MouseTools 3.0.0.dev2__py3-none-any.whl → 3.1.0.dev2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: MouseTools
3
- Version: 3.0.0.dev2
3
+ Version: 3.1.0.dev2
4
4
  Summary: An unofficial Python wrapper for Disney's API
5
5
  Author: Scott Caratozzolo
6
6
  Project-URL: repository, https://gitlab.com/caratozzoloxyz/public/MouseTools
7
+ Project-URL: documentation, https://caratozzoloxyz.gitlab.io/public/MouseTools/
7
8
  Classifier: Programming Language :: Python :: 3
8
9
  Classifier: License :: OSI Approved :: MIT License
9
10
  Classifier: Operating System :: OS Independent
@@ -1,11 +1,11 @@
1
- mousetools/__init__.py,sha256=QDVy9HOqGcQaEeRFhBKiKEx_BdM0er3pydqlvoSMztw,199
1
+ mousetools/__init__.py,sha256=8TH8dO7pAgFB4pSi1mfpEtIEAtOoLj0thRwkh-BWc7U,199
2
2
  mousetools/auth.py,sha256=ogbssFgG4Fmjuce2ppH96nlh3BJNXjOTWuSVbVM4XGQ,2372
3
3
  mousetools/exceptions.py,sha256=0omdWcFu99r1XgVWQpn2jemgR34-lkfOeXvWFyCFILM,536
4
4
  mousetools/ids.py,sha256=Gsnb9tkQ7uyDacbGJHGdYVv-4-FyfEI3BplMrYW67PY,4248
5
5
  mousetools/urls.py,sha256=2WQMnUo080QxwFXOs5t9X5893QofQ5z3by_vkQsCDpo,233
6
- mousetools/entities/__init__.py,sha256=6UCrjuEJ_DboUhQHYrn16GL2VdCPw13or4fuU85Q4hM,1437
6
+ mousetools/entities/__init__.py,sha256=HuNje5r9AuMPbP1h3S06XBPzoanhub8tWcApNyE4mIc,1493
7
7
  mousetools/entities/attraction.py,sha256=ACKNG_5xMM2kXws_76SmcfqaqErxRRzEER2XGsMtUpA,366
8
- mousetools/entities/base.py,sha256=G7i8WQhRoWAp7eDx3_c9I_A9rejnC9TwKchRAtL00_c,16570
8
+ mousetools/entities/base.py,sha256=Eeye28DhNk1_YXf-VPtwI2U0uum-wPfVW1Q57CRofg0,16579
9
9
  mousetools/entities/character.py,sha256=ifdzEZC9r3W_ZBoYzjgsKMWbT3TmmDo98wg7letqaoU,363
10
10
  mousetools/entities/destination.py,sha256=MsQ713DRoWlBoEHSKqtt4qctArHXUqk1ukYU_tnNh5o,520
11
11
  mousetools/entities/dining_event.py,sha256=9aa7MF5FPQdLcwHDgm77KT6kmba3IVBx_KyhEPXu9XU,370
@@ -15,18 +15,18 @@ mousetools/entities/entertainment_venue.py,sha256=53WzFLnjoKZYaz3GV-B9km2UNiMYKX
15
15
  mousetools/entities/event.py,sha256=_u_IYJM55FwPpf_RVlqYK2ryaWq-5gznhBqRlSwnepg,351
16
16
  mousetools/entities/guest_services.py,sha256=p1NP1vnkEXOv1OMKRiWPhQ77Cikok3jXAOu3PJQXV_o,376
17
17
  mousetools/entities/land.py,sha256=oT8wSBuLyBe34kRhl2O-DJyA1np1O-X-YsJoRnqVhFI,348
18
- mousetools/entities/menu.py,sha256=sZPanyB7zuznRC-B4wIJbKWRyM_gwVAAVnLKsBjG5-A,353
18
+ mousetools/entities/menu.py,sha256=ymXEBbxIlbThII_oxvgk9cXWt2_JSARWrk0uR4-xaw0,6167
19
19
  mousetools/entities/merchandise_facility.py,sha256=xtU_yuhGi4seS7e2ClMtsaqmw-SBIs5N_7gFz1FxgcA,395
