# Code generated by op-codegen - DO NO EDIT MANUALLY

from .core import InnerClient
from pydantic import TypeAdapter
from .types import Group, GroupGetParams


class Groups:
    """
    The Groups API holds all the operations the SDK client can perform on 1Password groups.
    """

    def __init__(self, inner_client: InnerClient):
        self.inner_client = inner_client

    async def get(self, group_id: str, group_params: GroupGetParams) -> Group:
        """
        Get a group by its ID and parameters.
        """
        response = await self.inner_client.invoke(
            {
                "invocation": {
                    "clientId": self.inner_client.client_id,
                    "parameters": {
                        "name": "GroupsGet",
                        "parameters": {
                            "group_id": group_id,
                            "group_params": group_params.model_dump(by_alias=True),
                        },
                    },
                }
            }
        )

        response = TypeAdapter(Group).validate_json(response)
        return response
