The get_gtype field in property_typ_data is intended to specify an enum type for properties that are really defined as (u)int in the NMSetting class. Specifying get_gtype for properties that are already defined as enum in the NMSetting class is rejected as a runtime error. However, the error message doesn't explain the reason. Put a code comment explaining the reason.
Explaining it in a comment is actually enough because:
Anyway, the code that did this checks was very difficult to read, so let's take the opportunity to refactor it, with no functional changes.
Help to understand the error if it arises and improve code readability.
Please read https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/CONTRIBUTING.md before opening the merge request. In particular, check that: