MCPcopy Create free account
hub / github.com/GetStream/stream-cli / deleteCmd

Function deleteCmd

pkg/cmd/chat/channeltype/channeltype.go:105–134  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103}
104
105func 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
136func updateCmd() *cobra.Command {
137 cmd := &cobra.Command{

Callers 1

NewCmdsFunction · 0.70

Calls 2

GetConfigFunction · 0.92
GetClientMethod · 0.80

Tested by

no test coverage detected