From be20f9e560c7313295ef710812577712d8582f18 Mon Sep 17 00:00:00 2001 From: "marcin.cebo" Date: Thu, 5 Dec 2024 14:26:55 +0100 Subject: [PATCH 1/7] Fix parameter name in manageChannelMembers --- .../src/jvmMain/kotlin/com/pubnub/api/PubNub.kt | 4 ++-- .../api/integration/ObjectsIntegrationTest.kt | 13 +++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/pubnub-kotlin/pubnub-kotlin-api/src/jvmMain/kotlin/com/pubnub/api/PubNub.kt b/pubnub-kotlin/pubnub-kotlin-api/src/jvmMain/kotlin/com/pubnub/api/PubNub.kt index f714f7e7a..18b819ea6 100644 --- a/pubnub-kotlin/pubnub-kotlin-api/src/jvmMain/kotlin/com/pubnub/api/PubNub.kt +++ b/pubnub-kotlin/pubnub-kotlin-api/src/jvmMain/kotlin/com/pubnub/api/PubNub.kt @@ -1868,7 +1868,7 @@ actual interface PubNub : StatusEmitter, EventEmitter { * * @param channel Channel name * @param usersToSet Collection of members to add to the channel. @see [com.pubnub.api.models.consumer.objects.member.PNMember.Partial] - * @param usersToRemove Members to remove from channel. + * @param usersIdsToRemove Members to remove from channel. * @param limit Number of objects to return in the response. * Default is 100, which is also the maximum value. * Set limit to 0 (zero) and includeCount to true if you want to retrieve only a result count. @@ -1886,7 +1886,7 @@ actual interface PubNub : StatusEmitter, EventEmitter { fun manageChannelMembers( channel: String, usersToSet: Collection, - usersToRemove: Collection, + usersIdsToRemove: Collection, limit: Int? = null, page: PNPage? = null, filter: String? = null, diff --git a/pubnub-kotlin/pubnub-kotlin-impl/src/integrationTest/kotlin/com/pubnub/api/integration/ObjectsIntegrationTest.kt b/pubnub-kotlin/pubnub-kotlin-impl/src/integrationTest/kotlin/com/pubnub/api/integration/ObjectsIntegrationTest.kt index 53ec5c7da..34375bdbe 100644 --- a/pubnub-kotlin/pubnub-kotlin-impl/src/integrationTest/kotlin/com/pubnub/api/integration/ObjectsIntegrationTest.kt +++ b/pubnub-kotlin/pubnub-kotlin-impl/src/integrationTest/kotlin/com/pubnub/api/integration/ObjectsIntegrationTest.kt @@ -540,11 +540,8 @@ class ObjectsIntegrationTest : BaseIntegrationTest() { pubnub.manageChannelMembers( channel = channel, usersToSet = listOf(PNMember.Partial(uuidId = testUserId01, status = status01, type = type01)), - usersToRemove = listOf(), - include = MemberInclude( - includeStatus = true, - includeType = true, - ) + usersIdsToRemove = listOf(), + include = MemberInclude(includeStatus = true, includeType = true) ).sync() val getAllResult = @@ -585,7 +582,7 @@ class ObjectsIntegrationTest : BaseIntegrationTest() { pubnub.manageChannelMembers( channel = channel, usersToSet = listOf(), - usersToRemove = listOf(testUserId01, testUserId02), + usersIdsToRemove = listOf(testUserId01, testUserId02), ).sync().data assertThat(removeResult, not(containsInAnyOrder(testUuidMatcher, otherTestUuidMatcher))) @@ -601,7 +598,7 @@ class ObjectsIntegrationTest : BaseIntegrationTest() { pubnub.manageChannelMembers( channel = channel, usersToSet = listOf(PNMember.Partial(uuidId = testUserId01, status = status01)), - usersToRemove = listOf(), + usersIdsToRemove = listOf(), ).sync() val getAllResult = @@ -635,7 +632,7 @@ class ObjectsIntegrationTest : BaseIntegrationTest() { pubnub.manageChannelMembers( channel = channel, usersToSet = listOf(), - usersToRemove = listOf(testUserId01, testUserId02), + usersIdsToRemove = listOf(testUserId01, testUserId02), ).sync().data assertThat(removeResult, not(containsInAnyOrder(testUuidMatcher, otherTestUuidMatcher))) From 92958e22e8819615506094e217a26c3392521c95 Mon Sep 17 00:00:00 2001 From: "marcin.cebo" Date: Thu, 5 Dec 2024 14:53:57 +0100 Subject: [PATCH 2/7] Fix parameter name in manageChannelMembers --- .../objects_api/members/ManageChannelMembersImpl.java | 10 +++++----- .../src/jvmMain/kotlin/com/pubnub/api/PubNub.kt | 4 ++-- .../pubnub/api/integration/ObjectsIntegrationTest.kt | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pubnub-gson/pubnub-gson-impl/src/main/java/com/pubnub/internal/java/endpoints/objects_api/members/ManageChannelMembersImpl.java b/pubnub-gson/pubnub-gson-impl/src/main/java/com/pubnub/internal/java/endpoints/objects_api/members/ManageChannelMembersImpl.java index 83934c095..c4a7fda8e 100644 --- a/pubnub-gson/pubnub-gson-impl/src/main/java/com/pubnub/internal/java/endpoints/objects_api/members/ManageChannelMembersImpl.java +++ b/pubnub-gson/pubnub-gson-impl/src/main/java/com/pubnub/internal/java/endpoints/objects_api/members/ManageChannelMembersImpl.java @@ -46,7 +46,7 @@ public class ManageChannelMembersImpl extends DelegatingEndpoint uuidsToSet; // deprecated private Collection uuidsToRemove; // deprecated private Collection usersToSet; - private List usersIdsToRemove; + private List userIdsToRemove; private MemberInclude include; @Deprecated @@ -57,11 +57,11 @@ public ManageChannelMembersImpl(String channel, Collection uuidsToSet, C this.uuidsToRemove = uuidsToRemove; } - public ManageChannelMembersImpl(final PubNub pubnubInstance, String channel, Collection usersToSet, Collection usersIdsToRemove) { + public ManageChannelMembersImpl(final PubNub pubnubInstance, String channel, Collection usersToSet, Collection userIdsToRemove) { super(pubnubInstance); this.channel = channel; this.usersToSet = usersToSet; - this.usersIdsToRemove = new ArrayList<>(usersIdsToRemove); + this.userIdsToRemove = new ArrayList<>(userIdsToRemove); } @NotNull @@ -77,9 +77,9 @@ protected Endpoint createRemoteAction() { List toRemove; // new API use - if (usersToSet != null || usersIdsToRemove != null) { + if (usersToSet != null || userIdsToRemove != null) { toSet = createMemberInputFromUserToSet(); - toRemove = usersIdsToRemove; + toRemove = userIdsToRemove; } else { // old API used toSet = createMemberInputFromUUIDToSet(); toRemove = createUserIdsFromUUIDToRemove(); diff --git a/pubnub-kotlin/pubnub-kotlin-api/src/jvmMain/kotlin/com/pubnub/api/PubNub.kt b/pubnub-kotlin/pubnub-kotlin-api/src/jvmMain/kotlin/com/pubnub/api/PubNub.kt index 18b819ea6..27a9901d8 100644 --- a/pubnub-kotlin/pubnub-kotlin-api/src/jvmMain/kotlin/com/pubnub/api/PubNub.kt +++ b/pubnub-kotlin/pubnub-kotlin-api/src/jvmMain/kotlin/com/pubnub/api/PubNub.kt @@ -1868,7 +1868,7 @@ actual interface PubNub : StatusEmitter, EventEmitter { * * @param channel Channel name * @param usersToSet Collection of members to add to the channel. @see [com.pubnub.api.models.consumer.objects.member.PNMember.Partial] - * @param usersIdsToRemove Members to remove from channel. + * @param userIdsToRemove Members to remove from channel. * @param limit Number of objects to return in the response. * Default is 100, which is also the maximum value. * Set limit to 0 (zero) and includeCount to true if you want to retrieve only a result count. @@ -1886,7 +1886,7 @@ actual interface PubNub : StatusEmitter, EventEmitter { fun manageChannelMembers( channel: String, usersToSet: Collection, - usersIdsToRemove: Collection, + userIdsToRemove: Collection, limit: Int? = null, page: PNPage? = null, filter: String? = null, diff --git a/pubnub-kotlin/pubnub-kotlin-impl/src/integrationTest/kotlin/com/pubnub/api/integration/ObjectsIntegrationTest.kt b/pubnub-kotlin/pubnub-kotlin-impl/src/integrationTest/kotlin/com/pubnub/api/integration/ObjectsIntegrationTest.kt index 34375bdbe..79ac31f12 100644 --- a/pubnub-kotlin/pubnub-kotlin-impl/src/integrationTest/kotlin/com/pubnub/api/integration/ObjectsIntegrationTest.kt +++ b/pubnub-kotlin/pubnub-kotlin-impl/src/integrationTest/kotlin/com/pubnub/api/integration/ObjectsIntegrationTest.kt @@ -540,7 +540,7 @@ class ObjectsIntegrationTest : BaseIntegrationTest() { pubnub.manageChannelMembers( channel = channel, usersToSet = listOf(PNMember.Partial(uuidId = testUserId01, status = status01, type = type01)), - usersIdsToRemove = listOf(), + userIdsToRemove = listOf(), include = MemberInclude(includeStatus = true, includeType = true) ).sync() @@ -582,7 +582,7 @@ class ObjectsIntegrationTest : BaseIntegrationTest() { pubnub.manageChannelMembers( channel = channel, usersToSet = listOf(), - usersIdsToRemove = listOf(testUserId01, testUserId02), + userIdsToRemove = listOf(testUserId01, testUserId02), ).sync().data assertThat(removeResult, not(containsInAnyOrder(testUuidMatcher, otherTestUuidMatcher))) @@ -598,7 +598,7 @@ class ObjectsIntegrationTest : BaseIntegrationTest() { pubnub.manageChannelMembers( channel = channel, usersToSet = listOf(PNMember.Partial(uuidId = testUserId01, status = status01)), - usersIdsToRemove = listOf(), + userIdsToRemove = listOf(), ).sync() val getAllResult = @@ -632,7 +632,7 @@ class ObjectsIntegrationTest : BaseIntegrationTest() { pubnub.manageChannelMembers( channel = channel, usersToSet = listOf(), - usersIdsToRemove = listOf(testUserId01, testUserId02), + userIdsToRemove = listOf(testUserId01, testUserId02), ).sync().data assertThat(removeResult, not(containsInAnyOrder(testUuidMatcher, otherTestUuidMatcher))) From 99e03de678d06deb2ac518ca40da4495b4f51cfc Mon Sep 17 00:00:00 2001 From: "marcin.cebo" Date: Thu, 5 Dec 2024 17:21:40 +0100 Subject: [PATCH 3/7] Added kDoc --- .../objects_api/member/MemberInclude.kt | 67 +++++++++++++++++++ .../membership/MembershipInclude.kt | 67 +++++++++++++++++++ .../config/ktlint/baseline.xml | 4 +- .../consumer/objects/member/MemberInclude.kt | 17 +++++ .../objects/membership/MembershipInclude.kt | 17 +++++ .../config/ktlint/baseline.xml | 3 + .../consumer/objects/member/MemberInclude.kt | 36 ++++++++++ .../objects/membership/MembershipInclude.kt | 19 ++++++ 8 files changed, 228 insertions(+), 2 deletions(-) diff --git a/pubnub-gson/pubnub-gson-api/src/main/java/com/pubnub/api/java/models/consumer/objects_api/member/MemberInclude.kt b/pubnub-gson/pubnub-gson-api/src/main/java/com/pubnub/api/java/models/consumer/objects_api/member/MemberInclude.kt index d7617f6ff..937a8e0e8 100644 --- a/pubnub-gson/pubnub-gson-api/src/main/java/com/pubnub/api/java/models/consumer/objects_api/member/MemberInclude.kt +++ b/pubnub-gson/pubnub-gson-api/src/main/java/com/pubnub/api/java/models/consumer/objects_api/member/MemberInclude.kt @@ -1,11 +1,25 @@ package com.pubnub.api.java.models.consumer.objects_api.member +/** + * Represents the options for including additional details in member-related operations. + * + * This interface extends [com.pubnub.api.models.consumer.objects.member.MemberInclude] + * and provides a flexible builder pattern to configure the desired inclusion options. + */ interface MemberInclude : com.pubnub.api.models.consumer.objects.member.MemberInclude { companion object { + /** + * Creates a new [Builder] for constructing a [MemberInclude] instance. + * + * @return a new [Builder] instance. + */ @JvmStatic fun builder() = Builder() } + /** + * Builder class for configuring and creating instances of [MemberInclude]. + */ class Builder internal constructor() { var includeCustom: Boolean = false var includeStatus: Boolean = false @@ -16,46 +30,99 @@ interface MemberInclude : com.pubnub.api.models.consumer.objects.member.MemberIn var includeUserType: Boolean = false var includeUserStatus: Boolean = false + /** + * Specifies whether to include custom data in the member data. + * + * @param includeCustom `true` to include custom fields, `false` otherwise. + * @return the current [Builder] instance. + */ fun includeCustom(includeCustom: Boolean): Builder { this.includeCustom = includeCustom return this } + /** + * Specifies whether to include the status of the member. + * + * @param includeStatus `true` to include status, `false` otherwise. + * @return the current [Builder] instance. + */ fun includeStatus(includeStatus: Boolean): Builder { this.includeStatus = includeStatus return this } + /** + * Specifies whether to include the type of the member. + * + * @param includeType `true` to include type, `false` otherwise. + * @return the current [Builder] instance. + */ fun includeType(includeType: Boolean): Builder { this.includeType = includeType return this } + /** + * Specifies whether to include the total count of members. + * + * @param includeTotalCount `true` to include the total count, `false` otherwise. + * @return the current [Builder] instance. + */ fun includeTotalCount(includeTotalCount: Boolean): Builder { this.includeTotalCount = includeTotalCount return this } + /** + * Specifies whether to include user information in the member data. + * + * @param includeUser `true` to include user information, `false` otherwise. + * @return the current [Builder] instance. + */ fun includeUser(includeUser: Boolean): Builder { this.includeUser = includeUser return this } + /** + * Specifies whether to include custom fields for the user in the member data. + * + * @param includeUserCustom `true` to include user custom fields, `false` otherwise. + * @return the current [Builder] instance. + */ fun includeUserCustom(includeUserCustom: Boolean): Builder { this.includeUserCustom = includeUserCustom return this } + /** + * Specifies whether to include the type of the user in the member data. + * + * @param includeUserType `true` to include user type, `false` otherwise. + * @return the current [Builder] instance. + */ fun includeUserType(includeUserType: Boolean): Builder { this.includeUserType = includeUserType return this } + /** + * Specifies whether to include the status of the user in the member data. + * + * @param includeUserStatus `true` to include user status, `false` otherwise. + * @return the current [Builder] instance. + */ fun includeUserStatus(includeUserStatus: Boolean): Builder { this.includeUserStatus = includeUserStatus return this } + /** + * Builds and returns a new [MemberInclude] instance with the configured options. + * + * @return a new [MemberInclude] instance. + */ fun build(): MemberInclude { return object : MemberInclude { override val includeCustom: Boolean = this@Builder.includeCustom diff --git a/pubnub-gson/pubnub-gson-api/src/main/java/com/pubnub/api/java/models/consumer/objects_api/membership/MembershipInclude.kt b/pubnub-gson/pubnub-gson-api/src/main/java/com/pubnub/api/java/models/consumer/objects_api/membership/MembershipInclude.kt index e4df62ced..64a0c8ce6 100644 --- a/pubnub-gson/pubnub-gson-api/src/main/java/com/pubnub/api/java/models/consumer/objects_api/membership/MembershipInclude.kt +++ b/pubnub-gson/pubnub-gson-api/src/main/java/com/pubnub/api/java/models/consumer/objects_api/membership/MembershipInclude.kt @@ -1,11 +1,25 @@ package com.pubnub.api.java.models.consumer.objects_api.membership +/** + * Represents the options for including additional details in membership-related operations. + * + * This interface extends [com.pubnub.api.models.consumer.objects.membership.MembershipInclude] + * and provides a flexible builder pattern to configure the desired inclusion options. + */ interface MembershipInclude : com.pubnub.api.models.consumer.objects.membership.MembershipInclude { companion object { + /** + * Creates a new [Builder] for constructing a [MembershipInclude] instance. + * + * @return a new [Builder] instance. + */ @JvmStatic fun builder() = Builder() } + /** + * Builder class for configuring and creating instances of [MembershipInclude]. + */ class Builder internal constructor() { var includeCustom: Boolean = false var includeStatus: Boolean = false @@ -16,46 +30,99 @@ interface MembershipInclude : com.pubnub.api.models.consumer.objects.membership. var includeChannelType: Boolean = false var includeChannelStatus: Boolean = false + /** + * Specifies whether to include custom fields in the membership data. + * + * @param includeCustom `true` to include custom data, `false` otherwise. + * @return the current [Builder] instance. + */ fun includeCustom(includeCustom: Boolean): Builder { this.includeCustom = includeCustom return this } + /** + * Specifies whether to include the status of the membership. + * + * @param includeStatus `true` to include status, `false` otherwise. + * @return the current [Builder] instance. + */ fun includeStatus(includeStatus: Boolean): Builder { this.includeStatus = includeStatus return this } + /** + * Specifies whether to include the type of the membership. + * + * @param includeType `true` to include type, `false` otherwise. + * @return the current [Builder] instance. + */ fun includeType(includeType: Boolean): Builder { this.includeType = includeType return this } + /** + * Specifies whether to include the total count of memberships. + * + * @param includeTotalCount `true` to include the total count, `false` otherwise. + * @return the current [Builder] instance. + */ fun includeTotalCount(includeTotalCount: Boolean): Builder { this.includeTotalCount = includeTotalCount return this } + /** + * Specifies whether to include channel information in the membership data. + * + * @param includeChannel `true` to include channel information, `false` otherwise. + * @return the current [Builder] instance. + */ fun includeChannel(includeChannel: Boolean): Builder { this.includeChannel = includeChannel return this } + /** + * Specifies whether to include custom data for the channel in the membership data. + * + * @param includeChannelCustom `true` to include channel custom fields, `false` otherwise. + * @return the current [Builder] instance. + */ fun includeChannelCustom(includeChannelCustom: Boolean): Builder { this.includeChannelCustom = includeChannelCustom return this } + /** + * Specifies whether to include the type of the channel in the membership data. + * + * @param includeChannelType `true` to include channel type, `false` otherwise. + * @return the current [Builder] instance. + */ fun includeChannelType(includeChannelType: Boolean): Builder { this.includeChannelType = includeChannelType return this } + /** + * Specifies whether to include the status of the channel in the membership data. + * + * @param includeChannelStatus `true` to include channel status, `false` otherwise. + * @return the current [Builder] instance. + */ fun includeChannelStatus(includeChannelStatus: Boolean): Builder { this.includeChannelStatus = includeChannelStatus return this } + /** + * Builds and returns a new [MembershipInclude] instance with the configured options. + * + * @return a new [MembershipInclude] instance. + */ fun build(): MembershipInclude { return object : MembershipInclude { override val includeCustom: Boolean = this@Builder.includeCustom diff --git a/pubnub-kotlin/pubnub-kotlin-api/config/ktlint/baseline.xml b/pubnub-kotlin/pubnub-kotlin-api/config/ktlint/baseline.xml index 48f5566e5..73f3810db 100644 --- a/pubnub-kotlin/pubnub-kotlin-api/config/ktlint/baseline.xml +++ b/pubnub-kotlin/pubnub-kotlin-api/config/ktlint/baseline.xml @@ -1,10 +1,10 @@ - + - + diff --git a/pubnub-kotlin/pubnub-kotlin-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/objects/member/MemberInclude.kt b/pubnub-kotlin/pubnub-kotlin-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/objects/member/MemberInclude.kt index 75e85be53..ac252ffe1 100644 --- a/pubnub-kotlin/pubnub-kotlin-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/objects/member/MemberInclude.kt +++ b/pubnub-kotlin/pubnub-kotlin-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/objects/member/MemberInclude.kt @@ -1,5 +1,22 @@ package com.pubnub.api.models.consumer.objects.member +/** + * Factory function to create an instance of [MemberInclude]. + * + * This function provides default values for all inclusion flags and returns an + * implementation of the [MemberInclude] interface with the specified options. + * + * @param includeCustom Whether to include custom properties in the result. Default is `false`. + * @param includeStatus Whether to include the status of the Members in the result. Default is `false`. + * @param includeType Whether to include the type of the Members in the result. Default is `false`. + * @param includeTotalCount Whether to include the total count of Members in the result. Default is `false`. + * @param includeUser Whether to include user information in the result. Default is `false`. + * @param includeUserCustom Whether to include custom properties of the user in the result. Default is `false`. + * @param includeUserType Whether to include the type of the user in the result. Default is `false`. + * @param includeUserStatus Whether to include the status of the user in the result. Default is `false`. + * + * @return An instance of [MemberInclude] with the specified inclusion options. + */ fun MemberInclude( includeCustom: Boolean = false, includeStatus: Boolean = false, diff --git a/pubnub-kotlin/pubnub-kotlin-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/objects/membership/MembershipInclude.kt b/pubnub-kotlin/pubnub-kotlin-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/objects/membership/MembershipInclude.kt index ead05909e..592e05841 100644 --- a/pubnub-kotlin/pubnub-kotlin-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/objects/membership/MembershipInclude.kt +++ b/pubnub-kotlin/pubnub-kotlin-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/objects/membership/MembershipInclude.kt @@ -1,5 +1,22 @@ package com.pubnub.api.models.consumer.objects.membership +/** + * Factory function to create an instance of [MembershipInclude]. + * + * This function provides default values for all inclusion flags and returns an + * implementation of the [MembershipInclude] interface with the specified options. + * + * @param includeCustom Whether to include custom properties in the result. Default is `false`. + * @param includeStatus Whether to include the status of the Memberships in the result. Default is `false`. + * @param includeType Whether to include the type of the Memberships in the result. Default is `false`. + * @param includeTotalCount Whether to include the total count of Memberships in the result. Default is `false`. + * @param includeChannel Whether to include channel information in the result. Default is `false`. + * @param includeChannelCustom Whether to include custom properties of the channel in the result. Default is `false`. + * @param includeChannelType Whether to include the type of the channel in the result. Default is `false`. + * @param includeChannelStatus Whether to include the status of the channel in the result. Default is `false`. + * + * @return An instance of [MembershipInclude] with the specified inclusion options. + */ fun MembershipInclude( includeCustom: Boolean = false, includeStatus: Boolean = false, diff --git a/pubnub-kotlin/pubnub-kotlin-core-api/config/ktlint/baseline.xml b/pubnub-kotlin/pubnub-kotlin-core-api/config/ktlint/baseline.xml index 981420778..d9e947930 100644 --- a/pubnub-kotlin/pubnub-kotlin-core-api/config/ktlint/baseline.xml +++ b/pubnub-kotlin/pubnub-kotlin-core-api/config/ktlint/baseline.xml @@ -1,3 +1,6 @@ + + + diff --git a/pubnub-kotlin/pubnub-kotlin-core-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/objects/member/MemberInclude.kt b/pubnub-kotlin/pubnub-kotlin-core-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/objects/member/MemberInclude.kt index a6e60be11..8a52d666c 100644 --- a/pubnub-kotlin/pubnub-kotlin-core-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/objects/member/MemberInclude.kt +++ b/pubnub-kotlin/pubnub-kotlin-core-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/objects/member/MemberInclude.kt @@ -1,15 +1,51 @@ package com.pubnub.api.models.consumer.objects.member +/** + * Base interface defining options to include additional data when using Memberships API and ChannelMembers. + */ interface Include { + /** + * Whether to include custom data of the Membership in the result. + */ val includeCustom: Boolean + + /** + * Whether to include the status of the Membership in the result. + */ val includeStatus: Boolean + + /** + * Whether to include the type of the Membership in the result. + */ val includeType: Boolean + + /** + * Whether to include the total count of Memberships in the result. + */ val includeTotalCount: Boolean } +/** + * Interface representing options to include additional data when using Channel Members API. + */ interface MemberInclude : Include { + /** + * Whether to include user information in the result. + */ val includeUser: Boolean + + /** + * Whether to include custom properties of the user in the result. + */ val includeUserCustom: Boolean + + /** + * Whether to include the type of the user in the result. + */ val includeUserType: Boolean + + /** + * Whether to include the status of the user in the result. + */ val includeUserStatus: Boolean } diff --git a/pubnub-kotlin/pubnub-kotlin-core-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/objects/membership/MembershipInclude.kt b/pubnub-kotlin/pubnub-kotlin-core-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/objects/membership/MembershipInclude.kt index a87527f09..49f82f30a 100644 --- a/pubnub-kotlin/pubnub-kotlin-core-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/objects/membership/MembershipInclude.kt +++ b/pubnub-kotlin/pubnub-kotlin-core-api/src/commonMain/kotlin/com/pubnub/api/models/consumer/objects/membership/MembershipInclude.kt @@ -2,9 +2,28 @@ package com.pubnub.api.models.consumer.objects.membership import com.pubnub.api.models.consumer.objects.member.Include +/** + * Interface representing options to include additional data when using Memberships API. + */ interface MembershipInclude : Include { + + /** + * Whether to include channel information in the result. + */ val includeChannel: Boolean + + /** + * Whether to include custom properties of the channel in the result. + */ val includeChannelCustom: Boolean + + /** + * Whether to include the type of the channel in the result. + */ val includeChannelType: Boolean + + /** + * Whether to include the status of the channel in the result. + */ val includeChannelStatus: Boolean } From 00c0e19c52cd7e375964b655d3d02eb89564cd6c Mon Sep 17 00:00:00 2001 From: PubNub Release Bot <120067856+pubnub-release-bot@users.noreply.github.com> Date: Thu, 5 Dec 2024 16:49:06 +0000 Subject: [PATCH 4/7] PubNub SDK v10.3.1 release. --- .pubnub.yml | 13 +++++++++---- CHANGELOG.md | 6 ++++++ README.md | 2 +- gradle.properties | 2 +- .../kotlin/com/pubnub/api/legacy/PubNubImplTest.kt | 2 +- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.pubnub.yml b/.pubnub.yml index d8120da65..0b2fd698e 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,9 +1,9 @@ name: kotlin -version: 10.2.1 +version: 10.3.1 schema: 1 scm: github.com/pubnub/kotlin files: - - build/libs/pubnub-kotlin-10.2.1-all.jar + - build/libs/pubnub-kotlin-10.3.1-all.jar sdks: - type: library @@ -23,8 +23,8 @@ sdks: - distribution-type: library distribution-repository: maven - package-name: pubnub-kotlin-10.2.1 - location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.2.1/pubnub-kotlin-10.2.1.jar + package-name: pubnub-kotlin-10.3.1 + location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.3.1/pubnub-kotlin-10.3.1.jar supported-platforms: supported-operating-systems: Android: @@ -114,6 +114,11 @@ sdks: license-url: https://www.apache.org/licenses/LICENSE-2.0.txt is-required: Required changelog: + - date: 2024-12-05 + version: v10.3.1 + changes: + - type: feature + text: "Added also a way to specify optional data being added to the response for Membership and ChannelMembers APIs." - date: 2024-12-03 version: v10.2.1 changes: diff --git a/CHANGELOG.md b/CHANGELOG.md index 6df6e4439..04ba50e15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v10.3.1 +December 05 2024 + +#### Added +- Added also a way to specify optional data being added to the response for Membership and ChannelMembers APIs. + ## v10.2.1 December 03 2024 diff --git a/README.md b/README.md index 440ff75c1..57b3beae7 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ You will need the publish and subscribe keys to authenticate your app. Get your com.pubnub pubnub-kotlin - 10.2.1 + 10.3.1 ``` diff --git a/gradle.properties b/gradle.properties index aad1df2cd..ec3082879 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,7 +18,7 @@ RELEASE_SIGNING_ENABLED=true SONATYPE_HOST=DEFAULT SONATYPE_AUTOMATIC_RELEASE=false GROUP=com.pubnub -VERSION_NAME=10.2.1 +VERSION_NAME=10.3.1 POM_PACKAGING=jar POM_NAME=PubNub SDK diff --git a/pubnub-kotlin/pubnub-kotlin-impl/src/test/kotlin/com/pubnub/api/legacy/PubNubImplTest.kt b/pubnub-kotlin/pubnub-kotlin-impl/src/test/kotlin/com/pubnub/api/legacy/PubNubImplTest.kt index 184856ac8..70c598435 100644 --- a/pubnub-kotlin/pubnub-kotlin-impl/src/test/kotlin/com/pubnub/api/legacy/PubNubImplTest.kt +++ b/pubnub-kotlin/pubnub-kotlin-impl/src/test/kotlin/com/pubnub/api/legacy/PubNubImplTest.kt @@ -56,7 +56,7 @@ class PubNubImplTest : BaseTest() { fun getVersionAndTimeStamp() { val version = PubNubImpl.SDK_VERSION val timeStamp = PubNubImpl.timestamp() - assertEquals("10.2.1", version) + assertEquals("10.3.1", version) assertTrue(timeStamp > 0) } From c75dedc610c4ff1261a1645a2ecd1d47b6b82f59 Mon Sep 17 00:00:00 2001 From: PubNub Release Bot <120067856+pubnub-release-bot@users.noreply.github.com> Date: Thu, 5 Dec 2024 17:08:15 +0000 Subject: [PATCH 5/7] PubNub SDK v10.3.0 release. --- .pubnub.yml | 13 +++++++++---- CHANGELOG.md | 6 ++++++ README.md | 2 +- gradle.properties | 2 +- .../kotlin/com/pubnub/api/legacy/PubNubImplTest.kt | 2 +- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.pubnub.yml b/.pubnub.yml index 0b2fd698e..0ec12a369 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,9 +1,9 @@ name: kotlin -version: 10.3.1 +version: 10.3.0 schema: 1 scm: github.com/pubnub/kotlin files: - - build/libs/pubnub-kotlin-10.3.1-all.jar + - build/libs/pubnub-kotlin-10.3.0-all.jar sdks: - type: library @@ -23,8 +23,8 @@ sdks: - distribution-type: library distribution-repository: maven - package-name: pubnub-kotlin-10.3.1 - location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.3.1/pubnub-kotlin-10.3.1.jar + package-name: pubnub-kotlin-10.3.0 + location: https://repo.maven.apache.org/maven2/com/pubnub/pubnub-kotlin/10.3.0/pubnub-kotlin-10.3.0.jar supported-platforms: supported-operating-systems: Android: @@ -114,6 +114,11 @@ sdks: license-url: https://www.apache.org/licenses/LICENSE-2.0.txt is-required: Required changelog: + - date: 2024-12-05 + version: v10.3.0 + changes: + - type: feature + text: "Added also a way to specify optional data being added to the response for Membership and ChannelMembers APIs." - date: 2024-12-05 version: v10.3.1 changes: diff --git a/CHANGELOG.md b/CHANGELOG.md index 04ba50e15..189fa0fdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v10.3.0 +December 05 2024 + +#### Added +- Added also a way to specify optional data being added to the response for Membership and ChannelMembers APIs. + ## v10.3.1 December 05 2024 diff --git a/README.md b/README.md index 57b3beae7..e8dc8c5cb 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ You will need the publish and subscribe keys to authenticate your app. Get your com.pubnub pubnub-kotlin - 10.3.1 + 10.3.0 ``` diff --git a/gradle.properties b/gradle.properties index ec3082879..6af73796b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,7 +18,7 @@ RELEASE_SIGNING_ENABLED=true SONATYPE_HOST=DEFAULT SONATYPE_AUTOMATIC_RELEASE=false GROUP=com.pubnub -VERSION_NAME=10.3.1 +VERSION_NAME=10.3.0 POM_PACKAGING=jar POM_NAME=PubNub SDK diff --git a/pubnub-kotlin/pubnub-kotlin-impl/src/test/kotlin/com/pubnub/api/legacy/PubNubImplTest.kt b/pubnub-kotlin/pubnub-kotlin-impl/src/test/kotlin/com/pubnub/api/legacy/PubNubImplTest.kt index 70c598435..462749a43 100644 --- a/pubnub-kotlin/pubnub-kotlin-impl/src/test/kotlin/com/pubnub/api/legacy/PubNubImplTest.kt +++ b/pubnub-kotlin/pubnub-kotlin-impl/src/test/kotlin/com/pubnub/api/legacy/PubNubImplTest.kt @@ -56,7 +56,7 @@ class PubNubImplTest : BaseTest() { fun getVersionAndTimeStamp() { val version = PubNubImpl.SDK_VERSION val timeStamp = PubNubImpl.timestamp() - assertEquals("10.3.1", version) + assertEquals("10.3.0", version) assertTrue(timeStamp > 0) } From ee9dc3a6eb415f25c02eb2f49e6d18e21f645f9c Mon Sep 17 00:00:00 2001 From: "marcin.cebo" Date: Thu, 5 Dec 2024 18:17:52 +0100 Subject: [PATCH 6/7] Fix changelog info. --- .pubnub.yml | 5 ----- CHANGELOG.md | 6 ------ 2 files changed, 11 deletions(-) diff --git a/.pubnub.yml b/.pubnub.yml index 0ec12a369..170a25497 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -119,11 +119,6 @@ changelog: changes: - type: feature text: "Added also a way to specify optional data being added to the response for Membership and ChannelMembers APIs." - - date: 2024-12-05 - version: v10.3.1 - changes: - - type: feature - text: "Added also a way to specify optional data being added to the response for Membership and ChannelMembers APIs." - date: 2024-12-03 version: v10.2.1 changes: diff --git a/CHANGELOG.md b/CHANGELOG.md index 189fa0fdc..09461c3a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,12 +4,6 @@ December 05 2024 #### Added - Added also a way to specify optional data being added to the response for Membership and ChannelMembers APIs. -## v10.3.1 -December 05 2024 - -#### Added -- Added also a way to specify optional data being added to the response for Membership and ChannelMembers APIs. - ## v10.2.1 December 03 2024 From 40b3cc9835e755d09ab9c054fb6d034d49339f1c Mon Sep 17 00:00:00 2001 From: "marcin.cebo" Date: Fri, 6 Dec 2024 08:41:28 +0100 Subject: [PATCH 7/7] Fix changelog info. --- .pubnub.yml | 2 +- CHANGELOG.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pubnub.yml b/.pubnub.yml index 170a25497..f0997cff7 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -118,7 +118,7 @@ changelog: version: v10.3.0 changes: - type: feature - text: "Added also a way to specify optional data being added to the response for Membership and ChannelMembers APIs." + text: "Added type aka. membershipType to Memberships and ChannelMembers APIs. Added also a way to specify optional data being added to the response for Membership and ChannelMembers APIs." - date: 2024-12-03 version: v10.2.1 changes: diff --git a/CHANGELOG.md b/CHANGELOG.md index 09461c3a8..39b623f5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ December 05 2024 #### Added -- Added also a way to specify optional data being added to the response for Membership and ChannelMembers APIs. +- Added type aka. membershipType to Memberships and ChannelMembers APIs. Added also a way to specify optional data being added to the response for Membership and ChannelMembers APIs. ## v10.2.1 December 03 2024