コード例 #1
0
        public async stt::Task MutateFeedMappingsAsync()
        {
            moq::Mock <FeedMappingService.FeedMappingServiceClient> mockGrpcClient = new moq::Mock <FeedMappingService.FeedMappingServiceClient>(moq::MockBehavior.Strict);
            MutateFeedMappingsRequest request = new MutateFeedMappingsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new FeedMappingOperation(),
                },
            };
            MutateFeedMappingsResponse expectedResponse = new MutateFeedMappingsResponse
            {
                Results =
                {
                    new MutateFeedMappingResult(),
                },
                PartialFailureError = new gr::Status(),
            };

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

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

            Assert.AreEqual(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
コード例 #2
0
        public void MutateFeedMappingsRequestObject()
        {
            moq::Mock <FeedMappingService.FeedMappingServiceClient> mockGrpcClient = new moq::Mock <FeedMappingService.FeedMappingServiceClient>(moq::MockBehavior.Strict);
            MutateFeedMappingsRequest request = new MutateFeedMappingsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new FeedMappingOperation(),
                },
                PartialFailure      = false,
                ValidateOnly        = true,
                ResponseContentType = gagve::ResponseContentTypeEnum.Types.ResponseContentType.ResourceNameOnly,
            };
            MutateFeedMappingsResponse expectedResponse = new MutateFeedMappingsResponse
            {
                Results =
                {
                    new MutateFeedMappingResult(),
                },
                PartialFailureError = new gr::Status(),
            };

            mockGrpcClient.Setup(x => x.MutateFeedMappings(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            FeedMappingServiceClient   client   = new FeedMappingServiceClientImpl(mockGrpcClient.Object, null);
            MutateFeedMappingsResponse response = client.MutateFeedMappings(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
コード例 #3
0
        public void MutateFeedMappings()
        {
            moq::Mock <FeedMappingService.FeedMappingServiceClient> mockGrpcClient = new moq::Mock <FeedMappingService.FeedMappingServiceClient>(moq::MockBehavior.Strict);
            MutateFeedMappingsRequest request = new MutateFeedMappingsRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operations =
                {
                    new FeedMappingOperation(),
                },
            };
            MutateFeedMappingsResponse expectedResponse = new MutateFeedMappingsResponse
            {
                Results =
                {
                    new MutateFeedMappingResult(),
                },
                PartialFailureError = new gr::Status(),
            };

            mockGrpcClient.Setup(x => x.MutateFeedMappings(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            FeedMappingServiceClient   client   = new FeedMappingServiceClientImpl(mockGrpcClient.Object, null);
            MutateFeedMappingsResponse response = client.MutateFeedMappings(request.CustomerId, request.Operations);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>Snippet for MutateFeedMappings</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void MutateFeedMappingsRequestObject()
 {
     // Create client
     FeedMappingServiceClient feedMappingServiceClient = FeedMappingServiceClient.Create();
     // Initialize request argument(s)
     MutateFeedMappingsRequest request = new MutateFeedMappingsRequest
     {
         CustomerId = "",
         Operations =
         {
             new FeedMappingOperation(),
         },
         PartialFailure = false,
         ValidateOnly   = false,
     };
     // Make the request
     MutateFeedMappingsResponse response = feedMappingServiceClient.MutateFeedMappings(request);
 }
コード例 #5
0
        public void MutateFeedMappings3()
        {
            Mock <FeedMappingService.FeedMappingServiceClient> mockGrpcClient = new Mock <FeedMappingService.FeedMappingServiceClient>(MockBehavior.Strict);
            MutateFeedMappingsRequest request = new MutateFeedMappingsRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateFeedMappingsResponse expectedResponse = new MutateFeedMappingsResponse();

            mockGrpcClient.Setup(x => x.MutateFeedMappings(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            FeedMappingServiceClient   client   = new FeedMappingServiceClientImpl(mockGrpcClient.Object, null);
            MutateFeedMappingsResponse response = client.MutateFeedMappings(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
コード例 #6
0
        public async Task MutateFeedMappingsAsync3()
        {
            Mock <FeedMappingService.FeedMappingServiceClient> mockGrpcClient = new Mock <FeedMappingService.FeedMappingServiceClient>(MockBehavior.Strict);
            MutateFeedMappingsRequest request = new MutateFeedMappingsRequest
            {
                CustomerId = "customerId-1772061412",
                Operations = { },
            };
            MutateFeedMappingsResponse expectedResponse = new MutateFeedMappingsResponse();

            mockGrpcClient.Setup(x => x.MutateFeedMappingsAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <MutateFeedMappingsResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            FeedMappingServiceClient   client   = new FeedMappingServiceClientImpl(mockGrpcClient.Object, null);
            MutateFeedMappingsResponse response = await client.MutateFeedMappingsAsync(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
コード例 #7
0
        /// <summary>Snippet for MutateFeedMappingsAsync</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 MutateFeedMappingsRequestObjectAsync()
        {
            // Create client
            FeedMappingServiceClient feedMappingServiceClient = await FeedMappingServiceClient.CreateAsync();

            // Initialize request argument(s)
            MutateFeedMappingsRequest request = new MutateFeedMappingsRequest
            {
                CustomerId = "",
                Operations =
                {
                    new FeedMappingOperation(),
                },
                PartialFailure      = false,
                ValidateOnly        = false,
                ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified,
            };
            // Make the request
            MutateFeedMappingsResponse response = await feedMappingServiceClient.MutateFeedMappingsAsync(request);
        }
コード例 #8
0
 /// <summary>Snippet for MutateFeedMappings</summary>
 public void MutateFeedMappingsRequestObject()
 {
     // Snippet: MutateFeedMappings(MutateFeedMappingsRequest, CallSettings)
     // Create client
     FeedMappingServiceClient feedMappingServiceClient = FeedMappingServiceClient.Create();
     // Initialize request argument(s)
     MutateFeedMappingsRequest request = new MutateFeedMappingsRequest
     {
         CustomerId = "",
         Operations =
         {
             new FeedMappingOperation(),
         },
         PartialFailure      = false,
         ValidateOnly        = false,
         ResponseContentType = ResponseContentTypeEnum.Types.ResponseContentType.Unspecified,
     };
     // Make the request
     MutateFeedMappingsResponse response = feedMappingServiceClient.MutateFeedMappings(request);
     // End snippet
 }
        /// <summary>Snippet for MutateFeedMappingsAsync</summary>
        public async Task MutateFeedMappingsRequestObjectAsync()
        {
            // Snippet: MutateFeedMappingsAsync(MutateFeedMappingsRequest, CallSettings)
            // Additional: MutateFeedMappingsAsync(MutateFeedMappingsRequest, CancellationToken)
            // Create client
            FeedMappingServiceClient feedMappingServiceClient = await FeedMappingServiceClient.CreateAsync();

            // Initialize request argument(s)
            MutateFeedMappingsRequest request = new MutateFeedMappingsRequest
            {
                CustomerId = "",
                Operations =
                {
                    new FeedMappingOperation(),
                },
                PartialFailure = false,
                ValidateOnly   = false,
            };
            // Make the request
            MutateFeedMappingsResponse response = await feedMappingServiceClient.MutateFeedMappingsAsync(request);

            // End snippet
        }
コード例 #10
0
        public async Task MutateFeedMappingsAsync()
        {
            Mock <FeedMappingService.FeedMappingServiceClient> mockGrpcClient = new Mock <FeedMappingService.FeedMappingServiceClient>(MockBehavior.Strict);
            MutateFeedMappingsRequest expectedRequest = new MutateFeedMappingsRequest
            {
                CustomerId     = "customerId-1772061412",
                Operations     = { },
                PartialFailure = true,
                ValidateOnly   = false,
            };
            MutateFeedMappingsResponse expectedResponse = new MutateFeedMappingsResponse();

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

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
コード例 #11
0
 /// <summary>
 /// Creates or removes feed mappings. Operation statuses are
 /// returned.
 ///
 /// List of thrown errors:
 /// [AuthenticationError]()
 /// [AuthorizationError]()
 /// [DatabaseError]()
 /// [DistinctError]()
 /// [FeedMappingError]()
 /// [FieldError]()
 /// [HeaderError]()
 /// [IdError]()
 /// [InternalError]()
 /// [MutateError]()
 /// [NotEmptyError]()
 /// [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 <MutateFeedMappingsResponse> MutateFeedMappingsAsync(MutateFeedMappingsRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_MutateFeedMappingsRequest(ref request, ref callSettings);
     return(_callMutateFeedMappings.Async(request, callSettings));
 }
コード例 #12
0
 partial void Modify_MutateFeedMappingsRequest(ref MutateFeedMappingsRequest request, ref gaxgrpc::CallSettings settings);
コード例 #13
0
 /// <summary>
 /// Creates or removes feed mappings. Operation statuses are
 /// returned.
 ///
 /// List of thrown errors:
 /// [AuthenticationError]()
 /// [AuthorizationError]()
 /// [DatabaseError]()
 /// [DistinctError]()
 /// [FeedMappingError]()
 /// [FieldError]()
 /// [HeaderError]()
 /// [IdError]()
 /// [InternalError]()
 /// [MutateError]()
 /// [NotEmptyError]()
 /// [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 <MutateFeedMappingsResponse> MutateFeedMappingsAsync(MutateFeedMappingsRequest request, st::CancellationToken cancellationToken) =>
 MutateFeedMappingsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
コード例 #14
0
 /// <summary>
 /// Creates or removes feed mappings. Operation statuses are
 /// returned.
 ///
 /// List of thrown errors:
 /// [AuthenticationError]()
 /// [AuthorizationError]()
 /// [DatabaseError]()
 /// [DistinctError]()
 /// [FeedMappingError]()
 /// [FieldError]()
 /// [HeaderError]()
 /// [IdError]()
 /// [InternalError]()
 /// [MutateError]()
 /// [NotEmptyError]()
 /// [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 <MutateFeedMappingsResponse> MutateFeedMappingsAsync(MutateFeedMappingsRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();