module GitHub.Endpoints.Search(
searchReposR,
searchCodeR,
searchIssuesR,
searchUsersR,
module GitHub.Data,
) where
import GitHub.Data
import GitHub.Internal.Prelude
import Prelude ()
import qualified Data.Text.Encoding as TE
searchReposR :: Text -> FetchCount -> Request k (SearchResult Repo)
searchReposR :: forall (k :: RW).
Text -> FetchCount -> Request k (SearchResult Repo)
searchReposR Text
searchString =
Paths
-> QueryString
-> FetchCount
-> GenRequest 'MtJSON k (SearchResult Repo)
forall a (t :: * -> *) b (mt :: MediaType (*)) (rw :: RW).
(a ~ t b, Foldable t, Semigroup a) =>
Paths -> QueryString -> FetchCount -> GenRequest mt rw a
PagedQuery [Text
"search", Text
"repositories"] [(ByteString
"q", ByteString -> Maybe ByteString
forall a. a -> Maybe a
Just (ByteString -> Maybe ByteString) -> ByteString -> Maybe ByteString
forall a b. (a -> b) -> a -> b
$ Text -> ByteString
TE.encodeUtf8 Text
searchString)]
searchCodeR :: Text -> FetchCount -> Request k (SearchResult Code)
searchCodeR :: forall (k :: RW).
Text -> FetchCount -> Request k (SearchResult Code)
searchCodeR Text
searchString =
Paths
-> QueryString
-> FetchCount
-> GenRequest 'MtJSON k (SearchResult Code)
forall a (t :: * -> *) b (mt :: MediaType (*)) (rw :: RW).
(a ~ t b, Foldable t, Semigroup a) =>
Paths -> QueryString -> FetchCount -> GenRequest mt rw a
PagedQuery [Text
"search", Text
"code"] [(ByteString
"q", ByteString -> Maybe ByteString
forall a. a -> Maybe a
Just (ByteString -> Maybe ByteString) -> ByteString -> Maybe ByteString
forall a b. (a -> b) -> a -> b
$ Text -> ByteString
TE.encodeUtf8 Text
searchString)]
searchIssuesR :: Text -> FetchCount -> Request k (SearchResult Issue)
searchIssuesR :: forall (k :: RW).
Text -> FetchCount -> Request k (SearchResult Issue)
searchIssuesR Text
searchString =
Paths
-> QueryString
-> FetchCount
-> GenRequest 'MtJSON k (SearchResult Issue)
forall a (t :: * -> *) b (mt :: MediaType (*)) (rw :: RW).
(a ~ t b, Foldable t, Semigroup a) =>
Paths -> QueryString -> FetchCount -> GenRequest mt rw a
PagedQuery [Text
"search", Text
"issues"] [(ByteString
"q", ByteString -> Maybe ByteString
forall a. a -> Maybe a
Just (ByteString -> Maybe ByteString) -> ByteString -> Maybe ByteString
forall a b. (a -> b) -> a -> b
$ Text -> ByteString
TE.encodeUtf8 Text
searchString)]
searchUsersR :: Text -> FetchCount -> Request k (SearchResult SimpleUser)
searchUsersR :: forall (k :: RW).
Text -> FetchCount -> Request k (SearchResult SimpleUser)
searchUsersR Text
searchString =
Paths
-> QueryString
-> FetchCount
-> GenRequest 'MtJSON k (SearchResult SimpleUser)
forall a (t :: * -> *) b (mt :: MediaType (*)) (rw :: RW).
(a ~ t b, Foldable t, Semigroup a) =>
Paths -> QueryString -> FetchCount -> GenRequest mt rw a
PagedQuery [Text
"search", Text
"users"] [(ByteString
"q", ByteString -> Maybe ByteString
forall a. a -> Maybe a
Just (ByteString -> Maybe ByteString) -> ByteString -> Maybe ByteString
forall a b. (a -> b) -> a -> b
$ Text -> ByteString
TE.encodeUtf8 Text
searchString)]