public sealed class DataMaskingPolicy : IMessage<DataMaskingPolicy>, IEquatable<DataMaskingPolicy>, IDeepCloneable<DataMaskingPolicy>, IBufferMessage, IMessage
Reference documentation and code samples for the BigQuery Data Policy v1 API class DataMaskingPolicy.
The data masking policy that is used to specify data masking rule.
The name of the BigQuery routine that contains the custom masking
routine, in the format of
projects/{project_number}/datasets/{dataset_id}/routines/{routine_id}.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eDataMaskingPolicy\u003c/code\u003e class is 1.5.0, part of the Google.Cloud.BigQuery.DataPolicies.V1 API.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDataMaskingPolicy\u003c/code\u003e is a class used to define data masking rules, implementing interfaces like IMessage, IEquatable, and IDeepCloneable.\u003c/p\u003e\n"],["\u003cp\u003eThe class offers the ability to utilize either a predefined masking expression or a custom masking routine specified by name.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eDataMaskingPolicy\u003c/code\u003e class is found in the \u003ccode\u003eGoogle.Cloud.BigQuery.DataPolicies.V1\u003c/code\u003e namespace, within the \u003ccode\u003eGoogle.Cloud.BigQuery.DataPolicies.V1.dll\u003c/code\u003e assembly.\u003c/p\u003e\n"],["\u003cp\u003eThere are two constructors provided for the \u003ccode\u003eDataMaskingPolicy\u003c/code\u003e class; one is parameterless and the other allows for the creation of a new \u003ccode\u003eDataMaskingPolicy\u003c/code\u003e based on an existing one.\u003c/p\u003e\n"]]],[],null,["# BigQuery Data Policy v1 API - Class DataMaskingPolicy (1.5.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.5.0 (latest)](/dotnet/docs/reference/Google.Cloud.BigQuery.DataPolicies.V1/latest/Google.Cloud.BigQuery.DataPolicies.V1.DataMaskingPolicy)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.BigQuery.DataPolicies.V1/1.4.0/Google.Cloud.BigQuery.DataPolicies.V1.DataMaskingPolicy)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.BigQuery.DataPolicies.V1/1.3.0/Google.Cloud.BigQuery.DataPolicies.V1.DataMaskingPolicy)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.BigQuery.DataPolicies.V1/1.2.0/Google.Cloud.BigQuery.DataPolicies.V1.DataMaskingPolicy)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.BigQuery.DataPolicies.V1/1.1.0/Google.Cloud.BigQuery.DataPolicies.V1.DataMaskingPolicy)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.BigQuery.DataPolicies.V1/1.0.0/Google.Cloud.BigQuery.DataPolicies.V1.DataMaskingPolicy) \n\n public sealed class DataMaskingPolicy : IMessage\u003cDataMaskingPolicy\u003e, IEquatable\u003cDataMaskingPolicy\u003e, IDeepCloneable\u003cDataMaskingPolicy\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the BigQuery Data Policy v1 API class DataMaskingPolicy.\n\nThe data masking policy that is used to specify data masking rule. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e DataMaskingPolicy \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[DataMaskingPolicy](/dotnet/docs/reference/Google.Cloud.BigQuery.DataPolicies.V1/latest/Google.Cloud.BigQuery.DataPolicies.V1.DataMaskingPolicy), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[DataMaskingPolicy](/dotnet/docs/reference/Google.Cloud.BigQuery.DataPolicies.V1/latest/Google.Cloud.BigQuery.DataPolicies.V1.DataMaskingPolicy), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[DataMaskingPolicy](/dotnet/docs/reference/Google.Cloud.BigQuery.DataPolicies.V1/latest/Google.Cloud.BigQuery.DataPolicies.V1.DataMaskingPolicy), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.BigQuery.DataPolicies.V1](/dotnet/docs/reference/Google.Cloud.BigQuery.DataPolicies.V1/latest/Google.Cloud.BigQuery.DataPolicies.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.BigQuery.DataPolicies.V1.dll\n\nConstructors\n------------\n\n### DataMaskingPolicy()\n\n public DataMaskingPolicy()\n\n### DataMaskingPolicy(DataMaskingPolicy)\n\n public DataMaskingPolicy(DataMaskingPolicy other)\n\nProperties\n----------\n\n### HasPredefinedExpression\n\n public bool HasPredefinedExpression { get; }\n\nGets whether the \"predefined_expression\" field is set\n\n### HasRoutine\n\n public bool HasRoutine { get; }\n\nGets whether the \"routine\" field is set\n\n### MaskingExpressionCase\n\n public DataMaskingPolicy.MaskingExpressionOneofCase MaskingExpressionCase { get; }\n\n### PredefinedExpression\n\n public DataMaskingPolicy.Types.PredefinedExpression PredefinedExpression { get; set; }\n\nA predefined masking expression.\n\n### Routine\n\n public string Routine { get; set; }\n\nThe name of the BigQuery routine that contains the custom masking\nroutine, in the format of\n`projects/{project_number}/datasets/{dataset_id}/routines/{routine_id}`."]]