Commit 26b62ef6 authored by Sander van Harmelen's avatar Sander van Harmelen

Reorder the list of services

parent e82b6532
...@@ -20,53 +20,53 @@ incompatible changes that were needed to fully support the V4 Gitlab API. ...@@ -20,53 +20,53 @@ incompatible changes that were needed to fully support the V4 Gitlab API.
This API client package covers most of the existing Gitlab API calls and is updated regularly This API client package covers most of the existing Gitlab API calls and is updated regularly
to add new and/or missing endpoints. Currently the following services are supported: to add new and/or missing endpoints. Currently the following services are supported:
- [ ] Discussions (threaded comments)
- [ ] Epic Issues
- [ ] Epics
- [ ] Geo Nodes
- [ ] Project import/export
- [x] Award Emojis - [x] Award Emojis
- [x] Branches - [x] Branches
- [x] Broadcast Messages - [x] Broadcast Messages
- [x] Project-level Variables
- [x] Group-level Variables
- [x] Commits - [x] Commits
- [x] Custom Attributes - [x] Custom Attributes
- [x] Deployments
- [x] Deploy Keys - [x] Deploy Keys
- [x] Deployments
- [x] Environments - [x] Environments
- [ ] Epics
- [ ] Epic Issues
- [x] Events - [x] Events
- [x] Feature flags - [x] Feature flags
- [ ] Geo Nodes
- [x] Gitignores templates
- [x] GitLab CI Config templates - [x] GitLab CI Config templates
- [x] Groups - [x] Gitignores templates
- [x] Group Access Requests - [x] Group Access Requests
- [x] Group Issue Boards
- [x] Group Members - [x] Group Members
- [x] Issues - [x] Group Milestones
- [x] Group-level Variables
- [x] Groups
- [x] Issue Boards - [x] Issue Boards
- [x] Group Issue Boards - [x] Issues
- [x] Jobs - [x] Jobs
- [x] Keys - [x] Keys
- [x] Labels - [x] Labels
- [x] License - [x] License
- [x] Merge Requests
- [x] Merge Request Approvals - [x] Merge Request Approvals
- [x] Project Milestones - [x] Merge Requests
- [x] Group Milestones
- [x] Namespaces - [x] Namespaces
- [x] Notes (comments) - [x] Notes (comments)
- [ ] Discussions (threaded comments)
- [x] Notification settings - [x] Notification settings
- [x] Open source license templates - [x] Open source license templates
- [x] Pages Domains - [x] Pages Domains
- [x] Pipelines
- [x] Pipeline Triggers
- [x] Pipeline Schedules - [x] Pipeline Schedules
- [x] Projects (including setting Webhooks) - [x] Pipeline Triggers
- [x] Pipelines
- [x] Project Access Requests - [x] Project Access Requests
- [x] Project badges - [x] Project Clusters
- [ ] Project import/export
- [x] Project Members - [x] Project Members
- [x] Project Milestones
- [x] Project Snippets - [x] Project Snippets
- [x] Project Clusters - [x] Project badges
- [x] Project-level Variables
- [x] Projects (including setting Webhooks)
- [x] Protected Branches - [x] Protected Branches
- [x] Protected Tags - [x] Protected Tags
- [x] Repositories - [x] Repositories
......
...@@ -288,9 +288,10 @@ type Client struct { ...@@ -288,9 +288,10 @@ type Client struct {
// Services used for talking to different parts of the GitLab API. // Services used for talking to different parts of the GitLab API.
AccessRequests *AccessRequestsService AccessRequests *AccessRequestsService
AwardEmoji *AwardEmojiService AwardEmoji *AwardEmojiService
Boards *IssueBoardsService
Branches *BranchesService Branches *BranchesService
BuildVariables *BuildVariablesService
BroadcastMessage *BroadcastMessagesService BroadcastMessage *BroadcastMessagesService
BuildVariables *BuildVariablesService
CIYMLTemplate *CIYMLTemplatesService CIYMLTemplate *CIYMLTemplatesService
Commits *CommitsService Commits *CommitsService
CustomAttribute *CustomAttributesService CustomAttribute *CustomAttributesService
...@@ -301,35 +302,34 @@ type Client struct { ...@@ -301,35 +302,34 @@ type Client struct {
Events *EventsService Events *EventsService
Features *FeaturesService Features *FeaturesService
GitIgnoreTemplates *GitIgnoreTemplatesService GitIgnoreTemplates *GitIgnoreTemplatesService
Groups *GroupsService
GroupIssueBoards *GroupIssueBoardsService GroupIssueBoards *GroupIssueBoardsService
GroupMembers *GroupMembersService GroupMembers *GroupMembersService
GroupMilestones *GroupMilestonesService GroupMilestones *GroupMilestonesService
GroupVariables *GroupVariablesService GroupVariables *GroupVariablesService
Issues *IssuesService Groups *GroupsService
IssueLinks *IssueLinksService IssueLinks *IssueLinksService
Issues *IssuesService
Jobs *JobsService Jobs *JobsService
Keys *KeysService Keys *KeysService
Boards *IssueBoardsService
Labels *LabelsService Labels *LabelsService
License *LicenseService License *LicenseService
LicenseTemplates *LicenseTemplatesService LicenseTemplates *LicenseTemplatesService
MergeRequests *MergeRequestsService
MergeRequestApprovals *MergeRequestApprovalsService MergeRequestApprovals *MergeRequestApprovalsService
MergeRequests *MergeRequestsService
Milestones *MilestonesService Milestones *MilestonesService
Namespaces *NamespacesService Namespaces *NamespacesService
Notes *NotesService Notes *NotesService
NotificationSettings *NotificationSettingsService NotificationSettings *NotificationSettingsService
PagesDomains *PagesDomainsService PagesDomains *PagesDomainsService
Pipelines *PipelinesService
PipelineSchedules *PipelineSchedulesService PipelineSchedules *PipelineSchedulesService
PipelineTriggers *PipelineTriggersService PipelineTriggers *PipelineTriggersService
Projects *ProjectsService Pipelines *PipelinesService
ProjectMembers *ProjectMembersService
ProjectBadges *ProjectBadgesService ProjectBadges *ProjectBadgesService
ProjectCluster *ProjectClustersService
ProjectMembers *ProjectMembersService
ProjectSnippets *ProjectSnippetsService ProjectSnippets *ProjectSnippetsService
ProjectVariables *ProjectVariablesService ProjectVariables *ProjectVariablesService
ProjectCluster *ProjectClustersService Projects *ProjectsService
ProtectedBranches *ProtectedBranchesService ProtectedBranches *ProtectedBranchesService
ProtectedTags *ProtectedTagsService ProtectedTags *ProtectedTagsService
Repositories *RepositoriesService Repositories *RepositoriesService
...@@ -430,9 +430,10 @@ func newClient(httpClient *http.Client) *Client { ...@@ -430,9 +430,10 @@ func newClient(httpClient *http.Client) *Client {
// Create all the public services. // Create all the public services.
c.AccessRequests = &AccessRequestsService{client: c} c.AccessRequests = &AccessRequestsService{client: c}
c.AwardEmoji = &AwardEmojiService{client: c} c.AwardEmoji = &AwardEmojiService{client: c}
c.Boards = &IssueBoardsService{client: c}
c.Branches = &BranchesService{client: c} c.Branches = &BranchesService{client: c}
c.BuildVariables = &BuildVariablesService{client: c}
c.BroadcastMessage = &BroadcastMessagesService{client: c} c.BroadcastMessage = &BroadcastMessagesService{client: c}
c.BuildVariables = &BuildVariablesService{client: c}
c.CIYMLTemplate = &CIYMLTemplatesService{client: c} c.CIYMLTemplate = &CIYMLTemplatesService{client: c}
c.Commits = &CommitsService{client: c} c.Commits = &CommitsService{client: c}
c.CustomAttribute = &CustomAttributesService{client: c} c.CustomAttribute = &CustomAttributesService{client: c}
...@@ -443,42 +444,41 @@ func newClient(httpClient *http.Client) *Client { ...@@ -443,42 +444,41 @@ func newClient(httpClient *http.Client) *Client {
c.Events = &EventsService{client: c} c.Events = &EventsService{client: c}
c.Features = &FeaturesService{client: c} c.Features = &FeaturesService{client: c}
c.GitIgnoreTemplates = &GitIgnoreTemplatesService{client: c} c.GitIgnoreTemplates = &GitIgnoreTemplatesService{client: c}
c.Groups = &GroupsService{client: c}
c.GroupIssueBoards = &GroupIssueBoardsService{client: c} c.GroupIssueBoards = &GroupIssueBoardsService{client: c}
c.GroupMembers = &GroupMembersService{client: c} c.GroupMembers = &GroupMembersService{client: c}
c.GroupMilestones = &GroupMilestonesService{client: c} c.GroupMilestones = &GroupMilestonesService{client: c}
c.GroupVariables = &GroupVariablesService{client: c} c.GroupVariables = &GroupVariablesService{client: c}
c.Issues = &IssuesService{client: c, timeStats: timeStats} c.Groups = &GroupsService{client: c}
c.IssueLinks = &IssueLinksService{client: c} c.IssueLinks = &IssueLinksService{client: c}
c.Issues = &IssuesService{client: c, timeStats: timeStats}
c.Jobs = &JobsService{client: c} c.Jobs = &JobsService{client: c}
c.Keys = &KeysService{client: c} c.Keys = &KeysService{client: c}
c.Boards = &IssueBoardsService{client: c}
c.Labels = &LabelsService{client: c} c.Labels = &LabelsService{client: c}
c.License = &LicenseService{client: c} c.License = &LicenseService{client: c}
c.LicenseTemplates = &LicenseTemplatesService{client: c} c.LicenseTemplates = &LicenseTemplatesService{client: c}
c.MergeRequests = &MergeRequestsService{client: c, timeStats: timeStats}
c.MergeRequestApprovals = &MergeRequestApprovalsService{client: c} c.MergeRequestApprovals = &MergeRequestApprovalsService{client: c}
c.MergeRequests = &MergeRequestsService{client: c, timeStats: timeStats}
c.Milestones = &MilestonesService{client: c} c.Milestones = &MilestonesService{client: c}
c.Namespaces = &NamespacesService{client: c} c.Namespaces = &NamespacesService{client: c}
c.Notes = &NotesService{client: c} c.Notes = &NotesService{client: c}
c.NotificationSettings = &NotificationSettingsService{client: c} c.NotificationSettings = &NotificationSettingsService{client: c}
c.PagesDomains = &PagesDomainsService{client: c} c.PagesDomains = &PagesDomainsService{client: c}
c.Pipelines = &PipelinesService{client: c}
c.PipelineSchedules = &PipelineSchedulesService{client: c} c.PipelineSchedules = &PipelineSchedulesService{client: c}
c.PipelineTriggers = &PipelineTriggersService{client: c} c.PipelineTriggers = &PipelineTriggersService{client: c}
c.Projects = &ProjectsService{client: c} c.Pipelines = &PipelinesService{client: c}
c.ProjectMembers = &ProjectMembersService{client: c}
c.ProjectBadges = &ProjectBadgesService{client: c} c.ProjectBadges = &ProjectBadgesService{client: c}
c.ProjectCluster = &ProjectClustersService{client: c}
c.ProjectMembers = &ProjectMembersService{client: c}
c.ProjectSnippets = &ProjectSnippetsService{client: c} c.ProjectSnippets = &ProjectSnippetsService{client: c}
c.ProjectVariables = &ProjectVariablesService{client: c} c.ProjectVariables = &ProjectVariablesService{client: c}
c.ProjectCluster = &ProjectClustersService{client: c} c.Projects = &ProjectsService{client: c}
c.ProtectedBranches = &ProtectedBranchesService{client: c} c.ProtectedBranches = &ProtectedBranchesService{client: c}
c.ProtectedTags = &ProtectedTagsService{client: c} c.ProtectedTags = &ProtectedTagsService{client: c}
c.Repositories = &RepositoriesService{client: c} c.Repositories = &RepositoriesService{client: c}
c.RepositoryFiles = &RepositoryFilesService{client: c} c.RepositoryFiles = &RepositoryFilesService{client: c}
c.Runners = &RunnersService{client: c} c.Runners = &RunnersService{client: c}
c.Services = &ServicesService{client: c}
c.Search = &SearchService{client: c} c.Search = &SearchService{client: c}
c.Services = &ServicesService{client: c}
c.Settings = &SettingsService{client: c} c.Settings = &SettingsService{client: c}
c.Sidekiq = &SidekiqService{client: c} c.Sidekiq = &SidekiqService{client: c}
c.Snippets = &SnippetsService{client: c} c.Snippets = &SnippetsService{client: c}
......
...@@ -33,8 +33,7 @@ type ProjectClustersService struct { ...@@ -33,8 +33,7 @@ type ProjectClustersService struct {
// ProjectCluster represents a GitLab Project Cluster. // ProjectCluster represents a GitLab Project Cluster.
// //
// GitLab API docs: // GitLab API docs: https://docs.gitlab.com/ee/api/project_clusters.html
// https://docs.gitlab.com/ee/api/project_clusters.html
type ProjectCluster struct { type ProjectCluster struct {
ID int `json:"id"` ID int `json:"id"`
Name string `json:"name"` Name string `json:"name"`
...@@ -61,15 +60,6 @@ type PlatformKubernetes struct { ...@@ -61,15 +60,6 @@ type PlatformKubernetes struct {
AuthorizationType string `json:"authorization_type"` AuthorizationType string `json:"authorization_type"`
} }
// PlatformKubernetesOptions represents the available PlatformKubernetes options.
type PlatformKubernetesOptions struct {
APIURL *string `url:"api_url,omitempty" json:"api_url,omitempty"`
Token *string `url:"token,omitempty" json:"token,omitempty"`
CaCert *string `url:"ca_cert,omitempty" json:"ca_cert,omitempty"`
Namespace *string `url:"namespace,omitempty" json:"namespace,omitempty"`
AuthorizationType *string `url:"authorization_type,omitempty" json:"authorization_type,omitempty"`
}
// ListClusters gets a list of all clusters in a project. // ListClusters gets a list of all clusters in a project.
// //
// GitLab API docs: // GitLab API docs:
...@@ -86,13 +76,13 @@ func (s *ProjectClustersService) ListClusters(pid interface{}, options ...Option ...@@ -86,13 +76,13 @@ func (s *ProjectClustersService) ListClusters(pid interface{}, options ...Option
return nil, nil, err return nil, nil, err
} }
var pc []*ProjectCluster var pcs []*ProjectCluster
resp, err := s.client.Do(req, &pc) resp, err := s.client.Do(req, &pcs)
if err != nil { if err != nil {
return nil, resp, err return nil, resp, err
} }
return pc, resp, err return pcs, resp, err
} }
// GetCluster gets a cluster. // GetCluster gets a cluster.
...@@ -111,7 +101,7 @@ func (s *ProjectClustersService) GetCluster(pid interface{}, cluster int, option ...@@ -111,7 +101,7 @@ func (s *ProjectClustersService) GetCluster(pid interface{}, cluster int, option
return nil, nil, err return nil, nil, err
} }
var pc *ProjectCluster pc := new(ProjectCluster)
resp, err := s.client.Do(req, &pc) resp, err := s.client.Do(req, &pc)
if err != nil { if err != nil {
return nil, resp, err return nil, resp, err
...@@ -131,6 +121,15 @@ type AddClusterOptions struct { ...@@ -131,6 +121,15 @@ type AddClusterOptions struct {
PlatformKubernetes *PlatformKubernetesOptions `url:"platform_kubernetes_attributes,omitempty" json:"platform_kubernetes_attributes,omitempty"` PlatformKubernetes *PlatformKubernetesOptions `url:"platform_kubernetes_attributes,omitempty" json:"platform_kubernetes_attributes,omitempty"`
} }
// PlatformKubernetesOptions represents the available PlatformKubernetes options.
type PlatformKubernetesOptions struct {
APIURL *string `url:"api_url,omitempty" json:"api_url,omitempty"`
Token *string `url:"token,omitempty" json:"token,omitempty"`
CaCert *string `url:"ca_cert,omitempty" json:"ca_cert,omitempty"`
Namespace *string `url:"namespace,omitempty" json:"namespace,omitempty"`
AuthorizationType *string `url:"authorization_type,omitempty" json:"authorization_type,omitempty"`
}
// AddCluster adds an existing cluster to the project. // AddCluster adds an existing cluster to the project.
// //
// GitLab API docs: // GitLab API docs:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment