MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / DeleteSubscription

Method DeleteSubscription

module/subscribe/iml.go:183–196  ·  view source on GitHub ↗
(ctx context.Context, pid string, uuid string)

Source from the content-addressed store, hash-verified

181}
182
183func (i *imlSubscribeModule) DeleteSubscription(ctx context.Context, pid string, uuid string) error {
184 _, err := i.serviceService.Get(ctx, pid)
185 if err != nil {
186 return fmt.Errorf("get service error: %w", err)
187 }
188 subscription, err := i.subscribeService.Get(ctx, uuid)
189 if err != nil {
190 return err
191 }
192 if subscription.ApplyStatus == subscribe.ApplyStatusSubscribe || subscription.ApplyStatus == subscribe.ApplyStatusReview {
193 return fmt.Errorf("subscription can not be deleted")
194 }
195 return i.subscribeService.Delete(ctx, uuid)
196}
197
198func (i *imlSubscribeModule) RevokeApply(ctx context.Context, app string, uuid string) error {
199 _, err := i.serviceService.Get(ctx, app)

Callers

nothing calls this directly

Calls 2

GetMethod · 0.65
DeleteMethod · 0.65

Tested by

no test coverage detected