# generated by datamodel-codegen:
#   filename:  epdx.schema.json
#   timestamp: 2024-02-16T08:04:39+00:00

from __future__ import annotations

from datetime import datetime
from enum import Enum
from typing import Any, Dict, List, Optional

from pydantic import BaseModel, conint


class ImpactCategory(BaseModel):
    a1a3: Optional[float] = None
    a4: Optional[float] = None
    a5: Optional[float] = None
    b1: Optional[float] = None
    b2: Optional[float] = None
    b3: Optional[float] = None
    b4: Optional[float] = None
    b5: Optional[float] = None
    b6: Optional[float] = None
    b7: Optional[float] = None
    c1: Optional[float] = None
    c2: Optional[float] = None
    c3: Optional[float] = None
    c4: Optional[float] = None
    d: Optional[float] = None


class Source(BaseModel):
    name: str
    url: Optional[str] = None


class Standard(Enum):
    EN15804A1 = 'EN15804A1'
    EN15804A2 = 'EN15804A2'
    UNKNOWN = 'UNKNOWN'


class SubType(Enum):
    Generic = 'Generic'
    Specific = 'Specific'
    Industry = 'Industry'
    Representative = 'Representative'


class Unit(Enum):
    M = 'M'
    M2 = 'M2'
    M3 = 'M3'
    KG = 'KG'
    TONES = 'TONES'
    PCS = 'PCS'
    L = 'L'
    M2R1 = 'M2R1'
    KM = 'KM'
    TONES_KM = 'TONES_KM'
    UNKNOWN = 'UNKNOWN'


class Conversion(BaseModel):
    meta_data: str
    to: Unit
    value: float


class EPD(BaseModel):
    adpe: Optional[ImpactCategory] = None
    adpf: Optional[ImpactCategory] = None
    ap: Optional[ImpactCategory] = None
    comment: Optional[str] = None
    conversions: Optional[List[Conversion]] = None
    cru: Optional[ImpactCategory] = None
    declared_unit: Unit
    eee: Optional[ImpactCategory] = None
    eet: Optional[ImpactCategory] = None
    ep: Optional[ImpactCategory] = None
    format_version: str
    fw: Optional[ImpactCategory] = None
    gwp: Optional[ImpactCategory] = None
    hwd: Optional[ImpactCategory] = None
    id: str
    location: str
    mer: Optional[ImpactCategory] = None
    meta_data: Optional[Dict[str, Any]] = None
    mfr: Optional[ImpactCategory] = None
    name: str
    nhwd: Optional[ImpactCategory] = None
    nrsf: Optional[ImpactCategory] = None
    odp: Optional[ImpactCategory] = None
    penre: Optional[ImpactCategory] = None
    penrm: Optional[ImpactCategory] = None
    penrt: Optional[ImpactCategory] = None
    pere: Optional[ImpactCategory] = None
    perm: Optional[ImpactCategory] = None
    pert: Optional[ImpactCategory] = None
    pocp: Optional[ImpactCategory] = None
    published_date: datetime
    reference_service_life: Optional[conint(ge=0)] = None
    rsf: Optional[ImpactCategory] = None
    rwd: Optional[ImpactCategory] = None
    sm: Optional[ImpactCategory] = None
    source: Optional[Source] = None
    standard: Standard
    subtype: SubType
    valid_until: datetime
    version: str
