Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_sdk_framework
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
Manos Chorianopoulos
2022-07-13 12:54:11 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
adaa7d7a124ee245bdc385019e9f7f3a43fa41bf
adaa7d7a
1 parent
410ae7eb
update CampaignItemModel
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
0 deletions
.DS_Store
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
.DS_Store
View file @
adaa7d7
No preview for this file type
SwiftWarplyFramework/SwiftWarplyFramework/swiftApi.swift
View file @
adaa7d7
...
...
@@ -481,6 +481,9 @@ public class swiftApi {
public
let
ccms_offer
:
String
?
public
var
loyaltyPackageId
:
String
?
public
var
badge
:
String
?
public
var
campaign_type
:
String
?
// public var campaign_type_settings: [String: Any]?
public
var
couponset
:
String
?
public
init
()
{
self
.
index_url
=
""
...
...
@@ -497,6 +500,9 @@ public class swiftApi {
self
.
ccms_offer
=
"false"
self
.
loyaltyPackageId
=
""
self
.
badge
=
""
self
.
campaign_type
=
""
// self.campaign_type_settings = [String: Any]()
self
.
couponset
=
""
}
public
init
(
dictionary
:
[
String
:
Any
])
{
...
...
@@ -509,6 +515,7 @@ public class swiftApi {
self
.
is_new
=
dictionary
[
"is_new"
]
as?
Bool
?
??
false
self
.
message
=
dictionary
[
"message"
]
as?
String
?
??
""
self
.
loyaltyPackageId
=
""
self
.
campaign_type
=
dictionary
[
"campaign_type"
]
as?
String
?
??
""
// let extra_fields = dictionary["extra_fields"] as? [String: Any]? ?? ["":""]
let
extra_fields
=
dictionary
[
"extra_fields"
]
as
AnyObject
...
...
@@ -540,6 +547,38 @@ public class swiftApi {
self
.
badge
=
""
print
(
error
)
}
// campaign_type_settings
if
let
campaign_type_settings_obj
=
dictionary
[
"campaign_type_settings"
]
as?
AnyObject
{
if
((
!
(
campaign_type_settings_obj
is
NSNull
))
&&
(
campaign_type_settings_obj
!=
nil
))
{
var
campaign_type_settings_parsed
:[
String
:
Any
]
let
campaign_type_settings_json
=
campaign_type_settings_obj
.
data
(
using
:
String
.
Encoding
.
utf8
.
rawValue
)
do
{
if
let
jsonArray
=
try
JSONSerialization
.
jsonObject
(
with
:
campaign_type_settings_json
!
,
options
:
.
allowFragments
)
as?
[
String
:
AnyObject
]
{
campaign_type_settings_parsed
=
jsonArray
;
// self.campaign_type_settings = campaign_type_settings_parsed as? [String: Any]? ?? [String: Any]()
self
.
couponset
=
campaign_type_settings_parsed
[
"couponset"
]
as?
String
?
??
""
}
else
{
// self.campaign_type_settings = [String: Any]()
self
.
couponset
=
""
print
(
"bad json"
)
}
}
catch
let
error
as
NSError
{
// self.campaign_type_settings = [String: Any]()
self
.
couponset
=
""
print
(
error
)
}
}
else
{
self
.
couponset
=
""
}
}
else
{
self
.
couponset
=
""
}
}
public
var
_logo_url
:
String
?
{
...
...
@@ -577,6 +616,33 @@ public class swiftApi {
self
.
badge
=
newValue
}
}
public
var
_campaign_type
:
String
?
{
get
{
// getter
return
self
.
campaign_type
}
set
(
newValue
)
{
//setter
self
.
campaign_type
=
newValue
}
}
// public var _campaign_type_settings: [String: Any]? {
// get { // getter
// return self.campaign_type_settings
// }
// set(newValue) { //setter
// self.campaign_type_settings = newValue
// }
// }
public
var
_couponset
:
String
?
{
get
{
// getter
return
self
.
couponset
}
set
(
newValue
)
{
//setter
self
.
couponset
=
newValue
}
}
}
public
class
CampaignDataModel
{
...
...
Please
register
or
login
to post a comment