Skip to content

Commit 78a809c

Browse files
Update core to version 6ce56b2f
1 parent dbc54b9 commit 78a809c

File tree

10 files changed

+22
-14
lines changed

10 files changed

+22
-14
lines changed

example/example.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ async def main():
172172
await client.items.delete(created_item.vault_id, updated_item.id)
173173
# [developer-docs.sdk.python.delete-item]-end
174174

175+
175176
## NOTE: this is in a separate function to avoid creating a new item
176177
## NOTE: just for the sake of archiving it. This is because the SDK
177178
## NOTE: only works with active items, so archiving and then deleting
@@ -207,14 +208,15 @@ async def share_item(client: Client, vault_id: str, item_id: str):
207208
item,
208209
policy,
209210
ItemShareParams(
210-
recipients = valid_recipients,
211-
expireAfter= ItemShareDuration.ONEHOUR,
212-
oneTimeOnly= False,
211+
recipients=valid_recipients,
212+
expireAfter=ItemShareDuration.ONEHOUR,
213+
oneTimeOnly=False,
213214
),
214215
)
215216

216217
print(share_link)
217218
# [developer-docs.sdk.python.item-share-create-share]-end
218219

220+
219221
if __name__ == "__main__":
220222
asyncio.run(main())

src/onepassword/items.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Code generated by op-codegen - DO NO EDIT MANUALLY
22

3-
from .core import _invoke
3+
from .core import _invoke, _invoke_sync
44
from .iterator import SDKIterator
5+
from typing import Optional, List
56
from pydantic import TypeAdapter
67
from .items_shares import ItemsShares
78
from .types import Item, ItemCreateParams, ItemOverview
@@ -73,7 +74,7 @@ async def put(self, item: Item) -> Item:
7374
response = TypeAdapter(Item).validate_json(response)
7475
return response
7576

76-
async def delete(self, vault_id: str, item_id: str):
77+
async def delete(self, vault_id: str, item_id: str) -> None:
7778
"""
7879
Delete an item.
7980
"""
@@ -91,7 +92,7 @@ async def delete(self, vault_id: str, item_id: str):
9192

9293
return None
9394

94-
async def archive(self, vault_id: str, item_id: str):
95+
async def archive(self, vault_id: str, item_id: str) -> None:
9596
"""
9697
Archive an item.
9798
"""
@@ -125,5 +126,5 @@ async def list_all(self, vault_id: str) -> SDKIterator[ItemOverview]:
125126
}
126127
)
127128

128-
response = TypeAdapter(list[ItemOverview]).validate_json(response)
129+
response = TypeAdapter(List[ItemOverview]).validate_json(response)
129130
return SDKIterator(response)

src/onepassword/items_shares.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Code generated by op-codegen - DO NO EDIT MANUALLY
22

3-
from .core import _invoke
3+
from .core import _invoke, _invoke_sync
4+
from .iterator import SDKIterator
5+
from typing import Optional, List
46
from pydantic import TypeAdapter
57
from .types import Item, ItemShareAccountPolicy, ItemShareParams, ValidRecipient
68

@@ -31,8 +33,8 @@ async def get_account_policy(
3133
return response
3234

3335
async def validate_recipients(
34-
self, policy: ItemShareAccountPolicy, recipients: list[str]
35-
) -> list[ValidRecipient]:
36+
self, policy: ItemShareAccountPolicy, recipients: List[str]
37+
) -> List[ValidRecipient]:
3638
"""
3739
Validate the recipients of an item sharing link.
3840
"""
@@ -51,7 +53,7 @@ async def validate_recipients(
5153
}
5254
)
5355

54-
response = TypeAdapter(list[ValidRecipient]).validate_json(response)
56+
response = TypeAdapter(List[ValidRecipient]).validate_json(response)
5557
return response
5658

5759
async def create(
8.38 KB
Binary file not shown.
236 KB
Binary file not shown.
-29.5 KB
Binary file not shown.
177 KB
Binary file not shown.
-141 KB
Binary file not shown.

src/onepassword/secrets.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Code generated by op-codegen - DO NO EDIT MANUALLY
22

33
from .core import _invoke, _invoke_sync
4+
from .iterator import SDKIterator
5+
from typing import Optional, List
46
from pydantic import TypeAdapter
57
from .types import GeneratePasswordResponse, PasswordRecipe
68

@@ -34,7 +36,7 @@ async def resolve(self, secret_reference: str) -> str:
3436
return response
3537

3638
@staticmethod
37-
def validate_secret_reference(secret_reference: str):
39+
def validate_secret_reference(secret_reference: str) -> None:
3840
"""
3941
Validate the secret reference to ensure there are no syntax errors.
4042
"""

0 commit comments

Comments
 (0)