/// <summary>Snippet for CreateAccountLink</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void CreateAccountLinkRequestObject() { // Create client AccountLinkServiceClient accountLinkServiceClient = AccountLinkServiceClient.Create(); // Initialize request argument(s) CreateAccountLinkRequest request = new CreateAccountLinkRequest { CustomerId = "", AccountLink = new AccountLink(), }; // Make the request CreateAccountLinkResponse response = accountLinkServiceClient.CreateAccountLink(request); }
/// <summary>Snippet for CreateAccountLinkAsync</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 CreateAccountLinkRequestObjectAsync() { // Create client AccountLinkServiceClient accountLinkServiceClient = await AccountLinkServiceClient.CreateAsync(); // Initialize request argument(s) CreateAccountLinkRequest request = new CreateAccountLinkRequest { CustomerId = "", AccountLink = new AccountLink(), }; // Make the request CreateAccountLinkResponse response = await accountLinkServiceClient.CreateAccountLinkAsync(request); }
/// <summary>Snippet for CreateAccountLinkAsync</summary> public async Task CreateAccountLinkRequestObjectAsync() { // Snippet: CreateAccountLinkAsync(CreateAccountLinkRequest, CallSettings) // Additional: CreateAccountLinkAsync(CreateAccountLinkRequest, CancellationToken) // Create client AccountLinkServiceClient accountLinkServiceClient = await AccountLinkServiceClient.CreateAsync(); // Initialize request argument(s) CreateAccountLinkRequest request = new CreateAccountLinkRequest { CustomerId = "", AccountLink = new AccountLink(), }; // Make the request CreateAccountLinkResponse response = await accountLinkServiceClient.CreateAccountLinkAsync(request); // End snippet }
public void CreateAccountLink() { moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict); CreateAccountLinkRequest request = new CreateAccountLinkRequest { CustomerId = "customer_id3b3724cb", AccountLink = new gagvr::AccountLink(), }; CreateAccountLinkResponse expectedResponse = new CreateAccountLinkResponse { ResourceName = "resource_name8cc2e687", }; mockGrpcClient.Setup(x => x.CreateAccountLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); AccountLinkServiceClient client = new AccountLinkServiceClientImpl(mockGrpcClient.Object, null); CreateAccountLinkResponse response = client.CreateAccountLink(request.CustomerId, request.AccountLink); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void CreateAccountLink() { moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict); CreateAccountLinkRequest request = new CreateAccountLinkRequest { CustomerId = "customer_id3b3724cb", AccountLink = new gagvr::AccountLink(), }; CreateAccountLinkResponse expectedResponse = new CreateAccountLinkResponse { ResourceNameAsAccountLinkName = gagvr::AccountLinkName.FromCustomerAccountLink("[CUSTOMER_ID]", "[ACCOUNT_LINK_ID]"), }; mockGrpcClient.Setup(x => x.CreateAccountLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); AccountLinkServiceClient client = new AccountLinkServiceClientImpl(mockGrpcClient.Object, null); CreateAccountLinkResponse response = client.CreateAccountLink(request.CustomerId, request.AccountLink); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async stt::Task CreateAccountLinkAsync() { moq::Mock <AccountLinkService.AccountLinkServiceClient> mockGrpcClient = new moq::Mock <AccountLinkService.AccountLinkServiceClient>(moq::MockBehavior.Strict); CreateAccountLinkRequest request = new CreateAccountLinkRequest { CustomerId = "customer_id3b3724cb", AccountLink = new gagvr::AccountLink(), }; CreateAccountLinkResponse expectedResponse = new CreateAccountLinkResponse { ResourceName = "resource_name8cc2e687", }; mockGrpcClient.Setup(x => x.CreateAccountLinkAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <CreateAccountLinkResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); AccountLinkServiceClient client = new AccountLinkServiceClientImpl(mockGrpcClient.Object, null); CreateAccountLinkResponse responseCallSettings = await client.CreateAccountLinkAsync(request.CustomerId, request.AccountLink, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); CreateAccountLinkResponse responseCancellationToken = await client.CreateAccountLinkAsync(request.CustomerId, request.AccountLink, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
/// <summary> /// Creates an account link. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [DatabaseError]() /// [FieldError]() /// [HeaderError]() /// [InternalError]() /// [MutateError]() /// [QuotaError]() /// [RequestError]() /// [ThirdPartyAppAnalyticsLinkError]() /// </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 <CreateAccountLinkResponse> CreateAccountLinkAsync(CreateAccountLinkRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_CreateAccountLinkRequest(ref request, ref callSettings); return(_callCreateAccountLink.Async(request, callSettings)); }
partial void Modify_CreateAccountLinkRequest(ref CreateAccountLinkRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Creates an account link. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [DatabaseError]() /// [FieldError]() /// [HeaderError]() /// [InternalError]() /// [MutateError]() /// [QuotaError]() /// [RequestError]() /// [ThirdPartyAppAnalyticsLinkError]() /// </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 <CreateAccountLinkResponse> CreateAccountLinkAsync(CreateAccountLinkRequest request, st::CancellationToken cancellationToken) => CreateAccountLinkAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Creates an account link. /// /// List of thrown errors: /// [AuthenticationError]() /// [AuthorizationError]() /// [DatabaseError]() /// [FieldError]() /// [HeaderError]() /// [InternalError]() /// [MutateError]() /// [QuotaError]() /// [RequestError]() /// [ThirdPartyAppAnalyticsLinkError]() /// </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 <CreateAccountLinkResponse> CreateAccountLinkAsync(CreateAccountLinkRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();