https://github.com/devth/pagerduty-openapi-clj
Generated PagerDuty API Client via OpenAPI for Clojure
https://github.com/devth/pagerduty-openapi-clj
Last synced: 4 months ago
JSON representation
Generated PagerDuty API Client via OpenAPI for Clojure
- Host: GitHub
- URL: https://github.com/devth/pagerduty-openapi-clj
- Owner: devth
- Created: 2018-11-28T22:56:46.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-29T19:28:43.000Z (about 7 years ago)
- Last Synced: 2025-06-01T14:07:26.864Z (7 months ago)
- Language: Clojure
- Size: 50.8 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pagerduty-openapi-clj
This is a generated PagerDuty API client. It uses [PagerDuty's OpenAPI
specification](https://api-reference.pagerduty.com/output.json) and the
[openapi-generator](https://github.com/OpenAPITools/openapi-generator) tool.
## Coordinates
```clojure
[pager-duty-api "2.0"]
```
## Usage
```clojure
(require '[pager-duty-api.core :refer [with-api-context set-api-context]])
;; set a token. Note the required "Token token=" prefix.
(def my-pagerduty-token "xxxyyyzzz")
(set-api-context
{:auths {"api_key" (str "Token token=" my-pagerduty-token)}})
;; try calling an API
(require '[pager-duty-api.api.teams :as teams])
;; get all teams
(teams/teams-get)
;; get teams matching a query
(teams/teams-get {:query "frontend"})
```
## Dev
### Prerequisites
```bash
brew install openapi-generator
```
## Explore the `openapi-generator` CLI
```bash
openapi-generator help
openapi-generator help generate
openapi-generator config-help -g clojure
```
### Obtain OpenAPI spec
Obtain a fresh copy of the spec and commit this to the repo to keep it in sync
with generated source:
```bash
curl -o openapi.json https://api-reference.pagerduty.com/output.json
```
### Generate the client
```bash
openapi-generator generate -i openapi.json -c gen-config.json -l clojure -o client
```
### Install client locally
```bash
cd client && lein install; cd ..
```
### Deploy to Clojars
```bash
cd client && lein deploy; cd ..
```