Showing
1 changed file
with
14 additions
and
0 deletions
... | @@ -498,6 +498,7 @@ public class swiftApi { | ... | @@ -498,6 +498,7 @@ public class swiftApi { |
498 | public var campaign_type: String? | 498 | public var campaign_type: String? |
499 | // public var campaign_type_settings: [String: Any]? | 499 | // public var campaign_type_settings: [String: Any]? |
500 | public var couponset: String? | 500 | public var couponset: String? |
501 | + public var type: String? | ||
501 | 502 | ||
502 | public init() { | 503 | public init() { |
503 | self.index_url = "" | 504 | self.index_url = "" |
... | @@ -517,6 +518,7 @@ public class swiftApi { | ... | @@ -517,6 +518,7 @@ public class swiftApi { |
517 | self.campaign_type = "" | 518 | self.campaign_type = "" |
518 | // self.campaign_type_settings = [String: Any]() | 519 | // self.campaign_type_settings = [String: Any]() |
519 | self.couponset = "" | 520 | self.couponset = "" |
521 | + self.type = "" | ||
520 | } | 522 | } |
521 | 523 | ||
522 | public init(dictionary: [String: Any]) { | 524 | public init(dictionary: [String: Any]) { |
... | @@ -545,12 +547,14 @@ public class swiftApi { | ... | @@ -545,12 +547,14 @@ public class swiftApi { |
545 | self.hasExtraFields = true | 547 | self.hasExtraFields = true |
546 | self.ccms_offer = extra_fields_parsed["ccms_offer"] as? String? ?? "false" | 548 | self.ccms_offer = extra_fields_parsed["ccms_offer"] as? String? ?? "false" |
547 | self.badge = extra_fields_parsed["badge"] as? String? ?? "" | 549 | self.badge = extra_fields_parsed["badge"] as? String? ?? "" |
550 | + self.type = extra_fields_parsed["type"] as? String? ?? "" | ||
548 | } else { | 551 | } else { |
549 | self.subcategory = "" | 552 | self.subcategory = "" |
550 | self.loyaltyCampaignId = "" | 553 | self.loyaltyCampaignId = "" |
551 | self.hasExtraFields = false | 554 | self.hasExtraFields = false |
552 | self.ccms_offer = "false" | 555 | self.ccms_offer = "false" |
553 | self.badge = "" | 556 | self.badge = "" |
557 | + self.type = "" | ||
554 | print("bad json") | 558 | print("bad json") |
555 | } | 559 | } |
556 | } catch let error as NSError { | 560 | } catch let error as NSError { |
... | @@ -559,6 +563,7 @@ public class swiftApi { | ... | @@ -559,6 +563,7 @@ public class swiftApi { |
559 | self.hasExtraFields = false | 563 | self.hasExtraFields = false |
560 | self.ccms_offer = "false" | 564 | self.ccms_offer = "false" |
561 | self.badge = "" | 565 | self.badge = "" |
566 | + self.type = "" | ||
562 | print(error) | 567 | print(error) |
563 | } | 568 | } |
564 | 569 | ||
... | @@ -657,6 +662,15 @@ public class swiftApi { | ... | @@ -657,6 +662,15 @@ public class swiftApi { |
657 | self.couponset = newValue | 662 | self.couponset = newValue |
658 | } | 663 | } |
659 | } | 664 | } |
665 | + | ||
666 | + public var _type: String? { | ||
667 | + get { // getter | ||
668 | + return self.type | ||
669 | + } | ||
670 | + set(newValue) { //setter | ||
671 | + self.type = newValue | ||
672 | + } | ||
673 | + } | ||
660 | } | 674 | } |
661 | 675 | ||
662 | public class CampaignDataModel { | 676 | public class CampaignDataModel { | ... | ... |
-
Please register or login to post a comment