# Code generated by Lark OpenAPI.

from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init


class CustomMetricConfig(object):
    _types = {
        "default_formula_id": int,
        "least_metrics_size": int,
        "add_metric_options": List[int],
    }

    def __init__(self, d=None):
        self.default_formula_id: Optional[int] = None
        self.least_metrics_size: Optional[int] = None
        self.add_metric_options: Optional[List[int]] = None
        init(self, d, self._types)

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


class CustomMetricConfigBuilder(object):
    def __init__(self) -> None:
        self._custom_metric_config = CustomMetricConfig()

    def default_formula_id(self, default_formula_id: int) -> "CustomMetricConfigBuilder":
        self._custom_metric_config.default_formula_id = default_formula_id
        return self

    def least_metrics_size(self, least_metrics_size: int) -> "CustomMetricConfigBuilder":
        self._custom_metric_config.least_metrics_size = least_metrics_size
        return self

    def add_metric_options(self, add_metric_options: List[int]) -> "CustomMetricConfigBuilder":
        self._custom_metric_config.add_metric_options = add_metric_options
        return self

    def build(self) -> "CustomMetricConfig":
        return self._custom_metric_config
