public async stt::Task MutateFeedItemSetLinksAsync() { moq::Mock <FeedItemSetLinkService.FeedItemSetLinkServiceClient> mockGrpcClient = new moq::Mock <FeedItemSetLinkService.FeedItemSetLinkServiceClient>(moq::MockBehavior.Strict); MutateFeedItemSetLinksRequest request = new MutateFeedItemSetLinksRequest { CustomerId = "customer_id3b3724cb", Operations = { new FeedItemSetLinkOperation(), }, }; MutateFeedItemSetLinksResponse expectedResponse = new MutateFeedItemSetLinksResponse { Results = { new MutateFeedItemSetLinkResult(), }, }; mockGrpcClient.Setup(x => x.MutateFeedItemSetLinksAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <MutateFeedItemSetLinksResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); FeedItemSetLinkServiceClient client = new FeedItemSetLinkServiceClientImpl(mockGrpcClient.Object, null); MutateFeedItemSetLinksResponse responseCallSettings = await client.MutateFeedItemSetLinksAsync(request.CustomerId, request.Operations, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); Assert.AreEqual(expectedResponse, responseCallSettings); MutateFeedItemSetLinksResponse responseCancellationToken = await client.MutateFeedItemSetLinksAsync(request.CustomerId, request.Operations, st::CancellationToken.None); Assert.AreEqual(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public void MutateFeedItemSetLinks() { moq::Mock <FeedItemSetLinkService.FeedItemSetLinkServiceClient> mockGrpcClient = new moq::Mock <FeedItemSetLinkService.FeedItemSetLinkServiceClient>(moq::MockBehavior.Strict); MutateFeedItemSetLinksRequest request = new MutateFeedItemSetLinksRequest { CustomerId = "customer_id3b3724cb", Operations = { new FeedItemSetLinkOperation(), }, }; MutateFeedItemSetLinksResponse expectedResponse = new MutateFeedItemSetLinksResponse { Results = { new MutateFeedItemSetLinkResult(), }, }; mockGrpcClient.Setup(x => x.MutateFeedItemSetLinks(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); FeedItemSetLinkServiceClient client = new FeedItemSetLinkServiceClientImpl(mockGrpcClient.Object, null); MutateFeedItemSetLinksResponse response = client.MutateFeedItemSetLinks(request.CustomerId, request.Operations); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for MutateFeedItemSetLinks</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void MutateFeedItemSetLinksRequestObject() { // Create client FeedItemSetLinkServiceClient feedItemSetLinkServiceClient = FeedItemSetLinkServiceClient.Create(); // Initialize request argument(s) MutateFeedItemSetLinksRequest request = new MutateFeedItemSetLinksRequest { CustomerId = "", Operations = { new FeedItemSetLinkOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateFeedItemSetLinksResponse response = feedItemSetLinkServiceClient.MutateFeedItemSetLinks(request); }
/// <summary>Snippet for MutateFeedItemSetLinksAsync</summary> public async Task MutateFeedItemSetLinksRequestObjectAsync() { // Snippet: MutateFeedItemSetLinksAsync(MutateFeedItemSetLinksRequest, CallSettings) // Additional: MutateFeedItemSetLinksAsync(MutateFeedItemSetLinksRequest, CancellationToken) // Create client FeedItemSetLinkServiceClient feedItemSetLinkServiceClient = await FeedItemSetLinkServiceClient.CreateAsync(); // Initialize request argument(s) MutateFeedItemSetLinksRequest request = new MutateFeedItemSetLinksRequest { CustomerId = "", Operations = { new FeedItemSetLinkOperation(), }, PartialFailure = false, ValidateOnly = false, }; // Make the request MutateFeedItemSetLinksResponse response = await feedItemSetLinkServiceClient.MutateFeedItemSetLinksAsync(request); // End snippet }
/// <summary> /// Creates, updates, or removes feed item set links. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [HeaderError]() /// [InternalError]() /// [QuotaError]() /// [RequestError]() /// </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 <MutateFeedItemSetLinksResponse> MutateFeedItemSetLinksAsync(MutateFeedItemSetLinksRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_MutateFeedItemSetLinksRequest(ref request, ref callSettings); return(_callMutateFeedItemSetLinks.Async(request, callSettings)); }
partial void Modify_MutateFeedItemSetLinksRequest(ref MutateFeedItemSetLinksRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Creates, updates, or removes feed item set links. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [HeaderError]() /// [InternalError]() /// [QuotaError]() /// [RequestError]() /// </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 <MutateFeedItemSetLinksResponse> MutateFeedItemSetLinksAsync(MutateFeedItemSetLinksRequest request, st::CancellationToken cancellationToken) => MutateFeedItemSetLinksAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Creates, updates, or removes feed item set links. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [HeaderError]() /// [InternalError]() /// [QuotaError]() /// [RequestError]() /// </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 <MutateFeedItemSetLinksResponse> MutateFeedItemSetLinksAsync(MutateFeedItemSetLinksRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();