Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
This module contains Share API calls related to projects, wrapped in the Cli monad.
Here, we also validate inputs from Share that the API itself does not. For example, in the API, a project name is just a Text. But because our client requires a richer structure for project names, we try parsing them into a ProjectName, and fail right away if parsing fails.
Synopsis
- data RemoteProject = RemoteProject {}
- data RemoteProjectBranch = RemoteProjectBranch {}
- getProjectById :: RemoteProjectId -> Cli (Maybe RemoteProject)
- getProjectByName :: ProjectName -> Cli (Maybe RemoteProject)
- getProjectByName' :: ProjectName -> Cli (Either ClientError (Maybe RemoteProject))
- createProject :: ProjectName -> Cli (Maybe RemoteProject)
- data GetProjectBranchResponse
- data IncludeSquashedHead
- getProjectBranchById :: IncludeSquashedHead -> ProjectAndBranch RemoteProjectId RemoteProjectBranchId -> Cli GetProjectBranchResponse
- getProjectBranchByName :: IncludeSquashedHead -> ProjectAndBranch RemoteProjectId ProjectBranchName -> Cli GetProjectBranchResponse
- getProjectBranchByName' :: IncludeSquashedHead -> ProjectAndBranch RemoteProjectId ProjectBranchName -> Cli (Either ClientError GetProjectBranchResponse)
- createProjectBranch :: CreateProjectBranchRequest -> Cli (Maybe RemoteProjectBranch)
- data SetProjectBranchHeadResponse
- setProjectBranchHead :: SetProjectBranchHeadRequest -> Cli SetProjectBranchHeadResponse
- hardCodedBaseUrl :: BaseUrl
- hardCodedUri :: URI
API types
data RemoteProject Source #
A remote project.
Instances
data RemoteProjectBranch Source #
A remote project branch.
Instances
API functions
getProjectById :: RemoteProjectId -> Cli (Maybe RemoteProject) Source #
Get a project by id.
On success, update the remote_project
table.
getProjectByName :: ProjectName -> Cli (Maybe RemoteProject) Source #
Get a project by name.
On success, update the remote_project
table.
getProjectByName' :: ProjectName -> Cli (Either ClientError (Maybe RemoteProject)) Source #
Variant of getProjectByName
that returns servant client errors.
createProject :: ProjectName -> Cli (Maybe RemoteProject) Source #
Create a new project. Kinda weird: returns Nothing
if the user handle part of the project doesn't exist.
On success, update the remote_project
table.
data IncludeSquashedHead Source #
Instances
Show IncludeSquashedHead Source # | |
Defined in Unison.Cli.Share.Projects showsPrec :: Int -> IncludeSquashedHead -> ShowS # show :: IncludeSquashedHead -> String # showList :: [IncludeSquashedHead] -> ShowS # | |
Eq IncludeSquashedHead Source # | |
Defined in Unison.Cli.Share.Projects (==) :: IncludeSquashedHead -> IncludeSquashedHead -> Bool # (/=) :: IncludeSquashedHead -> IncludeSquashedHead -> Bool # |
getProjectBranchById :: IncludeSquashedHead -> ProjectAndBranch RemoteProjectId RemoteProjectBranchId -> Cli GetProjectBranchResponse Source #
Get a project branch by id.
On success, update the remote_project_branch
table.
getProjectBranchByName :: IncludeSquashedHead -> ProjectAndBranch RemoteProjectId ProjectBranchName -> Cli GetProjectBranchResponse Source #
Get a project branch by name.
On success, update the remote_project_branch
table.
getProjectBranchByName' :: IncludeSquashedHead -> ProjectAndBranch RemoteProjectId ProjectBranchName -> Cli (Either ClientError GetProjectBranchResponse) Source #
Variant of getProjectBranchByName
that returns servant client errors.
createProjectBranch :: CreateProjectBranchRequest -> Cli (Maybe RemoteProjectBranch) Source #
Create a new project branch.
On success, update the remote_project_branch
table.
data SetProjectBranchHeadResponse Source #
Instances
setProjectBranchHead :: SetProjectBranchHeadRequest -> Cli SetProjectBranchHeadResponse Source #
Set a project branch head (can be a fast-forward or force-push).
Temporary special hard-coded base url
hardCodedUri :: URI Source #