public void GetCampaignDraft()
        {
            moq::Mock <CampaignDraftService.CampaignDraftServiceClient> mockGrpcClient = new moq::Mock <CampaignDraftService.CampaignDraftServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetCampaignDraftRequest request = new GetCampaignDraftRequest
            {
                ResourceNameAsCampaignDraftName = gagvr::CampaignDraftName.FromCustomerCampaignDraft("[CUSTOMER]", "[CAMPAIGN_DRAFT]"),
            };
            gagvr::CampaignDraft expectedResponse = new gagvr::CampaignDraft
            {
                ResourceNameAsCampaignDraftName = gagvr::CampaignDraftName.FromCustomerCampaignDraft("[CUSTOMER]", "[CAMPAIGN_DRAFT]"),
                DraftId = -3652444185194679204L,
                BaseCampaignAsCampaignName  = gagvr::CampaignName.FromCustomerCampaign("[CUSTOMER]", "[CAMPAIGN]"),
                CampaignDraftName           = gagvr::CampaignDraftName.FromCustomerCampaignDraft("[CUSTOMER]", "[CAMPAIGN_DRAFT]"),
                DraftCampaignAsCampaignName = gagvr::CampaignName.FromCustomerCampaign("[CUSTOMER]", "[CAMPAIGN]"),
                Status = gagve::CampaignDraftStatusEnum.Types.CampaignDraftStatus.Removed,
                HasExperimentRunning = true,
                LongRunningOperation = "long_running_operation0897bd41",
            };

            mockGrpcClient.Setup(x => x.GetCampaignDraft(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            CampaignDraftServiceClient client   = new CampaignDraftServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::CampaignDraft       response = client.GetCampaignDraft(request.ResourceName);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task MutateCampaignDraftsAsync()
        {
            moq::Mock <CampaignDraftService.CampaignDraftServiceClient> mockGrpcClient = new moq::Mock <CampaignDraftService.CampaignDraftServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            MutateCampaignDraftsRequest request = new MutateCampaignDraftsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new CampaignDraftOperation(),
                },
            };
            MutateCampaignDraftsResponse expectedResponse = new MutateCampaignDraftsResponse
            {
                Results =
                {
                    new MutateCampaignDraftResult(),
                },
                PartialFailureError = new gr::Status(),
            };

            mockGrpcClient.Setup(x => x.MutateCampaignDraftsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateCampaignDraftsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            CampaignDraftServiceClient   client = new CampaignDraftServiceClientImpl(mockGrpcClient.Object, null);
            MutateCampaignDraftsResponse responseCallSettings = await client.MutateCampaignDraftsAsync(request.CustomerId, request.Operations, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            Assert.AreEqual(expectedResponse, responseCallSettings);
            MutateCampaignDraftsResponse responseCancellationToken = await client.MutateCampaignDraftsAsync(request.CustomerId, request.Operations, st::CancellationToken.None);

            Assert.AreEqual(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task GetCampaignDraftRequestObjectAsync()
        {
            moq::Mock <CampaignDraftService.CampaignDraftServiceClient> mockGrpcClient = new moq::Mock <CampaignDraftService.CampaignDraftServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            GetCampaignDraftRequest request = new GetCampaignDraftRequest
            {
                ResourceNameAsCampaignDraftName = gagvr::CampaignDraftName.FromCustomerCampaignDraft("[CUSTOMER]", "[CAMPAIGN_DRAFT]"),
            };
            gagvr::CampaignDraft expectedResponse = new gagvr::CampaignDraft
            {
                ResourceNameAsCampaignDraftName = gagvr::CampaignDraftName.FromCustomerCampaignDraft("[CUSTOMER]", "[CAMPAIGN_DRAFT]"),
                DraftId = -3652444185194679204L,
                BaseCampaignAsCampaignName  = gagvr::CampaignName.FromCustomerCampaign("[CUSTOMER]", "[CAMPAIGN]"),
                CampaignDraftName           = gagvr::CampaignDraftName.FromCustomerCampaignDraft("[CUSTOMER]", "[CAMPAIGN_DRAFT]"),
                DraftCampaignAsCampaignName = gagvr::CampaignName.FromCustomerCampaign("[CUSTOMER]", "[CAMPAIGN]"),
                Status = gagve::CampaignDraftStatusEnum.Types.CampaignDraftStatus.Removed,
                HasExperimentRunning = true,
                LongRunningOperation = "long_running_operation0897bd41",
            };

            mockGrpcClient.Setup(x => x.GetCampaignDraftAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <gagvr::CampaignDraft>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            CampaignDraftServiceClient client = new CampaignDraftServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::CampaignDraft       responseCallSettings = await client.GetCampaignDraftAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            Assert.AreEqual(expectedResponse, responseCallSettings);
            gagvr::CampaignDraft responseCancellationToken = await client.GetCampaignDraftAsync(request, st::CancellationToken.None);

            Assert.AreEqual(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public void MutateCampaignDraftsRequestObject()
        {
            moq::Mock <CampaignDraftService.CampaignDraftServiceClient> mockGrpcClient = new moq::Mock <CampaignDraftService.CampaignDraftServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            MutateCampaignDraftsRequest request = new MutateCampaignDraftsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new CampaignDraftOperation(),
                },
                PartialFailure      = false,
                ValidateOnly        = true,
                ResponseContentType = gagve::ResponseContentTypeEnum.Types.ResponseContentType.ResourceNameOnly,
            };
            MutateCampaignDraftsResponse expectedResponse = new MutateCampaignDraftsResponse
            {
                Results =
                {
                    new MutateCampaignDraftResult(),
                },
                PartialFailureError = new gr::Status(),
            };

            mockGrpcClient.Setup(x => x.MutateCampaignDrafts(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            CampaignDraftServiceClient   client   = new CampaignDraftServiceClientImpl(mockGrpcClient.Object, null);
            MutateCampaignDraftsResponse response = client.MutateCampaignDrafts(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void MutateCampaignDrafts()
        {
            moq::Mock <CampaignDraftService.CampaignDraftServiceClient> mockGrpcClient = new moq::Mock <CampaignDraftService.CampaignDraftServiceClient>(moq::MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient()).Returns(new moq::Mock <lro::Operations.OperationsClient>().Object);
            MutateCampaignDraftsRequest request = new MutateCampaignDraftsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new CampaignDraftOperation(),
                },
            };
            MutateCampaignDraftsResponse expectedResponse = new MutateCampaignDraftsResponse
            {
                Results =
                {
                    new MutateCampaignDraftResult(),
                },
                PartialFailureError = new gr::Status(),
            };

            mockGrpcClient.Setup(x => x.MutateCampaignDrafts(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            CampaignDraftServiceClient   client   = new CampaignDraftServiceClientImpl(mockGrpcClient.Object, null);
            MutateCampaignDraftsResponse response = client.MutateCampaignDrafts(request.CustomerId, request.Operations);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async Task MutateCampaignDraftsAsync()
        {
            Mock <CampaignDraftService.CampaignDraftServiceClient> mockGrpcClient = new Mock <CampaignDraftService.CampaignDraftServiceClient>(MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient())
            .Returns(new Mock <Operations.OperationsClient>().Object);
            MutateCampaignDraftsRequest expectedRequest = new MutateCampaignDraftsRequest
            {
                CustomerId     = "customerId-1772061412",
                Operations     = { },
                PartialFailure = true,
                ValidateOnly   = false,
            };
            MutateCampaignDraftsResponse expectedResponse = new MutateCampaignDraftsResponse();

            mockGrpcClient.Setup(x => x.MutateCampaignDraftsAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <MutateCampaignDraftsResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            CampaignDraftServiceClient client = new CampaignDraftServiceClientImpl(mockGrpcClient.Object, null);
            string customerId = "customerId-1772061412";
            IEnumerable <CampaignDraftOperation> operations = new List <CampaignDraftOperation>();
            bool partialFailure = true;
            bool validateOnly   = false;
            MutateCampaignDraftsResponse response = await client.MutateCampaignDraftsAsync(customerId, operations, partialFailure, validateOnly);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async Task MutateCampaignDraftsAsync3()
        {
            Mock <CampaignDraftService.CampaignDraftServiceClient> mockGrpcClient = new Mock <CampaignDraftService.CampaignDraftServiceClient>(MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient())
            .Returns(new Mock <Operations.OperationsClient>().Object);
            MutateCampaignDraftsRequest request = new MutateCampaignDraftsRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateCampaignDraftsResponse expectedResponse = new MutateCampaignDraftsResponse();

            mockGrpcClient.Setup(x => x.MutateCampaignDraftsAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <MutateCampaignDraftsResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            CampaignDraftServiceClient   client   = new CampaignDraftServiceClientImpl(mockGrpcClient.Object, null);
            MutateCampaignDraftsResponse response = await client.MutateCampaignDraftsAsync(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void MutateCampaignDrafts3()
        {
            Mock <CampaignDraftService.CampaignDraftServiceClient> mockGrpcClient = new Mock <CampaignDraftService.CampaignDraftServiceClient>(MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient())
            .Returns(new Mock <Operations.OperationsClient>().Object);
            MutateCampaignDraftsRequest request = new MutateCampaignDraftsRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateCampaignDraftsResponse expectedResponse = new MutateCampaignDraftsResponse();

            mockGrpcClient.Setup(x => x.MutateCampaignDrafts(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            CampaignDraftServiceClient   client   = new CampaignDraftServiceClientImpl(mockGrpcClient.Object, null);
            MutateCampaignDraftsResponse response = client.MutateCampaignDrafts(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void GetCampaignDraft2()
        {
            Mock <CampaignDraftService.CampaignDraftServiceClient> mockGrpcClient = new Mock <CampaignDraftService.CampaignDraftServiceClient>(MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient())
            .Returns(new Mock <Operations.OperationsClient>().Object);
            GetCampaignDraftRequest request = new GetCampaignDraftRequest
            {
                ResourceName = new CampaignDraftName("[CUSTOMER]", "[CAMPAIGN_DRAFT]").ToString(),
            };
            CampaignDraft expectedResponse = new CampaignDraft
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetCampaignDraft(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            CampaignDraftServiceClient client = new CampaignDraftServiceClientImpl(mockGrpcClient.Object, null);
            CampaignDraft response            = client.GetCampaignDraft(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async Task GetCampaignDraftAsync()
        {
            Mock <CampaignDraftService.CampaignDraftServiceClient> mockGrpcClient = new Mock <CampaignDraftService.CampaignDraftServiceClient>(MockBehavior.Strict);

            mockGrpcClient.Setup(x => x.CreateOperationsClient())
            .Returns(new Mock <Operations.OperationsClient>().Object);
            GetCampaignDraftRequest expectedRequest = new GetCampaignDraftRequest
            {
                ResourceName = new CampaignDraftName("[CUSTOMER]", "[CAMPAIGN_DRAFT]").ToString(),
            };
            CampaignDraft expectedResponse = new CampaignDraft
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetCampaignDraftAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <CampaignDraft>(Task.FromResult(expectedResponse), null, null, null, null));
            CampaignDraftServiceClient client   = new CampaignDraftServiceClientImpl(mockGrpcClient.Object, null);
            string        formattedResourceName = new CampaignDraftName("[CUSTOMER]", "[CAMPAIGN_DRAFT]").ToString();
            CampaignDraft response = await client.GetCampaignDraftAsync(formattedResourceName);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }