Skip to content

Commit 5296797

Browse files
gcf-owl-bot[bot]pearigeeshivanee-p
authored andcommitted
chore: [dlp] migrate generator to google-cloud-node (googleapis#7963)
* feat: added support for detecting key-value pairs in client provided metadata PiperOrigin-RevId: 895098649 Source-Link: googleapis/googleapis@544bab0 Source-Link: googleapis/googleapis-gen@676f5fc Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXByaXZhY3ktZGxwLy5Pd2xCb3QueWFtbCIsImgiOiI2NzZmNWZjNTkwZDU3N2I4OTkzYWE1ZmE2YjUwZjIyN2JmMzVmZTVhIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: migrate generator to google-cloud-node chore: update generator system tests PiperOrigin-RevId: 896174961 Source-Link: googleapis/googleapis@2233f63 Source-Link: googleapis/googleapis-gen@c4a8c4e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLXByaXZhY3ktZGxwLy5Pd2xCb3QueWFtbCIsImgiOiJjNGE4YzRlZWY5NTlhYTc0NGZiMWM2NzE0ODc1ZmEyOTVlMDZhYWQzIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Gabe Pearhill <86282859+pearigee@users.noreply.github.com> Co-authored-by: Shivanee <46910562+shivanee-p@users.noreply.github.com>
1 parent de89850 commit 5296797

6 files changed

Lines changed: 750 additions & 4 deletions

File tree

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"extends": "./node_modules/gts"
2+
"extends": "./node_modules/gts",
3+
"root": true
34
}

packages/google-privacy-dlp/protos/google/privacy/dlp/v2/dlp.proto

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,15 @@ message ContentItem {
13841384
// Content data to inspect or redact. Replaces `type` and `data`.
13851385
ByteContentItem byte_item = 5;
13861386
}
1387+
1388+
// User provided metadata for the content.
1389+
ContentMetadata content_metadata = 6;
1390+
}
1391+
1392+
// Metadata on content to be scanned.
1393+
message ContentMetadata {
1394+
// User provided key-value pairs of content metadata.
1395+
repeated KeyValueMetadataProperty properties = 2;
13871396
}
13881397

13891398
// Structured content to inspect. Up to 50,000 `Value`s per request allowed. See
@@ -1403,6 +1412,15 @@ message Table {
14031412
repeated Row rows = 2;
14041413
}
14051414

