from __future__ import annotations

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

from ..client import Client

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

    def create(self, body: Any, *, query: Optional[Dict[str, Any]] = None):
        return self._client.request("POST", "/articles/create", query=query, body=body)

    def update(self, body: Any, *, query: Optional[Dict[str, Any]] = None):
        return self._client.request("PUT", "/articles/update", query=query, body=body)

    def archive(self, body: Any, *, query: Optional[Dict[str, Any]] = None):
        return self._client.request("PUT", "/articles/archive", query=query, body=body)

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

    def getAll(self, *, query: Optional[Dict[str, Any]] = None):
        return self._client.request("GET", "/articles/getAll", query=query, body=None)

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

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

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

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

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

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

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

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

    def search(self, *, query: Optional[Dict[str, Any]] = None):
        return self._client.request("GET", "/articles/search", query=query, body=None)

    def advanceSearch(self, *, query: Optional[Dict[str, Any]] = None):
        return self._client.request("GET", "/articles/advanceSearch", query=query, body=None)

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