public async stt::Task FulfillIntentRequestObjectAsync() { moq::Mock <Sessions.SessionsClient> mockGrpcClient = new moq::Mock <Sessions.SessionsClient>(moq::MockBehavior.Strict); FulfillIntentRequest request = new FulfillIntentRequest { MatchIntentRequest = new MatchIntentRequest(), Match = new Match(), OutputAudioConfig = new OutputAudioConfig(), }; FulfillIntentResponse expectedResponse = new FulfillIntentResponse { ResponseId = "response_id17f822e1", QueryResult = new QueryResult(), OutputAudio = proto::ByteString.CopyFromUtf8("output_audio7e712c4b"), OutputAudioConfig = new OutputAudioConfig(), }; mockGrpcClient.Setup(x => x.FulfillIntentAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <FulfillIntentResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); SessionsClient client = new SessionsClientImpl(mockGrpcClient.Object, null); FulfillIntentResponse responseCallSettings = await client.FulfillIntentAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); FulfillIntentResponse responseCancellationToken = await client.FulfillIntentAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for FulfillIntent</summary> public void FulfillIntentRequestObject() { // Snippet: FulfillIntent(FulfillIntentRequest, CallSettings) // Create client SessionsClient sessionsClient = SessionsClient.Create(); // Initialize request argument(s) FulfillIntentRequest request = new FulfillIntentRequest { MatchIntentRequest = new MatchIntentRequest(), Match = new Match(), OutputAudioConfig = new OutputAudioConfig(), }; // Make the request FulfillIntentResponse response = sessionsClient.FulfillIntent(request); // End snippet }
/// <summary>Snippet for FulfillIntentAsync</summary> public async Task FulfillIntentRequestObjectAsync() { // Snippet: FulfillIntentAsync(FulfillIntentRequest, CallSettings) // Additional: FulfillIntentAsync(FulfillIntentRequest, CancellationToken) // Create client SessionsClient sessionsClient = await SessionsClient.CreateAsync(); // Initialize request argument(s) FulfillIntentRequest request = new FulfillIntentRequest { MatchIntentRequest = new MatchIntentRequest(), Match = new Match(), OutputAudioConfig = new OutputAudioConfig(), }; // Make the request FulfillIntentResponse response = await sessionsClient.FulfillIntentAsync(request); // End snippet }
public void FulfillIntentRequestObject() { moq::Mock <Sessions.SessionsClient> mockGrpcClient = new moq::Mock <Sessions.SessionsClient>(moq::MockBehavior.Strict); FulfillIntentRequest request = new FulfillIntentRequest { MatchIntentRequest = new MatchIntentRequest(), Match = new Match(), OutputAudioConfig = new OutputAudioConfig(), }; FulfillIntentResponse expectedResponse = new FulfillIntentResponse { ResponseId = "response_id17f822e1", QueryResult = new QueryResult(), OutputAudio = proto::ByteString.CopyFromUtf8("output_audio7e712c4b"), OutputAudioConfig = new OutputAudioConfig(), }; mockGrpcClient.Setup(x => x.FulfillIntent(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); SessionsClient client = new SessionsClientImpl(mockGrpcClient.Object, null); FulfillIntentResponse response = client.FulfillIntent(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary> /// Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent]. /// Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from /// [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>A Task containing the RPC response.</returns> public override stt::Task <FulfillIntentResponse> FulfillIntentAsync(FulfillIntentRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_FulfillIntentRequest(ref request, ref callSettings); return(_callFulfillIntent.Async(request, callSettings)); }
/// <summary> /// Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent]. /// Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from /// [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>The RPC response.</returns> public override FulfillIntentResponse FulfillIntent(FulfillIntentRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_FulfillIntentRequest(ref request, ref callSettings); return(_callFulfillIntent.Sync(request, callSettings)); }
partial void Modify_FulfillIntentRequest(ref FulfillIntentRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent]. /// Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from /// [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param> /// <returns>A Task containing the RPC response.</returns> public virtual stt::Task <FulfillIntentResponse> FulfillIntentAsync(FulfillIntentRequest request, st::CancellationToken cancellationToken) => FulfillIntentAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent]. /// Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from /// [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>A Task containing the RPC response.</returns> public virtual stt::Task <FulfillIntentResponse> FulfillIntentAsync(FulfillIntentRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();
/// <summary> /// Fulfills a matched intent returned by [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent]. /// Must be called after [MatchIntent][google.cloud.dialogflow.cx.v3.Sessions.MatchIntent], with input from /// [MatchIntentResponse][google.cloud.dialogflow.cx.v3.MatchIntentResponse]. Otherwise, the behavior is undefined. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>The RPC response.</returns> public virtual FulfillIntentResponse FulfillIntent(FulfillIntentRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();