MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / getVersionMap

Function getVersionMap

pkg/cmd/buildinformation/bulkdelete/bulk-delete.go:181–196  ·  view source on GitHub ↗
(opts *DeleteOptions)

Source from the content-addressed store, hash-verified

179}
180
181func getVersionMap(opts *DeleteOptions) (map[string]*buildinformation.BuildInformation, []string, error) {
182 buildInfoForPackageId, err := buildinformation.Get(opts.Client, opts.Client.GetSpaceID(), buildinformation.BuildInformationQuery{
183 PackageID: opts.PackageID.Value,
184 })
185 if err != nil {
186 return nil, nil, err
187 }
188
189 allBuildInfoForPackageId, err := buildInfoForPackageId.GetAllPages(opts.Client.Sling())
190 if err != nil {
191 return nil, nil, err
192 }
193
194 optionMap, options := question.MakeItemMapAndOptions(allBuildInfoForPackageId, func(item *buildinformation.BuildInformation) string { return item.Version })
195 return optionMap, options, nil
196}
197
198func selectVersionsBasedOnUserInput(opts *DeleteOptions) ([]*buildinformation.BuildInformation, error) {
199 var selectedBuildInformationVersions []*buildinformation.BuildInformation

Callers 2

selectVersionsFunction · 0.85

Calls 2

MakeItemMapAndOptionsFunction · 0.92
GetMethod · 0.65

Tested by

no test coverage detected