MCPcopy Create free account
hub / github.com/compozy/agh / newBundleDeactivateCommand

Function newBundleDeactivateCommand

internal/cli/bundle.go:203–233  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

201}
202
203func newBundleDeactivateCommand(deps commandDeps) *cobra.Command {
204 return &cobra.Command{
205 Use: "deactivate <activation-id>",
206 Short: "Deactivate a bundle preset and remove owned resources",
207 Args: exactOneNonBlankArg(),
208 RunE: func(cmd *cobra.Command, args []string) error {
209 client, err := clientFromDeps(deps)
210 if err != nil {
211 return err
212 }
213 if err := client.DeactivateBundle(cmd.Context(), args[0]); err != nil {
214 return err
215 }
216 return writeCommandOutput(cmd, outputBundle{
217 jsonValue: map[string]string{"deactivated": strings.TrimSpace(args[0])},
218 human: func() (string, error) {
219 return renderHumanSection("Bundle Deactivated", []keyValue{
220 {Label: "Activation", Value: strings.TrimSpace(args[0])},
221 }), nil
222 },
223 toon: func() (string, error) {
224 return renderToonObject(
225 "bundle_deactivated",
226 []string{"activation_id"},
227 []string{args[0]},
228 ), nil
229 },
230 })
231 },
232 }
233}
234
235func newBundleNetworkSettingsCommand(deps commandDeps) *cobra.Command {
236 return &cobra.Command{

Callers 1

newBundleCommandFunction · 0.85

Calls 6

exactOneNonBlankArgFunction · 0.85
clientFromDepsFunction · 0.85
writeCommandOutputFunction · 0.85
renderHumanSectionFunction · 0.85
renderToonObjectFunction · 0.85
DeactivateBundleMethod · 0.65

Tested by

no test coverage detected