public async stt::Task MutateKeywordPlanCampaignsRequestObjectAsync() { moq::Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient> mockGrpcClient = new moq::Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient>(moq::MockBehavior.Strict); MutateKeywordPlanCampaignsRequest request = new MutateKeywordPlanCampaignsRequest { CustomerId = "customer_id3b3724cb", Operations = { new KeywordPlanCampaignOperation(), }, PartialFailure = false, ValidateOnly = true, }; MutateKeywordPlanCampaignsResponse expectedResponse = new MutateKeywordPlanCampaignsResponse { Results = { new MutateKeywordPlanCampaignResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateKeywordPlanCampaignsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateKeywordPlanCampaignsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); KeywordPlanCampaignServiceClient client = new KeywordPlanCampaignServiceClientImpl(mockGrpcClient.Object, null); MutateKeywordPlanCampaignsResponse responseCallSettings = await client.MutateKeywordPlanCampaignsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); Assert.AreEqual(expectedResponse, responseCallSettings); MutateKeywordPlanCampaignsResponse responseCancellationToken = await client.MutateKeywordPlanCampaignsAsync(request, st::CancellationToken.None); Assert.AreEqual(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void MutateKeywordPlanCampaigns() { moq::Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient> mockGrpcClient = new moq::Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient>(moq::MockBehavior.Strict); MutateKeywordPlanCampaignsRequest request = new MutateKeywordPlanCampaignsRequest { CustomerId = "customer_id3b3724cb", Operations = { new KeywordPlanCampaignOperation(), }, }; MutateKeywordPlanCampaignsResponse expectedResponse = new MutateKeywordPlanCampaignsResponse { Results = { new MutateKeywordPlanCampaignResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateKeywordPlanCampaigns(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); KeywordPlanCampaignServiceClient client = new KeywordPlanCampaignServiceClientImpl(mockGrpcClient.Object, null); MutateKeywordPlanCampaignsResponse response = client.MutateKeywordPlanCampaigns(request.CustomerId, request.Operations); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async Task MutateKeywordPlanCampaignsAsync3() { Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient> mockGrpcClient = new Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient>(MockBehavior.Strict); MutateKeywordPlanCampaignsRequest request = new MutateKeywordPlanCampaignsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateKeywordPlanCampaignsResponse expectedResponse = new MutateKeywordPlanCampaignsResponse(); mockGrpcClient.Setup(x => x.MutateKeywordPlanCampaignsAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateKeywordPlanCampaignsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); KeywordPlanCampaignServiceClient client = new KeywordPlanCampaignServiceClientImpl(mockGrpcClient.Object, null); MutateKeywordPlanCampaignsResponse response = await client.MutateKeywordPlanCampaignsAsync(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateKeywordPlanCampaigns3() { Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient> mockGrpcClient = new Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient>(MockBehavior.Strict); MutateKeywordPlanCampaignsRequest request = new MutateKeywordPlanCampaignsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateKeywordPlanCampaignsResponse expectedResponse = new MutateKeywordPlanCampaignsResponse(); mockGrpcClient.Setup(x => x.MutateKeywordPlanCampaigns(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); KeywordPlanCampaignServiceClient client = new KeywordPlanCampaignServiceClientImpl(mockGrpcClient.Object, null); MutateKeywordPlanCampaignsResponse response = client.MutateKeywordPlanCampaigns(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateKeywordPlanCampaigns</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void MutateKeywordPlanCampaignsRequestObject() { // Create client KeywordPlanCampaignServiceClient keywordPlanCampaignServiceClient = KeywordPlanCampaignServiceClient.Create(); // Initialize request argument(s) MutateKeywordPlanCampaignsRequest request = new MutateKeywordPlanCampaignsRequest { CustomerId = "", Operations = { new KeywordPlanCampaignOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateKeywordPlanCampaignsResponse response = keywordPlanCampaignServiceClient.MutateKeywordPlanCampaigns(request); }
/// <summary>Snippet for MutateKeywordPlanCampaignsAsync</summary> public async Task MutateKeywordPlanCampaignsRequestObjectAsync() { // Snippet: MutateKeywordPlanCampaignsAsync(MutateKeywordPlanCampaignsRequest, CallSettings) // Additional: MutateKeywordPlanCampaignsAsync(MutateKeywordPlanCampaignsRequest, CancellationToken) // Create client KeywordPlanCampaignServiceClient keywordPlanCampaignServiceClient = await KeywordPlanCampaignServiceClient.CreateAsync(); // Initialize request argument(s) MutateKeywordPlanCampaignsRequest request = new MutateKeywordPlanCampaignsRequest { CustomerId = "", Operations = { new KeywordPlanCampaignOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateKeywordPlanCampaignsResponse response = await keywordPlanCampaignServiceClient.MutateKeywordPlanCampaignsAsync(request); // End snippet }
public async Task MutateKeywordPlanCampaignsAsync() { Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient> mockGrpcClient = new Mock <KeywordPlanCampaignService.KeywordPlanCampaignServiceClient>(MockBehavior.Strict); MutateKeywordPlanCampaignsRequest expectedRequest = new MutateKeywordPlanCampaignsRequest { CustomerId = "customerId-1772061412", Operations = { }, PartialFailure = true, ValidateOnly = false, }; MutateKeywordPlanCampaignsResponse expectedResponse = new MutateKeywordPlanCampaignsResponse(); mockGrpcClient.Setup(x => x.MutateKeywordPlanCampaignsAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateKeywordPlanCampaignsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); KeywordPlanCampaignServiceClient client = new KeywordPlanCampaignServiceClientImpl(mockGrpcClient.Object, null); string customerId = "customerId-1772061412"; IEnumerable <KeywordPlanCampaignOperation> operations = new List <KeywordPlanCampaignOperation>(); bool partialFailure = true; bool validateOnly = false; MutateKeywordPlanCampaignsResponse response = await client.MutateKeywordPlanCampaignsAsync(customerId, operations, partialFailure, validateOnly); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary> /// Creates, updates, or removes Keyword Plan campaigns. 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 <MutateKeywordPlanCampaignsResponse> MutateKeywordPlanCampaignsAsync(MutateKeywordPlanCampaignsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MutateKeywordPlanCampaignsRequest(ref request, ref callSettings); return(_callMutateKeywordPlanCampaigns.Async(request, callSettings)); }
partial void Modify_MutateKeywordPlanCampaignsRequest(ref MutateKeywordPlanCampaignsRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Creates, updates, or removes Keyword Plan campaigns. 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 <MutateKeywordPlanCampaignsResponse> MutateKeywordPlanCampaignsAsync(MutateKeywordPlanCampaignsRequest request, st::CancellationToken cancellationToken) => MutateKeywordPlanCampaignsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Creates, updates, or removes Keyword Plan campaigns. 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 <MutateKeywordPlanCampaignsResponse> MutateKeywordPlanCampaignsAsync(MutateKeywordPlanCampaignsRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();