# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.model import BaseRequest
from lark_oapi.core.enum import HttpMethod, AccessTokenType


class ListApplicationRequest(BaseRequest):
    def __init__(self) -> None:
        super().__init__()
        self.page_size: Optional[int] = None
        self.page_token: Optional[str] = None
        self.user_id_type: Optional[str] = None
        self.lang: Optional[str] = None
        self.status: Optional[int] = None
        self.payment_type: Optional[int] = None
        self.owner_type: Optional[int] = None

    @staticmethod
    def builder() -> "ListApplicationRequestBuilder":
        return ListApplicationRequestBuilder()


class ListApplicationRequestBuilder(object):

    def __init__(self) -> None:
        list_application_request = ListApplicationRequest()
        list_application_request.http_method = HttpMethod.GET
        list_application_request.uri = "/open-apis/application/v6/applications"
        list_application_request.token_types = {AccessTokenType.TENANT}
        self._list_application_request: ListApplicationRequest = list_application_request

    def page_size(self, page_size: int) -> "ListApplicationRequestBuilder":
        self._list_application_request.page_size = page_size
        self._list_application_request.add_query("page_size", page_size)
        return self

    def page_token(self, page_token: str) -> "ListApplicationRequestBuilder":
        self._list_application_request.page_token = page_token
        self._list_application_request.add_query("page_token", page_token)
        return self

    def user_id_type(self, user_id_type: str) -> "ListApplicationRequestBuilder":
        self._list_application_request.user_id_type = user_id_type
        self._list_application_request.add_query("user_id_type", user_id_type)
        return self

    def lang(self, lang: str) -> "ListApplicationRequestBuilder":
        self._list_application_request.lang = lang
        self._list_application_request.add_query("lang", lang)
        return self

    def status(self, status: int) -> "ListApplicationRequestBuilder":
        self._list_application_request.status = status
        self._list_application_request.add_query("status", status)
        return self

    def payment_type(self, payment_type: int) -> "ListApplicationRequestBuilder":
        self._list_application_request.payment_type = payment_type
        self._list_application_request.add_query("payment_type", payment_type)
        return self

    def owner_type(self, owner_type: int) -> "ListApplicationRequestBuilder":
        self._list_application_request.owner_type = owner_type
        self._list_application_request.add_query("owner_type", owner_type)
        return self

    def build(self) -> ListApplicationRequest:
        return self._list_application_request
