@@ -554,12 +554,11 @@ open class CuratedRecommendationsClient: CuratedRecommendationsClientProtocol, @
554
554
public func uniffiClonePointer( ) -> UnsafeMutableRawPointer {
555
555
return try ! rustCall { uniffi_merino_fn_clone_curatedrecommendationsclient ( self . pointer, $0) }
556
556
}
557
- public convenience init ( baseHost : String ? , userAgentHeader : String ) throws {
557
+ public convenience init ( config : CuratedRecommendationsConfig ) throws {
558
558
let pointer =
559
559
try rustCallWithError ( FfiConverterTypeCuratedRecommendationsApiError_lift) {
560
560
uniffi_merino_fn_constructor_curatedrecommendationsclient_new (
561
- FfiConverterOptionString . lower ( baseHost) ,
562
- FfiConverterString . lower ( userAgentHeader) , $0
561
+ FfiConverterTypeCuratedRecommendationsConfig_lower ( config) , $0
563
562
)
564
563
}
565
564
self . init ( unsafeFromRawPointer: pointer)
@@ -710,6 +709,76 @@ public func FfiConverterTypeCuratedRecommendationsBucket_lower(_ value: CuratedR
710
709
}
711
710
712
711
712
+ public struct CuratedRecommendationsConfig {
713
+ public var baseHost : String ?
714
+ public var userAgentHeader : String
715
+
716
+ // Default memberwise initializers are never public by default, so we
717
+ // declare one manually.
718
+ public init ( baseHost: String ? , userAgentHeader: String ) {
719
+ self . baseHost = baseHost
720
+ self . userAgentHeader = userAgentHeader
721
+ }
722
+ }
723
+
724
+ #if compiler(>=6)
725
+ extension CuratedRecommendationsConfig : Sendable { }
726
+ #endif
727
+
728
+
729
+ extension CuratedRecommendationsConfig : Equatable , Hashable {
730
+ public static func == ( lhs: CuratedRecommendationsConfig , rhs: CuratedRecommendationsConfig ) -> Bool {
731
+ if lhs. baseHost != rhs. baseHost {
732
+ return false
733
+ }
734
+ if lhs. userAgentHeader != rhs. userAgentHeader {
735
+ return false
736
+ }
737
+ return true
738
+ }
739
+
740
+ public func hash( into hasher: inout Hasher ) {
741
+ hasher. combine ( baseHost)
742
+ hasher. combine ( userAgentHeader)
743
+ }
744
+ }
745
+
746
+
747
+
748
+ #if swift(>=5.8)
749
+ @_documentation ( visibility: private)
750
+ #endif
751
+ public struct FfiConverterTypeCuratedRecommendationsConfig : FfiConverterRustBuffer {
752
+ public static func read( from buf: inout ( data: Data , offset: Data . Index ) ) throws -> CuratedRecommendationsConfig {
753
+ return
754
+ try CuratedRecommendationsConfig (
755
+ baseHost: FfiConverterOptionString . read ( from: & buf) ,
756
+ userAgentHeader: FfiConverterString . read ( from: & buf)
757
+ )
758
+ }
759
+
760
+ public static func write( _ value: CuratedRecommendationsConfig , into buf: inout [ UInt8 ] ) {
761
+ FfiConverterOptionString . write ( value. baseHost, into: & buf)
762
+ FfiConverterString . write ( value. userAgentHeader, into: & buf)
763
+ }
764
+ }
765
+
766
+
767
+ #if swift(>=5.8)
768
+ @_documentation ( visibility: private)
769
+ #endif
770
+ public func FfiConverterTypeCuratedRecommendationsConfig_lift( _ buf: RustBuffer ) throws -> CuratedRecommendationsConfig {
771
+ return try FfiConverterTypeCuratedRecommendationsConfig . lift ( buf)
772
+ }
773
+
774
+ #if swift(>=5.8)
775
+ @_documentation ( visibility: private)
776
+ #endif
777
+ public func FfiConverterTypeCuratedRecommendationsConfig_lower( _ value: CuratedRecommendationsConfig ) -> RustBuffer {
778
+ return FfiConverterTypeCuratedRecommendationsConfig . lower ( value)
779
+ }
780
+
781
+
713
782
public struct CuratedRecommendationsRequest {
714
783
public var locale : CuratedRecommendationLocale
715
784
public var region : String ?
@@ -2766,7 +2835,7 @@ private let initializationResult: InitializationResult = {
2766
2835
if ( uniffi_merino_checksum_method_curatedrecommendationsclient_get_curated_recommendations ( ) != 49968 ) {
2767
2836
return InitializationResult . apiChecksumMismatch
2768
2837
}
2769
- if ( uniffi_merino_checksum_constructor_curatedrecommendationsclient_new ( ) != 17990 ) {
2838
+ if ( uniffi_merino_checksum_constructor_curatedrecommendationsclient_new ( ) != 14537 ) {
2770
2839
return InitializationResult . apiChecksumMismatch
2771
2840
}
2772
2841
0 commit comments