Skip to content

Commit 5b45dd6

Browse files
authored
TPD-5754 Update get tickets to easily include comments (#135)
* Update get tickets to easily include comments * update setup version and changelog * change to add include function --------- Co-authored-by: Michael Liao <>
1 parent c89296b commit 5b45dd6

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
44
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5+
## [4.27.3] - 2023-02-24
6+
7+
## Changed
8+
9+
- Update get tickets to easily include comments
510

611
## [4.27.2] - 2023-02-02
712

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='VacasaConnect',
5-
version='4.27.2',
5+
version='4.27.3',
66
description='A Python 3.6+ SDK for the connect.vacasa.com API.',
77
packages=['vacasa.connect'],
88
url='https://github.com/Vacasa/python-vacasa-connect-sdk',

vacasa/connect/connect.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2091,20 +2091,24 @@ def get_unit_bulk(self, ids: str):
20912091
return self._post(url, json={'data': {'attributes': payload}}, headers=headers).json()
20922092

20932093

2094-
def get_tickets(self, params: dict = None):
2094+
def get_tickets(self, params: dict = None, include_comments: bool = False):
20952095
"""Retrieve a list of tickets
20962096
Yields:
20972097
An iterator of tickets. Each ticket is a dict.
20982098
"""
20992099
url = f"{self.endpoint}/v1/tickets"
21002100
headers = self._headers()
2101+
if include_comments:
2102+
params = self._add_include_param(params, 'comments')
21012103

21022104
return self._iterate_pages(url, headers, params)
21032105

2104-
def get_ticket_by_id(self, ticket_id: int, params: dict = None):
2106+
def get_ticket_by_id(self, ticket_id: int, params: dict = None, include_comments: bool = False):
21052107
""" Get a single ticket by ID """
21062108
url = f"{self.endpoint}/v1/tickets/{ticket_id}"
21072109
r = self._get(url, headers=self._headers(), params=params)
2110+
if include_comments:
2111+
params = self._add_include_param(params, 'comments')
21082112

21092113
return r.json()['data']
21102114

0 commit comments

Comments
 (0)