Copyright | (c) Rob Stewart Heriot-Watt University 2019 |
---|---|
License | BSD3 |
Maintainer | robstewart57@gmail.com |
Stability | stable |
Safe Haskell | None |
Language | Haskell2010 |
- List all projects
- Get single project
- Get project users
- User projects
- starredProjects
- project groups
- create project
- edit project
- fork project
- forks of project
- starring projects
- archving projects
- delete project
- share projects with groups
- impport project members
- fork relationship
- Search for projects
- housekeeping
- Transfer projects
- Additional functionality beyond the GitLab Projects API
Synopsis
- projects :: ProjectSearchAttrs -> GitLab [Project]
- project :: Int -> GitLab (Either (Response ByteString) (Maybe Project))
- projectUsers :: Project -> GitLab (Either (Response ByteString) [User])
- userProjects :: User -> ProjectSearchAttrs -> GitLab (Maybe [Project])
- starredProjects :: User -> ProjectSearchAttrs -> GitLab [Project]
- projectGroups :: Project -> GitLab (Either (Response ByteString) [Group])
- createProject :: Text -> Text -> GitLab (Either (Response ByteString) (Maybe Project))
- createProjectForUser :: User -> Text -> GitLab (Either (Response ByteString) (Maybe Project))
- editProject :: Project -> ProjectAttrs -> GitLab (Either (Response ByteString) Project)
- forkProject :: Project -> GitLab (Either (Response ByteString) (Maybe Project))
- projectForks :: Text -> GitLab (Either (Response ByteString) [Project])
- starProject :: Project -> GitLab (Either (Response ByteString) (Maybe Project))
- unstarProject :: Project -> GitLab (Either (Response ByteString) (Maybe Project))
- projectStarrers :: Project -> GitLab (Either (Response ByteString) [Group])
- archiveProject :: Project -> GitLab (Either (Response ByteString) (Maybe Project))
- unarchiveProject :: Project -> GitLab (Either (Response ByteString) (Maybe Project))
- deleteProject :: Project -> GitLab (Either (Response ByteString) (Maybe ()))
- shareProjectWithGroup :: Int -> Project -> AccessLevel -> GitLab (Either (Response ByteString) (Maybe Project))
- unshareProjectWithGroup :: Int -> Project -> GitLab (Either (Response ByteString) (Maybe ()))
- importMembersFromProject :: Project -> Project -> GitLab (Either (Response ByteString) (Maybe Project))
- forkRelation :: Project -> Project -> GitLab (Either (Response ByteString) (Maybe Project))
- unforkRelation :: Project -> GitLab (Either (Response ByteString) (Maybe ()))
- projectsWithName :: Text -> GitLab [Project]
- projectWithPathAndName :: Text -> Text -> GitLab (Either (Response ByteString) (Maybe Project))
- houseKeeping :: Project -> GitLab (Either (Response ByteString) (Maybe Project))
- transferProject :: Project -> Text -> GitLab (Either (Response ByteString) Project)
- multipleCommitters :: Project -> GitLab Bool
- commitsEmailAddresses :: Project -> GitLab [Text]
- projectOfIssue :: Issue -> GitLab Project
- projectDiffs :: Project -> Text -> GitLab (Either (Response ByteString) [Diff])
- defaultProjectAttrs :: Int -> ProjectAttrs
- defaultProjectSearchAttrs :: ProjectSearchAttrs
- data ProjectAttrs = ProjectAttrs {
- project_edit_allow_merge_on_skipped_pipeline :: Maybe Bool
- project_edit_analytics_access_level :: Maybe Text
- project_edit_approvals_before_merge :: Maybe Int
- project_edit_auto_cancel_pending_pipelines :: Maybe EnabledDisabled
- project_edit_auto_devops_deploy_strategy :: Maybe AutoDeployStrategy
- project_edit_auto_devops_enabled :: Maybe Bool
- project_edit_autoclose_referenced_issues :: Maybe Bool
- project_edit_build_coverage_regex :: Maybe Text
- project_edit_build_git_strategy :: Maybe GitStrategy
- project_edit_build_timeout :: Maybe Int
- project_edit_builds_access_level :: Maybe ProjectSettingAccessLevel
- project_edit_ci_config_path :: Maybe Text
- project_edit_ci_default_git_depth :: Maybe Int
- project_edit_ci_forward_deployment_enabled :: Maybe Bool
- project_edit_container_registry_access_level :: Maybe ProjectSettingAccessLevel
- project_edit_default_branch :: Maybe Text
- project_edit_description :: Maybe Text
- project_edit_emails_disabled :: Maybe Bool
- project_edit_external_authorization_classification_label :: Maybe Text
- project_edit_forking_access_level :: Maybe ProjectSettingAccessLevel
- project_edit_id :: Int
- project_edit_import_url :: Maybe Text
- project_edit_issues_access_level :: Maybe ProjectSettingAccessLevel
- project_edit_lfs_enabled :: Maybe Bool
- project_edit_merge_method :: Maybe MergeMethod
- project_edit_merge_requests_access_level :: Maybe ProjectSettingAccessLevel
- project_edit_mirror_overwrites_diverged_branches :: Maybe Bool
- project_edit_mirror_trigger_builds :: Maybe Bool
- project_edit_mirror_user_id :: Maybe Int
- project_edit_mirror :: Maybe Bool
- project_edit_name :: Maybe Text
- project_edit_operations_access_level :: Maybe ProjectSettingAccessLevel
- project_edit_only_allow_merge_if_all_discussions_are_resolved :: Maybe Bool
- project_edit_only_allow_merge_if_pipeline_succeeds :: Maybe Bool
- project_edit_only_mirror_protected_branches :: Maybe Bool
- project_edit_packages_enabled :: Maybe Bool
- project_edit_pages_access_level :: Maybe ProjectSettingAccessLevel
- project_edit_requirements_access_level :: Maybe ProjectSettingAccessLevel
- project_edit_restrict_user_defined_variables :: Maybe Bool
- project_edit_path :: Maybe Text
- project_edit_public_builds :: Maybe Bool
- project_edit_remove_source_branch_after_merge :: Maybe Bool
- project_edit_repository_access_level :: Maybe ProjectSettingAccessLevel
- project_edit_repository_storage :: Maybe Text
- project_edit_request_access_enabled :: Maybe Bool
- project_edit_resolve_outdated_diff_discussions :: Maybe Bool
- project_edit_service_desk_enabled :: Maybe Bool
- project_edit_shared_runners_enabled :: Maybe Bool
- project_edit_show_default_award_emojis :: Maybe Bool
- project_edit_snippets_access_level :: Maybe ProjectSettingAccessLevel
- project_edit_squash_option :: Maybe SquashOption
- project_edit_suggestion_commit_message :: Maybe Text
- project_edit_visibility :: Maybe Visibility
- project_edit_wiki_access_level :: Maybe ProjectSettingAccessLevel
- project_edit_issues_template :: Maybe Text
- project_edit_merge_requests_template :: Maybe Text
- project_edit_keep_latest_artifact :: Maybe Bool
- data ProjectSearchAttrs = ProjectSearchAttrs {
- projectSearchFilter_archived :: Maybe Bool
- projectSearchFilter_id_after :: Maybe Int
- projectSearchFilter_id_before :: Maybe Bool
- projectSearchFilter_imported :: Maybe Bool
- projectSearchFilter_last_activity_after :: Maybe UTCTime
- projectSearchFilter_last_activity_before :: Maybe UTCTime
- projectSearchFilter_membership :: Maybe Bool
- projectSearchFilter_min_access_level :: Maybe AccessLevel
- projectSearchFilter_order_by :: Maybe OrderBy
- projectSearchFilter_owned :: Maybe Bool
- projectSearchFilter_repository_checksum_failed :: Maybe Bool
- projectSearchFilter_repository_storage :: Maybe Text
- projectSearchFilter_search_namespaces :: Maybe Bool
- projectSearchFilter_search :: Maybe Text
- projectSearchFilter_simple :: Maybe Bool
- projectSearchFilter_sort :: Maybe SortBy
- projectSearchFilter_starred :: Maybe Bool
- projectSearchFilter_statistics :: Maybe Bool
- projectSearchFilter_topic :: Maybe Text
- projectSearchFilter_topic_id :: Maybe Int
- projectSearchFilter_visibility :: Maybe Visibility
- projectSearchFilter_with_custom_attributes :: Maybe Bool
- projectSearchFilter_with_issues_enabled :: Maybe Bool
- projectSearchFilter_with_merge_requests_enabled :: Maybe Bool
- projectSearchFilter_with_programming_language :: Maybe Text
- data EnabledDisabled
- data AutoDeployStrategy
- data GitStrategy
- data ProjectSettingAccessLevel
- data MergeMethod
- = Merge
- | RebaseMerge
- | FF
- data SquashOption
List all projects
:: ProjectSearchAttrs | project filters |
-> GitLab [Project] |
Get a list of all visible projects across GitLab for the authenticated user. When accessed without authentication, only public projects with simple fields are returned.
Get single project
project :: Int -> GitLab (Either (Response ByteString) (Maybe Project)) Source #
Get a specific project. This endpoint can be accessed without authentication if the project is publicly accessible.
Get project users
projectUsers :: Project -> GitLab (Either (Response ByteString) [User]) Source #
Get the users list of a project.
User projects
userProjects :: User -> ProjectSearchAttrs -> GitLab (Maybe [Project]) Source #
gets all projects for a user.
userProjects myUser
starredProjects
starredProjects :: User -> ProjectSearchAttrs -> GitLab [Project] Source #
Get a list of visible projects starred by the given user. When accessed without authentication, only public projects are returned.
userProjects myUser
project groups
projectGroups :: Project -> GitLab (Either (Response ByteString) [Group]) Source #
Get a list of ancestor groups for this project.
create project
createProject :: Text -> Text -> GitLab (Either (Response ByteString) (Maybe Project)) Source #
Creates a new project owned by the authenticated user.
:: User | user to create the project for |
-> Text | name of the new project |
-> GitLab (Either (Response ByteString) (Maybe Project)) |
Creates a new project owned by the specified user. Available only for administrators.
edit project
:: Project | project |
-> ProjectAttrs | project attributes |
-> GitLab (Either (Response ByteString) Project) |
Edit a project. The defaultProjectAttrs
value has default project
search values, which is a record that can be modified with Just
values.
For example to disable project specific email notifications:
editProject myProject (defaultProjectAttrs { project_edit_emails_disabled = Just True })
fork project
forkProject :: Project -> GitLab (Either (Response ByteString) (Maybe Project)) Source #
Forks a project into the user namespace of the authenticated user or the one provided.
forks of project
List the projects accessible to the calling user that have an established, forked relationship with the specified project
projectForks "project1" projectForks "group1/project1"
starring projects
starProject :: Project -> GitLab (Either (Response ByteString) (Maybe Project)) Source #
Stars a given project.
unstarProject :: Project -> GitLab (Either (Response ByteString) (Maybe Project)) Source #
Stars a given project.
projectStarrers :: Project -> GitLab (Either (Response ByteString) [Group]) Source #
List the users who starred the specified project.
archving projects
archiveProject :: Project -> GitLab (Either (Response ByteString) (Maybe Project)) Source #
Archives the project if the user is either an administrator or the owner of this project.
unarchiveProject :: Project -> GitLab (Either (Response ByteString) (Maybe Project)) Source #
Unarchives the project if the user is either an administrator or the owner of this project.
delete project
deleteProject :: Project -> GitLab (Either (Response ByteString) (Maybe ())) Source #
Deletes a project including all associated resources.
share projects with groups
shareProjectWithGroup Source #
:: Int | group ID |
-> Project | project |
-> AccessLevel | level of access granted |
-> GitLab (Either (Response ByteString) (Maybe Project)) |
Allow to share project with group.
unshareProjectWithGroup Source #
Unshare the project from the group.
impport project members
importMembersFromProject Source #
:: Project | project to receive memvers |
-> Project | source project to import members from |
-> GitLab (Either (Response ByteString) (Maybe Project)) |
Import members from another project.
fork relationship
:: Project | forked project |
-> Project | project that was forked from |
-> GitLab (Either (Response ByteString) (Maybe Project)) |
Allows modification of the forked relationship between existing projects. Available only for project owners and administrators.
Delete an existing forked from relationship.
Search for projects
gets all projects with the given project name. It only returns projects with an exact match with the project path.
projectsWithName "project1"
projectWithPathAndName :: Text -> Text -> GitLab (Either (Response ByteString) (Maybe Project)) Source #
gets a project with the given name for the given full path of the namespace. E.g.
projectWithPathAndName "user1" "project1"
looks for "user1/project1"
projectWithPathAndName "group1/subgroup1" "project1"
looks for "project1" within the namespace with full path "group1/subgroup1"
housekeeping
Start the Housekeeping task for a project.
Transfer projects
:: Project | project |
-> Text | namespace where to transfer project to |
-> GitLab (Either (Response ByteString) Project) |
transfer a project to a new namespace.
Additional functionality beyond the GitLab Projects API
commitsEmailAddresses :: Project -> GitLab [Text] Source #
gets the email addresses in the author information in all commit for a project.
projectDiffs :: Project -> Text -> GitLab (Either (Response ByteString) [Diff]) Source #
gets all diffs in a project for a given commit SHA.
:: Int | project ID |
-> ProjectAttrs |
A default set of project attributes to override with the
editProject
functions. Only the project ID value is set is a
search parameter, all other search parameters are not set and can
be overwritten.
defaultProjectSearchAttrs :: ProjectSearchAttrs Source #
A default set of project searc filters where no project filters are applied, thereby returning all projects.
data ProjectAttrs Source #
Attributes for updating when editing a project with the
editProject
functions.
ProjectAttrs | |
|
Instances
data ProjectSearchAttrs Source #
Attributes related to a group
ProjectSearchAttrs | |
|
data EnabledDisabled Source #
Is auto-cancel pending pipelines enabled or disabled
Instances
Eq EnabledDisabled Source # | |
Defined in GitLab.API.Projects (==) :: EnabledDisabled -> EnabledDisabled -> Bool # (/=) :: EnabledDisabled -> EnabledDisabled -> Bool # | |
Show EnabledDisabled Source # | |
Defined in GitLab.API.Projects showsPrec :: Int -> EnabledDisabled -> ShowS # show :: EnabledDisabled -> String # showList :: [EnabledDisabled] -> ShowS # |
data AutoDeployStrategy Source #
Auto Deploy strategy: continuous, manual, or timed_incremental,
for the editProject
functions
Instances
Eq AutoDeployStrategy Source # | |
Defined in GitLab.API.Projects (==) :: AutoDeployStrategy -> AutoDeployStrategy -> Bool # (/=) :: AutoDeployStrategy -> AutoDeployStrategy -> Bool # | |
Show AutoDeployStrategy Source # | |
Defined in GitLab.API.Projects showsPrec :: Int -> AutoDeployStrategy -> ShowS # show :: AutoDeployStrategy -> String # showList :: [AutoDeployStrategy] -> ShowS # |
data GitStrategy Source #
The Git strategy, defaults to fetch, for the editProject
functions
Instances
Eq GitStrategy Source # | |
Defined in GitLab.API.Projects (==) :: GitStrategy -> GitStrategy -> Bool # (/=) :: GitStrategy -> GitStrategy -> Bool # | |
Show GitStrategy Source # | |
Defined in GitLab.API.Projects showsPrec :: Int -> GitStrategy -> ShowS # show :: GitStrategy -> String # showList :: [GitStrategy] -> ShowS # |
data ProjectSettingAccessLevel Source #
The project access level setting, for the editProject
functions
Instances
Eq ProjectSettingAccessLevel Source # | |
Defined in GitLab.API.Projects | |
Show ProjectSettingAccessLevel Source # | |
Defined in GitLab.API.Projects showsPrec :: Int -> ProjectSettingAccessLevel -> ShowS # show :: ProjectSettingAccessLevel -> String # showList :: [ProjectSettingAccessLevel] -> ShowS # |
data MergeMethod Source #
The project git merge method, for the editProject
functions
Instances
Eq MergeMethod Source # | |
Defined in GitLab.API.Projects (==) :: MergeMethod -> MergeMethod -> Bool # (/=) :: MergeMethod -> MergeMethod -> Bool # | |
Show MergeMethod Source # | |
Defined in GitLab.API.Projects showsPrec :: Int -> MergeMethod -> ShowS # show :: MergeMethod -> String # showList :: [MergeMethod] -> ShowS # |
data SquashOption Source #
The project git merge squash option, for the editProject
functions
Instances
Eq SquashOption Source # | |
Defined in GitLab.API.Projects (==) :: SquashOption -> SquashOption -> Bool # (/=) :: SquashOption -> SquashOption -> Bool # | |
Show SquashOption Source # | |
Defined in GitLab.API.Projects showsPrec :: Int -> SquashOption -> ShowS # show :: SquashOption -> String # showList :: [SquashOption] -> ShowS # |