Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added documentation to certainty API end point #20

Merged
merged 2 commits into from
Nov 25, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ coverage

# Config
.env
.idea

# Docs
255 changes: 253 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -786,9 +786,260 @@ HTTP/1.1 200 Success

> TODO

## EventCertainty
## EVENTCERTAINTY
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mloweedgar I think this was supposed to be EventCertainty as others

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all should be caps


`EVENTCERTAINTY` The code denoting the certainty of the subject event of the alert message

### EVENTCERTAINTY Schema

`EVENTCERTAINTY` have the following attributes:

<br />

| Name | Type | Description |
| :-------: | :----: | :-----------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event certainty. |
|description| String | Human-translatable-readable description for the event certainty. |
| name | String | Human-translatable-readable name for the event certainty. |
| color | String | A color code(in hexadecimal format) used to differentiate event certainties visually. |
| createdAt | String | A time value given in ISO8601 combined date and time format that represents when the event certainty was created. |
| updatedAt | String | A time value given in ISO8601 combined date and time format that represents when the event certainty was updated. |

### Create EVENTCERTAINTY

To create a new event certainty, send a `POST` request to `https://api.ewea.io/v1/predefines/eventcertainties`. The following attributes are supported:

<br/>

| Name | Type | Description | Required |
| :---: | :----: | :-----------------------------------------------------------------------------: | :------: |
| description | Object | Human-translatable-readable description for the event certainty.| false |
| name | Object | Human-translatable-readable name for the event certainty. | true |
| color | String | A color code(in hexadecimal format) used to differentiate event certainty visually. | false |

> Example Request

```curl
curl --request POST \
--url https://api.ewea.io/v1/predefines/eventcertainties \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Be arer <apiKey>' \
--data '{
"description": { "en": "Determined to have occured or to be ongoing" },
"name": { "en": "Observed" },
"color": "#86C7E8"
}'
```

The response will be a `JSON object` with the standard event certainty attributes:

<br/>

| Name | Type | Description |
| :-------: | :----: | :-----------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event certainty. |
| description | Object | Human-translatable-readable description for the event certainty. |
| name | Object | Human-translatable-readable name for the event certainty. |
| color | String | A color code(in hexadecimal format) used to differentiate event certainties visually. |
| createdAt | String | A time value given in ISO8601 combined date and time format that represents when the event certainty was created. |
| updatedAt | String | A time value given in ISO8601 combined date and time format that represents when the event certainty was updated. |

> Example Response

```curl
HTTP/1.1 201 Success
{
"_id": "5c6ea7dae1dc700018aac95b",
"description": { "en": "Determined to have occured or to be ongoing" },
"name": { "en": "Observed" },
"color": "#86C7EE"
"updatedAt": "2019-02-21T13:45:04.340Z",
"createdAt": "2019-02-21T13:45:04.340Z"
}
```

### Retrieve EVENTCERTAINTY

To get a event certainty, send a `GET` request to `https://api.ewea.io/v1/predefines/eventcertainties/:id`.

> Example Request

```curl
curl --request GET \
--url https://api.ewea.io/v1/predefines/eventcertainties/5c6ea7dae1dc700018aac95b \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <apiKey>'
```

The response will be a `JSON object` with the standard event certainty attributes:

<br/>

| Name | Type | Description |
| :-------: | :----: | :-----------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event certainty. |
| description | Object | Human-translatable-readable description for the event certainty. |
| name | Object | Human-translatable-readable name for the event certainty. |
| color | String | A color code(in hexadecimal format) used to differentiate event certainties visually. |
| createdAt | String | A time value given in ISO8601 combined date and time format that represents when the event certainty was created. |
| updatedAt | String | A time value given in ISO8601 combined date and time format that represents when the event certainty was updated. |

> Example Response

```curl
HTTP/1.1 200 Success
{
"_id": "5c6ea7dae1dc700018aac95b",
"description": { "en": "Determined to have occured or to be ongoing" },
"name": { "en": "Observed" },
"color": "#86C7EE"
"updatedAt": "2019-02-21T13:45:04.340Z",
"createdAt": "2019-02-21T13:45:04.340Z"
}
```

### Update EVENTCERTAINTY

To update existing event certainty, send a `PATCH` request to `https://api.ewea.io/v1/predefines/eventcertainties/:id`. The following attributes are supported:

<br/>

