# coding: utf-8

"""
    Kubernetes

    No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)

    OpenAPI spec version: v1.8.2
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from pprint import pformat
from six import iteritems
import re


class V1alpha1AdmissionHookClientConfig(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    """


    """
    Attributes:
      swagger_types (dict): The key is attribute name
                            and the value is attribute type.
      attribute_map (dict): The key is attribute name
                            and the value is json key in definition.
    """
    swagger_types = {
        'ca_bundle': 'str',
        'service': 'V1alpha1ServiceReference'
    }

    attribute_map = {
        'ca_bundle': 'caBundle',
        'service': 'service'
    }

    def __init__(self, ca_bundle=None, service=None):
        """
        V1alpha1AdmissionHookClientConfig - a model defined in Swagger
        """

        self._ca_bundle = None
        self._service = None
        self.discriminator = None

        self.ca_bundle = ca_bundle
        self.service = service

    @property
    def ca_bundle(self):
        """
        Gets the ca_bundle of this V1alpha1AdmissionHookClientConfig.
        CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate. Required

        :return: The ca_bundle of this V1alpha1AdmissionHookClientConfig.
        :rtype: str
        """
        return self._ca_bundle

    @ca_bundle.setter
    def ca_bundle(self, ca_bundle):
        """
        Sets the ca_bundle of this V1alpha1AdmissionHookClientConfig.
        CABundle is a PEM encoded CA bundle which will be used to validate webhook's server certificate. Required

        :param ca_bundle: The ca_bundle of this V1alpha1AdmissionHookClientConfig.
        :type: str
        """
        if ca_bundle is None:
            raise ValueError("Invalid value for `ca_bundle`, must not be `None`")
        if ca_bundle is not None and not re.search('^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', ca_bundle):
            raise ValueError("Invalid value for `ca_bundle`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`")

        self._ca_bundle = ca_bundle

    @property
    def service(self):
        """
        Gets the service of this V1alpha1AdmissionHookClientConfig.
        Service is a reference to the service for this webhook. If there is only one port open for the service, that port will be used. If there are multiple ports open, port 443 will be used if it is open, otherwise it is an error. Required

        :return: The service of this V1alpha1AdmissionHookClientConfig.
        :rtype: V1alpha1ServiceReference
        """
        return self._service

    @service.setter
    def service(self, service):
        """
        Sets the service of this V1alpha1AdmissionHookClientConfig.
        Service is a reference to the service for this webhook. If there is only one port open for the service, that port will be used. If there are multiple ports open, port 443 will be used if it is open, otherwise it is an error. Required

        :param service: The service of this V1alpha1AdmissionHookClientConfig.
        :type: V1alpha1ServiceReference
        """
        if service is None:
            raise ValueError("Invalid value for `service`, must not be `None`")

        self._service = service

    def to_dict(self):
        """
        Returns the model properties as a dict
        """
        result = {}

        for attr, _ in iteritems(self.swagger_types):
            value = getattr(self, attr)
            if isinstance(value, list):
                result[attr] = list(map(
                    lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
                    value
                ))
            elif hasattr(value, "to_dict"):
                result[attr] = value.to_dict()
            elif isinstance(value, dict):
                result[attr] = dict(map(
                    lambda item: (item[0], item[1].to_dict())
                    if hasattr(item[1], "to_dict") else item,
                    value.items()
                ))
            else:
                result[attr] = value

        return result

    def to_str(self):
        """
        Returns the string representation of the model
        """
        return pformat(self.to_dict())

    def __repr__(self):
        """
        For `print` and `pprint`
        """
        return self.to_str()

    def __eq__(self, other):
        """
        Returns true if both objects are equal
        """
        if not isinstance(other, V1alpha1AdmissionHookClientConfig):
            return False

        return self.__dict__ == other.__dict__

    def __ne__(self, other):
        """
        Returns true if both objects are not equal
        """
        return not self == other
