module GitHub.Endpoints.Users.PublicSSHKeys (
publicSSHKeys',
publicSSHKeysR,
publicSSHKeysFor',
publicSSHKeysForR,
publicSSHKey',
publicSSHKeyR,
createUserPublicSSHKey',
createUserPublicSSHKeyR,
deleteUserPublicSSHKey',
deleteUserPublicSSHKeyR,
) where
import GitHub.Data
import GitHub.Internal.Prelude
import GitHub.Request
import Prelude ()
publicSSHKeysFor' :: Name Owner -> IO (Either Error (Vector PublicSSHKeyBasic))
publicSSHKeysFor' user =
executeRequest' $ publicSSHKeysForR user FetchAll
publicSSHKeysForR :: Name Owner -> FetchCount -> Request 'RO (Vector PublicSSHKeyBasic)
publicSSHKeysForR user =
pagedQuery ["users", toPathPart user, "keys"] []
publicSSHKeys' :: Auth -> IO (Either Error (Vector PublicSSHKey))
publicSSHKeys' auth =
executeRequest auth publicSSHKeysR
publicSSHKeysR :: Request 'RA (Vector PublicSSHKey)
publicSSHKeysR =
query ["user", "keys"] []
publicSSHKey' :: Auth -> Id PublicSSHKey -> IO (Either Error PublicSSHKey)
publicSSHKey' auth keyId =
executeRequest auth $ publicSSHKeyR keyId
publicSSHKeyR :: Id PublicSSHKey -> Request 'RA PublicSSHKey
publicSSHKeyR keyId =
query ["user", "keys", toPathPart keyId] []
createUserPublicSSHKey' :: Auth -> NewPublicSSHKey -> IO (Either Error PublicSSHKey)
createUserPublicSSHKey' auth key =
executeRequest auth $ createUserPublicSSHKeyR key
createUserPublicSSHKeyR :: NewPublicSSHKey -> Request 'RW PublicSSHKey
createUserPublicSSHKeyR key =
command Post ["user", "keys"] (encode key)
deleteUserPublicSSHKey' :: Auth -> Id PublicSSHKey -> IO (Either Error ())
deleteUserPublicSSHKey' auth keyId =
executeRequest auth $ deleteUserPublicSSHKeyR keyId
deleteUserPublicSSHKeyR :: Id PublicSSHKey -> GenRequest 'MtUnit 'RW ()
deleteUserPublicSSHKeyR keyId =
Command Delete ["user", "keys", toPathPart keyId] mempty