from typing import Optional

from clarabot_testing.common.gql import graphql_request_payload


def ref_mutation_create_new_id(type_: Optional[str] = None):
    return graphql_request_payload("mutation createNewId {", type=type_)


def ref_query_privy_rooms():
    return graphql_request_payload("query privyRooms {")


def ref_mutate_privy_setup(room_id: str, privy_setup_key: bytes, self_room_secret: bytes, privy_room_secret: bytes):
    return graphql_request_payload(
        "mutation setupPrivy {",
        roomId=room_id,
        privySetupKey=privy_setup_key,
        selfRoomSecret=self_room_secret,
        privyRoomSecret=privy_room_secret,
    )


def ref_mutate_privy_delete(room_id: str):
    return graphql_request_payload("mutation deletePrivy {", roomId=room_id)


SETUP_PRIVY_RESULT = {"data": {"setupPrivy": True}}
DELETE_PRIVY_RESULT = {"data": {"deletePrivy": True}}
