module Github.Search(
searchRepos',
searchRepos,
searchReposR,
searchCode',
searchCode,
searchCodeR,
searchIssues',
searchIssues,
searchIssuesR,
module Github.Data,
) where
import Data.Text (Text)
import qualified Data.Text.Encoding as TE
import Github.Auth
import Github.Data
import Github.Request
searchRepos' :: Maybe GithubAuth -> Text -> IO (Either Error SearchReposResult)
searchRepos' auth = executeRequestMaybe auth . searchReposR
searchRepos :: Text -> IO (Either Error SearchReposResult)
searchRepos = searchRepos' Nothing
searchReposR :: Text -> GithubRequest k SearchReposResult
searchReposR searchString = GithubGet ["search", "repositories"] [("q", Just $ TE.encodeUtf8 searchString)]
searchCode' :: Maybe GithubAuth -> Text -> IO (Either Error SearchCodeResult)
searchCode' auth = executeRequestMaybe auth . searchCodeR
searchCode :: Text -> IO (Either Error SearchCodeResult)
searchCode = searchCode' Nothing
searchCodeR :: Text -> GithubRequest k SearchCodeResult
searchCodeR searchString = GithubGet ["search", "code"] [("q", Just $ TE.encodeUtf8 searchString)]
searchIssues' :: Maybe GithubAuth -> Text -> IO (Either Error SearchIssuesResult)
searchIssues' auth = executeRequestMaybe auth . searchIssuesR
searchIssues :: Text -> IO (Either Error SearchIssuesResult)
searchIssues = searchIssues' Nothing
searchIssuesR :: Text -> GithubRequest k SearchIssuesResult
searchIssuesR searchString = GithubGet ["search", "issues"] [("q", Just $ TE.encodeUtf8 searchString)]