Manos Chorianopoulos

add getters setters at ProfileModel

......@@ -172,7 +172,7 @@ import UIKit
func getProfileCallback (_ profileData: swiftApi.ProfileModel?) -> Void {
if (profileData != nil) {
DispatchQueue.main.async {
self.numbersList = profileData?.msisdnList ?? []
self.numbersList = profileData?._msisdnList ?? []
print("========= getProfileRequest SUCCESSSS =========")
}
......
......@@ -114,7 +114,7 @@ import UIKit
func getProfileCallback (_ profileData: swiftApi.ProfileModel?) -> Void {
if (profileData != nil) {
DispatchQueue.main.async {
self.numbersList = profileData?.msisdnList ?? []
self.numbersList = profileData?._msisdnList ?? []
}
} else {
}
......
......@@ -69,15 +69,15 @@ import SwiftEventBus
profileImage.layer.borderWidth = 1
profileImage.layer.borderColor = UIColor(red: 0.13, green: 0.66, blue: 0.71, alpha: 1.00).cgColor
if (profile != nil && profile?.image_url != nil && profile?.image_url != "") {
profileImage.load(link: profile?.image_url ?? "", placeholder: UIImage(), cache: URLCache())
if (profile != nil && profile?._image_url != nil && profile?._image_url != "") {
profileImage.load(link: profile?._image_url ?? "", placeholder: UIImage(), cache: URLCache())
} else {
profileImage.image = UIImage(named: "default_profile_image", in: Bundle(for: MyEmptyClass.self), compatibleWith: nil)
}
print("Profile Name: " + (profile?.firstname ?? "") + " " + (profile?.lastname ?? ""))
print("Profile Name: " + (profile?._firstname ?? "") + " " + (profile?._lastname ?? ""))
profileNameLabel.text = (profile?.firstname ?? "") + " " + (profile?.lastname ?? "")
profileNameLabel.text = (profile?._firstname ?? "") + " " + (profile?._lastname ?? "")
let userTag = swiftApi().getUserTag()
print("User tag: " + userTag)
......
......@@ -956,7 +956,7 @@ public class swiftApi {
return (!(isCcmsOffer || isTelco))
}
if (swiftApi().getConsumer()?.answered == true) {
if (swiftApi().getConsumer()?._answered == true) {
filteredCampaigns = filteredCampaigns.filter { $0.offer_category != "questionnaire" }
}
......@@ -1522,45 +1522,45 @@ public class swiftApi {
public class ProfileModel {
public let ack_optin: Bool?
public let billing_info: [String: Any]?
public let birthday: String?
public let burnt_points: Double?
public let company_name: String?
public let consumer_metadata: [String: Any]?
public let display_name: String?
public let email: String?
public let firstname: String?
public let gender: String?
public let image_url: String?
public let language: String?
public let lastname: String?
public let loyalty_id: String?
public let msisdn: String?
public let nameday: String?
public let nickname: String?
public let password_set: Bool?
public let profile_metadata: [String: Any]?
public let redeemed_points: Double?
public let retrieved_points: Double?
public let salutation: String?
public let subscribe: Bool?
public let tags: [String: Any]?
public let tax_id: String?
public let user_points: Double?
public let uuid: String?
public let verified: Bool?
private var ack_optin: Bool?
private var billing_info: [String: Any]?
private var birthday: String?
private var burnt_points: Double?
private var company_name: String?
private var consumer_metadata: [String: Any]?
private var display_name: String?
private var email: String?
private var firstname: String?
private var gender: String?
private var image_url: String?
private var language: String?
private var lastname: String?
private var loyalty_id: String?
private var msisdn: String?
private var nameday: String?
private var nickname: String?
private var password_set: Bool?
private var profile_metadata: [String: Any]?
private var redeemed_points: Double?
private var retrieved_points: Double?
private var salutation: String?
private var subscribe: Bool?
private var tags: [String: Any]?
private var tax_id: String?
private var user_points: Double?
private var uuid: String?
private var verified: Bool?
// optin
public let optin_newsletter: Bool?
public let optin_sms: Bool?
public let optin_segmentation: Bool?
public let optin_sms_segmentation: Bool?
private var optin_newsletter: Bool?
private var optin_sms: Bool?
private var optin_segmentation: Bool?
private var optin_sms_segmentation: Bool?
// profile_metadata
public let badge: String?
public let msisdnList: Array<String>?
public let answered: Bool?
private var badge: String?
private var msisdnList: Array<String>?
private var answered: Bool?
public init() {
......@@ -1670,6 +1670,322 @@ public class swiftApi {
}
}
public var _ack_optin: Bool {
get { // getter
return self.ack_optin ?? false
}
set(newValue) { //setter
self.ack_optin = newValue
}
}
public var _billing_info: [String: Any] {
get { // getter
return self.billing_info ?? [String: Any]()
}
set(newValue) { //setter
self.billing_info = newValue
}
}
public var _birthday: String {
get { // getter
return self.birthday ?? ""
}
set(newValue) { //setter
self.birthday = newValue
}
}
public var _burnt_points: Double {
get { // getter
return self.burnt_points ?? 0.0
}
set(newValue) { //setter
self.burnt_points = newValue
}
}
public var _company_name: String {
get { // getter
return self.company_name ?? ""
}
set(newValue) { //setter
self.company_name = newValue
}
}
public var _consumer_metadata: [String: Any] {
get { // getter
return self.consumer_metadata ?? [String: Any]()
}
set(newValue) { //setter
self.consumer_metadata = newValue
}
}
public var _display_name: String {
get { // getter
return self.display_name ?? ""
}
set(newValue) { //setter
self.display_name = newValue
}
}
public var _email: String {
get { // getter
return self.email ?? ""
}
set(newValue) { //setter
self.email = newValue
}
}
public var _firstname: String {
get { // getter
return self.firstname ?? ""
}
set(newValue) { //setter
self.firstname = newValue
}
}
public var _gender: String {
get { // getter
return self.gender ?? ""
}
set(newValue) { //setter
self.gender = newValue
}
}
public var _image_url: String {
get { // getter
return self.image_url ?? ""
}
set(newValue) { //setter
self.image_url = newValue
}
}
public var _language: String {
get { // getter
return self.language ?? ""
}
set(newValue) { //setter
self.language = newValue
}
}
public var _lastname: String {
get { // getter
return self.lastname ?? ""
}
set(newValue) { //setter
self.lastname = newValue
}
}
public var _loyalty_id: String {
get { // getter
return self.loyalty_id ?? ""
}
set(newValue) { //setter
self.loyalty_id = newValue
}
}
public var _msisdn: String {
get { // getter
return self.msisdn ?? ""
}
set(newValue) { //setter
self.msisdn = newValue
}
}
public var _nameday: String {
get { // getter
return self.nameday ?? ""
}
set(newValue) { //setter
self.nameday = newValue
}
}
public var _nickname: String {
get { // getter
return self.nickname ?? ""
}
set(newValue) { //setter
self.nickname = newValue
}
}
public var _password_set: Bool {
get { // getter
return self.password_set ?? false
}
set(newValue) { //setter
self.password_set = newValue
}
}
public var _profile_metadata: [String: Any] {
get { // getter
return self.profile_metadata ?? [String: Any]()
}
set(newValue) { //setter
self.profile_metadata = newValue
}
}
public var _redeemed_points: Double {
get { // getter
return self.redeemed_points ?? 0.0
}
set(newValue) { //setter
self.redeemed_points = newValue
}
}
public var _retrieved_points: Double {
get { // getter
return self.retrieved_points ?? 0.0
}
set(newValue) { //setter
self.retrieved_points = newValue
}
}
public var _salutation: String {
get { // getter
return self.salutation ?? ""
}
set(newValue) { //setter
self.salutation = newValue
}
}
public var _subscribe: Bool {
get { // getter
return self.subscribe ?? false
}
set(newValue) { //setter
self.subscribe = newValue
}
}
public var _tags: [String: Any] {
get { // getter
return self.tags ?? [String: Any]()
}
set(newValue) { //setter
self.tags = newValue
}
}
public var _tax_id: String {
get { // getter
return self.tax_id ?? ""
}
set(newValue) { //setter
self.tax_id = newValue
}
}
public var _user_points: Double {
get { // getter
return self.user_points ?? 0.0
}
set(newValue) { //setter
self.user_points = newValue
}
}
public var _uuid: String {
get { // getter
return self.uuid ?? ""
}
set(newValue) { //setter
self.uuid = newValue
}
}
public var _verified: Bool {
get { // getter
return self.verified ?? false
}
set(newValue) { //setter
self.verified = newValue
}
}
public var _optin_newsletter: Bool {
get { // getter
return self.optin_newsletter ?? false
}
set(newValue) { //setter
self.optin_newsletter = newValue
}
}
public var _optin_sms: Bool {
get { // getter
return self.optin_sms ?? false
}
set(newValue) { //setter
self.optin_sms = newValue
}
}
public var _optin_segmentation: Bool {
get { // getter
return self.optin_segmentation ?? false
}
set(newValue) { //setter
self.optin_segmentation = newValue
}
}
public var _optin_sms_segmentation: Bool {
get { // getter
return self.optin_sms_segmentation ?? false
}
set(newValue) { //setter
self.optin_sms_segmentation = newValue
}
}
public var _badge: String {
get { // getter
return self.badge ?? ""
}
set(newValue) { //setter
self.badge = newValue
}
}
public var _msisdnList: Array<String> {
get { // getter
return self.msisdnList ?? []
}
set(newValue) { //setter
self.msisdnList = newValue
}
}
public var _answered: Bool {
get { // getter
return self.answered ?? false
}
set(newValue) { //setter
self.answered = newValue
}
}
}
public class ProfileDataModel {
......@@ -1690,7 +2006,7 @@ public class swiftApi {
let tempProfile = ProfileModel(dictionary: profileDataResult)
swiftApi().setConsumer(tempProfile ?? swiftApi.ProfileModel())
swiftApi().setUserTag(tempProfile.badge ?? "")
swiftApi().setUserTag(tempProfile._badge ?? "")
getProfileCallback(tempProfile);
......@@ -1775,7 +2091,7 @@ public class swiftApi {
if (profileData != nil) {
DispatchQueue.main.async {
swiftApi().setConsumer(profileData ?? swiftApi.ProfileModel())
swiftApi().setUserTag(profileData?.badge ?? "")
swiftApi().setUserTag(profileData?._badge ?? "")
}
} else {
......@@ -3076,7 +3392,7 @@ public class swiftApi {
return (!(isCcmsOffer || isTelco))
}
if (swiftApi().getConsumer()?.answered == true) {
if (swiftApi().getConsumer()?._answered == true) {
filteredCampaigns = filteredCampaigns.filter { $0.offer_category != "questionnaire" }
}
......