Liking cljdoc? Tell your friends :D

openadr3.api

OpenADR 3 API client library. Spec-driven HTTP client built on Martian with the OpenAPI spec as the single source of truth.

Functions return raw HTTP responses by default. Use the coerced helpers (programs, events, vens, etc.) to get namespaced Clojure entities.

OpenADR 3 API client library.
Spec-driven HTTP client built on Martian with the OpenAPI spec as the single source of truth.

Functions return raw HTTP responses by default. Use the coerced helpers
(programs, events, vens, etc.) to get namespaced Clojure entities.
raw docstring

all-routesclj

(all-routes client)

Returns vector of all route-name keywords.

Returns vector of all route-name keywords.
sourceraw docstring

authorized?clj

(authorized? client-scopes endpoint-scopes)

Returns truthy if the client's scopes intersect with the endpoint's required scopes.

Returns truthy if the client's scopes intersect with the endpoint's required scopes.
sourceraw docstring

bodyclj

(body response)

Extract the :body from an HTTP response.

Extract the :body from an HTTP response.
sourceraw docstring

build-shared-http-clientclj

(build-shared-http-client {:keys [connect-timeout-ms]
                           :or {connect-timeout-ms 5000}})

Build a shared Java HttpClient with connection timeout. Reuse across requests to avoid per-request client creation.

Build a shared Java HttpClient with connection timeout.
Reuse across requests to avoid per-request client creation.
sourceraw docstring

client-typeclj

(client-type client)

Returns OpenADR3 client-type keyword, :ven or :bl

Returns OpenADR3 client-type keyword, :ven or :bl
sourceraw docstring

create-authentication-headerclj

(create-authentication-header token)

Martian interceptor that adds a Bearer token to requests.

Martian interceptor that adds a Bearer token to requests.
sourceraw docstring

create-bl-clientclj

(create-bl-client auth-token url)
(create-bl-client auth-token url opts)

Create an authenticated BL (Business Logic) client. Uses the embedded spec (default version 3.1.0). Pass opts map to override :spec-version, :http-client, or :user-agent.

Examples: (create-bl-client token url) (create-bl-client token url {:spec-version "3.0.1"}) (create-bl-client token url {:http-client hc}) (create-bl-client token url {:user-agent "my-app/1.0"})

Create an authenticated BL (Business Logic) client.
Uses the embedded spec (default version 3.1.0). Pass opts map to override
:spec-version, :http-client, or :user-agent.

Examples:
  (create-bl-client token url)
  (create-bl-client token url {:spec-version "3.0.1"})
  (create-bl-client token url {:http-client hc})
  (create-bl-client token url {:user-agent "my-app/1.0"})
sourceraw docstring

create-eventclj

(create-event openapi-client event-request-body)

Create a new event.

Create a new event.
sourceraw docstring

create-programclj

(create-program openapi-client program-request-body)

Create a new program.

Create a new program.
sourceraw docstring

create-reportclj

(create-report openapi-client report-request-body)

Create a new report.

Create a new report.
sourceraw docstring

create-resourceclj

(create-resource openapi-client resource-body)

Create a resource for a VEN. Body should include :venID, :resourceName, and :objectType (VEN_RESOURCE_REQUEST or BL_RESOURCE_REQUEST). For BL requests, also include :clientID.

Create a resource for a VEN. Body should include :venID, :resourceName,
and :objectType (VEN_RESOURCE_REQUEST or BL_RESOURCE_REQUEST).
For BL requests, also include :clientID.
sourceraw docstring

create-subscriptionclj

(create-subscription openapi-client subscription-request-body)

Create a new subscription.

Create a new subscription.
sourceraw docstring

create-user-agent-headerclj

(create-user-agent-header user-agent)

Martian interceptor that sets the User-Agent header on requests.

Martian interceptor that sets the User-Agent header on requests.
sourceraw docstring

create-venclj

(create-ven openapi-client ven-request-body)

Create a new VEN.

Create a new VEN.
sourceraw docstring

create-ven-clientclj

(create-ven-client auth-token url)
(create-ven-client auth-token url opts)

Create an authenticated VEN (Virtual End Node) client. Uses the embedded spec (default version 3.1.0). Pass opts map to override :spec-version, :http-client, or :user-agent.

