Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
rename client service to match endpoint name
Browse files Browse the repository at this point in the history
  • Loading branch information
lmphil committed Nov 20, 2024
1 parent cd85b2a commit 9ccac05
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ to add new and/or missing endpoints. Currently, the following services are suppo
- [x] Commits
- [x] Container Registry
- [x] Custom Attributes
- [x] Dependency List Export
- [x] Deploy Keys
- [x] Deployments
- [x] Discussions (threaded comments)
Expand Down
8 changes: 4 additions & 4 deletions dependency_list.go → dependency_list_export.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http"
)

type DependencyListService struct {
type DependencyListExportService struct {
client *Client
}

Expand Down Expand Up @@ -40,7 +40,7 @@ type DependencyListExport struct {
//
// GitLab docs:
// https://docs.gitlab.com/ee/api/dependency_list_export.html#create-a-pipeline-level-dependency-list-export
func (s *DependencyListService) CreateDependencyListExport(id int, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) {
func (s *DependencyListExportService) CreateDependencyListExport(id int, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) {
// POST /pipelines/:id/dependency_list_exports
createExportPath := fmt.Sprintf("pipelines/%d/dependency_list_exports", id)

Expand All @@ -66,7 +66,7 @@ func (s *DependencyListService) CreateDependencyListExport(id int, options ...Re
//
// GitLab docs:
// https://docs.gitlab.com/ee/api/dependency_list_export.html#get-single-dependency-list-export
func (s *DependencyListService) GetDependencyListExport(id int, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) {
func (s *DependencyListExportService) GetDependencyListExport(id int, options ...RequestOptionFunc) (*DependencyListExport, *Response, error) {
// GET /dependency_list_exports/:id
getExportPath := fmt.Sprintf("dependency_list_exports/%d", id)

Expand All @@ -88,7 +88,7 @@ func (s *DependencyListService) GetDependencyListExport(id int, options ...Reque
//
// GitLab docs:
// https://docs.gitlab.com/ee/api/dependency_list_export.html#download-dependency-list-export
func (s *DependencyListService) DownloadDependencyListExport(id int, options ...RequestOptionFunc) (string, *Response, error) {
func (s *DependencyListExportService) DownloadDependencyListExport(id int, options ...RequestOptionFunc) (string, *Response, error) {
// GET /dependency_list_exports/:id/download
downloadExportPath := fmt.Sprintf("dependency_list_exports/%d/download", id)

Expand Down
6 changes: 3 additions & 3 deletions dependency_list_test.go → dependency_list_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestCreateDependencyListExport(t *testing.T) {
mustWriteHTTPResponse(t, w, "testdata/create_dependency_list_export.json")
})

export, _, err := client.DependencyList.CreateDependencyListExport(1234)
export, _, err := client.DependencyListExport.CreateDependencyListExport(1234)
require.NoError(t, err)

want := &DependencyListExport{
Expand All @@ -36,7 +36,7 @@ func TestGetDependencyListExport(t *testing.T) {
mustWriteHTTPResponse(t, w, "testdata/get_dependency_list_export.json")
})

export, _, err := client.DependencyList.GetDependencyListExport(5678)
export, _, err := client.DependencyListExport.GetDependencyListExport(5678)
require.NoError(t, err)

want := &DependencyListExport{
Expand All @@ -56,7 +56,7 @@ func TestDownloadDependencyListExport(t *testing.T) {
mustWriteHTTPResponse(t, w, "testdata/download_dependency_list_export.json")
})

sbom, _, err := client.DependencyList.DownloadDependencyListExport(5678)
sbom, _, err := client.DependencyListExport.DownloadDependencyListExport(5678)
require.NoError(t, err)

wantBytes, err := os.ReadFile("testdata/download_dependency_list_export.json")
Expand Down
4 changes: 2 additions & 2 deletions gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ type Client struct {
Commits *CommitsService
ContainerRegistry *ContainerRegistryService
CustomAttribute *CustomAttributesService
DependencyList *DependencyListService
DependencyListExport *DependencyListExportService
DeployKeys *DeployKeysService
DeployTokens *DeployTokensService
DeploymentMergeRequests *DeploymentMergeRequestsService
Expand Down Expand Up @@ -361,7 +361,7 @@ func newClient(options ...ClientOptionFunc) (*Client, error) {
c.Commits = &CommitsService{client: c}
c.ContainerRegistry = &ContainerRegistryService{client: c}
c.CustomAttribute = &CustomAttributesService{client: c}
c.DependencyList = &DependencyListService{client: c}
c.DependencyListExport = &DependencyListExportService{client: c}
c.DeployKeys = &DeployKeysService{client: c}
c.DeployTokens = &DeployTokensService{client: c}
c.DeploymentMergeRequests = &DeploymentMergeRequestsService{client: c}
Expand Down

0 comments on commit 9ccac05

Please sign in to comment.