Skip to content

Commit 743183c

Browse files
Update core to version e4366724
1 parent 1f09bb0 commit 743183c

File tree

13 files changed

+23
-1981
lines changed

13 files changed

+23
-1981
lines changed

src/onepassword/errors.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
import json
44

55

6+
class DesktopSessionExpiredException(Exception):
7+
def __init__(self, message):
8+
self.message = message
9+
super().__init__(self.message)
10+
11+
612
class RateLimitExceededException(Exception):
713
def __init__(self, message):
814
self.message = message
@@ -18,7 +24,9 @@ def raise_typed_exception(e: Exception):
1824
error_name = typed_error.get("name")
1925
message = typed_error.get("message")
2026

21-
if error_name == "RateLimitExceeded":
27+
if error_name == "DesktopSessionExpired":
28+
raise DesktopSessionExpiredException(message)
29+
elif error_name == "RateLimitExceeded":
2230
raise RateLimitExceededException(message)
2331
elif message is not None:
2432
raise Exception(message)

src/onepassword/items.py

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

33
from .core import _invoke, _invoke_sync
4-
from typing import Optional, List
4+
from typing import List
55
from pydantic import TypeAdapter
66
from .items_shares import ItemsShares
77
from .items_files import ItemsFiles
@@ -16,7 +16,6 @@ class Items:
1616
def __init__(self, client_id):
1717
self.client_id = client_id
1818
self.shares = ItemsShares(client_id)
19-
2019
self.files = ItemsFiles(client_id)
2120

2221
async def create(self, params: ItemCreateParams) -> Item:
@@ -40,7 +39,7 @@ async def create(self, params: ItemCreateParams) -> Item:
4039

4140
async def get(self, vault_id: str, item_id: str) -> Item:
4241
"""
43-
Get an item by vault and item ID
42+
Get an item by vault and item ID.
4443
"""
4544
response = await _invoke(
4645
{

src/onepassword/items_files.py

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

33
from .core import _invoke, _invoke_sync
4-
from typing import Optional, List
4+
from typing import List
55
from pydantic import TypeAdapter
66
from .types import DocumentCreateParams, FileAttributes, FileCreateParams, Item
77

@@ -12,7 +12,7 @@ def __init__(self, client_id):
1212

1313
async def attach(self, item: Item, file_params: FileCreateParams) -> Item:
1414
"""
15-
Attach files to Items
15+
Attach files to Items.
1616
"""
1717
response = await _invoke(
1818
{
@@ -34,7 +34,7 @@ async def attach(self, item: Item, file_params: FileCreateParams) -> Item:
3434

3535
async def read(self, vault_id: str, item_id: str, attr: FileAttributes) -> bytes:
3636
"""
37-
Read file content from the Item
37+
Read file content from the Item.
3838
"""
3939
response = await _invoke(
4040
{
@@ -57,7 +57,7 @@ async def read(self, vault_id: str, item_id: str, attr: FileAttributes) -> bytes
5757

5858
async def delete(self, item: Item, section_id: str, field_id: str) -> Item:
5959
"""
60-
Delete a field file from Item using the section and field IDs
60+
Delete a field file from Item using the section and field IDs.
6161
"""
6262
response = await _invoke(
6363
{
@@ -82,7 +82,7 @@ async def replace_document(
8282
self, item: Item, doc_params: DocumentCreateParams
8383
) -> Item:
8484
"""
85-
Replace the document file within a document item
85+
Replace the document file within a document item.
8686
"""
8787
response = await _invoke(
8888
{

src/onepassword/items_shares.py

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

33
from .core import _invoke, _invoke_sync
4-
from typing import Optional, List
4+
from typing import List
55
from pydantic import TypeAdapter
66
from .types import Item, ItemShareAccountPolicy, ItemShareParams, ValidRecipient
77

-14.4 MB
Binary file not shown.
-16.9 MB
Binary file not shown.

0 commit comments

Comments
 (0)