# API: Zonas

---

- [Index](#index)
- [Show](#show)
- [Store](#store)
- [Update](#update)
- [Destroy](#destroy)

<a name="index"></a>
## Index

### Endpoint
|Método|URI|Headers|
|:|:-|:|
|GET|`/zonas`|Default|

### Body
```json
Empty
```

### Responses
<larecipe-badge type="success" rounded><i class="fa fa-check" style="margin-right:9px"></i>200 - OK</larecipe-badge>
```json
[
    {
        "id": <id>,
        "propriedade_id": <propriedade_id>,
        "empresa_id": <empresa_id>,
        "identificacao": <identificacao>,
        "descricao": <descricao>,
        "center_lat": <center_lat>,
        "center_lng": <center_lng>,
        "area_polygon": [
            [
                <lat>,
                <lng>
            ],
            //...
        ],
        "profile_picture_file": <profile_picture_file>,
        "profile_picture_url": <profile_picture_url>
    }
    //...
]
```

<larecipe-badge type="danger" rounded><i class="fa fa-lock" style="margin-right:9px"></i>401 - Unauthorized</larecipe-badge>
```json
{
    "message": "Unauthenticated."
}
```

<a name="show"></a>
## Show

### Endpoint
|Método|URI|Headers|
|:|:-|:|
|GET|`/zonas`|Default|

### Body
```json
Empty
```

### Responses
<larecipe-badge type="success" rounded><i class="fa fa-check" style="margin-right:9px"></i>200 - OK</larecipe-badge>
```json
{
    "id": <id>,
    "propriedade_id": <propriedade_id>,
    "empresa_id": <empresa_id>,
    "identificacao": <identificacao>,
    "descricao": <descricao>,
    "center_lat": <center_lat>,
    "center_lng": <center_lng>,
    "area_polygon": [
        [
            <lat>,
            <lng>
        ],
        //...
    ],
    "profile_picture_file": <profile_picture_file>,
    "profile_picture_url": <profile_picture_url>
}
```

<larecipe-badge type="danger" rounded><i class="fa fa-lock" style="margin-right:9px"></i>401 - Unauthorized</larecipe-badge>
```json
{
    "message": "Unauthenticated."
}
```

<a name="store"></a>
## Store

### Endpoint
|Método|URI|Headers|
|:|:-|:|
|POST|`/zonas`|Default|

### Body
```json
{
    "propriedade_id": int,
    "identificacao": string,
    "descricao": string,
    "center_lat": double,
    "center_lng": double,
    "area_polygon": [
        [
            double, 
            double
        ], 
        //...
    ]
}
```

### Responses
<larecipe-badge type="success" rounded><i class="fa fa-check" style="margin-right:9px"></i>200 - OK</larecipe-badge>
```json
{
    "id": <id>,
    "propriedade_id": <propriedade_id>,
    "empresa_id": <empresa_id>,
    "identificacao": <identificacao>,
    "descricao": <descricao>,
    "center_lat": <center_lat>,
    "center_lng": <center_lng>,
    "area_polygon": [
        [
            <lat>,
            <lng>
        ],
        //...
    ],
    "profile_picture_file": <profile_picture_file>,
    "profile_picture_url": <profile_picture_url>
}
```

<larecipe-badge type="danger" rounded><i class="fa fa-lock" style="margin-right:9px"></i>401 - Unauthorized</larecipe-badge>
```json
{
    "message": "Unauthenticated."
}
```

<a name="update"></a>
## Update

### Endpoint
|Método|URI|Headers|
|:|:-|:|
|PUT|`/zonas/{zona}`|Default|

### Body
```json
{
    "propriedade_id": int,
    "identificacao": string,
    "descricao": string,
    "center_lat": double,
    "center_lng": double,
    "area_polygon": [
        [
            double, 
            double
        ], 
        //...
    ]
}
```

### Responses
<larecipe-badge type="success" rounded><i class="fa fa-check" style="margin-right:9px"></i>200 - OK</larecipe-badge>
```json
{
    "id": <id>,
    "propriedade_id": <propriedade_id>,
    "empresa_id": <empresa_id>,
    "identificacao": <identificacao>,
    "descricao": <descricao>,
    "center_lat": <center_lat>,
    "center_lng": <center_lng>,
    "area_polygon": [
        [
            <lat>,
            <lng>
        ],
        //...
    ],
    "profile_picture_file": <profile_picture_file>,
    "profile_picture_url": <profile_picture_url>
}
```

<larecipe-badge type="danger" rounded><i class="fa fa-lock" style="margin-right:9px"></i>401 - Unauthorized</larecipe-badge>
```json
{
    "message": "Unauthenticated."
}
```

<a name="destroy"></a>
## Destroy

### Endpoint
|Método|URI|Headers|
|:|:-|:|
|DELETE|`/zonas/{zona}`|Default|

### Body
```json
Empty
```

### Responses
<larecipe-badge type="success" rounded><i class="fa fa-check" style="margin-right:9px"></i>204 - No Content</larecipe-badge>
```json
Empty
```

<larecipe-badge type="danger" rounded><i class="fa fa-lock" style="margin-right:9px"></i>401 - Unauthorized</larecipe-badge>
```json
{
    "message": "Unauthenticated."
}
```