module GitHub.Endpoints.Users.PublicSSHKeys (
publicSSHKeysR,
publicSSHKeysForR,
publicSSHKeyR,
createUserPublicSSHKeyR,
deleteUserPublicSSHKeyR,
) where
import GitHub.Data
import GitHub.Internal.Prelude
import Prelude ()
publicSSHKeysForR :: Name Owner -> FetchCount -> Request 'RO (Vector PublicSSHKeyBasic)
publicSSHKeysForR :: Name Owner -> FetchCount -> Request 'RO (Vector PublicSSHKeyBasic)
publicSSHKeysForR Name Owner
user =
Paths
-> QueryString
-> FetchCount
-> Request 'RO (Vector PublicSSHKeyBasic)
forall a (mt :: RW).
FromJSON a =>
Paths -> QueryString -> FetchCount -> Request mt (Vector a)
pagedQuery [Text
"users", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Text
"keys"] []
publicSSHKeysR :: Request 'RA (Vector PublicSSHKey)
publicSSHKeysR :: Request 'RA (Vector PublicSSHKey)
publicSSHKeysR =
Paths -> QueryString -> Request 'RA (Vector PublicSSHKey)
forall (mt :: RW) a. Paths -> QueryString -> Request mt a
query [Text
"user", Text
"keys"] []
publicSSHKeyR :: Id PublicSSHKey -> Request 'RA PublicSSHKey
publicSSHKeyR :: Id PublicSSHKey -> Request 'RA PublicSSHKey
publicSSHKeyR Id PublicSSHKey
keyId =
Paths -> QueryString -> Request 'RA PublicSSHKey
forall (mt :: RW) a. Paths -> QueryString -> Request mt a
query [Text
"user", Text
"keys", Id PublicSSHKey -> Text
forall a. IsPathPart a => a -> Text
toPathPart Id PublicSSHKey
keyId] []
createUserPublicSSHKeyR :: NewPublicSSHKey -> Request 'RW PublicSSHKey
createUserPublicSSHKeyR :: NewPublicSSHKey -> Request 'RW PublicSSHKey
createUserPublicSSHKeyR NewPublicSSHKey
key =
CommandMethod -> Paths -> ByteString -> Request 'RW PublicSSHKey
forall a. CommandMethod -> Paths -> ByteString -> Request 'RW a
command CommandMethod
Post [Text
"user", Text
"keys"] (NewPublicSSHKey -> ByteString
forall a. ToJSON a => a -> ByteString
encode NewPublicSSHKey
key)
deleteUserPublicSSHKeyR :: Id PublicSSHKey -> GenRequest 'MtUnit 'RW ()
deleteUserPublicSSHKeyR :: Id PublicSSHKey -> GenRequest 'MtUnit 'RW ()
deleteUserPublicSSHKeyR Id PublicSSHKey
keyId =
CommandMethod -> Paths -> ByteString -> GenRequest 'MtUnit 'RW ()
forall (mt :: MediaType *) a.
CommandMethod -> Paths -> ByteString -> GenRequest mt 'RW a
Command CommandMethod
Delete [Text
"user", Text
"keys", Id PublicSSHKey -> Text
forall a. IsPathPart a => a -> Text
toPathPart Id PublicSSHKey
keyId] ByteString
forall a. Monoid a => a
mempty