diff --git a/README.md b/README.md index fa5a049a3..6038bedb2 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/dependency_list.go b/dependency_list_export.go similarity index 86% rename from dependency_list.go rename to dependency_list_export.go index b74f5ab3f..cf0ab40ca 100644 --- a/dependency_list.go +++ b/dependency_list_export.go @@ -6,7 +6,7 @@ import ( "net/http" ) -type DependencyListService struct { +type DependencyListExportService struct { client *Client } @@ -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) @@ -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) @@ -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) diff --git a/dependency_list_test.go b/dependency_list_export_test.go similarity index 88% rename from dependency_list_test.go rename to dependency_list_export_test.go index f52968557..7a7700bb8 100644 --- a/dependency_list_test.go +++ b/dependency_list_export_test.go @@ -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{ @@ -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{ @@ -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") diff --git a/gitlab.go b/gitlab.go index 1363073ad..31b62bd5f 100644 --- a/gitlab.go +++ b/gitlab.go @@ -122,7 +122,7 @@ type Client struct { Commits *CommitsService ContainerRegistry *ContainerRegistryService CustomAttribute *CustomAttributesService - DependencyList *DependencyListService + DependencyListExport *DependencyListExportService DeployKeys *DeployKeysService DeployTokens *DeployTokensService DeploymentMergeRequests *DeploymentMergeRequestsService @@ -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}