Showing
6 changed files
with
597 additions
and
31 deletions
No preview for this file type
... | @@ -97,6 +97,7 @@ | ... | @@ -97,6 +97,7 @@ |
97 | - (void)getCampaignsAsyncNew:(NSString*)language :(NSDictionary*)filters :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure; | 97 | - (void)getCampaignsAsyncNew:(NSString*)language :(NSDictionary*)filters :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure; |
98 | - (void)getCampaignsPersonalizedAsync:(NSString*)language :(NSDictionary*)filters :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure; | 98 | - (void)getCampaignsPersonalizedAsync:(NSString*)language :(NSDictionary*)filters :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure; |
99 | - (void)getSharingHistoryAsync:(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure; | 99 | - (void)getSharingHistoryAsync:(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure; |
100 | +- (void)getMultilingualMerchantsAsync:(NSArray*)categories andDefaultShown:(NSNumber*)defaultShown andCenter:(NSNumber*)center andTags:(NSArray*)tags andUuid:(NSString*)uuid andDistance:(NSNumber*)distance parent_uuids:(NSArray*)parent_uuids :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure; | ||
100 | 101 | ||
101 | @end | 102 | @end |
102 | #endif /* MyApi_h */ | 103 | #endif /* MyApi_h */ | ... | ... |
... | @@ -1216,32 +1216,32 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; | ... | @@ -1216,32 +1216,32 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; |
1216 | return resp; | 1216 | return resp; |
1217 | } | 1217 | } |
1218 | 1218 | ||
1219 | -- (NSDictionary*)retrieveMultilingualMerchantsWithCategories:(NSArray*)categories andDefaultShown:(NSNumber*)defaultShown andCenter:(NSNumber*)center andTags:(NSArray*)tags andUuid:(NSString*)uuid andDistance:(NSNumber*)distance { | 1219 | +// - (NSDictionary*)retrieveMultilingualMerchantsWithCategories:(NSArray*)categories andDefaultShown:(NSNumber*)defaultShown andCenter:(NSNumber*)center andTags:(NSArray*)tags andUuid:(NSString*)uuid andDistance:(NSNumber*)distance { |
1220 | - __block NSDictionary *resp = [NSDictionary alloc]; | 1220 | +// __block NSDictionary *resp = [NSDictionary alloc]; |
1221 | - __block BOOL isRunLoopNested = NO; | 1221 | +// __block BOOL isRunLoopNested = NO; |
1222 | - __block BOOL isOperationCompleted = NO; | 1222 | +// __block BOOL isOperationCompleted = NO; |
1223 | - [[Warply sharedService] retrieveMultilingualMerchantsWithCategoriesWithSuccessBlock:categories andDefaultShown:defaultShown andCenter:center andTags:tags andUuid:uuid andDistance:distance :^(NSDictionary *response) { | 1223 | +// [[Warply sharedService] retrieveMultilingualMerchantsWithCategoriesWithSuccessBlock:categories andDefaultShown:defaultShown andCenter:center andTags:tags andUuid:uuid andDistance:distance :^(NSDictionary *response) { |
1224 | - resp = response; | 1224 | +// resp = response; |
1225 | - isOperationCompleted = YES; | 1225 | +// isOperationCompleted = YES; |
1226 | - if (isRunLoopNested) { | 1226 | +// if (isRunLoopNested) { |
1227 | - CFRunLoopStop(CFRunLoopGetCurrent()); // CFRunLoopRun() returns | 1227 | +// CFRunLoopStop(CFRunLoopGetCurrent()); // CFRunLoopRun() returns |
1228 | - } | 1228 | +// } |
1229 | - } failureBlock:^(NSError *error) { | 1229 | +// } failureBlock:^(NSError *error) { |
1230 | - NSLog(@"%@", error); | 1230 | +// NSLog(@"%@", error); |
1231 | - resp = nil; | 1231 | +// resp = nil; |
1232 | - isOperationCompleted = YES; | 1232 | +// isOperationCompleted = YES; |
1233 | - if (isRunLoopNested) { | 1233 | +// if (isRunLoopNested) { |
1234 | - CFRunLoopStop(CFRunLoopGetCurrent()); // CFRunLoopRun() returns | 1234 | +// CFRunLoopStop(CFRunLoopGetCurrent()); // CFRunLoopRun() returns |
1235 | - } | 1235 | +// } |
1236 | - }]; | 1236 | +// }]; |
1237 | - if ( ! isOperationCompleted) { | 1237 | +// if ( ! isOperationCompleted) { |
1238 | - isRunLoopNested = YES; | 1238 | +// isRunLoopNested = YES; |
1239 | - NSLog(@"Waiting..."); | 1239 | +// NSLog(@"Waiting..."); |
1240 | - CFRunLoopRun(); // Magic! | 1240 | +// CFRunLoopRun(); // Magic! |
1241 | - isRunLoopNested = NO; | 1241 | +// isRunLoopNested = NO; |
1242 | - } | 1242 | +// } |
1243 | - return resp; | 1243 | +// return resp; |
1244 | -} | 1244 | +// } |
1245 | 1245 | ||
1246 | - (NSDictionary*)getCouponSetsWithActive:(NSNumber*)active andVisible:(NSNumber*)visible andUuids:(NSArray*)uuids { | 1246 | - (NSDictionary*)getCouponSetsWithActive:(NSNumber*)active andVisible:(NSNumber*)visible andUuids:(NSArray*)uuids { |
1247 | __block NSDictionary *resp = [NSDictionary alloc]; | 1247 | __block NSDictionary *resp = [NSDictionary alloc]; |
... | @@ -1578,4 +1578,17 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; | ... | @@ -1578,4 +1578,17 @@ NSString *VERIFY_URL = @"/partners/cosmote/verify"; |
1578 | }]; | 1578 | }]; |
1579 | } | 1579 | } |
1580 | 1580 | ||
1581 | +- (void)getMultilingualMerchantsAsync:(NSArray*)categories andDefaultShown:(NSNumber*)defaultShown andCenter:(NSNumber*)center andTags:(NSArray*)tags andUuid:(NSString*)uuid andDistance:(NSNumber*)distance parent_uuids:(NSArray*)parent_uuids :(void (^)(NSDictionary *response))success failureBlock:(void (^)(NSError *error))failure { | ||
1582 | + | ||
1583 | + [[Warply sharedService] retrieveMultilingualMerchantsWithCategoriesWithSuccessBlock:categories andDefaultShown:defaultShown andCenter:center andTags:tags andUuid:uuid andDistance:distance parent_uuids:parent_uuids :^(NSDictionary *response) { | ||
1584 | + if (success) { | ||
1585 | + success(response); | ||
1586 | + } | ||
1587 | + } failureBlock:^(NSError *error) { | ||
1588 | + if (failure) { | ||
1589 | + failure(error); | ||
1590 | + } | ||
1591 | + }]; | ||
1592 | +} | ||
1593 | + | ||
1581 | @end | 1594 | @end | ... | ... |
... | @@ -383,7 +383,7 @@ WL_VERSION_INTERFACE() | ... | @@ -383,7 +383,7 @@ WL_VERSION_INTERFACE() |
383 | 383 | ||
384 | - (void)resetPasswordWithPasswordWithSuccessBlock:(NSString*)password andConfCode:(NSString*)confCode andOtpUuid:(NSString*)otpUuid andConfToken:(NSString*)confToken :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; | 384 | - (void)resetPasswordWithPasswordWithSuccessBlock:(NSString*)password andConfCode:(NSString*)confCode andOtpUuid:(NSString*)otpUuid andConfToken:(NSString*)confToken :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; |
385 | 385 | ||
386 | -- (void)retrieveMultilingualMerchantsWithCategoriesWithSuccessBlock:(NSArray*)categories andDefaultShown:(NSNumber*)defaultShown andCenter:(NSNumber*)center andTags:(NSArray*)tags andUuid:(NSString*)uuid andDistance:(NSNumber*)distance :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; | 386 | +- (void)retrieveMultilingualMerchantsWithCategoriesWithSuccessBlock:(NSArray*)categories andDefaultShown:(NSNumber*)defaultShown andCenter:(NSNumber*)center andTags:(NSArray*)tags andUuid:(NSString*)uuid andDistance:(NSNumber*)distance parent_uuids:(NSArray*)parent_uuids :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; |
387 | 387 | ||
388 | - (void) getCouponSetsWithSuccessBlock:(NSNumber*) active andVisible:(NSNumber*) visible andUuids:(NSArray*) uuids :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; | 388 | - (void) getCouponSetsWithSuccessBlock:(NSNumber*) active andVisible:(NSNumber*) visible andUuids:(NSArray*) uuids :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure; |
389 | 389 | ... | ... |
... | @@ -2045,7 +2045,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) | ... | @@ -2045,7 +2045,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) |
2045 | }]; | 2045 | }]; |
2046 | } | 2046 | } |
2047 | 2047 | ||
2048 | -- (void)retrieveMultilingualMerchantsWithCategoriesWithSuccessBlock:(NSArray*)categories andDefaultShown:(NSNumber*)defaultShown andCenter:(NSNumber*)center andTags:(NSArray*)tags andUuid:(NSString*)uuid andDistance:(NSNumber*)distance :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure | 2048 | +- (void)retrieveMultilingualMerchantsWithCategoriesWithSuccessBlock:(NSArray*)categories andDefaultShown:(NSNumber*)defaultShown andCenter:(NSNumber*)center andTags:(NSArray*)tags andUuid:(NSString*)uuid andDistance:(NSNumber*)distance parent_uuids:(NSArray*)parent_uuids :(void(^)(NSDictionary *response))success failureBlock:(void(^)(NSError *error))failure |
2049 | { | 2049 | { |
2050 | NSString* appUuid = [NSString alloc]; | 2050 | NSString* appUuid = [NSString alloc]; |
2051 | appUuid = [WLKeychain getStringForKey:@"NBAPPUuid"]; | 2051 | appUuid = [WLKeychain getStringForKey:@"NBAPPUuid"]; |
... | @@ -2060,7 +2060,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) | ... | @@ -2060,7 +2060,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) |
2060 | } else { | 2060 | } else { |
2061 | [data setValue:[NSNull null] forKey:@"default_shown"]; | 2061 | [data setValue:[NSNull null] forKey:@"default_shown"]; |
2062 | } | 2062 | } |
2063 | - if (tags) { | 2063 | + if (tags && ![tags isEqual:@[]]) { |
2064 | [data setValue:tags forKey:@"tags"]; | 2064 | [data setValue:tags forKey:@"tags"]; |
2065 | } else { | 2065 | } else { |
2066 | [data setValue:[NSNull null] forKey:@"tags"]; | 2066 | [data setValue:[NSNull null] forKey:@"tags"]; |
... | @@ -2068,7 +2068,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) | ... | @@ -2068,7 +2068,7 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) |
2068 | if (uuid && ![uuid isEqual:@""]) { | 2068 | if (uuid && ![uuid isEqual:@""]) { |
2069 | [data setValue:uuid forKey:@"uuid"]; | 2069 | [data setValue:uuid forKey:@"uuid"]; |
2070 | } | 2070 | } |
2071 | - if (distance != 0 && center) { | 2071 | + if (distance && ![distance isEqual:@0] && center) { |
2072 | NSMutableDictionary* dataLocation = [[NSMutableDictionary alloc] init]; | 2072 | NSMutableDictionary* dataLocation = [[NSMutableDictionary alloc] init]; |
2073 | [dataLocation setValue:distance forKey:@"distance"]; | 2073 | [dataLocation setValue:distance forKey:@"distance"]; |
2074 | [dataLocation setValue:center forKey:@"center"]; | 2074 | [dataLocation setValue:center forKey:@"center"]; |
... | @@ -2078,7 +2078,11 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) | ... | @@ -2078,7 +2078,11 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) |
2078 | } else { | 2078 | } else { |
2079 | [data setValue:[NSNull null] forKey:@"location"]; | 2079 | [data setValue:[NSNull null] forKey:@"location"]; |
2080 | } | 2080 | } |
2081 | - | 2081 | + if (parent_uuids && ![parent_uuids isEqual:@[]]) { |
2082 | + [data setValue:parent_uuids forKey:@"parent_uuids"]; | ||
2083 | + } else { | ||
2084 | + [data setValue:[NSNull null] forKey:@"parent_uuids"]; | ||
2085 | + } | ||
2082 | 2086 | ||
2083 | NSMutableDictionary* dataShops = [[NSMutableDictionary alloc] init]; | 2087 | NSMutableDictionary* dataShops = [[NSMutableDictionary alloc] init]; |
2084 | [dataShops setValue:data forKey:@"shops"]; | 2088 | [dataShops setValue:data forKey:@"shops"]; |
... | @@ -2087,6 +2091,8 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) | ... | @@ -2087,6 +2091,8 @@ WL_VERSION_IMPLEMENTATION(WL_VERSION) |
2087 | if (success) { | 2091 | if (success) { |
2088 | success(contextResponse); | 2092 | success(contextResponse); |
2089 | } | 2093 | } |
2094 | + NSLog(@"**************** WARPLY Response *****************" ); | ||
2095 | + NSLog(@"%@", contextResponse ); | ||
2090 | } failureBlock:^(NSError *error) { | 2096 | } failureBlock:^(NSError *error) { |
2091 | if (failure) { | 2097 | if (failure) { |
2092 | failure(error); | 2098 | failure(error); | ... | ... |
... | @@ -302,6 +302,7 @@ public class swiftApi { | ... | @@ -302,6 +302,7 @@ public class swiftApi { |
302 | public let buyable: Bool? | 302 | public let buyable: Bool? |
303 | public let visible: Bool? | 303 | public let visible: Bool? |
304 | public let terms: String? | 304 | public let terms: String? |
305 | + public let merchant_uuid: String? | ||
305 | 306 | ||
306 | public init(dictionary: [String: Any]) { | 307 | public init(dictionary: [String: Any]) { |
307 | self.uuid = dictionary["uuid"] as? String? ?? "" | 308 | self.uuid = dictionary["uuid"] as? String? ?? "" |
... | @@ -316,6 +317,7 @@ public class swiftApi { | ... | @@ -316,6 +317,7 @@ public class swiftApi { |
316 | self.buyable = dictionary["buyable"] as? Bool? ?? false | 317 | self.buyable = dictionary["buyable"] as? Bool? ?? false |
317 | self.visible = dictionary["visible"] as? Bool? ?? false | 318 | self.visible = dictionary["visible"] as? Bool? ?? false |
318 | self.terms = dictionary["terms"] as? String? ?? "" | 319 | self.terms = dictionary["terms"] as? String? ?? "" |
320 | + self.merchant_uuid = dictionary["merchant_uuid"] as? String? ?? "" | ||
319 | 321 | ||
320 | let expirationObject = dictionary["expiration"] as? [String: Any]? ?? ["":""] | 322 | let expirationObject = dictionary["expiration"] as? [String: Any]? ?? ["":""] |
321 | let expirationString = expirationObject?["value"] as? String? ?? "" | 323 | let expirationString = expirationObject?["value"] as? String? ?? "" |
... | @@ -4087,4 +4089,548 @@ public class swiftApi { | ... | @@ -4087,4 +4089,548 @@ public class swiftApi { |
4087 | } | 4089 | } |
4088 | } | 4090 | } |
4089 | 4091 | ||
4092 | + | ||
4093 | + // _ center: Array<Double> | ||
4094 | + public func getMultilingualMerchantsAsync(_ categories: Array<String>, _ defaultShown: Bool, _ center: Double, _ tags: Array<String>, _ uuid: String, _ distance: Int, _ parent_uuids: Array<String>, _ getMerchantsCallback: @escaping (_ getMerchantsData: Array<MerchantModel>?) -> Void) -> Void { | ||
4095 | + let instanceOfMyApi = MyApi() | ||
4096 | + instanceOfMyApi.getMultilingualMerchantsAsync(categories, andDefaultShown:defaultShown as NSNumber, andCenter:center as NSNumber, andTags:tags, andUuid:uuid, andDistance:distance as NSNumber, parent_uuids:parent_uuids, requestCallback, failureBlock: requestFailureCallback) | ||
4097 | + | ||
4098 | + func requestCallback(_ getMerchantsData: [AnyHashable: Any]?) -> Void { // [Any]? - [AnyHashable: Any]? | ||
4099 | + var merchantsArray:Array<MerchantModel> = [] | ||
4100 | + | ||
4101 | + if let responseDataDictionary = getMerchantsData as? [String: AnyObject] { | ||
4102 | + | ||
4103 | + if (responseDataDictionary["MAPP_SHOPS-status"] as? Int == 1) { | ||
4104 | + | ||
4105 | + if let responseDataMappShops = responseDataDictionary["MAPP_SHOPS"] as? [String: Any] { | ||
4106 | + | ||
4107 | + if let responseDataResult = responseDataMappShops["result"] as? [[String: Any]?] { | ||
4108 | + | ||
4109 | + for item in responseDataResult { | ||
4110 | + if let itemDictionary = item { | ||
4111 | + | ||
4112 | + let tempMerchItem = MerchantModel(dictionary: itemDictionary) | ||
4113 | + merchantsArray.append(tempMerchItem) | ||
4114 | + | ||
4115 | + } | ||
4116 | + } | ||
4117 | + | ||
4118 | + getMerchantsCallback(merchantsArray); | ||
4119 | + | ||
4120 | + } else { | ||
4121 | + getMerchantsCallback(nil) | ||
4122 | + } | ||
4123 | + | ||
4124 | + } else { | ||
4125 | + getMerchantsCallback(nil) | ||
4126 | + } | ||
4127 | + | ||
4128 | + } else { | ||
4129 | + getMerchantsCallback(nil) | ||
4130 | + } | ||
4131 | + | ||
4132 | + } else { | ||
4133 | + getMerchantsCallback(nil) | ||
4134 | + } | ||
4135 | + } | ||
4136 | + | ||
4137 | + func requestFailureCallback(_ error: Error?) -> Void { | ||
4138 | + print("getMultilingualMerchants error: ") | ||
4139 | + print(error) | ||
4140 | + print("====================") | ||
4141 | + getMerchantsCallback(nil) | ||
4142 | + } | ||
4143 | + } | ||
4144 | + | ||
4145 | + | ||
4146 | + public class MerchantModel: Codable { | ||
4147 | + private var address: String? | ||
4148 | + private var id: String? | ||
4149 | + private var store_id: String? | ||
4150 | + private var name: String? | ||
4151 | + private var logo: String? | ||
4152 | + private var website: String? | ||
4153 | + private var email: String? | ||
4154 | + private var telephone: String? | ||
4155 | + private var category: String? | ||
4156 | + private var description: String? | ||
4157 | + private var short_description: String? | ||
4158 | + private var region: String? | ||
4159 | + private var latitude: Double? | ||
4160 | + private var longitude: Double? | ||
4161 | + private var image: String? | ||
4162 | + // private var extra_fields: [String: Any]? | ||
4163 | + private var active: Bool? | ||
4164 | + private var city: String? | ||
4165 | + private var country: String? | ||
4166 | + private var postal_code: String? | ||
4167 | + private var vat: String? | ||
4168 | + private var uuid: String? | ||
4169 | + private var category_uuid: String? | ||
4170 | + private var created: String? | ||
4171 | + private var parent: String? | ||
4172 | + // private var img: [[String: Any]]? | ||
4173 | + private var img_preview: String? | ||
4174 | + private var admin_name: String? | ||
4175 | + private var sorting: Int? | ||
4176 | + private var body: String? | ||
4177 | + private var owner_name: String? | ||
4178 | + private var preview: String? | ||
4179 | + // private var merchant_metadata: [String: Any]? | ||
4180 | + private var promoted: Bool? | ||
4181 | + private var distance: Int? | ||
4182 | + private var default_shown: Bool? | ||
4183 | + private var hidden: Bool? | ||
4184 | + // private var working_hours: [String: Any]? | ||
4185 | + // private var tags: [[String: Any]]? | ||
4186 | + // private var product: [String: Any]? | ||
4187 | + | ||
4188 | + public init() { | ||
4189 | + self.address = "" | ||
4190 | + self.id = "" | ||
4191 | + self.store_id = "" | ||
4192 | + self.name = "" | ||
4193 | + self.logo = "" | ||
4194 | + self.website = "" | ||
4195 | + self.email = "" | ||
4196 | + self.telephone = "" | ||
4197 | + self.category = "" | ||
4198 | + self.description = "" | ||
4199 | + self.short_description = "" | ||
4200 | + self.region = "" | ||
4201 | + self.latitude = 0.0 | ||
4202 | + self.longitude = 0.0 | ||
4203 | + self.image = "" | ||
4204 | + // self.extra_fields = [String: Any]() | ||
4205 | + self.active = false | ||
4206 | + self.city = "" | ||
4207 | + self.country = "" | ||
4208 | + self.postal_code = "" | ||
4209 | + self.vat = "" | ||
4210 | + self.uuid = "" | ||
4211 | + self.category_uuid = "" | ||
4212 | + self.created = "" | ||
4213 | + self.parent = "" | ||
4214 | + // self.img = [[String: Any]]() | ||
4215 | + self.img_preview = "" | ||
4216 | + self.admin_name = "" | ||
4217 | + self.sorting = 0 | ||
4218 | + self.body = "" | ||
4219 | + self.owner_name = "" | ||
4220 | + self.preview = "" | ||
4221 | + // self.merchant_metadata = [String: Any]() | ||
4222 | + self.promoted = false | ||
4223 | + self.distance = 0 | ||
4224 | + self.default_shown = false | ||
4225 | + self.hidden = false | ||
4226 | + // self.working_hours = [String: Any]() | ||
4227 | + // self.tags = [[String: Any]]() | ||
4228 | + // self.product = [String: Any]() | ||
4229 | + } | ||
4230 | + | ||
4231 | + public init(dictionary: [String: Any]) { | ||
4232 | + self.address = dictionary["address"] as? String? ?? "" | ||
4233 | + self.id = dictionary["id"] as? String? ?? "" | ||
4234 | + self.store_id = dictionary["store_id"] as? String? ?? "" | ||
4235 | + self.name = dictionary["name"] as? String? ?? "" | ||
4236 | + self.logo = dictionary["logo"] as? String? ?? "" | ||
4237 | + self.website = dictionary["website"] as? String? ?? "" | ||
4238 | + self.email = dictionary["email"] as? String? ?? "" | ||
4239 | + self.telephone = dictionary["telephone"] as? String? ?? "" | ||
4240 | + self.category = dictionary["category"] as? String? ?? "" | ||
4241 | + self.description = dictionary["description"] as? String? ?? "" | ||
4242 | + self.short_description = dictionary["short_description"] as? String? ?? "" | ||
4243 | + self.region = dictionary["region"] as? String? ?? "" | ||
4244 | + self.latitude = dictionary["latitude"] as? Double? ?? 0.0 | ||
4245 | + self.longitude = dictionary["longitude"] as? Double? ?? 0.0 | ||
4246 | + self.image = dictionary["image"] as? String? ?? "" | ||
4247 | + // self.extra_fields = dictionary["extra_fields"] as? [String: Any]? ?? [String: Any]() | ||
4248 | + self.active = dictionary["active"] as? Bool? ?? false | ||
4249 | + self.city = dictionary["city"] as? String? ?? "" | ||
4250 | + self.country = dictionary["country"] as? String? ?? "" | ||
4251 | + self.postal_code = dictionary["postal_code"] as? String? ?? "" | ||
4252 | + self.vat = dictionary["vat"] as? String? ?? "" | ||
4253 | + self.uuid = dictionary["uuid"] as? String? ?? "" | ||
4254 | + self.category_uuid = dictionary["category_uuid"] as? String? ?? "" | ||
4255 | + self.created = dictionary["created"] as? String? ?? "" | ||
4256 | + self.parent = dictionary["parent"] as? String? ?? "" | ||
4257 | + // self.img = dictionary["img"] as? [[String: Any]]? ?? [[String: Any]]() | ||
4258 | + self.img_preview = dictionary["img_preview"] as? String? ?? "" | ||
4259 | + self.admin_name = dictionary["admin_name"] as? String? ?? "" | ||
4260 | + self.sorting = dictionary["sorting"] as? Int? ?? 0 | ||
4261 | + self.body = dictionary["body"] as? String? ?? "" | ||
4262 | + self.owner_name = dictionary["owner_name"] as? String? ?? "" | ||
4263 | + self.preview = dictionary["preview"] as? String? ?? "" | ||
4264 | + // self.merchant_metadata = dictionary["merchant_metadata"] as? [String: Any]? ?? [String: Any]() | ||
4265 | + self.promoted = dictionary["promoted"] as? Bool? ?? false | ||
4266 | + self.distance = dictionary["distance"] as? Int? ?? 0 | ||
4267 | + self.default_shown = dictionary["default_shown"] as? Bool? ?? false | ||
4268 | + self.hidden = dictionary["hidden"] as? Bool? ?? false | ||
4269 | + // self.working_hours = dictionary["working_hours"] as? [String: Any]? ?? [String: Any]() | ||
4270 | + // self.tags = dictionary["tags"] as? [[String: Any]]? ?? [[String: Any]]() | ||
4271 | + // self.product = dictionary["product"] as? [String: Any]? ?? [String: Any]() | ||
4272 | + } | ||
4273 | + | ||
4274 | + public var _address: String { | ||
4275 | + get { // getter | ||
4276 | + return self.address ?? "" | ||
4277 | + } | ||
4278 | + set(newValue) { //setter | ||
4279 | + self.address = newValue | ||
4280 | + } | ||
4281 | + } | ||
4282 | + | ||
4283 | + public var _id: String { | ||
4284 | + get { // getter | ||
4285 | + return self.id ?? "" | ||
4286 | + } | ||
4287 | + set(newValue) { //setter | ||
4288 | + self.id = newValue | ||
4289 | + } | ||
4290 | + } | ||
4291 | + | ||
4292 | + public var _store_id: String { | ||
4293 | + get { // getter | ||
4294 | + return self.store_id ?? "" | ||
4295 | + } | ||
4296 | + set(newValue) { //setter | ||
4297 | + self.store_id = newValue | ||
4298 | + } | ||
4299 | + } | ||
4300 | + | ||
4301 | + public var _name: String { | ||
4302 | + get { // getter | ||
4303 | + return self.name ?? "" | ||
4304 | + } | ||
4305 | + set(newValue) { //setter | ||
4306 | + self.name = newValue | ||
4307 | + } | ||
4308 | + } | ||
4309 | + | ||
4310 | + public var _logo: String { | ||
4311 | + get { // getter | ||
4312 | + return self.logo ?? "" | ||
4313 | + } | ||
4314 | + set(newValue) { //setter | ||
4315 | + self.logo = newValue | ||
4316 | + } | ||
4317 | + } | ||
4318 | + | ||
4319 | + public var _website: String { | ||
4320 | + get { // getter | ||
4321 | + return self.website ?? "" | ||
4322 | + } | ||
4323 | + set(newValue) { //setter | ||
4324 | + self.website = newValue | ||
4325 | + } | ||
4326 | + } | ||
4327 | + | ||
4328 | + public var _email: String { | ||
4329 | + get { // getter | ||
4330 | + return self.email ?? "" | ||
4331 | + } | ||
4332 | + set(newValue) { //setter | ||
4333 | + self.email = newValue | ||
4334 | + } | ||
4335 | + } | ||
4336 | + | ||
4337 | + public var _telephone: String { | ||
4338 | + get { // getter | ||
4339 | + return self.telephone ?? "" | ||
4340 | + } | ||
4341 | + set(newValue) { //setter | ||
4342 | + self.telephone = newValue | ||
4343 | + } | ||
4344 | + } | ||
4345 | + | ||
4346 | + public var _category: String { | ||
4347 | + get { // getter | ||
4348 | + return self.category ?? "" | ||
4349 | + } | ||
4350 | + set(newValue) { //setter | ||
4351 | + self.category = newValue | ||
4352 | + } | ||
4353 | + } | ||
4354 | + | ||
4355 | + public var _description: String { | ||
4356 | + get { // getter | ||
4357 | + return self.description ?? "" | ||
4358 | + } | ||
4359 | + set(newValue) { //setter | ||
4360 | + self.description = newValue | ||
4361 | + } | ||
4362 | + } | ||
4363 | + | ||
4364 | + public var _short_description: String { | ||
4365 | + get { // getter | ||
4366 | + return self.short_description ?? "" | ||
4367 | + } | ||
4368 | + set(newValue) { //setter | ||
4369 | + self.short_description = newValue | ||
4370 | + } | ||
4371 | + } | ||
4372 | + | ||
4373 | + public var _region: String { | ||
4374 | + get { // getter | ||
4375 | + return self.region ?? "" | ||
4376 | + } | ||
4377 | + set(newValue) { //setter | ||
4378 | + self.region = newValue | ||
4379 | + } | ||
4380 | + } | ||
4381 | + | ||
4382 | + public var _latitude: Double { | ||
4383 | + get { // getter | ||
4384 | + return self.latitude ?? 0.0 | ||
4385 | + } | ||
4386 | + set(newValue) { //setter | ||
4387 | + self.latitude = newValue | ||
4388 | + } | ||
4389 | + } | ||
4390 | + | ||
4391 | + public var _longitude: Double { | ||
4392 | + get { // getter | ||
4393 | + return self.longitude ?? 0.0 | ||
4394 | + } | ||
4395 | + set(newValue) { //setter | ||
4396 | + self.longitude = newValue | ||
4397 | + } | ||
4398 | + } | ||
4399 | + | ||
4400 | + public var _image: String { | ||
4401 | + get { // getter | ||
4402 | + return self.image ?? "" | ||
4403 | + } | ||
4404 | + set(newValue) { //setter | ||
4405 | + self.image = newValue | ||
4406 | + } | ||
4407 | + } | ||
4408 | + | ||
4409 | + // public var _extra_fields: [String: Any] { | ||
4410 | + // get { // getter | ||
4411 | + // return self.extra_fields ?? [String: Any]() | ||
4412 | + // } | ||
4413 | + // set(newValue) { //setter | ||
4414 | + // self.extra_fields = newValue | ||
4415 | + // } | ||
4416 | + // } | ||
4417 | + | ||
4418 | + public var _active: Bool { | ||
4419 | + get { // getter | ||
4420 | + return self.active ?? false | ||
4421 | + } | ||
4422 | + set(newValue) { //setter | ||
4423 | + self.active = newValue | ||
4424 | + } | ||
4425 | + } | ||
4426 | + | ||
4427 | + public var _city: String { | ||
4428 | + get { // getter | ||
4429 | + return self.city ?? "" | ||
4430 | + } | ||
4431 | + set(newValue) { //setter | ||
4432 | + self.city = newValue | ||
4433 | + } | ||
4434 | + } | ||
4435 | + | ||
4436 | + public var _country: String { | ||
4437 | + get { // getter | ||
4438 | + return self.country ?? "" | ||
4439 | + } | ||
4440 | + set(newValue) { //setter | ||
4441 | + self.country = newValue | ||
4442 | + } | ||
4443 | + } | ||
4444 | + | ||
4445 | + public var _postal_code: String { | ||
4446 | + get { // getter | ||
4447 | + return self.postal_code ?? "" | ||
4448 | + } | ||
4449 | + set(newValue) { //setter | ||
4450 | + self.postal_code = newValue | ||
4451 | + } | ||
4452 | + } | ||
4453 | + | ||
4454 | + public var _vat: String { | ||
4455 | + get { // getter | ||
4456 | + return self.vat ?? "" | ||
4457 | + } | ||
4458 | + set(newValue) { //setter | ||
4459 | + self.vat = newValue | ||
4460 | + } | ||
4461 | + } | ||
4462 | + | ||
4463 | + public var _uuid: String { | ||
4464 | + get { // getter | ||
4465 | + return self.uuid ?? "" | ||
4466 | + } | ||
4467 | + set(newValue) { //setter | ||
4468 | + self.uuid = newValue | ||
4469 | + } | ||
4470 | + } | ||
4471 | + | ||
4472 | + public var _category_uuid: String { | ||
4473 | + get { // getter | ||
4474 | + return self.category_uuid ?? "" | ||
4475 | + } | ||
4476 | + set(newValue) { //setter | ||
4477 | + self.category_uuid = newValue | ||
4478 | + } | ||
4479 | + } | ||
4480 | + | ||
4481 | + public var _created: String { | ||
4482 | + get { // getter | ||
4483 | + return self.created ?? "" | ||
4484 | + } | ||
4485 | + set(newValue) { //setter | ||
4486 | + self.created = newValue | ||
4487 | + } | ||
4488 | + } | ||
4489 | + | ||
4490 | + public var _parent: String { | ||
4491 | + get { // getter | ||
4492 | + return self.parent ?? "" | ||
4493 | + } | ||
4494 | + set(newValue) { //setter | ||
4495 | + self.parent = newValue | ||
4496 | + } | ||
4497 | + } | ||
4498 | + | ||
4499 | + // public var _img: [[String: Any]] { | ||
4500 | + // get { // getter | ||
4501 | + // return self.img ?? [[String: Any]]() | ||
4502 | + // } | ||
4503 | + // set(newValue) { //setter | ||
4504 | + // self.img = newValue | ||
4505 | + // } | ||
4506 | + // } | ||
4507 | + | ||
4508 | + public var _img_preview: String { | ||
4509 | + get { // getter | ||
4510 | + return self.img_preview ?? "" | ||
4511 | + } | ||
4512 | + set(newValue) { //setter | ||
4513 | + self.img_preview = newValue | ||
4514 | + } | ||
4515 | + } | ||
4516 | + | ||
4517 | + public var _admin_name: String { | ||
4518 | + get { // getter | ||
4519 | + return self.admin_name ?? "" | ||
4520 | + } | ||
4521 | + set(newValue) { //setter | ||
4522 | + self.admin_name = newValue | ||
4523 | + } | ||
4524 | + } | ||
4525 | + | ||
4526 | + public var _sorting: Int { | ||
4527 | + get { // getter | ||
4528 | + return self.sorting ?? 0 | ||
4529 | + } | ||
4530 | + set(newValue) { //setter | ||
4531 | + self.sorting = newValue | ||
4532 | + } | ||
4533 | + } | ||
4534 | + | ||
4535 | + public var _body: String { | ||
4536 | + get { // getter | ||
4537 | + return self.body ?? "" | ||
4538 | + } | ||
4539 | + set(newValue) { //setter | ||
4540 | + self.body = newValue | ||
4541 | + } | ||
4542 | + } | ||
4543 | + | ||
4544 | + public var _owner_name: String { | ||
4545 | + get { // getter | ||
4546 | + return self.owner_name ?? "" | ||
4547 | + } | ||
4548 | + set(newValue) { //setter | ||
4549 | + self.owner_name = newValue | ||
4550 | + } | ||
4551 | + } | ||
4552 | + | ||
4553 | + public var _preview: String { | ||
4554 | + get { // getter | ||
4555 | + return self.preview ?? "" | ||
4556 | + } | ||
4557 | + set(newValue) { //setter | ||
4558 | + self.preview = newValue | ||
4559 | + } | ||
4560 | + } | ||
4561 | + | ||
4562 | + // public var _merchant_metadata: [String: Any] { | ||
4563 | + // get { // getter | ||
4564 | + // return self.merchant_metadata ?? [String: Any]() | ||
4565 | + // } | ||
4566 | + // set(newValue) { //setter | ||
4567 | + // self.merchant_metadata = newValue | ||
4568 | + // } | ||
4569 | + // } | ||
4570 | + | ||
4571 | + public var _promoted: Bool { | ||
4572 | + get { // getter | ||
4573 | + return self.promoted ?? false | ||
4574 | + } | ||
4575 | + set(newValue) { //setter | ||
4576 | + self.promoted = newValue | ||
4577 | + } | ||
4578 | + } | ||
4579 | + | ||
4580 | + public var _distance: Int { | ||
4581 | + get { // getter | ||
4582 | + return self.distance ?? 0 | ||
4583 | + } | ||
4584 | + set(newValue) { //setter | ||
4585 | + self.distance = newValue | ||
4586 | + } | ||
4587 | + } | ||
4588 | + | ||
4589 | + public var _default_shown: Bool { | ||
4590 | + get { // getter | ||
4591 | + return self.default_shown ?? false | ||
4592 | + } | ||
4593 | + set(newValue) { //setter | ||
4594 | + self.default_shown = newValue | ||
4595 | + } | ||
4596 | + } | ||
4597 | + | ||
4598 | + public var _hidden: Bool { | ||
4599 | + get { // getter | ||
4600 | + return self.hidden ?? false | ||
4601 | + } | ||
4602 | + set(newValue) { //setter | ||
4603 | + self.hidden = newValue | ||
4604 | + } | ||
4605 | + } | ||
4606 | + | ||
4607 | + // public var _working_hours: [String: Any] { | ||
4608 | + // get { // getter | ||
4609 | + // return self.working_hours ?? [String: Any]() | ||
4610 | + // } | ||
4611 | + // set(newValue) { //setter | ||
4612 | + // self.working_hours = newValue | ||
4613 | + // } | ||
4614 | + // } | ||
4615 | + | ||
4616 | + // public var _tags: [[String: Any]] { | ||
4617 | + // get { // getter | ||
4618 | + // return self.tags ?? [[String: Any]]() | ||
4619 | + // } | ||
4620 | + // set(newValue) { //setter | ||
4621 | + // self.tags = newValue | ||
4622 | + // } | ||
4623 | + // } | ||
4624 | + | ||
4625 | + // public var _product: [String: Any] { | ||
4626 | + // get { // getter | ||
4627 | + // return self.product ?? [String: Any]() | ||
4628 | + // } | ||
4629 | + // set(newValue) { //setter | ||
4630 | + // self.product = newValue | ||
4631 | + // } | ||
4632 | + // } | ||
4633 | + } | ||
4634 | + | ||
4635 | + | ||
4090 | } | 4636 | } | ... | ... |
-
Please register or login to post a comment