In this section, we will create the models that our app will translate the Weather API models into. Let's start by adding the WeatherData class (unless you created this manually in the preceding section):
- Create a new folder called Models in the Weather project.
- Add a new file called WeatherData.
- Paste or write the code for the classes based on the JSON. If code other than the properties is generated, ignore it and just use the properties.
- Rename MainClass (this is what quicktype names the root object) WeatherData.
Now, we will create models based on the data we are interested in. This will make the rest of the code more loosely coupled to the data source.