public void MutateAdGroupAdLabels() { moq::Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient> mockGrpcClient = new moq::Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient>(moq::MockBehavior.Strict); MutateAdGroupAdLabelsRequest request = new MutateAdGroupAdLabelsRequest { CustomerId = "customer_id3b3724cb", Operations = { new AdGroupAdLabelOperation(), }, }; MutateAdGroupAdLabelsResponse expectedResponse = new MutateAdGroupAdLabelsResponse { Results = { new MutateAdGroupAdLabelResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateAdGroupAdLabels(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); AdGroupAdLabelServiceClient client = new AdGroupAdLabelServiceClientImpl(mockGrpcClient.Object, null); MutateAdGroupAdLabelsResponse response = client.MutateAdGroupAdLabels(request.CustomerId, request.Operations); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async stt::Task MutateAdGroupAdLabelsAsync() { moq::Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient> mockGrpcClient = new moq::Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient>(moq::MockBehavior.Strict); MutateAdGroupAdLabelsRequest request = new MutateAdGroupAdLabelsRequest { CustomerId = "customer_id3b3724cb", Operations = { new AdGroupAdLabelOperation(), }, }; MutateAdGroupAdLabelsResponse expectedResponse = new MutateAdGroupAdLabelsResponse { Results = { new MutateAdGroupAdLabelResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateAdGroupAdLabelsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateAdGroupAdLabelsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AdGroupAdLabelServiceClient client = new AdGroupAdLabelServiceClientImpl(mockGrpcClient.Object, null); MutateAdGroupAdLabelsResponse responseCallSettings = await client.MutateAdGroupAdLabelsAsync(request.CustomerId, request.Operations, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); MutateAdGroupAdLabelsResponse responseCancellationToken = await client.MutateAdGroupAdLabelsAsync(request.CustomerId, request.Operations, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public async Task MutateAdGroupAdLabelsAsync3() { Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient> mockGrpcClient = new Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient>(MockBehavior.Strict); MutateAdGroupAdLabelsRequest request = new MutateAdGroupAdLabelsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateAdGroupAdLabelsResponse expectedResponse = new MutateAdGroupAdLabelsResponse(); mockGrpcClient.Setup(x => x.MutateAdGroupAdLabelsAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateAdGroupAdLabelsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); AdGroupAdLabelServiceClient client = new AdGroupAdLabelServiceClientImpl(mockGrpcClient.Object, null); MutateAdGroupAdLabelsResponse response = await client.MutateAdGroupAdLabelsAsync(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateAdGroupAdLabels3() { Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient> mockGrpcClient = new Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient>(MockBehavior.Strict); MutateAdGroupAdLabelsRequest request = new MutateAdGroupAdLabelsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateAdGroupAdLabelsResponse expectedResponse = new MutateAdGroupAdLabelsResponse(); mockGrpcClient.Setup(x => x.MutateAdGroupAdLabels(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); AdGroupAdLabelServiceClient client = new AdGroupAdLabelServiceClientImpl(mockGrpcClient.Object, null); MutateAdGroupAdLabelsResponse response = client.MutateAdGroupAdLabels(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateAdGroupAdLabels</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void MutateAdGroupAdLabelsRequestObject() { // Create client AdGroupAdLabelServiceClient adGroupAdLabelServiceClient = AdGroupAdLabelServiceClient.Create(); // Initialize request argument(s) MutateAdGroupAdLabelsRequest request = new MutateAdGroupAdLabelsRequest { CustomerId = "", Operations = { new AdGroupAdLabelOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateAdGroupAdLabelsResponse response = adGroupAdLabelServiceClient.MutateAdGroupAdLabels(request); }
/// <summary>Snippet for MutateAdGroupAdLabelsAsync</summary> public async Task MutateAdGroupAdLabelsRequestObjectAsync() { // Snippet: MutateAdGroupAdLabelsAsync(MutateAdGroupAdLabelsRequest, CallSettings) // Additional: MutateAdGroupAdLabelsAsync(MutateAdGroupAdLabelsRequest, CancellationToken) // Create client AdGroupAdLabelServiceClient adGroupAdLabelServiceClient = await AdGroupAdLabelServiceClient.CreateAsync(); // Initialize request argument(s) MutateAdGroupAdLabelsRequest request = new MutateAdGroupAdLabelsRequest { CustomerId = "", Operations = { new AdGroupAdLabelOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateAdGroupAdLabelsResponse response = await adGroupAdLabelServiceClient.MutateAdGroupAdLabelsAsync(request); // End snippet }
public async Task MutateAdGroupAdLabelsAsync() { Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient> mockGrpcClient = new Mock <AdGroupAdLabelService.AdGroupAdLabelServiceClient>(MockBehavior.Strict); MutateAdGroupAdLabelsRequest expectedRequest = new MutateAdGroupAdLabelsRequest { CustomerId = "customerId-1772061412", Operations = { }, PartialFailure = true, ValidateOnly = false, }; MutateAdGroupAdLabelsResponse expectedResponse = new MutateAdGroupAdLabelsResponse(); mockGrpcClient.Setup(x => x.MutateAdGroupAdLabelsAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateAdGroupAdLabelsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); AdGroupAdLabelServiceClient client = new AdGroupAdLabelServiceClientImpl(mockGrpcClient.Object, null); string customerId = "customerId-1772061412"; IEnumerable <AdGroupAdLabelOperation> operations = new List <AdGroupAdLabelOperation>(); bool partialFailure = true; bool validateOnly = false; MutateAdGroupAdLabelsResponse response = await client.MutateAdGroupAdLabelsAsync(customerId, operations, partialFailure, validateOnly); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary> /// Creates and removes ad group ad labels. /// Operation statuses are returned. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [DatabaseError]() /// [HeaderError]() /// [InternalError]() /// [LabelError]() /// [MutateError]() /// [NewResourceCreationError]() /// [QuotaError]() /// [RequestError]() /// </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 <MutateAdGroupAdLabelsResponse> MutateAdGroupAdLabelsAsync(MutateAdGroupAdLabelsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MutateAdGroupAdLabelsRequest(ref request, ref callSettings); return(_callMutateAdGroupAdLabels.Async(request, callSettings)); }
partial void Modify_MutateAdGroupAdLabelsRequest(ref MutateAdGroupAdLabelsRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Creates and removes ad group ad labels. /// Operation statuses are returned. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [DatabaseError]() /// [HeaderError]() /// [InternalError]() /// [LabelError]() /// [MutateError]() /// [NewResourceCreationError]() /// [QuotaError]() /// [RequestError]() /// </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 <MutateAdGroupAdLabelsResponse> MutateAdGroupAdLabelsAsync(MutateAdGroupAdLabelsRequest request, st::CancellationToken cancellationToken) => MutateAdGroupAdLabelsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Creates and removes ad group ad labels. /// Operation statuses are returned. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [DatabaseError]() /// [HeaderError]() /// [InternalError]() /// [LabelError]() /// [MutateError]() /// [NewResourceCreationError]() /// [QuotaError]() /// [RequestError]() /// </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 <MutateAdGroupAdLabelsResponse> MutateAdGroupAdLabelsAsync(MutateAdGroupAdLabelsRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();