public async stt::Task MutateKeywordPlanCampaignKeywordsAsync() { moq::Mock <KeywordPlanCampaignKeywordService.KeywordPlanCampaignKeywordServiceClient> mockGrpcClient = new moq::Mock <KeywordPlanCampaignKeywordService.KeywordPlanCampaignKeywordServiceClient>(moq::MockBehavior.Strict); MutateKeywordPlanCampaignKeywordsRequest request = new MutateKeywordPlanCampaignKeywordsRequest { CustomerId = "customer_id3b3724cb", Operations = { new KeywordPlanCampaignKeywordOperation(), }, }; MutateKeywordPlanCampaignKeywordsResponse expectedResponse = new MutateKeywordPlanCampaignKeywordsResponse { Results = { new MutateKeywordPlanCampaignKeywordResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateKeywordPlanCampaignKeywordsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateKeywordPlanCampaignKeywordsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); KeywordPlanCampaignKeywordServiceClient client = new KeywordPlanCampaignKeywordServiceClientImpl(mockGrpcClient.Object, null); MutateKeywordPlanCampaignKeywordsResponse responseCallSettings = await client.MutateKeywordPlanCampaignKeywordsAsync(request.CustomerId, request.Operations, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); MutateKeywordPlanCampaignKeywordsResponse responseCancellationToken = await client.MutateKeywordPlanCampaignKeywordsAsync(request.CustomerId, request.Operations, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void MutateKeywordPlanCampaignKeywords() { moq::Mock <KeywordPlanCampaignKeywordService.KeywordPlanCampaignKeywordServiceClient> mockGrpcClient = new moq::Mock <KeywordPlanCampaignKeywordService.KeywordPlanCampaignKeywordServiceClient>(moq::MockBehavior.Strict); MutateKeywordPlanCampaignKeywordsRequest request = new MutateKeywordPlanCampaignKeywordsRequest { CustomerId = "customer_id3b3724cb", Operations = { new KeywordPlanCampaignKeywordOperation(), }, }; MutateKeywordPlanCampaignKeywordsResponse expectedResponse = new MutateKeywordPlanCampaignKeywordsResponse { Results = { new MutateKeywordPlanCampaignKeywordResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateKeywordPlanCampaignKeywords(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); KeywordPlanCampaignKeywordServiceClient client = new KeywordPlanCampaignKeywordServiceClientImpl(mockGrpcClient.Object, null); MutateKeywordPlanCampaignKeywordsResponse response = client.MutateKeywordPlanCampaignKeywords(request.CustomerId, request.Operations); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateKeywordPlanCampaignKeywords</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void MutateKeywordPlanCampaignKeywordsRequestObject() { // Create client KeywordPlanCampaignKeywordServiceClient keywordPlanCampaignKeywordServiceClient = KeywordPlanCampaignKeywordServiceClient.Create(); // Initialize request argument(s) MutateKeywordPlanCampaignKeywordsRequest request = new MutateKeywordPlanCampaignKeywordsRequest { CustomerId = "", Operations = { new KeywordPlanCampaignKeywordOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateKeywordPlanCampaignKeywordsResponse response = keywordPlanCampaignKeywordServiceClient.MutateKeywordPlanCampaignKeywords(request); }
/// <summary>Snippet for MutateKeywordPlanCampaignKeywordsAsync</summary> public async Task MutateKeywordPlanCampaignKeywordsRequestObjectAsync() { // Snippet: MutateKeywordPlanCampaignKeywordsAsync(MutateKeywordPlanCampaignKeywordsRequest, CallSettings) // Additional: MutateKeywordPlanCampaignKeywordsAsync(MutateKeywordPlanCampaignKeywordsRequest, CancellationToken) // Create client KeywordPlanCampaignKeywordServiceClient keywordPlanCampaignKeywordServiceClient = await KeywordPlanCampaignKeywordServiceClient.CreateAsync(); // Initialize request argument(s) MutateKeywordPlanCampaignKeywordsRequest request = new MutateKeywordPlanCampaignKeywordsRequest { CustomerId = "", Operations = { new KeywordPlanCampaignKeywordOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateKeywordPlanCampaignKeywordsResponse response = await keywordPlanCampaignKeywordServiceClient.MutateKeywordPlanCampaignKeywordsAsync(request); // End snippet }
/// <summary> /// Creates, updates, or removes Keyword Plan campaign keywords. 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 <MutateKeywordPlanCampaignKeywordsResponse> MutateKeywordPlanCampaignKeywordsAsync(MutateKeywordPlanCampaignKeywordsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MutateKeywordPlanCampaignKeywordsRequest(ref request, ref callSettings); return(_callMutateKeywordPlanCampaignKeywords.Async(request, callSettings)); }
partial void Modify_MutateKeywordPlanCampaignKeywordsRequest(ref MutateKeywordPlanCampaignKeywordsRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Creates, updates, or removes Keyword Plan campaign keywords. 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 <MutateKeywordPlanCampaignKeywordsResponse> MutateKeywordPlanCampaignKeywordsAsync(MutateKeywordPlanCampaignKeywordsRequest request, st::CancellationToken cancellationToken) => MutateKeywordPlanCampaignKeywordsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Creates, updates, or removes Keyword Plan campaign keywords. 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 <MutateKeywordPlanCampaignKeywordsResponse> MutateKeywordPlanCampaignKeywordsAsync(MutateKeywordPlanCampaignKeywordsRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();