# coding: utf-8
"""
    Snowflake Session API

    The Snowflake Session API is a REST API that you can use to query your current session properties.  # noqa: E501

    The version of the OpenAPI document: 0.0.1
    Contact: support@snowflake.com
    Generated by: https://openapi-generator.tech

    Do not edit this file manually.
"""

from __future__ import annotations
import pprint
import re  # noqa: F401
import json

from typing import Union

from pydantic import BaseModel, ConfigDict, Field, StrictStr

from typing import Any, ClassVar, Dict, List, Optional


class Parameter(BaseModel):

    name: StrictStr

    value: Optional[StrictStr] = None

    default_value: Optional[StrictStr] = Field(default=None,
                                               alias="defaultValue")

    data_type: Optional[StrictStr] = Field(default=None, alias="dataType")

    level: Optional[StrictStr] = None

    description: Optional[StrictStr] = None

    __properties = [
        "name", "value", "defaultValue", "dataType", "level", "description"
    ]

    class Config:
        populate_by_name = True
        validate_assignment = True

    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.dict(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        return json.dumps(self.to_dict())

    @classmethod
    def from_json(cls, json_str: str) -> Parameter:
        """Create an instance of Parameter from a JSON string"""
        return cls.from_dict(json.loads(json_str))

    def to_dict(self):
        """Returns the dictionary representation of the model using alias"""
        _dict = dict(
            self._iter(to_dict=True,
                       by_alias=True,
                       exclude={},
                       exclude_none=True))

        return _dict

    @classmethod
    def from_dict(cls, obj: dict) -> Parameter:
        """Create an instance of Parameter from a dict"""

        if obj is None:
            return None

        if type(obj) is not dict:
            return Parameter.parse_obj(obj)

        _obj = Parameter.parse_obj({
            "name": obj.get("name"),
            "value": obj.get("value"),
            "default_value": obj.get("defaultValue"),
            "data_type": obj.get("dataType"),
            "level": obj.get("level"),
            "description": obj.get("description"),
        })

        return _obj


from typing import Optional, List, Dict


class ParameterModel():

    def __init__(
        self,
        name: str,
        # optional properties
        value: Optional[str] = None,
        default_value: Optional[str] = None,
        data_type: Optional[str] = None,
        level: Optional[str] = None,
        description: Optional[str] = None,
    ):

        self.name = name
        self.value = value
        self.default_value = default_value
        self.data_type = data_type
        self.level = level
        self.description = description

    __properties = [
        "name", "value", "defaultValue", "dataType", "level", "description"
    ]

    def _to_model(self):
        return Parameter(
            name=self.name,
            value=self.value,
            default_value=self.default_value,
            data_type=self.data_type,
            level=self.level,
            description=self.description,
        )

    @classmethod
    def _from_model(cls, model) -> ParameterModel:
        return ParameterModel(
            name=model.name,
            value=model.value,
            default_value=model.default_value,
            data_type=model.data_type,
            level=model.level,
            description=model.description,
        )

    def to_dict(self):
        """Returns the dictionary representation of the model using alias"""
        return self._to_model().to_dict()

    @classmethod
    def from_dict(cls, obj: dict) -> ParameterModel:
        """Create an instance of Parameter from a dict"""
        return cls._from_model(Parameter.from_dict(obj))


Parameter._model_class = ParameterModel
