@@ -464,8 +464,8 @@ fileprivate struct FfiConverterString: FfiConverter {
464464
465465
466466public struct Collection {
467- public let id : Uuid ?
468- public let organizationId : Uuid
467+ public let id : CollectionId ?
468+ public let organizationId : OrganizationId
469469 public let name : EncString
470470 public let externalId : String ?
471471 public let hidePasswords : Bool
@@ -476,7 +476,7 @@ public struct Collection {
476476
477477 // Default memberwise initializers are never public by default, so we
478478 // declare one manually.
479- public init ( id: Uuid ? , organizationId: Uuid , name: EncString , externalId: String ? , hidePasswords: Bool , readOnly: Bool , manage: Bool , defaultUserCollectionEmail: String ? , type: CollectionType ) {
479+ public init ( id: CollectionId ? , organizationId: OrganizationId , name: EncString , externalId: String ? , hidePasswords: Bool , readOnly: Bool , manage: Bool , defaultUserCollectionEmail: String ? , type: CollectionType ) {
480480 self . id = id
481481 self . organizationId = organizationId
482482 self . name = name
@@ -548,8 +548,8 @@ public struct FfiConverterTypeCollection: FfiConverterRustBuffer {
548548 public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> Collection {
549549 return
550550 try Collection (
551- id: FfiConverterOptionTypeUuid . read ( from: & buf) ,
552- organizationId: FfiConverterTypeUuid . read ( from: & buf) ,
551+ id: FfiConverterOptionTypeCollectionId . read ( from: & buf) ,
552+ organizationId: FfiConverterTypeOrganizationId . read ( from: & buf) ,
553553 name: FfiConverterTypeEncString . read ( from: & buf) ,
554554 externalId: FfiConverterOptionString . read ( from: & buf) ,
555555 hidePasswords: FfiConverterBool . read ( from: & buf) ,
@@ -561,8 +561,8 @@ public struct FfiConverterTypeCollection: FfiConverterRustBuffer {
561561 }
562562
563563 public static func write( _ value: Collection , into buf: inout [ UInt8 ] ) {
564- FfiConverterOptionTypeUuid . write ( value. id, into: & buf)
565- FfiConverterTypeUuid . write ( value. organizationId, into: & buf)
564+ FfiConverterOptionTypeCollectionId . write ( value. id, into: & buf)
565+ FfiConverterTypeOrganizationId . write ( value. organizationId, into: & buf)
566566 FfiConverterTypeEncString . write ( value. name, into: & buf)
567567 FfiConverterOptionString . write ( value. externalId, into: & buf)
568568 FfiConverterBool . write ( value. hidePasswords, into: & buf)
@@ -590,8 +590,8 @@ public func FfiConverterTypeCollection_lower(_ value: Collection) -> RustBuffer
590590
591591
592592public struct CollectionView {
593- public let id : Uuid ?
594- public let organizationId : Uuid
593+ public let id : CollectionId ?
594+ public let organizationId : OrganizationId
595595 public let name : String
596596 public let externalId : String ?
597597 public let hidePasswords : Bool
@@ -601,7 +601,7 @@ public struct CollectionView {
601601
602602 // Default memberwise initializers are never public by default, so we
603603 // declare one manually.
604- public init ( id: Uuid ? , organizationId: Uuid , name: String , externalId: String ? , hidePasswords: Bool , readOnly: Bool , manage: Bool , type: CollectionType ) {
604+ public init ( id: CollectionId ? , organizationId: OrganizationId , name: String , externalId: String ? , hidePasswords: Bool , readOnly: Bool , manage: Bool , type: CollectionType ) {
605605 self . id = id
606606 self . organizationId = organizationId
607607 self . name = name
@@ -668,8 +668,8 @@ public struct FfiConverterTypeCollectionView: FfiConverterRustBuffer {
668668 public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> CollectionView {
669669 return
670670 try CollectionView (
671- id: FfiConverterOptionTypeUuid . read ( from: & buf) ,
672- organizationId: FfiConverterTypeUuid . read ( from: & buf) ,
671+ id: FfiConverterOptionTypeCollectionId . read ( from: & buf) ,
672+ organizationId: FfiConverterTypeOrganizationId . read ( from: & buf) ,
673673 name: FfiConverterString . read ( from: & buf) ,
674674 externalId: FfiConverterOptionString . read ( from: & buf) ,
675675 hidePasswords: FfiConverterBool . read ( from: & buf) ,
@@ -680,8 +680,8 @@ public struct FfiConverterTypeCollectionView: FfiConverterRustBuffer {
680680 }
681681
682682 public static func write( _ value: CollectionView , into buf: inout [ UInt8 ] ) {
683- FfiConverterOptionTypeUuid . write ( value. id, into: & buf)
684- FfiConverterTypeUuid . write ( value. organizationId, into: & buf)
683+ FfiConverterOptionTypeCollectionId . write ( value. id, into: & buf)
684+ FfiConverterTypeOrganizationId . write ( value. organizationId, into: & buf)
685685 FfiConverterString . write ( value. name, into: & buf)
686686 FfiConverterOptionString . write ( value. externalId, into: & buf)
687687 FfiConverterBool . write ( value. hidePasswords, into: & buf)
@@ -810,27 +810,71 @@ fileprivate struct FfiConverterOptionString: FfiConverterRustBuffer {
810810#if swift(>=5.8)
811811@_documentation ( visibility: private)
812812#endif
813- fileprivate struct FfiConverterOptionTypeUuid : FfiConverterRustBuffer {
814- typealias SwiftType = Uuid ?
813+ fileprivate struct FfiConverterOptionTypeCollectionId : FfiConverterRustBuffer {
814+ typealias SwiftType = CollectionId ?
815815
816816 public static func write( _ value: SwiftType , into buf: inout [ UInt8 ] ) {
817817 guard let value = value else {
818818 writeInt ( & buf, Int8 ( 0 ) )
819819 return
820820 }
821821 writeInt ( & buf, Int8 ( 1 ) )
822- FfiConverterTypeUuid . write ( value, into: & buf)
822+ FfiConverterTypeCollectionId . write ( value, into: & buf)
823823 }
824824
825825 public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> SwiftType {
826826 switch try readInt ( & buf) as Int8 {
827827 case 0 : return nil
828- case 1 : return try FfiConverterTypeUuid . read ( from: & buf)
828+ case 1 : return try FfiConverterTypeCollectionId . read ( from: & buf)
829829 default : throw UniffiInternalError . unexpectedOptionalTag
830830 }
831831 }
832832}
833833
834+
835+ /**
836+ * Typealias from the type name used in the UDL file to the builtin type. This
837+ * is needed because the UDL type name is used in function/method signatures.
838+ */
839+ public typealias CollectionId = Uuid
840+
841+ #if swift(>=5.8)
842+ @_documentation ( visibility: private)
843+ #endif
844+ public struct FfiConverterTypeCollectionId : FfiConverter {
845+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> CollectionId {
846+ return try FfiConverterTypeUuid . read ( from: & buf)
847+ }
848+
849+ public static func write( _ value: CollectionId , into buf: inout [ UInt8 ] ) {
850+ return FfiConverterTypeUuid . write ( value, into: & buf)
851+ }
852+
853+ public static func lift( _ value: RustBuffer ) throws -> CollectionId {
854+ return try FfiConverterTypeUuid_lift ( value)
855+ }
856+
857+ public static func lower( _ value: CollectionId ) -> RustBuffer {
858+ return FfiConverterTypeUuid_lower ( value)
859+ }
860+ }
861+
862+
863+ #if swift(>=5.8)
864+ @_documentation ( visibility: private)
865+ #endif
866+ public func FfiConverterTypeCollectionId_lift( _ value: RustBuffer ) throws -> CollectionId {
867+ return try FfiConverterTypeCollectionId . lift ( value)
868+ }
869+
870+ #if swift(>=5.8)
871+ @_documentation ( visibility: private)
872+ #endif
873+ public func FfiConverterTypeCollectionId_lower( _ value: CollectionId ) -> RustBuffer {
874+ return FfiConverterTypeCollectionId . lower ( value)
875+ }
876+
877+
834878private enum InitializationResult {
835879 case ok
836880 case contractVersionMismatch
@@ -847,8 +891,8 @@ private let initializationResult: InitializationResult = {
847891 return InitializationResult . contractVersionMismatch
848892 }
849893
850- uniffiEnsureBitwardenCoreInitialized ( )
851894 uniffiEnsureBitwardenCryptoInitialized ( )
895+ uniffiEnsureBitwardenCoreInitialized ( )
852896 return InitializationResult . ok
853897} ( )
854898
0 commit comments