Skip to content

Commit

Permalink
feat: added support for DLP templates; expose Locations service to …
Browse files Browse the repository at this point in the history
…get/list avaliable locations of Dialogflow products

PiperOrigin-RevId: 389939863

Source-Author: Google APIs <noreply@google.com>
Source-Date: Tue Aug 10 11:48:00 2021 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 626df528c5ae8839254f28b1f8daa1bac75be3a4
Source-Link: googleapis/googleapis@626df52
  • Loading branch information
yoshi-automation authored and jskeet committed Aug 11, 2021
1 parent bd5d389 commit 992c711
Show file tree
Hide file tree
Showing 4 changed files with 816 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ public void CreateSecuritySettingsRequestObject()
{
SecuritySettings.Types.PurgeDataType.Unspecified,
},
InspectTemplate = "inspect_template78566a15",
InspectTemplateAsInspectTemplateName = InspectTemplateName.FromOrganizationLocationInspectTemplate("[ORGANIZATION]", "[LOCATION]", "[INSPECT_TEMPLATE]"),
InsightsExportSettings = new SecuritySettings.Types.InsightsExportSettings(),
DeidentifyTemplateAsDeidentifyTemplateName = DeidentifyTemplateName.FromOrganizationLocationDeidentifyTemplate("[ORGANIZATION]", "[LOCATION]", "[DEIDENTIFY_TEMPLATE]"),
};
mockGrpcClient.Setup(x => x.CreateSecuritySettings(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecuritySettingsServiceClient client = new SecuritySettingsServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -78,8 +79,9 @@ public void CreateSecuritySettingsRequestObject()
{
SecuritySettings.Types.PurgeDataType.Unspecified,
},
InspectTemplate = "inspect_template78566a15",
InspectTemplateAsInspectTemplateName = InspectTemplateName.FromOrganizationLocationInspectTemplate("[ORGANIZATION]", "[LOCATION]", "[INSPECT_TEMPLATE]"),
InsightsExportSettings = new SecuritySettings.Types.InsightsExportSettings(),
DeidentifyTemplateAsDeidentifyTemplateName = DeidentifyTemplateName.FromOrganizationLocationDeidentifyTemplate("[ORGANIZATION]", "[LOCATION]", "[DEIDENTIFY_TEMPLATE]"),
};
mockGrpcClient.Setup(x => x.CreateSecuritySettingsAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecuritySettings>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecuritySettingsServiceClient client = new SecuritySettingsServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -110,8 +112,9 @@ public void CreateSecuritySettings()
{
SecuritySettings.Types.PurgeDataType.Unspecified,
},
InspectTemplate = "inspect_template78566a15",
InspectTemplateAsInspectTemplateName = InspectTemplateName.FromOrganizationLocationInspectTemplate("[ORGANIZATION]", "[LOCATION]", "[INSPECT_TEMPLATE]"),
InsightsExportSettings = new SecuritySettings.Types.InsightsExportSettings(),
DeidentifyTemplateAsDeidentifyTemplateName = DeidentifyTemplateName.FromOrganizationLocationDeidentifyTemplate("[ORGANIZATION]", "[LOCATION]", "[DEIDENTIFY_TEMPLATE]"),
};
mockGrpcClient.Setup(x => x.CreateSecuritySettings(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecuritySettingsServiceClient client = new SecuritySettingsServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -140,8 +143,9 @@ public void CreateSecuritySettings()
{
SecuritySettings.Types.PurgeDataType.Unspecified,
},
InspectTemplate = "inspect_template78566a15",
InspectTemplateAsInspectTemplateName = InspectTemplateName.FromOrganizationLocationInspectTemplate("[ORGANIZATION]", "[LOCATION]", "[INSPECT_TEMPLATE]"),
InsightsExportSettings = new SecuritySettings.Types.InsightsExportSettings(),
DeidentifyTemplateAsDeidentifyTemplateName = DeidentifyTemplateName.FromOrganizationLocationDeidentifyTemplate("[ORGANIZATION]", "[LOCATION]", "[DEIDENTIFY_TEMPLATE]"),
};
mockGrpcClient.Setup(x => x.CreateSecuritySettingsAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecuritySettings>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecuritySettingsServiceClient client = new SecuritySettingsServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -172,8 +176,9 @@ public void CreateSecuritySettingsResourceNames()
{
SecuritySettings.Types.PurgeDataType.Unspecified,
},
InspectTemplate = "inspect_template78566a15",
InspectTemplateAsInspectTemplateName = InspectTemplateName.FromOrganizationLocationInspectTemplate("[ORGANIZATION]", "[LOCATION]", "[INSPECT_TEMPLATE]"),
InsightsExportSettings = new SecuritySettings.Types.InsightsExportSettings(),
DeidentifyTemplateAsDeidentifyTemplateName = DeidentifyTemplateName.FromOrganizationLocationDeidentifyTemplate("[ORGANIZATION]", "[LOCATION]", "[DEIDENTIFY_TEMPLATE]"),
};
mockGrpcClient.Setup(x => x.CreateSecuritySettings(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecuritySettingsServiceClient client = new SecuritySettingsServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -202,8 +207,9 @@ public void CreateSecuritySettingsResourceNames()
{
SecuritySettings.Types.PurgeDataType.Unspecified,
},
InspectTemplate = "inspect_template78566a15",
InspectTemplateAsInspectTemplateName = InspectTemplateName.FromOrganizationLocationInspectTemplate("[ORGANIZATION]", "[LOCATION]", "[INSPECT_TEMPLATE]"),
InsightsExportSettings = new SecuritySettings.Types.InsightsExportSettings(),
DeidentifyTemplateAsDeidentifyTemplateName = DeidentifyTemplateName.FromOrganizationLocationDeidentifyTemplate("[ORGANIZATION]", "[LOCATION]", "[DEIDENTIFY_TEMPLATE]"),
};
mockGrpcClient.Setup(x => x.CreateSecuritySettingsAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecuritySettings>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecuritySettingsServiceClient client = new SecuritySettingsServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -233,8 +239,9 @@ public void GetSecuritySettingsRequestObject()
{
SecuritySettings.Types.PurgeDataType.Unspecified,
},
InspectTemplate = "inspect_template78566a15",
InspectTemplateAsInspectTemplateName = InspectTemplateName.FromOrganizationLocationInspectTemplate("[ORGANIZATION]", "[LOCATION]", "[INSPECT_TEMPLATE]"),
InsightsExportSettings = new SecuritySettings.Types.InsightsExportSettings(),
DeidentifyTemplateAsDeidentifyTemplateName = DeidentifyTemplateName.FromOrganizationLocationDeidentifyTemplate("[ORGANIZATION]", "[LOCATION]", "[DEIDENTIFY_TEMPLATE]"),
};
mockGrpcClient.Setup(x => x.GetSecuritySettings(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecuritySettingsServiceClient client = new SecuritySettingsServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -262,8 +269,9 @@ public void GetSecuritySettingsRequestObject()
{
SecuritySettings.Types.PurgeDataType.Unspecified,
},
InspectTemplate = "inspect_template78566a15",
InspectTemplateAsInspectTemplateName = InspectTemplateName.FromOrganizationLocationInspectTemplate("[ORGANIZATION]", "[LOCATION]", "[INSPECT_TEMPLATE]"),
InsightsExportSettings = new SecuritySettings.Types.InsightsExportSettings(),
DeidentifyTemplateAsDeidentifyTemplateName = DeidentifyTemplateName.FromOrganizationLocationDeidentifyTemplate("[ORGANIZATION]", "[LOCATION]", "[DEIDENTIFY_TEMPLATE]"),
};
mockGrpcClient.Setup(x => x.GetSecuritySettingsAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecuritySettings>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecuritySettingsServiceClient client = new SecuritySettingsServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -293,8 +301,9 @@ public void GetSecuritySettings()
{
SecuritySettings.Types.PurgeDataType.Unspecified,
},
InspectTemplate = "inspect_template78566a15",
InspectTemplateAsInspectTemplateName = InspectTemplateName.FromOrganizationLocationInspectTemplate("[ORGANIZATION]", "[LOCATION]", "[INSPECT_TEMPLATE]"),
InsightsExportSettings = new SecuritySettings.Types.InsightsExportSettings(),
DeidentifyTemplateAsDeidentifyTemplateName = DeidentifyTemplateName.FromOrganizationLocationDeidentifyTemplate("[ORGANIZATION]", "[LOCATION]", "[DEIDENTIFY_TEMPLATE]"),
};
mockGrpcClient.Setup(x => x.GetSecuritySettings(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecuritySettingsServiceClient client = new SecuritySettingsServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -322,8 +331,9 @@ public void GetSecuritySettings()
{
SecuritySettings.Types.PurgeDataType.Unspecified,
},
InspectTemplate = "inspect_template78566a15",
InspectTemplateAsInspectTemplateName = InspectTemplateName.FromOrganizationLocationInspectTemplate("[ORGANIZATION]", "[LOCATION]", "[INSPECT_TEMPLATE]"),
InsightsExportSettings = new SecuritySettings.Types.InsightsExportSettings(),
DeidentifyTemplateAsDeidentifyTemplateName = DeidentifyTemplateName.FromOrganizationLocationDeidentifyTemplate("[ORGANIZATION]", "[LOCATION]", "[DEIDENTIFY_TEMPLATE]"),
};
mockGrpcClient.Setup(x => x.GetSecuritySettingsAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecuritySettings>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecuritySettingsServiceClient client = new SecuritySettingsServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -353,8 +363,9 @@ public void GetSecuritySettingsResourceNames()
{
SecuritySettings.Types.PurgeDataType.Unspecified,
},
InspectTemplate = "inspect_template78566a15",
InspectTemplateAsInspectTemplateName = InspectTemplateName.FromOrganizationLocationInspectTemplate("[ORGANIZATION]", "[LOCATION]", "[INSPECT_TEMPLATE]"),
InsightsExportSettings = new SecuritySettings.Types.InsightsExportSettings(),
DeidentifyTemplateAsDeidentifyTemplateName = DeidentifyTemplateName.FromOrganizationLocationDeidentifyTemplate("[ORGANIZATION]", "[LOCATION]", "[DEIDENTIFY_TEMPLATE]"),
};
mockGrpcClient.Setup(x => x.GetSecuritySettings(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecuritySettingsServiceClient client = new SecuritySettingsServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -382,8 +393,9 @@ public void GetSecuritySettingsResourceNames()
{
SecuritySettings.Types.PurgeDataType.Unspecified,
},
InspectTemplate = "inspect_template78566a15",
InspectTemplateAsInspectTemplateName = InspectTemplateName.FromOrganizationLocationInspectTemplate("[ORGANIZATION]", "[LOCATION]", "[INSPECT_TEMPLATE]"),
InsightsExportSettings = new SecuritySettings.Types.InsightsExportSettings(),
DeidentifyTemplateAsDeidentifyTemplateName = DeidentifyTemplateName.FromOrganizationLocationDeidentifyTemplate("[ORGANIZATION]", "[LOCATION]", "[DEIDENTIFY_TEMPLATE]"),
};
mockGrpcClient.Setup(x => x.GetSecuritySettingsAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecuritySettings>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecuritySettingsServiceClient client = new SecuritySettingsServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -414,8 +426,9 @@ public void UpdateSecuritySettingsRequestObject()
{
SecuritySettings.Types.PurgeDataType.Unspecified,
},
InspectTemplate = "inspect_template78566a15",
InspectTemplateAsInspectTemplateName = InspectTemplateName.FromOrganizationLocationInspectTemplate("[ORGANIZATION]", "[LOCATION]", "[INSPECT_TEMPLATE]"),
InsightsExportSettings = new SecuritySettings.Types.InsightsExportSettings(),
DeidentifyTemplateAsDeidentifyTemplateName = DeidentifyTemplateName.FromOrganizationLocationDeidentifyTemplate("[ORGANIZATION]", "[LOCATION]", "[DEIDENTIFY_TEMPLATE]"),
};
mockGrpcClient.Setup(x => x.UpdateSecuritySettings(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecuritySettingsServiceClient client = new SecuritySettingsServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -444,8 +457,9 @@ public void UpdateSecuritySettingsRequestObject()
{
SecuritySettings.Types.PurgeDataType.Unspecified,
},
InspectTemplate = "inspect_template78566a15",
InspectTemplateAsInspectTemplateName = InspectTemplateName.FromOrganizationLocationInspectTemplate("[ORGANIZATION]", "[LOCATION]", "[INSPECT_TEMPLATE]"),
InsightsExportSettings = new SecuritySettings.Types.InsightsExportSettings(),
DeidentifyTemplateAsDeidentifyTemplateName = DeidentifyTemplateName.FromOrganizationLocationDeidentifyTemplate("[ORGANIZATION]", "[LOCATION]", "[DEIDENTIFY_TEMPLATE]"),
};
mockGrpcClient.Setup(x => x.UpdateSecuritySettingsAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecuritySettings>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecuritySettingsServiceClient client = new SecuritySettingsServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -476,8 +490,9 @@ public void UpdateSecuritySettings()
{
SecuritySettings.Types.PurgeDataType.Unspecified,
},
InspectTemplate = "inspect_template78566a15",
InspectTemplateAsInspectTemplateName = InspectTemplateName.FromOrganizationLocationInspectTemplate("[ORGANIZATION]", "[LOCATION]", "[INSPECT_TEMPLATE]"),
InsightsExportSettings = new SecuritySettings.Types.InsightsExportSettings(),
DeidentifyTemplateAsDeidentifyTemplateName = DeidentifyTemplateName.FromOrganizationLocationDeidentifyTemplate("[ORGANIZATION]", "[LOCATION]", "[DEIDENTIFY_TEMPLATE]"),
};
mockGrpcClient.Setup(x => x.UpdateSecuritySettings(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
SecuritySettingsServiceClient client = new SecuritySettingsServiceClientImpl(mockGrpcClient.Object, null);
Expand Down Expand Up @@ -506,8 +521,9 @@ public void UpdateSecuritySettings()
{
SecuritySettings.Types.PurgeDataType.Unspecified,
},
InspectTemplate = "inspect_template78566a15",
InspectTemplateAsInspectTemplateName = InspectTemplateName.FromOrganizationLocationInspectTemplate("[ORGANIZATION]", "[LOCATION]", "[INSPECT_TEMPLATE]"),
InsightsExportSettings = new SecuritySettings.Types.InsightsExportSettings(),
DeidentifyTemplateAsDeidentifyTemplateName = DeidentifyTemplateName.FromOrganizationLocationDeidentifyTemplate("[ORGANIZATION]", "[LOCATION]", "[DEIDENTIFY_TEMPLATE]"),
};
mockGrpcClient.Setup(x => x.UpdateSecuritySettingsAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<SecuritySettings>(stt::Task.FromResult(expectedResponse), null, null, null, null));
SecuritySettingsServiceClient client = new SecuritySettingsServiceClientImpl(mockGrpcClient.Object, null);
Expand Down
Loading

0 comments on commit 992c711

Please sign in to comment.