Skip to content

Commit 9099ae8

Browse files
authored
docs: Documentation update for release 3.0.0 (#652)
1 parent 16ab086 commit 9099ae8

28 files changed

+325
-472
lines changed

HISTORY.rst

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,27 @@
33
Release History
44
---------------
55

6+
3.0.0 (2022-01-17)
7+
++++++++++++++++++++
8+
9+
**Breaking Changes**
10+
11+
- Drop support for python 2.7 (`#645 <https://github.com/box/box-python-sdk/pull/645>`_)
12+
- Add missing parameter stream_position to get_admin_events method (`#648 <https://github.com/box/box-python-sdk/pull/648>`_)
13+
- Drop support for python 3.5 (`#654 <https://github.com/box/box-python-sdk/pull/654>`_)
14+
- Remove deprecated code using insensitive language (`#651 <https://github.com/box/box-python-sdk/pull/651>`_)
15+
- Enforcing usage of keyword-only arguments in some functions (`#656 <https://github.com/box/box-python-sdk/pull/656>`_)
16+
17+
**New Features and Enhancements:**
18+
19+
- Remove six library and __future__ imports (`#646 <https://github.com/box/box-python-sdk/pull/646>`_)
20+
- Add type hints to method parameters (`#650 <https://github.com/box/box-python-sdk/pull/650>`_)
21+
22+
**Bug Fixes:**
23+
24+
- Add missing api_call decorators on multiput calls (`#653 <https://github.com/box/box-python-sdk/pull/653>`_)
25+
- Added `py.typed` file for mypy to recognise type hints (`#657 <https://github.com/box/box-python-sdk/pull/657>`_)
26+
627
2.14.0 (2021-12-08)
728
++++++++++++++++++++
829

docs/usage/authentication.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ auth = OAuth2(
8383
)
8484
client = Client(auth)
8585
me = client.user().get()
86-
print('My user ID is {0}'.format(me.id))
86+
print(f'My user ID is {me.id}')
8787
```
8888

8989
[dev_console]: https://app.box.com/developers/console
@@ -118,7 +118,7 @@ from boxsdk import JWTAuth, Client
118118
auth = JWTAuth.from_settings_file('/path/to/settings.json')
119119
client = Client(auth)
120120
service_account = client.user().get()
121-
print('Service Account user ID is {0}'.format(service_account.id))
121+
print(f'Service Account user ID is {service_account.id}')
122122
```
123123

124124
Otherwise, you'll need to provide the necessary configuration fields directly
@@ -262,7 +262,7 @@ oauth = OAuth2(
262262
client = Client(oauth)
263263

264264
user = client.user().get()
265-
print('User ID is {0}'.format(user.id))
265+
print(f'User ID is {user.id}')
266266
```
267267

268268
### Box View Authentication with App Tokens
@@ -330,7 +330,7 @@ This method returns a [`TokenResponse`][token_response] object with the downscop
330330
```python
331331
target_file = client.file(file_id='FILE_ID_HERE')
332332
token_info = client.downscope_token(['item_preview'], target_file)
333-
print('Got downscoped access token: {0}'.format(token_info.access_token))
333+
print(f'Got downscoped access token: {token_info.access_token}')
334334
```
335335

336336
[downscope_token]: https://box-python-sdk.readthedocs.io/en/latest/boxsdk.client.html#boxsdk.client.client.Client.downscope_token

docs/usage/classifications.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ Add another classification
6666

6767
To add another classification, call the
6868
[`template.start_update()`][start_update] API to start making changes to the
69-
template, and then call the [`template.update_info(updates)`][update_info]
69+
template, and then call the [`template.update_info(updates=new_updates)`][update_info]
7070
with the changes to apply to the template.
7171

7272
<!-- sample put_metadata_templates_enterprise_securityClassification-6VMVochwUWo_schema add -->
7373
```python
7474
template = client.metadata_template('enterprise', 'securityClassification-6VMVochwUWo')
75-
updates = template.start_update()
76-
updates.add_enum_option('Box__Security__Classification__Key', 'Sensitive')
77-
updated_template = template.update_info(updates)
75+
new_updates = template.start_update()
76+
new_updates.add_enum_option('Box__Security__Classification__Key', 'Sensitive')
77+
updated_template = template.update_info(updates=new_updates)
7878
```
7979

8080
[start_update]: https://box-python-sdk.readthedocs.io/en/latest/boxsdk.object.html#boxsdk.object.metadata_template.MetadataTemplate.start_update
@@ -85,31 +85,31 @@ Update a classification
8585

8686
To update a classification, call the
8787
[`template.start_update()`][start_update] API to start making changes to the
88-
template, and then call the [`template.update_info(updates)`][update_info]
88+
template, and then call the [`template.update_info(updates=new_updates)`][update_info]
8989
with the classification to change on the template.
9090

9191
<!-- sample put_metadata_templates_enterprise_securityClassification-6VMVochwUWo_schema update -->
9292
```python
9393
template = client.metadata_template('enterprise', 'securityClassification-6VMVochwUWo')
94-
updates = template.start_update()
95-
updates.edit_enum_option('Box__Security__Classification__Key', 'Sensitive', 'Very Sensitive')
96-
updated_template = template.update_info(updates)
94+
new_updates = template.start_update()
95+
new_updates.edit_enum_option('Box__Security__Classification__Key', 'Sensitive', 'Very Sensitive')
96+
updated_template = template.update_info(updates=new_updates)
9797
```
9898

9999
Delete a classification
100100
-----------------------
101101

102102
To delete a classification, call the
103103
[`template.start_update()`][start_update] API to start making changes to the
104-
template, and then call the [`template.update_info(updates)`][update_info]
104+
template, and then call the [`template.update_info(updates=new_updates)`][update_info]
105105
with the classification to remove from the template.
106106

107107
<!-- sample put_metadata_templates_enterprise_securityClassification-6VMVochwUWo_schema delete -->
108108
```python
109109
template = client.metadata_template('enterprise', 'securityClassification-6VMVochwUWo')
110-
updates = template.start_update()
111-
updates.remove_enum_option('Box__Security__Classification__Key', 'Sensitive')
112-
updated_template = template.update_info(updates)
110+
new_updates = template.start_update()
111+
new_updates.remove_enum_option('Box__Security__Classification__Key', 'Sensitive')
112+
updated_template = template.update_info(updates=new_updates)
113113
```
114114

115115
Delete all classifications

docs/usage/collaboration.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ collaboration = client.folder(folder_id='22222').collaborate(user, Collaboration
3737
collaborator = collaboration.accessible_by
3838
item = collaboration.item
3939
has_accepted = 'has' if collaboration.status == 'accepted' else 'has not'
40-
print('{0} {1} accepted the collaboration to folder "{2}"'.format(collaborator.name, has_accepted, item.name))
40+
print(f'{collaborator.name} {has_accepted} accepted the collaboration to folder "{item.name}"')
4141
```
4242

4343
Alternatively, you can also invite a user with their email address.
@@ -61,7 +61,7 @@ collaboration = client.folder(folder_id='22222').collaborate(group, Collaboratio
6161
collaborator = collaboration.accessible_by
6262
item = collaboration.item
6363
has_accepted = 'has' if collaboration.status == 'accepted' else 'has not'
64-
print('{0} {1} accepted the collaboration to folder "{2}"'.format(collaborator.name, has_accepted, item.name))
64+
print(f'{collaborator.name} {has_accepted} accepted the collaboration to folder "{item.name}"')
6565
```
6666

6767
> __Note:__ The `can_view_path` parameter is currently only available for collaborations on folders.
@@ -74,15 +74,15 @@ print('{0} {1} accepted the collaboration to folder "{2}"'.format(collaborator.n
7474
Edit a Collaboration
7575
--------------------
7676

77-
A collaboration can be edited by calling [`collaboration.update_info(role, status=None)`][update_info]. This method
77+
A collaboration can be edited by calling [`collaboration.update_info(*, role=None, status=None, **kwargs)`][update_info]. This method
7878
returns an updated [`Collaboration`][collaboration_class] object, leaving the original unmodified.
7979

8080
<!-- sample put_collaborations_id -->
8181
```python
8282
from boxsdk.object.collaboration import CollaborationRole, CollaborationStatus
8383

8484
collaboration = client.collaboration(collab_id='12345')
85-
updated_collaboration = collaboration.update_info(CollaborationRole.EDITOR)
85+
updated_collaboration = collaboration.update_info(role=CollaborationRole.EDITOR)
8686
```
8787

8888
[update_info]: https://box-python-sdk.readthedocs.io/en/latest/boxsdk.object.html#boxsdk.object.collaboration.Collaboration.update_info
@@ -128,15 +128,15 @@ To retrieve all collaborations on a specified [`Folder`][folder_class] or [`File
128128
collaborations = client.folder(folder_id='22222').get_collaborations()
129129
for collab in collaborations:
130130
target = collab.accessible_by
131-
print('{0} {1} is collaborated on the folder'.format(target.type.capitalize(), target.name))
131+
print(f'{target.type.capitalize()} {target.name} is collaborated on the folder')
132132
```
133133

134134
<!-- sample get_files_id_collaborations -->
135135
```python
136136
collaborations = client.file(file_id='11111').get_collaborations()
137137
for collab in collaborations
138138
target = collab.accessible_by
139-
print('{0} {1} is collaborated on the file'.format(target.type.capitalize(), target.name))
139+
print(f'{target.type.capitalize()} {target.name} is collaborated on the file')
140140
```
141141

142142
[folder_class]: https://box-python-sdk.readthedocs.io/en/latest/boxsdk.object.html#boxsdk.object.folder.Folder
@@ -155,7 +155,7 @@ can use to iterate over all pending [`Collaboration`][collaboration_class] objec
155155
```python
156156
pending_collaborations = client.get_pending_collaborations()
157157
for pending_collaboration in pending_collaborations:
158-
print('Collaboration {0} is pending'.format(pending_collaboration.id))
158+
print(f'Collaboration {pending_collaboration.id} is pending')
159159
```
160160

161161
[get_pending_collaborations]: https://box-python-sdk.readthedocs.io/en/latest/boxsdk.client.html#boxsdk.client.client.Client.get_pending_collaborations

docs/usage/collaboration_allowlist.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ objects in the collection.
3535
allowlist_entries = client.collaboration_allowlist().get_entries()
3636
for entry in allowlist_entries:
3737
direction = entry.direction if entry.direction != 'both' else 'bidirectional'
38-
print('Domain {0} is allowlisted for {1} collaboration'.format(entry.domain, direction))
38+
print(f'Domain {entry.domain} is allowlisted for {direction} collaboration')
3939
```
4040

4141
[get_entries]: https://box-python-sdk.readthedocs.io/en/latest/boxsdk.object.html#boxsdk.object.collaboration_allowlist.CollaborationAllowlist.get_entries
@@ -44,7 +44,7 @@ for entry in allowlist_entries:
4444
Get Information for Collaboration Allowlist Entry
4545
-------------------------------------------------
4646

47-
To get information about a collaboration allowlist entry, use [`collaboration_allowlist_entry.get(fields=None)`][get].
47+
To get information about a collaboration allowlist entry, use [`collaboration_allowlist_entry.get(*, fields=None, headers=None, **kwargs)`][get].
4848
This method returns a [`CollaborationAllowlistEntry`][entry_class] object with fields populated by data form the API.
4949

5050
<!-- sample get_collaboration_allowlist_entries_id -->
@@ -100,7 +100,7 @@ a `BoxObjectCollection` that allows you to iterate over each
100100
```python
101101
exemptions = client.collaboration_allowlist().get_exemptions()
102102
for exemption in exemptions:
103-
print('{0} (ID: {1}) is exempt from the collaboration allowlist'.format(exemption.user.name, exemption.user.id))
103+
print(f'{exemption.user.name} (ID: {exemption.user.id}) is exempt from the collaboration allowlist')
104104
```
105105

106106
[get_exemptions]: https://box-python-sdk.readthedocs.io/en/latest/boxsdk.object.html#boxsdk.object.collaboration_allowlist.CollaborationAllowlist.get_exemptions
@@ -109,8 +109,8 @@ for exemption in exemptions:
109109
Get Exempt User Information
110110
---------------------------
111111

112-
To get information about an exempted user, call [`collaboration_allowlist_exempt_target.get(fields=None)`][get]. This
113-
method will return a [`CollaborationAllowlistExemptTarget][exemption_class] with fields populated by data from the API.
112+
To get information about an exempted user, call [`collaboration_allowlist_exempt_target.get(*, fields=None, headers=None, **kwargs)`][get].
113+
This method will return a [`CollaborationAllowlistExemptTarget][exemption_class] with fields populated by data from the API.
114114

115115
<!-- sample get_collaboration_allowlist_exempt_targets_id -->
116116
```python

docs/usage/collaboration_whitelist (deprecated).md

Lines changed: 0 additions & 148 deletions
This file was deleted.

0 commit comments

Comments
 (0)