public async stt::Task MutateAccountLinkRequestObjectAsync()
        {
            moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict);
            MutateAccountLinkRequest request = new MutateAccountLinkRequest
            {
                CustomerId     = "customer_id3b3724cb",
                Operation      = new AccountLinkOperation(),
                PartialFailure = false,
                ValidateOnly   = true,
            };
            MutateAccountLinkResponse expectedResponse = new MutateAccountLinkResponse
            {
                Result = new MutateAccountLinkResult(),
            };

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

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            MutateAccountLinkResponse responseCancellationToken = await client.MutateAccountLinkAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>Snippet for MutateAccountLink</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void MutateAccountLinkRequestObject()
 {
     // Create client
     AccountLinkServiceClient accountLinkServiceClient = AccountLinkServiceClient.Create();
     // Initialize request argument(s)
     MutateAccountLinkRequest request = new MutateAccountLinkRequest
     {
         CustomerId     = "",
         Operation      = new AccountLinkOperation(),
         PartialFailure = false,
         ValidateOnly   = false,
     };
     // Make the request
     MutateAccountLinkResponse response = accountLinkServiceClient.MutateAccountLink(request);
 }
Exemple #3
0
        /// <summary>Snippet for MutateAccountLinkAsync</summary>
        public async Task MutateAccountLinkRequestObjectAsync()
        {
            // Snippet: MutateAccountLinkAsync(MutateAccountLinkRequest, CallSettings)
            // Additional: MutateAccountLinkAsync(MutateAccountLinkRequest, CancellationToken)
            // Create client
            AccountLinkServiceClient accountLinkServiceClient = await AccountLinkServiceClient.CreateAsync();

            // Initialize request argument(s)
            MutateAccountLinkRequest request = new MutateAccountLinkRequest
            {
                CustomerId     = "",
                Operation      = new AccountLinkOperation(),
                PartialFailure = false,
                ValidateOnly   = false,
            };
            // Make the request
            MutateAccountLinkResponse response = await accountLinkServiceClient.MutateAccountLinkAsync(request);

            // End snippet
        }
        public void MutateAccountLink()
        {
            moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict);
            MutateAccountLinkRequest request = new MutateAccountLinkRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operation  = new AccountLinkOperation(),
            };
            MutateAccountLinkResponse expectedResponse = new MutateAccountLinkResponse
            {
                Result = new MutateAccountLinkResult(),
            };

            mockGrpcClient.Setup(x => x.MutateAccountLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AccountLinkServiceClient  client   = new AccountLinkServiceClientImpl(mockGrpcClient.Object, null);
            MutateAccountLinkResponse response = client.MutateAccountLink(request.CustomerId, request.Operation);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void MutateAccountLinkRequestObject()
        {
            moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict);
            MutateAccountLinkRequest request = new MutateAccountLinkRequest
            {
                CustomerId     = "customer_id3b3724cb",
                Operation      = new AccountLinkOperation(),
                PartialFailure = false,
                ValidateOnly   = true,
            };
            MutateAccountLinkResponse expectedResponse = new MutateAccountLinkResponse
            {
                Result = new MutateAccountLinkResult(),
            };

            mockGrpcClient.Setup(x => x.MutateAccountLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            AccountLinkServiceClient  client   = new AccountLinkServiceClientImpl(mockGrpcClient.Object, null);
            MutateAccountLinkResponse response = client.MutateAccountLink(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
 /// <summary>
 /// Creates or removes an account link.
 /// From V5, create is not supported through
 /// AccountLinkService.MutateAccountLink. Please use
 /// AccountLinkService.CreateAccountLink instead.
 ///
 /// List of thrown errors:
 /// [AccountLinkError]()
 /// [AuthenticationError]()
 /// [AuthorizationError]()
 /// [FieldMaskError]()
 /// [HeaderError]()
 /// [InternalError]()
 /// [MutateError]()
 /// [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 <MutateAccountLinkResponse> MutateAccountLinkAsync(MutateAccountLinkRequest request, gaxgrpc::CallSettings callSettings = null)
 {
     Modify_MutateAccountLinkRequest(ref request, ref callSettings);
     return(_callMutateAccountLink.Async(request, callSettings));
 }
 partial void Modify_MutateAccountLinkRequest(ref MutateAccountLinkRequest request, ref gaxgrpc::CallSettings settings);
 /// <summary>
 /// Creates or removes an account link.
 /// From V5, create is not supported through
 /// AccountLinkService.MutateAccountLink. Please use
 /// AccountLinkService.CreateAccountLink instead.
 ///
 /// List of thrown errors:
 /// [AccountLinkError]()
 /// [AuthenticationError]()
 /// [AuthorizationError]()
 /// [FieldMaskError]()
 /// [HeaderError]()
 /// [InternalError]()
 /// [MutateError]()
 /// [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 <MutateAccountLinkResponse> MutateAccountLinkAsync(MutateAccountLinkRequest request, st::CancellationToken cancellationToken) =>
 MutateAccountLinkAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
 /// <summary>
 /// Creates or removes an account link.
 /// From V5, create is not supported through
 /// AccountLinkService.MutateAccountLink. Please use
 /// AccountLinkService.CreateAccountLink instead.
 ///
 /// List of thrown errors:
 /// [AccountLinkError]()
 /// [AuthenticationError]()
 /// [AuthorizationError]()
 /// [FieldMaskError]()
 /// [HeaderError]()
 /// [InternalError]()
 /// [MutateError]()
 /// [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 <MutateAccountLinkResponse> MutateAccountLinkAsync(MutateAccountLinkRequest request, gaxgrpc::CallSettings callSettings = null) =>
 throw new sys::NotImplementedException();