File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,13 @@ def _end_point(self) -> str:
5656 return super ()._end_point + \
5757 f'/{ self .__account_slug } /{ self .__event_slug } /tickets/{ self .__ticket_slug } '
5858
59+ def _populate_json (self ) -> None :
60+ self ._json_content = self ._get_response (endpoint = '' )['ticket' ]
61+ if self .__ticket_slug != self ._json_content ['slug' ]:
62+ raise ValueError ('slug in json content does not match expected value' )
63+ if self ._json_content ['view' ] != 'extended' :
64+ raise ValueError ('expected the extended view of the ticket' )
65+
5966 @property
6067 def state (self ) -> TicketState :
6168 """
@@ -69,3 +76,22 @@ def name(self) -> str:
6976 Name of the ticket holder (First Name + Last Name)
7077 """
7178 return self ._json_content ['name' ]
79+
80+ @property
81+ def reference (self ) -> str :
82+ """
83+ Ticket reference (this is shown in guest emails) and therefore with is what ticket holder
84+ will consider to be their: "Ticket Number"
85+ """
86+ return self ._json_content ['reference' ]
87+
88+ @property
89+ def answers (self ) -> str :
90+ """
91+ Answers to ticket specific questions
92+ """
93+ # The answers are part of the extended data for a ticket, therefore if it is not present
94+ # try getting the extended view
95+ if 'answers' not in self ._json_content :
96+ self ._populate_json ()
97+ return self ._json_content ['answers' ]
You can’t perform that action at this time.
0 commit comments