Skip to content

Configuration

Environment selection used by the API client and validation helpers.

Environment

Parse and inspect

Parse environment values and resolve API base URLs.

EnvironmentType::from_str(env: &str) -> Result<EnvironmentType, EnvironmentParseError>
EnvironmentType::as_str(&self) -> &'static str
EnvironmentType::endpoint_url(&self) -> &'static str
Environment
FfiEnvironment

Args

  • env: non_production, simulation, or production.

Returns

  • EnvironmentType / Environment: parsed environment.
  • endpoint_url: base URL for ZATCA API.

Config

Create and read

Create config handles and read their environment.

Config::new(env: EnvironmentType) -> Config
Config::env(&self) -> EnvironmentType
Config::default() -> Config
Config(env: Environment = Environment.NON_PRODUCTION)
Config.env_value() -> Environment
Config.validate_xml(xml: str) -> bool
FfiConfig* fatoora_config_new(FfiEnvironment env);
FfiResult_FfiEnvironment fatoora_config_env(FfiConfig* config);
void fatoora_config_free(FfiConfig* config);

Args

  • env: target environment.
  • xml: invoice XML string (Python convenience).

Returns

  • Config / FfiConfig: environment-aware handle.
  • Environment: environment value from the handle.