# coding: utf-8

"""
    Kubernetes

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: release-1.29
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


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


from typing import List, Optional
from pydantic import BaseModel, Field, StrictStr, conlist

class V1CustomResourceDefinitionNames(BaseModel):
    """
    CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition  # noqa: E501
    """
    categories: Optional[conlist(StrictStr)] = Field(None, description="categories is a list of grouped resources this custom resource belongs to (e.g. 'all'). This is published in API discovery documents, and used by clients to support invocations like `kubectl get all`.")
    kind: StrictStr = Field(..., description="kind is the serialized kind of the resource. It is normally CamelCase and singular. Custom resource instances will use this value as the `kind` attribute in API calls.")
    list_kind: Optional[StrictStr] = Field(None, alias="listKind", description="listKind is the serialized kind of the list for this resource. Defaults to \"`kind`List\".")
    plural: StrictStr = Field(..., description="plural is the plural name of the resource to serve. The custom resources are served under `/apis/<group>/<version>/.../<plural>`. Must match the name of the CustomResourceDefinition (in the form `<names.plural>.<group>`). Must be all lowercase.")
    short_names: Optional[conlist(StrictStr)] = Field(None, alias="shortNames", description="shortNames are short names for the resource, exposed in API discovery documents, and used by clients to support invocations like `kubectl get <shortname>`. It must be all lowercase.")
    singular: Optional[StrictStr] = Field(None, description="singular is the singular name of the resource. It must be all lowercase. Defaults to lowercased `kind`.")
    __properties = ["categories", "kind", "listKind", "plural", "shortNames", "singular"]

    class Config:
        """Pydantic configuration"""
        allow_population_by_field_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) -> V1CustomResourceDefinitionNames:
        """Create an instance of V1CustomResourceDefinitionNames 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 = self.dict(by_alias=True,
                          exclude={
                          },
                          exclude_none=True)
        return _dict

    @classmethod
    def from_dict(cls, obj: dict) -> V1CustomResourceDefinitionNames:
        """Create an instance of V1CustomResourceDefinitionNames from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return V1CustomResourceDefinitionNames.parse_obj(obj)

        _obj = V1CustomResourceDefinitionNames.parse_obj({
            "categories": obj.get("categories"),
            "kind": obj.get("kind"),
            "list_kind": obj.get("listKind"),
            "plural": obj.get("plural"),
            "short_names": obj.get("shortNames"),
            "singular": obj.get("singular")
        })
        return _obj