| Name | Type | Description | Required |
| :---: | :----: | :---------------------------------------------------: | :------: |
| description | Object | Human-translatable-readable description for the event certainty. |
| name | Object | Human-translatable-readable name for the event certainty. |

> Example Request

```curl
curl --request PATCH \
--url https://api.ewea.io/v1/predefines/eventcertainties/5c6ea7dae1dc700018aac95b \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <apiKey>' \
--data '{
"description": { "en": "Determined to have occured or to be ongoing" },
"name": { "en": "Observed" },
}'
```

The response will be a `JSON object` with the standard event certainty attributes:

<br/>

| Name | Type | Description |
| :-------: | :----: | :-----------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event certainty. |
| description | String | Unique Human-readable given code of this event certainty. |
| name | Object | Human-translatable-readable name for the event certainty. |
| color | String | A color code(in hexadecimal format) used to differentiate event certainties visually. |
| createdAt | String | A time value given in ISO8601 combined date and time format that represents when the event certainty was created. |
| updatedAt | String | A time value given in ISO8601 combined date and time format that represents when the event certainty was updated. |

> Example Response

```curl
HTTP/1.1 200 Success
{
"_id": "5c6ea7dae1dc700018aac95b",
"description": { "en": "Determined to have occured or to be ongoing" },
"name": { "en": "Observed" },
"color": "#86C7EE"
"updatedAt": "2019-02-21T13:30:04.340Z",
"createdAt": "2019-02-21T13:30:04.340Z"
}
```

### Delete EVENTCERTAINTY

To delete existing event certainty, send a `DELETE` request to `https://api.ewea.io/v1/predefines/eventcertainties/:id`.

> Example Request

```curl
curl --request DELETE \
--url https://api.ewea.io/v1/predefines/eventcertainties/5c6ea7dae1dc700018aac95b \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <apiKey>'
```

The response will be a `JSON object` with the standard event certainty attributes:

<br/>

| Name | Type | Description |
| :-------: | :----: | :-----------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event certainty. |
| description | Object | Human-translatable-readable description for the event certainty. |
| name | Object | Human-translatable-readable name for the event certainty. |
| color | String | A color code(in hexadecimal format) used to differentiate event certainties visually. |
| createdAt | String | A time value given in ISO8601 combined date and time format that represents when the event certainty was created. |
| updatedAt | String | A time value given in ISO8601 combined date and time format that represents when the event certainty was updated. |

> Example Response

```curl
HTTP/1.1 200 Success
{
"_id": "5c6ea7dae1dc700018aac95b",
"description": { "en": "Determined to have occured or to be ongoing" },
"name": { "en": "Observed" },
"color": "#86C7EE"
"updatedAt": "2019-02-21T13:30:04.340Z",
"createdAt": "2019-02-21T13:30:04.340Z"
}
```

### List All EVENTCERTAINTY

To list all event certainties, send a `GET` request to `https://api.ewea.io/v1/predefines/eventcertainties`.

> Example Request

```curl
curl --request GET \
--url https://api.ewea.io/v1/predefines/eventcertainties \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <apiKey>'
```

The response will be a `JSON object` with a `data key`. The values in the `data key` are set of event certainty with the standard event certainty attributes:

<br/>

| Name | Type | Description |
| :-------: | :----: | :-----------------------------------------------------------------------------------------------------------: |
| \_id | String | Unique universal identifier of this event certainty. |
| description | Object | Human-translatable-readable description for the event certainty. |
| name | Object | Human-translatable-readable name for the event certainty. |
| color | String | A color code(in hexadecimal format) used to differentiate event certainties visually. |
| createdAt | String | A time value given in ISO8601 combined date and time format that represents when the event certainty was created. |
| updatedAt | String | A time value given in ISO8601 combined date and time format that represents when the event certainty was updated. |

> Example Response:

```curl
HTTP/1.1 200 Success
{
"data": [{
"_id": "5c6ea7dae1dc700018aac95b",
"description": { "en": "Determined to have occured or to be ongoing" },
"name": { "en": "Observed" },
"color": "#86C7EE"
"updatedAt": "2019-02-21T13:30:04.340Z",
"createdAt": "2019-02-21T13:30:04.340Z"
}],
"total": 26,
"size": 10,
"limit": 10,
"skip": 0,
"page": 1,
"pages": 3,
"lastModified": "2019-02-21T13:30:04.340Z"
}
```

> TODO

## EventFunction

Expand Down