mirror of
https://github.com/bitwarden/android.git
synced 2026-03-11 20:54:58 -05:00
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:
@@ -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(),
|
||||
)
|
||||
@@ -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,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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": [
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user