Example #1
0
        public void MutateSmartCampaignSettings()
        {
            moq::Mock <SmartCampaignSettingService.SmartCampaignSettingServiceClient> mockGrpcClient = new moq::Mock <SmartCampaignSettingService.SmartCampaignSettingServiceClient>(moq::MockBehavior.Strict);
            MutateSmartCampaignSettingsRequest request = new MutateSmartCampaignSettingsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new SmartCampaignSettingOperation(),
                },
            };
            MutateSmartCampaignSettingsResponse expectedResponse = new MutateSmartCampaignSettingsResponse
            {
                PartialFailureError = new gr::Status(),
                Results             =
                {
                    new MutateSmartCampaignSettingResult(),
                },
            };

            mockGrpcClient.Setup(x => x.MutateSmartCampaignSettings(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            SmartCampaignSettingServiceClient   client   = new SmartCampaignSettingServiceClientImpl(mockGrpcClient.Object, null);
            MutateSmartCampaignSettingsResponse response = client.MutateSmartCampaignSettings(request.CustomerId, request.Operations);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void MutateSmartCampaignSettingsRequestObject()
        {
            moq::Mock <SmartCampaignSettingService.SmartCampaignSettingServiceClient> mockGrpcClient = new moq::Mock <SmartCampaignSettingService.SmartCampaignSettingServiceClient>(moq::MockBehavior.Strict);
            MutateSmartCampaignSettingsRequest request = new MutateSmartCampaignSettingsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new SmartCampaignSettingOperation(),
                },
                PartialFailure      = false,
                ValidateOnly        = true,
                ResponseContentType = gagve::ResponseContentTypeEnum.Types.ResponseContentType.ResourceNameOnly,
            };
            MutateSmartCampaignSettingsResponse expectedResponse = new MutateSmartCampaignSettingsResponse
            {
                PartialFailureError = new gr::Status(),
                Results             =
                {
                    new MutateSmartCampaignSettingResult(),
                },
            };

            mockGrpcClient.Setup(x => x.MutateSmartCampaignSettings(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            SmartCampaignSettingServiceClient   client   = new SmartCampaignSettingServiceClientImpl(mockGrpcClient.Object, null);
            MutateSmartCampaignSettingsResponse response = client.MutateSmartCampaignSettings(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Example #3
0
        public async stt::Task MutateSmartCampaignSettingsRequestObjectAsync()
        {
            moq::Mock <SmartCampaignSettingService.SmartCampaignSettingServiceClient> mockGrpcClient = new moq::Mock <SmartCampaignSettingService.SmartCampaignSettingServiceClient>(moq::MockBehavior.Strict);
            MutateSmartCampaignSettingsRequest request = new MutateSmartCampaignSettingsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new SmartCampaignSettingOperation(),
                },
                PartialFailure      = false,
                ValidateOnly        = true,
                ResponseContentType = gagve::ResponseContentTypeEnum.Types.ResponseContentType.ResourceNameOnly,
            };
            MutateSmartCampaignSettingsResponse expectedResponse = new MutateSmartCampaignSettingsResponse
            {
                PartialFailureError = new gr::Status(),
                Results             =
                {
                    new MutateSmartCampaignSettingResult(),
                },
            };

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

            Assert.AreEqual(expectedResponse, responseCallSettings);
            MutateSmartCampaignSettingsResponse responseCancellationToken = await client.MutateSmartCampaignSettingsAsync(request, st::CancellationToken.None);

            Assert.AreEqual(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>Snippet for MutateSmartCampaignSettings</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void MutateSmartCampaignSettingsRequestObject()
 {
     // Create client
     SmartCampaignSettingServiceClient smartCampaignSettingServiceClient = SmartCampaignSettingServiceClient.Create();
     // Initialize request argument(s)
     MutateSmartCampaignSettingsRequest request = new MutateSmartCampaignSettingsRequest
     {
         CustomerId = "",
         Operations =
         {
             new SmartCampaignSettingOperation(),
         },
         PartialFailure      = false,
         ValidateOnly        = false,
         ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified,
     };
     // Make the request
     MutateSmartCampaignSettingsResponse response = smartCampaignSettingServiceClient.MutateSmartCampaignSettings(request);
 }
Example #5
0
        /// <summary>Snippet for MutateSmartCampaignSettingsAsync</summary>
        public async Task MutateSmartCampaignSettingsRequestObjectAsync()
        {
            // Snippet: MutateSmartCampaignSettingsAsync(MutateSmartCampaignSettingsRequest, CallSettings)
            // Additional: MutateSmartCampaignSettingsAsync(MutateSmartCampaignSettingsRequest, CancellationToken)
            // Create client
            SmartCampaignSettingServiceClient smartCampaignSettingServiceClient = await SmartCampaignSettingServiceClient.CreateAsync();

            // Initialize request argument(s)
            MutateSmartCampaignSettingsRequest request = new MutateSmartCampaignSettingsRequest
            {
                CustomerId = "",
                Operations =
                {
                    new SmartCampaignSettingOperation(),
                },
                PartialFailure      = false,
                ValidateOnly        = false,
                ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified,
            };
            // Make the request
            MutateSmartCampaignSettingsResponse response = await smartCampaignSettingServiceClient.MutateSmartCampaignSettingsAsync(request);

            // End snippet
        }
 /// <summary>
 /// Updates Smart campaign settings for campaigns.
 /// </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 <MutateSmartCampaignSettingsResponse> MutateSmartCampaignSettingsAsync(MutateSmartCampaignSettingsRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_MutateSmartCampaignSettingsRequest(ref request, ref callSettings);
     return(_callMutateSmartCampaignSettings.Async(request, callSettings));
 }
 partial void Modify_MutateSmartCampaignSettingsRequest(ref MutateSmartCampaignSettingsRequest request, ref gaxgrpc::CallSettings settings);
 /// <summary>
 /// Updates Smart campaign settings for campaigns.
 /// </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 <MutateSmartCampaignSettingsResponse> MutateSmartCampaignSettingsAsync(MutateSmartCampaignSettingsRequest request, st::CancellationToken cancellationToken) =>
 MutateSmartCampaignSettingsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
 /// <summary>
 /// Updates Smart campaign settings for campaigns.
 /// </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 <MutateSmartCampaignSettingsResponse> MutateSmartCampaignSettingsAsync(MutateSmartCampaignSettingsRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();