| 103 | } |
| 104 | |
| 105 | func deleteCmd() *cobra.Command { |
| 106 | return &cobra.Command{ |
| 107 | Use: "delete-channel-type [channel-type]", |
| 108 | Short: "Delete channel type", |
| 109 | Long: heredoc.Doc(` |
| 110 | This command deletes a channel type. |
| 111 | `), |
| 112 | Example: heredoc.Doc(` |
| 113 | # Delete a channel type called my-ch-type |
| 114 | $ stream-cli chat delete-channel-type my-ch-type |
| 115 | `), |
| 116 | Args: cobra.ExactArgs(1), |
| 117 | RunE: func(cmd *cobra.Command, args []string) error { |
| 118 | c, err := config.GetConfig(cmd).GetClient(cmd) |
| 119 | if err != nil { |
| 120 | return err |
| 121 | } |
| 122 | |
| 123 | ct := args[0] |
| 124 | |
| 125 | _, err = c.GetChannelType(cmd.Context(), ct) |
| 126 | if err != nil { |
| 127 | return err |
| 128 | } |
| 129 | |
| 130 | cmd.Println("Successfully deleted channel type.") |
| 131 | return nil |
| 132 | }, |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | func updateCmd() *cobra.Command { |
| 137 | cmd := &cobra.Command{ |