@@ -1016,12 +1016,14 @@ public func FfiConverterTypeSuggestGlobalConfig_lower(_ value: SuggestGlobalConf
1016
1016
1017
1017
public struct SuggestIngestionConstraints {
1018
1018
public var providers : [ SuggestionProvider ] ?
1019
+ public var providerConstraints : SuggestionProviderConstraints ?
1019
1020
public var emptyOnly : Bool
1020
1021
1021
1022
// Default memberwise initializers are never public by default, so we
1022
1023
// declare one manually.
1023
- public init ( providers: [ SuggestionProvider ] ? = nil , emptyOnly: Bool = false ) {
1024
+ public init ( providers: [ SuggestionProvider ] ? = nil , providerConstraints : SuggestionProviderConstraints ? = nil , emptyOnly: Bool = false ) {
1024
1025
self . providers = providers
1026
+ self . providerConstraints = providerConstraints
1025
1027
self . emptyOnly = emptyOnly
1026
1028
}
1027
1029
}
@@ -1033,6 +1035,9 @@ extension SuggestIngestionConstraints: Equatable, Hashable {
1033
1035
if lhs. providers != rhs. providers {
1034
1036
return false
1035
1037
}
1038
+ if lhs. providerConstraints != rhs. providerConstraints {
1039
+ return false
1040
+ }
1036
1041
if lhs. emptyOnly != rhs. emptyOnly {
1037
1042
return false
1038
1043
}
@@ -1041,6 +1046,7 @@ extension SuggestIngestionConstraints: Equatable, Hashable {
1041
1046
1042
1047
public func hash( into hasher: inout Hasher ) {
1043
1048
hasher. combine ( providers)
1049
+ hasher. combine ( providerConstraints)
1044
1050
hasher. combine ( emptyOnly)
1045
1051
}
1046
1052
}
@@ -1051,12 +1057,14 @@ public struct FfiConverterTypeSuggestIngestionConstraints: FfiConverterRustBuffe
1051
1057
return
1052
1058
try SuggestIngestionConstraints (
1053
1059
providers: FfiConverterOptionSequenceTypeSuggestionProvider . read ( from: & buf) ,
1060
+ providerConstraints: FfiConverterOptionTypeSuggestionProviderConstraints . read ( from: & buf) ,
1054
1061
emptyOnly: FfiConverterBool . read ( from: & buf)
1055
1062
)
1056
1063
}
1057
1064
1058
1065
public static func write( _ value: SuggestIngestionConstraints , into buf: inout [ UInt8 ] ) {
1059
1066
FfiConverterOptionSequenceTypeSuggestionProvider . write ( value. providers, into: & buf)
1067
+ FfiConverterOptionTypeSuggestionProviderConstraints . write ( value. providerConstraints, into: & buf)
1060
1068
FfiConverterBool . write ( value. emptyOnly, into: & buf)
1061
1069
}
1062
1070
}
@@ -1128,16 +1136,67 @@ public func FfiConverterTypeSuggestIngestionMetrics_lower(_ value: SuggestIngest
1128
1136
}
1129
1137
1130
1138
1139
+ public struct SuggestionProviderConstraints {
1140
+ public var exposureSuggestionTypes : [ String ] ?
1141
+
1142
+ // Default memberwise initializers are never public by default, so we
1143
+ // declare one manually.
1144
+ public init ( exposureSuggestionTypes: [ String ] ? = nil ) {
1145
+ self . exposureSuggestionTypes = exposureSuggestionTypes
1146
+ }
1147
+ }
1148
+
1149
+
1150
+
1151
+ extension SuggestionProviderConstraints : Equatable , Hashable {
1152
+ public static func == ( lhs: SuggestionProviderConstraints , rhs: SuggestionProviderConstraints ) -> Bool {
1153
+ if lhs. exposureSuggestionTypes != rhs. exposureSuggestionTypes {
1154
+ return false
1155
+ }
1156
+ return true
1157
+ }
1158
+
1159
+ public func hash( into hasher: inout Hasher ) {
1160
+ hasher. combine ( exposureSuggestionTypes)
1161
+ }
1162
+ }
1163
+
1164
+
1165
+ public struct FfiConverterTypeSuggestionProviderConstraints : FfiConverterRustBuffer {
1166
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> SuggestionProviderConstraints {
1167
+ return
1168
+ try SuggestionProviderConstraints (
1169
+ exposureSuggestionTypes: FfiConverterOptionSequenceString . read ( from: & buf)
1170
+ )
1171
+ }
1172
+
1173
+ public static func write( _ value: SuggestionProviderConstraints , into buf: inout [ UInt8 ] ) {
1174
+ FfiConverterOptionSequenceString . write ( value. exposureSuggestionTypes, into: & buf)
1175
+ }
1176
+ }
1177
+
1178
+
1179
+ public func FfiConverterTypeSuggestionProviderConstraints_lift( _ buf: RustBuffer ) throws -> SuggestionProviderConstraints {
1180
+ return try FfiConverterTypeSuggestionProviderConstraints . lift ( buf)
1181
+ }
1182
+
1183
+ public func FfiConverterTypeSuggestionProviderConstraints_lower( _ value: SuggestionProviderConstraints ) -> RustBuffer {
1184
+ return FfiConverterTypeSuggestionProviderConstraints . lower ( value)
1185
+ }
1186
+
1187
+
1131
1188
public struct SuggestionQuery {
1132
1189
public var keyword : String
1133
1190
public var providers : [ SuggestionProvider ]
1191
+ public var providerConstraints : SuggestionProviderConstraints ?
1134
1192
public var limit : Int32 ?
1135
1193
1136
1194
// Default memberwise initializers are never public by default, so we
1137
1195
// declare one manually.
1138
- public init ( keyword: String , providers: [ SuggestionProvider ] , limit: Int32 ? = nil ) {
1196
+ public init ( keyword: String , providers: [ SuggestionProvider ] , providerConstraints : SuggestionProviderConstraints ? = nil , limit: Int32 ? = nil ) {
1139
1197
self . keyword = keyword
1140
1198
self . providers = providers
1199
+ self . providerConstraints = providerConstraints
1141
1200
self . limit = limit
1142
1201
}
1143
1202
}
@@ -1152,6 +1211,9 @@ extension SuggestionQuery: Equatable, Hashable {
1152
1211
if lhs. providers != rhs. providers {
1153
1212
return false
1154
1213
}
1214
+ if lhs. providerConstraints != rhs. providerConstraints {
1215
+ return false
1216
+ }
1155
1217
if lhs. limit != rhs. limit {
1156
1218
return false
1157
1219
}
@@ -1161,6 +1223,7 @@ extension SuggestionQuery: Equatable, Hashable {
1161
1223
public func hash( into hasher: inout Hasher ) {
1162
1224
hasher. combine ( keyword)
1163
1225
hasher. combine ( providers)
1226
+ hasher. combine ( providerConstraints)
1164
1227
hasher. combine ( limit)
1165
1228
}
1166
1229
}
@@ -1172,13 +1235,15 @@ public struct FfiConverterTypeSuggestionQuery: FfiConverterRustBuffer {
1172
1235
try SuggestionQuery (
1173
1236
keyword: FfiConverterString . read ( from: & buf) ,
1174
1237
providers: FfiConverterSequenceTypeSuggestionProvider . read ( from: & buf) ,
1238
+ providerConstraints: FfiConverterOptionTypeSuggestionProviderConstraints . read ( from: & buf) ,
1175
1239
limit: FfiConverterOptionInt32 . read ( from: & buf)
1176
1240
)
1177
1241
}
1178
1242
1179
1243
public static func write( _ value: SuggestionQuery , into buf: inout [ UInt8 ] ) {
1180
1244
FfiConverterString . write ( value. keyword, into: & buf)
1181
1245
FfiConverterSequenceTypeSuggestionProvider . write ( value. providers, into: & buf)
1246
+ FfiConverterOptionTypeSuggestionProviderConstraints . write ( value. providerConstraints, into: & buf)
1182
1247
FfiConverterOptionInt32 . write ( value. limit, into: & buf)
1183
1248
}
1184
1249
}
@@ -1400,6 +1465,8 @@ public enum Suggestion {
1400
1465
)
1401
1466
case fakespot( fakespotGrade: String , productId: String , rating: Double , title: String , totalReviews: Int64 , url: String , icon: [ UInt8 ] ? , iconMimetype: String ? , score: Double
1402
1467
)
1468
+ case exposure( suggestionType: String , score: Double
1469
+ )
1403
1470
}
1404
1471
1405
1472
@@ -1434,6 +1501,9 @@ public struct FfiConverterTypeSuggestion: FfiConverterRustBuffer {
1434
1501
case 8 : return . fakespot( fakespotGrade: try FfiConverterString . read ( from: & buf) , productId: try FfiConverterString . read ( from: & buf) , rating: try FfiConverterDouble . read ( from: & buf) , title: try FfiConverterString . read ( from: & buf) , totalReviews: try FfiConverterInt64 . read ( from: & buf) , url: try FfiConverterString . read ( from: & buf) , icon: try FfiConverterOptionSequenceUInt8 . read ( from: & buf) , iconMimetype: try FfiConverterOptionString . read ( from: & buf) , score: try FfiConverterDouble . read ( from: & buf)
1435
1502
)
1436
1503
1504
+ case 9 : return . exposure( suggestionType: try FfiConverterString . read ( from: & buf) , score: try FfiConverterDouble . read ( from: & buf)
1505
+ )
1506
+
1437
1507
default : throw UniffiInternalError . unexpectedEnumCase
1438
1508
}
1439
1509
}
@@ -1525,6 +1595,12 @@ public struct FfiConverterTypeSuggestion: FfiConverterRustBuffer {
1525
1595
FfiConverterOptionString . write ( iconMimetype, into: & buf)
1526
1596
FfiConverterDouble . write ( score, into: & buf)
1527
1597
1598
+
1599
+ case let . exposure( suggestionType, score) :
1600
+ writeInt ( & buf, Int32 ( 9 ) )
1601
+ FfiConverterString . write ( suggestionType, into: & buf)
1602
+ FfiConverterDouble . write ( score, into: & buf)
1603
+
1528
1604
}
1529
1605
}
1530
1606
}
@@ -1558,6 +1634,7 @@ public enum SuggestionProvider {
1558
1634
case weather
1559
1635
case ampMobile
1560
1636
case fakespot
1637
+ case exposure
1561
1638
}
1562
1639
1563
1640
@@ -1586,6 +1663,8 @@ public struct FfiConverterTypeSuggestionProvider: FfiConverterRustBuffer {
1586
1663
1587
1664
case 9 : return . fakespot
1588
1665
1666
+ case 10 : return . exposure
1667
+
1589
1668
default : throw UniffiInternalError . unexpectedEnumCase
1590
1669
}
1591
1670
}
@@ -1629,6 +1708,10 @@ public struct FfiConverterTypeSuggestionProvider: FfiConverterRustBuffer {
1629
1708
case . fakespot:
1630
1709
writeInt ( & buf, Int32 ( 9 ) )
1631
1710
1711
+
1712
+ case . exposure:
1713
+ writeInt ( & buf, Int32 ( 10 ) )
1714
+
1632
1715
}
1633
1716
}
1634
1717
}
@@ -1690,6 +1773,27 @@ fileprivate struct FfiConverterOptionString: FfiConverterRustBuffer {
1690
1773
}
1691
1774
}
1692
1775
1776
+ fileprivate struct FfiConverterOptionTypeSuggestionProviderConstraints : FfiConverterRustBuffer {
1777
+ typealias SwiftType = SuggestionProviderConstraints ?
1778
+
1779
+ public static func write( _ value: SwiftType , into buf: inout [ UInt8 ] ) {
1780
+ guard let value = value else {
1781
+ writeInt ( & buf, Int8 ( 0 ) )
1782
+ return
1783
+ }
1784
+ writeInt ( & buf, Int8 ( 1 ) )
1785
+ FfiConverterTypeSuggestionProviderConstraints . write ( value, into: & buf)
1786
+ }
1787
+
1788
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> SwiftType {
1789
+ switch try readInt ( & buf) as Int8 {
1790
+ case 0 : return nil
1791
+ case 1 : return try FfiConverterTypeSuggestionProviderConstraints . read ( from: & buf)
1792
+ default : throw UniffiInternalError . unexpectedOptionalTag
1793
+ }
1794
+ }
1795
+ }
1796
+
1693
1797
fileprivate struct FfiConverterOptionTypeInterruptKind : FfiConverterRustBuffer {
1694
1798
typealias SwiftType = InterruptKind ?
1695
1799
@@ -1753,6 +1857,27 @@ fileprivate struct FfiConverterOptionSequenceUInt8: FfiConverterRustBuffer {
1753
1857
}
1754
1858
}
1755
1859
1860
+ fileprivate struct FfiConverterOptionSequenceString : FfiConverterRustBuffer {
1861
+ typealias SwiftType = [ String ] ?
1862
+
1863
+ public static func write( _ value: SwiftType , into buf: inout [ UInt8 ] ) {
1864
+ guard let value = value else {
1865
+ writeInt ( & buf, Int8 ( 0 ) )
1866
+ return
1867
+ }
1868
+ writeInt ( & buf, Int8 ( 1 ) )
1869
+ FfiConverterSequenceString . write ( value, into: & buf)
1870
+ }
1871
+
1872
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> SwiftType {
1873
+ switch try readInt ( & buf) as Int8 {
1874
+ case 0 : return nil
1875
+ case 1 : return try FfiConverterSequenceString . read ( from: & buf)
1876
+ default : throw UniffiInternalError . unexpectedOptionalTag
1877
+ }
1878
+ }
1879
+ }
1880
+
1756
1881
fileprivate struct FfiConverterOptionSequenceTypeSuggestionProvider : FfiConverterRustBuffer {
1757
1882
typealias SwiftType = [ SuggestionProvider ] ?
1758
1883
@@ -1817,6 +1942,28 @@ fileprivate struct FfiConverterSequenceUInt8: FfiConverterRustBuffer {
1817
1942
}
1818
1943
}
1819
1944
1945
+ fileprivate struct FfiConverterSequenceString : FfiConverterRustBuffer {
1946
+ typealias SwiftType = [ String ]
1947
+
1948
+ public static func write( _ value: [ String ] , into buf: inout [ UInt8 ] ) {
1949
+ let len = Int32 ( value. count)
1950
+ writeInt ( & buf, len)
1951
+ for item in value {
1952
+ FfiConverterString . write ( item, into: & buf)
1953
+ }
1954
+ }
1955
+
1956
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> [ String ] {
1957
+ let len : Int32 = try readInt ( & buf)
1958
+ var seq = [ String] ( )
1959
+ seq. reserveCapacity ( Int ( len) )
1960
+ for _ in 0 ..< len {
1961
+ seq. append ( try FfiConverterString . read ( from: & buf) )
1962
+ }
1963
+ return seq
1964
+ }
1965
+ }
1966
+
1820
1967
fileprivate struct FfiConverterSequenceTypeLabeledTimingSample : FfiConverterRustBuffer {
1821
1968
typealias SwiftType = [ LabeledTimingSample ]
1822
1969
0 commit comments