# coding: utf-8

"""
    FactPulse REST API

     REST API for electronic invoicing in France: Factur-X, AFNOR PDP/PA, electronic signatures.  ## 🎯 Main Features  ### 📄 Factur-X Invoice Generation - **Formats**: XML only or PDF/A-3 with embedded XML - **Profiles**: MINIMUM, BASIC, EN16931, EXTENDED - **Standards**: EN 16931 (EU directive 2014/55), ISO 19005-3 (PDF/A-3), CII (UN/CEFACT) - **🆕 Simplified Format**: Generation from SIRET + auto-enrichment (Chorus Pro API + Business Search)  ### ✅ Validation and Compliance - **XML Validation**: Schematron (45 to 210+ rules depending on profile) - **PDF Validation**: PDF/A-3, Factur-X XMP metadata, electronic signatures - **VeraPDF**: Strict PDF/A validation (146+ ISO 19005-3 rules) - **Asynchronous Processing**: Celery support for heavy validations (VeraPDF)  ### 📡 AFNOR PDP/PA Integration (XP Z12-013) - **Flow Submission**: Send invoices to Partner Dematerialization Platforms - **Flow Search**: View submitted invoices - **Download**: Retrieve PDF/A-3 with XML - **Directory Service**: Company search (SIREN/SIRET) - **Multi-client**: Support for multiple PDP configs per user (stored credentials or zero-storage)  ### ✍️ PDF Electronic Signature - **Standards**: PAdES-B-B, PAdES-B-T (RFC 3161 timestamping), PAdES-B-LT (long-term archival) - **eIDAS Levels**: SES (self-signed), AdES (commercial CA), QES (QTSP) - **Validation**: Cryptographic integrity and certificate verification - **Certificate Generation**: Self-signed X.509 certificates for testing  ### 🔄 Asynchronous Processing - **Celery**: Asynchronous generation, validation and signing - **Polling**: Status tracking via `/tasks/{task_id}/status` - **No timeout**: Ideal for large files or heavy validations  ## 🔒 Authentication  All requests require a **JWT token** in the Authorization header: ``` Authorization: Bearer YOUR_JWT_TOKEN ```  ### How to obtain a JWT token?  #### 🔑 Method 1: `/api/token/` API (Recommended)  **URL:** `https://factpulse.fr/api/token/`  This method is **recommended** for integration in your applications and CI/CD workflows.  **Prerequisites:** Having set a password on your account  **For users registered via email/password:** - You already have a password, use it directly  **For users registered via OAuth (Google/GitHub):** - You must first set a password at: https://factpulse.fr/accounts/password/set/ - Once the password is created, you can use the API  **Request example:** ```bash curl -X POST https://factpulse.fr/api/token/ \\   -H \"Content-Type: application/json\" \\   -d '{     \"username\": \"your_email@example.com\",     \"password\": \"your_password\"   }' ```  **Optional `client_uid` parameter:**  To select credentials for a specific client (PA/PDP, Chorus Pro, signing certificates), add `client_uid`:  ```bash curl -X POST https://factpulse.fr/api/token/ \\   -H \"Content-Type: application/json\" \\   -d '{     \"username\": \"your_email@example.com\",     \"password\": \"your_password\",     \"client_uid\": \"550e8400-e29b-41d4-a716-446655440000\"   }' ```  The `client_uid` will be included in the JWT and allow the API to automatically use: - AFNOR/PDP credentials configured for this client - Chorus Pro credentials configured for this client - Electronic signature certificates configured for this client  **Response:** ```json {   \"access\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\",  // Access token (validity: 30 min)   \"refresh\": \"eyJ0eXAiOiJKV1QiLCJhbGc...\"  // Refresh token (validity: 7 days) } ```  **Advantages:** - ✅ Full automation (CI/CD, scripts) - ✅ Programmatic token management - ✅ Refresh token support for automatic access renewal - ✅ Easy integration in any language/tool  #### 🖥️ Method 2: Dashboard Generation (Alternative)  **URL:** https://factpulse.fr/api/dashboard/  This method is suitable for quick tests or occasional use via the graphical interface.  **How it works:** - Log in to the dashboard - Use the \"Generate Test Token\" or \"Generate Production Token\" buttons - Works for **all** users (OAuth and email/password), without requiring a password  **Token types:** - **Test Token**: 24h validity, 1000 calls/day quota (free) - **Production Token**: 7 days validity, quota based on your plan  **Advantages:** - ✅ Quick for API testing - ✅ No password required - ✅ Simple visual interface  **Disadvantages:** - ❌ Requires manual action - ❌ No refresh token - ❌ Less suited for automation  ### 📚 Full Documentation  For more information on authentication and API usage: https://factpulse.fr/documentation-api/     

    The version of the OpenAPI document: 1.0.0
    Contact: contact@factpulse.fr
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self


class CountryCode(str, Enum):
    """
    ISO 3166-1 alpha-2 country codes.  Complete list of country codes used in e-reporting and invoicing. Includes all EU member states, major trading partners, and territories.
    """

    """
    allowed enum values
    """
    AT = 'AT'
    BE = 'BE'
    BG = 'BG'
    HR = 'HR'
    CY = 'CY'
    CZ = 'CZ'
    DK = 'DK'
    EE = 'EE'
    FI = 'FI'
    FR = 'FR'
    DE = 'DE'
    GR = 'GR'
    HU = 'HU'
    IE = 'IE'
    IT = 'IT'
    LV = 'LV'
    LT = 'LT'
    LU = 'LU'
    MT = 'MT'
    NL = 'NL'
    PL = 'PL'
    PT = 'PT'
    RO = 'RO'
    SK = 'SK'
    SI = 'SI'
    ES = 'ES'
    SE = 'SE'
    IS = 'IS'
    LI = 'LI'
    NO = 'NO'
    CH = 'CH'
    GB = 'GB'
    AD = 'AD'
    MC = 'MC'
    SM = 'SM'
    VA = 'VA'
    AL = 'AL'
    BA = 'BA'
    BY = 'BY'
    MD = 'MD'
    ME = 'ME'
    MK = 'MK'
    RS = 'RS'
    RU = 'RU'
    UA = 'UA'
    XK = 'XK'
    TR = 'TR'
    GP = 'GP'
    MQ = 'MQ'
    GF = 'GF'
    RE = 'RE'
    YT = 'YT'
    PM = 'PM'
    BL = 'BL'
    MF = 'MF'
    WF = 'WF'
    PF = 'PF'
    NC = 'NC'
    TF = 'TF'
    US = 'US'
    CA = 'CA'
    MX = 'MX'
    BR = 'BR'
    AR = 'AR'
    CL = 'CL'
    CO = 'CO'
    PE = 'PE'
    VE = 'VE'
    EC = 'EC'
    BO = 'BO'
    PY = 'PY'
    UY = 'UY'
    CR = 'CR'
    PA = 'PA'
    DO = 'DO'
    CU = 'CU'
    PR = 'PR'
    JM = 'JM'
    HT = 'HT'
    TT = 'TT'
    CN = 'CN'
    JP = 'JP'
    KR = 'KR'
    KP = 'KP'
    TW = 'TW'
    HK = 'HK'
    MO = 'MO'
    IN = 'IN'
    PK = 'PK'
    BD = 'BD'
    LK = 'LK'
    NP = 'NP'
    TH = 'TH'
    VN = 'VN'
    MY = 'MY'
    SG = 'SG'
    ID = 'ID'
    PH = 'PH'
    MM = 'MM'
    KH = 'KH'
    LA = 'LA'
    BN = 'BN'
    TL = 'TL'
    AE = 'AE'
    SA = 'SA'
    QA = 'QA'
    KW = 'KW'
    BH = 'BH'
    OM = 'OM'
    YE = 'YE'
    IL = 'IL'
    PS = 'PS'
    JO = 'JO'
    LB = 'LB'
    SY = 'SY'
    IQ = 'IQ'
    IR = 'IR'
    AF = 'AF'
    ZA = 'ZA'
    EG = 'EG'
    MA = 'MA'
    DZ = 'DZ'
    TN = 'TN'
    LY = 'LY'
    NG = 'NG'
    KE = 'KE'
    GH = 'GH'
    CI = 'CI'
    SN = 'SN'
    CM = 'CM'
    ET = 'ET'
    TZ = 'TZ'
    UG = 'UG'
    RW = 'RW'
    MU = 'MU'
    MG = 'MG'
    AO = 'AO'
    MZ = 'MZ'
    ZW = 'ZW'
    BW = 'BW'
    NA = 'NA'
    GA = 'GA'
    CG = 'CG'
    CD = 'CD'
    ML = 'ML'
    BF = 'BF'
    NE = 'NE'
    TD = 'TD'
    SD = 'SD'
    SS = 'SS'
    ER = 'ER'
    DJ = 'DJ'
    SO = 'SO'
    AU = 'AU'
    NZ = 'NZ'
    FJ = 'FJ'
    PG = 'PG'
    SB = 'SB'
    VU = 'VU'
    WS = 'WS'
    TO = 'TO'
    KZ = 'KZ'
    UZ = 'UZ'
    TM = 'TM'
    KG = 'KG'
    TJ = 'TJ'
    AZ = 'AZ'
    AM = 'AM'
    GE = 'GE'
    MN = 'MN'

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Create an instance of CountryCode from a JSON string"""
        return cls(json.loads(json_str))


