Skip to content

Commit 52f6d55

Browse files
committed
Rename unify.pm.issues to unify.ticketing.tickets
Mirror the Unify API migration from the /pm/issues endpoint to /ticketing/tickets: - Rename bundleup/unify/pm.py -> ticketing.py (PM class -> Ticketing, issues() -> tickets(), path pm/issues -> ticketing/tickets) - Update the unify.ticketing accessor in __init__.py - Update tests, README, and examples Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014zVgT6VdGxc5a96oMxJU87
1 parent c67485c commit 52f6d55

9 files changed

Lines changed: 51 additions & 51 deletions

File tree

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ Runnable examples are available in the [`examples/`](./examples) directory:
8282

8383
- [`examples/basic_usage.py`](./examples/basic_usage.py) - Client setup, connections, integrations, and webhooks
8484
- [`examples/proxy_api.py`](./examples/proxy_api.py) - Proxy API GET request with a connection
85-
- [`examples/unify_api.py`](./examples/unify_api.py) - Unify Chat, Git, and PM endpoint usage
85+
- [`examples/unify_api.py`](./examples/unify_api.py) - Unify Chat, Git, and Ticketing endpoint usage
8686
- [`examples/README.md`](./examples/README.md) - Setup and execution instructions
8787

8888
## Quick Start
@@ -933,20 +933,20 @@ print(f"Releases: {result['data']}")
933933
}
934934
```
935935

936-
#### Project Management API
936+
#### Ticketing API
937937

938-
The PM API provides a unified interface for project management platforms like Jira, Linear, and Asana.
938+
The Ticketing API provides a unified interface for ticketing and project management platforms like Jira, Linear, and Asana.
939939

940-
##### List Issues
940+
##### List Tickets
941941

942942
```python
943-
result = unify.pm.issues({
943+
result = unify.ticketing.tickets({
944944
'limit': 100,
945945
'after': None,
946946
'include_raw': False
947947
})
948948

949-
print(f"Issues: {result['data']}")
949+
print(f"Tickets: {result['data']}")
950950
```
951951

952952
**Response:**
@@ -973,7 +973,7 @@ print(f"Issues: {result['data']}")
973973
**Filtering and sorting:**
974974

975975
```python
976-
open_issues = [issue for issue in result['data'] if issue['status'] == 'open']
976+
open_tickets = [ticket for ticket in result['data'] if ticket['status'] == 'open']
977977
sorted_by_date = sorted(
978978
result['data'],
979979
key=lambda x: x['created_at'],
@@ -1045,7 +1045,7 @@ bundleup/
10451045
├── base.py # Base Unify class
10461046
├── chat.py # Chat Unify API
10471047
├── git.py # Git Unify API
1048-
└── pm.py # PM Unify API
1048+
└── ticketing.py # Ticketing Unify API
10491049
tests/ # Test files
10501050
```
10511051

bundleup/unify/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from .chat import Chat
22
from .git import Git
3-
from .pm import PM
3+
from .ticketing import Ticketing
44

55

66
class Unify:
77
def __init__(self, api_key: str, connection_id: str):
88
# Initialize
99
self.chat = Chat(api_key, connection_id)
1010
self.git = Git(api_key, connection_id)
11-
self.pm = PM(api_key, connection_id)
11+
self.ticketing = Ticketing(api_key, connection_id)

bundleup/unify/pm.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

bundleup/unify/ticketing.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from .base import Base
2+
3+
4+
class Ticketing(Base):
5+
def tickets(self, params: dict = None):
6+
"""
7+
List ticketing tickets
8+
"""
9+
url = self._build_url("ticketing/tickets")
10+
response = self._connection.get(url, params=params)
11+
12+
if not response.ok:
13+
raise Exception(f"Failed to fetch ticketing/tickets: {response.status_code}")
14+
15+
return response.json()

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ python examples/unify_api.py
2626

2727
- `basic_usage.py` — initialize the SDK and list connections, integrations, and webhooks
2828
- `proxy_api.py` — send a GET request through the Proxy API
29-
- `unify_api.py` — call Unify Chat, Git, and PM endpoints
29+
- `unify_api.py` — call Unify Chat, Git, and Ticketing endpoints

examples/unify_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
print(f"Failed to fetch git repos: {error}")
3030

3131
try:
32-
issues = unify.pm.issues({"limit": 10})
33-
print(f"PM issues: {len(issues.get('data', []))}")
32+
tickets = unify.ticketing.tickets({"limit": 10})
33+
print(f"Ticketing tickets: {len(tickets.get('data', []))}")
3434
except Exception as error:
35-
print(f"Failed to fetch PM issues: {error}")
35+
print(f"Failed to fetch tickets: {error}")

tests/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ The test suite includes **87 tests** covering all major components of the SDK:
5050

5151
7. **test_unify.py** (15 tests) - Unify API client
5252
- Unify class initialization
53-
- Chat, Git, and PM subclients
53+
- Chat, Git, and Ticketing subclients
5454
- Method signatures and parameters
5555
- Base class configuration
5656

tests/test_bundleup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ def test_unify_with_connection_id(self, api_key, connection_id):
7272
assert unify.chat._connection_id == connection_id
7373
assert unify.git._api_key == api_key
7474
assert unify.git._connection_id == connection_id
75-
assert unify.pm._api_key == api_key
76-
assert unify.pm._connection_id == connection_id
75+
assert unify.ticketing._api_key == api_key
76+
assert unify.ticketing._connection_id == connection_id
7777

7878
def test_unify_without_connection_id(self, api_key):
7979
"""Test creating a unify client without connection ID raises exception."""

tests/test_unify.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from bundleup.unify import Unify
66
from bundleup.unify.chat import Chat
77
from bundleup.unify.git import Git
8-
from bundleup.unify.pm import PM
8+
from bundleup.unify.ticketing import Ticketing
99

1010

1111
class TestUnifyInitialization:
@@ -17,7 +17,7 @@ def test_init_with_valid_params(self, api_key, connection_id):
1717

1818
assert isinstance(unify.chat, Chat)
1919
assert isinstance(unify.git, Git)
20-
assert isinstance(unify.pm, PM)
20+
assert isinstance(unify.ticketing, Ticketing)
2121

2222
def test_chat_has_correct_params(self, api_key, connection_id):
2323
"""Test that chat client has correct parameters."""
@@ -33,12 +33,12 @@ def test_git_has_correct_params(self, api_key, connection_id):
3333
assert unify.git._api_key == api_key
3434
assert unify.git._connection_id == connection_id
3535

36-
def test_pm_has_correct_params(self, api_key, connection_id):
37-
"""Test that pm client has correct parameters."""
36+
def test_ticketing_has_correct_params(self, api_key, connection_id):
37+
"""Test that ticketing client has correct parameters."""
3838
unify = Unify(api_key, connection_id)
3939

40-
assert unify.pm._api_key == api_key
41-
assert unify.pm._connection_id == connection_id
40+
assert unify.ticketing._api_key == api_key
41+
assert unify.ticketing._connection_id == connection_id
4242

4343

4444
class TestChatInitialization:
@@ -100,23 +100,23 @@ def test_has_releases_method(self, api_key, connection_id):
100100
assert callable(git.releases)
101101

102102

103-
class TestPMInitialization:
104-
"""Test PM class initialization."""
103+
class TestTicketingInitialization:
104+
"""Test Ticketing class initialization."""
105105

106106
def test_init_with_valid_params(self, api_key, connection_id):
107107
"""Test initialization with valid API key and connection ID."""
108-
pm = PM(api_key, connection_id)
108+
ticketing = Ticketing(api_key, connection_id)
109109

110-
assert pm._api_key == api_key
111-
assert pm._connection_id == connection_id
112-
assert pm.base_url == "https://unify.bundleup.io"
110+
assert ticketing._api_key == api_key
111+
assert ticketing._connection_id == connection_id
112+
assert ticketing.base_url == "https://unify.bundleup.io"
113113

114-
def test_has_issues_method(self, api_key, connection_id):
115-
"""Test that PM has issues method."""
116-
pm = PM(api_key, connection_id)
114+
def test_has_tickets_method(self, api_key, connection_id):
115+
"""Test that Ticketing has tickets method."""
116+
ticketing = Ticketing(api_key, connection_id)
117117

118-
assert hasattr(pm, 'issues')
119-
assert callable(pm.issues)
118+
assert hasattr(ticketing, 'tickets')
119+
assert callable(ticketing.tickets)
120120

121121

122122
class TestUnifyBaseClass:
@@ -126,11 +126,11 @@ def test_base_url_is_set(self, api_key, connection_id):
126126
"""Test that base URL is correctly set."""
127127
chat = Chat(api_key, connection_id)
128128
git = Git(api_key, connection_id)
129-
pm = PM(api_key, connection_id)
129+
ticketing = Ticketing(api_key, connection_id)
130130

131131
assert chat.base_url == "https://unify.bundleup.io"
132132
assert git.base_url == "https://unify.bundleup.io"
133-
assert pm.base_url == "https://unify.bundleup.io"
133+
assert ticketing.base_url == "https://unify.bundleup.io"
134134

135135

136136
class TestUnifyMethodSignatures:

0 commit comments

Comments
 (0)