@@ -12,8 +12,8 @@ enum Endpoint {
12
12
static let links = linksHostName + " / "
13
13
}
14
14
15
- public enum Const {
16
- public static let apiPath = " /api/ "
15
+ enum Const {
16
+ static let apiPath = " /api/ "
17
17
18
18
static let deepLinkRegex = " /a/[a-zA-Z0-9]+ "
19
19
static let href = " href "
@@ -43,10 +43,10 @@ public enum Const {
43
43
static let getRemoteConfiguration = " mobile/getRemoteConfiguration "
44
44
}
45
45
46
- public enum UserDefaults {
46
+ public enum UserDefault {
47
47
static let payloadKey = " itbl_payload_key "
48
48
static let attributionInfoKey = " itbl_attribution_info_key "
49
- public static let emailKey = " itbl_email "
49
+ static let emailKey = " itbl_email "
50
50
static let userIdKey = " itbl_userid "
51
51
static let authTokenKey = " itbl_auth_token "
52
52
static let ddlChecked = " itbl_ddl_checked "
@@ -74,109 +74,95 @@ public enum Const {
74
74
}
75
75
}
76
76
77
- public protocol JsonKeyValueRepresentable {
78
- var key : JsonKeyRepresentable { get }
79
- var value : JsonValueRepresentable { get }
80
- }
81
-
82
- public struct JsonKeyValue : JsonKeyValueRepresentable {
83
- public let key : JsonKeyRepresentable
84
- public let value : JsonValueRepresentable
85
- }
86
-
87
- public protocol JsonKeyRepresentable {
88
- var jsonKey : String { get }
89
- }
90
-
91
- public enum JsonKey : String , JsonKeyRepresentable {
92
- case email
93
- case userId
94
- case currentEmail
95
- case currentUserId
96
- case newEmail
97
- case emailListIds
98
- case unsubscribedChannelIds
99
- case unsubscribedMessageTypeIds
100
- case subscribedMessageTypeIds
101
- case preferUserId
102
-
103
- case mergeNestedObjects
104
-
105
- case inboxMetadata
106
- case inboxTitle = " title "
107
- case inboxSubtitle = " subtitle "
108
- case inboxIcon = " icon "
109
-
110
- case inboxExpiresAt = " expiresAt "
111
- case inboxCreatedAt = " createdAt "
112
-
113
- case inAppMessageContext = " messageContext "
114
-
115
- case campaignId
116
- case templateId
117
- case messageId
118
- case inboxSessionId
119
-
120
- case saveToInbox
121
- case silentInbox
122
- case inAppLocation = " location "
123
- case clickedUrl
124
- case read
125
- case priorityLevel
126
-
127
- case inboxSessionStart
128
- case inboxSessionEnd
129
- case startTotalMessageCount
130
- case startUnreadMessageCount
131
- case endTotalMessageCount
132
- case endUnreadMessageCount
133
- case impressions
134
- case closeAction
135
- case deleteAction
136
-
137
- case url
138
-
139
- case device
140
- case token
141
- case dataFields
142
- case deviceInfo
143
- case identifierForVendor
144
- case deviceId
145
- case localizedModel
146
- case model
147
- case userInterfaceIdiom
148
- case systemName
149
- case systemVersion
150
- case platform
151
- case appPackageName
152
- case appVersion
153
- case appBuild
154
- case applicationName
155
- case eventName
156
- case actionIdentifier
157
- case userText
158
- case appAlreadyRunning
159
-
160
- case html
161
-
162
- case iterableSdkVersion
163
-
164
- case notificationsEnabled
165
-
166
- case contentType = " Content-Type "
167
-
168
- public enum ActionButton {
77
+ enum JsonKey {
78
+ static let email = " email "
79
+ static let userId = " userId "
80
+ static let currentEmail = " currentEmail "
81
+ static let currentUserId = " currentUserId "
82
+ static let newEmail = " newEmail "
83
+ static let emailListIds = " emailListIds "
84
+ static let unsubscribedChannelIds = " unsubscribedChannelIds "
85
+ static let unsubscribedMessageTypeIds = " unsubscribedMessageTypeIds "
86
+ static let subscribedMessageTypeIds = " subscribedMessageTypeIds "
87
+ static let preferUserId = " preferUserId "
88
+
89
+ static let mergeNestedObjects = " mergeNestedObjects "
90
+
91
+ static let inboxMetadata = " inboxMetadata "
92
+ static let inboxTitle = " title "
93
+ static let inboxSubtitle = " subtitle "
94
+ static let inboxIcon = " icon "
95
+
96
+ static let inboxExpiresAt = " expiresAt "
97
+ static let inboxCreatedAt = " createdAt "
98
+
99
+ static let inAppMessageContext = " messageContext "
100
+
101
+ static let campaignId = " campaignId "
102
+ static let templateId = " templateId "
103
+ static let messageId = " messageId "
104
+ static let inboxSessionId = " inboxSessionId "
105
+
106
+ static let saveToInbox = " saveToInbox "
107
+ static let silentInbox = " silentInbox "
108
+ static let inAppLocation = " location "
109
+ static let clickedUrl = " clickedUrl "
110
+ static let read = " read "
111
+ static let priorityLevel = " priorityLevel "
112
+
113
+ static let inboxSessionStart = " inboxSessionStart "
114
+ static let inboxSessionEnd = " inboxSessionEnd "
115
+ static let startTotalMessageCount = " startTotalMessageCount "
116
+ static let startUnreadMessageCount = " startUnreadMessageCount "
117
+ static let endTotalMessageCount = " endTotalMessageCount "
118
+ static let endUnreadMessageCount = " endUnreadMessageCount "
119
+ static let impressions = " impressions "
120
+ static let closeAction = " closeAction "
121
+ static let deleteAction = " deleteAction "
122
+
123
+ static let url = " url "
124
+
125
+ static let device = " device "
126
+ static let token = " token "
127
+ static let dataFields = " dataFields "
128
+ static let deviceInfo = " deviceInfo "
129
+ static let identifierForVendor = " identifierForVendor "
130
+ static let deviceId = " deviceId "
131
+ static let localizedModel = " localizedModel "
132
+ static let model = " model "
133
+ static let userInterfaceIdiom = " userInterfaceIdiom "
134
+ static let systemName = " systemName "
135
+ static let systemVersion = " systemVersion "
136
+ static let platform = " platform "
137
+ static let appPackageName = " appPackageName "
138
+ static let appVersion = " appVersion "
139
+ static let appBuild = " appBuild "
140
+ static let applicationName = " applicationName "
141
+ static let eventName = " eventName "
142
+ static let actionIdentifier = " actionIdentifier "
143
+ static let userText = " userText "
144
+ static let appAlreadyRunning = " appAlreadyRunning "
145
+
146
+ static let html = " html "
147
+
148
+ static let iterableSdkVersion = " iterableSdkVersion "
149
+
150
+ static let notificationsEnabled = " notificationsEnabled "
151
+
152
+ static let contentType = " Content-Type "
153
+
154
+ enum ActionButton {
169
155
static let identifier = " identifier "
170
156
static let action = " action "
171
157
}
172
158
173
- public enum Commerce {
159
+ enum Commerce {
174
160
static let items = " items "
175
161
static let total = " total "
176
162
static let user = " user "
177
163
}
178
164
179
- public enum Device {
165
+ enum Device {
180
166
static let localizedModel = " localizedModel "
181
167
static let vendorId = " identifierForVendor "
182
168
static let model = " model "
@@ -185,7 +171,7 @@ public enum JsonKey: String, JsonKeyRepresentable {
185
171
static let userInterfaceIdiom = " userInterfaceIdiom "
186
172
}
187
173
188
- public enum Header {
174
+ enum Header {
189
175
static let apiKey = " Api-Key "
190
176
static let sdkVersion = " SDK-Version "
191
177
static let sdkPlatform = " SDK-Platform "
@@ -194,11 +180,11 @@ public enum JsonKey: String, JsonKeyRepresentable {
194
180
static let requestProcessor = " SDK-Request-Processor "
195
181
}
196
182
197
- public enum Body {
183
+ enum Body {
198
184
static let createdAt = " createdAt "
199
185
}
200
186
201
- public enum InApp {
187
+ enum InApp {
202
188
static let trigger = " trigger "
203
189
static let type = " type "
204
190
static let contentType = " contentType "
@@ -212,60 +198,48 @@ public enum JsonKey: String, JsonKeyRepresentable {
212
198
static let content = " content "
213
199
}
214
200
215
- public enum Payload {
201
+ enum Payload {
216
202
static let metadata = " itbl "
217
203
static let actionButtons = " actionButtons "
218
204
static let defaultAction = " defaultAction "
219
205
}
220
206
221
- public enum Response {
207
+ enum Response {
222
208
static let iterableCode = " code "
223
209
}
224
210
225
- public enum JWT {
211
+ enum JWT {
226
212
static let exp = " exp "
227
213
}
228
-
229
- public var jsonKey : String {
230
- rawValue
231
- }
232
214
}
233
215
234
- public protocol JsonValueRepresentable {
235
- var jsonValue : Any { get }
236
- }
216
+ enum JsonValue {
217
+ static let applicationJson = " application/json "
218
+ static let apnsSandbox = " APNS_SANDBOX "
219
+ static let apnsProduction = " APNS "
220
+ static let iOS = " iOS "
221
+ static let bearer = " Bearer "
237
222
238
- public enum JsonValue : String , JsonValueRepresentable {
239
- case applicationJson = " application/json "
240
- case apnsSandbox = " APNS_SANDBOX "
241
- case apnsProduction = " APNS "
242
- case iOS
243
- case bearer = " Bearer "
244
-
245
- public enum ActionIdentifier {
223
+ enum ActionIdentifier {
246
224
static let pushOpenDefault = " default "
247
225
}
248
226
249
- public enum DeviceIdiom {
227
+ enum DeviceIdiom {
250
228
static let pad = " Pad "
251
229
static let phone = " Phone "
252
230
static let carPlay = " CarPlay "
253
231
static let tv = " TV "
254
232
static let unspecified = " Unspecified "
255
233
}
256
234
257
- public enum Code {
235
+ enum Code {
258
236
static let badApiKey = " BadApiKey "
259
237
static let invalidJwtPayload = " InvalidJwtPayload "
260
238
}
261
-
262
- public var jsonStringValue : String {
263
- rawValue
264
- }
265
-
266
- public var jsonValue : Any {
267
- rawValue
268
- }
239
+ }
240
+
241
+ public protocol JsonValueRepresentable {
242
+ var jsonValue : Any { get }
269
243
}
270
244
271
245
@objc public enum InAppLocation : Int , JsonValueRepresentable {
0 commit comments