• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-python-sdk-gen / 11461434425

22 Oct 2024 01:38PM UTC coverage: 92.421% (+0.008%) from 92.413%
11461434425

Pull #347

github

web-flow
Merge b78e5fe79 into 6820d08f3
Pull Request #347: fix: update client error schema to support schema errors (box/box-openapi#467)

90 of 90 new or added lines in 3 files covered. (100.0%)

1 existing line in 1 file now uncovered.

10512 of 11374 relevant lines covered (92.42%)

0.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.68
/box_sdk_gen/schemas/client_error.py
1
from enum import Enum
1✔
2

3
from box_sdk_gen.internal.base_object import BaseObject
1✔
4

5
from typing import Optional
1✔
6

7

8
class ClientErrorTypeField(str, Enum):
1✔
9
    ERROR = 'error'
1✔
10

11

12
class ClientErrorCodeField(str, Enum):
1✔
13
    CREATED = 'created'
1✔
14
    ACCEPTED = 'accepted'
1✔
15
    NO_CONTENT = 'no_content'
1✔
16
    REDIRECT = 'redirect'
1✔
17
    NOT_MODIFIED = 'not_modified'
1✔
18
    BAD_REQUEST = 'bad_request'
1✔
19
    UNAUTHORIZED = 'unauthorized'
1✔
20
    FORBIDDEN = 'forbidden'
1✔
21
    NOT_FOUND = 'not_found'
1✔
22
    METHOD_NOT_ALLOWED = 'method_not_allowed'
1✔
23
    CONFLICT = 'conflict'
1✔
24
    PRECONDITION_FAILED = 'precondition_failed'
1✔
25
    TOO_MANY_REQUESTS = 'too_many_requests'
1✔
26
    INTERNAL_SERVER_ERROR = 'internal_server_error'
1✔
27
    UNAVAILABLE = 'unavailable'
1✔
28
    ITEM_NAME_INVALID = 'item_name_invalid'
1✔
29
    INSUFFICIENT_SCOPE = 'insufficient_scope'
1✔
30

31

32
class ClientErrorContextInfoField(BaseObject):
1✔
33
    def __init__(self, **kwargs):
1✔
UNCOV
34
        super().__init__(**kwargs)
×
35

36

37
class ClientError(BaseObject):
1✔
38
    _discriminator = 'type', {'error'}
1✔
39

40
    def __init__(
1✔
41
        self,
42
        *,
43
        type: Optional[ClientErrorTypeField] = None,
44
        status: Optional[int] = None,
45
        code: Optional[ClientErrorCodeField] = None,
46
        message: Optional[str] = None,
47
        context_info: Optional[ClientErrorContextInfoField] = None,
48
        help_url: Optional[str] = None,
49
        request_id: Optional[str] = None,
50
        **kwargs
51
    ):
52
        """
53
                :param type: error, defaults to None
54
                :type type: Optional[ClientErrorTypeField], optional
55
                :param status: The HTTP status of the response., defaults to None
56
                :type status: Optional[int], optional
57
                :param code: A Box-specific error code, defaults to None
58
                :type code: Optional[ClientErrorCodeField], optional
59
                :param message: A short message describing the error., defaults to None
60
                :type message: Optional[str], optional
61
                :param context_info: A free-form object that contains additional context
62
        about the error. The possible fields are defined on
63
        a per-endpoint basis. `message` is only one example., defaults to None
64
                :type context_info: Optional[ClientErrorContextInfoField], optional
65
                :param help_url: A URL that links to more information about why this error occurred., defaults to None
66
                :type help_url: Optional[str], optional
67
                :param request_id: A unique identifier for this response, which can be used
68
        when contacting Box support., defaults to None
69
                :type request_id: Optional[str], optional
70
        """
71
        super().__init__(**kwargs)
×
72
        self.type = type
×
73
        self.status = status
×
74
        self.code = code
×
75
        self.message = message
×
76
        self.context_info = context_info
×
77
        self.help_url = help_url
×
78
        self.request_id = request_id
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc