Skip to content

Commit a19ee13

Browse files
Regenerate Google.Cloud.Dialogflow.V2 (#4438)
- Adds AgentsClient.GetValidationResult RPC with associated types - Adds DetectIntentRequest.OutputAudioConfigMask
1 parent 6e62004 commit a19ee13

15 files changed

Lines changed: 1140 additions & 223 deletions

File tree

‎apis/Google.Cloud.Dialogflow.V2/Google.Cloud.Dialogflow.V2.Snippets/AgentsClientSnippets.g.cs‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,5 +1045,40 @@ public async Task RestoreAgentRequestObjectAsync()
10451045
}
10461046
// End snippet
10471047
}
1048+
1049+
/// <summary>Snippet for GetValidationResult</summary>
1050+
public void GetValidationResultRequestObject()
1051+
{
1052+
// Snippet: GetValidationResult(GetValidationResultRequest, CallSettings)
1053+
// Create client
1054+
AgentsClient agentsClient = AgentsClient.Create();
1055+
// Initialize request argument(s)
1056+
GetValidationResultRequest request = new GetValidationResultRequest
1057+
{
1058+
Parent = "",
1059+
LanguageCode = "",
1060+
};
1061+
// Make the request
1062+
ValidationResult response = agentsClient.GetValidationResult(request);
1063+
// End snippet
1064+
}
1065+
1066+
/// <summary>Snippet for GetValidationResultAsync</summary>
1067+
public async Task GetValidationResultRequestObjectAsync()
1068+
{
1069+
// Snippet: GetValidationResultAsync(GetValidationResultRequest, CallSettings)
1070+
// Additional: GetValidationResultAsync(GetValidationResultRequest, CancellationToken)
1071+
// Create client
1072+
AgentsClient agentsClient = await AgentsClient.CreateAsync();
1073+
// Initialize request argument(s)
1074+
GetValidationResultRequest request = new GetValidationResultRequest
1075+
{
1076+
Parent = "",
1077+
LanguageCode = "",
1078+
};
1079+
// Make the request
1080+
ValidationResult response = await agentsClient.GetValidationResultAsync(request);
1081+
// End snippet
1082+
}
10481083
}
10491084
}

‎apis/Google.Cloud.Dialogflow.V2/Google.Cloud.Dialogflow.V2.Snippets/SessionsClientSnippets.g.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ namespace Google.Cloud.Dialogflow.V2.Snippets
1818
{
1919
using Google.Api.Gax.Grpc;
2020
using Google.Protobuf;
21+
using Google.Protobuf.WellKnownTypes;
2122
using System.Threading.Tasks;
2223

2324
/// <summary>Generated snippets.</summary>
@@ -37,6 +38,7 @@ public void DetectIntentRequestObject()
3738
QueryInput = new QueryInput(),
3839
OutputAudioConfig = new OutputAudioConfig(),
3940
InputAudio = ByteString.Empty,
41+
OutputAudioConfigMask = new FieldMask(),
4042
};
4143
// Make the request
4244
DetectIntentResponse response = sessionsClient.DetectIntent(request);
@@ -58,6 +60,7 @@ public async Task DetectIntentRequestObjectAsync()
5860
QueryInput = new QueryInput(),
5961
OutputAudioConfig = new OutputAudioConfig(),
6062
InputAudio = ByteString.Empty,
63+
OutputAudioConfigMask = new FieldMask(),
6164
};
6265
// Make the request
6366
DetectIntentResponse response = await sessionsClient.DetectIntentAsync(request);
@@ -159,6 +162,7 @@ public async Task StreamingDetectIntent()
159162
QueryInput = new QueryInput(),
160163
OutputAudioConfig = new OutputAudioConfig(),
161164
InputAudio = ByteString.Empty,
165+
OutputAudioConfigMask = new FieldMask(),
162166
};
163167
// Stream a request to the server
164168
await response.WriteAsync(request);

