# coding: utf-8

"""
    HashiCorp Vault API

    HTTP API that gives you full access to Vault. All API routes are prefixed with `/v1/`.

    The version of the OpenAPI document: 1.15.0
    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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class PkiConfigureAutoTidyResponse(BaseModel):
    """
    PkiConfigureAutoTidyResponse
    """ # noqa: E501
    acme_account_safety_buffer: Optional[StrictInt] = Field(default=None, description="Safety buffer after creation after which accounts lacking orders are revoked")
    enabled: Optional[StrictBool] = Field(default=None, description="Specifies whether automatic tidy is enabled or not")
    interval_duration: Optional[StrictInt] = Field(default=None, description="Specifies the duration between automatic tidy operation")
    issuer_safety_buffer: Optional[StrictInt] = Field(default=None, description="Issuer safety buffer")
    maintain_stored_certificate_counts: Optional[StrictBool] = None
    pause_duration: Optional[StrictStr] = Field(default=None, description="Duration to pause between tidying certificates")
    publish_stored_certificate_count_metrics: Optional[StrictBool] = None
    revocation_queue_safety_buffer: Optional[StrictInt] = None
    safety_buffer: Optional[StrictInt] = Field(default=None, description="Safety buffer time duration")
    tidy_acme: Optional[StrictBool] = Field(default=None, description="Tidy Unused Acme Accounts, and Orders")
    tidy_cert_store: Optional[StrictBool] = Field(default=None, description="Specifies whether to tidy up the certificate store")
    tidy_cross_cluster_revoked_certs: Optional[StrictBool] = Field(default=None, description="Tidy the cross-cluster revoked certificate store")
    tidy_expired_issuers: Optional[StrictBool] = Field(default=None, description="Specifies whether tidy expired issuers")
    tidy_move_legacy_ca_bundle: Optional[StrictBool] = None
    tidy_revocation_queue: Optional[StrictBool] = None
    tidy_revoked_cert_issuer_associations: Optional[StrictBool] = Field(default=None, description="Specifies whether to associate revoked certificates with their corresponding issuers")
    tidy_revoked_certs: Optional[StrictBool] = Field(default=None, description="Specifies whether to remove all invalid and expired certificates from storage")
    __properties: ClassVar[List[str]] = ["acme_account_safety_buffer", "enabled", "interval_duration", "issuer_safety_buffer", "maintain_stored_certificate_counts", "pause_duration", "publish_stored_certificate_count_metrics", "revocation_queue_safety_buffer", "safety_buffer", "tidy_acme", "tidy_cert_store", "tidy_cross_cluster_revoked_certs", "tidy_expired_issuers", "tidy_move_legacy_ca_bundle", "tidy_revocation_queue", "tidy_revoked_cert_issuer_associations", "tidy_revoked_certs"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


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

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

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

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of PkiConfigureAutoTidyResponse from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "acme_account_safety_buffer": obj.get("acme_account_safety_buffer"),
            "enabled": obj.get("enabled"),
            "interval_duration": obj.get("interval_duration"),
            "issuer_safety_buffer": obj.get("issuer_safety_buffer"),
            "maintain_stored_certificate_counts": obj.get("maintain_stored_certificate_counts"),
            "pause_duration": obj.get("pause_duration"),
            "publish_stored_certificate_count_metrics": obj.get("publish_stored_certificate_count_metrics"),
            "revocation_queue_safety_buffer": obj.get("revocation_queue_safety_buffer"),
            "safety_buffer": obj.get("safety_buffer"),
            "tidy_acme": obj.get("tidy_acme"),
            "tidy_cert_store": obj.get("tidy_cert_store"),
            "tidy_cross_cluster_revoked_certs": obj.get("tidy_cross_cluster_revoked_certs"),
            "tidy_expired_issuers": obj.get("tidy_expired_issuers"),
            "tidy_move_legacy_ca_bundle": obj.get("tidy_move_legacy_ca_bundle"),
            "tidy_revocation_queue": obj.get("tidy_revocation_queue"),
            "tidy_revoked_cert_issuer_associations": obj.get("tidy_revoked_cert_issuer_associations"),
            "tidy_revoked_certs": obj.get("tidy_revoked_certs")
        })
        return _obj


