magento2 – How to identify if region_id or region (region_name) is required?

I am creating the client's address in Magento 2 programmatically.

In a few countries, region_id It is required, which can be obtained from the model. Magento Directory Model Region, for example forWE country and in a few countries the region It is required to be a text field, for example for Italy country.

How to identify if region_id is required or region (region_name) is mandatory for the country?