Skip to content

Commit fcca2a4

Browse files
feat: add signer language, cancel sign request reason (box/box-openapi#584) (#1331)
1 parent 672ac0f commit fcca2a4

File tree

10 files changed

+49
-12
lines changed

10 files changed

+49
-12
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "bfb97cc", "specHash": "ccdb456", "version": "10.3.0" }
1+
{ "engineHash": "bfb97cc", "specHash": "77eac4b", "version": "10.3.0" }

box_sdk_gen/managers/folders.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,10 @@ def get_folder_by_id(
377377
:type direction: Optional[GetFolderByIdDirection], optional
378378
:param offset: The offset of the item at which to begin the response.
379379
380-
Queries with offset parameter value
381-
exceeding 10000 will be rejected
382-
with a 400 response., defaults to None
380+
Offset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In
381+
those cases, reduce the number of items in the folder (for example, by
382+
restructuring the folder into smaller subfolders) before retrying the
383+
request., defaults to None
383384
:type offset: Optional[int], optional
384385
:param limit: The maximum number of items to return per page., defaults to None
385386
:type limit: Optional[int], optional
@@ -733,9 +734,8 @@ def get_folder_items(
733734
:type marker: Optional[str], optional
734735
:param offset: The offset of the item at which to begin the response.
735736
736-
Queries with offset parameter value
737-
exceeding 10000 will be rejected
738-
with a 400 response., defaults to None
737+
Offset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In
738+
those cases, use marker-based pagination by setting `usemarker` to `true`., defaults to None
739739
:type offset: Optional[int], optional
740740
:param limit: The maximum number of items to return per page., defaults to None
741741
:type limit: Optional[int], optional

box_sdk_gen/managers/sign_requests.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
from box_sdk_gen.internal.utils import to_string
88

9+
from box_sdk_gen.serialization.json import serialize
10+
911
from box_sdk_gen.serialization.json import deserialize
1012

1113
from typing import List
@@ -14,8 +16,6 @@
1416

1517
from typing import Union
1618

17-
from box_sdk_gen.serialization.json import serialize
18-
1919
from box_sdk_gen.networking.fetch_options import ResponseFormat
2020

2121
from box_sdk_gen.schemas.file_base import FileBase
@@ -30,6 +30,8 @@
3030

3131
from box_sdk_gen.schemas.client_error import ClientError
3232

33+
from box_sdk_gen.schemas.sign_request_cancel_request import SignRequestCancelRequest
34+
3335
from box_sdk_gen.schemas.sign_requests import SignRequests
3436

3537
from box_sdk_gen.schemas.sign_request_create_request import SignRequestCreateRequest
@@ -77,18 +79,22 @@ def cancel_sign_request(
7779
self,
7880
sign_request_id: str,
7981
*,
82+
reason: Optional[str] = None,
8083
extra_headers: Optional[Dict[str, Optional[str]]] = None
8184
) -> SignRequest:
8285
"""
8386
Cancels a sign request.
8487
:param sign_request_id: The ID of the signature request.
8588
Example: "33243242"
8689
:type sign_request_id: str
90+
:param reason: An optional reason for cancelling the sign request., defaults to None
91+
:type reason: Optional[str], optional
8792
:param extra_headers: Extra headers that will be included in the HTTP request., defaults to None
8893
:type extra_headers: Optional[Dict[str, Optional[str]]], optional
8994
"""
9095
if extra_headers is None:
9196
extra_headers = {}
97+
request_body: Dict = {'reason': reason}
9298
headers_map: Dict[str, str] = prepare_params({**extra_headers})
9399
response: FetchResponse = self.network_session.network_client.fetch(
94100
FetchOptions(
@@ -102,6 +108,8 @@ def cancel_sign_request(
102108
),
103109
method='POST',
104110
headers=headers_map,
111+
data=serialize(request_body) if not request_body == None else None,
112+
content_type='application/json',
105113
response_format=ResponseFormat.JSON,
106114
auth=self.auth,
107115
network_session=self.network_session,

box_sdk_gen/schemas/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@
274274

275275
from box_sdk_gen.schemas.shield_information_barrier_segment_restriction_mini import *
276276

277+
from box_sdk_gen.schemas.sign_request_cancel_request import *
278+
277279
from box_sdk_gen.schemas.sign_request_create_signer import *
278280

279281
from box_sdk_gen.schemas.sign_request_prefill_tag import *

box_sdk_gen/schemas/ai_extract_structured_response.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(
2727
:type created_at: DateTime
2828
:param completion_reason: The reason the response finishes., defaults to None
2929
:type completion_reason: Optional[str], optional
30-
:param confidence_score: The confidence score numeric values for each extracted field as a JSON dictionary. This can be empty if no field could be extracted., defaults to None
30+
:param confidence_score: The confidence score levels and numeric values for each extracted field as a JSON dictionary. This can be empty if no field could be extracted., defaults to None
3131
:type confidence_score: Optional[Dict], optional
3232
"""
3333
super().__init__(**kwargs)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from typing import Optional
2+
3+
from box_sdk_gen.internal.base_object import BaseObject
4+
5+
from box_sdk_gen.box.errors import BoxSDKError
6+
7+
8+
class SignRequestCancelRequest(BaseObject):
9+
def __init__(self, *, reason: Optional[str] = None, **kwargs):
10+
"""
11+
:param reason: An optional reason for cancelling the sign request., defaults to None
12+
:type reason: Optional[str], optional
13+
"""
14+
super().__init__(**kwargs)
15+
self.reason = reason

box_sdk_gen/schemas/sign_request_create_signer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def __init__(
2929
password: Optional[str] = None,
3030
signer_group_id: Optional[str] = None,
3131
suppress_notifications: Optional[bool] = None,
32+
language: Optional[str] = None,
3233
**kwargs
3334
):
3435
"""
@@ -82,6 +83,9 @@ def __init__(
8283
:type signer_group_id: Optional[str], optional
8384
:param suppress_notifications: If true, no emails about the sign request will be sent., defaults to None
8485
:type suppress_notifications: Optional[bool], optional
86+
:param language: The language of the user, formatted in modified version of the
87+
[ISO 639-1](https://developer.box.com/guides/api-calls/language-codes) format., defaults to None
88+
:type language: Optional[str], optional
8589
"""
8690
super().__init__(**kwargs)
8791
self.email = email
@@ -96,3 +100,4 @@ def __init__(
96100
self.password = password
97101
self.signer_group_id = signer_group_id
98102
self.suppress_notifications = suppress_notifications
103+
self.language = language

box_sdk_gen/schemas/sign_request_signer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ def __init__(
7575
password: Optional[str] = None,
7676
signer_group_id: Optional[str] = None,
7777
suppress_notifications: Optional[bool] = None,
78+
language: Optional[str] = None,
7879
**kwargs
7980
):
8081
"""
@@ -143,6 +144,9 @@ def __init__(
143144
:type signer_group_id: Optional[str], optional
144145
:param suppress_notifications: If true, no emails about the sign request will be sent., defaults to None
145146
:type suppress_notifications: Optional[bool], optional
147+
:param language: The language of the user, formatted in modified version of the
148+
[ISO 639-1](https://developer.box.com/guides/api-calls/language-codes) format., defaults to None
149+
:type language: Optional[str], optional
146150
"""
147151
super().__init__(
148152
email=email,
@@ -157,6 +161,7 @@ def __init__(
157161
password=password,
158162
signer_group_id=signer_group_id,
159163
suppress_notifications=suppress_notifications,
164+
language=language,
160165
**kwargs
161166
)
162167
self.has_viewed_document = has_viewed_document

docs/folders.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ client.folders.get_folder_by_id("0")
4242
- direction `Optional[GetFolderByIdDirection]`
4343
- The direction to sort results in. This can be either in alphabetical ascending (`ASC`) or descending (`DESC`) order.
4444
- offset `Optional[int]`
45-
- The offset of the item at which to begin the response. Queries with offset parameter value exceeding 10000 will be rejected with a 400 response.
45+
- The offset of the item at which to begin the response. Offset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In those cases, reduce the number of items in the folder (for example, by restructuring the folder into smaller subfolders) before retrying the request.
4646
- limit `Optional[int]`
4747
- The maximum number of items to return per page.
4848
- if_none_match `Optional[str]`
@@ -195,7 +195,7 @@ client.folders.get_folder_items(folder_origin.id)
195195
- marker `Optional[str]`
196196
- Defines the position marker at which to begin returning results. This is used when paginating using marker-based pagination. This requires `usemarker` to be set to `true`.
197197
- offset `Optional[int]`
198-
- The offset of the item at which to begin the response. Queries with offset parameter value exceeding 10000 will be rejected with a 400 response.
198+
- The offset of the item at which to begin the response. Offset-based pagination is not guaranteed to work reliably for high offset values and may fail for large datasets. In those cases, use marker-based pagination by setting `usemarker` to `true`.
199199
- limit `Optional[int]`
200200
- The maximum number of items to return per page.
201201
- sort `Optional[GetFolderItemsSort]`

docs/sign_requests.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ client.sign_requests.cancel_sign_request(created_sign_request.id)
2525

2626
- sign_request_id `str`
2727
- The ID of the signature request. Example: "33243242"
28+
- reason `Optional[str]`
29+
- An optional reason for cancelling the sign request.
2830
- extra_headers `Optional[Dict[str, Optional[str]]]`
2931
- Extra headers that will be included in the HTTP request.
3032

0 commit comments

Comments
 (0)