-- | -- The actions API as documented at -- . module GitHub.Endpoints.Actions.Secrets ( organizationSecretsR, organizationPublicKeyR, organizationSecretR, setOrganizationSecretR, deleteOrganizationSecretR, organizationSelectedRepositoriesForSecretR, setOrganizationSelectedRepositoriesForSecretR, addOrganizationSelectedRepositoriesForSecretR, removeOrganizationSelectedRepositoriesForSecretR, repoSecretsR, repoPublicKeyR, repoSecretR, setRepoSecretR, deleteRepoSecretR, environmentSecretsR, environmentPublicKeyR, environmentSecretR, setEnvironmentSecretR, deleteEnvironmentSecretR, module GitHub.Data ) where import GitHub.Data import GitHub.Internal.Prelude import Prelude () -- | List organization secrets. -- See organizationSecretsR :: Name Organization -> FetchCount -> GenRequest 'MtJSON 'RA (WithTotalCount OrganizationSecret) organizationSecretsR org = PagedQuery ["orgs", toPathPart org, "actions", "secrets"] [] -- | List organization secrets. -- See organizationPublicKeyR :: Name Organization -> GenRequest 'MtJSON 'RA PublicKey organizationPublicKeyR org = Query ["orgs", toPathPart org, "actions", "secrets", "public-key"] [] -- | Get an organization secret. -- See organizationSecretR :: Name Organization -> Name OrganizationSecret -> GenRequest 'MtJSON 'RA OrganizationSecret organizationSecretR org name = Query ["orgs", toPathPart org, "actions", "secrets", toPathPart name] [] -- | Create or update an organization secret. -- See setOrganizationSecretR :: Name Organization -> Name OrganizationSecret -> SetSecret -> GenRequest 'MtUnit 'RW () setOrganizationSecretR org name = Command Put ["orgs", toPathPart org, "actions", "secrets", toPathPart name] . encode -- | Delete an organization secret. -- See deleteOrganizationSecretR :: Name Organization -> Name OrganizationSecret -> GenRequest 'MtUnit 'RW () deleteOrganizationSecretR org name = Command Delete parts mempty where parts = ["orgs", toPathPart org, "actions", "secrets", toPathPart name] -- | Get selected repositories for an organization secret. -- See organizationSelectedRepositoriesForSecretR :: Name Organization -> Name OrganizationSecret -> FetchCount -> GenRequest 'MtJSON 'RA (WithTotalCount SelectedRepo) organizationSelectedRepositoriesForSecretR org name = PagedQuery ["orgs", toPathPart org, "actions", "secrets", toPathPart name, "repositories"] [] -- | Set selected repositories for an organization secret. -- See setOrganizationSelectedRepositoriesForSecretR :: Name Organization -> Name OrganizationSecret -> SetSelectedRepositories -> GenRequest 'MtUnit 'RW () setOrganizationSelectedRepositoriesForSecretR org name = Command Put ["orgs", toPathPart org, "actions", "secrets", toPathPart name, "repositories"] . encode -- | Add selected repository to an organization secret. -- See addOrganizationSelectedRepositoriesForSecretR :: Name Organization -> Name OrganizationSecret -> Id Repo -> GenRequest 'MtUnit 'RW () addOrganizationSelectedRepositoriesForSecretR org name repo = Command Put ["orgs", toPathPart org, "actions", "secrets", toPathPart name, "repositories", toPathPart repo] mempty -- | Remove selected repository from an organization secret. -- See removeOrganizationSelectedRepositoriesForSecretR :: Name Organization -> Name OrganizationSecret -> Id Repo -> GenRequest 'MtUnit 'RW () removeOrganizationSelectedRepositoriesForSecretR org name repo = Command Delete ["orgs", toPathPart org, "actions", "secrets", toPathPart name, "repositories", toPathPart repo] mempty -- | List repository secrets. -- See repoSecretsR :: Name Owner -> Name Repo -> FetchCount -> GenRequest 'MtJSON 'RA (WithTotalCount RepoSecret) repoSecretsR user repo = PagedQuery ["repos", toPathPart user, toPathPart repo, "actions", "secrets"] [] -- | Get a repository public key. -- See repoPublicKeyR :: Name Owner -> Name Organization -> GenRequest 'MtJSON 'RA PublicKey repoPublicKeyR user org = Query ["repos", toPathPart user, toPathPart org, "actions", "secrets", "public-key"] [] -- | Get a repository secret. -- See repoSecretR :: Name Owner -> Name Organization -> Name RepoSecret -> GenRequest 'MtJSON 'RA RepoSecret repoSecretR user org name = Query ["repos", toPathPart user, toPathPart org, "actions", "secrets", toPathPart name] [] -- | Create or update a repository secret. -- See setRepoSecretR :: Name Owner -> Name Organization -> Name RepoSecret -> SetRepoSecret -> GenRequest 'MtUnit 'RW () setRepoSecretR user org name = Command Put ["repos", toPathPart user, toPathPart org, "actions", "secrets", toPathPart name] . encode -- | Delete a repository secret. -- See deleteRepoSecretR :: Name Owner -> Name Organization -> Name RepoSecret -> GenRequest 'MtUnit 'RW () deleteRepoSecretR user org name = Command Delete parts mempty where parts = ["repos", toPathPart user, toPathPart org, "actions", "secrets", toPathPart name] -- | List environment secrets. -- See environmentSecretsR :: Id Repo -> Name Environment -> FetchCount -> GenRequest 'MtJSON 'RA (WithTotalCount RepoSecret) environmentSecretsR repo env = PagedQuery ["repositories", toPathPart repo, "environments", toPathPart env, "secrets"] [] -- | Get an environment public key. -- See environmentPublicKeyR :: Id Repo -> Name Environment -> GenRequest 'MtJSON 'RA PublicKey environmentPublicKeyR repo env = Query ["repositories", toPathPart repo, "environments", toPathPart env, "secrets", "public-key"] [] -- | Get an environment secret -- See environmentSecretR :: Id Repo -> Name Environment -> Name RepoSecret -> GenRequest 'MtJSON 'RA RepoSecret environmentSecretR repo env name = Query ["repositories", toPathPart repo, "environments", toPathPart env, "secrets", toPathPart name] [] -- | Create or update an environment secret. -- See setEnvironmentSecretR :: Id Repo -> Name Environment -> Name RepoSecret -> SetRepoSecret -> GenRequest 'MtUnit 'RW () setEnvironmentSecretR repo env name = Command Put ["repositories", toPathPart repo, "environments", toPathPart env, "secrets", toPathPart name] . encode -- | Delete an environment secret. -- See deleteEnvironmentSecretR :: Id Repo -> Name Environment -> Name RepoSecret -> GenRequest 'MtUnit 'RW () deleteEnvironmentSecretR repo env name = Command Delete parts mempty where parts = ["repositories", toPathPart repo, "environments", toPathPart env, "secrets", toPathPart name]