private async Task <List <SupplierInvoiceFileConnections> > GetConnections() { var request = new SupplierInvoiceFileConnectionListRequest( connectionSettings.AccessToken, connectionSettings.ClientSecret ); return((await SupplierInvoiceFileConnectionService.GetSupplierInvoiceFileConnectionsAsync(request)).Data?.ToList()); }
public async Task ItCanGetConnections() { var request = new SupplierInvoiceFileConnectionListRequest( connectionSettings.AccessToken, connectionSettings.ClientSecret ); var response = await SupplierInvoiceFileConnectionService.GetSupplierInvoiceFileConnectionsAsync(request); Assert.IsNotNull(response); Assert.IsNotNull(response.Data); }
public static async Task <SupplierInvoiceFileConnection> GetSupplierInvoiceFileConnectionAsync( SupplierInvoiceFileConnectionListRequest listRequest, string fileId) { var apiRequest = new FortnoxApiClientRequest <SingleResource <SupplierInvoiceFileConnection> >( HttpMethod.Get, listRequest.AccessToken, listRequest.ClientSecret, $"{ApiEndpoints.SupplierInvoiceFileConnections}/{fileId}" ); return((await FortnoxAPIClient.CallAsync(apiRequest)).Data); }
public static async Task <ListedResourceResponse <SupplierInvoiceFileConnections> > GetSupplierInvoiceFileConnectionsAsync( SupplierInvoiceFileConnectionListRequest listRequest) { var apiRequest = new FortnoxApiClientRequest <ListedResourceResponse <SupplierInvoiceFileConnections> >( HttpMethod.Get, listRequest.AccessToken, listRequest.ClientSecret, ApiEndpoints.SupplierInvoiceFileConnections ); apiRequest.SetPageAndLimit(listRequest.Page, listRequest.Limit); return(await FortnoxAPIClient.CallAsync(apiRequest)); }
public async Task ItCanGetAConnection() { var connections = await GetConnections(); if (connections == null || !connections.Any()) { Assert.Inconclusive("No connections exist between a file and a supplier invoice in the system"); } var request = new SupplierInvoiceFileConnectionListRequest( connectionSettings.AccessToken, connectionSettings.ClientSecret ); var response = await SupplierInvoiceFileConnectionService.GetSupplierInvoiceFileConnectionAsync( request, connections.First().FileId ); Assert.IsNotNull(response); Assert.AreEqual(connections.First().FileId, response.FileId); }