github.com/jhump/protocompile@v0.0.0-20221021153901-4f6f732835e8/parser/testdata/largeproto.proto (about)

     1  // Copyright 2020 Google LLC
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  syntax = "proto3";
    16  
    17  package google.privacy.dlp.v2;
    18  
    19  import "google/api/client.proto";
    20  import "google/api/field_behavior.proto";
    21  import "google/api/resource.proto";
    22  import "google/privacy/dlp/v2/storage.proto";
    23  import "google/protobuf/duration.proto";
    24  import "google/protobuf/empty.proto";
    25  import "google/protobuf/field_mask.proto";
    26  import "google/protobuf/timestamp.proto";
    27  import "google/rpc/status.proto";
    28  import "google/type/date.proto";
    29  import "google/type/dayofweek.proto";
    30  import "google/type/timeofday.proto";
    31  import "google/api/annotations.proto";
    32  
    33  option csharp_namespace = "Google.Cloud.Dlp.V2";
    34  option go_package = "google.golang.org/genproto/googleapis/privacy/dlp/v2;dlp";
    35  option java_multiple_files = true;
    36  option java_outer_classname = "DlpProto";
    37  option java_package = "com.google.privacy.dlp.v2";
    38  option php_namespace = "Google\\Cloud\\Dlp\\V2";
    39  option ruby_package = "Google::Cloud::Dlp::V2";
    40  option (google.api.resource_definition) = {
    41    type: "dlp.googleapis.com/DlpContent"
    42    pattern: "projects/{project}/dlpContent"
    43    pattern: "projects/{project}/locations/{location}/dlpContent"
    44  };
    45  option (google.api.resource_definition) = {
    46    type: "dlp.googleapis.com/OrganizationLocation"
    47    pattern: "organizations/{organization}/locations/{location}"
    48  };
    49  
    50  // The Cloud Data Loss Prevention (DLP) API is a service that allows clients
    51  // to detect the presence of Personally Identifiable Information (PII) and other
    52  // privacy-sensitive data in user-supplied, unstructured data streams, like text
    53  // blocks or images.
    54  // The service also includes methods for sensitive data redaction and
    55  // scheduling of data scans on Google Cloud Platform based data sets.
    56  //
    57  // To learn more about concepts and find how-to guides see
    58  // https://cloud.google.com/dlp/docs/.
    59  service DlpService {
    60    option (google.api.default_host) = "dlp.googleapis.com";
    61    option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
    62  
    63    // Finds potentially sensitive info in content.
    64    // This method has limits on input size, processing time, and output size.
    65    //
    66    // When no InfoTypes or CustomInfoTypes are specified in this request, the
    67    // system will automatically choose what detectors to run. By default this may
    68    // be all types, but may change over time as detectors are updated.
    69    //
    70    // For how to guides, see https://cloud.google.com/dlp/docs/inspecting-images
    71    // and https://cloud.google.com/dlp/docs/inspecting-text,
    72    rpc InspectContent(InspectContentRequest) returns (InspectContentResponse) {
    73      option (google.api.http) = {
    74        post: "/v2/{parent=projects/*}/content:inspect"
    75        body: "*"
    76        additional_bindings {
    77          post: "/v2/{parent=projects/*/locations/*}/content:inspect"
    78          body: "*"
    79        }
    80      };
    81    }
    82  
    83    // Redacts potentially sensitive info from an image.
    84    // This method has limits on input size, processing time, and output size.
    85    // See https://cloud.google.com/dlp/docs/redacting-sensitive-data-images to
    86    // learn more.
    87    //
    88    // When no InfoTypes or CustomInfoTypes are specified in this request, the
    89    // system will automatically choose what detectors to run. By default this may
    90    // be all types, but may change over time as detectors are updated.
    91    rpc RedactImage(RedactImageRequest) returns (RedactImageResponse) {
    92      option (google.api.http) = {
    93        post: "/v2/{parent=projects/*}/image:redact"
    94        body: "*"
    95        additional_bindings {
    96          post: "/v2/{parent=projects/*/locations/*}/image:redact"
    97          body: "*"
    98        }
    99      };
   100    }
   101  
   102    // De-identifies potentially sensitive info from a ContentItem.
   103    // This method has limits on input size and output size.
   104    // See https://cloud.google.com/dlp/docs/deidentify-sensitive-data to
   105    // learn more.
   106    //
   107    // When no InfoTypes or CustomInfoTypes are specified in this request, the
   108    // system will automatically choose what detectors to run. By default this may
   109    // be all types, but may change over time as detectors are updated.
   110    rpc DeidentifyContent(DeidentifyContentRequest) returns (DeidentifyContentResponse) {
   111      option (google.api.http) = {
   112        post: "/v2/{parent=projects/*}/content:deidentify"
   113        body: "*"
   114        additional_bindings {
   115          post: "/v2/{parent=projects/*/locations/*}/content:deidentify"
   116          body: "*"
   117        }
   118      };
   119    }
   120  
   121    // Re-identifies content that has been de-identified.
   122    // See
   123    // https://cloud.google.com/dlp/docs/pseudonymization#re-identification_in_free_text_code_example
   124    // to learn more.
   125    rpc ReidentifyContent(ReidentifyContentRequest) returns (ReidentifyContentResponse) {
   126      option (google.api.http) = {
   127        post: "/v2/{parent=projects/*}/content:reidentify"
   128        body: "*"
   129        additional_bindings {
   130          post: "/v2/{parent=projects/*/locations/*}/content:reidentify"
   131          body: "*"
   132        }
   133      };
   134    }
   135  
   136    // Returns a list of the sensitive information types that the DLP API
   137    // supports. See https://cloud.google.com/dlp/docs/infotypes-reference to
   138    // learn more.
   139    rpc ListInfoTypes(ListInfoTypesRequest) returns (ListInfoTypesResponse) {
   140      option (google.api.http) = {
   141        get: "/v2/infoTypes"
   142        additional_bindings {
   143          get: "/v2/{parent=locations/*}/infoTypes"
   144        }
   145      };
   146      option (google.api.method_signature) = "parent";
   147    }
   148  
   149    // Creates an InspectTemplate for re-using frequently used configuration
   150    // for inspecting content, images, and storage.
   151    // See https://cloud.google.com/dlp/docs/creating-templates to learn more.
   152    rpc CreateInspectTemplate(CreateInspectTemplateRequest) returns (InspectTemplate) {
   153      option (google.api.http) = {
   154        post: "/v2/{parent=organizations/*}/inspectTemplates"
   155        body: "*"
   156        additional_bindings {
   157          post: "/v2/{parent=organizations/*/locations/*}/inspectTemplates"
   158          body: "*"
   159        }
   160        additional_bindings {
   161          post: "/v2/{parent=projects/*}/inspectTemplates"
   162          body: "*"
   163        }
   164        additional_bindings {
   165          post: "/v2/{parent=projects/*/locations/*}/inspectTemplates"
   166          body: "*"
   167        }
   168      };
   169      option (google.api.method_signature) = "parent,inspect_template";
   170    }
   171  
   172    // Updates the InspectTemplate.
   173    // See https://cloud.google.com/dlp/docs/creating-templates to learn more.
   174    rpc UpdateInspectTemplate(UpdateInspectTemplateRequest) returns (InspectTemplate) {
   175      option (google.api.http) = {
   176        patch: "/v2/{name=organizations/*/inspectTemplates/*}"
   177        body: "*"
   178        additional_bindings {
   179          patch: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}"
   180          body: "*"
   181        }
   182        additional_bindings {
   183          patch: "/v2/{name=projects/*/inspectTemplates/*}"
   184          body: "*"
   185        }
   186        additional_bindings {
   187          patch: "/v2/{name=projects/*/locations/*/inspectTemplates/*}"
   188          body: "*"
   189        }
   190      };
   191      option (google.api.method_signature) = "name,inspect_template,update_mask";
   192    }
   193  
   194    // Gets an InspectTemplate.
   195    // See https://cloud.google.com/dlp/docs/creating-templates to learn more.
   196    rpc GetInspectTemplate(GetInspectTemplateRequest) returns (InspectTemplate) {
   197      option (google.api.http) = {
   198        get: "/v2/{name=organizations/*/inspectTemplates/*}"
   199        additional_bindings {
   200          get: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}"
   201        }
   202        additional_bindings {
   203          get: "/v2/{name=projects/*/inspectTemplates/*}"
   204        }
   205        additional_bindings {
   206          get: "/v2/{name=projects/*/locations/*/inspectTemplates/*}"
   207        }
   208      };
   209      option (google.api.method_signature) = "name";
   210    }
   211  
   212    // Lists InspectTemplates.
   213    // See https://cloud.google.com/dlp/docs/creating-templates to learn more.
   214    rpc ListInspectTemplates(ListInspectTemplatesRequest) returns (ListInspectTemplatesResponse) {
   215      option (google.api.http) = {
   216        get: "/v2/{parent=organizations/*}/inspectTemplates"
   217        additional_bindings {
   218          get: "/v2/{parent=organizations/*/locations/*}/inspectTemplates"
   219        }
   220        additional_bindings {
   221          get: "/v2/{parent=projects/*}/inspectTemplates"
   222        }
   223        additional_bindings {
   224          get: "/v2/{parent=projects/*/locations/*}/inspectTemplates"
   225        }
   226      };
   227      option (google.api.method_signature) = "parent";
   228    }
   229  
   230    // Deletes an InspectTemplate.
   231    // See https://cloud.google.com/dlp/docs/creating-templates to learn more.
   232    rpc DeleteInspectTemplate(DeleteInspectTemplateRequest) returns (google.protobuf.Empty) {
   233      option (google.api.http) = {
   234        delete: "/v2/{name=organizations/*/inspectTemplates/*}"
   235        additional_bindings {
   236          delete: "/v2/{name=organizations/*/locations/*/inspectTemplates/*}"
   237        }
   238        additional_bindings {
   239          delete: "/v2/{name=projects/*/inspectTemplates/*}"
   240        }
   241        additional_bindings {
   242          delete: "/v2/{name=projects/*/locations/*/inspectTemplates/*}"
   243        }
   244      };
   245      option (google.api.method_signature) = "name";
   246    }
   247  
   248    // Creates a DeidentifyTemplate for re-using frequently used configuration
   249    // for de-identifying content, images, and storage.
   250    // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
   251    // more.
   252    rpc CreateDeidentifyTemplate(CreateDeidentifyTemplateRequest) returns (DeidentifyTemplate) {
   253      option (google.api.http) = {
   254        post: "/v2/{parent=organizations/*}/deidentifyTemplates"
   255        body: "*"
   256        additional_bindings {
   257          post: "/v2/{parent=organizations/*/locations/*}/deidentifyTemplates"
   258          body: "*"
   259        }
   260        additional_bindings {
   261          post: "/v2/{parent=projects/*}/deidentifyTemplates"
   262          body: "*"
   263        }
   264        additional_bindings {
   265          post: "/v2/{parent=projects/*/locations/*}/deidentifyTemplates"
   266          body: "*"
   267        }
   268      };
   269      option (google.api.method_signature) = "parent,deidentify_template";
   270    }
   271  
   272    // Updates the DeidentifyTemplate.
   273    // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
   274    // more.
   275    rpc UpdateDeidentifyTemplate(UpdateDeidentifyTemplateRequest) returns (DeidentifyTemplate) {
   276      option (google.api.http) = {
   277        patch: "/v2/{name=organizations/*/deidentifyTemplates/*}"
   278        body: "*"
   279        additional_bindings {
   280          patch: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}"
   281          body: "*"
   282        }
   283        additional_bindings {
   284          patch: "/v2/{name=projects/*/deidentifyTemplates/*}"
   285          body: "*"
   286        }
   287        additional_bindings {
   288          patch: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}"
   289          body: "*"
   290        }
   291      };
   292      option (google.api.method_signature) = "name,deidentify_template,update_mask";
   293    }
   294  
   295    // Gets a DeidentifyTemplate.
   296    // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
   297    // more.
   298    rpc GetDeidentifyTemplate(GetDeidentifyTemplateRequest) returns (DeidentifyTemplate) {
   299      option (google.api.http) = {
   300        get: "/v2/{name=organizations/*/deidentifyTemplates/*}"
   301        additional_bindings {
   302          get: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}"
   303        }
   304        additional_bindings {
   305          get: "/v2/{name=projects/*/deidentifyTemplates/*}"
   306        }
   307        additional_bindings {
   308          get: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}"
   309        }
   310      };
   311      option (google.api.method_signature) = "name";
   312    }
   313  
   314    // Lists DeidentifyTemplates.
   315    // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
   316    // more.
   317    rpc ListDeidentifyTemplates(ListDeidentifyTemplatesRequest) returns (ListDeidentifyTemplatesResponse) {
   318      option (google.api.http) = {
   319        get: "/v2/{parent=organizations/*}/deidentifyTemplates"
   320        additional_bindings {
   321          get: "/v2/{parent=organizations/*/locations/*}/deidentifyTemplates"
   322        }
   323        additional_bindings {
   324          get: "/v2/{parent=projects/*}/deidentifyTemplates"
   325        }
   326        additional_bindings {
   327          get: "/v2/{parent=projects/*/locations/*}/deidentifyTemplates"
   328        }
   329      };
   330      option (google.api.method_signature) = "parent";
   331    }
   332  
   333    // Deletes a DeidentifyTemplate.
   334    // See https://cloud.google.com/dlp/docs/creating-templates-deid to learn
   335    // more.
   336    rpc DeleteDeidentifyTemplate(DeleteDeidentifyTemplateRequest) returns (google.protobuf.Empty) {
   337      option (google.api.http) = {
   338        delete: "/v2/{name=organizations/*/deidentifyTemplates/*}"
   339        additional_bindings {
   340          delete: "/v2/{name=organizations/*/locations/*/deidentifyTemplates/*}"
   341        }
   342        additional_bindings {
   343          delete: "/v2/{name=projects/*/deidentifyTemplates/*}"
   344        }
   345        additional_bindings {
   346          delete: "/v2/{name=projects/*/locations/*/deidentifyTemplates/*}"
   347        }
   348      };
   349      option (google.api.method_signature) = "name";
   350    }
   351  
   352    // Creates a job trigger to run DLP actions such as scanning storage for
   353    // sensitive information on a set schedule.
   354    // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
   355    rpc CreateJobTrigger(CreateJobTriggerRequest) returns (JobTrigger) {
   356      option (google.api.http) = {
   357        post: "/v2/{parent=projects/*}/jobTriggers"
   358        body: "*"
   359        additional_bindings {
   360          post: "/v2/{parent=projects/*/locations/*}/jobTriggers"
   361          body: "*"
   362        }
   363      };
   364      option (google.api.method_signature) = "parent,job_trigger";
   365    }
   366  
   367    // Updates a job trigger.
   368    // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
   369    rpc UpdateJobTrigger(UpdateJobTriggerRequest) returns (JobTrigger) {
   370      option (google.api.http) = {
   371        patch: "/v2/{name=projects/*/jobTriggers/*}"
   372        body: "*"
   373        additional_bindings {
   374          patch: "/v2/{name=projects/*/locations/*/jobTriggers/*}"
   375          body: "*"
   376        }
   377      };
   378      option (google.api.method_signature) = "name,job_trigger,update_mask";
   379    }
   380  
   381    // Inspect hybrid content and store findings to a trigger. The inspection
   382    // will be processed asynchronously. To review the findings monitor the
   383    // jobs within the trigger.
   384    // Early access feature is in a pre-release state and might change or have
   385    // limited support. For more information, see
   386    // https://cloud.google.com/products#product-launch-stages.
   387    rpc HybridInspectJobTrigger(HybridInspectJobTriggerRequest) returns (HybridInspectResponse) {
   388      option (google.api.http) = {
   389        post: "/v2/{name=projects/*/locations/*/jobTriggers/*}:hybridInspect"
   390        body: "*"
   391      };
   392      option (google.api.method_signature) = "name";
   393    }
   394  
   395    // Gets a job trigger.
   396    // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
   397    rpc GetJobTrigger(GetJobTriggerRequest) returns (JobTrigger) {
   398      option (google.api.http) = {
   399        get: "/v2/{name=projects/*/jobTriggers/*}"
   400        additional_bindings {
   401          get: "/v2/{name=projects/*/locations/*/jobTriggers/*}"
   402        }
   403      };
   404      option (google.api.method_signature) = "name";
   405    }
   406  
   407    // Lists job triggers.
   408    // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
   409    rpc ListJobTriggers(ListJobTriggersRequest) returns (ListJobTriggersResponse) {
   410      option (google.api.http) = {
   411        get: "/v2/{parent=projects/*}/jobTriggers"
   412        additional_bindings {
   413          get: "/v2/{parent=projects/*/locations/*}/jobTriggers"
   414        }
   415      };
   416      option (google.api.method_signature) = "parent";
   417    }
   418  
   419    // Deletes a job trigger.
   420    // See https://cloud.google.com/dlp/docs/creating-job-triggers to learn more.
   421    rpc DeleteJobTrigger(DeleteJobTriggerRequest) returns (google.protobuf.Empty) {
   422      option (google.api.http) = {
   423        delete: "/v2/{name=projects/*/jobTriggers/*}"
   424        additional_bindings {
   425          delete: "/v2/{name=projects/*/locations/*/jobTriggers/*}"
   426        }
   427      };
   428      option (google.api.method_signature) = "name";
   429    }
   430  
   431    // Activate a job trigger. Causes the immediate execute of a trigger
   432    // instead of waiting on the trigger event to occur.
   433    rpc ActivateJobTrigger(ActivateJobTriggerRequest) returns (DlpJob) {
   434      option (google.api.http) = {
   435        post: "/v2/{name=projects/*/jobTriggers/*}:activate"
   436        body: "*"
   437        additional_bindings {
   438          post: "/v2/{name=projects/*/locations/*/jobTriggers/*}:activate"
   439          body: "*"
   440        }
   441      };
   442    }
   443  
   444    // Creates a new job to inspect storage or calculate risk metrics.
   445    // See https://cloud.google.com/dlp/docs/inspecting-storage and
   446    // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
   447    //
   448    // When no InfoTypes or CustomInfoTypes are specified in inspect jobs, the
   449    // system will automatically choose what detectors to run. By default this may
   450    // be all types, but may change over time as detectors are updated.
   451    rpc CreateDlpJob(CreateDlpJobRequest) returns (DlpJob) {
   452      option (google.api.http) = {
   453        post: "/v2/{parent=projects/*}/dlpJobs"
   454        body: "*"
   455        additional_bindings {
   456          post: "/v2/{parent=projects/*/locations/*}/dlpJobs"
   457          body: "*"
   458        }
   459      };
   460      option (google.api.method_signature) = "parent,inspect_job";
   461      option (google.api.method_signature) = "parent,risk_job";
   462    }
   463  
   464    // Lists DlpJobs that match the specified filter in the request.
   465    // See https://cloud.google.com/dlp/docs/inspecting-storage and
   466    // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
   467    rpc ListDlpJobs(ListDlpJobsRequest) returns (ListDlpJobsResponse) {
   468      option (google.api.http) = {
   469        get: "/v2/{parent=projects/*}/dlpJobs"
   470        additional_bindings {
   471          get: "/v2/{parent=projects/*/locations/*}/dlpJobs"
   472        }
   473      };
   474      option (google.api.method_signature) = "parent";
   475    }
   476  
   477    // Gets the latest state of a long-running DlpJob.
   478    // See https://cloud.google.com/dlp/docs/inspecting-storage and
   479    // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
   480    rpc GetDlpJob(GetDlpJobRequest) returns (DlpJob) {
   481      option (google.api.http) = {
   482        get: "/v2/{name=projects/*/dlpJobs/*}"
   483        additional_bindings {
   484          get: "/v2/{name=projects/*/locations/*/dlpJobs/*}"
   485        }
   486      };
   487      option (google.api.method_signature) = "name";
   488    }
   489  
   490    // Deletes a long-running DlpJob. This method indicates that the client is
   491    // no longer interested in the DlpJob result. The job will be cancelled if
   492    // possible.
   493    // See https://cloud.google.com/dlp/docs/inspecting-storage and
   494    // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
   495    rpc DeleteDlpJob(DeleteDlpJobRequest) returns (google.protobuf.Empty) {
   496      option (google.api.http) = {
   497        delete: "/v2/{name=projects/*/dlpJobs/*}"
   498        additional_bindings {
   499          delete: "/v2/{name=projects/*/locations/*/dlpJobs/*}"
   500        }
   501      };
   502      option (google.api.method_signature) = "name";
   503    }
   504  
   505    // Starts asynchronous cancellation on a long-running DlpJob. The server
   506    // makes a best effort to cancel the DlpJob, but success is not
   507    // guaranteed.
   508    // See https://cloud.google.com/dlp/docs/inspecting-storage and
   509    // https://cloud.google.com/dlp/docs/compute-risk-analysis to learn more.
   510    rpc CancelDlpJob(CancelDlpJobRequest) returns (google.protobuf.Empty) {
   511      option (google.api.http) = {
   512        post: "/v2/{name=projects/*/dlpJobs/*}:cancel"
   513        body: "*"
   514        additional_bindings {
   515          post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:cancel"
   516          body: "*"
   517        }
   518      };
   519    }
   520  
   521    // Creates a pre-built stored infoType to be used for inspection.
   522    // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
   523    // learn more.
   524    rpc CreateStoredInfoType(CreateStoredInfoTypeRequest) returns (StoredInfoType) {
   525      option (google.api.http) = {
   526        post: "/v2/{parent=organizations/*}/storedInfoTypes"
   527        body: "*"
   528        additional_bindings {
   529          post: "/v2/{parent=organizations/*/locations/*}/storedInfoTypes"
   530          body: "*"
   531        }
   532        additional_bindings {
   533          post: "/v2/{parent=projects/*}/storedInfoTypes"
   534          body: "*"
   535        }
   536        additional_bindings {
   537          post: "/v2/{parent=projects/*/locations/*}/storedInfoTypes"
   538          body: "*"
   539        }
   540      };
   541      option (google.api.method_signature) = "parent,config";
   542    }
   543  
   544    // Updates the stored infoType by creating a new version. The existing version
   545    // will continue to be used until the new version is ready.
   546    // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
   547    // learn more.
   548    rpc UpdateStoredInfoType(UpdateStoredInfoTypeRequest) returns (StoredInfoType) {
   549      option (google.api.http) = {
   550        patch: "/v2/{name=organizations/*/storedInfoTypes/*}"
   551        body: "*"
   552        additional_bindings {
   553          patch: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}"
   554          body: "*"
   555        }
   556        additional_bindings {
   557          patch: "/v2/{name=projects/*/storedInfoTypes/*}"
   558          body: "*"
   559        }
   560        additional_bindings {
   561          patch: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}"
   562          body: "*"
   563        }
   564      };
   565      option (google.api.method_signature) = "name,config,update_mask";
   566    }
   567  
   568    // Gets a stored infoType.
   569    // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
   570    // learn more.
   571    rpc GetStoredInfoType(GetStoredInfoTypeRequest) returns (StoredInfoType) {
   572      option (google.api.http) = {
   573        get: "/v2/{name=organizations/*/storedInfoTypes/*}"
   574        additional_bindings {
   575          get: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}"
   576        }
   577        additional_bindings {
   578          get: "/v2/{name=projects/*/storedInfoTypes/*}"
   579        }
   580        additional_bindings {
   581          get: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}"
   582        }
   583      };
   584      option (google.api.method_signature) = "name";
   585    }
   586  
   587    // Lists stored infoTypes.
   588    // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
   589    // learn more.
   590    rpc ListStoredInfoTypes(ListStoredInfoTypesRequest) returns (ListStoredInfoTypesResponse) {
   591      option (google.api.http) = {
   592        get: "/v2/{parent=organizations/*}/storedInfoTypes"
   593        additional_bindings {
   594          get: "/v2/{parent=organizations/*/locations/*}/storedInfoTypes"
   595        }
   596        additional_bindings {
   597          get: "/v2/{parent=projects/*}/storedInfoTypes"
   598        }
   599        additional_bindings {
   600          get: "/v2/{parent=projects/*/locations/*}/storedInfoTypes"
   601        }
   602      };
   603      option (google.api.method_signature) = "parent";
   604    }
   605  
   606    // Deletes a stored infoType.
   607    // See https://cloud.google.com/dlp/docs/creating-stored-infotypes to
   608    // learn more.
   609    rpc DeleteStoredInfoType(DeleteStoredInfoTypeRequest) returns (google.protobuf.Empty) {
   610      option (google.api.http) = {
   611        delete: "/v2/{name=organizations/*/storedInfoTypes/*}"
   612        additional_bindings {
   613          delete: "/v2/{name=organizations/*/locations/*/storedInfoTypes/*}"
   614        }
   615        additional_bindings {
   616          delete: "/v2/{name=projects/*/storedInfoTypes/*}"
   617        }
   618        additional_bindings {
   619          delete: "/v2/{name=projects/*/locations/*/storedInfoTypes/*}"
   620        }
   621      };
   622      option (google.api.method_signature) = "name";
   623    }
   624  
   625    // Inspect hybrid content and store findings to a job.
   626    // To review the findings inspect the job. Inspection will occur
   627    // asynchronously.
   628    // Early access feature is in a pre-release state and might change or have
   629    // limited support. For more information, see
   630    // https://cloud.google.com/products#product-launch-stages.
   631    rpc HybridInspectDlpJob(HybridInspectDlpJobRequest) returns (HybridInspectResponse) {
   632      option (google.api.http) = {
   633        post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:hybridInspect"
   634        body: "*"
   635      };
   636      option (google.api.method_signature) = "name";
   637    }
   638  
   639    // Finish a running hybrid DlpJob. Triggers the finalization steps and running
   640    // of any enabled actions that have not yet run.
   641    // Early access feature is in a pre-release state and might change or have
   642    // limited support. For more information, see
   643    // https://cloud.google.com/products#product-launch-stages.
   644    rpc FinishDlpJob(FinishDlpJobRequest) returns (google.protobuf.Empty) {
   645      option (google.api.http) = {
   646        post: "/v2/{name=projects/*/locations/*/dlpJobs/*}:finish"
   647        body: "*"
   648      };
   649    }
   650  }
   651  
   652  // List of exclude infoTypes.
   653  message ExcludeInfoTypes {
   654    // InfoType list in ExclusionRule rule drops a finding when it overlaps or
   655    // contained within with a finding of an infoType from this list. For
   656    // example, for `InspectionRuleSet.info_types` containing "PHONE_NUMBER"` and
   657    // `exclusion_rule` containing `exclude_info_types.info_types` with
   658    // "EMAIL_ADDRESS" the phone number findings are dropped if they overlap
   659    // with EMAIL_ADDRESS finding.
   660    // That leads to "555-222-2222@example.org" to generate only a single
   661    // finding, namely email address.
   662    repeated InfoType info_types = 1;
   663  }
   664  
   665  // The rule that specifies conditions when findings of infoTypes specified in
   666  // `InspectionRuleSet` are removed from results.
   667  message ExclusionRule {
   668    // Exclusion rule types.
   669    oneof type {
   670      // Dictionary which defines the rule.
   671      CustomInfoType.Dictionary dictionary = 1;
   672  
   673      // Regular expression which defines the rule.
   674      CustomInfoType.Regex regex = 2;
   675  
   676      // Set of infoTypes for which findings would affect this rule.
   677      ExcludeInfoTypes exclude_info_types = 3;
   678    }
   679  
   680    // How the rule is applied, see MatchingType documentation for details.
   681    MatchingType matching_type = 4;
   682  }
   683  
   684  // A single inspection rule to be applied to infoTypes, specified in
   685  // `InspectionRuleSet`.
   686  message InspectionRule {
   687    // Inspection rule types.
   688    oneof type {
   689      // Hotword-based detection rule.
   690      CustomInfoType.DetectionRule.HotwordRule hotword_rule = 1;
   691  
   692      // Exclusion rule.
   693      ExclusionRule exclusion_rule = 2;
   694    }
   695  }
   696  
   697  // Rule set for modifying a set of infoTypes to alter behavior under certain
   698  // circumstances, depending on the specific details of the rules within the set.
   699  message InspectionRuleSet {
   700    // List of infoTypes this rule set is applied to.
   701    repeated InfoType info_types = 1;
   702  
   703    // Set of rules to be applied to infoTypes. The rules are applied in order.
   704    repeated InspectionRule rules = 2;
   705  }
   706  
   707  // Configuration description of the scanning process.
   708  // When used with redactContent only info_types and min_likelihood are currently
   709  // used.
   710  message InspectConfig {
   711    // Configuration to control the number of findings returned.
   712    message FindingLimits {
   713      // Max findings configuration per infoType, per content item or long
   714      // running DlpJob.
   715      message InfoTypeLimit {
   716        // Type of information the findings limit applies to. Only one limit per
   717        // info_type should be provided. If InfoTypeLimit does not have an
   718        // info_type, the DLP API applies the limit against all info_types that
   719        // are found but not specified in another InfoTypeLimit.
   720        InfoType info_type = 1;
   721  
   722        // Max findings limit for the given infoType.
   723        int32 max_findings = 2;
   724      }
   725  
   726      // Max number of findings that will be returned for each item scanned.
   727      // When set within `InspectJobConfig`,
   728      // the maximum returned is 2000 regardless if this is set higher.
   729      // When set within `InspectContentRequest`, this field is ignored.
   730      int32 max_findings_per_item = 1;
   731  
   732      // Max number of findings that will be returned per request/job.
   733      // When set within `InspectContentRequest`, the maximum returned is 2000
   734      // regardless if this is set higher.
   735      int32 max_findings_per_request = 2;
   736  
   737      // Configuration of findings limit given for specified infoTypes.
   738      repeated InfoTypeLimit max_findings_per_info_type = 3;
   739    }
   740  
   741    // Restricts what info_types to look for. The values must correspond to
   742    // InfoType values returned by ListInfoTypes or listed at
   743    // https://cloud.google.com/dlp/docs/infotypes-reference.
   744    //
   745    // When no InfoTypes or CustomInfoTypes are specified in a request, the
   746    // system may automatically choose what detectors to run. By default this may
   747    // be all types, but may change over time as detectors are updated.
   748    //
   749    // If you need precise control and predictability as to what detectors are
   750    // run you should specify specific InfoTypes listed in the reference,
   751    // otherwise a default list will be used, which may change over time.
   752    repeated InfoType info_types = 1;
   753  
   754    // Only returns findings equal or above this threshold. The default is
   755    // POSSIBLE.
   756    // See https://cloud.google.com/dlp/docs/likelihood to learn more.
   757    Likelihood min_likelihood = 2;
   758  
   759    // Configuration to control the number of findings returned.
   760    FindingLimits limits = 3;
   761  
   762    // When true, a contextual quote from the data that triggered a finding is
   763    // included in the response; see Finding.quote.
   764    bool include_quote = 4;
   765  
   766    // When true, excludes type information of the findings.
   767    bool exclude_info_types = 5;
   768  
   769    // CustomInfoTypes provided by the user. See
   770    // https://cloud.google.com/dlp/docs/creating-custom-infotypes to learn more.
   771    repeated CustomInfoType custom_info_types = 6;
   772  
   773    // List of options defining data content to scan.
   774    // If empty, text, images, and other content will be included.
   775    repeated ContentOption content_options = 8;
   776  
   777    // Set of rules to apply to the findings for this InspectConfig.
   778    // Exclusion rules, contained in the set are executed in the end, other
   779    // rules are executed in the order they are specified for each info type.
   780    repeated InspectionRuleSet rule_set = 10;
   781  }
   782  
   783  // Container for bytes to inspect or redact.
   784  message ByteContentItem {
   785    // The type of data being sent for inspection.
   786    enum BytesType {
   787      // Unused
   788      BYTES_TYPE_UNSPECIFIED = 0;
   789  
   790      // Any image type.
   791      IMAGE = 6;
   792  
   793      // jpeg
   794      IMAGE_JPEG = 1;
   795  
   796      // bmp
   797      IMAGE_BMP = 2;
   798  
   799      // png
   800      IMAGE_PNG = 3;
   801  
   802      // svg
   803      IMAGE_SVG = 4;
   804  
   805      // plain text
   806      TEXT_UTF8 = 5;
   807  
   808      // docx, docm, dotx, dotm
   809      WORD_DOCUMENT = 7;
   810  
   811      // pdf
   812      PDF = 8;
   813  
   814      // avro
   815      AVRO = 11;
   816  
   817      // csv
   818      CSV = 12;
   819  
   820      // tsv
   821      TSV = 13;
   822    }
   823  
   824    // The type of data stored in the bytes string. Default will be TEXT_UTF8.
   825    BytesType type = 1;
   826  
   827    // Content data to inspect or redact.
   828    bytes data = 2;
   829  }
   830  
   831  // Container structure for the content to inspect.
   832  message ContentItem {
   833    // Data of the item either in the byte array or UTF-8 string form, or table.
   834    oneof data_item {
   835      // String data to inspect or redact.
   836      string value = 3;
   837  
   838      // Structured content for inspection. See
   839      // https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table to
   840      // learn more.
   841      Table table = 4;
   842  
   843      // Content data to inspect or redact. Replaces `type` and `data`.
   844      ByteContentItem byte_item = 5;
   845    }
   846  }
   847  
   848  // Structured content to inspect. Up to 50,000 `Value`s per request allowed.
   849  // See https://cloud.google.com/dlp/docs/inspecting-text#inspecting_a_table to
   850  // learn more.
   851  message Table {
   852    // Values of the row.
   853    message Row {
   854      // Individual cells.
   855      repeated Value values = 1;
   856    }
   857  
   858    // Headers of the table.
   859    repeated FieldId headers = 1;
   860  
   861    // Rows of the table.
   862    repeated Row rows = 2;
   863  }
   864  
   865  // All the findings for a single scanned item.
   866  message InspectResult {
   867    // List of findings for an item.
   868    repeated Finding findings = 1;
   869  
   870    // If true, then this item might have more findings than were returned,
   871    // and the findings returned are an arbitrary subset of all findings.
   872    // The findings list might be truncated because the input items were too
   873    // large, or because the server reached the maximum amount of resources
   874    // allowed for a single API call. For best results, divide the input into
   875    // smaller batches.
   876    bool findings_truncated = 2;
   877  }
   878  
   879  // Represents a piece of potentially sensitive content.
   880  message Finding {
   881    option (google.api.resource) = {
   882      type: "dlp.googleapis.com/Finding"
   883      pattern: "projects/{project}/locations/{location}/findings/{finding}"
   884    };
   885  
   886    // Resource name in format
   887    // projects/{project}/locations/{location}/findings/{finding} Populated only
   888    // when viewing persisted findings.
   889    string name = 14;
   890  
   891    // The content that was found. Even if the content is not textual, it
   892    // may be converted to a textual representation here.
   893    // Provided if `include_quote` is true and the finding is
   894    // less than or equal to 4096 bytes long. If the finding exceeds 4096 bytes
   895    // in length, the quote may be omitted.
   896    string quote = 1;
   897  
   898    // The type of content that might have been found.
   899    // Provided if `excluded_types` is false.
   900    InfoType info_type = 2;
   901  
   902    // Confidence of how likely it is that the `info_type` is correct.
   903    Likelihood likelihood = 3;
   904  
   905    // Where the content was found.
   906    Location location = 4;
   907  
   908    // Timestamp when finding was detected.
   909    google.protobuf.Timestamp create_time = 6;
   910  
   911    // Contains data parsed from quotes. Only populated if include_quote was set
   912    // to true and a supported infoType was requested. Currently supported
   913    // infoTypes: DATE, DATE_OF_BIRTH and TIME.
   914    QuoteInfo quote_info = 7;
   915  
   916    // The job that stored the finding.
   917    string resource_name = 8 [(google.api.resource_reference) = {
   918                                type: "dlp.googleapis.com/DlpJob"
   919                              }];
   920  
   921    // Job trigger name, if applicable, for this finding.
   922    string trigger_name = 9 [(google.api.resource_reference) = {
   923                               type: "dlp.googleapis.com/JobTrigger"
   924                             }];
   925  
   926    // The labels associated with this `Finding`.
   927    //
   928    // Label keys must be between 1 and 63 characters long and must conform
   929    // to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
   930    //
   931    // Label values must be between 0 and 63 characters long and must conform
   932    // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
   933    //
   934    // No more than 10 labels can be associated with a given finding.
   935    //
   936    // Examples:
   937    // * `"environment" : "production"`
   938    // * `"pipeline" : "etl"`
   939    map<string, string> labels = 10;
   940  
   941    // Time the job started that produced this finding.
   942    google.protobuf.Timestamp job_create_time = 11;
   943  
   944    // The job that stored the finding.
   945    string job_name = 13 [(google.api.resource_reference) = {
   946                            type: "dlp.googleapis.com/DlpJob"
   947                          }];
   948  }
   949  
   950  // Specifies the location of the finding.
   951  message Location {
   952    // Zero-based byte offsets delimiting the finding.
   953    // These are relative to the finding's containing element.
   954    // Note that when the content is not textual, this references
   955    // the UTF-8 encoded textual representation of the content.
   956    // Omitted if content is an image.
   957    Range byte_range = 1;
   958  
   959    // Unicode character offsets delimiting the finding.
   960    // These are relative to the finding's containing element.
   961    // Provided when the content is text.
   962    Range codepoint_range = 2;
   963  
   964    // List of nested objects pointing to the precise location of the finding
   965    // within the file or record.
   966    repeated ContentLocation content_locations = 7;
   967  
   968    // Information about the container where this finding occurred, if available.
   969    Container container = 8;
   970  }
   971  
   972  // Precise location of the finding within a document, record, image, or metadata
   973  // container.
   974  message ContentLocation {
   975    // Name of the container where the finding is located.
   976    // The top level name is the source file name or table name. Names of some
   977    // common storage containers are formatted as follows:
   978    //
   979    // * BigQuery tables:  `{project_id}:{dataset_id}.{table_id}`
   980    // * Cloud Storage files: `gs://{bucket}/{path}`
   981    // * Datastore namespace: {namespace}
   982    //
   983    // Nested names could be absent if the embedded object has no string
   984    // identifier (for an example an image contained within a document).
   985    string container_name = 1;
   986  
   987    // Type of the container within the file with location of the finding.
   988    oneof location {
   989      // Location within a row or record of a database table.
   990      RecordLocation record_location = 2;
   991  
   992      // Location within an image's pixels.
   993      ImageLocation image_location = 3;
   994  
   995      // Location data for document files.
   996      DocumentLocation document_location = 5;
   997  
   998      // Location within the metadata for inspected content.
   999      MetadataLocation metadata_location = 8;
  1000    }
  1001  
  1002    // Findings container modification timestamp, if applicable.
  1003    // For Google Cloud Storage contains last file modification timestamp.
  1004    // For BigQuery table contains last_modified_time property.
  1005    // For Datastore - not populated.
  1006    google.protobuf.Timestamp container_timestamp = 6;
  1007  
  1008    // Findings container version, if available
  1009    // ("generation" for Google Cloud Storage).
  1010    string container_version = 7;
  1011  }
  1012  
  1013  // Metadata Location
  1014  message MetadataLocation {
  1015    // Type of metadata containing the finding.
  1016    MetadataType type = 1;
  1017  
  1018    // Label of the piece of metadata containing the finding, for example -
  1019    // latitude, author, caption.
  1020    oneof label {
  1021      // Storage metadata.
  1022      StorageMetadataLabel storage_label = 3;
  1023    }
  1024  }
  1025  
  1026  // Storage metadata label to indicate which metadata entry contains findings.
  1027  message StorageMetadataLabel {
  1028    string key = 1;
  1029  }
  1030  
  1031  // Location of a finding within a document.
  1032  message DocumentLocation {
  1033    // Offset of the line, from the beginning of the file, where the finding
  1034    // is located.
  1035    int64 file_offset = 1;
  1036  }
  1037  
  1038  // Location of a finding within a row or record.
  1039  message RecordLocation {
  1040    // Key of the finding.
  1041    RecordKey record_key = 1;
  1042  
  1043    // Field id of the field containing the finding.
  1044    FieldId field_id = 2;
  1045  
  1046    // Location within a `ContentItem.Table`.
  1047    TableLocation table_location = 3;
  1048  }
  1049  
  1050  // Location of a finding within a table.
  1051  message TableLocation {
  1052    // The zero-based index of the row where the finding is located. Only
  1053    // populated for resources that have a natural ordering, not BigQuery. In
  1054    // BigQuery, to identify the row a finding came from, populate
  1055    // BigQueryOptions.identifying_fields with your primary key column names and
  1056    // when you store the findings the value of those columns will be stored
  1057    // inside of Finding.
  1058    int64 row_index = 1;
  1059  }
  1060  
  1061  // Represents a container that may contain DLP findings.
  1062  // Examples of a container include a file, table, or database record.
  1063  message Container {
  1064    // Container type, for example BigQuery or Google Cloud Storage.
  1065    string type = 1;
  1066  
  1067    // Project where the finding was found.
  1068    // Can be different from the project that owns the finding.
  1069    string project_id = 2;
  1070  
  1071    // A string representation of the full container name.
  1072    // Examples:
  1073    // - BigQuery: 'Project:DataSetId.TableId'
  1074    // - Google Cloud Storage: 'gs://Bucket/folders/filename.txt'
  1075    string full_path = 3;
  1076  
  1077    // The root of the container.
  1078    // Examples:
  1079    // - For BigQuery table `project_id:dataset_id.table_id`, the root is
  1080    //  `dataset_id`
  1081    // - For Google Cloud Storage file `gs://bucket/folder/filename.txt`, the root
  1082    //  is `gs://bucket`
  1083    string root_path = 4;
  1084  
  1085    // The rest of the path after the root.
  1086    // Examples:
  1087    // - For BigQuery table `project_id:dataset_id.table_id`, the relative path is
  1088    //  `table_id`
  1089    // - Google Cloud Storage file `gs://bucket/folder/filename.txt`, the relative
  1090    //  path is `folder/filename.txt`
  1091    string relative_path = 5;
  1092  
  1093    // Findings container modification timestamp, if applicable.
  1094    // For Google Cloud Storage contains last file modification timestamp.
  1095    // For BigQuery table contains last_modified_time property.
  1096    // For Datastore - not populated.
  1097    google.protobuf.Timestamp update_time = 6;
  1098  
  1099    // Findings container version, if available
  1100    // ("generation" for Google Cloud Storage).
  1101    string version = 7;
  1102  }
  1103  
  1104  // Generic half-open interval [start, end)
  1105  message Range {
  1106    // Index of the first character of the range (inclusive).
  1107    int64 start = 1;
  1108  
  1109    // Index of the last character of the range (exclusive).
  1110    int64 end = 2;
  1111  }
  1112  
  1113  // Location of the finding within an image.
  1114  message ImageLocation {
  1115    // Bounding boxes locating the pixels within the image containing the finding.
  1116    repeated BoundingBox bounding_boxes = 1;
  1117  }
  1118  
  1119  // Bounding box encompassing detected text within an image.
  1120  message BoundingBox {
  1121    // Top coordinate of the bounding box. (0,0) is upper left.
  1122    int32 top = 1;
  1123  
  1124    // Left coordinate of the bounding box. (0,0) is upper left.
  1125    int32 left = 2;
  1126  
  1127    // Width of the bounding box in pixels.
  1128    int32 width = 3;
  1129  
  1130    // Height of the bounding box in pixels.
  1131    int32 height = 4;
  1132  }
  1133  
  1134  // Request to search for potentially sensitive info in an image and redact it
  1135  // by covering it with a colored rectangle.
  1136  message RedactImageRequest {
  1137    // Configuration for determining how redaction of images should occur.
  1138    message ImageRedactionConfig {
  1139      // Type of information to redact from images.
  1140      oneof target {
  1141        // Only one per info_type should be provided per request. If not
  1142        // specified, and redact_all_text is false, the DLP API will redact all
  1143        // text that it matches against all info_types that are found, but not
  1144        // specified in another ImageRedactionConfig.
  1145        InfoType info_type = 1;
  1146  
  1147        // If true, all text found in the image, regardless whether it matches an
  1148        // info_type, is redacted. Only one should be provided.
  1149        bool redact_all_text = 2;
  1150      }
  1151  
  1152      // The color to use when redacting content from an image. If not specified,
  1153      // the default is black.
  1154      Color redaction_color = 3;
  1155    }
  1156  
  1157    // Parent resource name.
  1158    //
  1159    // The format of this value varies depending on whether you have [specified a
  1160    // processing
  1161    // location](https://cloud.google.com/dlp/docs/specifying-location):
  1162    //
  1163    // + Projects scope, location specified:<br/>
  1164    //   `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  1165    // + Projects scope, no location specified (defaults to global):<br/>
  1166    //   `projects/`<var>PROJECT_ID</var>
  1167    //
  1168    // The following example `parent` string specifies a parent project with the
  1169    // identifier `example-project`, and specifies the `europe-west3` location
  1170    // for processing data:
  1171    //
  1172    //     parent=projects/example-project/locations/europe-west3
  1173    string parent = 1 [(google.api.resource_reference) = {
  1174                         child_type: "dlp.googleapis.com/DlpContent"
  1175                       }];
  1176  
  1177    // Deprecated. This field has no effect.
  1178    string location_id = 8;
  1179  
  1180    // Configuration for the inspector.
  1181    InspectConfig inspect_config = 2;
  1182  
  1183    // The configuration for specifying what content to redact from images.
  1184    repeated ImageRedactionConfig image_redaction_configs = 5;
  1185  
  1186    // Whether the response should include findings along with the redacted
  1187    // image.
  1188    bool include_findings = 6;
  1189  
  1190    // The content must be PNG, JPEG, SVG or BMP.
  1191    ByteContentItem byte_item = 7;
  1192  }
  1193  
  1194  // Represents a color in the RGB color space.
  1195  message Color {
  1196    // The amount of red in the color as a value in the interval [0, 1].
  1197    float red = 1;
  1198  
  1199    // The amount of green in the color as a value in the interval [0, 1].
  1200    float green = 2;
  1201  
  1202    // The amount of blue in the color as a value in the interval [0, 1].
  1203    float blue = 3;
  1204  }
  1205  
  1206  // Results of redacting an image.
  1207  message RedactImageResponse {
  1208    // The redacted image. The type will be the same as the original image.
  1209    bytes redacted_image = 1;
  1210  
  1211    // If an image was being inspected and the InspectConfig's include_quote was
  1212    // set to true, then this field will include all text, if any, that was found
  1213    // in the image.
  1214    string extracted_text = 2;
  1215  
  1216    // The findings. Populated when include_findings in the request is true.
  1217    InspectResult inspect_result = 3;
  1218  }
  1219  
  1220  // Request to de-identify a list of items.
  1221  message DeidentifyContentRequest {
  1222    // Parent resource name.
  1223    //
  1224    // The format of this value varies depending on whether you have [specified a
  1225    // processing
  1226    // location](https://cloud.google.com/dlp/docs/specifying-location):
  1227    //
  1228    // + Projects scope, location specified:<br/>
  1229    //   `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  1230    // + Projects scope, no location specified (defaults to global):<br/>
  1231    //   `projects/`<var>PROJECT_ID</var>
  1232    //
  1233    // The following example `parent` string specifies a parent project with the
  1234    // identifier `example-project`, and specifies the `europe-west3` location
  1235    // for processing data:
  1236    //
  1237    //     parent=projects/example-project/locations/europe-west3
  1238    string parent = 1 [(google.api.resource_reference) = {
  1239                         child_type: "dlp.googleapis.com/DlpContent"
  1240                       }];
  1241  
  1242    // Configuration for the de-identification of the content item.
  1243    // Items specified here will override the template referenced by the
  1244    // deidentify_template_name argument.
  1245    DeidentifyConfig deidentify_config = 2;
  1246  
  1247    // Configuration for the inspector.
  1248    // Items specified here will override the template referenced by the
  1249    // inspect_template_name argument.
  1250    InspectConfig inspect_config = 3;
  1251  
  1252    // The item to de-identify. Will be treated as text.
  1253    ContentItem item = 4;
  1254  
  1255    // Template to use. Any configuration directly specified in
  1256    // inspect_config will override those set in the template. Singular fields
  1257    // that are set in this request will replace their corresponding fields in the
  1258    // template. Repeated fields are appended. Singular sub-messages and groups
  1259    // are recursively merged.
  1260    string inspect_template_name = 5;
  1261  
  1262    // Template to use. Any configuration directly specified in
  1263    // deidentify_config will override those set in the template. Singular fields
  1264    // that are set in this request will replace their corresponding fields in the
  1265    // template. Repeated fields are appended. Singular sub-messages and groups
  1266    // are recursively merged.
  1267    string deidentify_template_name = 6;
  1268  
  1269    // Deprecated. This field has no effect.
  1270    string location_id = 7;
  1271  }
  1272  
  1273  // Results of de-identifying a ContentItem.
  1274  message DeidentifyContentResponse {
  1275    // The de-identified item.
  1276    ContentItem item = 1;
  1277  
  1278    // An overview of the changes that were made on the `item`.
  1279    TransformationOverview overview = 2;
  1280  }
  1281  
  1282  // Request to re-identify an item.
  1283  message ReidentifyContentRequest {
  1284    // Required. Parent resource name.
  1285    //
  1286    // The format of this value varies depending on whether you have [specified a
  1287    // processing
  1288    // location](https://cloud.google.com/dlp/docs/specifying-location):
  1289    //
  1290    // + Projects scope, location specified:<br/>
  1291    //   `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  1292    // + Projects scope, no location specified (defaults to global):<br/>
  1293    //   `projects/`<var>PROJECT_ID</var>
  1294    //
  1295    // The following example `parent` string specifies a parent project with the
  1296    // identifier `example-project`, and specifies the `europe-west3` location
  1297    // for processing data:
  1298    //
  1299    //     parent=projects/example-project/locations/europe-west3
  1300    string parent = 1 [
  1301      (google.api.field_behavior) = REQUIRED,
  1302      (google.api.resource_reference) = {
  1303        child_type: "dlp.googleapis.com/DlpContent"
  1304      }
  1305    ];
  1306  
  1307    // Configuration for the re-identification of the content item.
  1308    // This field shares the same proto message type that is used for
  1309    // de-identification, however its usage here is for the reversal of the
  1310    // previous de-identification. Re-identification is performed by examining
  1311    // the transformations used to de-identify the items and executing the
  1312    // reverse. This requires that only reversible transformations
  1313    // be provided here. The reversible transformations are:
  1314    //
  1315    //  - `CryptoDeterministicConfig`
  1316    //  - `CryptoReplaceFfxFpeConfig`
  1317    DeidentifyConfig reidentify_config = 2;
  1318  
  1319    // Configuration for the inspector.
  1320    InspectConfig inspect_config = 3;
  1321  
  1322    // The item to re-identify. Will be treated as text.
  1323    ContentItem item = 4;
  1324  
  1325    // Template to use. Any configuration directly specified in
  1326    // `inspect_config` will override those set in the template. Singular fields
  1327    // that are set in this request will replace their corresponding fields in the
  1328    // template. Repeated fields are appended. Singular sub-messages and groups
  1329    // are recursively merged.
  1330    string inspect_template_name = 5;
  1331  
  1332    // Template to use. References an instance of `DeidentifyTemplate`.
  1333    // Any configuration directly specified in `reidentify_config` or
  1334    // `inspect_config` will override those set in the template. The
  1335    // `DeidentifyTemplate` used must include only reversible transformations.
  1336    // Singular fields that are set in this request will replace their
  1337    // corresponding fields in the template. Repeated fields are appended.
  1338    // Singular sub-messages and groups are recursively merged.
  1339    string reidentify_template_name = 6;
  1340  
  1341    // Deprecated. This field has no effect.
  1342    string location_id = 7;
  1343  }
  1344  
  1345  // Results of re-identifying a item.
  1346  message ReidentifyContentResponse {
  1347    // The re-identified item.
  1348    ContentItem item = 1;
  1349  
  1350    // An overview of the changes that were made to the `item`.
  1351    TransformationOverview overview = 2;
  1352  }
  1353  
  1354  // Request to search for potentially sensitive info in a ContentItem.
  1355  message InspectContentRequest {
  1356    // Parent resource name.
  1357    //
  1358    // The format of this value varies depending on whether you have [specified a
  1359    // processing
  1360    // location](https://cloud.google.com/dlp/docs/specifying-location):
  1361    //
  1362    // + Projects scope, location specified:<br/>
  1363    //   `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  1364    // + Projects scope, no location specified (defaults to global):<br/>
  1365    //   `projects/`<var>PROJECT_ID</var>
  1366    //
  1367    // The following example `parent` string specifies a parent project with the
  1368    // identifier `example-project`, and specifies the `europe-west3` location
  1369    // for processing data:
  1370    //
  1371    //     parent=projects/example-project/locations/europe-west3
  1372    string parent = 1 [(google.api.resource_reference) = {
  1373                         child_type: "dlp.googleapis.com/DlpContent"
  1374                       }];
  1375  
  1376    // Configuration for the inspector. What specified here will override
  1377    // the template referenced by the inspect_template_name argument.
  1378    InspectConfig inspect_config = 2;
  1379  
  1380    // The item to inspect.
  1381    ContentItem item = 3;
  1382  
  1383    // Template to use. Any configuration directly specified in
  1384    // inspect_config will override those set in the template. Singular fields
  1385    // that are set in this request will replace their corresponding fields in the
  1386    // template. Repeated fields are appended. Singular sub-messages and groups
  1387    // are recursively merged.
  1388    string inspect_template_name = 4;
  1389  
  1390    // Deprecated. This field has no effect.
  1391    string location_id = 5;
  1392  }
  1393  
  1394  // Results of inspecting an item.
  1395  message InspectContentResponse {
  1396    // The findings.
  1397    InspectResult result = 1;
  1398  }
  1399  
  1400  // Cloud repository for storing output.
  1401  message OutputStorageConfig {
  1402    // Predefined schemas for storing findings.
  1403    // Only for use with external storage.
  1404    enum OutputSchema {
  1405      // Unused.
  1406      OUTPUT_SCHEMA_UNSPECIFIED = 0;
  1407  
  1408      // Basic schema including only `info_type`, `quote`, `certainty`, and
  1409      // `timestamp`.
  1410      BASIC_COLUMNS = 1;
  1411  
  1412      // Schema tailored to findings from scanning Google Cloud Storage.
  1413      GCS_COLUMNS = 2;
  1414  
  1415      // Schema tailored to findings from scanning Google Datastore.
  1416      DATASTORE_COLUMNS = 3;
  1417  
  1418      // Schema tailored to findings from scanning Google BigQuery.
  1419      BIG_QUERY_COLUMNS = 4;
  1420  
  1421      // Schema containing all columns.
  1422      ALL_COLUMNS = 5;
  1423    }
  1424  
  1425    // Output storage types.
  1426    oneof type {
  1427      // Store findings in an existing table or a new table in an existing
  1428      // dataset. If table_id is not set a new one will be generated
  1429      // for you with the following format:
  1430      // dlp_googleapis_yyyy_mm_dd_[dlp_job_id]. Pacific timezone will be used for
  1431      // generating the date details.
  1432      //
  1433      // For Inspect, each column in an existing output table must have the same
  1434      // name, type, and mode of a field in the `Finding` object.
  1435      //
  1436      // For Risk, an existing output table should be the output of a previous
  1437      // Risk analysis job run on the same source table, with the same privacy
  1438      // metric and quasi-identifiers. Risk jobs that analyze the same table but
  1439      // compute a different privacy metric, or use different sets of
  1440      // quasi-identifiers, cannot store their results in the same table.
  1441      BigQueryTable table = 1;
  1442    }
  1443  
  1444    // Schema used for writing the findings for Inspect jobs. This field is only
  1445    // used for Inspect and must be unspecified for Risk jobs. Columns are derived
  1446    // from the `Finding` object. If appending to an existing table, any columns
  1447    // from the predefined schema that are missing will be added. No columns in
  1448    // the existing table will be deleted.
  1449    //
  1450    // If unspecified, then all available columns will be used for a new table or
  1451    // an (existing) table with no schema, and no changes will be made to an
  1452    // existing table that has a schema.
  1453    // Only for use with external storage.
  1454    OutputSchema output_schema = 3;
  1455  }
  1456  
  1457  // Statistics regarding a specific InfoType.
  1458  message InfoTypeStats {
  1459    // The type of finding this stat is for.
  1460    InfoType info_type = 1;
  1461  
  1462    // Number of findings for this infoType.
  1463    int64 count = 2;
  1464  }
  1465  
  1466  // The results of an inspect DataSource job.
  1467  message InspectDataSourceDetails {
  1468    // Snapshot of the inspection configuration.
  1469    message RequestedOptions {
  1470      // If run with an InspectTemplate, a snapshot of its state at the time of
  1471      // this run.
  1472      InspectTemplate snapshot_inspect_template = 1;
  1473  
  1474      // Inspect config.
  1475      InspectJobConfig job_config = 3;
  1476    }
  1477  
  1478    // All result fields mentioned below are updated while the job is processing.
  1479    message Result {
  1480      // Total size in bytes that were processed.
  1481      int64 processed_bytes = 1;
  1482  
  1483      // Estimate of the number of bytes to process.
  1484      int64 total_estimated_bytes = 2;
  1485  
  1486      // Statistics of how many instances of each info type were found during
  1487      // inspect job.
  1488      repeated InfoTypeStats info_type_stats = 3;
  1489  
  1490      // Statistics related to the processing of hybrid inspect.
  1491      // Early access feature is in a pre-release state and might change or have
  1492      // limited support. For more information, see
  1493      // https://cloud.google.com/products#product-launch-stages.
  1494      HybridInspectStatistics hybrid_stats = 7;
  1495    }
  1496  
  1497    // The configuration used for this job.
  1498    RequestedOptions requested_options = 2;
  1499  
  1500    // A summary of the outcome of this inspect job.
  1501    Result result = 3;
  1502  }
  1503  
  1504  // Statistics related to processing hybrid inspect requests.
  1505  message HybridInspectStatistics {
  1506    // The number of hybrid inspection requests processed within this job.
  1507    int64 processed_count = 1;
  1508  
  1509    // The number of hybrid inspection requests aborted because the job ran
  1510    // out of quota or was ended before they could be processed.
  1511    int64 aborted_count = 2;
  1512  
  1513    // The number of hybrid requests currently being processed. Only populated
  1514    // when called via method `getDlpJob`.
  1515    // A burst of traffic may cause hybrid inspect requests to be enqueued.
  1516    // Processing will take place as quickly as possible, but resource limitations
  1517    // may impact how long a request is enqueued for.
  1518    int64 pending_count = 3;
  1519  }
  1520  
  1521  // InfoType description.
  1522  message InfoTypeDescription {
  1523    // Internal name of the infoType.
  1524    string name = 1;
  1525  
  1526    // Human readable form of the infoType name.
  1527    string display_name = 2;
  1528  
  1529    // Which parts of the API supports this InfoType.
  1530    repeated InfoTypeSupportedBy supported_by = 3;
  1531  
  1532    // Description of the infotype. Translated when language is provided in the
  1533    // request.
  1534    string description = 4;
  1535  }
  1536  
  1537  // Request for the list of infoTypes.
  1538  message ListInfoTypesRequest {
  1539    // The parent resource name.
  1540    //
  1541    // The format of this value is as follows:
  1542    //
  1543    //     locations/<var>LOCATION_ID</var>
  1544    string parent = 4;
  1545  
  1546    // BCP-47 language code for localized infoType friendly
  1547    // names. If omitted, or if localized strings are not available,
  1548    // en-US strings will be returned.
  1549    string language_code = 1;
  1550  
  1551    // filter to only return infoTypes supported by certain parts of the
  1552    // API. Defaults to supported_by=INSPECT.
  1553    string filter = 2;
  1554  
  1555    // Deprecated. This field has no effect.
  1556    string location_id = 3;
  1557  }
  1558  
  1559  // Response to the ListInfoTypes request.
  1560  message ListInfoTypesResponse {
  1561    // Set of sensitive infoTypes.
  1562    repeated InfoTypeDescription info_types = 1;
  1563  }
  1564  
  1565  // Configuration for a risk analysis job. See
  1566  // https://cloud.google.com/dlp/docs/concepts-risk-analysis to learn more.
  1567  message RiskAnalysisJobConfig {
  1568    // Privacy metric to compute.
  1569    PrivacyMetric privacy_metric = 1;
  1570  
  1571    // Input dataset to compute metrics over.
  1572    BigQueryTable source_table = 2;
  1573  
  1574    // Actions to execute at the completion of the job. Are executed in the order
  1575    // provided.
  1576    repeated Action actions = 3;
  1577  }
  1578  
  1579  // A column with a semantic tag attached.
  1580  message QuasiId {
  1581    // Required. Identifies the column.
  1582    FieldId field = 1 [(google.api.field_behavior) = REQUIRED];
  1583  
  1584    // Semantic tag that identifies what a column contains, to determine which
  1585    // statistical model to use to estimate the reidentifiability of each
  1586    // value. [required]
  1587    oneof tag {
  1588      // A column can be tagged with a InfoType to use the relevant public
  1589      // dataset as a statistical model of population, if available. We
  1590      // currently support US ZIP codes, region codes, ages and genders.
  1591      // To programmatically obtain the list of supported InfoTypes, use
  1592      // ListInfoTypes with the supported_by=RISK_ANALYSIS filter.
  1593      InfoType info_type = 2;
  1594  
  1595      // A column can be tagged with a custom tag. In this case, the user must
  1596      // indicate an auxiliary table that contains statistical information on
  1597      // the possible values of this column (below).
  1598      string custom_tag = 3;
  1599  
  1600      // If no semantic tag is indicated, we infer the statistical model from
  1601      // the distribution of values in the input data
  1602      google.protobuf.Empty inferred = 4;
  1603    }
  1604  }
  1605  
  1606  // An auxiliary table containing statistical information on the relative
  1607  // frequency of different quasi-identifiers values. It has one or several
  1608  // quasi-identifiers columns, and one column that indicates the relative
  1609  // frequency of each quasi-identifier tuple.
  1610  // If a tuple is present in the data but not in the auxiliary table, the
  1611  // corresponding relative frequency is assumed to be zero (and thus, the
  1612  // tuple is highly reidentifiable).
  1613  message StatisticalTable {
  1614    // A quasi-identifier column has a custom_tag, used to know which column
  1615    // in the data corresponds to which column in the statistical model.
  1616    message QuasiIdentifierField {
  1617      // Identifies the column.
  1618      FieldId field = 1;
  1619  
  1620      // A column can be tagged with a custom tag. In this case, the user must
  1621      // indicate an auxiliary table that contains statistical information on
  1622      // the possible values of this column (below).
  1623      string custom_tag = 2;
  1624    }
  1625  
  1626    // Required. Auxiliary table location.
  1627    BigQueryTable table = 3 [(google.api.field_behavior) = REQUIRED];
  1628  
  1629    // Required. Quasi-identifier columns.
  1630    repeated QuasiIdentifierField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED];
  1631  
  1632    // Required. The relative frequency column must contain a floating-point number
  1633    // between 0 and 1 (inclusive). Null values are assumed to be zero.
  1634    FieldId relative_frequency = 2 [(google.api.field_behavior) = REQUIRED];
  1635  }
  1636  
  1637  // Privacy metric to compute for reidentification risk analysis.
  1638  message PrivacyMetric {
  1639    // Compute numerical stats over an individual column, including
  1640    // min, max, and quantiles.
  1641    message NumericalStatsConfig {
  1642      // Field to compute numerical stats on. Supported types are
  1643      // integer, float, date, datetime, timestamp, time.
  1644      FieldId field = 1;
  1645    }
  1646  
  1647    // Compute numerical stats over an individual column, including
  1648    // number of distinct values and value count distribution.
  1649    message CategoricalStatsConfig {
  1650      // Field to compute categorical stats on. All column types are
  1651      // supported except for arrays and structs. However, it may be more
  1652      // informative to use NumericalStats when the field type is supported,
  1653      // depending on the data.
  1654      FieldId field = 1;
  1655    }
  1656  
  1657    // k-anonymity metric, used for analysis of reidentification risk.
  1658    message KAnonymityConfig {
  1659      // Set of fields to compute k-anonymity over. When multiple fields are
  1660      // specified, they are considered a single composite key. Structs and
  1661      // repeated data types are not supported; however, nested fields are
  1662      // supported so long as they are not structs themselves or nested within
  1663      // a repeated field.
  1664      repeated FieldId quasi_ids = 1;
  1665  
  1666      // Message indicating that multiple rows might be associated to a
  1667      // single individual. If the same entity_id is associated to multiple
  1668      // quasi-identifier tuples over distinct rows, we consider the entire
  1669      // collection of tuples as the composite quasi-identifier. This collection
  1670      // is a multiset: the order in which the different tuples appear in the
  1671      // dataset is ignored, but their frequency is taken into account.
  1672      //
  1673      // Important note: a maximum of 1000 rows can be associated to a single
  1674      // entity ID. If more rows are associated with the same entity ID, some
  1675      // might be ignored.
  1676      EntityId entity_id = 2;
  1677    }
  1678  
  1679    // l-diversity metric, used for analysis of reidentification risk.
  1680    message LDiversityConfig {
  1681      // Set of quasi-identifiers indicating how equivalence classes are
  1682      // defined for the l-diversity computation. When multiple fields are
  1683      // specified, they are considered a single composite key.
  1684      repeated FieldId quasi_ids = 1;
  1685  
  1686      // Sensitive field for computing the l-value.
  1687      FieldId sensitive_attribute = 2;
  1688    }
  1689  
  1690    // Reidentifiability metric. This corresponds to a risk model similar to what
  1691    // is called "journalist risk" in the literature, except the attack dataset is
  1692    // statistically modeled instead of being perfectly known. This can be done
  1693    // using publicly available data (like the US Census), or using a custom
  1694    // statistical model (indicated as one or several BigQuery tables), or by
  1695    // extrapolating from the distribution of values in the input dataset.
  1696    message KMapEstimationConfig {
  1697      // A column with a semantic tag attached.
  1698      message TaggedField {
  1699        // Required. Identifies the column.
  1700        FieldId field = 1 [(google.api.field_behavior) = REQUIRED];
  1701  
  1702        // Semantic tag that identifies what a column contains, to determine which
  1703        // statistical model to use to estimate the reidentifiability of each
  1704        // value. [required]
  1705        oneof tag {
  1706          // A column can be tagged with a InfoType to use the relevant public
  1707          // dataset as a statistical model of population, if available. We
  1708          // currently support US ZIP codes, region codes, ages and genders.
  1709          // To programmatically obtain the list of supported InfoTypes, use
  1710          // ListInfoTypes with the supported_by=RISK_ANALYSIS filter.
  1711          InfoType info_type = 2;
  1712  
  1713          // A column can be tagged with a custom tag. In this case, the user must
  1714          // indicate an auxiliary table that contains statistical information on
  1715          // the possible values of this column (below).
  1716          string custom_tag = 3;
  1717  
  1718          // If no semantic tag is indicated, we infer the statistical model from
  1719          // the distribution of values in the input data
  1720          google.protobuf.Empty inferred = 4;
  1721        }
  1722      }
  1723  
  1724      // An auxiliary table contains statistical information on the relative
  1725      // frequency of different quasi-identifiers values. It has one or several
  1726      // quasi-identifiers columns, and one column that indicates the relative
  1727      // frequency of each quasi-identifier tuple.
  1728      // If a tuple is present in the data but not in the auxiliary table, the
  1729      // corresponding relative frequency is assumed to be zero (and thus, the
  1730      // tuple is highly reidentifiable).
  1731      message AuxiliaryTable {
  1732        // A quasi-identifier column has a custom_tag, used to know which column
  1733        // in the data corresponds to which column in the statistical model.
  1734        message QuasiIdField {
  1735          // Identifies the column.
  1736          FieldId field = 1;
  1737  
  1738          // A auxiliary field.
  1739          string custom_tag = 2;
  1740        }
  1741  
  1742        // Required. Auxiliary table location.
  1743        BigQueryTable table = 3 [(google.api.field_behavior) = REQUIRED];
  1744  
  1745        // Required. Quasi-identifier columns.
  1746        repeated QuasiIdField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED];
  1747  
  1748        // Required. The relative frequency column must contain a floating-point number
  1749        // between 0 and 1 (inclusive). Null values are assumed to be zero.
  1750        FieldId relative_frequency = 2 [(google.api.field_behavior) = REQUIRED];
  1751      }
  1752  
  1753      // Required. Fields considered to be quasi-identifiers. No two columns can have the
  1754      // same tag.
  1755      repeated TaggedField quasi_ids = 1 [(google.api.field_behavior) = REQUIRED];
  1756  
  1757      // ISO 3166-1 alpha-2 region code to use in the statistical modeling.
  1758      // Set if no column is tagged with a region-specific InfoType (like
  1759      // US_ZIP_5) or a region code.
  1760      string region_code = 2;
  1761  
  1762      // Several auxiliary tables can be used in the analysis. Each custom_tag
  1763      // used to tag a quasi-identifiers column must appear in exactly one column
  1764      // of one auxiliary table.
  1765      repeated AuxiliaryTable auxiliary_tables = 3;
  1766    }
  1767  
  1768    // δ-presence metric, used to estimate how likely it is for an attacker to
  1769    // figure out that one given individual appears in a de-identified dataset.
  1770    // Similarly to the k-map metric, we cannot compute δ-presence exactly without
  1771    // knowing the attack dataset, so we use a statistical model instead.
  1772    message DeltaPresenceEstimationConfig {
  1773      // Required. Fields considered to be quasi-identifiers. No two fields can have the
  1774      // same tag.
  1775      repeated QuasiId quasi_ids = 1 [(google.api.field_behavior) = REQUIRED];
  1776  
  1777      // ISO 3166-1 alpha-2 region code to use in the statistical modeling.
  1778      // Set if no column is tagged with a region-specific InfoType (like
  1779      // US_ZIP_5) or a region code.
  1780      string region_code = 2;
  1781  
  1782      // Several auxiliary tables can be used in the analysis. Each custom_tag
  1783      // used to tag a quasi-identifiers field must appear in exactly one
  1784      // field of one auxiliary table.
  1785      repeated StatisticalTable auxiliary_tables = 3;
  1786    }
  1787  
  1788    // Types of analysis.
  1789    oneof type {
  1790      // Numerical stats
  1791      NumericalStatsConfig numerical_stats_config = 1;
  1792  
  1793      // Categorical stats
  1794      CategoricalStatsConfig categorical_stats_config = 2;
  1795  
  1796      // K-anonymity
  1797      KAnonymityConfig k_anonymity_config = 3;
  1798  
  1799      // l-diversity
  1800      LDiversityConfig l_diversity_config = 4;
  1801  
  1802      // k-map
  1803      KMapEstimationConfig k_map_estimation_config = 5;
  1804  
  1805      // delta-presence
  1806      DeltaPresenceEstimationConfig delta_presence_estimation_config = 6;
  1807    }
  1808  }
  1809  
  1810  // Result of a risk analysis operation request.
  1811  message AnalyzeDataSourceRiskDetails {
  1812    // Result of the numerical stats computation.
  1813    message NumericalStatsResult {
  1814      // Minimum value appearing in the column.
  1815      Value min_value = 1;
  1816  
  1817      // Maximum value appearing in the column.
  1818      Value max_value = 2;
  1819  
  1820      // List of 99 values that partition the set of field values into 100 equal
  1821      // sized buckets.
  1822      repeated Value quantile_values = 4;
  1823    }
  1824  
  1825    // Result of the categorical stats computation.
  1826    message CategoricalStatsResult {
  1827      // Histogram of value frequencies in the column.
  1828      message CategoricalStatsHistogramBucket {
  1829        // Lower bound on the value frequency of the values in this bucket.
  1830        int64 value_frequency_lower_bound = 1;
  1831  
  1832        // Upper bound on the value frequency of the values in this bucket.
  1833        int64 value_frequency_upper_bound = 2;
  1834  
  1835        // Total number of values in this bucket.
  1836        int64 bucket_size = 3;
  1837  
  1838        // Sample of value frequencies in this bucket. The total number of
  1839        // values returned per bucket is capped at 20.
  1840        repeated ValueFrequency bucket_values = 4;
  1841  
  1842        // Total number of distinct values in this bucket.
  1843        int64 bucket_value_count = 5;
  1844      }
  1845  
  1846      // Histogram of value frequencies in the column.
  1847      repeated CategoricalStatsHistogramBucket value_frequency_histogram_buckets = 5;
  1848    }
  1849  
  1850    // Result of the k-anonymity computation.
  1851    message KAnonymityResult {
  1852      // The set of columns' values that share the same ldiversity value
  1853      message KAnonymityEquivalenceClass {
  1854        // Set of values defining the equivalence class. One value per
  1855        // quasi-identifier column in the original KAnonymity metric message.
  1856        // The order is always the same as the original request.
  1857        repeated Value quasi_ids_values = 1;
  1858  
  1859        // Size of the equivalence class, for example number of rows with the
  1860        // above set of values.
  1861        int64 equivalence_class_size = 2;
  1862      }
  1863  
  1864      // Histogram of k-anonymity equivalence classes.
  1865      message KAnonymityHistogramBucket {
  1866        // Lower bound on the size of the equivalence classes in this bucket.
  1867        int64 equivalence_class_size_lower_bound = 1;
  1868  
  1869        // Upper bound on the size of the equivalence classes in this bucket.
  1870        int64 equivalence_class_size_upper_bound = 2;
  1871  
  1872        // Total number of equivalence classes in this bucket.
  1873        int64 bucket_size = 3;
  1874  
  1875        // Sample of equivalence classes in this bucket. The total number of
  1876        // classes returned per bucket is capped at 20.
  1877        repeated KAnonymityEquivalenceClass bucket_values = 4;
  1878  
  1879        // Total number of distinct equivalence classes in this bucket.
  1880        int64 bucket_value_count = 5;
  1881      }
  1882  
  1883      // Histogram of k-anonymity equivalence classes.
  1884      repeated KAnonymityHistogramBucket equivalence_class_histogram_buckets = 5;
  1885    }
  1886  
  1887    // Result of the l-diversity computation.
  1888    message LDiversityResult {
  1889      // The set of columns' values that share the same ldiversity value.
  1890      message LDiversityEquivalenceClass {
  1891        // Quasi-identifier values defining the k-anonymity equivalence
  1892        // class. The order is always the same as the original request.
  1893        repeated Value quasi_ids_values = 1;
  1894  
  1895        // Size of the k-anonymity equivalence class.
  1896        int64 equivalence_class_size = 2;
  1897  
  1898        // Number of distinct sensitive values in this equivalence class.
  1899        int64 num_distinct_sensitive_values = 3;
  1900  
  1901        // Estimated frequencies of top sensitive values.
  1902        repeated ValueFrequency top_sensitive_values = 4;
  1903      }
  1904  
  1905      // Histogram of l-diversity equivalence class sensitive value frequencies.
  1906      message LDiversityHistogramBucket {
  1907        // Lower bound on the sensitive value frequencies of the equivalence
  1908        // classes in this bucket.
  1909        int64 sensitive_value_frequency_lower_bound = 1;
  1910  
  1911        // Upper bound on the sensitive value frequencies of the equivalence
  1912        // classes in this bucket.
  1913        int64 sensitive_value_frequency_upper_bound = 2;
  1914  
  1915        // Total number of equivalence classes in this bucket.
  1916        int64 bucket_size = 3;
  1917  
  1918        // Sample of equivalence classes in this bucket. The total number of
  1919        // classes returned per bucket is capped at 20.
  1920        repeated LDiversityEquivalenceClass bucket_values = 4;
  1921  
  1922        // Total number of distinct equivalence classes in this bucket.
  1923        int64 bucket_value_count = 5;
  1924      }
  1925  
  1926      // Histogram of l-diversity equivalence class sensitive value frequencies.
  1927      repeated LDiversityHistogramBucket sensitive_value_frequency_histogram_buckets = 5;
  1928    }
  1929  
  1930    // Result of the reidentifiability analysis. Note that these results are an
  1931    // estimation, not exact values.
  1932    message KMapEstimationResult {
  1933      // A tuple of values for the quasi-identifier columns.
  1934      message KMapEstimationQuasiIdValues {
  1935        // The quasi-identifier values.
  1936        repeated Value quasi_ids_values = 1;
  1937  
  1938        // The estimated anonymity for these quasi-identifier values.
  1939        int64 estimated_anonymity = 2;
  1940      }
  1941  
  1942      // A KMapEstimationHistogramBucket message with the following values:
  1943      //   min_anonymity: 3
  1944      //   max_anonymity: 5
  1945      //   frequency: 42
  1946      // means that there are 42 records whose quasi-identifier values correspond
  1947      // to 3, 4 or 5 people in the overlying population. An important particular
  1948      // case is when min_anonymity = max_anonymity = 1: the frequency field then
  1949      // corresponds to the number of uniquely identifiable records.
  1950      message KMapEstimationHistogramBucket {
  1951        // Always positive.
  1952        int64 min_anonymity = 1;
  1953  
  1954        // Always greater than or equal to min_anonymity.
  1955        int64 max_anonymity = 2;
  1956  
  1957        // Number of records within these anonymity bounds.
  1958        int64 bucket_size = 5;
  1959  
  1960        // Sample of quasi-identifier tuple values in this bucket. The total
  1961        // number of classes returned per bucket is capped at 20.
  1962        repeated KMapEstimationQuasiIdValues bucket_values = 6;
  1963  
  1964        // Total number of distinct quasi-identifier tuple values in this bucket.
  1965        int64 bucket_value_count = 7;
  1966      }
  1967  
  1968      // The intervals [min_anonymity, max_anonymity] do not overlap. If a value
  1969      // doesn't correspond to any such interval, the associated frequency is
  1970      // zero. For example, the following records:
  1971      //   {min_anonymity: 1, max_anonymity: 1, frequency: 17}
  1972      //   {min_anonymity: 2, max_anonymity: 3, frequency: 42}
  1973      //   {min_anonymity: 5, max_anonymity: 10, frequency: 99}
  1974      // mean that there are no record with an estimated anonymity of 4, 5, or
  1975      // larger than 10.
  1976      repeated KMapEstimationHistogramBucket k_map_estimation_histogram = 1;
  1977    }
  1978  
  1979    // Result of the δ-presence computation. Note that these results are an
  1980    // estimation, not exact values.
  1981    message DeltaPresenceEstimationResult {
  1982      // A tuple of values for the quasi-identifier columns.
  1983      message DeltaPresenceEstimationQuasiIdValues {
  1984        // The quasi-identifier values.
  1985        repeated Value quasi_ids_values = 1;
  1986  
  1987        // The estimated probability that a given individual sharing these
  1988        // quasi-identifier values is in the dataset. This value, typically called
  1989        // δ, is the ratio between the number of records in the dataset with these
  1990        // quasi-identifier values, and the total number of individuals (inside
  1991        // *and* outside the dataset) with these quasi-identifier values.
  1992        // For example, if there are 15 individuals in the dataset who share the
  1993        // same quasi-identifier values, and an estimated 100 people in the entire
  1994        // population with these values, then δ is 0.15.
  1995        double estimated_probability = 2;
  1996      }
  1997  
  1998      // A DeltaPresenceEstimationHistogramBucket message with the following
  1999      // values:
  2000      //   min_probability: 0.1
  2001      //   max_probability: 0.2
  2002      //   frequency: 42
  2003      // means that there are 42 records for which δ is in [0.1, 0.2). An
  2004      // important particular case is when min_probability = max_probability = 1:
  2005      // then, every individual who shares this quasi-identifier combination is in
  2006      // the dataset.
  2007      message DeltaPresenceEstimationHistogramBucket {
  2008        // Between 0 and 1.
  2009        double min_probability = 1;
  2010  
  2011        // Always greater than or equal to min_probability.
  2012        double max_probability = 2;
  2013  
  2014        // Number of records within these probability bounds.
  2015        int64 bucket_size = 5;
  2016  
  2017        // Sample of quasi-identifier tuple values in this bucket. The total
  2018        // number of classes returned per bucket is capped at 20.
  2019        repeated DeltaPresenceEstimationQuasiIdValues bucket_values = 6;
  2020  
  2021        // Total number of distinct quasi-identifier tuple values in this bucket.
  2022        int64 bucket_value_count = 7;
  2023      }
  2024  
  2025      // The intervals [min_probability, max_probability) do not overlap. If a
  2026      // value doesn't correspond to any such interval, the associated frequency
  2027      // is zero. For example, the following records:
  2028      //   {min_probability: 0, max_probability: 0.1, frequency: 17}
  2029      //   {min_probability: 0.2, max_probability: 0.3, frequency: 42}
  2030      //   {min_probability: 0.3, max_probability: 0.4, frequency: 99}
  2031      // mean that there are no record with an estimated probability in [0.1, 0.2)
  2032      // nor larger or equal to 0.4.
  2033      repeated DeltaPresenceEstimationHistogramBucket delta_presence_estimation_histogram = 1;
  2034    }
  2035  
  2036    // Risk analysis options.
  2037    message RequestedRiskAnalysisOptions {
  2038      // The job config for the risk job.
  2039      RiskAnalysisJobConfig job_config = 1;
  2040    }
  2041  
  2042    // Privacy metric to compute.
  2043    PrivacyMetric requested_privacy_metric = 1;
  2044  
  2045    // Input dataset to compute metrics over.
  2046    BigQueryTable requested_source_table = 2;
  2047  
  2048    // Values associated with this metric.
  2049    oneof result {
  2050      // Numerical stats result
  2051      NumericalStatsResult numerical_stats_result = 3;
  2052  
  2053      // Categorical stats result
  2054      CategoricalStatsResult categorical_stats_result = 4;
  2055  
  2056      // K-anonymity result
  2057      KAnonymityResult k_anonymity_result = 5;
  2058  
  2059      // L-divesity result
  2060      LDiversityResult l_diversity_result = 6;
  2061  
  2062      // K-map result
  2063      KMapEstimationResult k_map_estimation_result = 7;
  2064  
  2065      // Delta-presence result
  2066      DeltaPresenceEstimationResult delta_presence_estimation_result = 9;
  2067    }
  2068  
  2069    // The configuration used for this job.
  2070    RequestedRiskAnalysisOptions requested_options = 10;
  2071  }
  2072  
  2073  // A value of a field, including its frequency.
  2074  message ValueFrequency {
  2075    // A value contained in the field in question.
  2076    Value value = 1;
  2077  
  2078    // How many times the value is contained in the field.
  2079    int64 count = 2;
  2080  }
  2081  
  2082  // Set of primitive values supported by the system.
  2083  // Note that for the purposes of inspection or transformation, the number
  2084  // of bytes considered to comprise a 'Value' is based on its representation
  2085  // as a UTF-8 encoded string. For example, if 'integer_value' is set to
  2086  // 123456789, the number of bytes would be counted as 9, even though an
  2087  // int64 only holds up to 8 bytes of data.
  2088  message Value {
  2089    // Value types
  2090    oneof type {
  2091      // integer
  2092      int64 integer_value = 1;
  2093  
  2094      // float
  2095      double float_value = 2;
  2096  
  2097      // string
  2098      string string_value = 3;
  2099  
  2100      // boolean
  2101      bool boolean_value = 4;
  2102  
  2103      // timestamp
  2104      google.protobuf.Timestamp timestamp_value = 5;
  2105  
  2106      // time of day
  2107      google.type.TimeOfDay time_value = 6;
  2108  
  2109      // date
  2110      google.type.Date date_value = 7;
  2111  
  2112      // day of week
  2113      google.type.DayOfWeek day_of_week_value = 8;
  2114    }
  2115  }
  2116  
  2117  // Message for infoType-dependent details parsed from quote.
  2118  message QuoteInfo {
  2119    // Object representation of the quote.
  2120    oneof parsed_quote {
  2121      // The date time indicated by the quote.
  2122      DateTime date_time = 2;
  2123    }
  2124  }
  2125  
  2126  // Message for a date time object.
  2127  // e.g. 2018-01-01, 5th August.
  2128  message DateTime {
  2129    // Time zone of the date time object.
  2130    message TimeZone {
  2131      // Set only if the offset can be determined. Positive for time ahead of UTC.
  2132      // E.g. For "UTC-9", this value is -540.
  2133      int32 offset_minutes = 1;
  2134    }
  2135  
  2136    // One or more of the following must be set.
  2137    // Must be a valid date or time value.
  2138    google.type.Date date = 1;
  2139  
  2140    // Day of week
  2141    google.type.DayOfWeek day_of_week = 2;
  2142  
  2143    // Time of day
  2144    google.type.TimeOfDay time = 3;
  2145  
  2146    // Time zone
  2147    TimeZone time_zone = 4;
  2148  }
  2149  
  2150  // The configuration that controls how the data will change.
  2151  message DeidentifyConfig {
  2152    oneof transformation {
  2153      // Treat the dataset as free-form text and apply the same free text
  2154      // transformation everywhere.
  2155      InfoTypeTransformations info_type_transformations = 1;
  2156  
  2157      // Treat the dataset as structured. Transformations can be applied to
  2158      // specific locations within structured datasets, such as transforming
  2159      // a column within a table.
  2160      RecordTransformations record_transformations = 2;
  2161    }
  2162  
  2163    // Mode for handling transformation errors. If left unspecified, the default
  2164    // mode is `TransformationErrorHandling.ThrowError`.
  2165    TransformationErrorHandling transformation_error_handling = 3;
  2166  }
  2167  
  2168  // How to handle transformation errors during de-identification. A
  2169  // transformation error occurs when the requested transformation is incompatible
  2170  // with the data. For example, trying to de-identify an IP address using a
  2171  // `DateShift` transformation would result in a transformation error, since date
  2172  // info cannot be extracted from an IP address.
  2173  // Information about any incompatible transformations, and how they were
  2174  // handled, is returned in the response as part of the
  2175  // `TransformationOverviews`.
  2176  message TransformationErrorHandling {
  2177    // Throw an error and fail the request when a transformation error occurs.
  2178    message ThrowError {
  2179  
  2180    }
  2181  
  2182    // Skips the data without modifying it if the requested transformation would
  2183    // cause an error. For example, if a `DateShift` transformation were applied
  2184    // an an IP address, this mode would leave the IP address unchanged in the
  2185    // response.
  2186    message LeaveUntransformed {
  2187  
  2188    }
  2189  
  2190    // How transformation errors should be handled.
  2191    oneof mode {
  2192      // Throw an error
  2193      ThrowError throw_error = 1;
  2194  
  2195      // Ignore errors
  2196      LeaveUntransformed leave_untransformed = 2;
  2197    }
  2198  }
  2199  
  2200  // A rule for transforming a value.
  2201  message PrimitiveTransformation {
  2202    oneof transformation {
  2203      // Replace
  2204      ReplaceValueConfig replace_config = 1;
  2205  
  2206      // Redact
  2207      RedactConfig redact_config = 2;
  2208  
  2209      // Mask
  2210      CharacterMaskConfig character_mask_config = 3;
  2211  
  2212      // Ffx-Fpe
  2213      CryptoReplaceFfxFpeConfig crypto_replace_ffx_fpe_config = 4;
  2214  
  2215      // Fixed size bucketing
  2216      FixedSizeBucketingConfig fixed_size_bucketing_config = 5;
  2217  
  2218      // Bucketing
  2219      BucketingConfig bucketing_config = 6;
  2220  
  2221      // Replace with infotype
  2222      ReplaceWithInfoTypeConfig replace_with_info_type_config = 7;
  2223  
  2224      // Time extraction
  2225      TimePartConfig time_part_config = 8;
  2226  
  2227      // Crypto
  2228      CryptoHashConfig crypto_hash_config = 9;
  2229  
  2230      // Date Shift
  2231      DateShiftConfig date_shift_config = 11;
  2232  
  2233      // Deterministic Crypto
  2234      CryptoDeterministicConfig crypto_deterministic_config = 12;
  2235    }
  2236  }
  2237  
  2238  // For use with `Date`, `Timestamp`, and `TimeOfDay`, extract or preserve a
  2239  // portion of the value.
  2240  message TimePartConfig {
  2241    // Components that make up time.
  2242    enum TimePart {
  2243      // Unused
  2244      TIME_PART_UNSPECIFIED = 0;
  2245  
  2246      // [0-9999]
  2247      YEAR = 1;
  2248  
  2249      // [1-12]
  2250      MONTH = 2;
  2251  
  2252      // [1-31]
  2253      DAY_OF_MONTH = 3;
  2254  
  2255      // [1-7]
  2256      DAY_OF_WEEK = 4;
  2257  
  2258      // [1-53]
  2259      WEEK_OF_YEAR = 5;
  2260  
  2261      // [0-23]
  2262      HOUR_OF_DAY = 6;
  2263    }
  2264  
  2265    // The part of the time to keep.
  2266    TimePart part_to_extract = 1;
  2267  }
  2268  
  2269  // Pseudonymization method that generates surrogates via cryptographic hashing.
  2270  // Uses SHA-256.
  2271  // The key size must be either 32 or 64 bytes.
  2272  // Outputs a base64 encoded representation of the hashed output
  2273  // (for example, L7k0BHmF1ha5U3NfGykjro4xWi1MPVQPjhMAZbSV9mM=).
  2274  // Currently, only string and integer values can be hashed.
  2275  // See https://cloud.google.com/dlp/docs/pseudonymization to learn more.
  2276  message CryptoHashConfig {
  2277    // The key used by the hash function.
  2278    CryptoKey crypto_key = 1;
  2279  }
  2280  
  2281  // Pseudonymization method that generates deterministic encryption for the given
  2282  // input. Outputs a base64 encoded representation of the encrypted output.
  2283  // Uses AES-SIV based on the RFC https://tools.ietf.org/html/rfc5297.
  2284  message CryptoDeterministicConfig {
  2285    // The key used by the encryption function.
  2286    CryptoKey crypto_key = 1;
  2287  
  2288    // The custom info type to annotate the surrogate with.
  2289    // This annotation will be applied to the surrogate by prefixing it with
  2290    // the name of the custom info type followed by the number of
  2291    // characters comprising the surrogate. The following scheme defines the
  2292    // format: {info type name}({surrogate character count}):{surrogate}
  2293    //
  2294    // For example, if the name of custom info type is 'MY_TOKEN_INFO_TYPE' and
  2295    // the surrogate is 'abc', the full replacement value
  2296    // will be: 'MY_TOKEN_INFO_TYPE(3):abc'
  2297    //
  2298    // This annotation identifies the surrogate when inspecting content using the
  2299    // custom info type 'Surrogate'. This facilitates reversal of the
  2300    // surrogate when it occurs in free text.
  2301    //
  2302    // Note: For record transformations where the entire cell in a table is being
  2303    // transformed, surrogates are not mandatory. Surrogates are used to denote
  2304    // the location of the token and are necessary for re-identification in free
  2305    // form text.
  2306    //
  2307    // In order for inspection to work properly, the name of this info type must
  2308    // not occur naturally anywhere in your data; otherwise, inspection may either
  2309    //
  2310    // - reverse a surrogate that does not correspond to an actual identifier
  2311    // - be unable to parse the surrogate and result in an error
  2312    //
  2313    // Therefore, choose your custom info type name carefully after considering
  2314    // what your data looks like. One way to select a name that has a high chance
  2315    // of yielding reliable detection is to include one or more unicode characters
  2316    // that are highly improbable to exist in your data.
  2317    // For example, assuming your data is entered from a regular ASCII keyboard,
  2318    // the symbol with the hex code point 29DD might be used like so:
  2319    // ⧝MY_TOKEN_TYPE.
  2320    InfoType surrogate_info_type = 2;
  2321  
  2322    // A context may be used for higher security and maintaining
  2323    // referential integrity such that the same identifier in two different
  2324    // contexts will be given a distinct surrogate. The context is appended to
  2325    // plaintext value being encrypted. On decryption the provided context is
  2326    // validated against the value used during encryption. If a context was
  2327    // provided during encryption, same context must be provided during decryption
  2328    // as well.
  2329    //
  2330    // If the context is not set, plaintext would be used as is for encryption.
  2331    // If the context is set but:
  2332    //
  2333    // 1. there is no record present when transforming a given value or
  2334    // 2. the field is not present when transforming a given value,
  2335    //
  2336    // plaintext would be used as is for encryption.
  2337    //
  2338    // Note that case (1) is expected when an `InfoTypeTransformation` is
  2339    // applied to both structured and non-structured `ContentItem`s.
  2340    FieldId context = 3;
  2341  }
  2342  
  2343  // Replace each input value with a given `Value`.
  2344  message ReplaceValueConfig {
  2345    // Value to replace it with.
  2346    Value new_value = 1;
  2347  }
  2348  
  2349  // Replace each matching finding with the name of the info_type.
  2350  message ReplaceWithInfoTypeConfig {
  2351  
  2352  }
  2353  
  2354  // Redact a given value. For example, if used with an `InfoTypeTransformation`
  2355  // transforming PHONE_NUMBER, and input 'My phone number is 206-555-0123', the
  2356  // output would be 'My phone number is '.
  2357  message RedactConfig {
  2358  
  2359  }
  2360  
  2361  // Characters to skip when doing deidentification of a value. These will be left
  2362  // alone and skipped.
  2363  message CharsToIgnore {
  2364    // Convenience enum for indication common characters to not transform.
  2365    enum CommonCharsToIgnore {
  2366      // Unused.
  2367      COMMON_CHARS_TO_IGNORE_UNSPECIFIED = 0;
  2368  
  2369      // 0-9
  2370      NUMERIC = 1;
  2371  
  2372      // A-Z
  2373      ALPHA_UPPER_CASE = 2;
  2374  
  2375      // a-z
  2376      ALPHA_LOWER_CASE = 3;
  2377  
  2378      // US Punctuation, one of !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
  2379      PUNCTUATION = 4;
  2380  
  2381      // Whitespace character, one of [ \t\n\x0B\f\r]
  2382      WHITESPACE = 5;
  2383    }
  2384  
  2385    oneof characters {
  2386      // Characters to not transform when masking.
  2387      string characters_to_skip = 1;
  2388  
  2389      // Common characters to not transform when masking. Useful to avoid removing
  2390      // punctuation.
  2391      CommonCharsToIgnore common_characters_to_ignore = 2;
  2392    }
  2393  }
  2394  
  2395  // Partially mask a string by replacing a given number of characters with a
  2396  // fixed character. Masking can start from the beginning or end of the string.
  2397  // This can be used on data of any type (numbers, longs, and so on) and when
  2398  // de-identifying structured data we'll attempt to preserve the original data's
  2399  // type. (This allows you to take a long like 123 and modify it to a string like
  2400  // **3.
  2401  message CharacterMaskConfig {
  2402    // Character to use to mask the sensitive values&mdash;for example, `*` for an
  2403    // alphabetic string such as a name, or `0` for a numeric string such as ZIP
  2404    // code or credit card number. This string must have a length of 1. If not
  2405    // supplied, this value defaults to `*` for strings, and `0` for digits.
  2406    string masking_character = 1;
  2407  
  2408    // Number of characters to mask. If not set, all matching chars will be
  2409    // masked. Skipped characters do not count towards this tally.
  2410    int32 number_to_mask = 2;
  2411  
  2412    // Mask characters in reverse order. For example, if `masking_character` is
  2413    // `0`, `number_to_mask` is `14`, and `reverse_order` is `false`, then the
  2414    // input string `1234-5678-9012-3456` is masked as `00000000000000-3456`.
  2415    // If `masking_character` is `*`, `number_to_mask` is `3`, and `reverse_order`
  2416    // is `true`, then the string `12345` is masked as `12***`.
  2417    bool reverse_order = 3;
  2418  
  2419    // When masking a string, items in this list will be skipped when replacing
  2420    // characters. For example, if the input string is `555-555-5555` and you
  2421    // instruct Cloud DLP to skip `-` and mask 5 characters with `*`, Cloud DLP
  2422    // returns `***-**5-5555`.
  2423    repeated CharsToIgnore characters_to_ignore = 4;
  2424  }
  2425  
  2426  // Buckets values based on fixed size ranges. The
  2427  // Bucketing transformation can provide all of this functionality,
  2428  // but requires more configuration. This message is provided as a convenience to
  2429  // the user for simple bucketing strategies.
  2430  //
  2431  // The transformed value will be a hyphenated string of
  2432  // {lower_bound}-{upper_bound}, i.e if lower_bound = 10 and upper_bound = 20
  2433  // all values that are within this bucket will be replaced with "10-20".
  2434  //
  2435  // This can be used on data of type: double, long.
  2436  //
  2437  // If the bound Value type differs from the type of data
  2438  // being transformed, we will first attempt converting the type of the data to
  2439  // be transformed to match the type of the bound before comparing.
  2440  //
  2441  // See https://cloud.google.com/dlp/docs/concepts-bucketing to learn more.
  2442  message FixedSizeBucketingConfig {
  2443    // Required. Lower bound value of buckets. All values less than `lower_bound` are
  2444    // grouped together into a single bucket; for example if `lower_bound` = 10,
  2445    // then all values less than 10 are replaced with the value "-10".
  2446    Value lower_bound = 1 [(google.api.field_behavior) = REQUIRED];
  2447  
  2448    // Required. Upper bound value of buckets. All values greater than upper_bound are
  2449    // grouped together into a single bucket; for example if `upper_bound` = 89,
  2450    // then all values greater than 89 are replaced with the value "89+".
  2451    Value upper_bound = 2 [(google.api.field_behavior) = REQUIRED];
  2452  
  2453    // Required. Size of each bucket (except for minimum and maximum buckets). So if
  2454    // `lower_bound` = 10, `upper_bound` = 89, and `bucket_size` = 10, then the
  2455    // following buckets would be used: -10, 10-20, 20-30, 30-40, 40-50, 50-60,
  2456    // 60-70, 70-80, 80-89, 89+. Precision up to 2 decimals works.
  2457    double bucket_size = 3 [(google.api.field_behavior) = REQUIRED];
  2458  }
  2459  
  2460  // Generalization function that buckets values based on ranges. The ranges and
  2461  // replacement values are dynamically provided by the user for custom behavior,
  2462  // such as 1-30 -> LOW 31-65 -> MEDIUM 66-100 -> HIGH
  2463  // This can be used on
  2464  // data of type: number, long, string, timestamp.
  2465  // If the bound `Value` type differs from the type of data being transformed, we
  2466  // will first attempt converting the type of the data to be transformed to match
  2467  // the type of the bound before comparing.
  2468  // See https://cloud.google.com/dlp/docs/concepts-bucketing to learn more.
  2469  message BucketingConfig {
  2470    // Bucket is represented as a range, along with replacement values.
  2471    message Bucket {
  2472      // Lower bound of the range, inclusive. Type should be the same as max if
  2473      // used.
  2474      Value min = 1;
  2475  
  2476      // Upper bound of the range, exclusive; type must match min.
  2477      Value max = 2;
  2478  
  2479      // Required. Replacement value for this bucket.
  2480      Value replacement_value = 3 [(google.api.field_behavior) = REQUIRED];
  2481    }
  2482  
  2483    // Set of buckets. Ranges must be non-overlapping.
  2484    repeated Bucket buckets = 1;
  2485  }
  2486  
  2487  // Replaces an identifier with a surrogate using Format Preserving Encryption
  2488  // (FPE) with the FFX mode of operation; however when used in the
  2489  // `ReidentifyContent` API method, it serves the opposite function by reversing
  2490  // the surrogate back into the original identifier. The identifier must be
  2491  // encoded as ASCII. For a given crypto key and context, the same identifier
  2492  // will be replaced with the same surrogate. Identifiers must be at least two
  2493  // characters long. In the case that the identifier is the empty string, it will
  2494  // be skipped. See https://cloud.google.com/dlp/docs/pseudonymization to learn
  2495  // more.
  2496  //
  2497  // Note: We recommend using  CryptoDeterministicConfig for all use cases which
  2498  // do not require preserving the input alphabet space and size, plus warrant
  2499  // referential integrity.
  2500  message CryptoReplaceFfxFpeConfig {
  2501    // These are commonly used subsets of the alphabet that the FFX mode
  2502    // natively supports. In the algorithm, the alphabet is selected using
  2503    // the "radix". Therefore each corresponds to particular radix.
  2504    enum FfxCommonNativeAlphabet {
  2505      // Unused.
  2506      FFX_COMMON_NATIVE_ALPHABET_UNSPECIFIED = 0;
  2507  
  2508      // `[0-9]` (radix of 10)
  2509      NUMERIC = 1;
  2510  
  2511      // `[0-9A-F]` (radix of 16)
  2512      HEXADECIMAL = 2;
  2513  
  2514      // `[0-9A-Z]` (radix of 36)
  2515      UPPER_CASE_ALPHA_NUMERIC = 3;
  2516  
  2517      // `[0-9A-Za-z]` (radix of 62)
  2518      ALPHA_NUMERIC = 4;
  2519    }
  2520  
  2521    // Required. The key used by the encryption algorithm.
  2522    CryptoKey crypto_key = 1 [(google.api.field_behavior) = REQUIRED];
  2523  
  2524    // The 'tweak', a context may be used for higher security since the same
  2525    // identifier in two different contexts won't be given the same surrogate. If
  2526    // the context is not set, a default tweak will be used.
  2527    //
  2528    // If the context is set but:
  2529    //
  2530    // 1. there is no record present when transforming a given value or
  2531    // 1. the field is not present when transforming a given value,
  2532    //
  2533    // a default tweak will be used.
  2534    //
  2535    // Note that case (1) is expected when an `InfoTypeTransformation` is
  2536    // applied to both structured and non-structured `ContentItem`s.
  2537    // Currently, the referenced field may be of value type integer or string.
  2538    //
  2539    // The tweak is constructed as a sequence of bytes in big endian byte order
  2540    // such that:
  2541    //
  2542    // - a 64 bit integer is encoded followed by a single byte of value 1
  2543    // - a string is encoded in UTF-8 format followed by a single byte of value 2
  2544    FieldId context = 2;
  2545  
  2546    // Choose an alphabet which the data being transformed will be made up of.
  2547    oneof alphabet {
  2548      // Common alphabets.
  2549      FfxCommonNativeAlphabet common_alphabet = 4;
  2550  
  2551      // This is supported by mapping these to the alphanumeric characters
  2552      // that the FFX mode natively supports. This happens before/after
  2553      // encryption/decryption.
  2554      // Each character listed must appear only once.
  2555      // Number of characters must be in the range [2, 95].
  2556      // This must be encoded as ASCII.
  2557      // The order of characters does not matter.
  2558      // The full list of allowed characters is:
  2559      // <code>0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
  2560      // ~`!@#$%^&*()_-+={[}]|\:;"'<,>.?/</code>
  2561      string custom_alphabet = 5;
  2562  
  2563      // The native way to select the alphabet. Must be in the range [2, 95].
  2564      int32 radix = 6;
  2565    }
  2566  
  2567    // The custom infoType to annotate the surrogate with.
  2568    // This annotation will be applied to the surrogate by prefixing it with
  2569    // the name of the custom infoType followed by the number of
  2570    // characters comprising the surrogate. The following scheme defines the
  2571    // format: info_type_name(surrogate_character_count):surrogate
  2572    //
  2573    // For example, if the name of custom infoType is 'MY_TOKEN_INFO_TYPE' and
  2574    // the surrogate is 'abc', the full replacement value
  2575    // will be: 'MY_TOKEN_INFO_TYPE(3):abc'
  2576    //
  2577    // This annotation identifies the surrogate when inspecting content using the
  2578    // custom infoType
  2579    // [`SurrogateType`](https://cloud.google.com/dlp/docs/reference/rest/v2/InspectConfig#surrogatetype).
  2580    // This facilitates reversal of the surrogate when it occurs in free text.
  2581    //
  2582    // In order for inspection to work properly, the name of this infoType must
  2583    // not occur naturally anywhere in your data; otherwise, inspection may
  2584    // find a surrogate that does not correspond to an actual identifier.
  2585    // Therefore, choose your custom infoType name carefully after considering
  2586    // what your data looks like. One way to select a name that has a high chance
  2587    // of yielding reliable detection is to include one or more unicode characters
  2588    // that are highly improbable to exist in your data.
  2589    // For example, assuming your data is entered from a regular ASCII keyboard,
  2590    // the symbol with the hex code point 29DD might be used like so:
  2591    // ⧝MY_TOKEN_TYPE
  2592    InfoType surrogate_info_type = 8;
  2593  }
  2594  
  2595  // This is a data encryption key (DEK) (as opposed to
  2596  // a key encryption key (KEK) stored by KMS).
  2597  // When using KMS to wrap/unwrap DEKs, be sure to set an appropriate
  2598  // IAM policy on the KMS CryptoKey (KEK) to ensure an attacker cannot
  2599  // unwrap the data crypto key.
  2600  message CryptoKey {
  2601    // Sources of crypto keys.
  2602    oneof source {
  2603      // Transient crypto key
  2604      TransientCryptoKey transient = 1;
  2605  
  2606      // Unwrapped crypto key
  2607      UnwrappedCryptoKey unwrapped = 2;
  2608  
  2609      // Kms wrapped key
  2610      KmsWrappedCryptoKey kms_wrapped = 3;
  2611    }
  2612  }
  2613  
  2614  // Use this to have a random data crypto key generated.
  2615  // It will be discarded after the request finishes.
  2616  message TransientCryptoKey {
  2617    // Required. Name of the key.
  2618    // This is an arbitrary string used to differentiate different keys.
  2619    // A unique key is generated per name: two separate `TransientCryptoKey`
  2620    // protos share the same generated key if their names are the same.
  2621    // When the data crypto key is generated, this name is not used in any way
  2622    // (repeating the api call will result in a different key being generated).
  2623    string name = 1 [(google.api.field_behavior) = REQUIRED];
  2624  }
  2625  
  2626  // Using raw keys is prone to security risks due to accidentally
  2627  // leaking the key. Choose another type of key if possible.
  2628  message UnwrappedCryptoKey {
  2629    // Required. A 128/192/256 bit key.
  2630    bytes key = 1 [(google.api.field_behavior) = REQUIRED];
  2631  }
  2632  
  2633  // Include to use an existing data crypto key wrapped by KMS.
  2634  // The wrapped key must be a 128/192/256 bit key.
  2635  // Authorization requires the following IAM permissions when sending a request
  2636  // to perform a crypto transformation using a kms-wrapped crypto key:
  2637  // dlp.kms.encrypt
  2638  message KmsWrappedCryptoKey {
  2639    // Required. The wrapped data crypto key.
  2640    bytes wrapped_key = 1 [(google.api.field_behavior) = REQUIRED];
  2641  
  2642    // Required. The resource name of the KMS CryptoKey to use for unwrapping.
  2643    string crypto_key_name = 2 [(google.api.field_behavior) = REQUIRED];
  2644  }
  2645  
  2646  // Shifts dates by random number of days, with option to be consistent for the
  2647  // same context. See https://cloud.google.com/dlp/docs/concepts-date-shifting
  2648  // to learn more.
  2649  message DateShiftConfig {
  2650    // Required. Range of shift in days. Actual shift will be selected at random within this
  2651    // range (inclusive ends). Negative means shift to earlier in time. Must not
  2652    // be more than 365250 days (1000 years) each direction.
  2653    //
  2654    // For example, 3 means shift date to at most 3 days into the future.
  2655    int32 upper_bound_days = 1 [(google.api.field_behavior) = REQUIRED];
  2656  
  2657    // Required. For example, -5 means shift date to at most 5 days back in the past.
  2658    int32 lower_bound_days = 2 [(google.api.field_behavior) = REQUIRED];
  2659  
  2660    // Points to the field that contains the context, for example, an entity id.
  2661    // If set, must also set cryptoKey. If set, shift will be consistent for the
  2662    // given context.
  2663    FieldId context = 3;
  2664  
  2665    // Method for calculating shift that takes context into consideration. If
  2666    // set, must also set context. Can only be applied to table items.
  2667    oneof method {
  2668      // Causes the shift to be computed based on this key and the context. This
  2669      // results in the same shift for the same context and crypto_key. If
  2670      // set, must also set context. Can only be applied to table items.
  2671      CryptoKey crypto_key = 4;
  2672    }
  2673  }
  2674  
  2675  // A type of transformation that will scan unstructured text and
  2676  // apply various `PrimitiveTransformation`s to each finding, where the
  2677  // transformation is applied to only values that were identified as a specific
  2678  // info_type.
  2679  message InfoTypeTransformations {
  2680    // A transformation to apply to text that is identified as a specific
  2681    // info_type.
  2682    message InfoTypeTransformation {
  2683      // InfoTypes to apply the transformation to. An empty list will cause
  2684      // this transformation to apply to all findings that correspond to
  2685      // infoTypes that were requested in `InspectConfig`.
  2686      repeated InfoType info_types = 1;
  2687  
  2688      // Required. Primitive transformation to apply to the infoType.
  2689      PrimitiveTransformation primitive_transformation = 2 [(google.api.field_behavior) = REQUIRED];
  2690    }
  2691  
  2692    // Required. Transformation for each infoType. Cannot specify more than one
  2693    // for a given infoType.
  2694    repeated InfoTypeTransformation transformations = 1 [(google.api.field_behavior) = REQUIRED];
  2695  }
  2696  
  2697  // The transformation to apply to the field.
  2698  message FieldTransformation {
  2699    // Required. Input field(s) to apply the transformation to.
  2700    repeated FieldId fields = 1 [(google.api.field_behavior) = REQUIRED];
  2701  
  2702    // Only apply the transformation if the condition evaluates to true for the
  2703    // given `RecordCondition`. The conditions are allowed to reference fields
  2704    // that are not used in the actual transformation.
  2705    //
  2706    // Example Use Cases:
  2707    //
  2708    // - Apply a different bucket transformation to an age column if the zip code
  2709    // column for the same record is within a specific range.
  2710    // - Redact a field if the date of birth field is greater than 85.
  2711    RecordCondition condition = 3;
  2712  
  2713    // Transformation to apply. [required]
  2714    oneof transformation {
  2715      // Apply the transformation to the entire field.
  2716      PrimitiveTransformation primitive_transformation = 4;
  2717  
  2718      // Treat the contents of the field as free text, and selectively
  2719      // transform content that matches an `InfoType`.
  2720      InfoTypeTransformations info_type_transformations = 5;
  2721    }
  2722  }
  2723  
  2724  // A type of transformation that is applied over structured data such as a
  2725  // table.
  2726  message RecordTransformations {
  2727    // Transform the record by applying various field transformations.
  2728    repeated FieldTransformation field_transformations = 1;
  2729  
  2730    // Configuration defining which records get suppressed entirely. Records that
  2731    // match any suppression rule are omitted from the output.
  2732    repeated RecordSuppression record_suppressions = 2;
  2733  }
  2734  
  2735  // Configuration to suppress records whose suppression conditions evaluate to
  2736  // true.
  2737  message RecordSuppression {
  2738    // A condition that when it evaluates to true will result in the record being
  2739    // evaluated to be suppressed from the transformed content.
  2740    RecordCondition condition = 1;
  2741  }
  2742  
  2743  // A condition for determining whether a transformation should be applied to
  2744  // a field.
  2745  message RecordCondition {
  2746    // The field type of `value` and `field` do not need to match to be
  2747    // considered equal, but not all comparisons are possible.
  2748    // EQUAL_TO and NOT_EQUAL_TO attempt to compare even with incompatible types,
  2749    // but all other comparisons are invalid with incompatible types.
  2750    // A `value` of type:
  2751    //
  2752    // - `string` can be compared against all other types
  2753    // - `boolean` can only be compared against other booleans
  2754    // - `integer` can be compared against doubles or a string if the string value
  2755    // can be parsed as an integer.
  2756    // - `double` can be compared against integers or a string if the string can
  2757    // be parsed as a double.
  2758    // - `Timestamp` can be compared against strings in RFC 3339 date string
  2759    // format.
  2760    // - `TimeOfDay` can be compared against timestamps and strings in the format
  2761    // of 'HH:mm:ss'.
  2762    //
  2763    // If we fail to compare do to type mismatch, a warning will be given and
  2764    // the condition will evaluate to false.
  2765    message Condition {
  2766      // Required. Field within the record this condition is evaluated against.
  2767      FieldId field = 1 [(google.api.field_behavior) = REQUIRED];
  2768  
  2769      // Required. Operator used to compare the field or infoType to the value.
  2770      RelationalOperator operator = 3 [(google.api.field_behavior) = REQUIRED];
  2771  
  2772      // Value to compare against. [Mandatory, except for `EXISTS` tests.]
  2773      Value value = 4;
  2774    }
  2775  
  2776    // A collection of conditions.
  2777    message Conditions {
  2778      // A collection of conditions.
  2779      repeated Condition conditions = 1;
  2780    }
  2781  
  2782    // An expression, consisting or an operator and conditions.
  2783    message Expressions {
  2784      // Logical operators for conditional checks.
  2785      enum LogicalOperator {
  2786        // Unused
  2787        LOGICAL_OPERATOR_UNSPECIFIED = 0;
  2788  
  2789        // Conditional AND
  2790        AND = 1;
  2791      }
  2792  
  2793      // The operator to apply to the result of conditions. Default and currently
  2794      // only supported value is `AND`.
  2795      LogicalOperator logical_operator = 1;
  2796  
  2797      // Expression types.
  2798      oneof type {
  2799        // Conditions to apply to the expression.
  2800        Conditions conditions = 3;
  2801      }
  2802    }
  2803  
  2804    // An expression.
  2805    Expressions expressions = 3;
  2806  }
  2807  
  2808  // Overview of the modifications that occurred.
  2809  message TransformationOverview {
  2810    // Total size in bytes that were transformed in some way.
  2811    int64 transformed_bytes = 2;
  2812  
  2813    // Transformations applied to the dataset.
  2814    repeated TransformationSummary transformation_summaries = 3;
  2815  }
  2816  
  2817  // Summary of a single transformation.
  2818  // Only one of 'transformation', 'field_transformation', or 'record_suppress'
  2819  // will be set.
  2820  message TransformationSummary {
  2821    // A collection that informs the user the number of times a particular
  2822    // `TransformationResultCode` and error details occurred.
  2823    message SummaryResult {
  2824      // Number of transformations counted by this result.
  2825      int64 count = 1;
  2826  
  2827      // Outcome of the transformation.
  2828      TransformationResultCode code = 2;
  2829  
  2830      // A place for warnings or errors to show up if a transformation didn't
  2831      // work as expected.
  2832      string details = 3;
  2833    }
  2834  
  2835    // Possible outcomes of transformations.
  2836    enum TransformationResultCode {
  2837      // Unused
  2838      TRANSFORMATION_RESULT_CODE_UNSPECIFIED = 0;
  2839  
  2840      // Transformation completed without an error.
  2841      SUCCESS = 1;
  2842  
  2843      // Transformation had an error.
  2844      ERROR = 2;
  2845    }
  2846  
  2847    // Set if the transformation was limited to a specific InfoType.
  2848    InfoType info_type = 1;
  2849  
  2850    // Set if the transformation was limited to a specific FieldId.
  2851    FieldId field = 2;
  2852  
  2853    // The specific transformation these stats apply to.
  2854    PrimitiveTransformation transformation = 3;
  2855  
  2856    // The field transformation that was applied.
  2857    // If multiple field transformations are requested for a single field,
  2858    // this list will contain all of them; otherwise, only one is supplied.
  2859    repeated FieldTransformation field_transformations = 5;
  2860  
  2861    // The specific suppression option these stats apply to.
  2862    RecordSuppression record_suppress = 6;
  2863  
  2864    // Collection of all transformations that took place or had an error.
  2865    repeated SummaryResult results = 4;
  2866  
  2867    // Total size in bytes that were transformed in some way.
  2868    int64 transformed_bytes = 7;
  2869  }
  2870  
  2871  // Schedule for triggeredJobs.
  2872  message Schedule {
  2873    oneof option {
  2874      // With this option a job is started a regular periodic basis. For
  2875      // example: every day (86400 seconds).
  2876      //
  2877      // A scheduled start time will be skipped if the previous
  2878      // execution has not ended when its scheduled time occurs.
  2879      //
  2880      // This value must be set to a time duration greater than or equal
  2881      // to 1 day and can be no longer than 60 days.
  2882      google.protobuf.Duration recurrence_period_duration = 1;
  2883    }
  2884  }
  2885  
  2886  // Job trigger option for hybrid jobs. Jobs must be manually created
  2887  // and finished.
  2888  message Manual {
  2889  
  2890  }
  2891  
  2892  // The inspectTemplate contains a configuration (set of types of sensitive data
  2893  // to be detected) to be used anywhere you otherwise would normally specify
  2894  // InspectConfig. See https://cloud.google.com/dlp/docs/concepts-templates
  2895  // to learn more.
  2896  message InspectTemplate {
  2897    option (google.api.resource) = {
  2898      type: "dlp.googleapis.com/InspectTemplate"
  2899      pattern: "organizations/{organization}/inspectTemplates/{inspect_template}"
  2900      pattern: "projects/{project}/inspectTemplates/{inspect_template}"
  2901      pattern: "organizations/{organization}/locations/{location}/inspectTemplates/{inspect_template}"
  2902      pattern: "projects/{project}/locations/{location}/inspectTemplates/{inspect_template}"
  2903    };
  2904  
  2905    // Output only. The template name.
  2906    //
  2907    // The template will have one of the following formats:
  2908    // `projects/PROJECT_ID/inspectTemplates/TEMPLATE_ID` OR
  2909    // `organizations/ORGANIZATION_ID/inspectTemplates/TEMPLATE_ID`;
  2910    string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  2911  
  2912    // Display name (max 256 chars).
  2913    string display_name = 2;
  2914  
  2915    // Short description (max 256 chars).
  2916    string description = 3;
  2917  
  2918    // Output only. The creation timestamp of an inspectTemplate.
  2919    google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  2920  
  2921    // Output only. The last update timestamp of an inspectTemplate.
  2922    google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  2923  
  2924    // The core content of the template. Configuration of the scanning process.
  2925    InspectConfig inspect_config = 6;
  2926  }
  2927  
  2928  // DeidentifyTemplates contains instructions on how to de-identify content.
  2929  // See https://cloud.google.com/dlp/docs/concepts-templates to learn more.
  2930  message DeidentifyTemplate {
  2931    option (google.api.resource) = {
  2932      type: "dlp.googleapis.com/DeidentifyTemplate"
  2933      pattern: "organizations/{organization}/deidentifyTemplates/{deidentify_template}"
  2934      pattern: "projects/{project}/deidentifyTemplates/{deidentify_template}"
  2935      pattern: "organizations/{organization}/locations/{location}/deidentifyTemplates/{deidentify_template}"
  2936      pattern: "projects/{project}/locations/{location}/deidentifyTemplates/{deidentify_template}"
  2937    };
  2938  
  2939    // Output only. The template name.
  2940    //
  2941    // The template will have one of the following formats:
  2942    // `projects/PROJECT_ID/deidentifyTemplates/TEMPLATE_ID` OR
  2943    // `organizations/ORGANIZATION_ID/deidentifyTemplates/TEMPLATE_ID`
  2944    string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  2945  
  2946    // Display name (max 256 chars).
  2947    string display_name = 2;
  2948  
  2949    // Short description (max 256 chars).
  2950    string description = 3;
  2951  
  2952    // Output only. The creation timestamp of an inspectTemplate.
  2953    google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  2954  
  2955    // Output only. The last update timestamp of an inspectTemplate.
  2956    google.protobuf.Timestamp update_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
  2957  
  2958    // ///////////// // The core content of the template  // ///////////////
  2959    DeidentifyConfig deidentify_config = 6;
  2960  }
  2961  
  2962  // Details information about an error encountered during job execution or
  2963  // the results of an unsuccessful activation of the JobTrigger.
  2964  message Error {
  2965    // Detailed error codes and messages.
  2966    google.rpc.Status details = 1;
  2967  
  2968    // The times the error occurred.
  2969    repeated google.protobuf.Timestamp timestamps = 2;
  2970  }
  2971  
  2972  // Contains a configuration to make dlp api calls on a repeating basis.
  2973  // See https://cloud.google.com/dlp/docs/concepts-job-triggers to learn more.
  2974  message JobTrigger {
  2975    option (google.api.resource) = {
  2976      type: "dlp.googleapis.com/JobTrigger"
  2977      pattern: "projects/{project}/jobTriggers/{job_trigger}"
  2978      pattern: "projects/{project}/locations/{location}/jobTriggers/{job_trigger}"
  2979    };
  2980  
  2981    // What event needs to occur for a new job to be started.
  2982    message Trigger {
  2983      oneof trigger {
  2984        // Create a job on a repeating basis based on the elapse of time.
  2985        Schedule schedule = 1;
  2986  
  2987        // For use with hybrid jobs. Jobs must be manually created and finished.
  2988        // Early access feature is in a pre-release state and might change or have
  2989        // limited support. For more information, see
  2990        // https://cloud.google.com/products#product-launch-stages.
  2991        Manual manual = 2;
  2992      }
  2993    }
  2994  
  2995    // Whether the trigger is currently active. If PAUSED or CANCELLED, no jobs
  2996    // will be created with this configuration. The service may automatically
  2997    // pause triggers experiencing frequent errors. To restart a job, set the
  2998    // status to HEALTHY after correcting user errors.
  2999    enum Status {
  3000      // Unused.
  3001      STATUS_UNSPECIFIED = 0;
  3002  
  3003      // Trigger is healthy.
  3004      HEALTHY = 1;
  3005  
  3006      // Trigger is temporarily paused.
  3007      PAUSED = 2;
  3008  
  3009      // Trigger is cancelled and can not be resumed.
  3010      CANCELLED = 3;
  3011    }
  3012  
  3013    // Unique resource name for the triggeredJob, assigned by the service when the
  3014    // triggeredJob is created, for example
  3015    // `projects/dlp-test-project/jobTriggers/53234423`.
  3016    string name = 1;
  3017  
  3018    // Display name (max 100 chars)
  3019    string display_name = 2;
  3020  
  3021    // User provided description (max 256 chars)
  3022    string description = 3;
  3023  
  3024    // The configuration details for the specific type of job to run.
  3025    oneof job {
  3026      // For inspect jobs, a snapshot of the configuration.
  3027      InspectJobConfig inspect_job = 4;
  3028    }
  3029  
  3030    // A list of triggers which will be OR'ed together. Only one in the list
  3031    // needs to trigger for a job to be started. The list may contain only
  3032    // a single Schedule trigger and must have at least one object.
  3033    repeated Trigger triggers = 5;
  3034  
  3035    // Output only. A stream of errors encountered when the trigger was activated. Repeated
  3036    // errors may result in the JobTrigger automatically being paused.
  3037    // Will return the last 100 errors. Whenever the JobTrigger is modified
  3038    // this list will be cleared.
  3039    repeated Error errors = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  3040  
  3041    // Output only. The creation timestamp of a triggeredJob.
  3042    google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  3043  
  3044    // Output only. The last update timestamp of a triggeredJob.
  3045    google.protobuf.Timestamp update_time = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  3046  
  3047    // Output only. The timestamp of the last time this trigger executed.
  3048    google.protobuf.Timestamp last_run_time = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  3049  
  3050    // Required. A status for this trigger.
  3051    Status status = 10 [(google.api.field_behavior) = REQUIRED];
  3052  }
  3053  
  3054  // A task to execute on the completion of a job.
  3055  // See https://cloud.google.com/dlp/docs/concepts-actions to learn more.
  3056  message Action {
  3057    // If set, the detailed findings will be persisted to the specified
  3058    // OutputStorageConfig. Only a single instance of this action can be
  3059    // specified.
  3060    // Compatible with: Inspect, Risk
  3061    message SaveFindings {
  3062      // Location to store findings outside of DLP.
  3063      OutputStorageConfig output_config = 1;
  3064    }
  3065  
  3066    // Publish a message into given Pub/Sub topic when DlpJob has completed. The
  3067    // message contains a single field, `DlpJobName`, which is equal to the
  3068    // finished job's
  3069    // [`DlpJob.name`](https://cloud.google.com/dlp/docs/reference/rest/v2/projects.dlpJobs#DlpJob).
  3070    // Compatible with: Inspect, Risk
  3071    message PublishToPubSub {
  3072      // Cloud Pub/Sub topic to send notifications to. The topic must have given
  3073      // publishing access rights to the DLP API service account executing
  3074      // the long running DlpJob sending the notifications.
  3075      // Format is projects/{project}/topics/{topic}.
  3076      string topic = 1;
  3077    }
  3078  
  3079    // Publish the result summary of a DlpJob to the Cloud Security
  3080    // Command Center (CSCC Alpha).
  3081    // This action is only available for projects which are parts of
  3082    // an organization and whitelisted for the alpha Cloud Security Command
  3083    // Center.
  3084    // The action will publish count of finding instances and their info types.
  3085    // The summary of findings will be persisted in CSCC and are governed by CSCC
  3086    // service-specific policy, see https://cloud.google.com/terms/service-terms
  3087    // Only a single instance of this action can be specified.
  3088    // Compatible with: Inspect
  3089    message PublishSummaryToCscc {
  3090  
  3091    }
  3092  
  3093    // Publish findings of a DlpJob to Cloud Data Catalog. Labels summarizing the
  3094    // results of the DlpJob will be applied to the entry for the resource scanned
  3095    // in Cloud Data Catalog. Any labels previously written by another DlpJob will
  3096    // be deleted. InfoType naming patterns are strictly enforced when using this
  3097    // feature. Note that the findings will be persisted in Cloud Data Catalog
  3098    // storage and are governed by Data Catalog service-specific policy, see
  3099    // https://cloud.google.com/terms/service-terms
  3100    // Only a single instance of this action can be specified and only allowed if
  3101    // all resources being scanned are BigQuery tables.
  3102    // Compatible with: Inspect
  3103    message PublishFindingsToCloudDataCatalog {
  3104  
  3105    }
  3106  
  3107    // Enable email notification to project owners and editors on jobs's
  3108    // completion/failure.
  3109    message JobNotificationEmails {
  3110  
  3111    }
  3112  
  3113    // Enable Stackdriver metric dlp.googleapis.com/finding_count. This
  3114    // will publish a metric to stack driver on each infotype requested and
  3115    // how many findings were found for it. CustomDetectors will be bucketed
  3116    // as 'Custom' under the Stackdriver label 'info_type'.
  3117    message PublishToStackdriver {
  3118  
  3119    }
  3120  
  3121    oneof action {
  3122      // Save resulting findings in a provided location.
  3123      SaveFindings save_findings = 1;
  3124  
  3125      // Publish a notification to a pubsub topic.
  3126      PublishToPubSub pub_sub = 2;
  3127  
  3128      // Publish summary to Cloud Security Command Center (Alpha).
  3129      PublishSummaryToCscc publish_summary_to_cscc = 3;
  3130  
  3131      // Publish findings to Cloud Datahub.
  3132      PublishFindingsToCloudDataCatalog publish_findings_to_cloud_data_catalog = 5;
  3133  
  3134      // Enable email notification for project owners and editors on job's
  3135      // completion/failure.
  3136      JobNotificationEmails job_notification_emails = 8;
  3137  
  3138      // Enable Stackdriver metric dlp.googleapis.com/finding_count.
  3139      PublishToStackdriver publish_to_stackdriver = 9;
  3140    }
  3141  }
  3142  
  3143  // Request message for CreateInspectTemplate.
  3144  message CreateInspectTemplateRequest {
  3145    // Required. Parent resource name.
  3146    //
  3147    // The format of this value varies depending on the scope of the request
  3148    // (project or organization) and whether you have [specified a processing
  3149    // location](https://cloud.google.com/dlp/docs/specifying-location):
  3150    //
  3151    // + Projects scope, location specified:<br/>
  3152    //   `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3153    // + Projects scope, no location specified (defaults to global):<br/>
  3154    //   `projects/`<var>PROJECT_ID</var>
  3155    // + Organizations scope, location specified:<br/>
  3156    //   `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  3157    // + Organizations scope, no location specified (defaults to global):<br/>
  3158    //   `organizations/`<var>ORG_ID</var>
  3159    //
  3160    // The following example `parent` string specifies a parent project with the
  3161    // identifier `example-project`, and specifies the `europe-west3` location
  3162    // for processing data:
  3163    //
  3164    //     parent=projects/example-project/locations/europe-west3
  3165    string parent = 1 [
  3166      (google.api.field_behavior) = REQUIRED,
  3167      (google.api.resource_reference) = {
  3168        child_type: "dlp.googleapis.com/InspectTemplate"
  3169      }
  3170    ];
  3171  
  3172    // Required. The InspectTemplate to create.
  3173    InspectTemplate inspect_template = 2 [(google.api.field_behavior) = REQUIRED];
  3174  
  3175    // The template id can contain uppercase and lowercase letters,
  3176    // numbers, and hyphens; that is, it must match the regular
  3177    // expression: `[a-zA-Z\d-_]+`. The maximum length is 100
  3178    // characters. Can be empty to allow the system to generate one.
  3179    string template_id = 3;
  3180  
  3181    // Deprecated. This field has no effect.
  3182    string location_id = 4;
  3183  }
  3184  
  3185  // Request message for UpdateInspectTemplate.
  3186  message UpdateInspectTemplateRequest {
  3187    // Required. Resource name of organization and inspectTemplate to be updated, for
  3188    // example `organizations/433245324/inspectTemplates/432452342` or
  3189    // projects/project-id/inspectTemplates/432452342.
  3190    string name = 1 [
  3191      (google.api.field_behavior) = REQUIRED,
  3192      (google.api.resource_reference) = {
  3193        type: "dlp.googleapis.com/InspectTemplate"
  3194      }
  3195    ];
  3196  
  3197    // New InspectTemplate value.
  3198    InspectTemplate inspect_template = 2;
  3199  
  3200    // Mask to control which fields get updated.
  3201    google.protobuf.FieldMask update_mask = 3;
  3202  }
  3203  
  3204  // Request message for GetInspectTemplate.
  3205  message GetInspectTemplateRequest {
  3206    // Required. Resource name of the organization and inspectTemplate to be read, for
  3207    // example `organizations/433245324/inspectTemplates/432452342` or
  3208    // projects/project-id/inspectTemplates/432452342.
  3209    string name = 1 [
  3210      (google.api.field_behavior) = REQUIRED,
  3211      (google.api.resource_reference) = {
  3212        type: "dlp.googleapis.com/InspectTemplate"
  3213      }
  3214    ];
  3215  }
  3216  
  3217  // Request message for ListInspectTemplates.
  3218  message ListInspectTemplatesRequest {
  3219    // Required. Parent resource name.
  3220    //
  3221    // The format of this value varies depending on the scope of the request
  3222    // (project or organization) and whether you have [specified a processing
  3223    // location](https://cloud.google.com/dlp/docs/specifying-location):
  3224    //
  3225    // + Projects scope, location specified:<br/>
  3226    //   `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3227    // + Projects scope, no location specified (defaults to global):<br/>
  3228    //   `projects/`<var>PROJECT_ID</var>
  3229    // + Organizations scope, location specified:<br/>
  3230    //   `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  3231    // + Organizations scope, no location specified (defaults to global):<br/>
  3232    //   `organizations/`<var>ORG_ID</var>
  3233    //
  3234    // The following example `parent` string specifies a parent project with the
  3235    // identifier `example-project`, and specifies the `europe-west3` location
  3236    // for processing data:
  3237    //
  3238    //     parent=projects/example-project/locations/europe-west3
  3239    string parent = 1 [
  3240      (google.api.field_behavior) = REQUIRED,
  3241      (google.api.resource_reference) = {
  3242        child_type: "dlp.googleapis.com/InspectTemplate"
  3243      }
  3244    ];
  3245  
  3246    // Page token to continue retrieval. Comes from previous call
  3247    // to `ListInspectTemplates`.
  3248    string page_token = 2;
  3249  
  3250    // Size of the page, can be limited by server. If zero server returns
  3251    // a page of max size 100.
  3252    int32 page_size = 3;
  3253  
  3254    // Comma separated list of fields to order by,
  3255    // followed by `asc` or `desc` postfix. This list is case-insensitive,
  3256    // default sorting order is ascending, redundant space characters are
  3257    // insignificant.
  3258    //
  3259    // Example: `name asc,update_time, create_time desc`
  3260    //
  3261    // Supported fields are:
  3262    //
  3263    // - `create_time`: corresponds to time the template was created.
  3264    // - `update_time`: corresponds to time the template was last updated.
  3265    // - `name`: corresponds to template's name.
  3266    // - `display_name`: corresponds to template's display name.
  3267    string order_by = 4;
  3268  
  3269    // Deprecated. This field has no effect.
  3270    string location_id = 5;
  3271  }
  3272  
  3273  // Response message for ListInspectTemplates.
  3274  message ListInspectTemplatesResponse {
  3275    // List of inspectTemplates, up to page_size in ListInspectTemplatesRequest.
  3276    repeated InspectTemplate inspect_templates = 1;
  3277  
  3278    // If the next page is available then the next page token to be used
  3279    // in following ListInspectTemplates request.
  3280    string next_page_token = 2;
  3281  }
  3282  
  3283  // Request message for DeleteInspectTemplate.
  3284  message DeleteInspectTemplateRequest {
  3285    // Required. Resource name of the organization and inspectTemplate to be deleted, for
  3286    // example `organizations/433245324/inspectTemplates/432452342` or
  3287    // projects/project-id/inspectTemplates/432452342.
  3288    string name = 1 [
  3289      (google.api.field_behavior) = REQUIRED,
  3290      (google.api.resource_reference) = {
  3291        type: "dlp.googleapis.com/InspectTemplate"
  3292      }
  3293    ];
  3294  }
  3295  
  3296  // Request message for CreateJobTrigger.
  3297  message CreateJobTriggerRequest {
  3298    // Required. Parent resource name.
  3299    //
  3300    // The format of this value varies depending on whether you have [specified a
  3301    // processing
  3302    // location](https://cloud.google.com/dlp/docs/specifying-location):
  3303    //
  3304    // + Projects scope, location specified:<br/>
  3305    //   `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3306    // + Projects scope, no location specified (defaults to global):<br/>
  3307    //   `projects/`<var>PROJECT_ID</var>
  3308    //
  3309    // The following example `parent` string specifies a parent project with the
  3310    // identifier `example-project`, and specifies the `europe-west3` location
  3311    // for processing data:
  3312    //
  3313    //     parent=projects/example-project/locations/europe-west3
  3314    string parent = 1 [
  3315      (google.api.field_behavior) = REQUIRED,
  3316      (google.api.resource_reference) = {
  3317        child_type: "dlp.googleapis.com/JobTrigger"
  3318      }
  3319    ];
  3320  
  3321    // Required. The JobTrigger to create.
  3322    JobTrigger job_trigger = 2 [(google.api.field_behavior) = REQUIRED];
  3323  
  3324    // The trigger id can contain uppercase and lowercase letters,
  3325    // numbers, and hyphens; that is, it must match the regular
  3326    // expression: `[a-zA-Z\d-_]+`. The maximum length is 100
  3327    // characters. Can be empty to allow the system to generate one.
  3328    string trigger_id = 3;
  3329  
  3330    // Deprecated. This field has no effect.
  3331    string location_id = 4;
  3332  }
  3333  
  3334  // Request message for ActivateJobTrigger.
  3335  message ActivateJobTriggerRequest {
  3336    // Required. Resource name of the trigger to activate, for example
  3337    // `projects/dlp-test-project/jobTriggers/53234423`.
  3338    string name = 1 [
  3339      (google.api.field_behavior) = REQUIRED,
  3340      (google.api.resource_reference) = {
  3341        type: "dlp.googleapis.com/JobTrigger"
  3342      }
  3343    ];
  3344  }
  3345  
  3346  // Request message for UpdateJobTrigger.
  3347  message UpdateJobTriggerRequest {
  3348    // Required. Resource name of the project and the triggeredJob, for example
  3349    // `projects/dlp-test-project/jobTriggers/53234423`.
  3350    string name = 1 [
  3351      (google.api.field_behavior) = REQUIRED,
  3352      (google.api.resource_reference) = {
  3353        type: "dlp.googleapis.com/JobTrigger"
  3354      }
  3355    ];
  3356  
  3357    // New JobTrigger value.
  3358    JobTrigger job_trigger = 2;
  3359  
  3360    // Mask to control which fields get updated.
  3361    google.protobuf.FieldMask update_mask = 3;
  3362  }
  3363  
  3364  // Request message for GetJobTrigger.
  3365  message GetJobTriggerRequest {
  3366    // Required. Resource name of the project and the triggeredJob, for example
  3367    // `projects/dlp-test-project/jobTriggers/53234423`.
  3368    string name = 1 [
  3369      (google.api.field_behavior) = REQUIRED,
  3370      (google.api.resource_reference) = {
  3371        type: "dlp.googleapis.com/JobTrigger"
  3372      }
  3373    ];
  3374  }
  3375  
  3376  // Request message for CreateDlpJobRequest. Used to initiate long running
  3377  // jobs such as calculating risk metrics or inspecting Google Cloud
  3378  // Storage.
  3379  message CreateDlpJobRequest {
  3380    // Required. Parent resource name.
  3381    //
  3382    // The format of this value varies depending on whether you have [specified a
  3383    // processing
  3384    // location](https://cloud.google.com/dlp/docs/specifying-location):
  3385    //
  3386    // + Projects scope, location specified:<br/>
  3387    //   `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3388    // + Projects scope, no location specified (defaults to global):<br/>
  3389    //   `projects/`<var>PROJECT_ID</var>
  3390    //
  3391    // The following example `parent` string specifies a parent project with the
  3392    // identifier `example-project`, and specifies the `europe-west3` location
  3393    // for processing data:
  3394    //
  3395    //     parent=projects/example-project/locations/europe-west3
  3396    string parent = 1 [
  3397      (google.api.field_behavior) = REQUIRED,
  3398      (google.api.resource_reference) = {
  3399        child_type: "dlp.googleapis.com/DlpJob"
  3400      }
  3401    ];
  3402  
  3403    // The configuration details for the specific type of job to run.
  3404    oneof job {
  3405      // Set to control what and how to inspect.
  3406      InspectJobConfig inspect_job = 2;
  3407  
  3408      // Set to choose what metric to calculate.
  3409      RiskAnalysisJobConfig risk_job = 3;
  3410    }
  3411  
  3412    // The job id can contain uppercase and lowercase letters,
  3413    // numbers, and hyphens; that is, it must match the regular
  3414    // expression: `[a-zA-Z\d-_]+`. The maximum length is 100
  3415    // characters. Can be empty to allow the system to generate one.
  3416    string job_id = 4;
  3417  
  3418    // Deprecated. This field has no effect.
  3419    string location_id = 5;
  3420  }
  3421  
  3422  // Request message for ListJobTriggers.
  3423  message ListJobTriggersRequest {
  3424    // Required. Parent resource name.
  3425    //
  3426    // The format of this value varies depending on whether you have [specified a
  3427    // processing
  3428    // location](https://cloud.google.com/dlp/docs/specifying-location):
  3429    //
  3430    // + Projects scope, location specified:<br/>
  3431    //   `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3432    // + Projects scope, no location specified (defaults to global):<br/>
  3433    //   `projects/`<var>PROJECT_ID</var>
  3434    //
  3435    // The following example `parent` string specifies a parent project with the
  3436    // identifier `example-project`, and specifies the `europe-west3` location
  3437    // for processing data:
  3438    //
  3439    //     parent=projects/example-project/locations/europe-west3
  3440    string parent = 1 [
  3441      (google.api.field_behavior) = REQUIRED,
  3442      (google.api.resource_reference) = {
  3443        child_type: "dlp.googleapis.com/JobTrigger"
  3444      }
  3445    ];
  3446  
  3447    // Page token to continue retrieval. Comes from previous call
  3448    // to ListJobTriggers. `order_by` field must not
  3449    // change for subsequent calls.
  3450    string page_token = 2;
  3451  
  3452    // Size of the page, can be limited by a server.
  3453    int32 page_size = 3;
  3454  
  3455    // Comma separated list of triggeredJob fields to order by,
  3456    // followed by `asc` or `desc` postfix. This list is case-insensitive,
  3457    // default sorting order is ascending, redundant space characters are
  3458    // insignificant.
  3459    //
  3460    // Example: `name asc,update_time, create_time desc`
  3461    //
  3462    // Supported fields are:
  3463    //
  3464    // - `create_time`: corresponds to time the JobTrigger was created.
  3465    // - `update_time`: corresponds to time the JobTrigger was last updated.
  3466    // - `last_run_time`: corresponds to the last time the JobTrigger ran.
  3467    // - `name`: corresponds to JobTrigger's name.
  3468    // - `display_name`: corresponds to JobTrigger's display name.
  3469    // - `status`: corresponds to JobTrigger's status.
  3470    string order_by = 4;
  3471  
  3472    // Allows filtering.
  3473    //
  3474    // Supported syntax:
  3475    //
  3476    // * Filter expressions are made up of one or more restrictions.
  3477    // * Restrictions can be combined by `AND` or `OR` logical operators. A
  3478    // sequence of restrictions implicitly uses `AND`.
  3479    // * A restriction has the form of `{field} {operator} {value}`.
  3480    // * Supported fields/values for inspect jobs:
  3481    //     - `status` - HEALTHY|PAUSED|CANCELLED
  3482    //     - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY
  3483    //     - 'last_run_time` - RFC 3339 formatted timestamp, surrounded by
  3484    //     quotation marks. Nanoseconds are ignored.
  3485    //     - 'error_count' - Number of errors that have occurred while running.
  3486    // * The operator must be `=` or `!=` for status and inspected_storage.
  3487    //
  3488    // Examples:
  3489    //
  3490    // * inspected_storage = cloud_storage AND status = HEALTHY
  3491    // * inspected_storage = cloud_storage OR inspected_storage = bigquery
  3492    // * inspected_storage = cloud_storage AND (state = PAUSED OR state = HEALTHY)
  3493    // * last_run_time > \"2017-12-12T00:00:00+00:00\"
  3494    //
  3495    // The length of this field should be no more than 500 characters.
  3496    string filter = 5;
  3497  
  3498    // Deprecated. This field has no effect.
  3499    string location_id = 7;
  3500  }
  3501  
  3502  // Response message for ListJobTriggers.
  3503  message ListJobTriggersResponse {
  3504    // List of triggeredJobs, up to page_size in ListJobTriggersRequest.
  3505    repeated JobTrigger job_triggers = 1;
  3506  
  3507    // If the next page is available then the next page token to be used
  3508    // in following ListJobTriggers request.
  3509    string next_page_token = 2;
  3510  }
  3511  
  3512  // Request message for DeleteJobTrigger.
  3513  message DeleteJobTriggerRequest {
  3514    // Required. Resource name of the project and the triggeredJob, for example
  3515    // `projects/dlp-test-project/jobTriggers/53234423`.
  3516    string name = 1 [
  3517      (google.api.field_behavior) = REQUIRED,
  3518      (google.api.resource_reference) = {
  3519        type: "dlp.googleapis.com/JobTrigger"
  3520      }
  3521    ];
  3522  }
  3523  
  3524  // Controls what and how to inspect for findings.
  3525  message InspectJobConfig {
  3526    // The data to scan.
  3527    StorageConfig storage_config = 1;
  3528  
  3529    // How and what to scan for.
  3530    InspectConfig inspect_config = 2;
  3531  
  3532    // If provided, will be used as the default for all values in InspectConfig.
  3533    // `inspect_config` will be merged into the values persisted as part of the
  3534    // template.
  3535    string inspect_template_name = 3;
  3536  
  3537    // Actions to execute at the completion of the job.
  3538    repeated Action actions = 4;
  3539  }
  3540  
  3541  // Combines all of the information about a DLP job.
  3542  message DlpJob {
  3543    option (google.api.resource) = {
  3544      type: "dlp.googleapis.com/DlpJob"
  3545      pattern: "projects/{project}/dlpJobs/{dlp_job}"
  3546      pattern: "projects/{project}/locations/{location}/dlpJobs/{dlp_job}"
  3547    };
  3548  
  3549    // Possible states of a job. New items may be added.
  3550    enum JobState {
  3551      // Unused.
  3552      JOB_STATE_UNSPECIFIED = 0;
  3553  
  3554      // The job has not yet started.
  3555      PENDING = 1;
  3556  
  3557      // The job is currently running. Once a job has finished it will transition
  3558      // to FAILED or DONE.
  3559      RUNNING = 2;
  3560  
  3561      // The job is no longer running.
  3562      DONE = 3;
  3563  
  3564      // The job was canceled before it could complete.
  3565      CANCELED = 4;
  3566  
  3567      // The job had an error and did not complete.
  3568      FAILED = 5;
  3569  
  3570      // The job is currently accepting findings via hybridInspect.
  3571      // A hybrid job in ACTIVE state may continue to have findings added to it
  3572      // through calling of hybridInspect. After the job has finished no more
  3573      // calls to hybridInspect may be made. ACTIVE jobs can transition to DONE.
  3574      ACTIVE = 6;
  3575    }
  3576  
  3577    // The server-assigned name.
  3578    string name = 1;
  3579  
  3580    // The type of job.
  3581    DlpJobType type = 2;
  3582  
  3583    // State of a job.
  3584    JobState state = 3;
  3585  
  3586    oneof details {
  3587      // Results from analyzing risk of a data source.
  3588      AnalyzeDataSourceRiskDetails risk_details = 4;
  3589  
  3590      // Results from inspecting a data source.
  3591      InspectDataSourceDetails inspect_details = 5;
  3592    }
  3593  
  3594    // Time when the job was created.
  3595    google.protobuf.Timestamp create_time = 6;
  3596  
  3597    // Time when the job started.
  3598    google.protobuf.Timestamp start_time = 7;
  3599  
  3600    // Time when the job finished.
  3601    google.protobuf.Timestamp end_time = 8;
  3602  
  3603    // If created by a job trigger, the resource name of the trigger that
  3604    // instantiated the job.
  3605    string job_trigger_name = 10;
  3606  
  3607    // A stream of errors encountered running the job.
  3608    repeated Error errors = 11;
  3609  }
  3610  
  3611  // The request message for [DlpJobs.GetDlpJob][].
  3612  message GetDlpJobRequest {
  3613    // Required. The name of the DlpJob resource.
  3614    string name = 1 [
  3615      (google.api.field_behavior) = REQUIRED,
  3616      (google.api.resource_reference) = {
  3617        type: "dlp.googleapis.com/DlpJob"
  3618      }
  3619    ];
  3620  }
  3621  
  3622  // The request message for listing DLP jobs.
  3623  message ListDlpJobsRequest {
  3624    // Required. Parent resource name.
  3625    //
  3626    // The format of this value varies depending on whether you have [specified a
  3627    // processing
  3628    // location](https://cloud.google.com/dlp/docs/specifying-location):
  3629    //
  3630    // + Projects scope, location specified:<br/>
  3631    //   `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3632    // + Projects scope, no location specified (defaults to global):<br/>
  3633    //   `projects/`<var>PROJECT_ID</var>
  3634    //
  3635    // The following example `parent` string specifies a parent project with the
  3636    // identifier `example-project`, and specifies the `europe-west3` location
  3637    // for processing data:
  3638    //
  3639    //     parent=projects/example-project/locations/europe-west3
  3640    string parent = 4 [
  3641      (google.api.field_behavior) = REQUIRED,
  3642      (google.api.resource_reference) = {
  3643        child_type: "dlp.googleapis.com/DlpJob"
  3644      }
  3645    ];
  3646  
  3647    // Allows filtering.
  3648    //
  3649    // Supported syntax:
  3650    //
  3651    // * Filter expressions are made up of one or more restrictions.
  3652    // * Restrictions can be combined by `AND` or `OR` logical operators. A
  3653    // sequence of restrictions implicitly uses `AND`.
  3654    // * A restriction has the form of `{field} {operator} {value}`.
  3655    // * Supported fields/values for inspect jobs:
  3656    //     - `state` - PENDING|RUNNING|CANCELED|FINISHED|FAILED
  3657    //     - `inspected_storage` - DATASTORE|CLOUD_STORAGE|BIGQUERY
  3658    //     - `trigger_name` - The resource name of the trigger that created job.
  3659    //     - 'end_time` - Corresponds to time the job finished.
  3660    //     - 'start_time` - Corresponds to time the job finished.
  3661    // * Supported fields for risk analysis jobs:
  3662    //     - `state` - RUNNING|CANCELED|FINISHED|FAILED
  3663    //     - 'end_time` - Corresponds to time the job finished.
  3664    //     - 'start_time` - Corresponds to time the job finished.
  3665    // * The operator must be `=` or `!=`.
  3666    //
  3667    // Examples:
  3668    //
  3669    // * inspected_storage = cloud_storage AND state = done
  3670    // * inspected_storage = cloud_storage OR inspected_storage = bigquery
  3671    // * inspected_storage = cloud_storage AND (state = done OR state = canceled)
  3672    // * end_time > \"2017-12-12T00:00:00+00:00\"
  3673    //
  3674    // The length of this field should be no more than 500 characters.
  3675    string filter = 1;
  3676  
  3677    // The standard list page size.
  3678    int32 page_size = 2;
  3679  
  3680    // The standard list page token.
  3681    string page_token = 3;
  3682  
  3683    // The type of job. Defaults to `DlpJobType.INSPECT`
  3684    DlpJobType type = 5;
  3685  
  3686    // Comma separated list of fields to order by,
  3687    // followed by `asc` or `desc` postfix. This list is case-insensitive,
  3688    // default sorting order is ascending, redundant space characters are
  3689    // insignificant.
  3690    //
  3691    // Example: `name asc, end_time asc, create_time desc`
  3692    //
  3693    // Supported fields are:
  3694    //
  3695    // - `create_time`: corresponds to time the job was created.
  3696    // - `end_time`: corresponds to time the job ended.
  3697    // - `name`: corresponds to job's name.
  3698    // - `state`: corresponds to `state`
  3699    string order_by = 6;
  3700  
  3701    // Deprecated. This field has no effect.
  3702    string location_id = 7;
  3703  }
  3704  
  3705  // The response message for listing DLP jobs.
  3706  message ListDlpJobsResponse {
  3707    // A list of DlpJobs that matches the specified filter in the request.
  3708    repeated DlpJob jobs = 1;
  3709  
  3710    // The standard List next-page token.
  3711    string next_page_token = 2;
  3712  }
  3713  
  3714  // The request message for canceling a DLP job.
  3715  message CancelDlpJobRequest {
  3716    // Required. The name of the DlpJob resource to be cancelled.
  3717    string name = 1 [
  3718      (google.api.field_behavior) = REQUIRED,
  3719      (google.api.resource_reference) = {
  3720        type: "dlp.googleapis.com/DlpJob"
  3721      }
  3722    ];
  3723  }
  3724  
  3725  // The request message for finishing a DLP hybrid job.
  3726  message FinishDlpJobRequest {
  3727    // Required. The name of the DlpJob resource to be cancelled.
  3728    string name = 1 [
  3729      (google.api.field_behavior) = REQUIRED,
  3730      (google.api.resource_reference) = {
  3731        type: "dlp.googleapis.com/DlpJob"
  3732      }
  3733    ];
  3734  }
  3735  
  3736  // The request message for deleting a DLP job.
  3737  message DeleteDlpJobRequest {
  3738    // Required. The name of the DlpJob resource to be deleted.
  3739    string name = 1 [
  3740      (google.api.field_behavior) = REQUIRED,
  3741      (google.api.resource_reference) = {
  3742        type: "dlp.googleapis.com/DlpJob"
  3743      }
  3744    ];
  3745  }
  3746  
  3747  // Request message for CreateDeidentifyTemplate.
  3748  message CreateDeidentifyTemplateRequest {
  3749    // Required. Parent resource name.
  3750    //
  3751    // The format of this value varies depending on the scope of the request
  3752    // (project or organization) and whether you have [specified a processing
  3753    // location](https://cloud.google.com/dlp/docs/specifying-location):
  3754    //
  3755    // + Projects scope, location specified:<br/>
  3756    //   `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3757    // + Projects scope, no location specified (defaults to global):<br/>
  3758    //   `projects/`<var>PROJECT_ID</var>
  3759    // + Organizations scope, location specified:<br/>
  3760    //   `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  3761    // + Organizations scope, no location specified (defaults to global):<br/>
  3762    //   `organizations/`<var>ORG_ID</var>
  3763    //
  3764    // The following example `parent` string specifies a parent project with the
  3765    // identifier `example-project`, and specifies the `europe-west3` location
  3766    // for processing data:
  3767    //
  3768    //     parent=projects/example-project/locations/europe-west3
  3769    string parent = 1 [
  3770      (google.api.field_behavior) = REQUIRED,
  3771      (google.api.resource_reference) = {
  3772        child_type: "dlp.googleapis.com/DeidentifyTemplate"
  3773      }
  3774    ];
  3775  
  3776    // Required. The DeidentifyTemplate to create.
  3777    DeidentifyTemplate deidentify_template = 2 [(google.api.field_behavior) = REQUIRED];
  3778  
  3779    // The template id can contain uppercase and lowercase letters,
  3780    // numbers, and hyphens; that is, it must match the regular
  3781    // expression: `[a-zA-Z\d-_]+`. The maximum length is 100
  3782    // characters. Can be empty to allow the system to generate one.
  3783    string template_id = 3;
  3784  
  3785    // Deprecated. This field has no effect.
  3786    string location_id = 4;
  3787  }
  3788  
  3789  // Request message for UpdateDeidentifyTemplate.
  3790  message UpdateDeidentifyTemplateRequest {
  3791    // Required. Resource name of organization and deidentify template to be updated, for
  3792    // example `organizations/433245324/deidentifyTemplates/432452342` or
  3793    // projects/project-id/deidentifyTemplates/432452342.
  3794    string name = 1 [
  3795      (google.api.field_behavior) = REQUIRED,
  3796      (google.api.resource_reference) = {
  3797        type: "dlp.googleapis.com/DeidentifyTemplate"
  3798      }
  3799    ];
  3800  
  3801    // New DeidentifyTemplate value.
  3802    DeidentifyTemplate deidentify_template = 2;
  3803  
  3804    // Mask to control which fields get updated.
  3805    google.protobuf.FieldMask update_mask = 3;
  3806  }
  3807  
  3808  // Request message for GetDeidentifyTemplate.
  3809  message GetDeidentifyTemplateRequest {
  3810    // Required. Resource name of the organization and deidentify template to be read, for
  3811    // example `organizations/433245324/deidentifyTemplates/432452342` or
  3812    // projects/project-id/deidentifyTemplates/432452342.
  3813    string name = 1 [
  3814      (google.api.field_behavior) = REQUIRED,
  3815      (google.api.resource_reference) = {
  3816        type: "dlp.googleapis.com/DeidentifyTemplate"
  3817      }
  3818    ];
  3819  }
  3820  
  3821  // Request message for ListDeidentifyTemplates.
  3822  message ListDeidentifyTemplatesRequest {
  3823    // Required. Parent resource name.
  3824    //
  3825    // The format of this value varies depending on the scope of the request
  3826    // (project or organization) and whether you have [specified a processing
  3827    // location](https://cloud.google.com/dlp/docs/specifying-location):
  3828    //
  3829    // + Projects scope, location specified:<br/>
  3830    //   `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  3831    // + Projects scope, no location specified (defaults to global):<br/>
  3832    //   `projects/`<var>PROJECT_ID</var>
  3833    // + Organizations scope, location specified:<br/>
  3834    //   `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  3835    // + Organizations scope, no location specified (defaults to global):<br/>
  3836    //   `organizations/`<var>ORG_ID</var>
  3837    //
  3838    // The following example `parent` string specifies a parent project with the
  3839    // identifier `example-project`, and specifies the `europe-west3` location
  3840    // for processing data:
  3841    //
  3842    //     parent=projects/example-project/locations/europe-west3
  3843    string parent = 1 [
  3844      (google.api.field_behavior) = REQUIRED,
  3845      (google.api.resource_reference) = {
  3846        child_type: "dlp.googleapis.com/DeidentifyTemplate"
  3847      }
  3848    ];
  3849  
  3850    // Page token to continue retrieval. Comes from previous call
  3851    // to `ListDeidentifyTemplates`.
  3852    string page_token = 2;
  3853  
  3854    // Size of the page, can be limited by server. If zero server returns
  3855    // a page of max size 100.
  3856    int32 page_size = 3;
  3857  
  3858    // Comma separated list of fields to order by,
  3859    // followed by `asc` or `desc` postfix. This list is case-insensitive,
  3860    // default sorting order is ascending, redundant space characters are
  3861    // insignificant.
  3862    //
  3863    // Example: `name asc,update_time, create_time desc`
  3864    //
  3865    // Supported fields are:
  3866    //
  3867    // - `create_time`: corresponds to time the template was created.
  3868    // - `update_time`: corresponds to time the template was last updated.
  3869    // - `name`: corresponds to template's name.
  3870    // - `display_name`: corresponds to template's display name.
  3871    string order_by = 4;
  3872  
  3873    // Deprecated. This field has no effect.
  3874    string location_id = 5;
  3875  }
  3876  
  3877  // Response message for ListDeidentifyTemplates.
  3878  message ListDeidentifyTemplatesResponse {
  3879    // List of deidentify templates, up to page_size in
  3880    // ListDeidentifyTemplatesRequest.
  3881    repeated DeidentifyTemplate deidentify_templates = 1;
  3882  
  3883    // If the next page is available then the next page token to be used
  3884    // in following ListDeidentifyTemplates request.
  3885    string next_page_token = 2;
  3886  }
  3887  
  3888  // Request message for DeleteDeidentifyTemplate.
  3889  message DeleteDeidentifyTemplateRequest {
  3890    // Required. Resource name of the organization and deidentify template to be deleted,
  3891    // for example `organizations/433245324/deidentifyTemplates/432452342` or
  3892    // projects/project-id/deidentifyTemplates/432452342.
  3893    string name = 1 [
  3894      (google.api.field_behavior) = REQUIRED,
  3895      (google.api.resource_reference) = {
  3896        type: "dlp.googleapis.com/DeidentifyTemplate"
  3897      }
  3898    ];
  3899  }
  3900  
  3901  // Configuration for a custom dictionary created from a data source of any size
  3902  // up to the maximum size defined in the
  3903  // [limits](https://cloud.google.com/dlp/limits) page. The artifacts of
  3904  // dictionary creation are stored in the specified Google Cloud Storage
  3905  // location. Consider using `CustomInfoType.Dictionary` for smaller dictionaries
  3906  // that satisfy the size requirements.
  3907  message LargeCustomDictionaryConfig {
  3908    // Location to store dictionary artifacts in Google Cloud Storage. These files
  3909    // will only be accessible by project owners and the DLP API. If any of these
  3910    // artifacts are modified, the dictionary is considered invalid and can no
  3911    // longer be used.
  3912    CloudStoragePath output_path = 1;
  3913  
  3914    oneof source {
  3915      // Set of files containing newline-delimited lists of dictionary phrases.
  3916      CloudStorageFileSet cloud_storage_file_set = 2;
  3917  
  3918      // Field in a BigQuery table where each cell represents a dictionary phrase.
  3919      BigQueryField big_query_field = 3;
  3920    }
  3921  }
  3922  
  3923  // Summary statistics of a custom dictionary.
  3924  message LargeCustomDictionaryStats {
  3925    // Approximate number of distinct phrases in the dictionary.
  3926    int64 approx_num_phrases = 1;
  3927  }
  3928  
  3929  // Configuration for stored infoTypes. All fields and subfield are provided
  3930  // by the user. For more information, see
  3931  // https://cloud.google.com/dlp/docs/creating-custom-infotypes.
  3932  message StoredInfoTypeConfig {
  3933    // Display name of the StoredInfoType (max 256 characters).
  3934    string display_name = 1;
  3935  
  3936    // Description of the StoredInfoType (max 256 characters).
  3937    string description = 2;
  3938  
  3939    // Stored infotype types.
  3940    oneof type {
  3941      // StoredInfoType where findings are defined by a dictionary of phrases.
  3942      LargeCustomDictionaryConfig large_custom_dictionary = 3;
  3943  
  3944      // Store dictionary-based CustomInfoType.
  3945      CustomInfoType.Dictionary dictionary = 4;
  3946  
  3947      // Store regular expression-based StoredInfoType.
  3948      CustomInfoType.Regex regex = 5;
  3949    }
  3950  }
  3951  
  3952  // Statistics for a StoredInfoType.
  3953  message StoredInfoTypeStats {
  3954    // Stat types
  3955    oneof type {
  3956      // StoredInfoType where findings are defined by a dictionary of phrases.
  3957      LargeCustomDictionaryStats large_custom_dictionary = 1;
  3958    }
  3959  }
  3960  
  3961  // Version of a StoredInfoType, including the configuration used to build it,
  3962  // create timestamp, and current state.
  3963  message StoredInfoTypeVersion {
  3964    // StoredInfoType configuration.
  3965    StoredInfoTypeConfig config = 1;
  3966  
  3967    // Create timestamp of the version. Read-only, determined by the system
  3968    // when the version is created.
  3969    google.protobuf.Timestamp create_time = 2;
  3970  
  3971    // Stored info type version state. Read-only, updated by the system
  3972    // during dictionary creation.
  3973    StoredInfoTypeState state = 3;
  3974  
  3975    // Errors that occurred when creating this storedInfoType version, or
  3976    // anomalies detected in the storedInfoType data that render it unusable. Only
  3977    // the five most recent errors will be displayed, with the most recent error
  3978    // appearing first.
  3979    //
  3980    // For example, some of the data for stored custom dictionaries is put in
  3981    // the user's Google Cloud Storage bucket, and if this data is modified or
  3982    // deleted by the user or another system, the dictionary becomes invalid.
  3983    //
  3984    // If any errors occur, fix the problem indicated by the error message and
  3985    // use the UpdateStoredInfoType API method to create another version of the
  3986    // storedInfoType to continue using it, reusing the same `config` if it was
  3987    // not the source of the error.
  3988    repeated Error errors = 4;
  3989  
  3990    // Statistics about this storedInfoType version.
  3991    StoredInfoTypeStats stats = 5;
  3992  }
  3993  
  3994  // StoredInfoType resource message that contains information about the current
  3995  // version and any pending updates.
  3996  message StoredInfoType {
  3997    option (google.api.resource) = {
  3998      type: "dlp.googleapis.com/StoredInfoType"
  3999      pattern: "organizations/{organization}/storedInfoTypes/{stored_info_type}"
  4000      pattern: "projects/{project}/storedInfoTypes/{stored_info_type}"
  4001      pattern: "organizations/{organization}/locations/{location}/storedInfoTypes/{stored_info_type}"
  4002      pattern: "projects/{project}/locations/{location}/storedInfoTypes/{stored_info_type}"
  4003    };
  4004  
  4005    // Resource name.
  4006    string name = 1;
  4007  
  4008    // Current version of the stored info type.
  4009    StoredInfoTypeVersion current_version = 2;
  4010  
  4011    // Pending versions of the stored info type. Empty if no versions are
  4012    // pending.
  4013    repeated StoredInfoTypeVersion pending_versions = 3;
  4014  }
  4015  
  4016  // Request message for CreateStoredInfoType.
  4017  message CreateStoredInfoTypeRequest {
  4018    // Required. Parent resource name.
  4019    //
  4020    // The format of this value varies depending on the scope of the request
  4021    // (project or organization) and whether you have [specified a processing
  4022    // location](https://cloud.google.com/dlp/docs/specifying-location):
  4023    //
  4024    // + Projects scope, location specified:<br/>
  4025    //   `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  4026    // + Projects scope, no location specified (defaults to global):<br/>
  4027    //   `projects/`<var>PROJECT_ID</var>
  4028    // + Organizations scope, location specified:<br/>
  4029    //   `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  4030    // + Organizations scope, no location specified (defaults to global):<br/>
  4031    //   `organizations/`<var>ORG_ID</var>
  4032    //
  4033    // The following example `parent` string specifies a parent project with the
  4034    // identifier `example-project`, and specifies the `europe-west3` location
  4035    // for processing data:
  4036    //
  4037    //     parent=projects/example-project/locations/europe-west3
  4038    string parent = 1 [
  4039      (google.api.field_behavior) = REQUIRED,
  4040      (google.api.resource_reference) = {
  4041        child_type: "dlp.googleapis.com/StoredInfoType"
  4042      }
  4043    ];
  4044  
  4045    // Required. Configuration of the storedInfoType to create.
  4046    StoredInfoTypeConfig config = 2 [(google.api.field_behavior) = REQUIRED];
  4047  
  4048    // The storedInfoType ID can contain uppercase and lowercase letters,
  4049    // numbers, and hyphens; that is, it must match the regular
  4050    // expression: `[a-zA-Z\d-_]+`. The maximum length is 100
  4051    // characters. Can be empty to allow the system to generate one.
  4052    string stored_info_type_id = 3;
  4053  
  4054    // Deprecated. This field has no effect.
  4055    string location_id = 4;
  4056  }
  4057  
  4058  // Request message for UpdateStoredInfoType.
  4059  message UpdateStoredInfoTypeRequest {
  4060    // Required. Resource name of organization and storedInfoType to be updated, for
  4061    // example `organizations/433245324/storedInfoTypes/432452342` or
  4062    // projects/project-id/storedInfoTypes/432452342.
  4063    string name = 1 [
  4064      (google.api.field_behavior) = REQUIRED,
  4065      (google.api.resource_reference) = {
  4066        type: "dlp.googleapis.com/StoredInfoType"
  4067      }
  4068    ];
  4069  
  4070    // Updated configuration for the storedInfoType. If not provided, a new
  4071    // version of the storedInfoType will be created with the existing
  4072    // configuration.
  4073    StoredInfoTypeConfig config = 2;
  4074  
  4075    // Mask to control which fields get updated.
  4076    google.protobuf.FieldMask update_mask = 3;
  4077  }
  4078  
  4079  // Request message for GetStoredInfoType.
  4080  message GetStoredInfoTypeRequest {
  4081    // Required. Resource name of the organization and storedInfoType to be read, for
  4082    // example `organizations/433245324/storedInfoTypes/432452342` or
  4083    // projects/project-id/storedInfoTypes/432452342.
  4084    string name = 1 [
  4085      (google.api.field_behavior) = REQUIRED,
  4086      (google.api.resource_reference) = {
  4087        type: "dlp.googleapis.com/StoredInfoType"
  4088      }
  4089    ];
  4090  }
  4091  
  4092  // Request message for ListStoredInfoTypes.
  4093  message ListStoredInfoTypesRequest {
  4094    // Required. Parent resource name.
  4095    //
  4096    // The format of this value varies depending on the scope of the request
  4097    // (project or organization) and whether you have [specified a processing
  4098    // location](https://cloud.google.com/dlp/docs/specifying-location):
  4099    //
  4100    // + Projects scope, location specified:<br/>
  4101    //   `projects/`<var>PROJECT_ID</var>`/locations/`<var>LOCATION_ID</var>
  4102    // + Projects scope, no location specified (defaults to global):<br/>
  4103    //   `projects/`<var>PROJECT_ID</var>
  4104    // + Organizations scope, location specified:<br/>
  4105    //   `organizations/`<var>ORG_ID</var>`/locations/`<var>LOCATION_ID</var>
  4106    // + Organizations scope, no location specified (defaults to global):<br/>
  4107    //   `organizations/`<var>ORG_ID</var>
  4108    //
  4109    // The following example `parent` string specifies a parent project with the
  4110    // identifier `example-project`, and specifies the `europe-west3` location
  4111    // for processing data:
  4112    //
  4113    //     parent=projects/example-project/locations/europe-west3
  4114    string parent = 1 [
  4115      (google.api.field_behavior) = REQUIRED,
  4116      (google.api.resource_reference) = {
  4117        child_type: "dlp.googleapis.com/StoredInfoType"
  4118      }
  4119    ];
  4120  
  4121    // Page token to continue retrieval. Comes from previous call
  4122    // to `ListStoredInfoTypes`.
  4123    string page_token = 2;
  4124  
  4125    // Size of the page, can be limited by server. If zero server returns
  4126    // a page of max size 100.
  4127    int32 page_size = 3;
  4128  
  4129    // Comma separated list of fields to order by,
  4130    // followed by `asc` or `desc` postfix. This list is case-insensitive,
  4131    // default sorting order is ascending, redundant space characters are
  4132    // insignificant.
  4133    //
  4134    // Example: `name asc, display_name, create_time desc`
  4135    //
  4136    // Supported fields are:
  4137    //
  4138    // - `create_time`: corresponds to time the most recent version of the
  4139    // resource was created.
  4140    // - `state`: corresponds to the state of the resource.
  4141    // - `name`: corresponds to resource name.
  4142    // - `display_name`: corresponds to info type's display name.
  4143    string order_by = 4;
  4144  
  4145    // Deprecated. This field has no effect.
  4146    string location_id = 5;
  4147  }
  4148  
  4149  // Response message for ListStoredInfoTypes.
  4150  message ListStoredInfoTypesResponse {
  4151    // List of storedInfoTypes, up to page_size in ListStoredInfoTypesRequest.
  4152    repeated StoredInfoType stored_info_types = 1;
  4153  
  4154    // If the next page is available then the next page token to be used
  4155    // in following ListStoredInfoTypes request.
  4156    string next_page_token = 2;
  4157  }
  4158  
  4159  // Request message for DeleteStoredInfoType.
  4160  message DeleteStoredInfoTypeRequest {
  4161    // Required. Resource name of the organization and storedInfoType to be deleted, for
  4162    // example `organizations/433245324/storedInfoTypes/432452342` or
  4163    // projects/project-id/storedInfoTypes/432452342.
  4164    string name = 1 [
  4165      (google.api.field_behavior) = REQUIRED,
  4166      (google.api.resource_reference) = {
  4167        type: "dlp.googleapis.com/StoredInfoType"
  4168      }
  4169    ];
  4170  }
  4171  
  4172  // Request to search for potentially sensitive info in a custom location.
  4173  message HybridInspectJobTriggerRequest {
  4174    // Required. Resource name of the trigger to execute a hybrid inspect on, for example
  4175    // `projects/dlp-test-project/jobTriggers/53234423`.
  4176    string name = 1 [
  4177      (google.api.field_behavior) = REQUIRED,
  4178      (google.api.resource_reference) = {
  4179        type: "dlp.googleapis.com/JobTrigger"
  4180      }
  4181    ];
  4182  
  4183    // The item to inspect.
  4184    HybridContentItem hybrid_item = 3;
  4185  }
  4186  
  4187  // Request to search for potentially sensitive info in a custom location.
  4188  message HybridInspectDlpJobRequest {
  4189    // Required. Resource name of the job to execute a hybrid inspect on, for example
  4190    // `projects/dlp-test-project/dlpJob/53234423`.
  4191    string name = 1 [
  4192      (google.api.field_behavior) = REQUIRED,
  4193      (google.api.resource_reference) = {
  4194        type: "dlp.googleapis.com/DlpJob"
  4195      }
  4196    ];
  4197  
  4198    // The item to inspect.
  4199    HybridContentItem hybrid_item = 3;
  4200  }
  4201  
  4202  // An individual hybrid item to inspect. Will be stored temporarily during
  4203  // processing.
  4204  message HybridContentItem {
  4205    // The item to inspect.
  4206    ContentItem item = 1;
  4207  
  4208    // Supplementary information that will be added to each finding.
  4209    HybridFindingDetails finding_details = 2;
  4210  }
  4211  
  4212  // Populate to associate additional data with each finding.
  4213  message HybridFindingDetails {
  4214    // Details about the container where the content being inspected is from.
  4215    Container container_details = 1;
  4216  
  4217    // Offset in bytes of the line, from the beginning of the file, where the
  4218    // finding  is located. Populate if the item being scanned is only part of a
  4219    // bigger item, such as a shard of a file and you want to track the absolute
  4220    // position of the finding.
  4221    int64 file_offset = 2;
  4222  
  4223    // Offset of the row for tables. Populate if the row(s) being scanned are
  4224    // part of a bigger dataset and you want to keep track of their absolute
  4225    // position.
  4226    int64 row_offset = 3;
  4227  
  4228    // If the container is a table, additional information to make findings
  4229    // meaningful such as the columns that are primary keys. If not known ahead
  4230    // of time, can also be set within each inspect hybrid call and the two
  4231    // will be merged. Note that identifying_fields will only be stored to
  4232    // BigQuery, and only if the BigQuery action has been included.
  4233    TableOptions table_options = 4;
  4234  
  4235    // Labels to represent user provided metadata about the data being inspected.
  4236    // If configured by the job, some key values may be required.
  4237    // The labels associated with `Finding`'s produced by hybrid
  4238    // inspection.
  4239    //
  4240    // Label keys must be between 1 and 63 characters long and must conform
  4241    // to the following regular expression: `[a-z]([-a-z0-9]*[a-z0-9])?`.
  4242    //
  4243    // Label values must be between 0 and 63 characters long and must conform
  4244    // to the regular expression `([a-z]([-a-z0-9]*[a-z0-9])?)?`.
  4245    //
  4246    // No more than 10 labels can be associated with a given finding.
  4247    //
  4248    // Examples:
  4249    // * `"environment" : "production"`
  4250    // * `"pipeline" : "etl"`
  4251    map<string, string> labels = 5;
  4252  }
  4253  
  4254  // Quota exceeded errors will be thrown once quota has been met.
  4255  message HybridInspectResponse {
  4256  
  4257  }
  4258  
  4259  // Operators available for comparing the value of fields.
  4260  enum RelationalOperator {
  4261    // Unused
  4262    RELATIONAL_OPERATOR_UNSPECIFIED = 0;
  4263  
  4264    // Equal. Attempts to match even with incompatible types.
  4265    EQUAL_TO = 1;
  4266  
  4267    // Not equal to. Attempts to match even with incompatible types.
  4268    NOT_EQUAL_TO = 2;
  4269  
  4270    // Greater than.
  4271    GREATER_THAN = 3;
  4272  
  4273    // Less than.
  4274    LESS_THAN = 4;
  4275  
  4276    // Greater than or equals.
  4277    GREATER_THAN_OR_EQUALS = 5;
  4278  
  4279    // Less than or equals.
  4280    LESS_THAN_OR_EQUALS = 6;
  4281  
  4282    // Exists
  4283    EXISTS = 7;
  4284  }
  4285  
  4286  // Type of the match which can be applied to different ways of matching, like
  4287  // Dictionary, regular expression and intersecting with findings of another
  4288  // info type.
  4289  enum MatchingType {
  4290    // Invalid.
  4291    MATCHING_TYPE_UNSPECIFIED = 0;
  4292  
  4293    // Full match.
  4294    //
  4295    // - Dictionary: join of Dictionary results matched complete finding quote
  4296    // - Regex: all regex matches fill a finding quote start to end
  4297    // - Exclude info type: completely inside affecting info types findings
  4298    MATCHING_TYPE_FULL_MATCH = 1;
  4299  
  4300    // Partial match.
  4301    //
  4302    // - Dictionary: at least one of the tokens in the finding matches
  4303    // - Regex: substring of the finding matches
  4304    // - Exclude info type: intersects with affecting info types findings
  4305    MATCHING_TYPE_PARTIAL_MATCH = 2;
  4306  
  4307    // Inverse match.
  4308    //
  4309    // - Dictionary: no tokens in the finding match the dictionary
  4310    // - Regex: finding doesn't match the regex
  4311    // - Exclude info type: no intersection with affecting info types findings
  4312    MATCHING_TYPE_INVERSE_MATCH = 3;
  4313  }
  4314  
  4315  // Options describing which parts of the provided content should be scanned.
  4316  enum ContentOption {
  4317    // Includes entire content of a file or a data stream.
  4318    CONTENT_UNSPECIFIED = 0;
  4319  
  4320    // Text content within the data, excluding any metadata.
  4321    CONTENT_TEXT = 1;
  4322  
  4323    // Images found in the data.
  4324    CONTENT_IMAGE = 2;
  4325  }
  4326  
  4327  // Type of metadata containing the finding.
  4328  enum MetadataType {
  4329    // Unused
  4330    METADATATYPE_UNSPECIFIED = 0;
  4331  
  4332    // General file metadata provided by Cloud Storage.
  4333    STORAGE_METADATA = 2;
  4334  }
  4335  
  4336  // Parts of the APIs which use certain infoTypes.
  4337  enum InfoTypeSupportedBy {
  4338    // Unused.
  4339    ENUM_TYPE_UNSPECIFIED = 0;
  4340  
  4341    // Supported by the inspect operations.
  4342    INSPECT = 1;
  4343  
  4344    // Supported by the risk analysis operations.
  4345    RISK_ANALYSIS = 2;
  4346  }
  4347  
  4348  // An enum to represent the various types of DLP jobs.
  4349  enum DlpJobType {
  4350    // Unused
  4351    DLP_JOB_TYPE_UNSPECIFIED = 0;
  4352  
  4353    // The job inspected Google Cloud for sensitive data.
  4354    INSPECT_JOB = 1;
  4355  
  4356    // The job executed a Risk Analysis computation.
  4357    RISK_ANALYSIS_JOB = 2;
  4358  }
  4359  
  4360  // State of a StoredInfoType version.
  4361  enum StoredInfoTypeState {
  4362    // Unused
  4363    STORED_INFO_TYPE_STATE_UNSPECIFIED = 0;
  4364  
  4365    // StoredInfoType version is being created.
  4366    PENDING = 1;
  4367  
  4368    // StoredInfoType version is ready for use.
  4369    READY = 2;
  4370  
  4371    // StoredInfoType creation failed. All relevant error messages are returned in
  4372    // the `StoredInfoTypeVersion` message.
  4373    FAILED = 3;
  4374  
  4375    // StoredInfoType is no longer valid because artifacts stored in
  4376    // user-controlled storage were modified. To fix an invalid StoredInfoType,
  4377    // use the `UpdateStoredInfoType` method to create a new version.
  4378    INVALID = 4;
  4379  }