package com.l7tech.gateway.api;

import com.l7tech.gateway.api.impl.AccessorSupport;
import com.l7tech.gateway.api.impl.AttributeExtensibleType;
import com.l7tech.gateway.api.impl.ElementExtensionSupport;
import com.l7tech.gateway.api.impl.ManagedObjectReference;
import com.l7tech.gateway.api.impl.PropertiesMapType;
import jakarta.xml.bind.annotation.XmlAnyElement;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.util.List;
import java.util.Map;

@XmlRootElement(name = "TrustedCertificate")
@XmlType(name = "TrustedCertificateType", propOrder = {"nameValue", "certificateData", "properties", "trustedCertificateExtension", "extensions"})
@AccessorSupport.AccessibleResource(name = "trustedCertificates")
public class TrustedCertificateMO extends SecurityZoneableObject {
   private AttributeExtensibleType.AttributeExtensibleString h;
   private CertificateData i;
   private Map<String, Object> j;
   private TrustedCertificateMO.TrustedCertificateExtension k = new TrustedCertificateMO.TrustedCertificateExtension();

   public String getName() {
      return AttributeExtensibleType.get(this.h);
   }

   public void setName(String var1) {
      this.h = AttributeExtensibleType.set(this.h, var1);
   }

   @XmlElement(name = "CertificateData", required = true)
   public CertificateData getCertificateData() {
      return this.i;
   }

   public void setCertificateData(CertificateData var1) {
      this.i = var1;
   }

   public String getRevocationCheckingPolicyId() {
      return this.k.d == null ? null : this.k.d.getId();
   }

   public void setRevocationCheckingPolicyId(String var1) {
      this.k.d = var1 == null ? null : new ManagedObjectReference(RevocationCheckingPolicyMO.class, var1);
   }

   @XmlElement(name = "Properties")
   @XmlJavaTypeAdapter(PropertiesMapType.PropertiesMapTypeAdapter.class)
   public Map<String, Object> getProperties() {
      return this.j;
   }

   public void setProperties(Map<String, Object> var1) {
      this.j = var1;
   }

   @XmlElement(name = "Name", required = true)
   protected AttributeExtensibleType.AttributeExtensibleString getNameValue() {
      return this.h;
   }

   protected void setNameValue(AttributeExtensibleType.AttributeExtensibleString var1) {
      this.h = var1;
   }

   @XmlElement(name = "Extension")
   protected TrustedCertificateMO.TrustedCertificateExtension getTrustedCertificateExtension() {
      return this.k.d == null ? null : this.k;
   }

   protected void setTrustedCertificateExtension(TrustedCertificateMO.TrustedCertificateExtension var1) {
      this.k = var1 == null ? new TrustedCertificateMO.TrustedCertificateExtension() : var1;
   }

   @XmlAnyElement(lax = true)
   @Override
   protected List<Object> getExtensions() {
      return super.getExtensions();
   }

   TrustedCertificateMO() {
   }

   @XmlType(name = "TrustedCertificateExtensionType", propOrder = {"revocationCheckingPolicyReference", "extension", "extensions"})
   protected static class TrustedCertificateExtension extends ElementExtensionSupport {
      private ManagedObjectReference d;

      @XmlElement(name = "RevocationCheckingPolicyReference")
      protected ManagedObjectReference getRevocationCheckingPolicyReference() {
         return this.d;
      }

      protected void setRevocationCheckingPolicyReference(ManagedObjectReference var1) {
         this.d = var1;
      }
   }
}
