Skip to content

Commit

Permalink
Fix tickets discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
alzheltkovskiy-hubspot committed Oct 28, 2024
1 parent 615260f commit 7a6e25c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions hubspot/discovery/crm/tickets/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ class Discovery(DiscoveryBase):
def basic_api(self) -> api_client.BasicApi:
return self._configure_api_client(api_client, "BasicApi")

@property
def search_api(self) -> api_client.SearchApi:
return self._configure_api_client(api_client, "SearchApi")

@property
def batch_api(self) -> api_client.BatchApi:
return self._configure_api_client(api_client, "BatchApi")

@property
def merge_api(self) -> api_client.MergeApi:
return self._configure_api_client(api_client, "MergeApi")

@property
def search_api(self) -> api_client.SearchApi:
return self._configure_api_client(api_client, "SearchApi")

def get_all(self, **kwargs):
return fetch_all(self.basic_api, **kwargs)
3 changes: 2 additions & 1 deletion tests/spec/crm/test_tickets.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
from hubspot import HubSpot
from hubspot.crm.tickets import BasicApi, BatchApi, SearchApi
from hubspot.crm.tickets import BasicApi, BatchApi, MergeApi, SearchApi


def test_is_discoverable():
apis = HubSpot().crm.tickets
assert isinstance(apis.basic_api, BasicApi)
assert isinstance(apis.batch_api, BatchApi)
assert isinstance(apis.merge_api, MergeApi)
assert isinstance(apis.search_api, SearchApi)
assert hasattr(apis, "get_all")

0 comments on commit 7a6e25c

Please sign in to comment.