Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codegen output 1467a3d9a9f34b609898cc43e3011db9 #60

Merged
merged 1 commit into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/semantic-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Semantic PR

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate semantic PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ You can also initialize `DeveloperTokenAuth` with the retrieved access token and
<!-- sample post_oauth2_token downscope_token -->

```python
from box_sdk_gen import BoxDeveloperTokenAuth, AccessToken
from box_sdk_gen import BoxDeveloperTokenAuth, AccessToken, BoxClient

resource = 'https://api.box.com/2.0/files/123456789'
downscoped_token: AccessToken = auth.downscope_token(
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ from box_sdk_gen import BoxClient, BoxDeveloperTokenAuth

auth = BoxDeveloperTokenAuth(token='DEVELOPER_TOKEN_GOES_HERE')
client = BoxClient(auth=auth)
client.network.MAX_ATTEMPTS = 6
client.network_session.MAX_ATTEMPTS = 6
```
8 changes: 4 additions & 4 deletions docs/downloads.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ it won;t be necessary to store the entire file content in-memory.
To get the full content of the file in `bytes` format just call `read()` method on returned object.

```python
from box_sdk_gen import ByteStream
from io import BufferedIOBase

file_content_stream: ByteStream = client.downloads.download_file(file_id='123456789')
file_content_stream: BufferedIOBase = client.downloads.download_file(file_id='123456789')
print('File content: ', file_content_stream.read())
```

Expand All @@ -31,9 +31,9 @@ To save downloaded file to your local disk you can use e.g. `shutil.copyfileobj(

```python
import shutil
from box_sdk_gen import ByteStream
from io import BufferedIOBase

file_content_stream: ByteStream = client.downloads.download_file(file_id='123456789')
file_content_stream: BufferedIOBase = client.downloads.download_file(file_id='123456789')
with open('file.pdf', 'wb') as f:
shutil.copyfileobj(file_content_stream, f)
print('File was successfully downloaded as "file.pdf"')
Expand Down
266 changes: 184 additions & 82 deletions docs/files.md

Large diffs are not rendered by default.

354 changes: 237 additions & 117 deletions docs/folders.md

Large diffs are not rendered by default.

198 changes: 150 additions & 48 deletions docs/sign_requests.md
Original file line number Diff line number Diff line change
@@ -1,78 +1,180 @@
# Sign Requests
# SignRequestsManager

