We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a6eb663 commit c956f81Copy full SHA for c956f81
1 file changed
xbox/webapi/common/ratelimits/__init__.py
@@ -170,6 +170,15 @@ def get_reset_after(self) -> Union[datetime, None]:
170
# dates_valid has no elements, return None
171
return None
172
173
+ def get_limits(self) -> list[SingleRateLimit]:
174
+ return self.__limits
175
+
176
+ def get_limits_by_period(self, period: TimePeriod) -> list[SingleRateLimit]:
177
+ # Filter the list for the given LimitType
178
+ matches = filter(lambda limit: limit.get_time_period() == period, self.__limits)
179
+ # Convert the filter object to a list and return it
180
+ return list(matches)
181
182
def is_exceeded(self) -> bool:
183
# Map self.__limits to (limit).is_exceeded()
184
is_exceeded_map = map(lambda limit: limit.is_exceeded(), self.__limits)
0 commit comments