module GitHub.Endpoints.Actions.Cache (
cacheUsageOrganizationR,
cacheUsageByRepositoryR,
cacheUsageR,
cachesForRepoR,
deleteCacheR,
module GitHub.Data
) where
import GitHub.Data
import GitHub.Internal.Prelude
import Prelude ()
cacheUsageOrganizationR
:: Name Organization
-> GenRequest 'MtJSON 'RA OrganizationCacheUsage
cacheUsageOrganizationR :: Name Organization -> GenRequest 'MtJSON 'RA OrganizationCacheUsage
cacheUsageOrganizationR Name Organization
org =
Paths
-> QueryString -> GenRequest 'MtJSON 'RA OrganizationCacheUsage
forall (mt :: MediaType (*)) (rw :: RW) a.
Paths -> QueryString -> GenRequest mt rw a
Query [Text
"orgs", Name Organization -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Organization
org, Text
"actions", Text
"cache", Text
"usage"] []
cacheUsageByRepositoryR
:: Name Organization
-> FetchCount
-> GenRequest 'MtJSON 'RA (WithTotalCount RepositoryCacheUsage)
cacheUsageByRepositoryR :: Name Organization
-> FetchCount
-> GenRequest 'MtJSON 'RA (WithTotalCount RepositoryCacheUsage)
cacheUsageByRepositoryR Name Organization
org =
Paths
-> QueryString
-> FetchCount
-> GenRequest 'MtJSON 'RA (WithTotalCount RepositoryCacheUsage)
forall a (t :: * -> *) b (mt :: MediaType (*)) (rw :: RW).
(a ~ t b, Foldable t, Semigroup a) =>
Paths -> QueryString -> FetchCount -> GenRequest mt rw a
PagedQuery [Text
"orgs", Name Organization -> Text
forall a. IsPathPart a => a -> Text
toPathPart Name Organization
org, Text
"actions", Text
"cache", Text
"usage-by-repository"] []
cacheUsageR
:: Name Owner
-> Name Repo
-> Request k RepositoryCacheUsage
cacheUsageR :: forall (k :: RW).
Name Owner -> Name Repo -> Request k RepositoryCacheUsage
cacheUsageR Name Owner
user Name Repo
repo =
Paths -> QueryString -> GenRequest 'MtJSON k RepositoryCacheUsage
forall (mt :: MediaType (*)) (rw :: RW) a.
Paths -> QueryString -> GenRequest mt rw a
Query [Text
"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, Text
"actions", Text
"cache", Text
"usage"] []
cachesForRepoR
:: Name Owner
-> Name Repo
-> CacheMod
-> FetchCount
-> GenRequest 'MtJSON 'RA (WithTotalCount Cache)
cachesForRepoR :: Name Owner
-> Name Repo
-> CacheMod
-> FetchCount
-> GenRequest 'MtJSON 'RA (WithTotalCount Cache)
cachesForRepoR Name Owner
user Name Repo
repo CacheMod
opts = Paths
-> QueryString
-> FetchCount
-> GenRequest 'MtJSON 'RA (WithTotalCount Cache)
forall a (t :: * -> *) b (mt :: MediaType (*)) (rw :: RW).
(a ~ t b, Foldable t, Semigroup a) =>
Paths -> QueryString -> FetchCount -> GenRequest mt rw a
PagedQuery
[Text
"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, Text
"actions", Text
"caches"]
(CacheMod -> QueryString
cacheModToQueryString CacheMod
opts)
deleteCacheR
:: Name Owner
-> Name Repo
-> Id Cache
-> GenRequest 'MtUnit 'RW ()
deleteCacheR :: Name Owner -> Name Repo -> Id Cache -> GenRequest 'MtUnit 'RW ()
deleteCacheR Name Owner
user Name Repo
repo Id Cache
cacheid =
CommandMethod -> Paths -> ByteString -> GenRequest 'MtUnit 'RW ()
forall (mt :: MediaType (*)) a.
CommandMethod -> Paths -> ByteString -> GenRequest mt 'RW a
Command CommandMethod
Delete Paths
parts ByteString
forall a. Monoid a => a
mempty
where
parts :: Paths
parts = [Text
"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, Text
"actions", Text
"caches", Id Cache -> Text
forall a. IsPathPart a => a -> Text
toPathPart Id Cache
cacheid]