• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hyperwallet / hyperwallet-ios-sdk / 15826401626

21 May 2025 02:36PM UTC coverage: 96.705%. Remained the same
15826401626

push

github

web-flow
Initial commit for CodeQL (#152)

* Initial commit for CodeQL

* Updating language

1937 of 2003 relevant lines covered (96.7%)

18.55 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/Sources/Model/GraphQL/HyperwalletTransferMethodConfigurationField.swift
1
//
2
// Copyright 2018 - Present Hyperwallet
3
//
4
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software
5
// and associated documentation files (the "Software"), to deal in the Software without restriction,
6
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
7
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
8
// furnished to do so, subject to the following conditions:
9
//
10
// The above copyright notice and this permission notice shall be included in all copies or
11
// substantial portions of the Software.
12
//
13
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
14
// BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
16
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18

19
import Foundation
20

21
/// The `HyperwalletTransferMethodConfigurationField` protocol for processing the transfer method
22
/// configuration field result from the Hyperwallet platform.
23
public protocol HyperwalletTransferMethodConfigurationField {
24
    /// Returns a list of `HyperwalletField`
25
    ///
26
    /// - Returns: a list of `HyperwalletFieldGroup`
27
    func fieldGroups() -> [HyperwalletFieldGroup]?
28

29
    /// Returns the list of transfer method types based on the parameters
30
    ///
31
    /// - Returns: HyperwalletTransferMethodType
32
    func transferMethodType() -> HyperwalletTransferMethodType?
33
}
34

35
final class TransferMethodConfigurationFieldResult: HyperwalletTransferMethodConfigurationField {
36
    private let transferMethodUIConfigurations: [HyperwalletTransferMethodConfiguration]?
37
    private let country: HyperwalletCountry?
38

39
    /// Creates a new instance of the 'HyperwalletTransferMethodConfigurationField' based on the
40
    /// transfer method configuration result
41
    ///
42
    /// - Parameters:
43
    ///   - transferMethodUIConfigurations: the GraphQL `[HyperwalletTransferMethodConfiguration]`
44
    ///   - country: the GraphQL `HyperwalletCountry`
45
    init(_ transferMethodUIConfigurations: [HyperwalletTransferMethodConfiguration]?, _ country: HyperwalletCountry?) {
5✔
46
        self.transferMethodUIConfigurations = transferMethodUIConfigurations
5✔
47
        self.country = country
5✔
48
    }
5✔
49

50
    func fieldGroups() -> [HyperwalletFieldGroup]? {
8✔
51
        transferMethodUIConfigurations?.first?.fieldGroups?.nodes
8✔
52
    }
8✔
53

54
    func transferMethodType() -> HyperwalletTransferMethodType? {
3✔
55
        country?.currencies?.nodes?.first?.transferMethodTypes?.nodes?.first
3✔
56
    }
3✔
57
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc