File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed
Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change 33The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ )
44and this project adheres to [ Semantic Versioning] ( https://semver.org/spec/v2.0.0.html ) .
55
6+ ## [ 4.25.0] - 2022-08-01
7+
8+ ## Changed
9+
10+ - Added ` get_tickets ` and ` get_ticket_by_id ` to support ` /v1/tickets ` functionality.
11+
612## [ 4.24.0] - 2022-07-07
713
814## Changed
Original file line number Diff line number Diff line change 22
33setup (
44 name = 'VacasaConnect' ,
5- version = '4.24 .0' ,
5+ version = '4.25 .0' ,
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' ,
Original file line number Diff line number Diff line change @@ -2082,6 +2082,24 @@ def get_unit_bulk(self, ids: str):
20822082 return self ._post (url , json = {'data' : {'attributes' : payload }}, headers = headers ).json ()
20832083
20842084
2085+ def get_tickets (self , params : dict = None ):
2086+ """Retrieve a list of tickets
2087+ Yields:
2088+ An iterator of tickets. Each ticket is a dict.
2089+ """
2090+ url = f"{ self .endpoint } /v1/tickets"
2091+ headers = self ._headers ()
2092+
2093+ return self ._iterate_pages (url , headers , params )
2094+
2095+ def get_ticket_by_id (self , ticket_id : int , params : dict = None ):
2096+ """ Get a single ticket by ID """
2097+ url = f"{ self .endpoint } /v1/tickets/{ ticket_id } "
2098+ r = self ._get (url , headers = self ._headers (), params = params )
2099+
2100+ return r .json ()['data' ]
2101+
2102+
20852103def _trip_protection_to_integer (trip_protection : bool ) -> int :
20862104 """Convert from True/False/None to 1/0/-1"""
20872105 if trip_protection is None :
You can’t perform that action at this time.
0 commit comments