public void MutateRemarketingActions() { moq::Mock <RemarketingActionService.RemarketingActionServiceClient> mockGrpcClient = new moq::Mock <RemarketingActionService.RemarketingActionServiceClient>(moq::MockBehavior.Strict); MutateRemarketingActionsRequest request = new MutateRemarketingActionsRequest { CustomerId = "customer_id3b3724cb", Operations = { new RemarketingActionOperation(), }, }; MutateRemarketingActionsResponse expectedResponse = new MutateRemarketingActionsResponse { Results = { new MutateRemarketingActionResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateRemarketingActions(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); RemarketingActionServiceClient client = new RemarketingActionServiceClientImpl(mockGrpcClient.Object, null); MutateRemarketingActionsResponse response = client.MutateRemarketingActions(request.CustomerId, request.Operations); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async stt::Task MutateRemarketingActionsAsync() { moq::Mock <RemarketingActionService.RemarketingActionServiceClient> mockGrpcClient = new moq::Mock <RemarketingActionService.RemarketingActionServiceClient>(moq::MockBehavior.Strict); MutateRemarketingActionsRequest request = new MutateRemarketingActionsRequest { CustomerId = "customer_id3b3724cb", Operations = { new RemarketingActionOperation(), }, }; MutateRemarketingActionsResponse expectedResponse = new MutateRemarketingActionsResponse { Results = { new MutateRemarketingActionResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateRemarketingActionsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateRemarketingActionsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); RemarketingActionServiceClient client = new RemarketingActionServiceClientImpl(mockGrpcClient.Object, null); MutateRemarketingActionsResponse responseCallSettings = await client.MutateRemarketingActionsAsync(request.CustomerId, request.Operations, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); Assert.AreEqual(expectedResponse, responseCallSettings); MutateRemarketingActionsResponse responseCancellationToken = await client.MutateRemarketingActionsAsync(request.CustomerId, request.Operations, st::CancellationToken.None); Assert.AreEqual(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateRemarketingActions</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void MutateRemarketingActionsRequestObject() { // Create client RemarketingActionServiceClient remarketingActionServiceClient = RemarketingActionServiceClient.Create(); // Initialize request argument(s) MutateRemarketingActionsRequest request = new MutateRemarketingActionsRequest { CustomerId = "", Operations = { new RemarketingActionOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateRemarketingActionsResponse response = remarketingActionServiceClient.MutateRemarketingActions(request); }
public async Task MutateRemarketingActionsAsync3() { Mock <RemarketingActionService.RemarketingActionServiceClient> mockGrpcClient = new Mock <RemarketingActionService.RemarketingActionServiceClient>(MockBehavior.Strict); MutateRemarketingActionsRequest request = new MutateRemarketingActionsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateRemarketingActionsResponse expectedResponse = new MutateRemarketingActionsResponse(); mockGrpcClient.Setup(x => x.MutateRemarketingActionsAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateRemarketingActionsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); RemarketingActionServiceClient client = new RemarketingActionServiceClientImpl(mockGrpcClient.Object, null); MutateRemarketingActionsResponse response = await client.MutateRemarketingActionsAsync(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateRemarketingActions3() { Mock <RemarketingActionService.RemarketingActionServiceClient> mockGrpcClient = new Mock <RemarketingActionService.RemarketingActionServiceClient>(MockBehavior.Strict); MutateRemarketingActionsRequest request = new MutateRemarketingActionsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateRemarketingActionsResponse expectedResponse = new MutateRemarketingActionsResponse(); mockGrpcClient.Setup(x => x.MutateRemarketingActions(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); RemarketingActionServiceClient client = new RemarketingActionServiceClientImpl(mockGrpcClient.Object, null); MutateRemarketingActionsResponse response = client.MutateRemarketingActions(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateRemarketingActionsAsync</summary> public async Task MutateRemarketingActionsRequestObjectAsync() { // Snippet: MutateRemarketingActionsAsync(MutateRemarketingActionsRequest, CallSettings) // Additional: MutateRemarketingActionsAsync(MutateRemarketingActionsRequest, CancellationToken) // Create client RemarketingActionServiceClient remarketingActionServiceClient = await RemarketingActionServiceClient.CreateAsync(); // Initialize request argument(s) MutateRemarketingActionsRequest request = new MutateRemarketingActionsRequest { CustomerId = "", Operations = { new RemarketingActionOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateRemarketingActionsResponse response = await remarketingActionServiceClient.MutateRemarketingActionsAsync(request); // End snippet }
public async Task MutateRemarketingActionsAsync() { Mock <RemarketingActionService.RemarketingActionServiceClient> mockGrpcClient = new Mock <RemarketingActionService.RemarketingActionServiceClient>(MockBehavior.Strict); MutateRemarketingActionsRequest expectedRequest = new MutateRemarketingActionsRequest { CustomerId = "customerId-1772061412", Operations = { }, PartialFailure = true, ValidateOnly = false, }; MutateRemarketingActionsResponse expectedResponse = new MutateRemarketingActionsResponse(); mockGrpcClient.Setup(x => x.MutateRemarketingActionsAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateRemarketingActionsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); RemarketingActionServiceClient client = new RemarketingActionServiceClientImpl(mockGrpcClient.Object, null); string customerId = "customerId-1772061412"; IEnumerable <RemarketingActionOperation> operations = new List <RemarketingActionOperation>(); bool partialFailure = true; bool validateOnly = false; MutateRemarketingActionsResponse response = await client.MutateRemarketingActionsAsync(customerId, operations, partialFailure, validateOnly); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary> /// Creates or updates remarketing actions. Operation statuses are returned. /// </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 <MutateRemarketingActionsResponse> MutateRemarketingActionsAsync(MutateRemarketingActionsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MutateRemarketingActionsRequest(ref request, ref callSettings); return(_callMutateRemarketingActions.Async(request, callSettings)); }
partial void Modify_MutateRemarketingActionsRequest(ref MutateRemarketingActionsRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Creates or updates remarketing actions. Operation statuses are returned. /// </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 <MutateRemarketingActionsResponse> MutateRemarketingActionsAsync(MutateRemarketingActionsRequest request, st::CancellationToken cancellationToken) => MutateRemarketingActionsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Creates or updates remarketing actions. Operation statuses are returned. /// </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 <MutateRemarketingActionsResponse> MutateRemarketingActionsAsync(MutateRemarketingActionsRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();