77import uuid
88from http import HTTPStatus
99
10+ from beartype import beartype
11+
1012from mock_vws ._constants import ResultCodes
1113from mock_vws ._mock_common import json_dump
1214
1315
16+ @beartype
1417class ValidatorError (Exception ):
1518 """
1619 A base class for exceptions thrown from mock Vuforia cloud recognition
@@ -22,6 +25,7 @@ class ValidatorError(Exception):
2225 headers : dict [str , str ]
2326
2427
28+ @beartype
2529class DateHeaderNotGivenError (ValidatorError ):
2630 """
2731 Exception raised when a date header is not given.
@@ -52,6 +56,7 @@ def __init__(self) -> None:
5256 }
5357
5458
59+ @beartype
5560class DateFormatNotValidError (ValidatorError ):
5661 """
5762 Exception raised when the date format is not valid.
@@ -83,6 +88,7 @@ def __init__(self) -> None:
8388 }
8489
8590
91+ @beartype
8692class RequestTimeTooSkewedError (ValidatorError ):
8793 """
8894 Exception raised when Vuforia returns a response with a result code
@@ -118,6 +124,7 @@ def __init__(self) -> None:
118124 }
119125
120126
127+ @beartype
121128class BadImageError (ValidatorError ):
122129 """
123130 Exception raised when Vuforia returns a response with a result code
@@ -160,6 +167,7 @@ def __init__(self) -> None:
160167 }
161168
162169
170+ @beartype
163171class AuthenticationFailureError (ValidatorError ):
164172 """
165173 Exception raised when Vuforia returns a response with a result code
@@ -202,6 +210,7 @@ def __init__(self) -> None:
202210 }
203211
204212
213+ @beartype
205214class AuthenticationFailureGoodFormattingError (ValidatorError ):
206215 """
207216 Exception raised when Vuforia returns a response with a result code
@@ -239,6 +248,7 @@ def __init__(self) -> None:
239248 }
240249
241250
251+ @beartype
242252class ImageNotGivenError (ValidatorError ):
243253 """
244254 Exception raised when an image is not given.
@@ -270,6 +280,7 @@ def __init__(self) -> None:
270280 }
271281
272282
283+ @beartype
273284class AuthHeaderMissingError (ValidatorError ):
274285 """
275286 Exception raised when an auth header is not given.
@@ -302,6 +313,7 @@ def __init__(self) -> None:
302313 }
303314
304315
316+ @beartype
305317class MalformedAuthHeaderError (ValidatorError ):
306318 """
307319 Exception raised when an auth header is not given.
@@ -335,6 +347,7 @@ def __init__(self) -> None:
335347 }
336348
337349
350+ @beartype
338351class UnknownParametersError (ValidatorError ):
339352 """
340353 Exception raised when unknown parameters are given.
@@ -366,6 +379,7 @@ def __init__(self) -> None:
366379 }
367380
368381
382+ @beartype
369383class InactiveProjectError (ValidatorError ):
370384 """
371385 Exception raised when Vuforia returns a response with a result code
@@ -407,6 +421,7 @@ def __init__(self) -> None:
407421 }
408422
409423
424+ @beartype
410425class InvalidMaxNumResultsError (ValidatorError ):
411426 """
412427 Exception raised when an invalid value is given as the
@@ -443,6 +458,7 @@ def __init__(self, given_value: str) -> None:
443458 }
444459
445460
461+ @beartype
446462class MaxNumResultsOutOfRangeError (ValidatorError ):
447463 """
448464 Exception raised when an integer value is given as the "max_num_results"
@@ -479,6 +495,7 @@ def __init__(self, given_value: str) -> None:
479495 }
480496
481497
498+ @beartype
482499class InvalidIncludeTargetDataError (ValidatorError ):
483500 """
484501 Exception raised when an invalid value is given as the
@@ -517,6 +534,7 @@ def __init__(self, given_value: str) -> None:
517534 }
518535
519536
537+ @beartype
520538class UnsupportedMediaTypeError (ValidatorError ):
521539 """
522540 Exception raised when no boundary is found for multipart data.
@@ -547,6 +565,7 @@ def __init__(self) -> None:
547565 }
548566
549567
568+ @beartype
550569class InvalidAcceptHeaderError (ValidatorError ):
551570 """
552571 Exception raised when there is an invalid accept header given.
@@ -577,6 +596,7 @@ def __init__(self) -> None:
577596 }
578597
579598
599+ @beartype
580600class NoBoundaryFoundError (ValidatorError ):
581601 """
582602 Exception raised when an invalid media type is given.
@@ -611,6 +631,7 @@ def __init__(self) -> None:
611631 }
612632
613633
634+ @beartype
614635class ContentLengthHeaderTooLargeError (ValidatorError ):
615636 """
616637 Exception raised when the given content length header is too large.
@@ -634,6 +655,7 @@ def __init__(self) -> None: # pragma: no cover
634655 }
635656
636657
658+ @beartype
637659class ContentLengthHeaderNotIntError (ValidatorError ):
638660 """
639661 Exception raised when the given content length header is not an integer.
@@ -656,6 +678,7 @@ def __init__(self) -> None:
656678 }
657679
658680
681+ @beartype
659682class RequestEntityTooLargeError (ValidatorError ):
660683 """
661684 Exception raised when the given image file size is too large.
@@ -699,6 +722,7 @@ def __init__(self) -> None: # pragma: no cover
699722 }
700723
701724
725+ @beartype
702726class NoContentTypeError (ValidatorError ):
703727 """
704728 Exception raised when a content type is either not given or is empty.
0 commit comments