Skip to content

Commit d610b85

Browse files
committed
Add group get example
1 parent dcd5939 commit d610b85

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

example/desktop_app.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ async def main():
1313
# Connects to the 1Password desktop app.
1414
client = await Client.authenticate(
1515
auth=DesktopAuth(
16-
account_name="Happy Company" # Set to your 1Password account name.
16+
account_name="YourAccountNameAsShownInTheDesktopApp" # Set to your 1Password account name.
1717
),
1818
# Set the following to your own integration name and version.
1919
integration_name="My 1Password Integration",
@@ -123,6 +123,16 @@ async def main():
123123
print("Deleted item {}".format(id))
124124
# [developer-docs.sdk.python.batch-delete-items]-end
125125

126+
group_id = os.environ.get("OP_GROUP_ID")
127+
if group_id is None:
128+
raise Exception("OP_GROUP_ID is required")
129+
130+
# [developer-docs.sdk.python.get-group]-start
131+
# Get a group
132+
group = await client.groups.get(group_id, GroupGetParams(vaultPermissions=False))
133+
print(group)
134+
# [developer-docs.sdk.python.get-group]-end
135+
126136

127137
if __name__ == "__main__":
128138
asyncio.run(main())

0 commit comments

Comments
 (0)