-
Notifications
You must be signed in to change notification settings - Fork 40
/
IWebConnectorHandler.cs
55 lines (49 loc) · 2.32 KB
/
IWebConnectorHandler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using System;
using System.Threading.Tasks;
namespace QbSync.WebConnector.Core
{
/// <summary>
/// Interface used to handle some messages between the WebConnector and your server.
/// </summary>
public interface IWebConnectorHandler
{
/// <summary>
/// Returns the configuration QuickBooks is in. This method is called once per session.
/// </summary>
/// <param name="authenticatedTicket">The ticket.</param>
/// <param name="response">XML data.</param>
/// <returns>Completed Task.</returns>
Task ProcessClientInformationAsync(IAuthenticatedTicket? authenticatedTicket, string response);
/// <summary>
/// Called when any types of exception occur on the server.
/// </summary>
/// <param name="authenticatedTicket">The ticket.</param>
/// <param name="exception">The exception.</param>
/// <returns>Completed Task.</returns>
Task OnExceptionAsync(IAuthenticatedTicket? authenticatedTicket, Exception exception);
/// <summary>
/// Tells the Web Connector to come back later after X seconds.
/// Returning 0 means to do the work immediately.
/// </summary>
/// <param name="authenticatedTicket">The ticket.</param>
/// <returns>Seconds to wait before reconnecting.</returns>
Task<int> GetWaitTimeAsync(IAuthenticatedTicket authenticatedTicket);
/// <summary>
/// Uses the company file path. Return an empty string to use the file that is currently opened.
/// </summary>
/// <param name="authenticatedTicket">The ticket.</param>
/// <returns>Company File or empty string.</returns>
Task<string> GetCompanyFileAsync(IAuthenticatedTicket authenticatedTicket);
/// <summary>
/// The connection is closing, the Web Connector will not come back with this ticket.
/// </summary>
/// <param name="authenticatedTicket">The ticket.</param>
/// <returns>Completed Task.</returns>
Task CloseConnectionAsync(IAuthenticatedTicket? authenticatedTicket);
/// <summary>
/// Returns the version that is requested to communicate with the Web Connector.
/// </summary>
/// <returns>The requested QBXML version.</returns>
Task<Version> GetQBXMLVersion();
}
}