public async stt::Task MutateCampaignFeedsAsync() { moq::Mock <CampaignFeedService.CampaignFeedServiceClient> mockGrpcClient = new moq::Mock <CampaignFeedService.CampaignFeedServiceClient>(moq::MockBehavior.Strict); MutateCampaignFeedsRequest request = new MutateCampaignFeedsRequest { CustomerId = "customer_id3b3724cb", Operations = { new CampaignFeedOperation(), }, }; MutateCampaignFeedsResponse expectedResponse = new MutateCampaignFeedsResponse { Results = { new MutateCampaignFeedResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateCampaignFeedsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateCampaignFeedsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); CampaignFeedServiceClient client = new CampaignFeedServiceClientImpl(mockGrpcClient.Object, null); MutateCampaignFeedsResponse responseCallSettings = await client.MutateCampaignFeedsAsync(request.CustomerId, request.Operations, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); Assert.AreEqual(expectedResponse, responseCallSettings); MutateCampaignFeedsResponse responseCancellationToken = await client.MutateCampaignFeedsAsync(request.CustomerId, request.Operations, st::CancellationToken.None); Assert.AreEqual(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void MutateCampaignFeeds() { moq::Mock <CampaignFeedService.CampaignFeedServiceClient> mockGrpcClient = new moq::Mock <CampaignFeedService.CampaignFeedServiceClient>(moq::MockBehavior.Strict); MutateCampaignFeedsRequest request = new MutateCampaignFeedsRequest { CustomerId = "customer_id3b3724cb", Operations = { new CampaignFeedOperation(), }, }; MutateCampaignFeedsResponse expectedResponse = new MutateCampaignFeedsResponse { Results = { new MutateCampaignFeedResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateCampaignFeeds(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); CampaignFeedServiceClient client = new CampaignFeedServiceClientImpl(mockGrpcClient.Object, null); MutateCampaignFeedsResponse response = client.MutateCampaignFeeds(request.CustomerId, request.Operations); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateCampaignFeedsRequestObject() { moq::Mock <CampaignFeedService.CampaignFeedServiceClient> mockGrpcClient = new moq::Mock <CampaignFeedService.CampaignFeedServiceClient>(moq::MockBehavior.Strict); MutateCampaignFeedsRequest request = new MutateCampaignFeedsRequest { CustomerId = "customer_id3b3724cb", Operations = { new CampaignFeedOperation(), }, PartialFailure = false, ValidateOnly = true, ResponseContentType = gagve::ResponseContentTypeEnum.Types.ResponseContentType.ResourceNameOnly, }; MutateCampaignFeedsResponse expectedResponse = new MutateCampaignFeedsResponse { Results = { new MutateCampaignFeedResult(), }, PartialFailureError = new gr::Status(), }; mockGrpcClient.Setup(x => x.MutateCampaignFeeds(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); CampaignFeedServiceClient client = new CampaignFeedServiceClientImpl(mockGrpcClient.Object, null); MutateCampaignFeedsResponse response = client.MutateCampaignFeeds(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async Task MutateCampaignFeedsAsync3() { Mock <CampaignFeedService.CampaignFeedServiceClient> mockGrpcClient = new Mock <CampaignFeedService.CampaignFeedServiceClient>(MockBehavior.Strict); MutateCampaignFeedsRequest request = new MutateCampaignFeedsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateCampaignFeedsResponse expectedResponse = new MutateCampaignFeedsResponse(); mockGrpcClient.Setup(x => x.MutateCampaignFeedsAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateCampaignFeedsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); CampaignFeedServiceClient client = new CampaignFeedServiceClientImpl(mockGrpcClient.Object, null); MutateCampaignFeedsResponse response = await client.MutateCampaignFeedsAsync(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateCampaignFeeds3() { Mock <CampaignFeedService.CampaignFeedServiceClient> mockGrpcClient = new Mock <CampaignFeedService.CampaignFeedServiceClient>(MockBehavior.Strict); MutateCampaignFeedsRequest request = new MutateCampaignFeedsRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateCampaignFeedsResponse expectedResponse = new MutateCampaignFeedsResponse(); mockGrpcClient.Setup(x => x.MutateCampaignFeeds(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); CampaignFeedServiceClient client = new CampaignFeedServiceClientImpl(mockGrpcClient.Object, null); MutateCampaignFeedsResponse response = client.MutateCampaignFeeds(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateCampaignFeeds</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void MutateCampaignFeedsRequestObject() { // Create client CampaignFeedServiceClient campaignFeedServiceClient = CampaignFeedServiceClient.Create(); // Initialize request argument(s) MutateCampaignFeedsRequest request = new MutateCampaignFeedsRequest { CustomerId = "", Operations = { new CampaignFeedOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateCampaignFeedsResponse response = campaignFeedServiceClient.MutateCampaignFeeds(request); }
/// <summary>Snippet for MutateCampaignFeedsAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task MutateCampaignFeedsRequestObjectAsync() { // Create client CampaignFeedServiceClient campaignFeedServiceClient = await CampaignFeedServiceClient.CreateAsync(); // Initialize request argument(s) MutateCampaignFeedsRequest request = new MutateCampaignFeedsRequest { CustomerId = "", Operations = { new CampaignFeedOperation(), }, PartialFailure = false, ValidateOnly = false, ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified, }; // Make the request MutateCampaignFeedsResponse response = await campaignFeedServiceClient.MutateCampaignFeedsAsync(request); }
/// <summary>Snippet for MutateCampaignFeeds</summary> public void MutateCampaignFeedsRequestObject() { // Snippet: MutateCampaignFeeds(MutateCampaignFeedsRequest, CallSettings) // Create client CampaignFeedServiceClient campaignFeedServiceClient = CampaignFeedServiceClient.Create(); // Initialize request argument(s) MutateCampaignFeedsRequest request = new MutateCampaignFeedsRequest { CustomerId = "", Operations = { new CampaignFeedOperation(), }, PartialFailure = false, ValidateOnly = false, ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified, }; // Make the request MutateCampaignFeedsResponse response = campaignFeedServiceClient.MutateCampaignFeeds(request); // End snippet }
/// <summary>Snippet for MutateCampaignFeedsAsync</summary> public async Task MutateCampaignFeedsRequestObjectAsync() { // Snippet: MutateCampaignFeedsAsync(MutateCampaignFeedsRequest, CallSettings) // Additional: MutateCampaignFeedsAsync(MutateCampaignFeedsRequest, CancellationToken) // Create client CampaignFeedServiceClient campaignFeedServiceClient = await CampaignFeedServiceClient.CreateAsync(); // Initialize request argument(s) MutateCampaignFeedsRequest request = new MutateCampaignFeedsRequest { CustomerId = "", Operations = { new CampaignFeedOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateCampaignFeedsResponse response = await campaignFeedServiceClient.MutateCampaignFeedsAsync(request); // End snippet }
public async Task MutateCampaignFeedsAsync() { Mock <CampaignFeedService.CampaignFeedServiceClient> mockGrpcClient = new Mock <CampaignFeedService.CampaignFeedServiceClient>(MockBehavior.Strict); MutateCampaignFeedsRequest expectedRequest = new MutateCampaignFeedsRequest { CustomerId = "customerId-1772061412", Operations = { }, PartialFailure = true, ValidateOnly = false, }; MutateCampaignFeedsResponse expectedResponse = new MutateCampaignFeedsResponse(); mockGrpcClient.Setup(x => x.MutateCampaignFeedsAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <MutateCampaignFeedsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); CampaignFeedServiceClient client = new CampaignFeedServiceClientImpl(mockGrpcClient.Object, null); string customerId = "customerId-1772061412"; IEnumerable <CampaignFeedOperation> operations = new List <CampaignFeedOperation>(); bool partialFailure = true; bool validateOnly = false; MutateCampaignFeedsResponse response = await client.MutateCampaignFeedsAsync(customerId, operations, partialFailure, validateOnly); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary> /// Creates, updates, or removes campaign feeds. Operation statuses are /// returned. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [CampaignFeedError]() /// [CollectionSizeError]() /// [DatabaseError]() /// [DistinctError]() /// [FieldError]() /// [FunctionError]() /// [FunctionParsingError]() /// [HeaderError]() /// [IdError]() /// [InternalError]() /// [MutateError]() /// [NotEmptyError]() /// [NullError]() /// [OperationAccessDeniedError]() /// [OperatorError]() /// [QuotaError]() /// [RangeError]() /// [RequestError]() /// [SizeLimitError]() /// [StringFormatError]() /// [StringLengthError]() /// </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 <MutateCampaignFeedsResponse> MutateCampaignFeedsAsync(MutateCampaignFeedsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MutateCampaignFeedsRequest(ref request, ref callSettings); return(_callMutateCampaignFeeds.Async(request, callSettings)); }
partial void Modify_MutateCampaignFeedsRequest(ref MutateCampaignFeedsRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Creates, updates, or removes campaign feeds. Operation statuses are /// returned. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [CampaignFeedError]() /// [CollectionSizeError]() /// [DatabaseError]() /// [DistinctError]() /// [FieldError]() /// [FunctionError]() /// [FunctionParsingError]() /// [HeaderError]() /// [IdError]() /// [InternalError]() /// [MutateError]() /// [NotEmptyError]() /// [NullError]() /// [OperationAccessDeniedError]() /// [OperatorError]() /// [QuotaError]() /// [RangeError]() /// [RequestError]() /// [SizeLimitError]() /// [StringFormatError]() /// [StringLengthError]() /// </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 <MutateCampaignFeedsResponse> MutateCampaignFeedsAsync(MutateCampaignFeedsRequest request, st::CancellationToken cancellationToken) => MutateCampaignFeedsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Creates, updates, or removes campaign feeds. Operation statuses are /// returned. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [CampaignFeedError]() /// [CollectionSizeError]() /// [DatabaseError]() /// [DistinctError]() /// [FieldError]() /// [FunctionError]() /// [FunctionParsingError]() /// [HeaderError]() /// [IdError]() /// [InternalError]() /// [MutateError]() /// [NotEmptyError]() /// [NullError]() /// [OperationAccessDeniedError]() /// [OperatorError]() /// [QuotaError]() /// [RangeError]() /// [RequestError]() /// [SizeLimitError]() /// [StringFormatError]() /// [StringLengthError]() /// </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 <MutateCampaignFeedsResponse> MutateCampaignFeedsAsync(MutateCampaignFeedsRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();