Skip to content

Commit a70a2d1

Browse files
committed
Merge branch '322-remove-user-api' into 'master'
Resolve "Remove User API" Closes #322 See merge request pace/mobile/ios/pace-cloud-sdk!367
2 parents 43d9904 + 64b0a23 commit a70a2d1

File tree

12 files changed

+124
-270
lines changed

12 files changed

+124
-270
lines changed

PACECloudSDK/API/Generated/Models/PCUserUser.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ public class PCUserUser: APIModel {
2929
*/
3030
public var birthDate: DateDay?
3131

32-
/** time of the user creation */
33-
public var createdAt: DateTime?
34-
3532
public var email: String?
3633

3734
public var firstName: String?
@@ -122,12 +119,11 @@ public class PCUserUser: APIModel {
122119
}
123120
}
124121

125-
public init(id: ID? = nil, type: PCUserType? = nil, address: Address? = nil, birthDate: DateDay? = nil, createdAt: DateTime? = nil, email: String? = nil, firstName: String? = nil, gender: PCUserGender? = nil, lastName: String? = nil, locale: String? = nil, phoneNumber: String? = nil, pictureUrl: String? = nil, zoneInfo: String? = nil) {
122+
public init(id: ID? = nil, type: PCUserType? = nil, address: Address? = nil, birthDate: DateDay? = nil, email: String? = nil, firstName: String? = nil, gender: PCUserGender? = nil, lastName: String? = nil, locale: String? = nil, phoneNumber: String? = nil, pictureUrl: String? = nil, zoneInfo: String? = nil) {
126123
self.id = id
127124
self.type = type
128125
self.address = address
129126
self.birthDate = birthDate
130-
self.createdAt = createdAt
131127
self.email = email
132128
self.firstName = firstName
133129
self.gender = gender
@@ -145,7 +141,6 @@ public class PCUserUser: APIModel {
145141
type = try container.decodeIfPresent("type")
146142
address = try container.decodeIfPresent("address")
147143
birthDate = try container.decodeIfPresent("birthDate")
148-
createdAt = try container.decodeIfPresent("createdAt")
149144
email = try container.decodeIfPresent("email")
150145
firstName = try container.decodeIfPresent("firstName")
151146
gender = try container.decodeIfPresent("gender")
@@ -163,7 +158,6 @@ public class PCUserUser: APIModel {
163158
try container.encodeIfPresent(type, forKey: "type")
164159
try container.encodeIfPresent(address, forKey: "address")
165160
try container.encodeIfPresent(birthDate, forKey: "birthDate")
166-
try container.encodeIfPresent(createdAt, forKey: "createdAt")
167161
try container.encodeIfPresent(email, forKey: "email")
168162
try container.encodeIfPresent(firstName, forKey: "firstName")
169163
try container.encodeIfPresent(gender, forKey: "gender")
@@ -180,7 +174,6 @@ public class PCUserUser: APIModel {
180174
guard self.type == object.type else { return false }
181175
guard self.address == object.address else { return false }
182176
guard self.birthDate == object.birthDate else { return false }
183-
guard self.createdAt == object.createdAt else { return false }
184177
guard self.email == object.email else { return false }
185178
guard self.firstName == object.firstName else { return false }
186179
guard self.gender == object.gender else { return false }

PACECloudSDK/API/Generated/Models/PCUserUserPINRequest.swift

Lines changed: 60 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,82 @@ import Foundation
77

88
public class PCUserUserPINRequest: APIModel {
99

10-
/** 4-digit code */
11-
public var pin: String?
10+
public enum PCUserType: String, Codable, Equatable, CaseIterable {
11+
case pin = "pin"
12+
}
13+
14+
public var attributes: Attributes?
15+
16+
public var id: String?
17+
18+
public var type: PCUserType?
19+
20+
public class Attributes: APIModel {
21+
22+
/** 4-digit code */
23+
public var pin: String
24+
25+
/** user otp */
26+
public var otp: String
1227

13-
/** allows skipping credential verification */
14-
public var skip: Bool?
28+
public init(pin: String, otp: String) {
29+
self.pin = pin
30+
self.otp = otp
31+
}
32+
33+
public required init(from decoder: Decoder) throws {
34+
let container = try decoder.container(keyedBy: StringCodingKey.self)
35+
36+
pin = try container.decode("pin")
37+
otp = try container.decode("otp")
38+
}
39+
40+
public func encode(to encoder: Encoder) throws {
41+
var container = encoder.container(keyedBy: StringCodingKey.self)
42+
43+
try container.encode(pin, forKey: "pin")
44+
try container.encode(otp, forKey: "otp")
45+
}
46+
47+
public func isEqual(to object: Any?) -> Bool {
48+
guard let object = object as? Attributes else { return false }
49+
guard self.pin == object.pin else { return false }
50+
guard self.otp == object.otp else { return false }
51+
return true
52+
}
53+
54+
public static func == (lhs: Attributes, rhs: Attributes) -> Bool {
55+
return lhs.isEqual(to: rhs)
56+
}
57+
}
1558

16-
public init(pin: String? = nil, skip: Bool? = nil) {
17-
self.pin = pin
18-
self.skip = skip
59+
public init(attributes: Attributes? = nil, id: String? = nil, type: PCUserType? = nil) {
60+
self.attributes = attributes
61+
self.id = id
62+
self.type = type
1963
}
2064

2165
public required init(from decoder: Decoder) throws {
2266
let container = try decoder.container(keyedBy: StringCodingKey.self)
2367

24-
pin = try container.decodeIfPresent("pin")
25-
skip = try container.decodeIfPresent("skip")
68+
attributes = try container.decodeIfPresent("attributes")
69+
id = try container.decodeIfPresent("id")
70+
type = try container.decodeIfPresent("type")
2671
}
2772

2873
public func encode(to encoder: Encoder) throws {
2974
var container = encoder.container(keyedBy: StringCodingKey.self)
3075

31-
try container.encodeIfPresent(pin, forKey: "pin")
32-
try container.encodeIfPresent(skip, forKey: "skip")
76+
try container.encodeIfPresent(attributes, forKey: "attributes")
77+
try container.encodeIfPresent(id, forKey: "id")
78+
try container.encodeIfPresent(type, forKey: "type")
3379
}
3480

3581
public func isEqual(to object: Any?) -> Bool {
3682
guard let object = object as? PCUserUserPINRequest else { return false }
37-
guard self.pin == object.pin else { return false }
38-
guard self.skip == object.skip else { return false }
83+
guard self.attributes == object.attributes else { return false }
84+
guard self.id == object.id else { return false }
85+
guard self.type == object.type else { return false }
3986
return true
4087
}
4188

PACECloudSDK/API/User/Generated/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ To add support for a specific asynchronous library, just add an extension on `Us
165165
- **PCUserUpdateUserPhoneRequest**
166166
- **PCUserUser**
167167
- **PCUserUserPINRequest**
168-
- **PCUserUserPINAndOTPRequest**
169168
- **PCUserVerifyUserPhoneRequest**
170169

171170
## Requests
@@ -182,7 +181,6 @@ To add support for a specific asynchronous library, just add an extension on `Us
182181
- **ResetPassword**: PUT `/user/password/reset`
183182
- **UpdateUserPIN**: PUT `/user/pin`
184183
- **UserAPI.FederatedIdentity**
185-
- **DeleteFederatedIdentity**: DELETE `/federated-identities/{identityprovider}`
186184
- **GrantFederatedToken**: POST `/federated-identities/{identityprovider}/token`
187185
- **SetFederatedIdentity**: PUT `/federated-identities/{identityprovider}`
188186
- **UserAPI.OAuth2**
@@ -213,4 +211,4 @@ To add support for a specific asynchronous library, just add an extension on `Us
213211
- **GetUser**: GET `/users/{userid}`
214212
- **SetUser**: PUT `/users/{userid}`
215213
- **UpdateUser**: PATCH `/users/{userid}`
216-
- **VerifyEmail**: POST `/user/email/verify`
214+
- **VerifyEmail**: GET `/user/email/verify`

0 commit comments

Comments
 (0)