Skip to content

Commit 121cadb

Browse files
Update core to version a892358e
1 parent e181f9e commit 121cadb

File tree

7 files changed

+7
-19
lines changed

7 files changed

+7
-19
lines changed

src/onepassword/items.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
from .core import _invoke
2-
import json
2+
from json import loads
33
from .types import Item
44

55

66
class Items:
7-
"""Contains all operations the SDK client can perform on 1Password items."""
8-
97
def __init__(self, client_id):
108
self.client_id = client_id
119

1210
async def create(self, item):
13-
"""Create a new item"""
1411
response = await _invoke(
1512
{
1613
"clientId": self.client_id,
@@ -22,28 +19,24 @@ async def create(self, item):
2219
},
2320
}
2421
)
25-
result = Item(**json.loads(response))
26-
return result
22+
return Item(**loads(response))
2723

2824
async def get(self, vault_id, item_id):
29-
"""Get an item by vault and item ID"""
3025
response = await _invoke(
3126
{
3227
"clientId": self.client_id,
3328
"invocation": {
3429
"name": "Get",
3530
"parameters": {
36-
"vault_id": vault_id,
3731
"item_id": item_id,
32+
"vault_id": vault_id,
3833
},
3934
},
4035
}
4136
)
42-
result = Item(**json.loads(response))
43-
return result
37+
return Item(**loads(response))
4438

4539
async def update(self, item):
46-
"""Update an existing item. Warning: Only text and concealed fields are currently supported. Other fields will be permanently lost when you update an item."""
4740
response = await _invoke(
4841
{
4942
"clientId": self.client_id,
@@ -55,19 +48,17 @@ async def update(self, item):
5548
},
5649
}
5750
)
58-
result = Item(**json.loads(response))
59-
return result
51+
return Item(**loads(response))
6052

6153
async def delete(self, vault_id, item_id):
62-
"""Delete an item. Warning: Information saved in fields other than text and concealed fields will be permanently lost."""
6354
await _invoke(
6455
{
6556
"clientId": self.client_id,
6657
"invocation": {
6758
"name": "Delete",
6859
"parameters": {
69-
"vault_id": vault_id,
7060
"item_id": item_id,
61+
"vault_id": vault_id,
7162
},
7263
},
7364
}
-7.92 MB
Binary file not shown.
59.9 KB
Binary file not shown.
-8.44 MB
Binary file not shown.
-480 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

src/onepassword/secrets.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,10 @@
33

44

55
class Secrets:
6-
"""Contains all operations the SDK client can perform on 1Password secrets."""
7-
86
def __init__(self, client_id):
97
self.client_id = client_id
108

119
async def resolve(self, secret_reference):
12-
"""Resolve the secret reference to a secret."""
1310
response = await _invoke(
1411
{
1512
"clientId": self.client_id,
@@ -21,4 +18,4 @@ async def resolve(self, secret_reference):
2118
},
2219
}
2320
)
24-
return loads(response)
21+
return str(loads(response))

0 commit comments

Comments
 (0)