|
11 | 11 |
|
12 | 12 | - **Deleting Archived Items:** The SDK now supports deleting items from the archive. |
13 | 13 |
|
14 | | -### ⚠️ BREAKING CHANGES ⚠️ |
| 14 | +## ⚠️ BREAKING CHANGES ⚠️ |
| 15 | +This release contains breaking changes for two functions in the Go SDK. |
15 | 16 |
|
16 | | -This release contains a breaking change for the Python SDK. |
| 17 | +**Vault listing** |
17 | 18 |
|
18 | | -`items.list_all()` has changed to `items.list()` and the return type has also changed from SDKIterator[ItemOverview] to List[ItemOverview]. To migrate to the latest SDK version: |
19 | | - |
20 | | -Wherever you were using: |
| 19 | +* The function name has changed from `list_all` to `list`. To use this in your code, replace: |
21 | 20 | ```python |
22 | | -overviews = await client.items.list_all(vault_id) |
23 | | - |
24 | | -async for overview in overviews: |
25 | | - print(overview.ID) |
| 21 | +vaults = await client.vaults.list_all(vault_id) |
| 22 | +``` |
| 23 | +with |
| 24 | +```python |
| 25 | +vaults = await client.vaults.list(vault_id) |
26 | 26 | ``` |
27 | 27 |
|
28 | | -You must now use: |
| 28 | +* The return type of the vault listing function has changed from `*Iterator[VaultOverview]` to `[]VaultOverview`. To use this in your code, replace: |
29 | 29 |
|
| 30 | +```python |
| 31 | +async for vault in vaults: |
| 32 | + # using vault overview |
| 33 | +``` |
| 34 | +with |
| 35 | +```python |
| 36 | +for vault in vaults: |
| 37 | + # using vault overview |
| 38 | +``` |
| 39 | +**Item listing** |
| 40 | + |
| 41 | +* The function name has changed from `ListAll` to `List`. To use this in your code, replace: |
| 42 | +```python |
| 43 | +overviews = await client.items.list_all(vault_id) |
| 44 | +``` |
| 45 | +with: |
30 | 46 | ```python |
31 | 47 | overviews = await client.items.list(vault_id, ItemListFilter( |
32 | 48 | content=ItemListFilterByStateInner( |
33 | 49 | active=active, |
34 | 50 | archived=archived |
35 | 51 | ) |
36 | 52 | )) |
37 | | - |
38 | | -for overview in overviews: |
39 | | - print(overview.ID) |
40 | 53 | ``` |
41 | | -`vaults.list_all()` has changed to `vaults.list()` nd the return type has also changed from SDKIterator[VaultOverview] to List[VaultOverview]. To migrate to the latest SDK version: |
42 | 54 |
|
43 | | -Wherever you were using: |
| 55 | +* The return type of the item listing function has changed from `*Iterator[ItemOverview]` to `[]ItemOverview`. To use this in your code, replace: |
44 | 56 | ```python |
45 | | - vaults = await client.vaults.list_all() |
46 | | - async for vault in vaults: |
47 | | - print(vault.title) |
| 57 | +async for overview in overviews: |
| 58 | + # using item overview |
48 | 59 | ``` |
49 | | - |
50 | | -You must now use: |
| 60 | +with |
51 | 61 | ```python |
52 | | - vaults = await client.vaults.list() |
53 | | - for vault in vaults: |
54 | | - print(vault.title) |
| 62 | +for overview in overviews: |
| 63 | + # using item overview |
55 | 64 | ``` |
56 | 65 |
|
57 | 66 | This does not affect any code that's already deployed, and will not take effect in your codebase until updating to v0.3.0+ of the 1Password Python SDK. |
0 commit comments