‎apis/Google.Cloud.Dialogflow.V2/Google.Cloud.Dialogflow.V2.Tests/AgentsClientTest.g.cs‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,5 +473,55 @@ public void DeleteAgentResourceNames()
473473
await client.DeleteAgentAsync(request.ParentAsProjectName, st::CancellationToken.None);
474474
mockGrpcClient.VerifyAll();
475475
}
476+
477+
[xunit::FactAttribute]
478+
public void GetValidationResultRequestObject()
479+
{
480+
moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict);
481+
mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
482+
GetValidationResultRequest request = new GetValidationResultRequest
483+
{
484+
Parent = "parent7858e4d0",
485+
LanguageCode = "language_code2f6c7160",
486+
};
487+
ValidationResult expectedResponse = new ValidationResult
488+
{
489+
ValidationErrors =
490+
{
491+
new ValidationError(),
492+
},
493+
};
494+
mockGrpcClient.Setup(x => x.GetValidationResult(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse);
495+
AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null);
496+
ValidationResult response = client.GetValidationResult(request);
497+
xunit::Assert.Same(expectedResponse, response);
498+
mockGrpcClient.VerifyAll();
499+
}
500+
501+
[xunit::FactAttribute]
502+
public async stt::Task GetValidationResultRequestObjectAsync()
503+
{
504+
moq::Mock<Agents.AgentsClient> mockGrpcClient = new moq::Mock<Agents.AgentsClient>(moq::MockBehavior.Strict);
505+
mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock<lro::Operations.OperationsClient>().Object);
506+
GetValidationResultRequest request = new GetValidationResultRequest
507+
{
508+
Parent = "parent7858e4d0",
509+
LanguageCode = "language_code2f6c7160",
510+
};
511+
ValidationResult expectedResponse = new ValidationResult
512+
{
513+
ValidationErrors =
514+
{
515+
new ValidationError(),
516+
},
517+
};
518+
mockGrpcClient.Setup(x => x.GetValidationResultAsync(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall<ValidationResult>(stt::Task.FromResult(expectedResponse), null, null, null, null));
519+
AgentsClient client = new AgentsClientImpl(mockGrpcClient.Object, null);
520+
ValidationResult responseCallSettings = await client.GetValidationResultAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));
521+
xunit::Assert.Same(expectedResponse, responseCallSettings);
522+
ValidationResult responseCancellationToken = await client.GetValidationResultAsync(request, st::CancellationToken.None);
523+
xunit::Assert.Same(expectedResponse, responseCancellationToken);
524+
mockGrpcClient.VerifyAll();
525+
}
476526
}
477527
}

‎apis/Google.Cloud.Dialogflow.V2/Google.Cloud.Dialogflow.V2.Tests/SessionsClientTest.g.cs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
using gaxgrpc = Google.Api.Gax.Grpc;
1818
using proto = Google.Protobuf;
19+
using wkt = Google.Protobuf.WellKnownTypes;
1920
using gr = Google.Rpc;
2021
using grpccore = Grpc.Core;
2122
using moq = Moq;
@@ -39,6 +40,7 @@ public void DetectIntentRequestObject()
3940
QueryInput = new QueryInput(),
4041
OutputAudioConfig = new OutputAudioConfig(),
4142
InputAudio = proto::ByteString.CopyFromUtf8("input_audio0acdfb28"),
43+
OutputAudioConfigMask = new wkt::FieldMask(),
4244
};
4345
DetectIntentResponse expectedResponse = new DetectIntentResponse
4446
{
@@ -66,6 +68,7 @@ public void DetectIntentRequestObject()
6668
QueryInput = new QueryInput(),
6769
OutputAudioConfig = new OutputAudioConfig(),
6870
InputAudio = proto::ByteString.CopyFromUtf8("input_audio0acdfb28"),
71+
OutputAudioConfigMask = new wkt::FieldMask(),
6972
};
7073
DetectIntentResponse expectedResponse = new DetectIntentResponse
7174
{

0 commit comments

Comments
 (0)
⌂ 换网址