Skip to content

Commit

Permalink
adds care partner alerts config endpoints
Browse files Browse the repository at this point in the history
GET, DELETE, and PUT have been added.

The POST isn't added, as it should be created via an invitation.

BACK-2502
BACK-2503
BACK-2655
  • Loading branch information
ewollesen committed Oct 2, 2023
1 parent 0437577 commit 00e234e
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 4 deletions.
134 changes: 134 additions & 0 deletions reference/carepartners.v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
openapi: 3.0.0
info:
title: Care Partners API
version: '1.0'
description: |-
The Tidepool API is an HTTP REST API used by Tidepool clients to communicate with the Tidepool Platform.
For more information, see the [Getting Started](../docs/quick-start.md) section.
termsOfService: https://developer.tidepool.org/terms-of-use/
contact:
name: API Support
url: https://support.tidepool.org/
email: support@tidepool.org
license:
name: BSD-2-Clause
url: https://github.com/tidepool-org/hydrophone/blob/master/LICENSE
x-tidepool-service: https://github.com/tidepool-org/hydrophone

servers:
- url: 'https://external.integration.tidepool.org'
description: integration
- url: 'https://api.tidepool.org'
description: production
- url: 'https://dev1.dev.tidepool.org'
description: dev1
- url: 'https://qa1.development.tidepool.org'
description: qa1
- url: 'https://qa2.development.tidepool.org'
description: qa2

security:
- sessionToken: []

tags:
- name: Alerts
description: >-
Retrieve, modify, and delete care partner alerts.
paths:
'/carepartners/alerts/{userId}/{sharerId}':
parameters:
- $ref: './common/parameters/tidepoolsharerid.v1.yaml'
- $ref: './common/parameters/tidepooluserid.yaml'

delete:
operationId: DeleteCarePartnerAlertsForUser
summary: Delete a care team partner's alerts configuration for a user
description: >-
Delete a care team partner's alerts configuration for a user.
responses:
'200':
description: 'Alerts configuration deleted'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
tags:
- Alerts

post:
operationId: ModifyCarePartnerAlertsForUser
summary: Modify or create a care team partner's alerts configuration for a user
description: >-
Modify or create a care team partner's alerts configuration for a user.
Alerts should be created via invitation, but can be later modified
by the invitee through this endpoint.
requestBody:
content:
'application/json':
schema:
$ref: './common/models/alertsconfig.v1.yaml'
responses:
'200':
$ref: '#/components/responses/AlertsConfig'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
tags:
- Alerts

get:
operationId: GetxoCarePartnerAlertsForUser
summary: Get a care team partner's alerts configuration for a user
description: >-
Get a care team partner's alerts configuration for a user.
responses:
'200':
$ref: '#/components/responses/AlertsConfig'
'400':
$ref: '#/components/responses/BadRequest'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/ServerError'
tags:
- Alerts


components:
securitySchemes:
sessionToken:
$ref: './common/security/tidepoolsessiontoken.v1.yaml'

responses:
AlertsConfig:
description: 'Alerts configuration of a user'
content:
'application/json':
schema:
$ref: './common/models/alertsconfig.v1.yaml'

BadRequest:
description: 'Bad Request'

Unauthorized:
description: 'Unauthorized'

NotFound:
description: 'Not Found'

ServerError:
description: 'Server Error'
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title: Care Team Alert Configurations
title: Care Team Alerts Configurations
type: object
properties:
urgentLow:
Expand Down
5 changes: 2 additions & 3 deletions reference/confirm/models/invitation.v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@ properties:
note: { }
upload: { }
view: { }
alerting: { }
nickname:
description: A user-friendly name for the recipient of the invitation.
type: string
example: "Julia"
## Suggestion: minLength / maxLength? Perhaps:
# minLength: 1
# maxLength: 100 # the value 100 is used in other similar places
alertConfig:
$ref: './alertconfig.v1.yaml'
alertsConfig:
$ref: '../../common/models/alertsconfig.v1.yaml'

required:
- email
Expand Down

0 comments on commit 00e234e

Please sign in to comment.