Examples: (create-ven-client token url) (create-ven-client token url {:spec-version "3.0.1"}) (create-ven-client token url {:http-client hc}) (create-ven-client token url {:user-agent "my-app/1.0"})

Create an authenticated VEN (Virtual End Node) client.
Uses the embedded spec (default version 3.1.0). Pass opts map to override
:spec-version, :http-client, or :user-agent.

Examples:
  (create-ven-client token url)
  (create-ven-client token url {:spec-version "3.0.1"})
  (create-ven-client token url {:http-client hc})
  (create-ven-client token url {:user-agent "my-app/1.0"})
sourceraw docstring

default-spec-versionclj

source

default-user-agentclj

source

default-vtn-urlclj

source

delete-eventclj

(delete-event openapi-client event-id)

Delete an event by ID.

Delete an event by ID.
sourceraw docstring

delete-programclj

(delete-program openapi-client program-id)

Delete a program by ID.

Delete a program by ID.
sourceraw docstring

delete-reportclj

(delete-report openapi-client report-id)

Delete a report by ID.

Delete a report by ID.
sourceraw docstring

delete-resourceclj

(delete-resource openapi-client resource-id)

Delete a resource by ID.

Delete a resource by ID.
sourceraw docstring

delete-subscriptionclj

(delete-subscription openapi-client subscription-id)

Delete a subscription by ID.

Delete a subscription by ID.
sourceraw docstring

delete-venclj

(delete-ven openapi-client ven-id)

Delete a VEN by ID.

Delete a VEN by ID.
sourceraw docstring

endpoint-scopesclj

(endpoint-scopes client endpoint)

Returns set of OAuth2 scopes required for the given endpoint.

Returns set of OAuth2 scopes required for the given endpoint.
sourceraw docstring

eventclj

(event client event-id)

Fetch and coerce an event by ID. Returns an Event entity.

Fetch and coerce an event by ID. Returns an Event entity.
sourceraw docstring

eventsclj

(events client)

Fetch and coerce all events. Returns a vector of Event entities.

Fetch and coerce all events. Returns a vector of Event entities.
sourceraw docstring

find-program-by-nameclj

(find-program-by-name client name)

Find a program by name. Returns the first match, or nil if not found.

Find a program by name. Returns the first match, or nil if not found.
sourceraw docstring

find-ven-by-nameclj

(find-ven-by-name client name)

Find a VEN by name. Returns the first match, or nil if not found.

Find a VEN by name. Returns the first match, or nil if not found.
sourceraw docstring

get-auth-serverclj

(get-auth-server openapi-client)

GET auth server info.

GET auth server info.
sourceraw docstring

get-event-by-idclj

(get-event-by-id openapi-client event-id)

Get an event by its ID.

Get an event by its ID.
sourceraw docstring

get-eventsclj

(get-events openapi-client)

Search all events.

Search all events.
sourceraw docstring

get-handlerclj

(get-handler martian route-kw)

Returns the handler for the specified route-name keyword.

Returns the handler for the specified route-name keyword.
sourceraw docstring

get-mqtt-topics-eventsclj

(get-mqtt-topics-events openapi-client)
source

get-mqtt-topics-programclj

(get-mqtt-topics-program openapi-client program-id)

Get MQTT topic names for a specific program.

Get MQTT topic names for a specific program.
sourceraw docstring

get-mqtt-topics-program-eventsclj

(get-mqtt-topics-program-events openapi-client program-id)

Get MQTT topic names for events on a specific program.

Get MQTT topic names for events on a specific program.
sourceraw docstring

get-mqtt-topics-programsclj

(get-mqtt-topics-programs openapi-client)
source

get-mqtt-topics-reportsclj

(get-mqtt-topics-reports openapi-client)
source

get-mqtt-topics-resourcesclj

(get-mqtt-topics-resources openapi-client)
source

get-mqtt-topics-subscriptionsclj

(get-mqtt-topics-subscriptions openapi-client)
source

get-mqtt-topics-venclj

(get-mqtt-topics-ven openapi-client ven-id)

Get MQTT topic names for a specific VEN.

