# 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 .query_metric_field_request_body import QueryMetricFieldRequestBody


class QueryMetricFieldRequest(BaseRequest):
    def __init__(self) -> None:
        super().__init__()
        self.request_body: Optional[QueryMetricFieldRequestBody] = None

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


class QueryMetricFieldRequestBuilder(object):

    def __init__(self) -> None:
        query_metric_field_request = QueryMetricFieldRequest()
        query_metric_field_request.http_method = HttpMethod.POST
        query_metric_field_request.uri = "/open-apis/performance/v2/metric_fields/query"
        query_metric_field_request.token_types = {AccessTokenType.TENANT}
        self._query_metric_field_request: QueryMetricFieldRequest = query_metric_field_request

    def request_body(self, request_body: QueryMetricFieldRequestBody) -> "QueryMetricFieldRequestBuilder":
        self._query_metric_field_request.request_body = request_body
        self._query_metric_field_request.body = request_body
        return self

    def build(self) -> QueryMetricFieldRequest:
        return self._query_metric_field_request
