summaryrefslogtreecommitdiffhomepage
path: root/ios/MullvadVPN/SettingsInteractorFactory.swift
blob: 521e5875707f8c716bc2e90e1a2d11df56a4d560 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
//  SettingsInteractorFactory.swift
//  MullvadVPN
//
//  Created by pronebird on 26/10/2022.
//  Copyright © 2022 Mullvad VPN AB. All rights reserved.
//

import Foundation
import MullvadREST

final class SettingsInteractorFactory {
    private let storePaymentManager: StorePaymentManager
    private let tunnelManager: TunnelManager
    private let apiProxy: REST.APIProxy

    init(
        storePaymentManager: StorePaymentManager,
        tunnelManager: TunnelManager,
        apiProxy: REST.APIProxy
    ) {
        self.storePaymentManager = storePaymentManager
        self.tunnelManager = tunnelManager
        self.apiProxy = apiProxy
    }

    func makeAccountInteractor() -> AccountInteractor {
        return AccountInteractor(
            storePaymentManager: storePaymentManager,
            tunnelManager: tunnelManager
        )
    }

    func makePreferencesInteractor() -> PreferencesInteractor {
        return PreferencesInteractor(tunnelManager: tunnelManager)
    }

    func makeProblemReportInteractor() -> ProblemReportInteractor {
        return ProblemReportInteractor(apiProxy: apiProxy, tunnelManager: tunnelManager)
    }

    func makeSettingsInteractor() -> SettingsInteractor {
        return SettingsInteractor(tunnelManager: tunnelManager)
    }
}