20
20
  mousetools/entities/park.py,sha256=ZtXo4hyyJFIRQ7l-GMmBj9rMH14KUQ84f5RVZ0VLBcI,1221
21
21
  mousetools/entities/point_of_interest.py,sha256=h-CroI3QwuLGvGmGHRS3yQO8OQB-5lplLmQHlvLHDNo,385
22
22
  mousetools/entities/resort.py,sha256=aKNrLVa_KRTHPLbY2IHMp7sgSesBT2gR0u6XJBaEt14,354
23
23
  mousetools/entities/resort_area.py,sha256=COiwcB8aXOFWmjw_RYOYgJ35SHb8z_QaBKyTHA2OGZQ,368
24
- mousetools/entities/restaurant.py,sha256=QTWPhmQb0kqRUNdLwqCpc3LGpQ35DvXdWFXQXgtgCBo,366
24
+ mousetools/entities/restaurant.py,sha256=9Ci3N2QohPeuPUwBS19rsFsXMjFC89IgSU8pYjJTKlo,1655
25
25
  mousetools/mixins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
- mousetools/mixins/disney.py,sha256=9EW_TPl3LQy9EHyivxVSOKJ1TWjfPHHdwnDQJK4c-b0,1854
26
+ mousetools/mixins/disney.py,sha256=1l2ck-1cIZph_fnIApqGRqLGKgVpTn91wnZ5abmxmfs,1862
27
27
  mousetools/mixins/themeparksapi.py,sha256=gxep2vBXMSSVh1c3Yjt7oaIyCjhQfGtbSHXysbhazbs,4321
