gitlab-haskell-1.0.0.1: A Haskell library for the GitLab web API
Copyright(c) Rob Stewart Heriot-Watt University 2019
LicenseBSD3
Maintainerrobstewart57@gmail.com
Stabilitystable
Safe HaskellNone
LanguageHaskell2010

GitLab.API.Projects

Description

 
Synopsis

List all projects

projects Source #

Arguments

:: 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.

createProjectForUser Source #

Arguments

:: 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

editProject Source #

Arguments

:: 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

projectForks Source #

Arguments

:: Text

name or namespace of the project

-> GitLab (Either (Response ByteString) [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

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 #

Arguments

:: Int

group ID

-> Project

project

-> AccessLevel

level of access granted

-> GitLab (Either (Response ByteString) (Maybe Project)) 

Allow to share project with group.

unshareProjectWithGroup Source #

Arguments

:: Int

group ID

-> Project

project

-> GitLab (Either (Response ByteString) (Maybe ())) 

Unshare the project from the group.

impport project members

importMembersFromProject Source #

Arguments

:: 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

forkRelation Source #

Arguments

:: 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.

unforkRelation Source #

Arguments

:: Project

forked project

-> GitLab (Either (Response ByteString) (Maybe ())) 

Delete an existing forked from relationship.

Search for projects

projectsWithName Source #

Arguments

:: Text

project name being searched for.

-> GitLab [Project] 

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

houseKeeping Source #

Arguments

:: Project

the project

-> GitLab (Either (Response ByteString) (Maybe Project)) 

Start the Housekeeping task for a project.

Transfer projects

transferProject Source #

Arguments

:: 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

multipleCommitters :: Project -> GitLab Bool Source #

Returns True is a projecthas multiple email addresses associated with all commits in a project, False otherwise.

commitsEmailAddresses :: Project -> GitLab [Text] Source #

gets the email addresses in the author information in all commit for a project.

projectOfIssue :: Issue -> GitLab Project Source #

gets the Project against which the given Issue was created.

projectDiffs :: Project -> Text -> GitLab (Either (Response ByteString) [Diff]) Source #

gets all diffs in a project for a given commit SHA.

defaultProjectAttrs Source #

Arguments

:: 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.

Constructors

ProjectAttrs 

Fields

Instances

Instances details
Eq ProjectAttrs Source # 
Instance details

Defined in GitLab.API.Projects

Show ProjectAttrs Source # 
Instance details

Defined in GitLab.API.Projects

Generic ProjectAttrs Source # 
Instance details

Defined in GitLab.API.Projects

Associated Types

type Rep ProjectAttrs :: Type -> Type #

type Rep ProjectAttrs Source # 
Instance details

Defined in GitLab.API.Projects

type Rep ProjectAttrs = D1 ('MetaData "ProjectAttrs" "GitLab.API.Projects" "gitlab-haskell-1.0.0.1-DonaEDjMHw5I5CPNrgZNHH" 'False) (C1 ('MetaCons "ProjectAttrs" 'PrefixI 'True) (((((S1 ('MetaSel ('Just "project_edit_allow_merge_on_skipped_pipeline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: (S1 ('MetaSel ('Just "project_edit_analytics_access_level") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "project_edit_approvals_before_merge") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)))) :*: ((S1 ('MetaSel ('Just "project_edit_auto_cancel_pending_pipelines") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe EnabledDisabled)) :*: S1 ('MetaSel ('Just "project_edit_auto_devops_deploy_strategy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe AutoDeployStrategy))) :*: (S1 ('MetaSel ('Just "project_edit_auto_devops_enabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "project_edit_autoclose_referenced_issues") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))))) :*: ((S1 ('MetaSel ('Just "project_edit_build_coverage_regex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "project_edit_build_git_strategy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe GitStrategy)) :*: S1 ('MetaSel ('Just "project_edit_build_timeout") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)))) :*: ((S1 ('MetaSel ('Just "project_edit_builds_access_level") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ProjectSettingAccessLevel)) :*: S1 ('MetaSel ('Just "project_edit_ci_config_path") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "project_edit_ci_default_git_depth") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Just "project_edit_ci_forward_deployment_enabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)))))) :*: (((S1 ('MetaSel ('Just "project_edit_container_registry_access_level") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ProjectSettingAccessLevel)) :*: (S1 ('MetaSel ('Just "project_edit_default_branch") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "project_edit_description") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "project_edit_emails_disabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "project_edit_external_authorization_classification_label") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "project_edit_forking_access_level") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ProjectSettingAccessLevel)) :*: S1 ('MetaSel ('Just "project_edit_id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))) :*: ((S1 ('MetaSel ('Just "project_edit_import_url") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "project_edit_issues_access_level") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ProjectSettingAccessLevel)) :*: S1 ('MetaSel ('Just "project_edit_lfs_enabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)))) :*: ((S1 ('MetaSel ('Just "project_edit_merge_method") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe MergeMethod)) :*: S1 ('MetaSel ('Just "project_edit_merge_requests_access_level") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ProjectSettingAccessLevel))) :*: (S1 ('MetaSel ('Just "project_edit_mirror_overwrites_diverged_branches") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "project_edit_mirror_trigger_builds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))))))) :*: ((((S1 ('MetaSel ('Just "project_edit_mirror_user_id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)) :*: (S1 ('MetaSel ('Just "project_edit_mirror") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "project_edit_name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "project_edit_operations_access_level") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ProjectSettingAccessLevel)) :*: S1 ('MetaSel ('Just "project_edit_only_allow_merge_if_all_discussions_are_resolved") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))) :*: (S1 ('MetaSel ('Just "project_edit_only_allow_merge_if_pipeline_succeeds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "project_edit_only_mirror_protected_branches") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))))) :*: ((S1 ('MetaSel ('Just "project_edit_packages_enabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: (S1 ('MetaSel ('Just "project_edit_pages_access_level") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ProjectSettingAccessLevel)) :*: S1 ('MetaSel ('Just "project_edit_requirements_access_level") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ProjectSettingAccessLevel)))) :*: ((S1 ('MetaSel ('Just "project_edit_restrict_user_defined_variables") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "project_edit_path") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "project_edit_public_builds") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "project_edit_remove_source_branch_after_merge") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)))))) :*: (((S1 ('MetaSel ('Just "project_edit_repository_access_level") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ProjectSettingAccessLevel)) :*: (S1 ('MetaSel ('Just "project_edit_repository_storage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "project_edit_request_access_enabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)))) :*: ((S1 ('MetaSel ('Just "project_edit_resolve_outdated_diff_discussions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "project_edit_service_desk_enabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))) :*: (S1 ('MetaSel ('Just "project_edit_shared_runners_enabled") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "project_edit_show_default_award_emojis") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool))))) :*: (((S1 ('MetaSel ('Just "project_edit_snippets_access_level") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ProjectSettingAccessLevel)) :*: S1 ('MetaSel ('Just "project_edit_squash_option") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe SquashOption))) :*: (S1 ('MetaSel ('Just "project_edit_suggestion_commit_message") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "project_edit_visibility") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Visibility)))) :*: ((S1 ('MetaSel ('Just "project_edit_wiki_access_level") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ProjectSettingAccessLevel)) :*: S1 ('MetaSel ('Just "project_edit_issues_template") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "project_edit_merge_requests_template") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "project_edit_keep_latest_artifact") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)))))))))

data ProjectSearchAttrs Source #

Attributes related to a group

Constructors

ProjectSearchAttrs 

Fields

data EnabledDisabled Source #

Is auto-cancel pending pipelines enabled or disabled

Constructors

Enabled 
Disabled 

data AutoDeployStrategy Source #

Auto Deploy strategy: continuous, manual, or timed_incremental, for the editProject functions

data GitStrategy Source #

The Git strategy, defaults to fetch, for the editProject functions

Constructors

Clone 
Fetch 
None 

Instances

Instances details
Eq GitStrategy Source # 
Instance details

Defined in GitLab.API.Projects

Show GitStrategy Source # 
Instance details

Defined in GitLab.API.Projects

data MergeMethod Source #

The project git merge method, for the editProject functions

Constructors

Merge 
RebaseMerge 
FF 

Instances

Instances details
Eq MergeMethod Source # 
Instance details

Defined in GitLab.API.Projects

Show MergeMethod Source # 
Instance details

Defined in GitLab.API.Projects

data SquashOption Source #

The project git merge squash option, for the editProject functions

Instances

Instances details
Eq SquashOption Source # 
Instance details

Defined in GitLab.API.Projects

Show SquashOption Source # 
Instance details

Defined in GitLab.API.Projects