module GitHub.Endpoints.GitData.Trees (
tree,
tree',
treeR,
nestedTree,
nestedTree',
nestedTreeR,
module GitHub.Data,
) where
import GitHub.Data
import GitHub.Internal.Prelude
import GitHub.Request
import Prelude ()
tree' :: Maybe Auth -> Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)
tree' :: Maybe Auth
-> Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)
tree' auth :: Maybe Auth
auth user :: Name Owner
user repo :: Name Repo
repo sha :: Name Tree
sha =
Maybe Auth -> GenRequest 'MtJSON 'RO Tree -> IO (Either Error Tree)
forall am (mt :: MediaType *) a.
(AuthMethod am, ParseResponse mt a) =>
Maybe am -> GenRequest mt 'RO a -> IO (Either Error a)
executeRequestMaybe Maybe Auth
auth (GenRequest 'MtJSON 'RO Tree -> IO (Either Error Tree))
-> GenRequest 'MtJSON 'RO Tree -> IO (Either Error Tree)
forall a b. (a -> b) -> a -> b
$ Name Owner -> Name Repo -> Name Tree -> GenRequest 'MtJSON 'RO Tree
forall (k :: RW).
Name Owner -> Name Repo -> Name Tree -> Request k Tree
treeR Name Owner
user Name Repo
repo Name Tree
sha
tree :: Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)
tree :: Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)
tree = Maybe Auth
-> Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)
tree' Maybe Auth
forall a. Maybe a
Nothing
treeR :: Name Owner -> Name Repo -> Name Tree -> Request k Tree
treeR :: Name Owner -> Name Repo -> Name Tree -> Request k Tree
treeR user :: Name Owner
user repo :: Name Repo
repo sha :: Name Tree
sha =
Paths -> QueryString -> Request k Tree
forall (mt :: RW) a. Paths -> QueryString -> Request mt a
query ["repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, "git", "trees", Name Tree -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Tree
sha] []
nestedTree' :: Maybe Auth -> Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)
nestedTree' :: Maybe Auth
-> Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)
nestedTree' auth :: Maybe Auth
auth user :: Name Owner
user repo :: Name Repo
repo sha :: Name Tree
sha =
Maybe Auth -> GenRequest 'MtJSON 'RO Tree -> IO (Either Error Tree)
forall am (mt :: MediaType *) a.
(AuthMethod am, ParseResponse mt a) =>
Maybe am -> GenRequest mt 'RO a -> IO (Either Error a)
executeRequestMaybe Maybe Auth
auth (GenRequest 'MtJSON 'RO Tree -> IO (Either Error Tree))
-> GenRequest 'MtJSON 'RO Tree -> IO (Either Error Tree)
forall a b. (a -> b) -> a -> b
$ Name Owner -> Name Repo -> Name Tree -> GenRequest 'MtJSON 'RO Tree
forall (k :: RW).
Name Owner -> Name Repo -> Name Tree -> Request k Tree
nestedTreeR Name Owner
user Name Repo
repo Name Tree
sha
nestedTree :: Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)
nestedTree :: Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)
nestedTree = Maybe Auth
-> Name Owner -> Name Repo -> Name Tree -> IO (Either Error Tree)
nestedTree' Maybe Auth
forall a. Maybe a
Nothing
nestedTreeR :: Name Owner -> Name Repo -> Name Tree -> Request k Tree
nestedTreeR :: Name Owner -> Name Repo -> Name Tree -> Request k Tree
nestedTreeR user :: Name Owner
user repo :: Name Repo
repo sha :: Name Tree
sha =
Paths -> QueryString -> Request k Tree
forall (mt :: RW) a. Paths -> QueryString -> Request mt a
query ["repos", Name Owner -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Owner
user, Name Repo -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Repo
repo, "git", "trees", Name Tree -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Tree
sha] [("recursive", ByteString -> Maybe ByteString
forall a. a -> Maybe a
Just "1")]