28
- MouseTools-3.0.0.dev2.dist-info/LICENSE,sha256=xX4HoDU-zdafl3yEfIaspkvqHPaaXhuDwkJ6qhDMUIo,1074
29
- MouseTools-3.0.0.dev2.dist-info/METADATA,sha256=RyuiZTeMGFhu4LPRIpTDIhoah-Ax90JBjQK7JhA1cgI,2496
30
- MouseTools-3.0.0.dev2.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
31
- MouseTools-3.0.0.dev2.dist-info/top_level.txt,sha256=7nanLN103J_xJn6HK6yuyqqlDgltCsQY2-ArRXx1Ukk,11
32
- MouseTools-3.0.0.dev2.dist-info/RECORD,,
28
+ MouseTools-3.1.0.dev2.dist-info/LICENSE,sha256=xX4HoDU-zdafl3yEfIaspkvqHPaaXhuDwkJ6qhDMUIo,1074
29
+ MouseTools-3.1.0.dev2.dist-info/METADATA,sha256=JHql1m7EDD0kAOK5-mZ2b3Tr4q49dlYrHV1a-CIFJt4,2576
30
+ MouseTools-3.1.0.dev2.dist-info/WHEEL,sha256=uCRv0ZEik_232NlR4YDw4Pv3Ajt5bKvMH13NUU7hFuI,91
31
+ MouseTools-3.1.0.dev2.dist-info/top_level.txt,sha256=7nanLN103J_xJn6HK6yuyqqlDgltCsQY2-ArRXx1Ukk,11
32
+ MouseTools-3.1.0.dev2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.0.0)
2
+ Generator: setuptools (74.1.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
mousetools/__init__.py CHANGED
@@ -3,5 +3,5 @@ import logging
3
3
  logger = logging.getLogger(__name__)
4
4
  logger.addHandler(logging.NullHandler())
5
5
 
6
- __version__ = "3.0.0-dev.2" # will be set at runtime
6
+ __version__ = "3.1.0-dev.2" # will be set at runtime
7
7
  logger.info(f"MouseTools version: {__version__}")
@@ -8,6 +8,7 @@ from mousetools.entities.entertainment_venue import EntertainmentVenue
8
8
  from mousetools.entities.event import Event
9
9
  from mousetools.entities.guest_services import GuestServices
10
10
  from mousetools.entities.land import Land
11
+ from mousetools.entities.menu import Menus
11
12
  from mousetools.entities.merchandise_facility import MerchandiseFacility
12
13
  from mousetools.entities.park import ThemePark, WaterPark
13
14
  from mousetools.entities.point_of_interest import PointOfInterest
@@ -38,4 +39,5 @@ __all__ = [
38
39
  "Event",
39
40
  "Land",
40
41
  "PointOfInterest",
42
+ "Menus",
41
43
  ]
@@ -23,7 +23,7 @@ class EntityBase(DisneyAPIMixin, ThemeParkAPIMixin):
23
23
 
24
24
  if isinstance(facility_service_entity_type, FacilityServiceEntityTypes):
25
25
  facility_service_entity_type = facility_service_entity_type.value
26
- self.__facility_service_url = f"{WDPRO_FACILITY_SERVICE_BASE_URL}/{facility_service_entity_type}/{self.entity_id}"
26
+ self._facility_service_url = f"{WDPRO_FACILITY_SERVICE_BASE_URL}/{facility_service_entity_type}/{self.entity_id}"
27
27
 
28
28
  @property
29
29
  def name(self) -> typing.Optional[str]:
@@ -35,7 +35,7 @@ class EntityBase(DisneyAPIMixin, ThemeParkAPIMixin):
35
35
  """
36
36
 
37
37
  if self.disney_data is None:
38
- self.disney_data = self.get_disney_data(self.__facility_service_url)
38
+ self.disney_data = self.get_disney_data(self._facility_service_url)
39
39
  try:
40
40
  return self.disney_data["name"]
41
41
  except KeyError:
@@ -52,7 +52,7 @@ class EntityBase(DisneyAPIMixin, ThemeParkAPIMixin):
52
52
  """
53
53
 
54
54
  if self.disney_data is None:
55
- self.disney_data = self.get_disney_data(self.__facility_service_url)
55
+ self.disney_data = self.get_disney_data(self._facility_service_url)
56
56
  try:
57
57
  return self.disney_data["type"]
58
58
  except KeyError:
@@ -68,7 +68,7 @@ class EntityBase(DisneyAPIMixin, ThemeParkAPIMixin):
68
68
  (typing.Optional[str]): The sub type of entity, or None if it was not found.
69
69
  """
70
70
  if self.disney_data is None:
71
- self.disney_data = self.get_disney_data(self.__facility_service_url)
71
+ self.disney_data = self.get_disney_data(self._facility_service_url)
72
72
  try:
73
73
  return self.disney_data["subType"]
74
74
  except KeyError:
@@ -84,7 +84,7 @@ class EntityBase(DisneyAPIMixin, ThemeParkAPIMixin):
84
84
  (typing.Optional[str]): The url friendly id of the entity, or None if not found.
85
85
  """
86
86
  if self.disney_data is None:
87
- self.disney_data = self.get_disney_data(self.__facility_service_url)
87
+ self.disney_data = self.get_disney_data(self._facility_service_url)
88
88
  try:
89
89
  _id = self.disney_data["urlFriendlyId"]
90
90
  return _id
@@ -101,21 +101,22 @@ class EntityBase(DisneyAPIMixin, ThemeParkAPIMixin):
101
101
  (typing.Optional[dict[str, float]]): A dict with "lat" and "lng" keys containing the coordinates of this entity as floats, or None if no coordinates are found
102
102
  """
103
103
  if self.disney_data is None:
104
- self.disney_data = self.get_disney_data(self.__facility_service_url)
104
+ self.disney_data = self.get_disney_data(self._facility_service_url)
105
105
  try:
106
106
  return {
107
107
  "lat": float(
108
108
  self.disney_data["coordinates"]["Guest Entrance"]["gps"][
109
- "lattitude"
109
+ "latitude"
110
110
  ]
111
111
  ),
112
112
  "lng": float(
113
- self.disney_data["coordinates"]["Guest entrance"]["gps"][
113
+ self.disney_data["coordinates"]["Guest Entrance"]["gps"][
114
114
  "longitude"
115
115
  ]
116
116
  ),
117
117
  }
118
- except KeyError:
118
+ except KeyError as e:
119
+ print(e)
119
120
  logger.debug("No coordinates found for %s", self.entity_id)
120
121
  return None
121
122
 
@@ -129,7 +130,7 @@ class EntityBase(DisneyAPIMixin, ThemeParkAPIMixin):
129
130
  """
130
131
  # TODO check other ancestors to guess dest if not found
131
132
  if self.disney_data is None:
132
- self.disney_data = self.get_disney_data(self.__facility_service_url)
133
+ self.disney_data = self.get_disney_data(self._facility_service_url)
133
134
  try:
134
135
  return (
135
136
  self.disney_data["links"]["ancestorDestination"]["href"]
@@ -156,7 +157,7 @@ class EntityBase(DisneyAPIMixin, ThemeParkAPIMixin):
156
157
  (typing.Optional[str]): Theme park id, or None if no such id is found.
157
158
  """
158
159
  if self.disney_data is None:
159
- self.disney_data = self.get_disney_data(self.__facility_service_url)
160
+ self.disney_data = self.get_disney_data(self._facility_service_url)
160
161
  try:
161
162
  return (
162
163
  self.disney_data["links"]["ancestorThemePark"]["href"]
@@ -176,7 +177,7 @@ class EntityBase(DisneyAPIMixin, ThemeParkAPIMixin):
176
177
  (typing.Optional[str]): Water park id, or None if no such id is found.
177
178
  """
178
179
  if self.disney_data is None:
179
- self.disney_data = self.get_disney_data(self.__facility_service_url)
180
+ self.disney_data = self.get_disney_data(self._facility_service_url)
180
181
  try:
181
182
  return (
182
183
  self.disney_data["links"]["ancestorWaterPark"]["href"]
@@ -197,7 +198,7 @@ class EntityBase(DisneyAPIMixin, ThemeParkAPIMixin):
197
198
  """
198
199
 
199
200
  if self.disney_data is None:
200
- self.disney_data = self.get_disney_data(self.__facility_service_url)
201
+ self.disney_data = self.get_disney_data(self._facility_service_url)
201
202
  try:
202
203
  return (
203
204
  self.disney_data["links"]["ancestorResort"]["href"]
@@ -217,7 +218,7 @@ class EntityBase(DisneyAPIMixin, ThemeParkAPIMixin):
217
218
  (typing.Optional[str]): Land id, or None if no such id is found.
218
219
  """
219
220
  if self.disney_data is None:
220
- self.disney_data = self.get_disney_data(self.__facility_service_url)
221
+ self.disney_data = self.get_disney_data(self._facility_service_url)
221
222
  try:
222
223
  return (
223
224
  self.disney_data["links"]["ancestorLand"]["href"]
@@ -237,7 +238,7 @@ class EntityBase(DisneyAPIMixin, ThemeParkAPIMixin):
237
238
  (typing.Optional[str]): Resort area id, or None if no such id is found.
238
239
  """
239
240
  if self.disney_data is None:
240
- self.disney_data = self.get_disney_data(self.__facility_service_url)
241
+ self.disney_data = self.get_disney_data(self._facility_service_url)
241
242
  try:
242
243
  return (
243
244
  self.disney_data["links"]["ancestorResortArea"]["href"]
@@ -257,7 +258,7 @@ class EntityBase(DisneyAPIMixin, ThemeParkAPIMixin):
257
258
  (typing.Optional[str]): Entertainment venue id, or None if no such id is found.
258
259
  """
259
260
  if self.disney_data is None:
260
- self.disney_data = self.get_disney_data(self.__facility_service_url)
261
+ self.disney_data = self.get_disney_data(self._facility_service_url)
261
262
  try:
262
263
  return (
263
264
  self.disney_data["links"]["ancestorEntertainmentVenue"]["href"]
@@ -279,7 +280,7 @@ class EntityBase(DisneyAPIMixin, ThemeParkAPIMixin):
279
280
  (typing.Optional[str]): Restaurant id, or None if no such id is found.
280
281
  """
281
282
  if self.disney_data is None:
282
- self.disney_data = self.get_disney_data(self.__facility_service_url)
283
+ self.disney_data = self.get_disney_data(self._facility_service_url)
283
284
  try:
284
285
  return (
285
286
  self.disney_data["links"]["ancestorRestaurant"]["href"]
@@ -322,7 +323,7 @@ class EntityBase(DisneyAPIMixin, ThemeParkAPIMixin):
322
323
  @property
323
324
  def duration(self) -> typing.Optional[time]:
324
325
  if self.disney_data is None:
325
- self.disney_data = self.get_disney_data(self.__facility_service_url)
326
+ self.disney_data = self.get_disney_data(self._facility_service_url)
326
327
  try:
327
328
  return time.fromisoformat(
328
329
  ":".join(self.disney_data["duration"].split(":")[:3])
@@ -465,7 +466,7 @@ class EntityBase(DisneyAPIMixin, ThemeParkAPIMixin):
465
466
  if isinstance(entity_type, FacilityServiceEntityTypes):
466
467
  entity_type = entity_type.value
467
468
 
468
- children_url = f"{self.__facility_service_url}/{entity_type}"
469
+ children_url = f"{self._facility_service_url}/{entity_type}"
469
470
  data = self.get_disney_data(children_url)
470
471
  if data:
471
472
  return [
@@ -1,8 +1,144 @@
1
+ import typing
2
+
1
3
  from mousetools.entities.base import EntityBase
2
4
  from mousetools.ids import FacilityServiceEntityTypes
3
5
 
4
6
 
5
- class Menu(EntityBase):
7
+ class MenuItem:
8
+ def __init__(self, raw_item_data: dict):
9
+ self._raw_item_data = raw_item_data
10
+
11
+ def __repr__(self) -> str:
12
+ return f"MenuItem(entity_id={self.entity_id}, name={self.name})"
13
+
14
+ @property
15
+ def entity_id(self) -> typing.Optional[str]:
16
+ """
17
+ The entity id of the menu item.
18
+
19
+ Returns:
20
+ (typing.Optional[str]): The entity id of the menu item.
21
+ """
22
+ try:
23
+ return self._raw_item_data["id"]
24
+ except KeyError:
25
+ return None
26
+
27
+ @property
28
+ def name(self) -> typing.Optional[str]:
29
+ """
30
+ The name of the menu item.
31
+
32
+ Returns:
33
+ (typing.Optional[str]): The name of the menu item.
34
+ """
35
+ try:
36
+ return self._raw_item_data["name"]
37
+ except KeyError:
38
+ return None
39
+
40
+ @property
41
+ def type_name(self) -> typing.Optional[str]:
42
+ """
43
+ The type of the menu item.
44
+
45
+ Returns:
46
+ (typing.Optional[str]): The type of the menu item.
47
+ """
48
+ try:
49
+ return self._raw_item_data["type"]
50
+ except KeyError:
51
+ return None
52
+
53
+ @property
54
+ def price(self) -> typing.Optional[dict]:
55
+ """
56
+ The price of the menu item.
57
+
58
+ Examples:
59
+ {'price_qualifier': 'Per Serving', 'price_without_tax': 6.29}
60
+
61
+ Returns:
62
+ (typing.Optional[dict]): The price of the menu item.
63
+ """
64
+ try:
65
+ for i in self._raw_item_data["prices"]:
66
+ if i["type"] == "Retail":
67
+ return {
68
+ "price_without_tax": float(
69
+ i["priceSpecifications"][0]["priceWithoutTax"]
70
+ ),
71
+ "price_qualifier": i["priceSpecifications"][0][
72
+ "priceQualifier"
73
+ ],
74
+ }
75
+ except KeyError:
76
+ return None
77
+
78
+ return None
79
+
80
+
81
+ class Menu:
82
+ def __init__(self, raw_menu_data: dict):
83
+ self._raw_menu_data = raw_menu_data
84
+
85
+ def __repr__(self) -> str:
86
+ return f"Menu(entity_id={self.entity_id}, name={self.name})"
87
+
88
+ @property
89
+ def entity_id(self) -> typing.Optional[str]:
90
+ """
91
+ The entity id of the menu.
92
+
93
+ Returns:
94
+ (typing.Optional[str]): The entity id of the menu.
95
+ """
96
+ try:
97
+ return self._raw_menu_data["id"]
98
+ except KeyError:
99
+ return None
100
+
101
+ @property
102
+ def name(self) -> typing.Optional[str]:
103
+ """
104
+ The name of the menu.
105
+
106
+ Returns:
107
+ (typing.Optional[str]): The name of the menu.
108
+ """
109
+ try:
110
+ return self._raw_menu_data["name"]
111
+ except KeyError:
112
+ return None
113
+
114
+ @property
115
+ def type_name(self) -> typing.Optional[str]:
116
+ """
117
+ The type of the menu.
118
+
119
+ Returns:
120
+ (typing.Optional[str]): The type of the menu.
121
+ """
122
+ try:
123
+ return self._raw_menu_data["type"]
124
+ except KeyError:
125
+ return None
126
+
127
+ @property
128
+ def menu_items(self) -> list[MenuItem]:
129
+ """
130
+ The menu items of the menu.
131
+
132
+ Returns:
133
+ (list[MenuItem]): The menu items of the menu.
134
+ """
135
+ try:
136
+ return [MenuItem(i) for i in self._raw_menu_data["menuItems"]]
137
+ except KeyError:
138
+ return []
139
+
140
+
141
+ class Menus(EntityBase):
6
142
  """Class for Menu Entities."""
7
143
 
8
144
  def __init__(self, entity_id: str):
@@ -10,3 +146,81 @@ class Menu(EntityBase):
10
146
  entity_id=entity_id,
11
147
  facility_service_entity_type=FacilityServiceEntityTypes.MENU_ITEMS,
12
148
  )
149
+
150
+ @property
151
+ def price_range(self) -> typing.Optional[str]:
152
+ """
153
+ The price range of the menu.
154
+
155
+ Examples:
156
+ "$ ($14.99 and under per adult)"
157
+
158
+ Returns:
159
+ (typing.Optional[str]): Price range of menu desribed in $.
160
+ """
161
+ if self.disney_data is None:
162
+ self.disney_data = self.get_disney_data(self._facility_service_url)
163
+ try:
164
+ return self.disney_data["priceRange"]
165
+ except KeyError:
166
+ return None
167
+
168
+ @property
169
+ def service_style(self) -> typing.Optional[str]:
170
+ """
171
+ The service style of the menu.
172
+
173
+ Returns:
174
+ (typing.Optional[str]): The service style of the menu.
175
+ """
176
+ if self.disney_data is None:
177
+ self.disney_data = self.get_disney_data(self._facility_service_url)
178
+ try:
179
+ return self.disney_data["serviceStyle"]
180
+ except KeyError:
181
+ return None
182
+
183
+ @property
184
+ def meal_period_type(self) -> typing.Optional[str]:
185
+ """
186
+ The meal period type of the menu.
187
+
188
+ Returns:
189
+ (typing.Optional[str]): The meal period type of the menu.
190
+ """
191
+ if self.disney_data is None:
192
+ self.disney_data = self.get_disney_data(self._facility_service_url)
193
+ try:
194
+ return self.disney_data["mealPeriodType"]
195
+ except KeyError:
196
+ return None
197
+
198
+ @property
199
+ def primary_cuisine_type(self) -> typing.Optional[str]:
200
+ """
201
+ The primary cuisine type of the menu.
202
+
203
+ Returns:
204
+ (typing.Optional[str]): The primary cuisine type of the menu.
205
+ """
206
+ if self.disney_data is None:
207
+ self.disney_data = self.get_disney_data(self._facility_service_url)
208
+ try:
209
+ return self.disney_data["primaryCuisineType"]
210
+ except KeyError:
211
+ return None
212
+
213
+ @property
214
+ def menus(self) -> list[Menu]:
215
+ """
216
+ Returns a list of all the menus associated with this entity.
217
+
218
+ Returns:
219
+ (list[Menu]): List of Menu objects that are associated with this entity.
220
+ """
221
+ if self.disney_data is None:
222
+ self.disney_data = self.get_disney_data(self._facility_service_url)
223
+ try:
224
+ return [Menu(i) for i in self.disney_data["menus"]]
225
+ except KeyError:
226
+ return []
@@ -1,6 +1,11 @@
1
+ import logging
2
+ import typing
3
+
1
4
  from mousetools.entities.base import EntityBase
2
5
  from mousetools.ids import FacilityServiceEntityTypes
3
6
 
7
+ logger = logging.getLogger(__name__)
8
+
4
9
 
5
10
  class Restaurant(EntityBase):
6
11
  """Class for Restaurant Entities."""
@@ -10,3 +15,39 @@ class Restaurant(EntityBase):
10
15
  entity_id=entity_id,
11
16
  facility_service_entity_type=FacilityServiceEntityTypes.RESTAURANTS,
12
17
  )
18
+
19
+ @property
20
+ def service_styles(self) -> typing.Optional[list[str]]:
21
+ """
22
+ The service styles offered by the restaurant.
23
+
24
+ Returns:
25
+ (typing.Optional[list[str]]): The service styles offered by the restaurant.
26
+ """
27
+ if self.disney_data is None:
28
+ self.disney_data = self.get_disney_data(self._facility_service_url)
29
+ try:
30
+ return self.disney_data["serviceStyles"]
31
+ except KeyError:
32
+ logger.debug("No service styles found for %s", self.entity_id)
33
+ return None
34
+
35
+ @property
36
+ def menu_id(self) -> typing.Optional[str]:
37
+ """
38
+ The menu id associated with the restaurant.
39
+
40
+ Returns:
41
+ (typing.Optional[str]): The menu id associated with the restaurant.
42
+ """
43
+ if self.disney_data is None:
44
+ self.disney_data = self.get_disney_data(self._facility_service_url)
45
+ try:
46
+ return (
47
+ self.disney_data["menuItems"][0]["links"]["self"]["href"]
48
+ .split("?")[0]
49
+ .split("/")[-1]
50
+ )
51
+ except KeyError:
52
+ logger.debug("No menu id found for %s", self.entity_id)
53
+ return None
@@ -30,8 +30,6 @@ class DisneyAPIMixin:
30
30
  logger.info("Sending request to %s", url)
31
31
  response = httpx.get(url, headers=auth_obj.get_headers())
32
32
  logger.debug("Response status: %s", response.status_code)
33
- if response.status_code == httpx._status_codes.codes.NOT_FOUND:
34
- raise EntityIDNotFoundError
35
33
 
36
34
  try:
37
35
  response.raise_for_status()
@@ -49,6 +47,8 @@ class DisneyAPIMixin:
49
47
  logger.debug("Sending new request to %s", url)
50
48
  response = httpx.get(url, headers=auth_obj.get_headers())
51
49
  logger.debug("Response status: %s", response.status_code)
50
+ if response.status_code == httpx._status_codes.codes.NOT_FOUND:
51
+ raise EntityIDNotFoundError
52
52
  response.raise_for_status()
53
53
  data = response.json()
54
54