Get MQTT topic names for a specific VEN.
sourceraw docstring

get-mqtt-topics-ven-eventsclj

(get-mqtt-topics-ven-events openapi-client ven-id)

Get MQTT topic names for events targeted at a VEN.

Get MQTT topic names for events targeted at a VEN.
sourceraw docstring

get-mqtt-topics-ven-programsclj

(get-mqtt-topics-ven-programs openapi-client ven-id)

Get MQTT topic names for programs targeted at a VEN.

Get MQTT topic names for programs targeted at a VEN.
sourceraw docstring

get-mqtt-topics-ven-resourcesclj

(get-mqtt-topics-ven-resources openapi-client ven-id)

Get MQTT topic names for resources of a VEN.

Get MQTT topic names for resources of a VEN.
sourceraw docstring

get-mqtt-topics-vensclj

(get-mqtt-topics-vens openapi-client)
source

get-notifiersclj

(get-notifiers openapi-client)

List all notifiers.

List all notifiers.
sourceraw docstring

get-program-by-idclj

(get-program-by-id openapi-client program-id)

Get a program by its ID.

Get a program by its ID.
sourceraw docstring

get-programsclj

(get-programs openapi-client)

Search all programs.

Search all programs.
sourceraw docstring

get-report-by-idclj

(get-report-by-id openapi-client report-id)

Get a report by its ID.

Get a report by its ID.
sourceraw docstring

get-reportsclj

(get-reports openapi-client)

Search all reports.

Search all reports.
sourceraw docstring

get-resource-by-idclj

(get-resource-by-id openapi-client resource-id)

Get a resource by its ID.

Get a resource by its ID.
sourceraw docstring

get-subscription-by-idclj

(get-subscription-by-id openapi-client subscription-id)

Get a subscription by its ID.

Get a subscription by its ID.
sourceraw docstring

get-subscriptionsclj

(get-subscriptions openapi-client)

Search all subscriptions.

Search all subscriptions.
sourceraw docstring

get-tokenclj

(get-token openapi-client client-id client-secret)

Fetch an OAuth2 token using client credentials.

Fetch an OAuth2 token using client credentials.
sourceraw docstring

get-unauthenticated-routesclj

(get-unauthenticated-routes martian)

Returns vector of route-names that require no authentication.

Returns vector of route-names that require no authentication.
sourceraw docstring

get-ven-by-idclj

(get-ven-by-id openapi-client ven-id)

Get a VEN by its ID.

Get a VEN by its ID.
sourceraw docstring

get-vensclj

(get-vens openapi-client)

Search all VENs.

Search all VENs.
sourceraw docstring

hash-map-byclj

(hash-map-by f coll)

Like group-by, but the mapping must be unique. Throws on duplicate keys.

Like group-by, but the mapping must be unique. Throws on duplicate keys.
sourceraw docstring

inject-http-clientclj

(inject-http-client http-client)

Martian interceptor that injects a shared HttpClient into every request.

Martian interceptor that injects a shared HttpClient into every request.
sourceraw docstring

lib-versionclj

source

programclj

(program client program-id)

Fetch and coerce a program by ID. Returns a Program entity.

Fetch and coerce a program by ID. Returns a Program entity.
sourceraw docstring

programsclj

(programs client)

Fetch and coerce all programs. Returns a vector of Program entities.

Fetch and coerce all programs. Returns a vector of Program entities.
sourceraw docstring

read-openapi-specclj

(read-openapi-spec filename)
(read-openapi-spec filename interceptors)
(read-openapi-spec filename interceptors url)
(read-openapi-spec filename interceptors url http-client)

Bootstrap a Martian client from an OpenAPI spec file. Returns a Martian instance with optional interceptors and API root URL. When http-client is provided, prepends an interceptor to inject it into every request, avoiding per-request HttpClient creation.

Bootstrap a Martian client from an OpenAPI spec file.
Returns a Martian instance with optional interceptors and API root URL.
When http-client is provided, prepends an interceptor to inject it into
every request, avoiding per-request HttpClient creation.
sourceraw docstring

reportclj

(report client report-id)

Fetch and coerce a report by ID. Returns a Report entity.

