-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtap.py
More file actions
76 lines (67 loc) · 2 KB
/
Copy pathtap.py
File metadata and controls
76 lines (67 loc) · 2 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
"""airwallex tap class."""
from typing import List
from hotglue_singer_sdk import Tap, Stream
from hotglue_singer_sdk import typing as th
from hotglue_singer_sdk.helpers.capabilities import AlertingLevel
from hotglue_etl_exceptions import InsufficientPermissionsError, InvalidCredentialsError
from tap_airwallex.streams import (
AccountsStream,
AccountDetailsStream,
FinancialTransactionsStream,
BillsStream,
TransfersStream,
ExpensesStream,
IssuingTransactionsStream,
DirectDebitsStream,
DepositsStream,
ConversionsStream,
PaymentAttemptsStream,
PaymentDisputesStream,
)
STREAM_TYPES = [
FinancialTransactionsStream,
BillsStream,
AccountsStream,
AccountDetailsStream,
TransfersStream,
ExpensesStream,
IssuingTransactionsStream,
DirectDebitsStream,
DepositsStream,
ConversionsStream,
PaymentAttemptsStream,
PaymentDisputesStream,
]
class TapAirwallex(Tap):
"""airwallex tap class."""
name = "tap-airwallex"
alerting_level = AlertingLevel.ERROR
exception_alerting_level_map = {
InvalidCredentialsError: AlertingLevel.NONE,
InsufficientPermissionsError: AlertingLevel.NONE,
}
config_jsonschema = th.PropertiesList(
th.Property(
"api_key",
th.StringType,
required=True,
description="The token to request a token from the API service"
),
th.Property(
"client_id",
th.StringType,
required=True,
description="Client ID to request a token from the API service"
),
th.Property(
"is_sandbox",
th.BooleanType,
default=False,
description="Whether to use the sandbox environment"
)
).to_dict()
def discover_streams(self) -> List[Stream]:
"""Return a list of discovered streams."""
return [stream_class(tap=self) for stream_class in STREAM_TYPES]
if __name__ == "__main__":
TapAirwallex.cli()