Skip to content

Commit ff1c4b0

Browse files
Update core to version 8ba31b5b
1 parent c29275d commit ff1c4b0

File tree

12 files changed

+647
-13
lines changed

12 files changed

+647
-13
lines changed

src/onepassword/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from .secrets import Secrets
88
from .items import Items
99
from .vaults import Vaults
10+
from .groups import Groups
1011

1112

1213
import sys
@@ -18,6 +19,7 @@
1819
"Secrets",
1920
"Items",
2021
"Vaults",
22+
"Groups",
2123
"DEFAULT_INTEGRATION_NAME",
2224
"DEFAULT_INTEGRATION_VERSION",
2325
]

src/onepassword/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
from .secrets import Secrets
88
from .items import Items
99
from .vaults import Vaults
10+
from .groups import Groups
1011

1112

1213
class Client:
1314
secrets: Secrets
1415
items: Items
1516
vaults: Vaults
17+
groups: Groups
1618

1719
@classmethod
1820
async def authenticate(
@@ -31,6 +33,7 @@ async def authenticate(
3133
authenticated_client.secrets = Secrets(client_id)
3234
authenticated_client.items = Items(client_id)
3335
authenticated_client.vaults = Vaults(client_id)
36+
authenticated_client.groups = Groups(client_id)
3437
authenticated_client._finalizer = weakref.finalize(
3538
cls, _release_client, client_id
3639
)

src/onepassword/groups.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Code generated by op-codegen - DO NO EDIT MANUALLY
2+
3+
from .core import _invoke, _invoke_sync
4+
from typing import Optional, List
5+
from pydantic import TypeAdapter
6+
from .types import Group, GroupGetParams
7+
8+
9+
class Groups:
10+
"""
11+
The Groups API holds all the operations the SDK client can perform on 1Password groups.
12+
"""
13+
14+
def __init__(self, client_id):
15+
self.client_id = client_id
16+
17+
async def get(self, group_id: str, group_params: GroupGetParams) -> Group:
18+
response = await _invoke(
19+
{
20+
"invocation": {
21+
"clientId": self.client_id,
22+
"parameters": {
23+
"name": "GroupsGet",
24+
"parameters": {
25+
"group_id": group_id,
26+
"group_params": group_params.model_dump(by_alias=True),
27+
},
28+
},
29+
}
30+
}
31+
)
32+
33+
response = TypeAdapter(Group).validate_json(response)
34+
return response

0 commit comments

Comments
 (0)