Fetch and coerce a report by ID. Returns a Report entity.
sourceraw docstring

reportsclj

(reports client)

Fetch and coerce all reports. Returns a vector of Report entities.

Fetch and coerce all reports. Returns a vector of Report entities.
sourceraw docstring

safe-default-interceptorsclj

Martian hato default interceptors with safe response coercion for error responses.

Martian hato default interceptors with safe response coercion for error responses.
sourceraw docstring

scopesclj

(scopes client)

Returns set of OpenADR client scopes.

Returns set of OpenADR client scopes.
sourceraw docstring

search-eventsclj

(search-events openapi-client query-params)

Search events with query parameters.

Search events with query parameters.
sourceraw docstring

search-programsclj

(search-programs openapi-client query-params)

Search programs with query parameters (targets, skip, limit).

Search programs with query parameters (targets, skip, limit).
sourceraw docstring

search-reportsclj

(search-reports openapi-client query-params)

Search reports with query parameters.

Search reports with query parameters.
sourceraw docstring

search-subscriptionsclj

(search-subscriptions openapi-client query-params)

Search subscriptions with query parameters.

Search subscriptions with query parameters.
sourceraw docstring

search-ven-resourcesclj

(search-ven-resources openapi-client query-params)

Search VEN resources with query parameters.

Search VEN resources with query parameters.
sourceraw docstring

search-vensclj

(search-vens openapi-client query-params)

Search VENs with query parameters (targetType, targetValues, skip, limit, venName).

Search VENs with query parameters (targetType, targetValues, skip, limit, venName).
sourceraw docstring

spec-pathclj

(spec-path)
(spec-path version)

Resolve a spec version string to a classpath resource name. Returns the resource name string (not a filesystem path) so that martian.file/local-resource can find it via clojure.java.io/resource. Throws if the version is unknown or the resource is not found.

Resolve a spec version string to a classpath resource name.
Returns the resource name string (not a filesystem path) so that
martian.file/local-resource can find it via clojure.java.io/resource.
Throws if the version is unknown or the resource is not found.
sourceraw docstring

spec-versionsclj

Map of OA3 spec version string to classpath resource path.

Map of OA3 spec version string to classpath resource path.
sourceraw docstring

subscriptionclj

(subscription client subscription-id)

Fetch and coerce a subscription by ID. Returns a Subscription entity.

Fetch and coerce a subscription by ID. Returns a Subscription entity.
sourceraw docstring

subscriptionsclj

(subscriptions client)

Fetch and coerce all subscriptions. Returns a vector of Subscription entities.

Fetch and coerce all subscriptions. Returns a vector of Subscription entities.
sourceraw docstring

success?clj

(success? response)

True if the HTTP response has a 2xx status code.

True if the HTTP response has a 2xx status code.
sourceraw docstring

turn-off-exception-throwingclj

(turn-off-exception-throwing)

Martian interceptor that prevents Hato from throwing on non-2xx responses.

Martian interceptor that prevents Hato from throwing on non-2xx responses.
sourceraw docstring

update-eventclj

(update-event openapi-client event-id event-request-body)

Update an existing event.

Update an existing event.
sourceraw docstring

update-programclj

(update-program openapi-client program-id program-request-body)

Update an existing program.

Update an existing program.
sourceraw docstring

update-reportclj

(update-report openapi-client report-id report-request-body)

Update an existing report.

Update an existing report.
sourceraw docstring

update-resourceclj

(update-resource openapi-client resource-id resource-request-body)

Update an existing resource.

Update an existing resource.
sourceraw docstring

update-subscriptionclj

(update-subscription openapi-client subscription-id subscription-request-body)

Update an existing subscription.

Update an existing subscription.
sourceraw docstring

update-venclj

(update-ven openapi-client ven-id ven-request-body)

Update an existing VEN.

Update an existing VEN.
sourceraw docstring

venclj

(ven client ven-id)

Fetch and coerce a VEN by ID. Returns a Ven entity.

Fetch and coerce a VEN by ID. Returns a Ven entity.
sourceraw docstring

vensclj

(vens client)

Fetch and coerce all VENs. Returns a vector of Ven entities.

Fetch and coerce all VENs. Returns a vector of Ven entities.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close