diff --git a/channel.go b/channel.go index e5e470b0..00924e42 100644 --- a/channel.go +++ b/channel.go @@ -111,10 +111,13 @@ func (ch *Channel) query(options map[string]interface{}, data map[string]interfa // // options: the object to update the custom properties of this channel with // message: optional update message -func (ch *Channel) Update(options map[string]interface{}, message string) error { +func (ch *Channel) Update(options map[string]interface{}, message *Message) error { payload := map[string]interface{}{ - "data": options, - "message": message, + "data": options, + } + + if message != nil { + payload["message"] = message } p := path.Join("channels", url.PathEscape(ch.Type), url.PathEscape(ch.ID)) @@ -137,7 +140,7 @@ func (ch *Channel) Truncate() error { } // AddMembers adds members with given user IDs to the channel -func (ch *Channel) AddMembers(userIDs ...string) error { +func (ch *Channel) AddMembers(userIDs []string, message *Message) error { if len(userIDs) == 0 { return errors.New("user IDs are empty") } @@ -146,13 +149,17 @@ func (ch *Channel) AddMembers(userIDs ...string) error { "add_members": userIDs, } + if message != nil { + data["message"] = message + } + p := path.Join("channels", url.PathEscape(ch.Type), url.PathEscape(ch.ID)) return ch.client.makeRequest(http.MethodPost, p, nil, data, nil) } // RemoveMembers deletes members with given IDs from the channel -func (ch *Channel) RemoveMembers(userIDs ...string) error { +func (ch *Channel) RemoveMembers(userIDs []string, message *Message) error { if len(userIDs) == 0 { return errors.New("user IDs are empty") } @@ -161,6 +168,9 @@ func (ch *Channel) RemoveMembers(userIDs ...string) error { "remove_members": userIDs, } + if message != nil { + data["message"] = message + } p := path.Join("channels", url.PathEscape(ch.Type), url.PathEscape(ch.ID)) var resp queryResponse @@ -385,6 +395,44 @@ func (ch *Channel) DeleteImage(location string) error { return ch.client.makeRequest(http.MethodDelete, p, params, nil, nil) } +func (ch *Channel) AcceptInvite(userID string, message *Message) error { + if userID == "" { + return errors.New("user ID must be not empty") + } + + data := map[string]interface{}{ + "accept_invite": true, + "user_id": userID, + } + + if message != nil { + data["message"] = message + } + + p := path.Join("channels", url.PathEscape(ch.Type), url.PathEscape(ch.ID)) + + return ch.client.makeRequest(http.MethodPost, p, nil, data, nil) +} + +func (ch *Channel) RejectInvite(userID string, message *Message) error { + if userID == "" { + return errors.New("user ID must be not empty") + } + + data := map[string]interface{}{ + "reject_invite": true, + "user_id": userID, + } + + if message != nil { + data["message"] = message + } + + p := path.Join("channels", url.PathEscape(ch.Type), url.PathEscape(ch.ID)) + + return ch.client.makeRequest(http.MethodPost, p, nil, data, nil) +} + // todo: cleanup this func (ch *Channel) refresh() error { options := map[string]interface{}{ diff --git a/channel_test.go b/channel_test.go index 24430a6a..1ab10f26 100644 --- a/channel_test.go +++ b/channel_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestClient_CreateChannel(t *testing.T) { @@ -73,7 +74,10 @@ func TestChannel_AddMembers(t *testing.T) { user := randomUser() - err = ch.AddMembers(user.ID) + err = ch.AddMembers( + []string{user.ID}, + &Message{Text: "some members", User: &User{ID: user.ID}}, + ) mustNoError(t, err, "add members") // refresh channel state @@ -207,7 +211,10 @@ func TestChannel_RemoveMembers(t *testing.T) { }() user := randomUser() - err := ch.RemoveMembers(user.ID) + err := ch.RemoveMembers( + []string{user.ID}, + &Message{Text: "some members", User: &User{ID: user.ID}}, + ) mustNoError(t, err, "remove members") @@ -270,7 +277,12 @@ func TestChannel_Truncate(t *testing.T) { } func TestChannel_Update(t *testing.T) { + c := initClient(t) + ch := initChannel(t, c) + err := ch.Update(map[string]interface{}{"color": "blue"}, + &Message{Text: "color is blue", User: &User{ID: testUsers[0].ID}}) + require.NoError(t, err) } func TestChannel_AddModerators(t *testing.T) { @@ -353,3 +365,45 @@ func TestChannel_SendImage(t *testing.T) { } }) } + +func TestChannel_AcceptInvite(t *testing.T) { + c := initClient(t) + + _, err := c.UpdateUsers(testUsers...) + mustNoError(t, err, "update users") + + members := make([]string, 0, len(testUsers)) + for i := range testUsers { + members = append(members, testUsers[i].ID) + } + + ch, err := c.CreateChannel("team", randomString(12), serverUser.ID, map[string]interface{}{ + "members": members, + "invites": []string{members[0]}, + }) + + require.NoError(t, err, "create channel") + err = ch.AcceptInvite(members[0], &Message{Text: "accepted", User: &User{ID: members[0]}}) + require.NoError(t, err, "accept invite") +} + +func TestChannel_RejectInvite(t *testing.T) { + c := initClient(t) + + _, err := c.UpdateUsers(testUsers...) + mustNoError(t, err, "update users") + + members := make([]string, 0, len(testUsers)) + for i := range testUsers { + members = append(members, testUsers[i].ID) + } + + ch, err := c.CreateChannel("team", randomString(12), serverUser.ID, map[string]interface{}{ + "members": members, + "invites": []string{members[0]}, + }) + + require.NoError(t, err, "create channel") + err = ch.RejectInvite(members[0], &Message{Text: "rejected", User: &User{ID: members[0]}}) + require.NoError(t, err, "reject invite") +} diff --git a/message.go b/message.go index 80ddab53..77002ddf 100644 --- a/message.go +++ b/message.go @@ -24,7 +24,7 @@ type Message struct { Text string `json:"text"` HTML string `json:"html"` - Type MessageType `json:"type"` // one of MessageType* constants + Type MessageType `json:"type,omitempty"` // one of MessageType* constants User *User `json:"user"` Attachments []*Attachment `json:"attachments"` @@ -35,12 +35,12 @@ type Message struct { ParentID string `json:"parent_id"` // id of parent message if it's reply ShowInChannel bool `json:"show_in_channel"` // show reply message also in channel - ReplyCount int `json:"reply_count"` + ReplyCount int `json:"reply_count,omitempty"` MentionedUsers []*User `json:"mentioned_users"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` // any other fields the user wants to attach a message ExtraData map[string]interface{} diff --git a/stream_chat.go b/stream_chat.go index 8378c28a..9682ee3a 100644 --- a/stream_chat.go +++ b/stream_chat.go @@ -73,16 +73,16 @@ type StreamClient interface { // StreamChannel is a channel of communication type StreamChannel interface { // channel.go - AddMembers(userIDs ...string) error + AddMembers(userIDs []string, message *Message) error AddModerators(userIDs ...string) error BanUser(targetID string, userID string, options map[string]interface{}) error Delete() error DemoteModerators(userIDs ...string) error MarkRead(userID string, options map[string]interface{}) error - RemoveMembers(userIDs ...string) error + RemoveMembers(userIDs []string, message *Message) error Truncate() error UnBanUser(targetID string, options map[string]string) error - Update(options map[string]interface{}, message string) error + Update(options map[string]interface{}, message *Message) error Query(data map[string]interface{}) error Show(userID string) error Hide(userID string) error @@ -91,7 +91,8 @@ type StreamChannel interface { SendImage(request SendFileRequest) (url string, err error) DeleteFile(location string) error DeleteImage(location string) error - + AcceptInvite(userID string, message *Message) error + RejectInvite(userID string, message *Message) error // event.go SendEvent(event *Event, userID string) error diff --git a/stream_chat_easyjson.go b/stream_chat_easyjson.go index 550939ac..de05f48c 100644 --- a/stream_chat_easyjson.go +++ b/stream_chat_easyjson.go @@ -7,6 +7,7 @@ import ( easyjson "github.com/getstream/easyjson" jlexer "github.com/getstream/easyjson/jlexer" jwriter "github.com/getstream/easyjson/jwriter" + multipart "mime/multipart" time "time" ) @@ -2199,7 +2200,67 @@ func (v *partialUserUpdateReq) UnmarshalJSON(data []byte) error { func (v *partialUserUpdateReq) UnmarshalEasyJSON(l *jlexer.Lexer) { easyjson458e82b7DecodeGithubComGetStreamStreamChatGo17(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo18(in *jlexer.Lexer, out *messageResponse) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo18(in *jlexer.Lexer, out *multipartForm) { + isTopLevel := in.IsStart() + if in.IsNull() { + if isTopLevel { + in.Consumed() + } + in.Skip() + return + } + out.Writer = new(multipart.Writer) + in.Delim('{') + for !in.IsDelim('}') { + key := in.UnsafeString() + in.WantColon() + if in.IsNull() { + in.Skip() + in.WantComma() + continue + } + switch key { + default: + in.SkipRecursive() + } + in.WantComma() + } + in.Delim('}') + if isTopLevel { + in.Consumed() + } +} +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo18(out *jwriter.Writer, in multipartForm) { + out.RawByte('{') + first := true + _ = first + out.RawByte('}') +} + +// MarshalJSON supports json.Marshaler interface +func (v multipartForm) MarshalJSON() ([]byte, error) { + w := jwriter.Writer{} + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo18(&w, v) + return w.Buffer.BuildBytes(), w.Error +} + +// MarshalEasyJSON supports easyjson.Marshaler interface +func (v multipartForm) MarshalEasyJSON(w *jwriter.Writer) { + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo18(w, v) +} + +// UnmarshalJSON supports json.Unmarshaler interface +func (v *multipartForm) UnmarshalJSON(data []byte) error { + r := jlexer.Lexer{Data: data} + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo18(&r, v) + return r.Error() +} + +// UnmarshalEasyJSON supports easyjson.Unmarshaler interface +func (v *multipartForm) UnmarshalEasyJSON(l *jlexer.Lexer) { + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo18(l, v) +} +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo19(in *jlexer.Lexer, out *messageResponse) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2238,7 +2299,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo18(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo18(out *jwriter.Writer, in messageResponse) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo19(out *jwriter.Writer, in messageResponse) { out.RawByte('{') first := true _ = first @@ -2257,27 +2318,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo18(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v messageResponse) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo18(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo19(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v messageResponse) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo18(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo19(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *messageResponse) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo18(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo19(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *messageResponse) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo18(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo19(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo19(in *jlexer.Lexer, out *messageRequestUser) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo20(in *jlexer.Lexer, out *messageRequestUser) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2308,7 +2369,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo19(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo19(out *jwriter.Writer, in messageRequestUser) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo20(out *jwriter.Writer, in messageRequestUser) { out.RawByte('{') first := true _ = first @@ -2323,27 +2384,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo19(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v messageRequestUser) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo19(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo20(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v messageRequestUser) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo19(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo20(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *messageRequestUser) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo19(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo20(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *messageRequestUser) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo19(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo20(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo20(in *jlexer.Lexer, out *messageRequestMessage) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo21(in *jlexer.Lexer, out *messageRequestMessage) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2440,7 +2501,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo20(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo20(out *jwriter.Writer, in messageRequestMessage) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo21(out *jwriter.Writer, in messageRequestMessage) { out.RawByte('{') first := true _ = first @@ -2522,27 +2583,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo20(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v messageRequestMessage) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo20(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo21(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v messageRequestMessage) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo20(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo21(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *messageRequestMessage) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo20(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo21(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *messageRequestMessage) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo20(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo21(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo21(in *jlexer.Lexer, out *messageRequest) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo22(in *jlexer.Lexer, out *messageRequest) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2573,7 +2634,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo21(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo21(out *jwriter.Writer, in messageRequest) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo22(out *jwriter.Writer, in messageRequest) { out.RawByte('{') first := true _ = first @@ -2588,27 +2649,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo21(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v messageRequest) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo21(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo22(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v messageRequest) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo21(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo22(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *messageRequest) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo21(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo22(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *messageRequest) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo21(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo22(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo22(in *jlexer.Lexer, out *eventRequest) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo23(in *jlexer.Lexer, out *eventRequest) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2647,7 +2708,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo22(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo22(out *jwriter.Writer, in eventRequest) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo23(out *jwriter.Writer, in eventRequest) { out.RawByte('{') first := true _ = first @@ -2666,27 +2727,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo22(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v eventRequest) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo22(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo23(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v eventRequest) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo22(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo23(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *eventRequest) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo22(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo23(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *eventRequest) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo22(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo23(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo23(in *jlexer.Lexer, out *devicesResponse) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo24(in *jlexer.Lexer, out *devicesResponse) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2746,7 +2807,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo23(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo23(out *jwriter.Writer, in devicesResponse) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo24(out *jwriter.Writer, in devicesResponse) { out.RawByte('{') first := true _ = first @@ -2776,27 +2837,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo23(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v devicesResponse) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo23(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo24(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v devicesResponse) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo23(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo24(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *devicesResponse) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo23(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo24(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *devicesResponse) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo23(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo24(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo24(in *jlexer.Lexer, out *channelTypeResponse) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo25(in *jlexer.Lexer, out *channelTypeResponse) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -2853,7 +2914,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo24(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo24(out *jwriter.Writer, in channelTypeResponse) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo25(out *jwriter.Writer, in channelTypeResponse) { out.RawByte('{') first := true _ = first @@ -2888,27 +2949,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo24(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v channelTypeResponse) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo24(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo25(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v channelTypeResponse) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo24(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo25(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *channelTypeResponse) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo24(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo25(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *channelTypeResponse) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo24(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo25(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo25(in *jlexer.Lexer, out *channelTypeRequest) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo26(in *jlexer.Lexer, out *channelTypeRequest) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3016,7 +3077,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo25(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo25(out *jwriter.Writer, in channelTypeRequest) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo26(out *jwriter.Writer, in channelTypeRequest) { out.RawByte('{') first := true _ = first @@ -3122,27 +3183,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo25(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v channelTypeRequest) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo25(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo26(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v channelTypeRequest) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo25(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo26(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *channelTypeRequest) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo25(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo26(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *channelTypeRequest) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo25(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo26(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo26(in *jlexer.Lexer, out *appResponse) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo27(in *jlexer.Lexer, out *appResponse) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3181,7 +3242,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo26(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo26(out *jwriter.Writer, in appResponse) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo27(out *jwriter.Writer, in appResponse) { out.RawByte('{') first := true _ = first @@ -3200,27 +3261,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo26(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v appResponse) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo26(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo27(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v appResponse) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo26(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo27(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *appResponse) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo26(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo27(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *appResponse) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo26(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo27(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo27(in *jlexer.Lexer, out *User) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo28(in *jlexer.Lexer, out *User) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3255,16 +3316,40 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo27(in *jlexer.Lexer, ou case "invisible": out.Invisible = bool(in.Bool()) case "created_at": - if data := in.Raw(); in.Ok() { - in.AddError((out.CreatedAt).UnmarshalJSON(data)) + if in.IsNull() { + in.Skip() + out.CreatedAt = nil + } else { + if out.CreatedAt == nil { + out.CreatedAt = new(time.Time) + } + if data := in.Raw(); in.Ok() { + in.AddError((*out.CreatedAt).UnmarshalJSON(data)) + } } case "updated_at": - if data := in.Raw(); in.Ok() { - in.AddError((out.UpdatedAt).UnmarshalJSON(data)) + if in.IsNull() { + in.Skip() + out.UpdatedAt = nil + } else { + if out.UpdatedAt == nil { + out.UpdatedAt = new(time.Time) + } + if data := in.Raw(); in.Ok() { + in.AddError((*out.UpdatedAt).UnmarshalJSON(data)) + } } case "last_active": - if data := in.Raw(); in.Ok() { - in.AddError((out.LastActive).UnmarshalJSON(data)) + if in.IsNull() { + in.Skip() + out.LastActive = nil + } else { + if out.LastActive == nil { + out.LastActive = new(time.Time) + } + if data := in.Raw(); in.Ok() { + in.AddError((*out.LastActive).UnmarshalJSON(data)) + } } case "mutes": if in.IsNull() { @@ -3310,7 +3395,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo27(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo27(out *jwriter.Writer, in User) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo28(out *jwriter.Writer, in User) { out.RawByte('{') first := true _ = first @@ -3344,20 +3429,20 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo27(out *jwriter.Writer, out.RawString(prefix) out.Bool(bool(in.Invisible)) } - if true { + if in.CreatedAt != nil { const prefix string = ",\"created_at\":" out.RawString(prefix) - out.Raw((in.CreatedAt).MarshalJSON()) + out.Raw((*in.CreatedAt).MarshalJSON()) } - if true { + if in.UpdatedAt != nil { const prefix string = ",\"updated_at\":" out.RawString(prefix) - out.Raw((in.UpdatedAt).MarshalJSON()) + out.Raw((*in.UpdatedAt).MarshalJSON()) } - if true { + if in.LastActive != nil { const prefix string = ",\"last_active\":" out.RawString(prefix) - out.Raw((in.LastActive).MarshalJSON()) + out.Raw((*in.LastActive).MarshalJSON()) } if len(in.Mutes) != 0 { const prefix string = ",\"mutes\":" @@ -3399,27 +3484,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo27(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v User) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo27(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo28(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v User) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo27(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo28(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *User) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo27(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo28(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *User) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo27(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo28(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo28(in *jlexer.Lexer, out *SortOption) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo29(in *jlexer.Lexer, out *SortOption) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3452,7 +3537,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo28(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo28(out *jwriter.Writer, in SortOption) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo29(out *jwriter.Writer, in SortOption) { out.RawByte('{') first := true _ = first @@ -3472,27 +3557,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo28(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v SortOption) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo28(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo29(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v SortOption) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo28(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo29(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *SortOption) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo28(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo29(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *SortOption) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo28(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo29(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo29(in *jlexer.Lexer, out *SendFileRequest) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo30(in *jlexer.Lexer, out *SendFileRequest) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3535,7 +3620,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo29(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo29(out *jwriter.Writer, in SendFileRequest) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo30(out *jwriter.Writer, in SendFileRequest) { out.RawByte('{') first := true _ = first @@ -3569,27 +3654,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo29(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v SendFileRequest) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo29(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo30(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v SendFileRequest) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo29(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo30(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *SendFileRequest) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo29(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo30(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *SendFileRequest) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo29(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo30(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo30(in *jlexer.Lexer, out *SearchRequest) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo31(in *jlexer.Lexer, out *SearchRequest) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3650,7 +3735,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo30(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo30(out *jwriter.Writer, in SearchRequest) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo31(out *jwriter.Writer, in SearchRequest) { out.RawByte('{') first := true _ = first @@ -3702,27 +3787,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo30(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v SearchRequest) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo30(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo31(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v SearchRequest) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo30(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo31(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *SearchRequest) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo30(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo31(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *SearchRequest) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo30(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo31(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo31(in *jlexer.Lexer, out *Reaction) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo32(in *jlexer.Lexer, out *Reaction) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3763,7 +3848,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo31(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo31(out *jwriter.Writer, in Reaction) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo32(out *jwriter.Writer, in Reaction) { out.RawByte('{') first := true _ = first @@ -3804,27 +3889,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo31(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Reaction) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo31(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo32(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Reaction) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo31(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo32(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Reaction) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo31(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo32(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Reaction) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo31(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo32(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo32(in *jlexer.Lexer, out *QueryOption) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo33(in *jlexer.Lexer, out *QueryOption) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3863,7 +3948,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo32(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo32(out *jwriter.Writer, in QueryOption) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo33(out *jwriter.Writer, in QueryOption) { out.RawByte('{') first := true _ = first @@ -3909,27 +3994,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo32(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v QueryOption) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo32(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo33(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v QueryOption) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo32(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo33(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *QueryOption) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo32(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo33(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *QueryOption) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo32(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo33(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo33(in *jlexer.Lexer, out *PushNotificationFields) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo34(in *jlexer.Lexer, out *PushNotificationFields) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -3962,7 +4047,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo33(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo33(out *jwriter.Writer, in PushNotificationFields) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo34(out *jwriter.Writer, in PushNotificationFields) { out.RawByte('{') first := true _ = first @@ -3982,27 +4067,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo33(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v PushNotificationFields) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo33(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo34(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v PushNotificationFields) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo33(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo34(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *PushNotificationFields) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo33(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo34(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *PushNotificationFields) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo33(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo34(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo34(in *jlexer.Lexer, out *Policy) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo35(in *jlexer.Lexer, out *Policy) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4093,7 +4178,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo34(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo34(out *jwriter.Writer, in Policy) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo35(out *jwriter.Writer, in Policy) { out.RawByte('{') first := true _ = first @@ -4165,27 +4250,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo34(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Policy) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo34(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo35(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Policy) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo34(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo35(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Policy) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo34(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo35(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Policy) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo34(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo35(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo35(in *jlexer.Lexer, out *Permission) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo36(in *jlexer.Lexer, out *Permission) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4268,7 +4353,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo35(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo35(out *jwriter.Writer, in Permission) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo36(out *jwriter.Writer, in Permission) { out.RawByte('{') first := true _ = first @@ -4330,27 +4415,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo35(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Permission) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo35(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo36(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Permission) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo35(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo36(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Permission) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo35(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo36(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Permission) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo35(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo36(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo36(in *jlexer.Lexer, out *PartialUserUpdate) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo37(in *jlexer.Lexer, out *PartialUserUpdate) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4430,7 +4515,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo36(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo36(out *jwriter.Writer, in PartialUserUpdate) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo37(out *jwriter.Writer, in PartialUserUpdate) { out.RawByte('{') first := true _ = first @@ -4484,27 +4569,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo36(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v PartialUserUpdate) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo36(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo37(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v PartialUserUpdate) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo36(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo37(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *PartialUserUpdate) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo36(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo37(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *PartialUserUpdate) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo36(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo37(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo37(in *jlexer.Lexer, out *Mute) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo38(in *jlexer.Lexer, out *Mute) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4545,7 +4630,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo37(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo37(out *jwriter.Writer, in Mute) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo38(out *jwriter.Writer, in Mute) { out.RawByte('{') first := true _ = first @@ -4575,27 +4660,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo37(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Mute) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo37(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo38(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Mute) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo37(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo38(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Mute) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo37(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo38(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Mute) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo37(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo38(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo38(in *jlexer.Lexer, out *Message) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo39(in *jlexer.Lexer, out *Message) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -4783,12 +4868,28 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo38(in *jlexer.Lexer, ou in.Delim(']') } case "created_at": - if data := in.Raw(); in.Ok() { - in.AddError((out.CreatedAt).UnmarshalJSON(data)) + if in.IsNull() { + in.Skip() + out.CreatedAt = nil + } else { + if out.CreatedAt == nil { + out.CreatedAt = new(time.Time) + } + if data := in.Raw(); in.Ok() { + in.AddError((*out.CreatedAt).UnmarshalJSON(data)) + } } case "updated_at": - if data := in.Raw(); in.Ok() { - in.AddError((out.UpdatedAt).UnmarshalJSON(data)) + if in.IsNull() { + in.Skip() + out.UpdatedAt = nil + } else { + if out.UpdatedAt == nil { + out.UpdatedAt = new(time.Time) + } + if data := in.Raw(); in.Ok() { + in.AddError((*out.UpdatedAt).UnmarshalJSON(data)) + } } case "ExtraData": if in.IsNull() { @@ -4826,7 +4927,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo38(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo38(out *jwriter.Writer, in Message) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo39(out *jwriter.Writer, in Message) { out.RawByte('{') first := true _ = first @@ -4845,7 +4946,7 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo38(out *jwriter.Writer, out.RawString(prefix) out.String(string(in.HTML)) } - { + if in.Type != "" { const prefix string = ",\"type\":" out.RawString(prefix) out.String(string(in.Type)) @@ -4950,7 +5051,7 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo38(out *jwriter.Writer, out.RawString(prefix) out.Bool(bool(in.ShowInChannel)) } - { + if in.ReplyCount != 0 { const prefix string = ",\"reply_count\":" out.RawString(prefix) out.Int(int(in.ReplyCount)) @@ -4975,15 +5076,15 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo38(out *jwriter.Writer, out.RawByte(']') } } - { + if in.CreatedAt != nil { const prefix string = ",\"created_at\":" out.RawString(prefix) - out.Raw((in.CreatedAt).MarshalJSON()) + out.Raw((*in.CreatedAt).MarshalJSON()) } - { + if in.UpdatedAt != nil { const prefix string = ",\"updated_at\":" out.RawString(prefix) - out.Raw((in.UpdatedAt).MarshalJSON()) + out.Raw((*in.UpdatedAt).MarshalJSON()) } { const prefix string = ",\"ExtraData\":" @@ -5018,27 +5119,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo38(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Message) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo38(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo39(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Message) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo38(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo39(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Message) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo38(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo39(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Message) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo38(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo39(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo39(in *jlexer.Lexer, out *FirebaseConfig) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo40(in *jlexer.Lexer, out *FirebaseConfig) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5071,7 +5172,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo39(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo39(out *jwriter.Writer, in FirebaseConfig) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo40(out *jwriter.Writer, in FirebaseConfig) { out.RawByte('{') first := true _ = first @@ -5091,27 +5192,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo39(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v FirebaseConfig) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo39(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo40(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v FirebaseConfig) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo39(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo40(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *FirebaseConfig) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo39(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo40(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *FirebaseConfig) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo39(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo40(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo40(in *jlexer.Lexer, out *Event) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo41(in *jlexer.Lexer, out *Event) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5212,7 +5313,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo40(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo40(out *jwriter.Writer, in Event) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo41(out *jwriter.Writer, in Event) { out.RawByte('{') first := true _ = first @@ -5283,27 +5384,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo40(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Event) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo40(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo41(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Event) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo40(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo41(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Event) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo40(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo41(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Event) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo40(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo41(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo41(in *jlexer.Lexer, out *Device) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo42(in *jlexer.Lexer, out *Device) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5338,7 +5439,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo41(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo41(out *jwriter.Writer, in Device) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo42(out *jwriter.Writer, in Device) { out.RawByte('{') first := true _ = first @@ -5363,27 +5464,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo41(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Device) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo41(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo42(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Device) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo41(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo42(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Device) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo41(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo42(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Device) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo41(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo42(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo42(in *jlexer.Lexer, out *Command) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo43(in *jlexer.Lexer, out *Command) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5420,7 +5521,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo42(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo42(out *jwriter.Writer, in Command) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo43(out *jwriter.Writer, in Command) { out.RawByte('{') first := true _ = first @@ -5450,27 +5551,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo42(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Command) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo42(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo43(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Command) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo42(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo43(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Command) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo42(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo43(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Command) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo42(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo43(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo43(in *jlexer.Lexer, out *Client) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo44(in *jlexer.Lexer, out *Client) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5501,7 +5602,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo43(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo43(out *jwriter.Writer, in Client) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo44(out *jwriter.Writer, in Client) { out.RawByte('{') first := true _ = first @@ -5516,27 +5617,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo43(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Client) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo43(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo44(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Client) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo43(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo44(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Client) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo43(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo44(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Client) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo43(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo44(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo44(in *jlexer.Lexer, out *ChannelType) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo45(in *jlexer.Lexer, out *ChannelType) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5659,7 +5760,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo44(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo44(out *jwriter.Writer, in ChannelType) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo45(out *jwriter.Writer, in ChannelType) { out.RawByte('{') first := true _ = first @@ -5779,27 +5880,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo44(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v ChannelType) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo44(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo45(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v ChannelType) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo44(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo45(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *ChannelType) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo44(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo45(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *ChannelType) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo44(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo45(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo45(in *jlexer.Lexer, out *ChannelRead) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo46(in *jlexer.Lexer, out *ChannelRead) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5842,7 +5943,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo45(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo45(out *jwriter.Writer, in ChannelRead) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo46(out *jwriter.Writer, in ChannelRead) { out.RawByte('{') first := true _ = first @@ -5866,27 +5967,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo45(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v ChannelRead) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo45(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo46(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v ChannelRead) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo45(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo46(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *ChannelRead) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo45(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo46(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *ChannelRead) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo45(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo46(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo46(in *jlexer.Lexer, out *ChannelMember) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo47(in *jlexer.Lexer, out *ChannelMember) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -5965,7 +6066,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo46(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo46(out *jwriter.Writer, in ChannelMember) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo47(out *jwriter.Writer, in ChannelMember) { out.RawByte('{') first := true _ = first @@ -6061,27 +6162,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo46(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v ChannelMember) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo46(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo47(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v ChannelMember) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo46(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo47(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *ChannelMember) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo46(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo47(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *ChannelMember) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo46(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo47(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo47(in *jlexer.Lexer, out *ChannelConfig) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo48(in *jlexer.Lexer, out *ChannelConfig) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -6134,7 +6235,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo47(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo47(out *jwriter.Writer, in ChannelConfig) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo48(out *jwriter.Writer, in ChannelConfig) { out.RawByte('{') first := true _ = first @@ -6204,27 +6305,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo47(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v ChannelConfig) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo47(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo48(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v ChannelConfig) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo47(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo48(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *ChannelConfig) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo47(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo48(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *ChannelConfig) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo47(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo48(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo48(in *jlexer.Lexer, out *Channel) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo49(in *jlexer.Lexer, out *Channel) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -6380,7 +6481,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo48(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo48(out *jwriter.Writer, in Channel) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo49(out *jwriter.Writer, in Channel) { out.RawByte('{') first := true _ = first @@ -6504,27 +6605,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo48(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Channel) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo48(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo49(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Channel) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo48(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo49(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Channel) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo48(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo49(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Channel) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo48(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo49(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo49(in *jlexer.Lexer, out *Attachment) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo50(in *jlexer.Lexer, out *Attachment) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -6577,7 +6678,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo49(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo49(out *jwriter.Writer, in Attachment) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo50(out *jwriter.Writer, in Attachment) { out.RawByte('{') first := true _ = first @@ -6693,27 +6794,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo49(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v Attachment) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo49(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo50(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v Attachment) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo49(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo50(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *Attachment) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo49(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo50(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *Attachment) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo49(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo50(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo50(in *jlexer.Lexer, out *AppSettings) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo51(in *jlexer.Lexer, out *AppSettings) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -6792,7 +6893,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo50(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo50(out *jwriter.Writer, in AppSettings) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo51(out *jwriter.Writer, in AppSettings) { out.RawByte('{') first := true _ = first @@ -6848,27 +6949,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo50(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v AppSettings) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo50(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo51(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v AppSettings) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo50(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo51(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *AppSettings) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo50(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo51(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *AppSettings) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo50(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo51(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo51(in *jlexer.Lexer, out *AppConfig) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo52(in *jlexer.Lexer, out *AppConfig) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -6982,7 +7083,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo51(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo51(out *jwriter.Writer, in AppConfig) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo52(out *jwriter.Writer, in AppConfig) { out.RawByte('{') first := true _ = first @@ -7089,27 +7190,27 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo51(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v AppConfig) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo51(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo52(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v AppConfig) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo51(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo52(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *AppConfig) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo51(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo52(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *AppConfig) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo51(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo52(l, v) } -func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo52(in *jlexer.Lexer, out *APNConfig) { +func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo53(in *jlexer.Lexer, out *APNConfig) { isTopLevel := in.IsStart() if in.IsNull() { if isTopLevel { @@ -7161,7 +7262,7 @@ func easyjson458e82b7DecodeGithubComGetStreamStreamChatGo52(in *jlexer.Lexer, ou in.Consumed() } } -func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo52(out *jwriter.Writer, in APNConfig) { +func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo53(out *jwriter.Writer, in APNConfig) { out.RawByte('{') first := true _ = first @@ -7216,23 +7317,23 @@ func easyjson458e82b7EncodeGithubComGetStreamStreamChatGo52(out *jwriter.Writer, // MarshalJSON supports json.Marshaler interface func (v APNConfig) MarshalJSON() ([]byte, error) { w := jwriter.Writer{} - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo52(&w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo53(&w, v) return w.Buffer.BuildBytes(), w.Error } // MarshalEasyJSON supports easyjson.Marshaler interface func (v APNConfig) MarshalEasyJSON(w *jwriter.Writer) { - easyjson458e82b7EncodeGithubComGetStreamStreamChatGo52(w, v) + easyjson458e82b7EncodeGithubComGetStreamStreamChatGo53(w, v) } // UnmarshalJSON supports json.Unmarshaler interface func (v *APNConfig) UnmarshalJSON(data []byte) error { r := jlexer.Lexer{Data: data} - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo52(&r, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo53(&r, v) return r.Error() } // UnmarshalEasyJSON supports easyjson.Unmarshaler interface func (v *APNConfig) UnmarshalEasyJSON(l *jlexer.Lexer) { - easyjson458e82b7DecodeGithubComGetStreamStreamChatGo52(l, v) + easyjson458e82b7DecodeGithubComGetStreamStreamChatGo53(l, v) } diff --git a/user.go b/user.go index 955ba0da..83f31c92 100644 --- a/user.go +++ b/user.go @@ -25,9 +25,9 @@ type User struct { Online bool `json:"online,omitempty"` Invisible bool `json:"invisible,omitempty"` - CreatedAt time.Time `json:"created_at,omitempty"` - UpdatedAt time.Time `json:"updated_at,omitempty"` - LastActive time.Time `json:"last_active,omitempty"` + CreatedAt *time.Time `json:"created_at,omitempty"` + UpdatedAt *time.Time `json:"updated_at,omitempty"` + LastActive *time.Time `json:"last_active,omitempty"` ExtraData map[string]interface{} `json:"-,extra"`