1415+
// A key-value pair in the Metadata.
1416+
message KeyValueMetadataProperty {
1417+
// The key of the property.
1418+
string key = 1;
1419+
1420+
// The value of the property.
1421+
string value = 2;
1422+
}
1423+
14061424
// All the findings for a single scanned item.
14071425
message InspectResult {
14081426
// List of findings for an item.
@@ -7478,6 +7496,9 @@ enum MetadataType {
74787496

74797497
// Metadata extracted from the files.
74807498
CONTENT_METADATA = 3;
7499+
7500+
// Metadata provided by the client.
7501+
CLIENT_PROVIDED_METADATA = 4;
74817502
}
74827503

74837504
// Parts of the APIs which use certain infoTypes.

packages/google-privacy-dlp/protos/protos.d.ts

Lines changed: 208 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2788,6 +2788,9 @@ export namespace google {
27882788

27892789
/** ContentItem byteItem */
27902790
byteItem?: (google.privacy.dlp.v2.IByteContentItem|null);
2791+
2792+
/** ContentItem contentMetadata */
2793+
contentMetadata?: (google.privacy.dlp.v2.IContentMetadata|null);
27912794
}
27922795

27932796
/** Represents a ContentItem. */
@@ -2808,6 +2811,9 @@ export namespace google {
28082811
/** ContentItem byteItem. */
28092812
public byteItem?: (google.privacy.dlp.v2.IByteContentItem|null);
28102813

2814+
/** ContentItem contentMetadata. */
2815+
public contentMetadata?: (google.privacy.dlp.v2.IContentMetadata|null);
2816+
28112817
/** ContentItem dataItem. */
28122818
public dataItem?: ("value"|"table"|"byteItem");
28132819

@@ -2889,6 +2895,103 @@ export namespace google {
28892895
public static getTypeUrl(typeUrlPrefix?: string): string;
28902896
}
28912897

2898+
/** Properties of a ContentMetadata. */
2899+
interface IContentMetadata {
2900+
2901+
/** ContentMetadata properties */
2902+
properties?: (google.privacy.dlp.v2.IKeyValueMetadataProperty[]|null);
2903+
}
2904+
2905+
/** Represents a ContentMetadata. */
2906+
class ContentMetadata implements IContentMetadata {
2907+
2908+
/**
2909+
* Constructs a new ContentMetadata.
2910+
* @param [properties] Properties to set
2911+
*/
2912+
constructor(properties?: google.privacy.dlp.v2.IContentMetadata);
2913+
2914+
/** ContentMetadata properties. */
2915+
public properties: google.privacy.dlp.v2.IKeyValueMetadataProperty[];
2916+
2917+
/**
2918+
* Creates a new ContentMetadata instance using the specified properties.
2919+
* @param [properties] Properties to set
2920+
* @returns ContentMetadata instance
2921+
*/
2922+
public static create(properties?: google.privacy.dlp.v2.IContentMetadata): google.privacy.dlp.v2.ContentMetadata;
2923+
2924+
/**
2925+
* Encodes the specified ContentMetadata message. Does not implicitly {@link google.privacy.dlp.v2.ContentMetadata.verify|verify} messages.
2926+
* @param message ContentMetadata message or plain object to encode
2927+
* @param [writer] Writer to encode to
2928+
* @returns Writer
2929+
*/
2930+
public static encode(message: google.privacy.dlp.v2.IContentMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
2931+
2932+
/**
2933+
* Encodes the specified ContentMetadata message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.ContentMetadata.verify|verify} messages.
2934+
* @param message ContentMetadata message or plain object to encode
2935+
* @param [writer] Writer to encode to
2936+
* @returns Writer
2937+
*/
2938+
public static encodeDelimited(message: google.privacy.dlp.v2.IContentMetadata, writer?: $protobuf.Writer): $protobuf.Writer;
2939+
2940+
/**
2941+
* Decodes a ContentMetadata message from the specified reader or buffer.
2942+
* @param reader Reader or buffer to decode from
2943+
* @param [length] Message length if known beforehand
2944+
* @returns ContentMetadata
2945+
* @throws {Error} If the payload is not a reader or valid buffer
2946+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
2947+
*/
2948+
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.privacy.dlp.v2.ContentMetadata;
2949+
2950+
/**
2951+
* Decodes a ContentMetadata message from the specified reader or buffer, length delimited.
2952+
* @param reader Reader or buffer to decode from
2953+
* @returns ContentMetadata
2954+
* @throws {Error} If the payload is not a reader or valid buffer
2955+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
2956+
*/
2957+
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.privacy.dlp.v2.ContentMetadata;
2958+
2959+
/**
2960+
* Verifies a ContentMetadata message.
2961+
* @param message Plain object to verify
2962+
* @returns `null` if valid, otherwise the reason why it is not
2963+
*/
2964+
public static verify(message: { [k: string]: any }): (string|null);
2965+
2966+
/**
2967+
* Creates a ContentMetadata message from a plain object. Also converts values to their respective internal types.
2968+
* @param object Plain object
2969+
* @returns ContentMetadata
2970+
*/
2971+
public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.ContentMetadata;
2972+
2973+
/**
2974+
* Creates a plain object from a ContentMetadata message. Also converts values to other types if specified.
2975+
* @param message ContentMetadata
2976+
* @param [options] Conversion options
2977+
* @returns Plain object
2978+
*/
2979+
public static toObject(message: google.privacy.dlp.v2.ContentMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any };
2980+
2981+
/**
2982+
* Converts this ContentMetadata to JSON.
2983+
* @returns JSON object
2984+
*/
2985+
public toJSON(): { [k: string]: any };
2986+
2987+
/**
2988+
* Gets the default type url for ContentMetadata
2989+
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
2990+
* @returns The default type url
2991+
*/
2992+
public static getTypeUrl(typeUrlPrefix?: string): string;
2993+
}
2994+
28922995
/** Properties of a Table. */
28932996
interface ITable {
28942997

@@ -3092,6 +3195,109 @@ export namespace google {
30923195
}
30933196
}
30943197

3198+
/** Properties of a KeyValueMetadataProperty. */
3199+
interface IKeyValueMetadataProperty {
3200+
3201+
/** KeyValueMetadataProperty key */
3202+
key?: (string|null);
3203+
3204+
/** KeyValueMetadataProperty value */
3205+
value?: (string|null);
3206+
}
3207+
3208+
/** Represents a KeyValueMetadataProperty. */
3209+
class KeyValueMetadataProperty implements IKeyValueMetadataProperty {
3210+
3211+
/**
3212+
* Constructs a new KeyValueMetadataProperty.
3213+
* @param [properties] Properties to set
3214+
*/
3215+
constructor(properties?: google.privacy.dlp.v2.IKeyValueMetadataProperty);
3216+
3217+
/** KeyValueMetadataProperty key. */
3218+
public key: string;
3219+
3220+
/** KeyValueMetadataProperty value. */
3221+
public value: string;
3222+
3223+
/**
3224+
* Creates a new KeyValueMetadataProperty instance using the specified properties.
3225+
* @param [properties] Properties to set
3226+
* @returns KeyValueMetadataProperty instance
3227+
*/
3228+
public static create(properties?: google.privacy.dlp.v2.IKeyValueMetadataProperty): google.privacy.dlp.v2.KeyValueMetadataProperty;
3229+
3230+
/**
3231+
* Encodes the specified KeyValueMetadataProperty message. Does not implicitly {@link google.privacy.dlp.v2.KeyValueMetadataProperty.verify|verify} messages.
3232+
* @param message KeyValueMetadataProperty message or plain object to encode
3233+
* @param [writer] Writer to encode to
3234+
* @returns Writer
3235+
*/
3236+
public static encode(message: google.privacy.dlp.v2.IKeyValueMetadataProperty, writer?: $protobuf.Writer): $protobuf.Writer;
3237+
3238+
/**
3239+
* Encodes the specified KeyValueMetadataProperty message, length delimited. Does not implicitly {@link google.privacy.dlp.v2.KeyValueMetadataProperty.verify|verify} messages.
3240+
* @param message KeyValueMetadataProperty message or plain object to encode
3241+
* @param [writer] Writer to encode to
3242+
* @returns Writer
3243+
*/
3244+
public static encodeDelimited(message: google.privacy.dlp.v2.IKeyValueMetadataProperty, writer?: $protobuf.Writer): $protobuf.Writer;
3245+
3246+
/**
3247+
* Decodes a KeyValueMetadataProperty message from the specified reader or buffer.
3248+
* @param reader Reader or buffer to decode from
3249+
* @param [length] Message length if known beforehand
3250+
* @returns KeyValueMetadataProperty
3251+
* @throws {Error} If the payload is not a reader or valid buffer
3252+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
3253+
*/
3254+
public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.privacy.dlp.v2.KeyValueMetadataProperty;
3255+
3256+
/**
3257+
* Decodes a KeyValueMetadataProperty message from the specified reader or buffer, length delimited.
3258+
* @param reader Reader or buffer to decode from
3259+
* @returns KeyValueMetadataProperty
3260+
* @throws {Error} If the payload is not a reader or valid buffer
3261+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
3262+
*/
3263+
public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.privacy.dlp.v2.KeyValueMetadataProperty;
3264+
3265+
/**
3266+
* Verifies a KeyValueMetadataProperty message.
3267+
* @param message Plain object to verify
3268+
* @returns `null` if valid, otherwise the reason why it is not
3269+
*/
3270+
public static verify(message: { [k: string]: any }): (string|null);
3271+
3272+
/**
3273+
* Creates a KeyValueMetadataProperty message from a plain object. Also converts values to their respective internal types.
3274+
* @param object Plain object
3275+
* @returns KeyValueMetadataProperty
3276+
*/
3277+
public static fromObject(object: { [k: string]: any }): google.privacy.dlp.v2.KeyValueMetadataProperty;
3278+
3279+
/**
3280+
* Creates a plain object from a KeyValueMetadataProperty message. Also converts values to other types if specified.
3281+
* @param message KeyValueMetadataProperty
3282+
* @param [options] Conversion options
3283+
* @returns Plain object
3284+
*/
3285+
public static toObject(message: google.privacy.dlp.v2.KeyValueMetadataProperty, options?: $protobuf.IConversionOptions): { [k: string]: any };
3286+
3287+
/**
3288+
* Converts this KeyValueMetadataProperty to JSON.
3289+
* @returns JSON object
3290+
*/
3291+
public toJSON(): { [k: string]: any };
3292+
3293+
/**
3294+
* Gets the default type url for KeyValueMetadataProperty
3295+
* @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
3296+
* @returns The default type url
3297+
*/
3298+
public static getTypeUrl(typeUrlPrefix?: string): string;
3299+
}
3300+
30953301
/** Properties of an InspectResult. */
30963302
interface IInspectResult {
30973303

@@ -32927,7 +33133,8 @@ export namespace google {
3292733133
enum MetadataType {
3292833134
METADATATYPE_UNSPECIFIED = 0,
3292933135
STORAGE_METADATA = 2,
32930-
CONTENT_METADATA = 3
33136+
CONTENT_METADATA = 3,
33137+
CLIENT_PROVIDED_METADATA = 4
3293133138
}
3293233139

3293333140
/** InfoTypeSupportedBy enum. */

0 commit comments

Comments
 (0)