Skip to content

Commit

Permalink
refactor to use native SDK methods
Browse files Browse the repository at this point in the history
  • Loading branch information
pnadolny13 committed Nov 4, 2024
1 parent d40ae6c commit 02bd0c7
Show file tree
Hide file tree
Showing 5 changed files with 465 additions and 255 deletions.
55 changes: 26 additions & 29 deletions tap_intacct/const.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
REQUIRED_CONFIG_KEYS = [
'company_id',
'sender_id',
'sender_password',
'user_id',
'user_password',
"company_id",
"sender_id",
"sender_password",
"user_id",
"user_password",
]

KEY_PROPERTIES = {
'accounts_payable_bills': ["RECORDNO"],
'accounts_payable_payments': ["RECORDNO"],
'accounts_payable_vendors': ["VENDORID"],
"accounts_payable_bills": ["RECORDNO"],
"accounts_payable_payments": ["RECORDNO"],
"accounts_payable_vendors": ["VENDORID"],
"accounts_payable_bank_accounts": ["RECORDNO"],
"checking_accounts": ["RECORDNO"],
"savings_accounts": ["RECORDNO"],
"card_accounts": ["RECORDNO"],
"classes": ["RECORDNO"],
"tasks": ["RECORDNO"],
'general_ledger_accounts': ['RECORDNO'],
'general_ledger_details': ["RECORDNO"],
'general_ledger_journal_entries': ["RECORDNO"],
'general_ledger_journal_entry_lines': ["RECORDNO"],
'projects': ["RECORDNO"],
'invoices': ["RECORDNO"],
'adjustments': ["RECORDNO"],
'customers': ["RECORDNO"],
'deposits': ["RECORDNO"],
'items': ["RECORDNO"],
'invoice_items': ["RECORDNO"],
'adjustment_items': ["RECORDNO"],
'departments': ["DEPARTMENTID"],
'audit_history': ["ID"],
'locations': ["RECORDNO"],
"general_ledger_accounts": ["RECORDNO"],
"general_ledger_details": ["RECORDNO"],
"general_ledger_journal_entries": ["RECORDNO"],
"general_ledger_journal_entry_lines": ["RECORDNO"],
"projects": ["RECORDNO"],
"invoices": ["RECORDNO"],
"adjustments": ["RECORDNO"],
"customers": ["RECORDNO"],
"deposits": ["RECORDNO"],
"items": ["RECORDNO"],
"invoice_items": ["RECORDNO"],
"adjustment_items": ["RECORDNO"],
"departments": ["DEPARTMENTID"],
"audit_history": ["ID"],
"locations": ["RECORDNO"],
}

# List of available objects with their internal object-reference/endpoint name.
Expand Down Expand Up @@ -61,14 +61,11 @@
"locations": "LOCATION"
}

REP_KEYS = {
"audit_history" : "ACCESSTIME"
}

IGNORE_FIELDS =["PASSWORD"]
REP_KEYS = {"audit_history": "ACCESSTIME"}

IGNORE_FIELDS = ["PASSWORD"]


GET_BY_DATE_FIELD = "WHENMODIFIED"

DEFAULT_API_URL = 'https://api.intacct.com/ia/xml/xmlgw.phtml'
DEFAULT_API_URL = "https://api.intacct.com/ia/xml/xmlgw.phtml"
24 changes: 21 additions & 3 deletions tap_intacct/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
"""
Sage Intacct SDK Exceptions
"""
"""Sage Intacct SDK Exceptions."""


class SageIntacctSDKError(Exception):
Expand Down Expand Up @@ -50,3 +48,23 @@ class InvalidRequest(SageIntacctSDKError):

class AuthFailure(SageIntacctSDKError):
"""The rest SageIntacctSDK errors, 500 error."""


class InvalidXmlResponse(Exception):
pass


class BadGatewayError(Exception):
pass


class OfflineServiceError(Exception):
pass


class RateLimitError(Exception):
pass


class PleaseTryAgainLaterError(Exception):
pass
Loading

0 comments on commit 02bd0c7

Please sign in to comment.