Enums
Enums for Simplified API Requests and Response Handling
Within the StadataFlutter SDK, you'll find several enums designed to streamline API requests and facilitate the handling of API responses.
DataLanguage Enum
-
The
DataLanguageenum is used to specify the language (lang) parameter when making API requests. It offers two options:Enums Param Value Description Status DataLanguage.idindRepresents the Indonesian language. Default DataLanguage.enengRepresents the English language.
DomainType Enum
-
The
DomainTypeenum simplifies domain type (type) parameters forDomainmodels in API requests. It includes the following options:Enums Actual Value Description Status DomainType.allallRetrieve all domains, including provinces and regencies. Default DomainType.provinceprovRetrieve all province domains. DataLanguage.regencykabRetrieve all regency domains. DataLanguage.regencyByProvincekabbyprovRetrieve all regency domains within a specified province ID.
DataAvailability Enum
-
The
DataAvailabilityenum helps you check thedata-availabilitykey in API responses, making it easier to determine the availability of data. It includes the following options:Enums Actual Value Description DataAvailability.availableavailableIndicates that data is available. DataAvailability.listNotAvailablelist-not-availableIndicates that the list is not available. DataAvailability.notAvailablenot-availableIndicates that data is not available.
These enums serve as valuable tools to enhance the readability and manageability of your API-related code. Whether you're specifying language preferences, domain types, or checking data availability, these enums simplify the process and make your code more concise and expressive.