Add OapApi.v1 module

This commit is contained in:
2024-03-28 22:10:26 -05:00
parent 67f488c5bd
commit 440ccba5d2
79 changed files with 3004 additions and 142 deletions

30
docs/api/OapApiV1.md Normal file
View File

@@ -0,0 +1,30 @@
# OapApiV1
URL: [`https://oaprotection.org/api/v1`](https://oaprotection.org/api/v1)
| method | path | description |
| --- | --- | --- |
| [getApplications](OapApiV1/getApplications.md) | `GET /applications` | Gets applications for the current user. |
| [createApplication](OapApiV1/createApplication.md) | `POST /applications/` | Creates a new application for the current user. |
| [getApplication](OapApiV1/getApplication.md) | `GET /applications/{id}` | Gets the specified application for the current user. |
| [updateApplication](OapApiV1/updateApplication.md) | `PATCH /applications/{id}` | Updates the application. |
| data | description |
| --- | --- |
| [Application](OapApiV1/Application.md) | An application. |
| [ApplicationCreateSet](OapApiV1/ApplicationCreateSet.md) | |
| [ApplicationChangeSet](OapApiV1/ApplicationChangeSet.md) | |
| [ApplicationTermsCreateSet](OapApiV1/ApplicationTermsCreateSet.md) | |
| [ApplicationTerms](OapApiV1/ApplicationTerms.md) | |
| enum | description |
| --- | --- |
| [ApplicationStatus](OapApiV1/ApplicationStatus.md) | |
API providing OAP functionality for the application form, calculator and more.
## Heading
Use a primary heading to indicate the member name.
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,21 @@
# Application
An application.
```
{
"id": "(string)",
"status": "(InProgress|Submitted)",
"terms": { "hasReadInstructions": ... }
}
```
| field | type | description |
| --- | --- | --- |
| id | string | A unique identifier for the application. |
| status | [ApplicationStatus](ApplicationStatus.md) | The current status of this application. |
| terms | [ApplicationTerms](ApplicationTerms.md) | Terms the user must accept to start, continue an accept an application. |
Represents a user's application, whether in progress or submitted.
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,8 @@
# ApplicationChangeSet
```
{
}
```
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,13 @@
# ApplicationCreateSet
```
{
"terms": { "hasReadInstructions": ... }
}
```
| field | type | description |
| --- | --- | --- |
| terms | [ApplicationTermsCreateSet](ApplicationTermsCreateSet.md) | Terms a user must accept to start an application. |
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,8 @@
# ApplicationStatus
| name | description |
| --- | --- |
| InProgress | |
| Submitted | |
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,13 @@
# ApplicationTerms
```
{
"hasReadInstructions": (true|false)
}
```
| field | type | description |
| --- | --- | --- |
| hasReadInstructions | boolean | |
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,13 @@
# ApplicationTermsCreateSet
```
{
"hasReadInstructions": (true|false)
}
```
| field | type | description |
| --- | --- | --- |
| hasReadInstructions | boolean | |
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,23 @@
# createApplication
Creates a new application for the current user.
```
POST /applications/
(applicationCreateSet)
--- 200 OK
(application)
--- 201 Created
```
| request | type | description |
| --- | --- | --- |
| applicationCreateSet | [ApplicationCreateSet](ApplicationCreateSet.md) | The application to create. |
| response | type | description |
| --- | --- | --- |
| application | [Application](Application.md) | The created application. |
Creates a new application for the current user.
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,25 @@
# getApplication
Gets the specified application for the current user.
```
GET /applications/{id}
--- response
eTag: (eTag)
--- 200 OK
(application)
--- 304 Not Modified
(if notModified)
```
| request | type | description |
| --- | --- | --- |
| id | string | The widget ID. |
| response | type | description |
| --- | --- | --- |
| application | [Application](Application.md) | The requested widget. |
| eTag | string | |
| notModified | boolean | |
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,34 @@
# getApplications
Gets applications for the current user.
```
GET /applications
?status={status}
&limit={limit}
&nextToken={nextToken}
--- 200 OK
{
"applications": [ { "id": ... }, ... ],
"total": (integer),
"nextToken": "(string)",
"isLastPage": (true|false)
}
```
| request | type | description |
| --- | --- | --- |
| status | [ApplicationStatus](ApplicationStatus.md) | Filter applications by the given status. |
| limit | int32 | The limit of returned results. |
| nextToken | string | The token presenting the next page of applications to get. |
| response | type | description |
| --- | --- | --- |
| applications | [Application](Application.md)[] | The applications. |
| total | int64 | The total number of applications. |
| nextToken | string | The token representing the next page of results. |
| isLastPage | boolean | True if this is the last page of results, false otherwise. |
Gets the current user's applications in pages.
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,23 @@
# updateApplication
Updates the application.
```
PATCH /applications/{id}
(applicationChangeSet)
--- 200 OK
(application)
```
| request | type | description |
| --- | --- | --- |
| id | string | The application ID. |
| applicationChangeSet | [ApplicationChangeSet](ApplicationChangeSet.md) | The application update set. |
| response | type | description |
| --- | --- | --- |
| application | [Application](Application.md) | The updated Application. |
Updates an application for the current user, given the ID of the application to update.
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,30 @@
# OverseasAutoProtectionApi
URL: [`https://oaprotection.org/api/v1`](https://oaprotection.org/api/v1)
| method | path | description |
| --- | --- | --- |
| [getApplications](OverseasAutoProtectionApi/getApplications.md) | `GET /applications` | Gets applications for the current user. |
| [createApplication](OverseasAutoProtectionApi/createApplication.md) | `POST /applications/` | Creates a new application for the current user. |
| [getApplication](OverseasAutoProtectionApi/getApplication.md) | `GET /applications/{id}` | Gets the specified application for the current user. |
| [updateApplication](OverseasAutoProtectionApi/updateApplication.md) | `PATCH /applications/{id}` | Updates the application. |
| data | description |
| --- | --- |
| [Application](OverseasAutoProtectionApi/Application.md) | An application. |
| [ApplicationCreateSet](OverseasAutoProtectionApi/ApplicationCreateSet.md) | |
| [ApplicationChangeSet](OverseasAutoProtectionApi/ApplicationChangeSet.md) | |
| [ApplicationTermsCreateSet](OverseasAutoProtectionApi/ApplicationTermsCreateSet.md) | |
| [ApplicationTerms](OverseasAutoProtectionApi/ApplicationTerms.md) | |
| enum | description |
| --- | --- |
| [ApplicationStatus](OverseasAutoProtectionApi/ApplicationStatus.md) | |
API providing OAP functionality for the application form, calculator and more.
## Heading
Use a primary heading to indicate the member name.
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,21 @@
# Application
An application.
```
{
"id": "(string)",
"status": "(InProgress|Submitted)",
"terms": { "hasReadInstructions": ... }
}
```
| field | type | description |
| --- | --- | --- |
| id | string | A unique identifier for the application. |
| status | [ApplicationStatus](ApplicationStatus.md) | The current status of this application. |
| terms | [ApplicationTerms](ApplicationTerms.md) | Terms the user must accept to start, continue an accept an application. |
Represents a user's application, whether in progress or submitted.
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,8 @@
# ApplicationChangeSet
```
{
}
```
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,13 @@
# ApplicationCreateSet
```
{
"terms": { "hasReadInstructions": ... }
}
```
| field | type | description |
| --- | --- | --- |
| terms | [ApplicationTermsCreateSet](ApplicationTermsCreateSet.md) | Terms a user must accept to start an application. |
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,8 @@
# ApplicationStatus
| name | description |
| --- | --- |
| InProgress | |
| Submitted | |
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,13 @@
# ApplicationTerms
```
{
"hasReadInstructions": (true|false)
}
```
| field | type | description |
| --- | --- | --- |
| hasReadInstructions | boolean | |
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,13 @@
# ApplicationTermsCreateSet
```
{
"hasReadInstructions": (true|false)
}
```
| field | type | description |
| --- | --- | --- |
| hasReadInstructions | boolean | |
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,23 @@
# createApplication
Creates a new application for the current user.
```
POST /applications/
(applicationCreateSet)
--- 200 OK
(application)
--- 201 Created
```
| request | type | description |
| --- | --- | --- |
| applicationCreateSet | [ApplicationCreateSet](ApplicationCreateSet.md) | The application to create. |
| response | type | description |
| --- | --- | --- |
| application | [Application](Application.md) | The created application. |
Creates a new application for the current user.
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,25 @@
# getApplication
Gets the specified application for the current user.
```
GET /applications/{id}
--- response
eTag: (eTag)
--- 200 OK
(application)
--- 304 Not Modified
(if notModified)
```
| request | type | description |
| --- | --- | --- |
| id | string | The widget ID. |
| response | type | description |
| --- | --- | --- |
| application | [Application](Application.md) | The requested widget. |
| eTag | string | |
| notModified | boolean | |
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,34 @@
# getApplications
Gets applications for the current user.
```
GET /applications
?status={status}
&limit={limit}
&nextToken={nextToken}
--- 200 OK
{
"applications": [ { "id": ... }, ... ],
"total": (integer),
"nextToken": "(string)",
"isLastPage": (true|false)
}
```
| request | type | description |
| --- | --- | --- |
| status | [ApplicationStatus](ApplicationStatus.md) | Filter applications by the given status. |
| limit | int32 | The limit of returned results. |
| nextToken | string | The token presenting the next page of applications to get. |
| response | type | description |
| --- | --- | --- |
| applications | [Application](Application.md)[] | The applications. |
| total | int64 | The total number of applications. |
| nextToken | string | The token representing the next page of results. |
| isLastPage | boolean | True if this is the last page of results, false otherwise. |
Gets the current user's applications in pages.
<!-- DO NOT EDIT: generated by fsdgenmd -->

View File

@@ -0,0 +1,23 @@
# updateApplication
Updates the application.
```
PATCH /applications/{id}
(applicationChangeSet)
--- 200 OK
(application)
```
| request | type | description |
| --- | --- | --- |
| id | string | The application ID. |
| applicationChangeSet | [ApplicationChangeSet](ApplicationChangeSet.md) | The application update set. |
| response | type | description |
| --- | --- | --- |
| application | [Application](Application.md) | The updated Application. |
Updates an application for the current user, given the ID of the application to update.
<!-- DO NOT EDIT: generated by fsdgenmd -->