• 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

90.74
/Sources/Model/TransferMethod/HyperwalletPaperCheck.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
/// Representation of the user's paper check
22
@objcMembers
23
public class HyperwalletPaperCheck: HyperwalletTransferMethod {
24
    override private init(data: [String: AnyCodable]) {
5✔
25
        super.init(data: data)
5✔
26
    }
5✔
27
    /// The required initializer
28
    public required init(from decoder: Decoder) throws {
6✔
29
        try super.init(from: decoder)
6✔
30
    }
6✔
31

32
    /// The user's relationship with the bank account holder.
33
    public var bankAccountRelationship: String? {
2✔
34
        getField(TransferMethodField.bankAccountRelationship.rawValue)
2✔
35
    }
2✔
36

37
    /// The bank account holder's street address.
38
    public var addressLine1: String? {
2✔
39
        getField(TransferMethodField.addressLine1.rawValue)
2✔
40
    }
2✔
41

42
    /// The bank account holder's address, second line.
43
    public var addressLine2: String? {
2✔
44
        getField(TransferMethodField.addressLine2.rawValue)
2✔
45
    }
2✔
46

47
    /// The bank account holder's city.
48
     public var city: String? {
2✔
49
         getField(TransferMethodField.city.rawValue)
2✔
50
     }
2✔
51

52
     /// The bank account holder's country.
53
     public var country: String? {
2✔
54
         getField(TransferMethodField.country.rawValue)
2✔
55
     }
2✔
56

57
    /// The bank account holder's postal code.
58
    public var postalCode: String? {
2✔
59
        getField(TransferMethodField.postalCode.rawValue)
2✔
60
    }
2✔
61

62
    /// The bank account holder's state, province or region.
63
    public var stateProvince: String? {
2✔
64
        getField(TransferMethodField.stateProvince.rawValue)
2✔
65
    }
2✔
66

67
    /// The bank account holder's state, province or region.
68
    public var shippingMethod: String? {
2✔
69
        getField(TransferMethodField.shippingMethod.rawValue)
2✔
70
    }
2✔
71

72
    /// The name of the bank account holder's business.
73
    public var businessName: String? {
1✔
74
        getField(TransferMethodField.businessName.rawValue)
1✔
75
    }
1✔
76

77
    /// The country where the bank account holder's business is registered.
78
    public var businessRegistrationCountry: String? {
×
79
        getField(TransferMethodField.businessRegistrationCountry.rawValue)
×
80
    }
×
81

82
    /// The bank account holder's business registration number or identifier,
83
    /// as assigned by the relevant government body.
84
    public var businessRegistrationId: String? {
×
85
        getField(TransferMethodField.businessRegistrationId.rawValue)
×
86
    }
×
87

88
    /// The state, province or region where the bank account holder's business is registered.
89
    public var businessRegistrationStateProvince: String? {
×
90
        getField(TransferMethodField.businessRegistrationStateProvince.rawValue)
×
91
    }
×
92

93
    /// The bank account holder's business type.
94
    public var businessType: String? {
1✔
95
        getField(TransferMethodField.businessType.rawValue)
1✔
96
    }
1✔
97

98
    /// The bank account holder's birth country.
99
    public var countryOfBirth: String? {
1✔
100
        getField(TransferMethodField.countryOfBirth.rawValue)
1✔
101
    }
1✔
102

103
    /// The bank account holder's nationality country.
104
    public var countryOfNationality: String? {
×
105
        getField(TransferMethodField.countryOfNationality.rawValue)
×
106
    }
×
107

108
    /// The bank account holder's date of birth (All users must be at least 13 years old).
109
    public var dateOfBirth: String? {
2✔
110
        getField(TransferMethodField.dateOfBirth.rawValue)
2✔
111
    }
2✔
112

113
    /// The bank account holder's driver's license number.
114
    public var driversLicenseId: String? {
1✔
115
        getField(TransferMethodField.driversLicenseId.rawValue)
1✔
116
    }
1✔
117

118
    /// The bank account holder's employer identifier, generally used for tax purposes.
119
    public var employerId: String? {
1✔
120
        getField(TransferMethodField.employerId.rawValue)
1✔
121
    }
1✔
122

123
    /// The bank account holder's first name.
124
    public var firstName: String? {
1✔
125
        getField(TransferMethodField.firstName.rawValue)
1✔
126
    }
1✔
127

128
    /// The bank account holder's gender.
129
    public var gender: String? {
1✔
130
        getField(TransferMethodField.gender.rawValue)
1✔
131
    }
1✔
132

133
    /// The bank account holder's government ID number, such as a Social Security Number.
134
    public var governmentId: String? {
1✔
135
        getField(TransferMethodField.governmentId.rawValue)
1✔
136
    }
1✔
137

138
    /// The bank account holder's government ID type.
139
    public var governmentIdType: String? {
1✔
140
        getField(TransferMethodField.governmentIdType.rawValue)
1✔
141
    }
1✔
142

143
    /// The bank account holder's phone number.
144
    public var phoneNumber: String? {
2✔
145
        getField(TransferMethodField.phoneNumber.rawValue)
2✔
146
    }
2✔
147

148
    /// The bank account holder's cell phone number.
149
    public var mobileNumber: String? {
2✔
150
        getField(TransferMethodField.mobileNumber.rawValue)
2✔
151
    }
2✔
152

153
    /// The bank account holder's last name.
154
    public var lastName: String? {
1✔
155
        getField(TransferMethodField.lastName.rawValue)
1✔
156
    }
1✔
157

158
    /// The bank account holder's middle name.
159
    public var middleName: String? {
1✔
160
        getField(TransferMethodField.middleName.rawValue)
1✔
161
    }
1✔
162

163
    /// The bank account holder's passport number.
164
    public var passportId: String? {
1✔
165
        getField(TransferMethodField.passportId.rawValue)
1✔
166
    }
1✔
167

168
    /// A helper class to build the `HyperwalletPaperCheck` instance.
169
    public final class Builder {
170
        private var storage = [String: AnyCodable]()
5✔
171

172
        /// Creates a new instance of the `HyperwalletPaperCheck.Builder`
173
        /// based on the required parameter to updaate Bank card.
174
        ///
175
        /// - Parameter token: The bank card token.
176
        public init(token: String) {
2✔
177
            storage[TransferMethodField.token.rawValue] = AnyCodable(value: token)
2✔
178
        }
2✔
179

180
        /// Creates a new instance of the `HyperwalletPaperCheck.Builder`
181
        /// based on the required parameters to create paper check.
182
        ///
183
        /// - Parameters:
184
        ///   - transferMethodCountry: The bank account country.
185
        ///   - transferMethodCurrency: The bank account currency.
186
        ///   - transferMethodProfileType: The bank account holder's profile type, e.g. INDIVIDUAL or BUSINESS
187
        ///   - transferMethodType: The bank account type, i.e, PAPER_CHECK
188
        public init(transferMethodCountry: String,
189
                    transferMethodCurrency: String,
190
                    transferMethodProfileType: String,
191
                    transferMethodType: String) {
3✔
192
            storage[TransferMethodField.type.rawValue] = AnyCodable(value: transferMethodType)
3✔
193
            storage[TransferMethodField.transferMethodCountry.rawValue] = AnyCodable(value: transferMethodCountry)
3✔
194
            storage[TransferMethodField.transferMethodCurrency.rawValue] = AnyCodable(value: transferMethodCurrency)
3✔
195
            storage[TransferMethodField.profileType.rawValue] = AnyCodable(value: transferMethodProfileType)
3✔
196
        }
3✔
197

198
        /// Sets the bank account holder's street address.
199
        ///
200
        /// - Parameter addressLine1: The bank account holder's street address.
201
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
202
        public func addressLine1(_ addressLine1: String) -> Builder {
2✔
203
           storage[TransferMethodField.addressLine1.rawValue] = AnyCodable(value: addressLine1)
2✔
204
           return self
2✔
205
        }
2✔
206

207
        /// Sets the bank account holder's address, second line.
208
        ///
209
        /// - Parameter addressLine2: The bank account holder's address, second line.
210
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
211
        public func addressLine2(_ addressLine2: String) -> Builder {
2✔
212
            storage[TransferMethodField.addressLine2.rawValue] = AnyCodable(value: addressLine2)
2✔
213
            return self
2✔
214
        }
2✔
215

216
        /// Sets the user's relationship with the bank account holder.
217
        ///
218
        /// - Parameter relationship: The `RelationshipType`
219
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
220
        public func bankAccountRelationship(_ relationship: String) -> Builder {
2✔
221
            storage[TransferMethodField.bankAccountRelationship.rawValue] = AnyCodable(value: relationship)
2✔
222
            return self
2✔
223
        }
2✔
224

225
        /// Sets the bank account holder's city.
226
        ///
227
        /// - Parameter city: The bank account holder's city.
228
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
229
        public func city(_ city: String) -> Builder {
2✔
230
            storage[TransferMethodField.city.rawValue] = AnyCodable(value: city)
2✔
231
            return self
2✔
232
        }
2✔
233

234
        /// Sets the bank account holder's country.
235
        ///
236
        /// - Parameter country: The bank account holder's country.
237
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
238
        public func country(_ country: String) -> Builder {
2✔
239
            storage[TransferMethodField.country.rawValue] = AnyCodable(value: country)
2✔
240
            return self
2✔
241
        }
2✔
242

243
        /// Sets the bank account holder's postal code.
244
        ///
245
        /// - Parameter postalCode: The bank account holder's postal code.
246
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
247
        public func postalCode(_ postalCode: String) -> Builder {
2✔
248
            storage[TransferMethodField.postalCode.rawValue] = AnyCodable(value: postalCode)
2✔
249
            return self
2✔
250
        }
2✔
251

252
        /// Sets the shipping method for paper check.
253
        ///
254
        /// - Parameter shippingMethod: The bank account holder's postal code.
255
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
256
        public func shippingMethod(_ shippingMethod: String) -> Builder {
4✔
257
            storage[TransferMethodField.shippingMethod.rawValue] = AnyCodable(value: shippingMethod)
4✔
258
            return self
4✔
259
        }
4✔
260

261
        /// Sets the bank account holder's state, province or region.
262
        ///
263
        /// - Parameter stateProvince: The bank account holder's state, province or region.
264
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
265
        public func stateProvince(_ stateProvince: String) -> Builder {
2✔
266
            storage[TransferMethodField.stateProvince.rawValue] = AnyCodable(value: stateProvince)
2✔
267
            return self
2✔
268
        }
2✔
269

270
        // Sets the bank account holder's profile type.
271
        ///
272
        /// - Parameter profileType: The bank account holder's profile type, e.g. INDIVIDUAL or BUSINESS
273
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
274
        public func profileType(_ profileType: String) -> Builder {
×
275
            storage[TransferMethodField.profileType.rawValue] = AnyCodable(value: profileType)
×
276
            return self
×
277
        }
×
278

279
        /// Sets the bank account holder's last name.
280
        ///
281
        /// - Parameter lastName: The bank account holder's last name.
282
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
283
        public func lastName(_ lastName: String) -> Builder {
1✔
284
            storage[TransferMethodField.lastName.rawValue] = AnyCodable(value: lastName)
1✔
285
            return self
1✔
286
        }
1✔
287

288
        /// Sets the bank account holder's middle name.
289
        ///
290
        /// - Parameter middleName: The bank account holder's middle name.
291
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
292
        public func middleName(_ middleName: String) -> Builder {
1✔
293
            storage[TransferMethodField.middleName.rawValue] = AnyCodable(value: middleName)
1✔
294
            return self
1✔
295
        }
1✔
296

297
        /// Sets the bank account holder's cell phone number.
298
        ///
299
        /// - Parameter mobileNumber: The bank account holder's cell phone number.
300
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
301
        public func mobileNumber(_ mobileNumber: String) -> Builder {
2✔
302
            storage[TransferMethodField.mobileNumber.rawValue] = AnyCodable(value: mobileNumber)
2✔
303
            return self
2✔
304
        }
2✔
305

306
        /// Sets the bank account holder's passport number.
307
        ///
308
        /// - Parameter passportId: The bank account holder's passport number.
309
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
310
        public func passportId(_ passportId: String) -> Builder {
1✔
311
            storage[TransferMethodField.passportId.rawValue] = AnyCodable(value: passportId)
1✔
312
            return self
1✔
313
        }
1✔
314

315
        /// Sets the bank account holder's phone number.
316
        ///
317
        /// - Parameter phoneNumber: The bank account holder's phone number.
318
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
319
        public func phoneNumber(_ phoneNumber: String) -> Builder {
2✔
320
            storage[TransferMethodField.phoneNumber.rawValue] = AnyCodable(value: phoneNumber)
2✔
321
            return self
2✔
322
        }
2✔
323

324
        /// Sets the bank account holder's birth country.
325
        ///
326
        /// - Parameter countryOfBirth: The bank account holder's birth country.
327
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
328
        public func countryOfBirth(_ countryOfBirth: String) -> Builder {
1✔
329
            storage[TransferMethodField.countryOfBirth.rawValue] = AnyCodable(value: countryOfBirth)
1✔
330
            return self
1✔
331
        }
1✔
332

333
        // Sets the bank account holder's nationality country.
334
        ///
335
        /// - Parameter countryOfNationality: The bank account holder's birth country.
336
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
337
        public func countryOfNationality(_ countryOfNationality: String) -> Builder {
×
338
            storage[TransferMethodField.countryOfNationality.rawValue] = AnyCodable(value: countryOfNationality)
×
339
            return self
×
340
        }
×
341

342
        /// Sets the bank account holder's date of birth (All users must be at least 13 years old).
343
        ///
344
        /// - Parameter dateOfBirth: The bank account holder's date of birth
345
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
346
        public func dateOfBirth(_ dateOfBirth: String) -> Builder {
1✔
347
            storage[TransferMethodField.dateOfBirth.rawValue] = AnyCodable(value: dateOfBirth)
1✔
348
            return self
1✔
349
        }
1✔
350

351
        /// Sets the bank account holder's driver's license number.
352
        ///
353
        /// - Parameter driversLicenseId: The bank account holder's driver's license number.
354
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
355
        public func driversLicenseId(_ driversLicenseId: String) -> Builder {
1✔
356
            storage[TransferMethodField.driversLicenseId.rawValue] = AnyCodable(value: driversLicenseId)
1✔
357
            return self
1✔
358
        }
1✔
359

360
        /// Sets the bank account holder's employer identifier, generally used for tax purposes.
361
        ///
362
        /// - Parameter employerId: The bank account holder's employer identifier, generally used for tax purposes.
363
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
364
        public func employerId(_ employerId: String) -> Builder {
1✔
365
            storage[TransferMethodField.employerId.rawValue] = AnyCodable(value: employerId)
1✔
366
            return self
1✔
367
        }
1✔
368

369
        /// Sets the bank account holder's first name.
370
        ///
371
        /// - Parameter firstName: The bank account holder's first name.
372
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
373
        public func firstName(_ firstName: String) -> Builder {
1✔
374
            storage[TransferMethodField.firstName.rawValue] = AnyCodable(value: firstName)
1✔
375
            return self
1✔
376
        }
1✔
377

378
        /// Sets the bank account holder's gender.
379
        ///
380
        /// - Parameter gender: The bank account holder's gender.
381
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
382
        public func gender(_ gender: String) -> Builder {
1✔
383
            storage[TransferMethodField.gender.rawValue] = AnyCodable(value: gender)
1✔
384
            return self
1✔
385
        }
1✔
386

387
        /// Sets the bank account holder's government ID number, such as a Social Security Number.
388
        ///
389
        /// - Parameter governmentId: The bank account holder's government ID number, such as a Social Security Number.
390
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
391
        public func governmentId(_ governmentId: String) -> Builder {
1✔
392
            storage[TransferMethodField.governmentId.rawValue] = AnyCodable(value: governmentId)
1✔
393
            return self
1✔
394
        }
1✔
395

396
        /// Sets the bank account holder's government ID type.
397
        ///
398
        /// - Parameter governmentIdType: The bank account holder's government ID type.
399
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
400
        public func governmentIdType(_ governmentIdType: String) -> Builder {
1✔
401
            storage[TransferMethodField.governmentIdType.rawValue] = AnyCodable(value: governmentIdType)
1✔
402
            return self
1✔
403
        }
1✔
404

405
        /// Sets the bank account holder's role in the organization.
406
        ///
407
        /// - Parameter businessContactRole: The bank account holder's role in the organization.
408
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
409
        public func businessContactRole(_ businessContactRole: String) -> Builder {
1✔
410
            storage[TransferMethodField.businessContactRole.rawValue] = AnyCodable(value: businessContactRole)
1✔
411
            return self
1✔
412
        }
1✔
413

414
        /// Sets the name of the bank account holder's business.
415
        ///
416
        /// - Parameter businessName: The name of the bank account holder's business.
417
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
418
        public func businessName(_ businessName: String) -> Builder {
1✔
419
            storage[TransferMethodField.businessName.rawValue] = AnyCodable(value: businessName)
1✔
420
            return self
1✔
421
        }
1✔
422

423
        /// Sets the country where the bank account holder's business is registered.
424
        ///
425
        /// - Parameter businessRegistrationCountry: The country where the bank account holder's business is registered.
426
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
427
        public func businessRegistrationCountry(_ country: String) -> Builder {
1✔
428
            storage[TransferMethodField.businessRegistrationCountry.rawValue] = AnyCodable(value: country)
1✔
429
            return self
1✔
430
        }
1✔
431

432
        /// Sets the bank account holder's business registration number or identifier,
433
        /// as assigned by the relevant government body.
434
        ///
435
        /// - Parameter businessRegistrationId: The bank account holder's business
436
        ///   registration number or identifier, as assigned by the relevant government body.
437
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
438
        public func businessRegistrationId(_ businessRegistrationId: String) -> Builder {
1✔
439
            storage[TransferMethodField.businessRegistrationId.rawValue] = AnyCodable(value: businessRegistrationId)
1✔
440
            return self
1✔
441
        }
1✔
442

443
        /// Sets the state, province or region where the bank account holder's business is registered.
444
        ///
445
        /// - Parameter businessRegistrationStateProvince: The state, province or region
446
        ///   where the bank account holder's business is registered.
447
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
448
        public func businessRegistrationStateProvince(_ stateProvince: String) -> Builder {
1✔
449
            storage[TransferMethodField.businessRegistrationStateProvince.rawValue] = AnyCodable(value: stateProvince)
1✔
450
            return self
1✔
451
        }
1✔
452

453
        /// Sets the bank account holder's business type.
454
        ///
455
        /// - Parameter businessType: The bank account holder's business type.
456
        /// - Returns: a self `HyperwalletPaperCheck.Builder` instance.
457
        public func businessType(_ businessType: String) -> Builder {
1✔
458
            storage[TransferMethodField.businessType.rawValue] = AnyCodable(value: businessType)
1✔
459
            return self
1✔
460
        }
1✔
461

462
        /// Builds a new instance of the `HyperwalletPaperCheck`.
463
        ///
464
        /// - Returns: a new instance of the `HyperwalletPaperCheck`.
465
        public func build() -> HyperwalletPaperCheck {
5✔
466
            HyperwalletPaperCheck(data: self.storage)
5✔
467
        }
5✔
468
    }
469
}
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