-
Notifications
You must be signed in to change notification settings - Fork 76
/
connection.py
81 lines (79 loc) · 3.66 KB
/
connection.py
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
77
78
79
80
81
from .api.accounts import Accounts
from .api.billing_account import BillingAccount
from .api.classifications import Classifications
from .api.credit_memos import CreditMemos
from .api.departments import Departments
from .api.currencies import Currencies
from .api.locations import Locations
from .api.vendor_bills import VendorBills
from .api.vendor_credits import VendorCredits
from .api.vendors import Vendors
from .api.subsidiaries import Subsidiaries
from .api.usage import Usage
from .api.journal_entries import JournalEntries
from .api.adv_inter_company_journal_entries import AdvInterCompanyJournalEntries
from .api.employees import Employees
from .api.expense_reports import ExpenseReports
from .api.folders import Folders
from .api.files import Files
from .api.customers import Customers
from .api.projects import Projects
from .api.expense_categories import ExpenseCategory
from .api.custom_lists import CustomLists
from .api.custom_segments import CustomSegments
from .api.custom_record_types import CustomRecordTypes
from .api.custom_records import CustomRecords
from .api.vendor_payments import VendorPayments
from .api.invoices import Invoices
from .api.terms import Terms
from .api.tax_items import TaxItems
from .api.tax_groups import TaxGroups
from .api.price_level import PriceLevel
from .api.items import Items
from .internal.client import NetSuiteClient
class NetSuiteConnection:
def __init__(self, account, consumer_key, consumer_secret, token_key, token_secret,
caching=True, caching_timeout=2592000, caching_path=None,
search_body_fields_only=True, page_size: int = 100):
ns_client = NetSuiteClient(account=account, caching=caching, caching_timeout=caching_timeout,
caching_path=caching_path, search_body_fields_only=search_body_fields_only,
page_size=page_size)
ns_client.connect_tba(
consumer_key=consumer_key,
consumer_secret=consumer_secret,
token_key=token_key,
token_secret=token_secret
)
self.client = ns_client
self.accounts = Accounts(ns_client)
self.billing_accounts = BillingAccount(ns_client)
self.classifications = Classifications(ns_client)
self.departments = Departments(ns_client)
self.currencies = Currencies(ns_client)
self.locations = Locations(ns_client)
self.vendor_bills = VendorBills(ns_client)
self.vendor_credits = VendorCredits(ns_client)
self.vendors = Vendors(ns_client)
self.subsidiaries = Subsidiaries(ns_client)
self.journal_entries = JournalEntries(ns_client)
self.adv_inter_company_journal_entries = AdvInterCompanyJournalEntries(ns_client)
self.employees = Employees(ns_client)
self.expense_reports = ExpenseReports(ns_client)
self.folders = Folders(ns_client)
self.files = Files(ns_client)
self.expense_categories = ExpenseCategory(ns_client)
self.custom_lists = CustomLists(ns_client)
self.custom_segments = CustomSegments(ns_client)
self.custom_records = CustomRecords(ns_client)
self.custom_record_types = CustomRecordTypes(ns_client)
self.customers = Customers(ns_client)
self.projects = Projects(ns_client)
self.vendor_payments = VendorPayments(ns_client)
self.invoices = Invoices(ns_client)
self.terms = Terms(ns_client)
self.tax_items = TaxItems(ns_client)
self.tax_groups = TaxGroups(ns_client)
self.credit_memos = CreditMemos(ns_client)
self.price_level = PriceLevel(ns_client)
self.usages = Usage(ns_client)
self.items = Items(ns_client)