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

Function deleteCmd

pkg/cmd/chat/push/push.go:126–160  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124}
125
126func deleteCmd() *cobra.Command {
127 cmd := &cobra.Command{
128 Use: "delete-pushprovider --push-provider-type [type] --push-provider-name [name]",
129 Short: "Delete a push provider",
130 Example: heredoc.Doc(`
131 # Delete an APN push provider
132 $ stream-cli chat delete-pushprovider --push-provider-type apn --push-provider-name staging
133 `),
134 RunE: func(cmd *cobra.Command, args []string) error {
135 c, err := config.GetConfig(cmd).GetClient(cmd)
136 if err != nil {
137 return err
138 }
139
140 providerName, _ := cmd.Flags().GetString("push-provider-name")
141 providerType, _ := cmd.Flags().GetString("push-provider-type")
142
143 _, err = c.DeletePushProvider(cmd.Context(), providerType, providerName)
144 if err != nil {
145 return err
146 }
147
148 cmd.Println("Successfully deleted push provider.")
149 return nil
150 },
151 }
152
153 fl := cmd.Flags()
154 fl.StringP("push-provider-type", "t", "", "[required] Push provider type")
155 fl.StringP("push-provider-name", "n", "", "[required] Push provider name")
156 _ = cmd.MarkFlagRequired("push-provider-type")
157 _ = cmd.MarkFlagRequired("push-provider-name")
158
159 return cmd
160}
161
162func testCmd() *cobra.Command {
163 cmd := &cobra.Command{

Callers 1

NewCmdsFunction · 0.70

Calls 2

GetConfigFunction · 0.92
GetClientMethod · 0.80

Tested by

no test coverage detected