// SPDX-License-Identifier: Apache-2.0
import { V1ConfigMap, V1ObjectMeta } from '@kubernetes/client-node';
import { NamespaceName } from '../../../../../types/namespace/namespace-name.js';
export class K8ClientConfigMap {
    namespace;
    name;
    labels;
    data;
    constructor(namespace, name, labels, data) {
        this.namespace = namespace;
        this.name = name;
        this.labels = labels;
        this.data = data;
    }
    static fromV1ConfigMap(v1ConfigMap) {
        return new K8ClientConfigMap(NamespaceName.of(v1ConfigMap.metadata.namespace), v1ConfigMap.metadata.name, v1ConfigMap.metadata.labels, v1ConfigMap.data);
    }
    static toV1ConfigMap(configMap) {
        const v1ConfigMap = new V1ConfigMap();
        v1ConfigMap.metadata = new V1ObjectMeta();
        v1ConfigMap.metadata.name = configMap.name;
        v1ConfigMap.metadata.namespace = configMap.namespace.name;
        v1ConfigMap.metadata.labels = configMap.labels;
        v1ConfigMap.data = configMap.data;
        return v1ConfigMap;
    }
}
//# sourceMappingURL=k8-client-config-map.js.map