public async stt::Task MutateKeywordPlanAdGroupsAsync() { moq::Mock <KeywordPlanAdGroupService.KeywordPlanAdGroupServiceClient> mockGrpcClient = new moq::Mock <KeywordPlanAdGroupService.KeywordPlanAdGroupServiceClient>(moq::MockBehavior.Strict); MutateKeywordPlanAdGroupsRequest request = new MutateKeywordPlanAdGroupsRequest { CustomerId = "customer_id3b3724cb", Operations = { new KeywordPlanAdGroupOperation(), }, }; MutateKeywordPlanAdGroupsResponse expectedResponse = new MutateKeywordPlanAdGroupsResponse { Results = { new MutateKeywordPlanAdGroupResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateKeywordPlanAdGroupsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateKeywordPlanAdGroupsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); KeywordPlanAdGroupServiceClient client = new KeywordPlanAdGroupServiceClientImpl(mockGrpcClient.Object, null); MutateKeywordPlanAdGroupsResponse responseCallSettings = await client.MutateKeywordPlanAdGroupsAsync(request.CustomerId, request.Operations, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); MutateKeywordPlanAdGroupsResponse responseCancellationToken = await client.MutateKeywordPlanAdGroupsAsync(request.CustomerId, request.Operations, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void MutateKeywordPlanAdGroups() { moq::Mock <KeywordPlanAdGroupService.KeywordPlanAdGroupServiceClient> mockGrpcClient = new moq::Mock <KeywordPlanAdGroupService.KeywordPlanAdGroupServiceClient>(moq::MockBehavior.Strict); MutateKeywordPlanAdGroupsRequest request = new MutateKeywordPlanAdGroupsRequest { CustomerId = "customer_id3b3724cb", Operations = { new KeywordPlanAdGroupOperation(), }, }; MutateKeywordPlanAdGroupsResponse expectedResponse = new MutateKeywordPlanAdGroupsResponse { Results = { new MutateKeywordPlanAdGroupResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateKeywordPlanAdGroups(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); KeywordPlanAdGroupServiceClient client = new KeywordPlanAdGroupServiceClientImpl(mockGrpcClient.Object, null); MutateKeywordPlanAdGroupsResponse response = client.MutateKeywordPlanAdGroups(request.CustomerId, request.Operations); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateKeywordPlanAdGroups</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void MutateKeywordPlanAdGroupsRequestObject() { // Create client KeywordPlanAdGroupServiceClient keywordPlanAdGroupServiceClient = KeywordPlanAdGroupServiceClient.Create(); // Initialize request argument(s) MutateKeywordPlanAdGroupsRequest request = new MutateKeywordPlanAdGroupsRequest { CustomerId = "", Operations = { new KeywordPlanAdGroupOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateKeywordPlanAdGroupsResponse response = keywordPlanAdGroupServiceClient.MutateKeywordPlanAdGroups(request); }
public void MutateKeywordPlanAdGroups3() { Mock <KeywordPlanAdGroupService.KeywordPlanAdGroupServiceClient> mockGrpcClient = new Mock <KeywordPlanAdGroupService.KeywordPlanAdGroupServiceClient>(MockBehavior.Strict); MutateKeywordPlanAdGroupsRequest request = new MutateKeywordPlanAdGroupsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateKeywordPlanAdGroupsResponse expectedResponse = new MutateKeywordPlanAdGroupsResponse(); mockGrpcClient.Setup(x => x.MutateKeywordPlanAdGroups(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); KeywordPlanAdGroupServiceClient client = new KeywordPlanAdGroupServiceClientImpl(mockGrpcClient.Object, null); MutateKeywordPlanAdGroupsResponse response = client.MutateKeywordPlanAdGroups(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async Task MutateKeywordPlanAdGroupsAsync3() { Mock <KeywordPlanAdGroupService.KeywordPlanAdGroupServiceClient> mockGrpcClient = new Mock <KeywordPlanAdGroupService.KeywordPlanAdGroupServiceClient>(MockBehavior.Strict); MutateKeywordPlanAdGroupsRequest request = new MutateKeywordPlanAdGroupsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateKeywordPlanAdGroupsResponse expectedResponse = new MutateKeywordPlanAdGroupsResponse(); mockGrpcClient.Setup(x => x.MutateKeywordPlanAdGroupsAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateKeywordPlanAdGroupsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); KeywordPlanAdGroupServiceClient client = new KeywordPlanAdGroupServiceClientImpl(mockGrpcClient.Object, null); MutateKeywordPlanAdGroupsResponse response = await client.MutateKeywordPlanAdGroupsAsync(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateKeywordPlanAdGroupsAsync</summary> public async Task MutateKeywordPlanAdGroupsRequestObjectAsync() { // Snippet: MutateKeywordPlanAdGroupsAsync(MutateKeywordPlanAdGroupsRequest, CallSettings) // Additional: MutateKeywordPlanAdGroupsAsync(MutateKeywordPlanAdGroupsRequest, CancellationToken) // Create client KeywordPlanAdGroupServiceClient keywordPlanAdGroupServiceClient = await KeywordPlanAdGroupServiceClient.CreateAsync(); // Initialize request argument(s) MutateKeywordPlanAdGroupsRequest request = new MutateKeywordPlanAdGroupsRequest { CustomerId = "", Operations = { new KeywordPlanAdGroupOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateKeywordPlanAdGroupsResponse response = await keywordPlanAdGroupServiceClient.MutateKeywordPlanAdGroupsAsync(request); // End snippet }
public async Task MutateKeywordPlanAdGroupsAsync() { Mock <KeywordPlanAdGroupService.KeywordPlanAdGroupServiceClient> mockGrpcClient = new Mock <KeywordPlanAdGroupService.KeywordPlanAdGroupServiceClient>(MockBehavior.Strict); MutateKeywordPlanAdGroupsRequest expectedRequest = new MutateKeywordPlanAdGroupsRequest { CustomerId = "customerId-1772061412", Operations = { }, PartialFailure = true, ValidateOnly = false, }; MutateKeywordPlanAdGroupsResponse expectedResponse = new MutateKeywordPlanAdGroupsResponse(); mockGrpcClient.Setup(x => x.MutateKeywordPlanAdGroupsAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateKeywordPlanAdGroupsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); KeywordPlanAdGroupServiceClient client = new KeywordPlanAdGroupServiceClientImpl(mockGrpcClient.Object, null); string customerId = "customerId-1772061412"; IEnumerable <KeywordPlanAdGroupOperation> operations = new List <KeywordPlanAdGroupOperation>(); bool partialFailure = true; bool validateOnly = false; MutateKeywordPlanAdGroupsResponse response = await client.MutateKeywordPlanAdGroupsAsync(customerId, operations, partialFailure, validateOnly); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary> /// Creates, updates, or removes Keyword Plan ad groups. 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 <MutateKeywordPlanAdGroupsResponse> MutateKeywordPlanAdGroupsAsync(MutateKeywordPlanAdGroupsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MutateKeywordPlanAdGroupsRequest(ref request, ref callSettings); return(_callMutateKeywordPlanAdGroups.Async(request, callSettings)); }
partial void Modify_MutateKeywordPlanAdGroupsRequest(ref MutateKeywordPlanAdGroupsRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Creates, updates, or removes Keyword Plan ad groups. 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 <MutateKeywordPlanAdGroupsResponse> MutateKeywordPlanAdGroupsAsync(MutateKeywordPlanAdGroupsRequest request, st::CancellationToken cancellationToken) => MutateKeywordPlanAdGroupsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Creates, updates, or removes Keyword Plan ad groups. 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 <MutateKeywordPlanAdGroupsResponse> MutateKeywordPlanAdGroupsAsync(MutateKeywordPlanAdGroupsRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();