Skip to content

Commit

Permalink
Adding Support for Custom Segments in NetSuite (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shwetabhk authored Mar 1, 2022
1 parent 65b6595 commit 4b9d1ff
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
18 changes: 18 additions & 0 deletions netsuitesdk/api/custom_segments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from .base import ApiBase
import logging

logger = logging.getLogger(__name__)


class CustomSegments(ApiBase):
def __init__(self, ns_client):
ApiBase.__init__(self, ns_client=ns_client, type_name='CustomSegment')

def get_all(self):
return self._get_all()

def get_all_generator(self, page_size=20):
"""
Returns a generator which is more efficient memory-wise
"""
return self._get_all_generator()
2 changes: 2 additions & 0 deletions netsuitesdk/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
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
Expand Down Expand Up @@ -57,6 +58,7 @@ def __init__(self, account, consumer_key, consumer_secret, token_key, token_secr
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)
Expand Down
1 change: 1 addition & 0 deletions netsuitesdk/internal/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
'customerMessage',
'customerStatus',
'customList',
'customSegment',
'customRecord',
'department',
'employee',
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='netsuitesdk',
version='2.8.0',
version='2.9.0',
author='Siva Narayanan',
author_email='[email protected]',
description='Python SDK for accessing the NetSuite SOAP webservice',
Expand Down

0 comments on commit 4b9d1ff

Please sign in to comment.