import type { Metadata } from "./Metadata";

export class Ingress
{
    constructor (
        public metadata: Metadata,
        public spec: IngressSpec
    ) { }
}

export class IngressSpec
{
    constructor (
        public ingressClassName: string,
        public rules: IngressRule[],
        public tls: IngressTLS[]
    ) { }
}

export class IngressRule
{
    constructor (
        public host: string,
        public http: IngressRuleHttp
    ) { }
}

export class IngressRuleHttp 
{
    constructor (
        public paths: IngressRulePath[]
    ) { }
}

export class IngressRulePath
{
    constructor (
        public path: string,
        public pathType: string,
        public backend: IngressRuleBackend
    ) { }
}

export class IngressRuleBackend
{
    constructor (
        public service: IngressRuleBackendService
    ) { }
}

export class IngressRuleBackendService
{
    constructor (
        public name: string
    ) { }
}

export class IngressTLS
{
    constructor (
        public hosts: string[],
        public secretName: string 
    ) {}
}