{"openapi":"3.1.0","info":{"title":"Everdrone AED Broker","version":"1.1.0"},"paths":{"/auth/token":{"post":{"tags":["auth"],"summary":"Token","operationId":"token_auth_token_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/refresh":{"post":{"tags":["auth"],"summary":"Refresh","operationId":"refresh_auth_refresh_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/cases":{"post":{"tags":["hr"],"summary":"Create Case","operationId":"create_case_cases_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/cases/{hr_case_id}":{"get":{"tags":["hr"],"summary":"Read Case","operationId":"read_case_cases__hr_case_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"hr_case_id","in":"path","required":true,"schema":{"type":"string","title":"Hr Case Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CaseStatus"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/ed/cases/pending":{"get":{"tags":["ed"],"summary":"List Pending","operationId":"list_pending_ed_cases_pending_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PendingCase"},"type":"array","title":"Response List Pending Ed Cases Pending Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/ed/deliveries":{"post":{"tags":["ed"],"summary":"Confirm Delivery","operationId":"confirm_delivery_ed_deliveries_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryConfirm"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/healthz":{"get":{"tags":["ops"],"summary":"Healthz","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Healthz Healthz Get"}}}}}}},"/readyz":{"get":{"tags":["ops"],"summary":"Readyz","operationId":"readyz_readyz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"CaseCreate":{"properties":{"hr_case_id":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$","title":"Hr Case Id","description":"Heartrunners' own case identifier; a UUID string in practice.","examples":["6f1d5f2c-6c2c-4f4a-9a1f-2b0f1a9c7e31"]},"grid_id":{"type":"string","title":"Grid Id","description":"H3 cell id of the masked alarm location.","examples":["891fb466257ffff"]}},"type":"object","required":["hr_case_id","grid_id"],"title":"CaseCreate"},"CaseStatus":{"properties":{"hr_case_id":{"type":"string","title":"Hr Case Id"},"grid_id":{"type":"string","title":"Grid Id"},"status":{"type":"string","title":"Status","description":"pending | delivered | expired"},"created_at":{"type":"string","title":"Created At"},"delivered_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivered At"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["hr_case_id","grid_id","status","created_at","expires_at"],"title":"CaseStatus"},"DeliveryConfirm":{"properties":{"grid_id":{"type":"string","title":"Grid Id","description":"H3 cell the AED was delivered to. This is the match key.","examples":["891fb466257ffff"]},"delivered_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivered At","description":"UTC ISO-8601. Defaults to the time the broker received it."},"hr_case_id":{"anyOf":[{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"},{"type":"null"}],"title":"Hr Case Id","description":"Optional. When given and the case exists, its grid_id must match. Omit it when confirming a delivery Heartrunners has not filed yet."}},"type":"object","required":["grid_id"],"title":"DeliveryConfirm"},"DeliveryResponse":{"properties":{"grid_id":{"type":"string","title":"Grid Id"},"delivered_at":{"type":"string","title":"Delivered At"},"expires_at":{"type":"string","title":"Expires At"},"matched_cases":{"items":{"$ref":"#/components/schemas/MatchedCase"},"type":"array","title":"Matched Cases","description":"Cases settled by this confirmation. Empty means the delivery was recorded and is waiting for Heartrunners to file the case."}},"type":"object","required":["grid_id","delivered_at","expires_at"],"title":"DeliveryResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MatchedCase":{"properties":{"hr_case_id":{"type":"string","title":"Hr Case Id"},"status":{"type":"string","title":"Status"}},"type":"object","required":["hr_case_id","status"],"title":"MatchedCase"},"PendingCase":{"properties":{"hr_case_id":{"type":"string","title":"Hr Case Id"},"grid_id":{"type":"string","title":"Grid Id"},"created_at":{"type":"string","title":"Created At"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["hr_case_id","grid_id","created_at","expires_at"],"title":"PendingCase"},"RefreshRequest":{"properties":{"refresh_token":{"type":"string","maxLength":512,"minLength":1,"title":"Refresh Token"}},"type":"object","required":["refresh_token"],"title":"RefreshRequest"},"TokenRequest":{"properties":{"client_id":{"type":"string","maxLength":128,"minLength":1,"title":"Client Id"},"client_secret":{"type":"string","maxLength":512,"minLength":1,"title":"Client Secret"}},"type":"object","required":["client_id","client_secret"],"title":"TokenRequest"},"TokenResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"Bearer"},"expires_in":{"type":"integer","title":"Expires In"},"scope":{"type":"string","title":"Scope"},"refresh_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refresh Token"},"refresh_expires_in":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Refresh Expires In"}},"type":"object","required":["access_token","expires_in","scope"],"title":"TokenResponse"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}