(deps commandDeps)
| 201 | } |
| 202 | |
| 203 | func 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 | |
| 235 | func newBundleNetworkSettingsCommand(deps commandDeps) *cobra.Command { |
| 236 | return &cobra.Command{ |
no test coverage detected