/
api_op_delete.go
34 lines (29 loc) · 1007 Bytes
/
api_op_delete.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// This is an autogenerated file. DO NOT MODIFY
package task
import (
"context"
"net/http"
"github.com/RJPearson94/twilio-sdk-go/client"
)
// Delete removes a task resource from the account
// See https://www.twilio.com/docs/autopilot/api/task#delete-a-task-resource for more details
// Context is defaulted to Background. See https://golang.org/pkg/context/#Background for more information
func (c Client) Delete() error {
return c.DeleteWithContext(context.Background())
}
// DeleteWithContext removes a task resource from the account
// See https://www.twilio.com/docs/autopilot/api/task#delete-a-task-resource for more details
func (c Client) DeleteWithContext(context context.Context) error {
op := client.Operation{
Method: http.MethodDelete,
URI: "/Assistants/{assistantSid}/Tasks/{sid}",
PathParams: map[string]string{
"assistantSid": c.assistantSid,
"sid": c.sid,
},
}
if err := c.client.Send(context, op, nil, nil); err != nil {
return err
}
return nil
}