Sign Requests are used to request e-signatures on documents from signers.
A Sign Request can refer to one or more Box Files and can be sent to one or more Box Sign Request Signers.
- [Cancel sign request](#cancel-sign-request)
- [Resend sign request](#resend-sign-request)
- [Get sign request by ID](#get-sign-request-by-id)
- [List sign requests](#list-sign-requests)
- [Create sign request](#create-sign-request)

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Cancel sign request

- [Create Sign Request](#create-sign-request)
- [Get All Sign Requests](#get-all-sign-requests)
- [Get Sign Request by ID](#get-sign-request-by-id)
- [Cancel Sign Request](#cancel-sign-request)
- [Resend Sign Request](#resend-sign-request)
Cancels a sign request.

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
This operation is performed by calling function `cancel_sign_request`.

# Create Sign Request
See the endpoint docs at
[API Reference](https://developer.box.com/reference/post-sign-requests-id-cancel/).

The `create_sign_request`method will create a Sign Request. You need to provide at least one file
(from which the signing document will be created) and at least one signer to receive the Sign Request.
<!-- sample post_sign_requests_id_cancel -->

```python
from box_sdk_gen import SignRequestCreateSigner, FileBaseTypeField, FolderBaseTypeField, FileBase, FolderMini
client.sign_requests.cancel_sign_request(sign_request_id=created_sign_request.id)
```

destination_folder_id = '12345'
file_to_sign_id = '11111'
signer_email = '[email protected]'
### Arguments

created_sign_request = client.sign_requests.create_sign_request(
signers=[SignRequestCreateSigner(email=signer_email)],
parent_folder=FolderMini(id=destination_folder_id, type=FolderBaseTypeField.FOLDER.value),
source_files=[FileBase(id=file_to_sign_id, type=FileBaseTypeField.FILE.value)]
)
- sign_request_id `str`
- The ID of the sign request Example: "33243242"
- extra_headers `Optional[Dict[str, Optional[str]]]`
- Extra headers that will be included in the HTTP request.

print(f'(Sign Request ID: {created_sign_request.id})')
```
### Returns

If you set `isDocumentPreparationNeeded` flag to true, you need to visit `prepareUrl` before the Sign Request will be sent.
For more information on `isDocumentPreparationNeeded` and the other parameters available, please refer to the [developer documentation](https://developer.box.com/guides/sign-request/).
This function returns a value of type `SignRequest`.

# Get All Sign Requests
Returns a Sign Request object.

Calling the `get_sign_requests` will return `SignRequests` object that will allow getting access to all the Sign Requests.
## Resend sign request

```python
sign_requests = client.sign_requests.get_sign_requests()
for sign_request in sign_requests.entries:
print(f'(Sign Request ID: {sign_request.id})')
```
Resends a sign request email to all outstanding signers.

This operation is performed by calling function `resend_sign_request`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/post-sign-requests-id-resend/).

_Currently we don't have an example for calling `resend_sign_request` in integration tests_

### Arguments

# Get Sign Request by ID
- sign_request_id `str`
- The ID of the sign request Example: "33243242"
- extra_headers `Optional[Dict[str, Optional[str]]]`
- Extra headers that will be included in the HTTP request.

Calling `get_sign_request_by_id` will return `SignRequest` object containing information about the Sign Request.
### Returns

This function returns a value of type `None`.

Returns an empty response when the API call was successful.
The email notifications will be sent asynchronously.

## Get sign request by ID

Gets a sign request by ID.

This operation is performed by calling function `get_sign_request_by_id`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/get-sign-requests-id/).

<!-- sample get_sign_requests_id -->

```python
sign_request = new_sign_request = client.sign_requests.get_sign_request_by_id('123456')
print(f'Sign Request ID is {sign_request.id}')
client.sign_requests.get_sign_request_by_id(sign_request_id=created_sign_request.id)
```

# Cancel Sign Request
### Arguments

- sign_request_id `str`
- The ID of the sign request Example: "33243242"
- extra_headers `Optional[Dict[str, Optional[str]]]`
- Extra headers that will be included in the HTTP request.

Calling `cancel_sign_request` will cancel a created Sign Request.
### Returns

This function returns a value of type `SignRequest`.

Returns a sign request

## List sign requests

Gets sign requests created by a user. If the `sign_files` and/or
`parent_folder` are deleted, the sign request will not return in the list.

This operation is performed by calling function `get_sign_requests`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/get-sign-requests/).

<!-- sample get_sign_requests -->

```python
cancelled_sign_request = client.sign_requests.cancel_sign_request('123456')
print(f'Cancelled Sign Request status is {cancelled_sign_request.status}')
client.sign_requests.get_sign_requests()
```

# Resend Sign Request
### Arguments

- marker `Optional[str]`
- 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`.
- limit `Optional[int]`
- The maximum number of items to return per page.
- extra_headers `Optional[Dict[str, Optional[str]]]`
- Extra headers that will be included in the HTTP request.

Calling `resend_sign_request` will resend a Sign Request to all signers that have not signed it yet.
There is an 10-minute cooling-off period between re-sending reminder emails.
### Returns

This function returns a value of type `SignRequests`.

Returns a collection of sign requests

## Create sign request

Creates a sign request. This involves preparing a document for signing and
sending the sign request to signers.

This operation is performed by calling function `create_sign_request`.

See the endpoint docs at
[API Reference](https://developer.box.com/reference/post-sign-requests/).

<!-- sample post_sign_requests -->

```python
sign_request_to_resend_id = '123456'
client.sign_requests.resend_sign_request(sign_request_to_resend_id)
print(f'Sign Request with ID {sign_request_to_resend_id} was resent')
client.sign_requests.create_sign_request(source_files=[FileBase(id=file_to_sign.id, type=FileBaseTypeField.FILE.value)], signers=[SignRequestCreateSigner(email=signer_1_email, signer_group_id='user'), SignRequestCreateSigner(email=signer_2_email, signer_group_id='user')], parent_folder=FolderMini(id=destination_folder.id, type=FolderBaseTypeField.FOLDER.value))
```

### Arguments

- source_files `Optional[List[FileBase]]`
- List of files to create a signing document from. This is currently limited to ten files. Only the ID and type fields are required for each file.
- signature_color `Optional[CreateSignRequestSignatureColor]`
- Force a specific color for the signature (blue, black, or red)
- signers `List[SignRequestCreateSigner]`
- Array of signers for the sign request. 35 is the max number of signers permitted.
- parent_folder `Optional[FolderMini]`
-
- is_document_preparation_needed `Optional[bool]`
- Indicates if the sender should receive a `prepare_url` in the response to complete document preparation via UI.
- redirect_url `Optional[str]`
- When specified, signature request will be redirected to this url when a document is signed.
- declined_redirect_url `Optional[str]`
- The uri that a signer will be redirected to after declining to sign a document.
- are_text_signatures_enabled `Optional[bool]`
- Disables the usage of signatures generated by typing (text).
- email_subject `Optional[str]`
- Subject of sign request email. This is cleaned by sign request. If this field is not passed, a default subject will be used.
- email_message `Optional[str]`
- Message to include in sign request email. The field is cleaned through sanitization of specific characters. However, some html tags are allowed. Links included in the message are also converted to hyperlinks in the email. The message may contain the following html tags including `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and `strong`. Be aware that when the text to html ratio is too high, the email may end up in spam filters. Custom styles on these tags are not allowed. If this field is not passed, a default message will be used.
- are_reminders_enabled `Optional[bool]`
- Reminds signers to sign a document on day 3, 8, 13 and 18. Reminders are only sent to outstanding signers.
- name `Optional[str]`
- Name of the sign request.
- prefill_tags `Optional[List[SignRequestPrefillTag]]`
- When a document contains sign related tags in the content, you can prefill them using this `prefill_tags` by referencing the 'id' of the tag as the `external_id` field of the prefill tag.
- days_valid `Optional[int]`
- Set the number of days after which the created signature request will automatically expire if not completed. By default, we do not apply any expiration date on signature requests, and the signature request does not expire.
- external_id `Optional[str]`
- This can be used to reference an ID in an external system that the sign request is related to.
- is_phone_verification_required_to_view `Optional[bool]`
- Forces signers to verify a text message prior to viewing the document. You must specify the phone number of signers to have this setting apply to them.
- template_id `Optional[str]`
- When a signature request is created from a template this field will indicate the id of that template.
- extra_headers `Optional[Dict[str, Optional[str]]]`
- Extra headers that will be included in the HTTP request.

### Returns

This function returns a value of type `SignRequest`.

Returns a Sign Request object.
10 changes: 5 additions & 5 deletions docs/uploads.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ This method returns a `Files` object which contains information about the upload
<!-- sample post_files_content -->

```python
from box_sdk_gen import UploadFileAttributesArg, UploadFileAttributesArgParentField
from box_sdk_gen import UploadFileAttributes, UploadFileAttributesParentField, Files, File

attrs = UploadFileAttributesArg(
attrs = UploadFileAttributes(
name='filename.txt',
parent=UploadFileAttributesArgParentField(id='0')
parent=UploadFileAttributesParentField(id='0')
)
files: File = client.uploads.upload_file(attributes=attrs, file=open('filename.txt', 'rb'))
file = files.entries[0]
files: Files = client.uploads.upload_file(attributes=attrs, file=open('filename.txt', 'rb'))
file: File = files.entries[0]
print(f'File uploaded with id {file.id}, name {file.name}')
```
Loading