# -*- coding: utf-8 -*-
# This file is auto-generated, don't edit it. Thanks.
from __future__ import annotations

from darabonba.model import DaraModel

class SetDomainCertificateRequest(DaraModel):
    def __init__(
        self,
        ca_certificate_body: str = None,
        certificate_body: str = None,
        certificate_name: str = None,
        certificate_private_key: str = None,
        client_cert_sdn_pass_through: bool = None,
        domain_name: str = None,
        group_id: str = None,
        security_token: str = None,
        ssl_ocsp_cache_enable: bool = None,
        ssl_ocsp_enable: bool = None,
        ssl_verify_depth: str = None,
    ):
        # The content of the CA certificate.
        self.ca_certificate_body = ca_certificate_body
        # The content of the certificate.
        self.certificate_body = certificate_body
        # The name of the SSL certificate.
        # 
        # This parameter is required.
        self.certificate_name = certificate_name
        # The private key of the SSL certificate.
        self.certificate_private_key = certificate_private_key
        # If pass ssl_client_s_dn of the cert to backend header \\"X-Client-S-Dn\\".
        self.client_cert_sdn_pass_through = client_cert_sdn_pass_through
        # The custom domain name.
        # 
        # This parameter is required.
        self.domain_name = domain_name
        # The ID of the API group. This ID is generated by the system and globally unique.
        # 
        # This parameter is required.
        self.group_id = group_id
        self.security_token = security_token
        # If enable ssl OCSP cache.
        self.ssl_ocsp_cache_enable = ssl_ocsp_cache_enable
        # If enable ssl OCSP.
        self.ssl_ocsp_enable = ssl_ocsp_enable
        # The certificate verification depth.
        self.ssl_verify_depth = ssl_verify_depth

    def validate(self):
        pass

    def to_map(self):
        result = dict()
        _map = super().to_map()
        if _map is not None:
            result = _map
        if self.ca_certificate_body is not None:
            result['CaCertificateBody'] = self.ca_certificate_body

        if self.certificate_body is not None:
            result['CertificateBody'] = self.certificate_body

        if self.certificate_name is not None:
            result['CertificateName'] = self.certificate_name

        if self.certificate_private_key is not None:
            result['CertificatePrivateKey'] = self.certificate_private_key

        if self.client_cert_sdn_pass_through is not None:
            result['ClientCertSDnPassThrough'] = self.client_cert_sdn_pass_through

        if self.domain_name is not None:
            result['DomainName'] = self.domain_name

        if self.group_id is not None:
            result['GroupId'] = self.group_id

        if self.security_token is not None:
            result['SecurityToken'] = self.security_token

        if self.ssl_ocsp_cache_enable is not None:
            result['SslOcspCacheEnable'] = self.ssl_ocsp_cache_enable

        if self.ssl_ocsp_enable is not None:
            result['SslOcspEnable'] = self.ssl_ocsp_enable

        if self.ssl_verify_depth is not None:
            result['SslVerifyDepth'] = self.ssl_verify_depth

        return result

    def from_map(self, m: dict = None):
        m = m or dict()
        if m.get('CaCertificateBody') is not None:
            self.ca_certificate_body = m.get('CaCertificateBody')

        if m.get('CertificateBody') is not None:
            self.certificate_body = m.get('CertificateBody')

        if m.get('CertificateName') is not None:
            self.certificate_name = m.get('CertificateName')

        if m.get('CertificatePrivateKey') is not None:
            self.certificate_private_key = m.get('CertificatePrivateKey')

        if m.get('ClientCertSDnPassThrough') is not None:
            self.client_cert_sdn_pass_through = m.get('ClientCertSDnPassThrough')

        if m.get('DomainName') is not None:
            self.domain_name = m.get('DomainName')

        if m.get('GroupId') is not None:
            self.group_id = m.get('GroupId')

        if m.get('SecurityToken') is not None:
            self.security_token = m.get('SecurityToken')

        if m.get('SslOcspCacheEnable') is not None:
            self.ssl_ocsp_cache_enable = m.get('SslOcspCacheEnable')

        if m.get('SslOcspEnable') is not None:
            self.ssl_ocsp_enable = m.get('SslOcspEnable')

        if m.get('SslVerifyDepth') is not None:
            self.ssl_verify_depth = m.get('SslVerifyDepth')

        return self

