# 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 Optional
from pydantic import BaseModel, Field, StrictStr

class V1SeccompProfile(BaseModel):
    """
    SeccompProfile defines a pod/container's seccomp profile settings. Only one profile source may be set.  # noqa: E501
    """
    localhost_profile: Optional[StrictStr] = Field(None, alias="localhostProfile", description="localhostProfile indicates a profile defined in a file on the node should be used. The profile must be preconfigured on the node to work. Must be a descending path, relative to the kubelet's configured seccomp profile location. Must be set if type is \"Localhost\". Must NOT be set for any other type.")
    type: StrictStr = Field(..., description="type indicates which kind of seccomp profile will be applied. Valid options are:  Localhost - a profile defined in a file on the node should be used. RuntimeDefault - the container runtime default profile should be used. Unconfined - no profile should be applied.")
    __properties = ["localhostProfile", "type"]

    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) -> V1SeccompProfile:
        """Create an instance of V1SeccompProfile 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) -> V1SeccompProfile:
        """Create an instance of V1SeccompProfile from a dict"""
        if obj is None:
            return None

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

        _obj = V1SeccompProfile.parse_obj({
            "localhost_profile": obj.get("localhostProfile"),
            "type": obj.get("type")
        })
        return _obj


