public void MutateFeeds()
        {
            moq::Mock <FeedService.FeedServiceClient> mockGrpcClient = new moq::Mock <FeedService.FeedServiceClient>(moq::MockBehavior.Strict);
            MutateFeedsRequest request = new MutateFeedsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new FeedOperation(),
                },
            };
            MutateFeedsResponse expectedResponse = new MutateFeedsResponse
            {
                Results =
                {
                    new MutateFeedResult(),
                },
                PartialFailureError = new gr::Status(),
            };

            mockGrpcClient.Setup(x => x.MutateFeeds(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            FeedServiceClient   client   = new FeedServiceClientImpl(mockGrpcClient.Object, null);
            MutateFeedsResponse response = client.MutateFeeds(request.CustomerId, request.Operations);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async stt::Task MutateFeedsAsync()
        {
            moq::Mock <FeedService.FeedServiceClient> mockGrpcClient = new moq::Mock <FeedService.FeedServiceClient>(moq::MockBehavior.Strict);
            MutateFeedsRequest request = new MutateFeedsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new FeedOperation(),
                },
            };
            MutateFeedsResponse expectedResponse = new MutateFeedsResponse
            {
                Results =
                {
                    new MutateFeedResult(),
                },
                PartialFailureError = new gr::Status(),
            };

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

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            MutateFeedsResponse responseCancellationToken = await client.MutateFeedsAsync(request.CustomerId, request.Operations, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public void MutateFeedsRequestObject()
        {
            moq::Mock <FeedService.FeedServiceClient> mockGrpcClient = new moq::Mock <FeedService.FeedServiceClient>(moq::MockBehavior.Strict);
            MutateFeedsRequest request = new MutateFeedsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new FeedOperation(),
                },
                PartialFailure      = false,
                ValidateOnly        = true,
                ResponseContentType = gagve::ResponseContentTypeEnum.Types.ResponseContentType.ResourceNameOnly,
            };
            MutateFeedsResponse expectedResponse = new MutateFeedsResponse
            {
                Results =
                {
                    new MutateFeedResult(),
                },
                PartialFailureError = new gr::Status(),
            };

            mockGrpcClient.Setup(x => x.MutateFeeds(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            FeedServiceClient   client   = new FeedServiceClientImpl(mockGrpcClient.Object, null);
            MutateFeedsResponse response = client.MutateFeeds(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>Snippet for MutateFeeds</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void MutateFeedsRequestObject()
 {
     // Create client
     FeedServiceClient feedServiceClient = FeedServiceClient.Create();
     // Initialize request argument(s)
     MutateFeedsRequest request = new MutateFeedsRequest
     {
         CustomerId = "",
         Operations =
         {
             new FeedOperation(),
         },
         PartialFailure = false,
         ValidateOnly   = false,
     };
     // Make the request
     MutateFeedsResponse response = feedServiceClient.MutateFeeds(request);
 }
示例#5
0
        public async Task MutateFeedsAsync2()
        {
            Mock <FeedService.FeedServiceClient> mockGrpcClient = new Mock <FeedService.FeedServiceClient>(MockBehavior.Strict);
            MutateFeedsRequest request = new MutateFeedsRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateFeedsResponse expectedResponse = new MutateFeedsResponse();

            mockGrpcClient.Setup(x => x.MutateFeedsAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <MutateFeedsResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            FeedServiceClient   client   = new FeedServiceClientImpl(mockGrpcClient.Object, null);
            MutateFeedsResponse response = await client.MutateFeedsAsync(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
示例#6
0
        public void MutateFeeds2()
        {
            Mock <FeedService.FeedServiceClient> mockGrpcClient = new Mock <FeedService.FeedServiceClient>(MockBehavior.Strict);
            MutateFeedsRequest request = new MutateFeedsRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateFeedsResponse expectedResponse = new MutateFeedsResponse();

            mockGrpcClient.Setup(x => x.MutateFeeds(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            FeedServiceClient   client   = new FeedServiceClientImpl(mockGrpcClient.Object, null);
            MutateFeedsResponse response = client.MutateFeeds(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        /// <summary>Snippet for MutateFeedsAsync</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 MutateFeedsRequestObjectAsync()
        {
            // Create client
            FeedServiceClient feedServiceClient = await FeedServiceClient.CreateAsync();

            // Initialize request argument(s)
            MutateFeedsRequest request = new MutateFeedsRequest
            {
                CustomerId = "",
                Operations =
                {
                    new FeedOperation(),
                },
                PartialFailure      = false,
                ValidateOnly        = false,
                ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified,
            };
            // Make the request
            MutateFeedsResponse response = await feedServiceClient.MutateFeedsAsync(request);
        }
示例#8
0
 /// <summary>Snippet for MutateFeeds</summary>
 public void MutateFeedsRequestObject()
 {
     // Snippet: MutateFeeds(MutateFeedsRequest, CallSettings)
     // Create client
     FeedServiceClient feedServiceClient = FeedServiceClient.Create();
     // Initialize request argument(s)
     MutateFeedsRequest request = new MutateFeedsRequest
     {
         CustomerId = "",
         Operations =
         {
             new FeedOperation(),
         },
         PartialFailure      = false,
         ValidateOnly        = false,
         ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified,
     };
     // Make the request
     MutateFeedsResponse response = feedServiceClient.MutateFeeds(request);
     // End snippet
 }
        /// <summary>Snippet for MutateFeedsAsync</summary>
        public async Task MutateFeedsRequestObjectAsync()
        {
            // Snippet: MutateFeedsAsync(MutateFeedsRequest, CallSettings)
            // Additional: MutateFeedsAsync(MutateFeedsRequest, CancellationToken)
            // Create client
            FeedServiceClient feedServiceClient = await FeedServiceClient.CreateAsync();

            // Initialize request argument(s)
            MutateFeedsRequest request = new MutateFeedsRequest
            {
                CustomerId = "",
                Operations =
                {
                    new FeedOperation(),
                },
                PartialFailure = false,
                ValidateOnly   = false,
            };
            // Make the request
            MutateFeedsResponse response = await feedServiceClient.MutateFeedsAsync(request);

            // End snippet
        }
示例#10
0
        public async Task MutateFeedsAsync()
        {
            Mock <FeedService.FeedServiceClient> mockGrpcClient = new Mock <FeedService.FeedServiceClient>(MockBehavior.Strict);
            MutateFeedsRequest expectedRequest = new MutateFeedsRequest
            {
                CustomerId     = "customerId-1772061412",
                Operations     = { },
                PartialFailure = true,
                ValidateOnly   = false,
            };
            MutateFeedsResponse expectedResponse = new MutateFeedsResponse();

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

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
示例#11
0
 /// <summary>
 /// Creates, updates, or removes feeds. Operation statuses are
 /// returned.
 ///
 /// List of thrown errors:
 /// [AuthenticationError]()
 /// [AuthorizationError]()
 /// [CollectionSizeError]()
 /// [DatabaseError]()
 /// [DistinctError]()
 /// [FeedError]()
 /// [FieldError]()
 /// [FieldMaskError]()
 /// [HeaderError]()
 /// [IdError]()
 /// [InternalError]()
 /// [ListOperationError]()
 /// [MutateError]()
 /// [NewResourceCreationError]()
 /// [NotEmptyError]()
 /// [NullError]()
 /// [OperatorError]()
 /// [QuotaError]()
 /// [RangeError]()
 /// [RequestError]()
 /// [ResourceCountLimitExceededError]()
 /// [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 <MutateFeedsResponse> MutateFeedsAsync(MutateFeedsRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_MutateFeedsRequest(ref request, ref callSettings);
     return(_callMutateFeeds.Async(request, callSettings));
 }
示例#12
0
 /// <summary>
 /// Creates, updates, or removes feeds. Operation statuses are
 /// returned.
 ///
 /// List of thrown errors:
 /// [AuthenticationError]()
 /// [AuthorizationError]()
 /// [CollectionSizeError]()
 /// [DatabaseError]()
 /// [DistinctError]()
 /// [FeedError]()
 /// [FieldError]()
 /// [FieldMaskError]()
 /// [HeaderError]()
 /// [IdError]()
 /// [InternalError]()
 /// [ListOperationError]()
 /// [MutateError]()
 /// [NewResourceCreationError]()
 /// [NotEmptyError]()
 /// [NullError]()
 /// [OperatorError]()
 /// [QuotaError]()
 /// [RangeError]()
 /// [RequestError]()
 /// [ResourceCountLimitExceededError]()
 /// [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>The RPC response.</returns>
 public override MutateFeedsResponse MutateFeeds(MutateFeedsRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_MutateFeedsRequest(ref request, ref callSettings);
     return(_callMutateFeeds.Sync(request, callSettings));
 }
示例#13
0
 partial void Modify_MutateFeedsRequest(ref MutateFeedsRequest request, ref gaxgrpc::CallSettings settings);
示例#14
0
 /// <summary>
 /// Creates, updates, or removes feeds. Operation statuses are
 /// returned.
 ///
 /// List of thrown errors:
 /// [AuthenticationError]()
 /// [AuthorizationError]()
 /// [CollectionSizeError]()
 /// [DatabaseError]()
 /// [DistinctError]()
 /// [FeedError]()
 /// [FieldError]()
 /// [FieldMaskError]()
 /// [HeaderError]()
 /// [IdError]()
 /// [InternalError]()
 /// [ListOperationError]()
 /// [MutateError]()
 /// [NewResourceCreationError]()
 /// [NotEmptyError]()
 /// [NullError]()
 /// [OperatorError]()
 /// [QuotaError]()
 /// [RangeError]()
 /// [RequestError]()
 /// [ResourceCountLimitExceededError]()
 /// [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 <MutateFeedsResponse> MutateFeedsAsync(MutateFeedsRequest request, st::CancellationToken cancellationToken) =>
 MutateFeedsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
示例#15
0
 /// <summary>
 /// Creates, updates, or removes feeds. Operation statuses are
 /// returned.
 ///
 /// List of thrown errors:
 /// [AuthenticationError]()
 /// [AuthorizationError]()
 /// [CollectionSizeError]()
 /// [DatabaseError]()
 /// [DistinctError]()
 /// [FeedError]()
 /// [FieldError]()
 /// [FieldMaskError]()
 /// [HeaderError]()
 /// [IdError]()
 /// [InternalError]()
 /// [ListOperationError]()
 /// [MutateError]()
 /// [NewResourceCreationError]()
 /// [NotEmptyError]()
 /// [NullError]()
 /// [OperatorError]()
 /// [QuotaError]()
 /// [RangeError]()
 /// [RequestError]()
 /// [ResourceCountLimitExceededError]()
 /// [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 <MutateFeedsResponse> MutateFeedsAsync(MutateFeedsRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();
示例#16
0
 /// <summary>
 /// Creates, updates, or removes feeds. Operation statuses are
 /// returned.
 ///
 /// List of thrown errors:
 /// [AuthenticationError]()
 /// [AuthorizationError]()
 /// [CollectionSizeError]()
 /// [DatabaseError]()
 /// [DistinctError]()
 /// [FeedError]()
 /// [FieldError]()
 /// [FieldMaskError]()
 /// [HeaderError]()
 /// [IdError]()
 /// [InternalError]()
 /// [ListOperationError]()
 /// [MutateError]()
 /// [NewResourceCreationError]()
 /// [NotEmptyError]()
 /// [NullError]()
 /// [OperatorError]()
 /// [QuotaError]()
 /// [RangeError]()
 /// [RequestError]()
 /// [ResourceCountLimitExceededError]()
 /// [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>The RPC response.</returns>
 public virtual MutateFeedsResponse MutateFeeds(MutateFeedsRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();