From 0790575f053c687cdfcc0bcd834fd610c8310725 Mon Sep 17 00:00:00 2001 From: Yun Wang Date: Wed, 26 Aug 2026 15:24:27 +0200 Subject: [PATCH] feat!: regenerate from protocol v237.1.3 and move the module to /v6 Six generated types changed shape. Nothing was removed: no endpoint, type or field disappeared, and no field was added. ChannelMemberRequest.UserID string -> *string ChannelMemberRequest.User *UserResponse -> *MemberUserRequest Reminder{Created,Updated,Deleted,Notification}Event.Reminder *ReminderResponseData -> ReminderResponseData oasdiff reports 44 errors between openapi-v236.2.0 and openapi-v237.1.3, all request-property-type-changed, which matches the first two rows. Go resolves a v2+ module only if go.mod carries the matching suffix, and release-please does not rewrite it, so go.mod and all 76 self-imports move to /v6 in this commit. That has to land before the major Release PR merges, otherwise the guard in release.yml refuses to tag. CHANGELOG.md and MIGRATION_v4_to_v5.md keep their /v5 references as historical record. MIGRATION_v5_to_v6.md documents the four call-site changes. The 15 affected lines in the hand-written tests use the existing PtrTo helper. BREAKING CHANGE: module path is now github.com/GetStream/getstream-go/v6, and ChannelMemberRequest.UserID, ChannelMemberRequest.User and the Reminder field on the four reminder events changed type. See MIGRATION_v5_to_v6.md. --- .spec-version | 4 +- MIGRATION_v5_to_v6.md | 43 +++++++ chat_channel_integration_test.go | 26 ++-- chat_message_integration_test.go | 6 +- chat_misc_integration_test.go | 2 +- chat_polls_integration_test.go | 2 +- chat_reaction_integration_test.go | 2 +- chat_retention_integration_test.go | 2 +- chat_test.go | 2 +- chat_test_helpers_test.go | 4 +- chat_user_group_integration_test.go | 2 +- chat_user_integration_test.go | 2 +- chat_webhook_test.go | 2 +- client_test.go | 2 +- common_test.go | 2 +- .../01-setup-and-auth.md | 12 +- .../migration-from-stream-chat-go/02-users.md | 14 +- .../03-channels.md | 20 +-- .../04-messages-and-reactions.md | 20 +-- .../05-moderation.md | 18 +-- .../06-devices.md | 10 +- docs/migration-from-stream-chat-go/README.md | 4 +- examples_test.go | 2 +- feeds_integration_test.go | 2 +- feeds_test.go | 2 +- feedtest/example.go | 2 +- go.mod | 2 +- models.go | 121 ++++++++++-------- moderation_integration_test.go | 2 +- rate_limits_test.go | 2 +- tasks_test.go | 2 +- utils_test.go | 2 +- video_example_test.go | 2 +- video_test.go | 2 +- 34 files changed, 200 insertions(+), 144 deletions(-) create mode 100644 MIGRATION_v5_to_v6.md diff --git a/.spec-version b/.spec-version index 2a69514..71134d1 100644 --- a/.spec-version +++ b/.spec-version @@ -1,2 +1,2 @@ -spec: openapi-v236.2.0 -generator: chat v236.1.0-13-gc76ef78629 +spec: openapi-v237.1.3 +generator: chat v237.1.3-14-g6e42baa6da diff --git a/MIGRATION_v5_to_v6.md b/MIGRATION_v5_to_v6.md new file mode 100644 index 0000000..7da0d26 --- /dev/null +++ b/MIGRATION_v5_to_v6.md @@ -0,0 +1,43 @@ +# Migrating from v5 to v6 + +v6 changes the module path and six generated types. There are no removed endpoints, types or fields. + +## Module path + +```bash +go get github.com/GetStream/getstream-go/v6 +``` + +Update every import: + +```go +- import "github.com/GetStream/getstream-go/v5" ++ import "github.com/GetStream/getstream-go/v6" +``` + +## `ChannelMemberRequest.UserID` is now optional + +`UserID` changed from `string` to `*string`. Use the `PtrTo` helper: + +```go +- members := []ChannelMemberRequest{{UserID: userID}} ++ members := []ChannelMemberRequest{{UserID: PtrTo(userID)}} +``` + +## `ChannelMemberRequest.User` takes a request type + +The field changed from `*UserResponse` to `*MemberUserRequest`, a new type carrying only the fields a request may set. If you were passing a `UserResponse` you received from the API, build a `MemberUserRequest` instead and set the fields you mean to change. + +```go +- ChannelMemberRequest{User: &UserResponse{ID: id, Name: PtrTo("Alice")}} ++ ChannelMemberRequest{User: &MemberUserRequest{ID: id, Name: PtrTo("Alice")}} +``` + +## Reminder events carry a value, not a pointer + +`Reminder` changed from `*ReminderResponseData` to `ReminderResponseData` on `ReminderCreatedEvent`, `ReminderUpdatedEvent`, `ReminderDeletedEvent` and `ReminderNotificationEvent`. Drop the nil check and the dereference: + +```go +- if event.Reminder != nil { use(*event.Reminder) } ++ use(event.Reminder) +``` diff --git a/chat_channel_integration_test.go b/chat_channel_integration_test.go index 9f9ff13..7d65d26 100644 --- a/chat_channel_integration_test.go +++ b/chat_channel_integration_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - . "github.com/GetStream/getstream-go/v5" + . "github.com/GetStream/getstream-go/v6" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -50,8 +50,8 @@ func TestChatChannelIntegration(t *testing.T) { t.Run("CreateDistinctChannel", func(t *testing.T) { members := []ChannelMemberRequest{ - {UserID: creatorID}, - {UserID: memberID1}, + {UserID: PtrTo(creatorID)}, + {UserID: PtrTo(memberID1)}, } resp, err := client.Chat().GetOrCreateDistinctChannel(ctx, "messaging", &GetOrCreateDistinctChannelRequest{ @@ -208,8 +208,8 @@ func TestChatChannelIntegration(t *testing.T) { // Add members _, err := ch.Update(ctx, &UpdateChannelRequest{ AddMembers: []ChannelMemberRequest{ - {UserID: memberID2}, - {UserID: memberID3}, + {UserID: PtrTo(memberID2)}, + {UserID: PtrTo(memberID3)}, }, }) require.NoError(t, err) @@ -260,11 +260,11 @@ func TestChatChannelIntegration(t *testing.T) { Data: &ChannelInput{ CreatedByID: PtrTo(creatorID), Members: []ChannelMemberRequest{ - {UserID: creatorID}, + {UserID: PtrTo(creatorID)}, }, Invites: []ChannelMemberRequest{ - {UserID: memberID1}, - {UserID: memberID2}, + {UserID: PtrTo(memberID1)}, + {UserID: PtrTo(memberID2)}, }, }, }) @@ -461,7 +461,7 @@ func TestChatChannelIntegration(t *testing.T) { // Assign channel_moderator role to memberID1 _, err := ch.Update(ctx, &UpdateChannelRequest{ AssignRoles: []ChannelMemberRequest{ - {UserID: memberID1, ChannelRole: PtrTo("channel_moderator")}, + {UserID: PtrTo(memberID1), ChannelRole: PtrTo("channel_moderator")}, }, }) require.NoError(t, err) @@ -669,8 +669,8 @@ func TestChatChannelIntegration(t *testing.T) { // Add members with specific channel roles _, err := ch.Update(ctx, &UpdateChannelRequest{ AddMembers: []ChannelMemberRequest{ - {UserID: modUserID, ChannelRole: PtrTo("channel_moderator")}, - {UserID: memberUserID2, ChannelRole: PtrTo("channel_member")}, + {UserID: PtrTo(modUserID), ChannelRole: PtrTo("channel_moderator")}, + {UserID: PtrTo(memberUserID2), ChannelRole: PtrTo("channel_member")}, }, }) require.NoError(t, err) @@ -812,8 +812,8 @@ func TestChatChannelIntegration(t *testing.T) { Data: &ChannelInput{ CreatedByID: PtrTo(creatorID), Members: []ChannelMemberRequest{ - {UserID: creatorID}, - {UserID: memberID1}, + {UserID: PtrTo(creatorID)}, + {UserID: PtrTo(memberID1)}, }, }, }) diff --git a/chat_message_integration_test.go b/chat_message_integration_test.go index 9a13285..7f52698 100644 --- a/chat_message_integration_test.go +++ b/chat_message_integration_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - . "github.com/GetStream/getstream-go/v5" + . "github.com/GetStream/getstream-go/v6" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -627,8 +627,8 @@ func TestChatMessageIntegration(t *testing.T) { Data: &ChannelInput{ CreatedByID: PtrTo(memberUserID), Members: []ChannelMemberRequest{ - {UserID: memberUserID, ChannelRole: PtrTo("channel_member")}, - {UserID: customRoleUserID, ChannelRole: PtrTo("channel_moderator")}, + {UserID: PtrTo(memberUserID), ChannelRole: PtrTo("channel_member")}, + {UserID: PtrTo(customRoleUserID), ChannelRole: PtrTo("channel_moderator")}, }, }, }) diff --git a/chat_misc_integration_test.go b/chat_misc_integration_test.go index c8a5d8d..8333b4c 100644 --- a/chat_misc_integration_test.go +++ b/chat_misc_integration_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - . "github.com/GetStream/getstream-go/v5" + . "github.com/GetStream/getstream-go/v6" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/chat_polls_integration_test.go b/chat_polls_integration_test.go index 84028dd..ed57f44 100644 --- a/chat_polls_integration_test.go +++ b/chat_polls_integration_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - . "github.com/GetStream/getstream-go/v5" + . "github.com/GetStream/getstream-go/v6" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/chat_reaction_integration_test.go b/chat_reaction_integration_test.go index b53a554..715bdcc 100644 --- a/chat_reaction_integration_test.go +++ b/chat_reaction_integration_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - . "github.com/GetStream/getstream-go/v5" + . "github.com/GetStream/getstream-go/v6" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/chat_retention_integration_test.go b/chat_retention_integration_test.go index ddf37bb..c013758 100644 --- a/chat_retention_integration_test.go +++ b/chat_retention_integration_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - . "github.com/GetStream/getstream-go/v5" + . "github.com/GetStream/getstream-go/v6" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/chat_test.go b/chat_test.go index 4c33899..db8ae7a 100644 --- a/chat_test.go +++ b/chat_test.go @@ -5,7 +5,7 @@ import ( "context" "testing" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" "github.com/stretchr/testify/require" ) diff --git a/chat_test_helpers_test.go b/chat_test_helpers_test.go index d33788b..cbfea9d 100644 --- a/chat_test_helpers_test.go +++ b/chat_test_helpers_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - . "github.com/GetStream/getstream-go/v5" + . "github.com/GetStream/getstream-go/v6" "github.com/google/uuid" "github.com/stretchr/testify/require" ) @@ -192,7 +192,7 @@ func createTestChannelWithMembers(t *testing.T, client *Stream, creatorID string members := make([]ChannelMemberRequest, len(memberIDs)) for i, id := range memberIDs { - members[i] = ChannelMemberRequest{UserID: id} + members[i] = ChannelMemberRequest{UserID: PtrTo(id)} } _, err := ch.GetOrCreate(ctx, &GetOrCreateChannelRequest{ diff --git a/chat_user_group_integration_test.go b/chat_user_group_integration_test.go index bb94b29..039ff5f 100644 --- a/chat_user_group_integration_test.go +++ b/chat_user_group_integration_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - . "github.com/GetStream/getstream-go/v5" + . "github.com/GetStream/getstream-go/v6" "github.com/google/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/chat_user_integration_test.go b/chat_user_integration_test.go index 4f0bb2f..e6d70c9 100644 --- a/chat_user_integration_test.go +++ b/chat_user_integration_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - . "github.com/GetStream/getstream-go/v5" + . "github.com/GetStream/getstream-go/v6" "github.com/google/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/chat_webhook_test.go b/chat_webhook_test.go index d546ad0..c3e5518 100644 --- a/chat_webhook_test.go +++ b/chat_webhook_test.go @@ -6,7 +6,7 @@ import ( "encoding/hex" "testing" - . "github.com/GetStream/getstream-go/v5" + . "github.com/GetStream/getstream-go/v6" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/client_test.go b/client_test.go index 02160c7..8ab8f24 100644 --- a/client_test.go +++ b/client_test.go @@ -11,7 +11,7 @@ import ( "testing" "time" - . "github.com/GetStream/getstream-go/v5" + . "github.com/GetStream/getstream-go/v6" "github.com/joho/godotenv" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/common_test.go b/common_test.go index b70e73b..746870b 100644 --- a/common_test.go +++ b/common_test.go @@ -5,7 +5,7 @@ import ( "context" "testing" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" "github.com/stretchr/testify/require" ) diff --git a/docs/migration-from-stream-chat-go/01-setup-and-auth.md b/docs/migration-from-stream-chat-go/01-setup-and-auth.md index 958b77d..e8fb195 100644 --- a/docs/migration-from-stream-chat-go/01-setup-and-auth.md +++ b/docs/migration-from-stream-chat-go/01-setup-and-auth.md @@ -1,6 +1,6 @@ # Setup and Authentication -This guide shows how to migrate setup and authentication code from `github.com/GetStream/stream-chat-go/v8` to `github.com/GetStream/getstream-go/v5`. +This guide shows how to migrate setup and authentication code from `github.com/GetStream/stream-chat-go/v8` to `github.com/GetStream/getstream-go/v6`. ## Installation @@ -13,11 +13,11 @@ go get github.com/GetStream/stream-chat-go/v8 **After (getstream-go):** ```bash -go get github.com/GetStream/getstream-go/v5 +go get github.com/GetStream/getstream-go/v6 ``` **Key changes:** -- Module path changed from `stream-chat-go/v8` to `getstream-go/v5` +- Module path changed from `stream-chat-go/v8` to `getstream-go/v6` ## Client Initialization @@ -52,7 +52,7 @@ package main import ( "time" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -94,7 +94,7 @@ func main() { package main import ( - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -136,7 +136,7 @@ package main import ( "time" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { diff --git a/docs/migration-from-stream-chat-go/02-users.md b/docs/migration-from-stream-chat-go/02-users.md index dc147a7..1e908fc 100644 --- a/docs/migration-from-stream-chat-go/02-users.md +++ b/docs/migration-from-stream-chat-go/02-users.md @@ -1,6 +1,6 @@ # Users -This guide shows how to migrate user operations from `github.com/GetStream/stream-chat-go/v8` to `github.com/GetStream/getstream-go/v5`. +This guide shows how to migrate user operations from `github.com/GetStream/stream-chat-go/v8` to `github.com/GetStream/getstream-go/v6`. ## Upsert a Single User @@ -40,7 +40,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -103,7 +103,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -162,7 +162,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -225,7 +225,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -283,7 +283,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -331,7 +331,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { diff --git a/docs/migration-from-stream-chat-go/03-channels.md b/docs/migration-from-stream-chat-go/03-channels.md index 70c906e..659368c 100644 --- a/docs/migration-from-stream-chat-go/03-channels.md +++ b/docs/migration-from-stream-chat-go/03-channels.md @@ -1,6 +1,6 @@ # Channels -This guide shows how to migrate channel operations from `github.com/GetStream/stream-chat-go/v8` to `github.com/GetStream/getstream-go/v5`. +This guide shows how to migrate channel operations from `github.com/GetStream/stream-chat-go/v8` to `github.com/GetStream/getstream-go/v6`. ## Create a Channel @@ -35,7 +35,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -94,7 +94,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -154,7 +154,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -209,7 +209,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -269,7 +269,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -328,7 +328,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -378,7 +378,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -430,7 +430,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -483,7 +483,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { diff --git a/docs/migration-from-stream-chat-go/04-messages-and-reactions.md b/docs/migration-from-stream-chat-go/04-messages-and-reactions.md index f674e58..a82c63c 100644 --- a/docs/migration-from-stream-chat-go/04-messages-and-reactions.md +++ b/docs/migration-from-stream-chat-go/04-messages-and-reactions.md @@ -1,6 +1,6 @@ # Messages and Reactions -This guide shows how to migrate message and reaction operations from `github.com/GetStream/stream-chat-go/v8` to `github.com/GetStream/getstream-go/v5`. +This guide shows how to migrate message and reaction operations from `github.com/GetStream/stream-chat-go/v8` to `github.com/GetStream/getstream-go/v6`. ## Send a Message @@ -35,7 +35,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -92,7 +92,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -143,7 +143,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -190,7 +190,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -248,7 +248,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -305,7 +305,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -358,7 +358,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -413,7 +413,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -461,7 +461,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { diff --git a/docs/migration-from-stream-chat-go/05-moderation.md b/docs/migration-from-stream-chat-go/05-moderation.md index f2ea11d..1164b53 100644 --- a/docs/migration-from-stream-chat-go/05-moderation.md +++ b/docs/migration-from-stream-chat-go/05-moderation.md @@ -1,6 +1,6 @@ # Moderation -This guide shows how to migrate moderation operations from `github.com/GetStream/stream-chat-go/v8` to `github.com/GetStream/getstream-go/v5`. +This guide shows how to migrate moderation operations from `github.com/GetStream/stream-chat-go/v8` to `github.com/GetStream/getstream-go/v6`. ## Add Moderators @@ -32,7 +32,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -81,7 +81,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -133,7 +133,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -187,7 +187,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -245,7 +245,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -309,7 +309,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -361,7 +361,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -411,7 +411,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { diff --git a/docs/migration-from-stream-chat-go/06-devices.md b/docs/migration-from-stream-chat-go/06-devices.md index 1de66cd..b8e7c9a 100644 --- a/docs/migration-from-stream-chat-go/06-devices.md +++ b/docs/migration-from-stream-chat-go/06-devices.md @@ -1,6 +1,6 @@ # Devices -This guide shows how to migrate device (push notification) operations from `github.com/GetStream/stream-chat-go/v8` to `github.com/GetStream/getstream-go/v5`. +This guide shows how to migrate device (push notification) operations from `github.com/GetStream/stream-chat-go/v8` to `github.com/GetStream/getstream-go/v6`. ## Add a Device @@ -35,7 +35,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -89,7 +89,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -137,7 +137,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { @@ -185,7 +185,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { diff --git a/docs/migration-from-stream-chat-go/README.md b/docs/migration-from-stream-chat-go/README.md index 4dcaa09..44f6fa0 100644 --- a/docs/migration-from-stream-chat-go/README.md +++ b/docs/migration-from-stream-chat-go/README.md @@ -11,7 +11,7 @@ | Aspect | stream-chat-go | getstream-go | |--------|----------------|--------------| -| Import | `github.com/GetStream/stream-chat-go/v8` | `github.com/GetStream/getstream-go/v5` | +| Import | `github.com/GetStream/stream-chat-go/v8` | `github.com/GetStream/getstream-go/v6` | | Env vars | `STREAM_KEY`, `STREAM_SECRET` | `STREAM_API_KEY`, `STREAM_API_SECRET` | | Client init | `stream.NewClient(key, secret)` | `getstream.NewClient(key, secret)` | | Sub-clients | All methods on root client | `client.Chat()`, `client.Moderation()`, `client.Video()` | @@ -52,7 +52,7 @@ package main import ( "context" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func main() { diff --git a/examples_test.go b/examples_test.go index e3749ff..65998c2 100644 --- a/examples_test.go +++ b/examples_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" "github.com/google/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/feeds_integration_test.go b/feeds_integration_test.go index 6b632ce..eb2533f 100644 --- a/feeds_integration_test.go +++ b/feeds_integration_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" "github.com/google/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/feeds_test.go b/feeds_test.go index d740d14..ad39f07 100644 --- a/feeds_test.go +++ b/feeds_test.go @@ -5,7 +5,7 @@ import ( "context" "testing" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" "github.com/stretchr/testify/require" ) diff --git a/feedtest/example.go b/feedtest/example.go index d6db3ce..2bd219d 100644 --- a/feedtest/example.go +++ b/feedtest/example.go @@ -4,7 +4,7 @@ import ( "context" "math/rand" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" ) func getRandomString(length int) string { diff --git a/go.mod b/go.mod index e107da9..a28d2d6 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/GetStream/getstream-go/v5 +module github.com/GetStream/getstream-go/v6 go 1.19 diff --git a/models.go b/models.go index 2e2d9d9..a0d7dbd 100644 --- a/models.go +++ b/models.go @@ -3287,12 +3287,11 @@ type ChannelMemberPartialResponse struct { } type ChannelMemberRequest struct { - UserID string `json:"user_id"` // Role of the member in the channel - ChannelRole *string `json:"channel_role,omitempty"` - Custom map[string]any `json:"custom,omitempty"` - // User response object - User *UserResponse `json:"user,omitempty"` + ChannelRole *string `json:"channel_role,omitempty"` + UserID *string `json:"user_id,omitempty"` + Custom map[string]any `json:"custom,omitempty"` + User *MemberUserRequest `json:"user,omitempty"` } type ChannelMemberResponse struct { @@ -7979,6 +7978,19 @@ func (e *MemberUpdatedEvent) GetEventType() string { return e.Type } +type MemberUserRequest struct { + ID string `json:"id"` + Image *string `json:"image,omitempty"` + Invisible *bool `json:"invisible,omitempty"` + Language *string `json:"language,omitempty"` + Name *string `json:"name,omitempty"` + Role *string `json:"role,omitempty"` + Teams []string `json:"teams,omitempty"` + Custom map[string]any `json:"custom,omitempty"` + PrivacySettings *PrivacySettingsResponse `json:"privacy_settings,omitempty"` + TeamsRole map[string]string `json:"teams_role,omitempty"` +} + type MembersResponse struct { // Duration of the request in milliseconds Duration string `json:"duration"` @@ -9768,26 +9780,27 @@ type PollResponse struct { } type PollResponseData struct { - AllowAnswers bool `json:"allow_answers"` - AllowUserSuggestedOptions bool `json:"allow_user_suggested_options"` - AnswersCount int `json:"answers_count"` - CreatedAt Timestamp `json:"created_at"` - CreatedByID string `json:"created_by_id"` - Description string `json:"description"` - EnforceUniqueVote bool `json:"enforce_unique_vote"` - ID string `json:"id"` - Name string `json:"name"` - UpdatedAt Timestamp `json:"updated_at"` - VoteCount int `json:"vote_count"` - VotingVisibility string `json:"voting_visibility"` - LatestAnswers []PollVoteResponseData `json:"latest_answers"` - Options []PollOptionResponseData `json:"options"` - OwnVotes []PollVoteResponseData `json:"own_votes"` - Custom map[string]any `json:"custom"` - LatestVotesByOption map[string][]PollVoteResponseData `json:"latest_votes_by_option"` - VoteCountsByOption map[string]int `json:"vote_counts_by_option"` - IsClosed *bool `json:"is_closed,omitempty"` - MaxVotesAllowed *int `json:"max_votes_allowed,omitempty"` + AllowAnswers bool `json:"allow_answers"` + AllowUserSuggestedOptions bool `json:"allow_user_suggested_options"` + AnswersCount int `json:"answers_count"` + CreatedAt Timestamp `json:"created_at"` + CreatedByID string `json:"created_by_id"` + Description string `json:"description"` + EnforceUniqueVote bool `json:"enforce_unique_vote"` + ID string `json:"id"` + Name string `json:"name"` + UpdatedAt Timestamp `json:"updated_at"` + VoteCount int `json:"vote_count"` + // Voting visibility of the poll + VotingVisibility string `json:"voting_visibility"` + LatestAnswers []PollVoteResponseData `json:"latest_answers"` + Options []PollOptionResponseData `json:"options"` + OwnVotes []PollVoteResponseData `json:"own_votes"` + Custom map[string]any `json:"custom"` + LatestVotesByOption map[string][]PollVoteResponseData `json:"latest_votes_by_option"` + VoteCountsByOption map[string]int `json:"vote_counts_by_option"` + IsClosed *bool `json:"is_closed,omitempty"` + MaxVotesAllowed *int `json:"max_votes_allowed,omitempty"` // User response object CreatedBy *UserResponse `json:"created_by,omitempty"` } @@ -10456,16 +10469,16 @@ type QueryLabelResultsResponse struct { } type QueryMembersPayload struct { - Type string `json:"type"` - // Filter conditions to apply to the query - FilterConditions map[string]any `json:"filter_conditions"` - ID *string `json:"id,omitempty"` - Limit *int `json:"limit,omitempty"` - Offset *int `json:"offset,omitempty"` - UserID *string `json:"user_id,omitempty"` - Members []ChannelMemberRequest `json:"members,omitempty"` + Type string `json:"type"` + ID *string `json:"id,omitempty"` + Limit *int `json:"limit,omitempty"` + Offset *int `json:"offset,omitempty"` + UserID *string `json:"user_id,omitempty"` + Members []ChannelMemberRequest `json:"members,omitempty"` // Array of sort parameters Sort []SortParamRequest `json:"sort,omitempty"` + // Filter conditions to apply to the query + FilterConditions map[string]any `json:"filter_conditions,omitempty"` // User request object User *UserRequest `json:"user,omitempty"` } @@ -11049,14 +11062,14 @@ type ReminderCreatedEvent struct { // The ID of the message for which the reminder was created MessageID string `json:"message_id"` // The ID of the user for whom the reminder was created - UserID string `json:"user_id"` - Custom map[string]any `json:"custom"` + UserID string `json:"user_id"` + Custom map[string]any `json:"custom"` + Reminder ReminderResponseData `json:"reminder"` // The type of event: "reminder.created" in this case Type string `json:"type"` // The ID of the parent message, if the reminder is for a thread message - ParentID *string `json:"parent_id,omitempty"` - ReceivedAt *Timestamp `json:"received_at,omitempty"` - Reminder *ReminderResponseData `json:"reminder,omitempty"` + ParentID *string `json:"parent_id,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } func (e *ReminderCreatedEvent) GetEventType() string { @@ -11072,14 +11085,14 @@ type ReminderDeletedEvent struct { // The ID of the message for which the reminder was created MessageID string `json:"message_id"` // The ID of the user for whom the reminder was created - UserID string `json:"user_id"` - Custom map[string]any `json:"custom"` + UserID string `json:"user_id"` + Custom map[string]any `json:"custom"` + Reminder ReminderResponseData `json:"reminder"` // The type of event: "reminder.deleted" in this case Type string `json:"type"` // The ID of the parent message, if the reminder is for a thread message - ParentID *string `json:"parent_id,omitempty"` - ReceivedAt *Timestamp `json:"received_at,omitempty"` - Reminder *ReminderResponseData `json:"reminder,omitempty"` + ParentID *string `json:"parent_id,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } func (e *ReminderDeletedEvent) GetEventType() string { @@ -11095,13 +11108,13 @@ type ReminderNotificationEvent struct { // The ID of the message for which the reminder was created MessageID string `json:"message_id"` // The ID of the user for whom the reminder was created - UserID string `json:"user_id"` - Custom map[string]any `json:"custom"` + UserID string `json:"user_id"` + Custom map[string]any `json:"custom"` + Reminder ReminderResponseData `json:"reminder"` // The type of event: "notification.reminder_due" in this case - Type string `json:"type"` - ParentID *string `json:"parent_id,omitempty"` - ReceivedAt *Timestamp `json:"received_at,omitempty"` - Reminder *ReminderResponseData `json:"reminder,omitempty"` + Type string `json:"type"` + ParentID *string `json:"parent_id,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } func (e *ReminderNotificationEvent) GetEventType() string { @@ -11132,14 +11145,14 @@ type ReminderUpdatedEvent struct { // The ID of the message for which the reminder was created MessageID string `json:"message_id"` // The ID of the user for whom the reminder was created - UserID string `json:"user_id"` - Custom map[string]any `json:"custom"` + UserID string `json:"user_id"` + Custom map[string]any `json:"custom"` + Reminder ReminderResponseData `json:"reminder"` // The type of event: "reminder.updated" in this case Type string `json:"type"` // The ID of the parent message, if the reminder is for a thread message - ParentID *string `json:"parent_id,omitempty"` - ReceivedAt *Timestamp `json:"received_at,omitempty"` - Reminder *ReminderResponseData `json:"reminder,omitempty"` + ParentID *string `json:"parent_id,omitempty"` + ReceivedAt *Timestamp `json:"received_at,omitempty"` } func (e *ReminderUpdatedEvent) GetEventType() string { diff --git a/moderation_integration_test.go b/moderation_integration_test.go index d20933a..605bae1 100644 --- a/moderation_integration_test.go +++ b/moderation_integration_test.go @@ -5,7 +5,7 @@ import ( "context" "testing" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" "github.com/stretchr/testify/require" ) diff --git a/rate_limits_test.go b/rate_limits_test.go index af82021..6e6e450 100644 --- a/rate_limits_test.go +++ b/rate_limits_test.go @@ -4,7 +4,7 @@ import ( "net/http" "testing" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" "github.com/stretchr/testify/assert" ) diff --git a/tasks_test.go b/tasks_test.go index 943b5e1..bef0600 100644 --- a/tasks_test.go +++ b/tasks_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - . "github.com/GetStream/getstream-go/v5" + . "github.com/GetStream/getstream-go/v6" ) // scriptedHTTPClient returns a queued sequence of HTTP responses. Each diff --git a/utils_test.go b/utils_test.go index 8620f7f..9cd34f1 100644 --- a/utils_test.go +++ b/utils_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - . "github.com/GetStream/getstream-go/v5" + . "github.com/GetStream/getstream-go/v6" "github.com/google/uuid" "github.com/stretchr/testify/require" ) diff --git a/video_example_test.go b/video_example_test.go index 1d9b10c..7764a0b 100644 --- a/video_example_test.go +++ b/video_example_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" "github.com/google/uuid" "github.com/stretchr/testify/require" ) diff --git a/video_test.go b/video_test.go index 4db07d7..323e765 100644 --- a/video_test.go +++ b/video_test.go @@ -5,7 +5,7 @@ import ( "context" "testing" - "github.com/GetStream/getstream-go/v5" + "github.com/GetStream/getstream-go/v6" "github.com/stretchr/testify/require" )