package io.renren.modules.kubesphere.module.request;

import com.google.gson.annotations.SerializedName;

import java.util.List;

/**
 * @author chenrj
 * @email 1412736935@qq.com
 * @since 2021/8/14
 */
public class IngressesDryRunRequest {
    @SerializedName("apiVersion")
    private String apiVersion;
    @SerializedName("kind")
    private String kind;
    @SerializedName("metadata")
    private MetadataDTO metadata;
    @SerializedName("spec")
    private SpecDTO spec;

    public String getApiVersion() {
        return apiVersion;
    }

    public void setApiVersion(String apiVersion) {
        this.apiVersion = apiVersion;
    }

    public String getKind() {
        return kind;
    }

    public void setKind(String kind) {
        this.kind = kind;
    }

    public MetadataDTO getMetadata() {
        return metadata;
    }

    public void setMetadata(MetadataDTO metadata) {
        this.metadata = metadata;
    }

    public SpecDTO getSpec() {
        return spec;
    }

    public void setSpec(SpecDTO spec) {
        this.spec = spec;
    }

    public static class MetadataDTO {
        @SerializedName("namespace")
        private String namespace;
        @SerializedName("labels")
        private LabelsDTO labels;
        @SerializedName("name")
        private String name;
        @SerializedName("annotations")
        private AnnotationsDTO annotations;

        public String getNamespace() {
            return namespace;
        }

        public void setNamespace(String namespace) {
            this.namespace = namespace;
        }

        public LabelsDTO getLabels() {
            return labels;
        }

        public void setLabels(LabelsDTO labels) {
            this.labels = labels;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public AnnotationsDTO getAnnotations() {
            return annotations;
        }

        public void setAnnotations(AnnotationsDTO annotations) {
            this.annotations = annotations;
        }

        public static class LabelsDTO {
            @SerializedName("app.kubernetes.io/version")
            private String _$AppKubernetesIoVersion310; // FIXME check this code
            @SerializedName("app.kubernetes.io/name")
            private String _$AppKubernetesIoName298; // FIXME check this code

            public String get_$AppKubernetesIoVersion310() {
                return _$AppKubernetesIoVersion310;
            }

            public void set_$AppKubernetesIoVersion310(String _$AppKubernetesIoVersion310) {
                this._$AppKubernetesIoVersion310 = _$AppKubernetesIoVersion310;
            }

            public String get_$AppKubernetesIoName298() {
                return _$AppKubernetesIoName298;
            }

            public void set_$AppKubernetesIoName298(String _$AppKubernetesIoName298) {
                this._$AppKubernetesIoName298 = _$AppKubernetesIoName298;
            }
        }

        public static class AnnotationsDTO {
            @SerializedName("kubesphere.io/creator")
            private String _$KubesphereIoCreator285; // FIXME check this code

            public String get_$KubesphereIoCreator285() {
                return _$KubesphereIoCreator285;
            }

            public void set_$KubesphereIoCreator285(String _$KubesphereIoCreator285) {
                this._$KubesphereIoCreator285 = _$KubesphereIoCreator285;
            }
        }
    }

    public static class SpecDTO {
        @SerializedName("rules")
        private List<RulesDTO> rules;
        @SerializedName("tls")
        private List<?> tls;

        public List<RulesDTO> getRules() {
            return rules;
        }

        public void setRules(List<RulesDTO> rules) {
            this.rules = rules;
        }

        public List<?> getTls() {
            return tls;
        }

        public void setTls(List<?> tls) {
            this.tls = tls;
        }

        public static class RulesDTO {
            @SerializedName("protocol")
            private String protocol;
            @SerializedName("host")
            private String host;
            @SerializedName("http")
            private HttpDTO http;

            public String getProtocol() {
                return protocol;
            }

            public void setProtocol(String protocol) {
                this.protocol = protocol;
            }

            public String getHost() {
                return host;
            }

            public void setHost(String host) {
                this.host = host;
            }

            public HttpDTO getHttp() {
                return http;
            }

            public void setHttp(HttpDTO http) {
                this.http = http;
            }

            public static class HttpDTO {
                @SerializedName("paths")
                private List<PathsDTO> paths;

                public List<PathsDTO> getPaths() {
                    return paths;
                }

                public void setPaths(List<PathsDTO> paths) {
                    this.paths = paths;
                }

                public static class PathsDTO {
                    @SerializedName("path")
                    private String path;
                    @SerializedName("backend")
                    private BackendDTO backend;

                    public String getPath() {
                        return path;
                    }

                    public void setPath(String path) {
                        this.path = path;
                    }

                    public BackendDTO getBackend() {
                        return backend;
                    }

                    public void setBackend(BackendDTO backend) {
                        this.backend = backend;
                    }

                    public static class BackendDTO {
                        @SerializedName("serviceName")
                        private String serviceName;
                        @SerializedName("servicePort")
                        private int servicePort;

                        public String getServiceName() {
                            return serviceName;
                        }

                        public void setServiceName(String serviceName) {
                            this.serviceName = serviceName;
                        }

                        public int getServicePort() {
                            return servicePort;
                        }

                        public void setServicePort(int servicePort) {
                            this.servicePort = servicePort;
                        }
                    }
                }
            }
        }
    }
}
