package com.l7tech.gateway.api;

import com.l7tech.gateway.api.impl.PrivateKeyExportResult;
import com.l7tech.gateway.api.impl.PrivateKeyGenerateCsrResult;
import com.l7tech.gateway.api.impl.PrivateKeySignCsrResult;
import com.l7tech.util.NonObfuscatable;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAnyElement;
import jakarta.xml.bind.annotation.XmlElementRef;
import jakarta.xml.bind.annotation.XmlElementRefs;
import jakarta.xml.bind.annotation.XmlElementWrapper;
import jakarta.xml.bind.annotation.XmlRootElement;
import jakarta.xml.bind.annotation.XmlType;

@XmlRootElement(name = "Item")
@XmlType(name = "ItemReferenceType", propOrder = {"name", "id", "type", "date", "links", "resourceList"})
@XmlAccessorType(XmlAccessType.PROPERTY)
public class Item<R> extends Reference<R> {
   Item() {
   }

   @XmlElementRefs(
      {
            @XmlElementRef(type = ActiveConnectorMO.class),
            @XmlElementRef(type = AssertionSecurityZoneMO.class),
            @XmlElementRef(type = TrustedCertificateMO.class),
            @XmlElementRef(type = CassandraConnectionMO.class),
            @XmlElementRef(type = ClusterPropertyMO.class),
            @XmlElementRef(type = CustomKeyValueStoreMO.class),
            @XmlElementRef(type = ResourceDocumentMO.class),
            @XmlElementRef(type = EmailListenerMO.class),
            @XmlElementRef(type = EncapsulatedAssertionMO.class),
            @XmlElementRef(type = FirewallRuleMO.class),
            @XmlElementRef(type = FolderMO.class),
            @XmlElementRef(type = GenericEntityMO.class),
            @XmlElementRef(type = HttpConfigurationMO.class),
            @XmlElementRef(type = IdentityProviderMO.class),
            @XmlElementRef(type = InterfaceTagMO.class),
            @XmlElementRef(type = JDBCConnectionMO.class),
            @XmlElementRef(type = JMSDestinationMO.class),
            @XmlElementRef(type = ListenPortMO.class),
            @XmlElementRef(type = PolicyAliasMO.class),
            @XmlElementRef(type = PolicyMO.class),
            @XmlElementRef(type = PolicyVersionMO.class),
            @XmlElementRef(type = PrivateKeyMO.class),
            @XmlElementRef(type = PrivateKeyExportResult.class),
            @XmlElementRef(type = PrivateKeyGenerateCsrResult.class),
            @XmlElementRef(type = PrivateKeySignCsrResult.class),
            @XmlElementRef(type = RevocationCheckingPolicyMO.class),
            @XmlElementRef(type = ServiceMO.class),
            @XmlElementRef(type = RbacRoleMO.class),
            @XmlElementRef(type = SampleMessageMO.class),
            @XmlElementRef(type = SiteMinderConfigurationMO.class),
            @XmlElementRef(type = StoredPasswordMO.class),
            @XmlElementRef(type = SecurityZoneMO.class),
            @XmlElementRef(type = ServiceAliasMO.class),
            @XmlElementRef(type = DependencyListMO.class),
            @XmlElementRef(type = Mappings.class),
            @XmlElementRef(type = ItemsList.class),
            @XmlElementRef(type = Bundle.class),
            @XmlElementRef(type = UserMO.class),
            @XmlElementRef(type = GroupMO.class),
            @XmlElementRef(type = CertificateData.class),
            @XmlElementRef(type = LogSinkMO.class),
            @XmlElementRef(type = ScheduledTaskMO.class),
            @XmlElementRef(type = ServerModuleFileMO.class),
            @XmlElementRef(type = PolicyBackedServiceMO.class),
            @XmlElementRef(type = SolutionKitMO.class),
            @XmlElementRef(type = AuditConfigurationMO.class)
      }
   )
   @XmlAnyElement(lax = true)
   @XmlElementWrapper(name = "Resource", required = false)
   @NonObfuscatable
   protected Object[] getResourceList() {
      return this.getContent() == null ? null : new Object[]{this.getContent()};
   }

   protected void setResourceList(Object[] var1) {
      this.setContent((R)(var1 != null && var1.length > 0 ? var1[0] : null));
   }
}
