-
Notifications
You must be signed in to change notification settings - Fork 0
/
channel.go
90 lines (69 loc) · 3.9 KB
/
channel.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// Code generated by GetStream internal OpenAPI code generator. DO NOT EDIT.
package getstream
import "context"
type Channels struct {
channelType string
channelD string
client *ChatClient
}
func NewChannel(channelType string, channelD string, client *ChatClient) *Channels {
return &Channels{
channelType: channelType,
channelD: channelD,
client: client,
}
}
func (c *Channels) Delete(ctx context.Context, request *DeleteChannelRequest) (*StreamResponse[DeleteChannelResponse], error) {
return c.client.DeleteChannel(ctx, c.channelType, c.channelD, request)
}
func (c *Channels) UpdateChannelPartial(ctx context.Context, request *UpdateChannelPartialRequest) (*StreamResponse[UpdateChannelPartialResponse], error) {
return c.client.UpdateChannelPartial(ctx, c.channelType, c.channelD, request)
}
func (c *Channels) Update(ctx context.Context, request *UpdateChannelRequest) (*StreamResponse[UpdateChannelResponse], error) {
return c.client.UpdateChannel(ctx, c.channelType, c.channelD, request)
}
func (c *Channels) SendEvent(ctx context.Context, request *SendEventRequest) (*StreamResponse[EventResponse], error) {
return c.client.SendEvent(ctx, c.channelType, c.channelD, request)
}
func (c *Channels) DeleteFile(ctx context.Context, request *DeleteFileRequest) (*StreamResponse[Response], error) {
return c.client.DeleteFile(ctx, c.channelType, c.channelD, request)
}
func (c *Channels) UploadFile(ctx context.Context, request *UploadFileRequest) (*StreamResponse[FileUploadResponse], error) {
return c.client.UploadFile(ctx, c.channelType, c.channelD, request)
}
func (c *Channels) Hide(ctx context.Context, request *HideChannelRequest) (*StreamResponse[HideChannelResponse], error) {
return c.client.HideChannel(ctx, c.channelType, c.channelD, request)
}
func (c *Channels) DeleteImage(ctx context.Context, request *DeleteImageRequest) (*StreamResponse[Response], error) {
return c.client.DeleteImage(ctx, c.channelType, c.channelD, request)
}
func (c *Channels) UploadImage(ctx context.Context, request *UploadImageRequest) (*StreamResponse[ImageUploadResponse], error) {
return c.client.UploadImage(ctx, c.channelType, c.channelD, request)
}
func (c *Channels) UpdateMemberPartial(ctx context.Context, userID string, request *UpdateMemberPartialRequest) (*StreamResponse[UpdateMemberPartialResponse], error) {
return c.client.UpdateMemberPartial(ctx, c.channelType, c.channelD, userID, request)
}
func (c *Channels) SendMessage(ctx context.Context, request *SendMessageRequest) (*StreamResponse[SendMessageResponse], error) {
return c.client.SendMessage(ctx, c.channelType, c.channelD, request)
}
func (c *Channels) GetManyMessages(ctx context.Context, request *GetManyMessagesRequest) (*StreamResponse[GetManyMessagesResponse], error) {
return c.client.GetManyMessages(ctx, c.channelType, c.channelD, request)
}
func (c *Channels) GetOrCreate(ctx context.Context, request *GetOrCreateChannelRequest) (*StreamResponse[ChannelStateResponse], error) {
return c.client.GetOrCreateChannel(ctx, c.channelType, c.channelD, request)
}
func (c *Channels) MarkRead(ctx context.Context, request *MarkReadRequest) (*StreamResponse[MarkReadResponse], error) {
return c.client.MarkRead(ctx, c.channelType, c.channelD, request)
}
func (c *Channels) Show(ctx context.Context, request *ShowChannelRequest) (*StreamResponse[ShowChannelResponse], error) {
return c.client.ShowChannel(ctx, c.channelType, c.channelD, request)
}
func (c *Channels) Truncate(ctx context.Context, request *TruncateChannelRequest) (*StreamResponse[TruncateChannelResponse], error) {
return c.client.TruncateChannel(ctx, c.channelType, c.channelD, request)
}
func (c *Channels) MarkUnread(ctx context.Context, request *MarkUnreadRequest) (*StreamResponse[Response], error) {
return c.client.MarkUnread(ctx, c.channelType, c.channelD, request)
}
func (c *ChatClient) Channel(channelType, channelD string) *Channels {
return NewChannel(channelType, channelD, c)
}