/
api_op_delete.go
35 lines (30 loc) · 1.07 KB
/
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
35
// Package message contains auto-generated files. DO NOT MODIFY
package message
import (
"context"
"net/http"
"github.com/RJPearson94/twilio-sdk-go/client"
)
// Delete removes a message resource from the account
// See https://www.twilio.com/docs/chat/rest/message-resource#delete-a-message-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 message resource from the account
// See https://www.twilio.com/docs/chat/rest/message-resource#delete-a-message-resource for more details
func (c Client) DeleteWithContext(context context.Context) error {
op := client.Operation{
Method: http.MethodDelete,
URI: "/Services/{serviceSid}/Channels/{channelSid}/Messages/{sid}",
PathParams: map[string]string{
"serviceSid": c.serviceSid,
"channelSid": c.channelSid,
"sid": c.sid,
},
}
if err := c.client.Send(context, op, nil, nil); err != nil {
return err
}
return nil
}