Update SDK to 1.0.0-2681-1a956d45 (#5756)

Co-authored-by: bw-ghapp[bot] <178206702+bw-ghapp[bot]@users.noreply.github.com>
Co-authored-by: Carlos Gonçalves <cgoncalves@bitwarden.com>
This commit is contained in:
bw-ghapp[bot]
2025-08-22 19:57:39 +01:00
committed by GitHub
parent bc7e682941
commit 99ab2245f6
14 changed files with 375 additions and 3 deletions

View File

@@ -0,0 +1,31 @@
package com.bitwarden.network.model
import androidx.annotation.Keep
import com.bitwarden.core.data.serializer.BaseEnumeratedIntSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
/**
* Represents the type of collection assigned to user(s) or group(s).
*/
@Serializable(CollectionTypeSerializer::class)
enum class CollectionTypeJson {
/**
* Default collection type. Can be assigned by an organization to user(s) or group(s).
*/
@SerialName("0")
SHARED_COLLECTION,
/**
* Default collection assigned to a user for an organization that has
* OrganizationDataOwnership (formerly PersonalOwnership) policy enabled.
*/
@SerialName("1")
DEFAULT_USER_COLLECTION,
}
@Keep
private class CollectionTypeSerializer : BaseEnumeratedIntSerializer<CollectionTypeJson>(
className = "CollectionTypeJson",
values = CollectionTypeJson.entries.toTypedArray(),
)

View File

@@ -998,6 +998,9 @@ data class SyncResponseJson(
* @property externalId The external ID of the collection (nullable).
* @property isReadOnly If the collection is marked as read only.
* @property id The ID of the collection.
* @property defaultUserCollectionEmail The offboarded user's email address to be used as name
* for the collection.
* @property type The collection's type.
*/
@Serializable
data class Collection(
@@ -1021,5 +1024,11 @@ data class SyncResponseJson(
@SerialName("manage")
val canManage: Boolean?,
@SerialName("defaultUserCollectionEmail")
val defaultUserCollectionEmail: String?,
@SerialName("type")
val type: CollectionTypeJson = CollectionTypeJson.SHARED_COLLECTION,
)
}

View File

@@ -214,7 +214,9 @@ private const val SYNC_SUCCESS_JSON = """
"externalId": "mockExternalId-1",
"readOnly": false,
"id": "mockId-1",
"manage": true
"manage": true,
"defaultUserCollectionEmail": "mockOffboardedUserEmail-1",
"type": 0
}
],
"ciphers": [

View File

@@ -13,6 +13,8 @@ fun createMockCollection(
isReadOnly: Boolean = false,
id: String = "mockId-$number",
canManage: Boolean? = true,
defaultUserCollectionEmail: String? = "mockOffboardedUserEmail-$number",
type: CollectionTypeJson = CollectionTypeJson.SHARED_COLLECTION,
): SyncResponseJson.Collection =
SyncResponseJson.Collection(
organizationId = organizationId,
@@ -22,4 +24,6 @@ fun createMockCollection(
isReadOnly = isReadOnly,
id = id,
canManage = canManage,
defaultUserCollectionEmail = defaultUserCollectionEmail,
type = type,
)