# 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
from .update_role_assign_authorization_request_body import UpdateRoleAssignAuthorizationRequestBody


class UpdateRoleAssignAuthorizationRequest(BaseRequest):
    def __init__(self) -> None:
        super().__init__()
        self.employment_id: Optional[str] = None
        self.user_id_type: Optional[str] = None
        self.role_id: Optional[str] = None
        self.request_body: Optional[UpdateRoleAssignAuthorizationRequestBody] = None

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


class UpdateRoleAssignAuthorizationRequestBuilder(object):

    def __init__(self) -> None:
        update_role_assign_authorization_request = UpdateRoleAssignAuthorizationRequest()
        update_role_assign_authorization_request.http_method = HttpMethod.POST
        update_role_assign_authorization_request.uri = "/open-apis/corehr/v1/authorizations/update_role_assign"
        update_role_assign_authorization_request.token_types = {AccessTokenType.TENANT}
        self._update_role_assign_authorization_request: UpdateRoleAssignAuthorizationRequest = update_role_assign_authorization_request

    def employment_id(self, employment_id: str) -> "UpdateRoleAssignAuthorizationRequestBuilder":
        self._update_role_assign_authorization_request.employment_id = employment_id
        self._update_role_assign_authorization_request.add_query("employment_id", employment_id)
        return self

    def user_id_type(self, user_id_type: str) -> "UpdateRoleAssignAuthorizationRequestBuilder":
        self._update_role_assign_authorization_request.user_id_type = user_id_type
        self._update_role_assign_authorization_request.add_query("user_id_type", user_id_type)
        return self

    def role_id(self, role_id: str) -> "UpdateRoleAssignAuthorizationRequestBuilder":
        self._update_role_assign_authorization_request.role_id = role_id
        self._update_role_assign_authorization_request.add_query("role_id", role_id)
        return self

    def request_body(self,
                     request_body: UpdateRoleAssignAuthorizationRequestBody) -> "UpdateRoleAssignAuthorizationRequestBuilder":
        self._update_role_assign_authorization_request.request_body = request_body
        self._update_role_assign_authorization_request.body = request_body
        return self

    def build(self) -> UpdateRoleAssignAuthorizationRequest:
        return self._update_role_assign_authorization_request
