github-rest-1.0.0: Query the GitHub REST API programmatically

MaintainerBrandon Chinn <brandon@leapyear.io>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

GitHub.REST.Endpoint

Description

Define the GHEndpoint helper type for defining a call to a GitHub API endpoint.

Synopsis

Documentation

data GHEndpoint Source #

A call to a GitHub API endpoint.

Constructors

GHEndpoint 

Fields

  • method :: StdMethod
     
  • endpoint :: Text

    The GitHub API endpoint, with colon-prefixed components that will be replaced; e.g. "/users/:username/repos"

  • endpointVals :: EndpointVals

    Key-value pairs to replace colon-prefixed components in endpoint; e.g. [ "username" := ("alice" :: Text) ]

  • ghData :: GitHubData

    Key-value pairs to send in the request body; e.g. [ "sort" := ("created" :: Text), "direction" := ("asc" :: Text) ]

endpointPath :: GHEndpoint -> Text Source #

Return the endpoint path, populated by the values in endpointVals.

renderMethod :: GHEndpoint -> Method Source #

Render the method of the endpoint.