// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use crate::ffi;
use glib::translate::*;

glib::wrapper! {
    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct CertificateInfo(Boxed<ffi::PopplerCertificateInfo>);

    match fn {
        copy => |ptr| ffi::poppler_certificate_info_copy(ptr),
        free => |ptr| ffi::poppler_certificate_info_free(ptr),
        type_ => || ffi::poppler_certificate_info_get_type(),
    }
}

impl CertificateInfo {
    #[doc(alias = "poppler_certificate_info_new")]
    pub fn new() -> CertificateInfo {
        unsafe { from_glib_full(ffi::poppler_certificate_info_new()) }
    }

    #[cfg(feature = "v23_8")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))]
    #[doc(alias = "poppler_certificate_info_get_expiration_time")]
    #[doc(alias = "get_expiration_time")]
    pub fn expiration_time(&self) -> Option<glib::DateTime> {
        unsafe {
            from_glib_none(ffi::poppler_certificate_info_get_expiration_time(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "poppler_certificate_info_get_id")]
    #[doc(alias = "get_id")]
    pub fn id(&self) -> Option<glib::GString> {
        unsafe { from_glib_none(ffi::poppler_certificate_info_get_id(self.to_glib_none().0)) }
    }

    #[cfg(feature = "v23_8")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))]
    #[doc(alias = "poppler_certificate_info_get_issuance_time")]
    #[doc(alias = "get_issuance_time")]
    pub fn issuance_time(&self) -> Option<glib::DateTime> {
        unsafe {
            from_glib_none(ffi::poppler_certificate_info_get_issuance_time(
                self.to_glib_none().0,
            ))
        }
    }

    #[cfg(feature = "v23_8")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))]
    #[doc(alias = "poppler_certificate_info_get_issuer_common_name")]
    #[doc(alias = "get_issuer_common_name")]
    pub fn issuer_common_name(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::poppler_certificate_info_get_issuer_common_name(
                self.to_glib_none().0,
            ))
        }
    }

    #[cfg(feature = "v23_8")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))]
    #[doc(alias = "poppler_certificate_info_get_issuer_email")]
    #[doc(alias = "get_issuer_email")]
    pub fn issuer_email(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::poppler_certificate_info_get_issuer_email(
                self.to_glib_none().0,
            ))
        }
    }

    #[cfg(feature = "v23_8")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))]
    #[doc(alias = "poppler_certificate_info_get_issuer_organization")]
    #[doc(alias = "get_issuer_organization")]
    pub fn issuer_organization(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::poppler_certificate_info_get_issuer_organization(
                self.to_glib_none().0,
            ))
        }
    }

    #[doc(alias = "poppler_certificate_info_get_subject_common_name")]
    #[doc(alias = "get_subject_common_name")]
    pub fn subject_common_name(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::poppler_certificate_info_get_subject_common_name(
                self.to_glib_none().0,
            ))
        }
    }

    #[cfg(feature = "v23_8")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))]
    #[doc(alias = "poppler_certificate_info_get_subject_email")]
    #[doc(alias = "get_subject_email")]
    pub fn subject_email(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::poppler_certificate_info_get_subject_email(
                self.to_glib_none().0,
            ))
        }
    }

    #[cfg(feature = "v23_8")]
    #[cfg_attr(docsrs, doc(cfg(feature = "v23_8")))]
    #[doc(alias = "poppler_certificate_info_get_subject_organization")]
    #[doc(alias = "get_subject_organization")]
    pub fn subject_organization(&self) -> Option<glib::GString> {
        unsafe {
            from_glib_none(ffi::poppler_certificate_info_get_subject_organization(
                self.to_glib_none().0,
            ))
        }
    }
}

#[cfg(feature = "v23_7")]
#[cfg_attr(docsrs, doc(cfg(feature = "v23_7")))]
impl Default for CertificateInfo {
    fn default() -> Self {
        Self::new()
    }
}
