# Models

## The errorMessage object

```json
{"openapi":"3.0.0","info":{"title":"Country Service","version":"0.0.1"},"components":{"schemas":{"errorMessage":{"title":"Error","description":"Schema for API specified errors.","type":"object","properties":{"status":{"description":"Original HTTP error reason.","type":"string"},"code":{"description":"Original HTTP error code, should be consistent with the response HTTP code.","type":"integer"},"message":{"description":"Descriptive error message for debugging.","type":"string"},"details":{"description":"List of problems causing this error.","type":"array","items":{"title":"Error Detail","description":"Schema for specific error cause.","type":"string"}}},"required":["status","code"]}}}}
```

## The metadata object

```json
{"openapi":"3.0.0","info":{"title":"Country Service","version":"0.0.1"},"components":{"schemas":{"metadata":{"type":"object","properties":{"createdAt":{"description":"Date and time when the document was created.","type":"string"},"modifiedAt":{"description":"Date and time when the document was last modified.","type":"string"},"version":{"minimum":1,"type":"integer","description":"Version of the document."}},"required":["createdAt","modifiedAt","version"]}}}}
```

## The country object

```json
{"openapi":"3.0.0","info":{"title":"Country Service","version":"0.0.1"},"components":{"schemas":{"country":{"title":"Country","type":"object","properties":{"code":{"type":"string","description":"The country code which consists of two capital letters and is compliant with ISO-3166-1 specification."},"name":{"description":"Localized name of the country. The value is returned as a map where the key is a language code and the value is a translation for the given language.","type":"object","additionalProperties":{"type":"string"}},"regions":{"type":"array","description":"A list of regions to which the given country belongs to.","items":{"type":"string"}},"active":{"type":"boolean","description":"The field indicating whether the given country is active for the tenant or not. Only active countries are visible in the system."},"metadata":{"$ref":"#/components/schemas/metadata"}}},"metadata":{"type":"object","properties":{"createdAt":{"description":"Date and time when the document was created.","type":"string"},"modifiedAt":{"description":"Date and time when the document was last modified.","type":"string"},"version":{"minimum":1,"type":"integer","description":"Version of the document."}},"required":["createdAt","modifiedAt","version"]}}}}
```

## The region object

```json
{"openapi":"3.0.0","info":{"title":"Country Service","version":"0.0.1"},"components":{"schemas":{"region":{"title":"Region","type":"object","properties":{"code":{"type":"string","description":"The region code."},"name":{"description":"The localized name of the region. The value is returned as a map where the key is a language code and the value is a translation for the given language.","type":"object","additionalProperties":{"type":"string"}},"metadata":{"$ref":"#/components/schemas/metadata"}}},"metadata":{"type":"object","properties":{"createdAt":{"description":"Date and time when the document was created.","type":"string"},"modifiedAt":{"description":"Date and time when the document was last modified.","type":"string"},"version":{"minimum":1,"type":"integer","description":"Version of the document."}},"required":["createdAt","modifiedAt","version"]}}}}
```

## The countryUpdate object

```json
{"openapi":"3.0.0","info":{"title":"Country Service","version":"0.0.1"},"components":{"schemas":{"countryUpdate":{"title":"Country update","type":"object","properties":{"active":{"type":"boolean","description":"The field indicates whether the given country is active for the tenant or not. Only active countries are visible in the system."},"metadata":{"type":"object","properties":{"version":{"type":"number","description":"Version of the document. The version is used for optimistic locking mechanism during the update request."}},"required":["version"]}},"required":["metadata"]}}}}
```
