from __future__ import annotations

import urllib.parse
from typing import Any, Dict, Optional

from ..client import Client

class FormSubmissionsResource:
    def __init__(self, client: Client) -> None:
        self._client = client

    def idSubmit(self, id, body: Any, *, query: Optional[Dict[str, Any]] = None):
        return self._client.request("POST", "/forms/" + urllib.parse.quote(str(id)) + "/submit", query=query, body=body)

    def idGetAllSubmissions(self, id, *, query: Optional[Dict[str, Any]] = None):
        return self._client.request("GET", "/forms/" + urllib.parse.quote(str(id)) + "/getAllSubmissions", query=query, body=None)

    def getSubmissionById(self, id, *, query: Optional[Dict[str, Any]] = None):
        return self._client.request("GET", "/forms/getSubmissionById/" + urllib.parse.quote(str(id)), query=query, body=None)

    def submissionUpdateId(self, id, body: Any, *, query: Optional[Dict[str, Any]] = None):
        return self._client.request("PUT", "/forms/submission/update/" + urllib.parse.quote(str(id)), query=query, body=body)

    def submissionDeleteId(self, id, *, query: Optional[Dict[str, Any]] = None):
        return self._client.request("DELETE", "/forms/submission/delete/" + urllib.parse.quote(str(id)), query=query, body=None)
