//
// WebService.m
// GoToBus
//
// Created by haibara on 10/8/14.
//
//

#import "WebService.h"
#import "SDK.h"
#import "Lang.h"
#import "BeanUtils.h"
#import "CocoaUtils.h"
#import <BlocksKit/BlocksKit.h>
#import <RestKit/RestKit.h>
#import <RestKit/RKObjectMappingOperationDataSource.h>
#import "Utility.h"
#import "CartEntry.h"
#import "SalesEntryRoom.h"
#import "SoldStock.h"
#import "Vars.h"

@implementation WebService

- (instancetype)init {
	if (self = [super init]) {
		self.apiUid = defaultAPIID;
		self.apiPassword = defaultAPIPassword;
		self.domainId = [Vars clientDomainId];
		self.accessToken = [Vars appDelegate].loginUser.cookie_string;
	}
	return self;
}

#pragma mark - Protected

- (NSString *)address {
	return [Utility perlCgiBin:@"restful"];
}

- (NSString *)name {
	return NSStringFromClass(self.class);
}

#pragma mark - Public

- (NSString *)innerXML {
	return [CocoaUtils xmlStringWithProperties:[BeanUtils describeAccessibleSimple:self]];
}

+ (NSArray *)travelerDetailsWithCartEntries:(NSArray *)cartEntries {
	NSMutableArray *array = [NSMutableArray array];
	for (CartEntry *cartEntry in cartEntries) {
		_Entry *entry = [[_Entry alloc] init];
		entry.isBusHotelPackage = cartEntry.isBusHotelPackage;
		if (cartEntry.product.product_id > 0) {
			entry.pid = cartEntry.product.product_id;
		} else if (cartEntry.product.tour_code) {
			entry.tourCode = cartEntry.product.tour_code;
		}
		NSMutableDictionary *dict = [NSMutableDictionary dictionaryWithDictionary:cartEntry.options];
		if (dict[@"roomTypeId"]) {
			[dict removeObjectForKey:@"roomType"];
		}
		[dict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
			if ([key isEqualToString:@"date"] && [obj isKindOfClass:[NSDictionary class]]) {
				dict[key] = [CocoaUtils xmlStringWithProperties:obj];
			} else if ([obj isKindOfClass:[FlightInfo class]]) {
				dict[key] = [(FlightInfo *) obj innerXML];
			}
		}];
		entry.option = [NSDictionary dictionaryWithDictionary:dict];
		if (cartEntry.rooms.count > 0) {
			NSMutableArray *array2 = [NSMutableArray array];
			for (SalesEntryRoom *salesEntryRoom in cartEntry.rooms) {
				_Room *room = [[_Room alloc] init];
				room.room_no = salesEntryRoom.room_no;
				if (salesEntryRoom.checkin_guest) {
					SoldStock *stock = salesEntryRoom.checkin_guest;
					_Passenger *passenger = [[_Passenger alloc] init];
					passenger.name = stock.sold_to_name;
					passenger.gender = stock.gender;
					passenger.type = [StringUtils capitalize:stock.people_type];
					passenger.age = stock.people_age;
					passenger.passport = stock.passport;
					room.checkInGuest = passenger;
				}
				NSMutableArray *array1 = [NSMutableArray array];
				for (SoldStock *stock in salesEntryRoom.stocks) {
					_Passenger *passenger = [[_Passenger alloc] init];
					passenger.name = stock.sold_to_name;
					passenger.gender = stock.gender;
					passenger.type = [StringUtils capitalize:stock.people_type];
					passenger.age = stock.people_age;
					passenger.passport = stock.passport;
					[array1 addObject:passenger];
				}
				room.passengers = [NSArray arrayWithArray:array1];
				[array2 addObject:room];
			}
			entry.rooms = [NSArray arrayWithArray:array2];
		} else {
			NSMutableArray *array1 = [NSMutableArray array];
			for (SoldStock *stock in cartEntry.stocks) {
				_Passenger *passenger = [[_Passenger alloc] init];
				passenger.name = stock.sold_to_name;
				passenger.gender = stock.gender;
				passenger.type = [StringUtils capitalize:stock.people_type];
				passenger.age = stock.people_age;
				passenger.passport = stock.passport;
				[array1 addObject:passenger];
			}
			entry.passengers = [NSArray arrayWithArray:array1];
		}
		[array addObject:entry];
	}
	return [NSArray arrayWithArray:array];
}

+ (NSArray *)transferredInWithCartEntry:(CartEntry *)cartEntry {
	return [WebService travelerDetailsWithCartEntries:@[cartEntry]];
}

+ (NSArray *)transferredOutWithCartEntry:(CartEntry *)cartEntry {
	_Entry *entry = [[_Entry alloc] init];
	entry.option = [NSDictionary dictionaryWithDictionary:cartEntry.options];
	if (cartEntry.rooms.count > 0) {
		NSMutableArray *array2 = [NSMutableArray array];
		for (SalesEntryRoom *salesEntryRoom in cartEntry.rooms) {
			_Room *room = [[_Room alloc] init];
			room.room_no = salesEntryRoom.room_no;
			if (salesEntryRoom.checkin_guest) {
				SoldStock *stock = salesEntryRoom.checkin_guest;
				_Passenger *passenger = [[_Passenger alloc] init];
				passenger.passengerNo = stock.stock_id;
				room.checkInGuest = passenger;
			} else {
				NSMutableArray *array1 = [NSMutableArray array];
				for (SoldStock *stock in salesEntryRoom.stocks) {
					_Passenger *passenger = [[_Passenger alloc] init];
					passenger.passengerNo = stock.stock_id;
					[array1 addObject:passenger];
				}
				room.passengers = [NSArray arrayWithArray:array1];
			}
			[array2 addObject:room];
		}
		entry.rooms = [NSArray arrayWithArray:array2];
	} else {
		NSMutableArray *array1 = [NSMutableArray array];
		for (SoldStock *stock in cartEntry.stocks) {
			_Passenger *passenger = [[_Passenger alloc] init];
			passenger.passengerNo = stock.stock_id;
			[array1 addObject:passenger];
		}
		entry.passengers = [NSArray arrayWithArray:array1];
	}
	return @[entry];
}

+ (NSArray *)transferredOutWithCartEntry:(CartEntry *)cartEntry reason:(NSInteger)reason service_fee:(CGFloat)service_fee penalty:(CGFloat)penalty {
	_Entry *entry = [[_Entry alloc] init];
	entry.reason = reason;
	entry.service_fee = service_fee;
	entry.penalty = penalty;
	if (cartEntry.rooms.count > 0) {
		NSMutableArray *array2 = [NSMutableArray array];
		for (SalesEntryRoom *salesEntryRoom in cartEntry.rooms) {
			_Room *room = [[_Room alloc] init];
			room.room_no = salesEntryRoom.room_no;
			if (salesEntryRoom.checkin_guest) {
				SoldStock *stock = salesEntryRoom.checkin_guest;
				_Passenger *passenger = [[_Passenger alloc] init];
				passenger.passengerNo = stock.stock_id;
				room.checkInGuest = passenger;
			} else {
				NSMutableArray *array1 = [NSMutableArray array];
				for (SoldStock *stock in salesEntryRoom.stocks) {
					_Passenger *passenger = [[_Passenger alloc] init];
					passenger.passengerNo = stock.stock_id;
					[array1 addObject:passenger];
				}
				room.passengers = [NSArray arrayWithArray:array1];
			}
			[array2 addObject:room];
		}
		entry.rooms = [NSArray arrayWithArray:array2];
	} else {
		NSMutableArray *array1 = [NSMutableArray array];
		for (SoldStock *stock in cartEntry.stocks) {
			_Passenger *passenger = [[_Passenger alloc] init];
			passenger.passengerNo = stock.stock_id;
			[array1 addObject:passenger];
		}
		entry.passengers = [NSArray arrayWithArray:array1];
	}
	return @[entry];
}

@end

@implementation WebServiceResponse
@end

@interface WebServiceResponseJsonMapper ()
@property (nonatomic, strong) Class class;
@end

@implementation WebServiceResponseJsonMapper

- (instancetype)init {
	return [self initWithClass:[WebServiceResponse class]];
}

- (instancetype)initWithClass:(Class)class {
	if (self = [super init]) {
		self.class = class;

		RKObjectMapping *responseMapping = [RKObjectMapping mappingForClass:self.class];
		[responseMapping addAttributeMappingsFromArray:[BeanUtils keysForAccessiblePropertyWithClass:self.class]];
		self.objectMapping = responseMapping;
	}
	return self;
}

#pragma mark - Public

- (NSError *)parseWithJSONObject:(id)jsonObject {
	self.response = [[self.class alloc] init];

	RKMappingOperation *mappingOperation = [[RKMappingOperation alloc] initWithSourceObject:jsonObject destinationObject:self.response mapping:self.objectMapping];
	RKObjectMappingOperationDataSource *mappingOperationDataSource = [[RKObjectMappingOperationDataSource alloc] init];
	mappingOperation.dataSource = mappingOperationDataSource;

	NSError *error = nil;
	[mappingOperation performMapping:&error];

	if ([jsonObject count] == 0 && error) {
		error = nil;
	}
	return error;
}

@end

@implementation GetSearchDataSource
- (instancetype)init {
	if (self = [super init]) {
		self.apiVersion = 0;
	}
	return self;
}
@end

@implementation FacebookLogin

- (instancetype)init {
	if (self = [super init]) {
		self.apiVersion = 12;
	}
	return self;
}

#pragma mark - Public

- (NSString *)innerXML {
	NSMutableString *string = [NSMutableString string];
	[string im_appendString:[CocoaUtils xmlStringWithProperties:[BeanUtils describeAccessibleSimple:self]]];
	if (self.userDetails) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[CocoaUtils xmlStringWithProperties:self.userDetails] forElement:@"userDetails"]];
	}
	return [NSString stringWithString:string];
}

@end

@implementation FacebookLoginResponse
@end

@implementation Registration

- (instancetype)init {
	if (self = [super init]) {
		self.apiVersion = 2;
	}
	return self;
}

@end

@implementation RegistrationResponse
@end

@implementation ChangePassword
@end

@implementation GetProductOptions
@end

@implementation GetProductOptionsResponsePeopleType

- (instancetype)init {
	if (self = [super init]) {
		self.ageFrom = -1;
		self.ageTo = -1;
	}
	return self;
}

@end

@implementation GetProductOptionsResponse
@end

@implementation _Passenger

- (instancetype)init {
	if (self = [super init]) {
		self.age = -1;
	}
	return self;
}

#pragma mark - Public

- (NSString *)innerXML {
	NSMutableString *string = [NSMutableString string];
	[string im_appendString:[CocoaUtils xmlStringWithNonZeroProperties:[BeanUtils describe:self keys:[ArrayUtils remove:[BeanUtils keysForAccessibleSimplePropertyWithClass:self.class] element:@"age"]]]];
	if (self.age >= 0) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[NSString stringWithFormat:@"%d", self.age] forElement:@"age"]];
	}
	if (self.option) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[CocoaUtils xmlStringWithProperties:self.option] forElement:@"option"]];
	}
	if (self.passport) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[self.passport innerXML] forElement:@"passport"]];
	}
	return [NSString stringWithString:string];
}

@end

@implementation _Room

#pragma mark - Public

- (NSString *)innerXML {
	NSMutableString *string = [NSMutableString string];
	[string im_appendString:[CocoaUtils xmlStringWithProperties:[BeanUtils describeAccessibleSimple:self]]];
	if (self.checkInGuest) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[self.checkInGuest innerXML] forElement:@"checkInGuest"]];
	}
	if (self.passengers) {
		NSMutableString *passengers_xml = [NSMutableString string];
		for (_Passenger *passenger in self.passengers) {
			[passengers_xml im_appendString:[CocoaUtils xmlStringWithValue:[passenger innerXML] forElement:@"passenger"]];
		}
		[string im_appendString:[CocoaUtils xmlStringWithValue:passengers_xml forElement:@"passengers"]];
	}
	return [NSString stringWithString:string];
}

@end

@implementation _Entry

#pragma mark - Public

- (NSString *)innerXML {
	NSMutableString *string = [NSMutableString string];
	[string im_appendString:[CocoaUtils xmlStringWithNonZeroProperties:[BeanUtils describeAccessibleSimple:self]]];
	if (self.option) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[CocoaUtils xmlStringWithProperties:self.option] forElement:@"option"]];
	}
	if (self.passengers) {
		NSMutableString *passengers_xml = [NSMutableString string];
		for (_Passenger *passenger in self.passengers) {
			[passengers_xml im_appendString:[CocoaUtils xmlStringWithValue:[passenger innerXML] forElement:@"passenger"]];
		}
		[string im_appendString:[CocoaUtils xmlStringWithValue:passengers_xml forElement:@"passengers"]];
	}
	if (self.rooms) {
		NSMutableString *rooms_xml = [NSMutableString string];
		for (_Room *room in self.rooms) {
			[rooms_xml im_appendString:[CocoaUtils xmlStringWithValue:[room innerXML] forElement:@"room"]];
		}
		[string im_appendString:[CocoaUtils xmlStringWithValue:rooms_xml forElement:@"rooms"]];
	}
	return [NSString stringWithString:string];
}

@end

@implementation _PaypalPayment

#pragma mark - Public

- (NSString *)innerXML {
	return [CocoaUtils xmlStringWithProperties:[BeanUtils describeAccessibleSimple:self]];
}

@end

@implementation _WechatpayPayment

#pragma mark - Public

- (NSString *)innerXML {
	return [CocoaUtils xmlStringWithProperties:[BeanUtils describeAccessibleSimple:self]];
}

@end

@implementation _AlipayPayment

- (NSString *)innerXML {
	return [CocoaUtils xmlStringWithProperties:[BeanUtils describeAccessibleSimple:self]];
}

@end

@implementation _UnionpayPayment

- (NSString *)innerXML {
	return [CocoaUtils xmlStringWithProperties:[BeanUtils describeAccessibleSimple:self]];
}

@end

@implementation _RefundTransaction

#pragma mark - Public

- (NSString *)innerXML {
	return [CocoaUtils xmlStringWithNonZeroProperties:[BeanUtils describeAccessibleSimple:self]];
}

@end

@implementation _PaymentInfo

#pragma mark - Public

- (NSString *)innerXML {
	NSMutableString *string = [NSMutableString string];
	[string im_appendString:[CocoaUtils xmlStringWithNonZeroProperties:[BeanUtils describeAccessibleSimple:self]]];
	if (self.payment_type == 2 && self.credit_card) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[self.credit_card innerXML] forElement:@"credit_card"]];
	} else if (self.payment_type == 14 && self.paypal_payment) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[self.paypal_payment innerXML] forElement:@"paypal_payment"]];
	} else if (self.payment_type == 19 && self.wechatpay_payment) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[self.wechatpay_payment innerXML] forElement:@"wechatpay_payment"]];
	} else if (self.payment_type == 12 && self.alipay_payment) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[self.alipay_payment innerXML] forElement:@"alipay_payment"]];
	} else if (self.payment_type == 20 && self.unionpay_payment) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[self.unionpay_payment innerXML] forElement:@"unionpay_payment"]];
	}
	if (self.refund_transactions) {
		NSMutableString *refund_transactions_xml = [NSMutableString string];
		for (_RefundTransaction *refundTransaction in self.refund_transactions) {
			[refund_transactions_xml im_appendString:[CocoaUtils xmlStringWithValue:[refundTransaction innerXML] forElement:@"refund_transaction"]];
		}
		[string im_appendString:[CocoaUtils xmlStringWithValue:refund_transactions_xml forElement:@"refund_transactions"]];
	}
	return [NSString stringWithString:string];
}

@end

@implementation CheckAvailabilityAndPrices

- (instancetype)init {
	if (self = [super init]) {
		self.apiVersion = 3;
	}
	return self;
}

#pragma mark - Public

- (NSString *)innerXML {
	NSMutableString *string = [NSMutableString string];
	[string im_appendString:[CocoaUtils xmlStringWithProperties:[BeanUtils describeAccessibleSimple:self]]];
	if (self.travelerDetails) {
		NSMutableString *travelerDetails_xml = [NSMutableString string];
		for (_Entry *entry in self.travelerDetails) {
			[travelerDetails_xml im_appendString:[CocoaUtils xmlStringWithValue:[entry innerXML] forElement:@"entry"]];
		}
		[string im_appendString:[CocoaUtils xmlStringWithValue:travelerDetails_xml forElement:@"travelerDetails"]];
	}
	if (self.contactInfo) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[self.contactInfo innerXML] forElement:@"contactInfo"]];
	}
	return [NSString stringWithString:string];
}

@end

@implementation _Coupon
@end

@implementation CheckAvailabilityAndPricesResponse

#pragma mark - Property

- (CGFloat)total_charge {
	return self.default_currency_charge;
}

- (NSString *)secondCurrencyDiscountText {
	return [Utility currencyStringFromNumber:self.second_currency_discount currencyCode:self.second_currency_code];
}

- (CGFloat)busRoundtripDiscount {
	return [self.entries bk_reduceFloat:0 withBlock:^CGFloat (CGFloat result, _Entry *obj) {
		return result + obj.roundtrip_discount;
	}];
}

- (CGFloat)busHotelPackageSaving {
	return [self.entries bk_reduceFloat:0 withBlock:^CGFloat (CGFloat result, _Entry *obj) {
		return result + obj.bus_hotel_package_saving;
	}];
}

- (NSArray *)appliedCouponCodes {
	return [[self.coupons bk_select:^BOOL (_Coupon *coupon) {
		return coupon.applied;
	}] bk_map:^NSString *(_Coupon *coupon) {
		return coupon.code_number;
	}];
}

- (NSArray *)couponErrorMessages {
	return [[self.coupons bk_select:^BOOL (_Coupon *coupon) {
		return !coupon.applied;
	}] bk_map:^NSString *(_Coupon *coupon) {
		return coupon.message;
	}];
}

#pragma mark - Public

- (NSString *)currencyTextFromNumber:(CGFloat)currencyNumber currencyCode:(NSString *)currencyCode {
	return [Utility currencyStringFromNumber:currencyNumber currencyCode:currencyCode currencyRate:self.second_currency_rate];
}

- (CGFloat)totalFareNumberWithCurrencyCode:(NSString *)currencyCode {
	if ([currencyCode isEqualToString:self.second_currency_code]) {
		return self.second_currency_charge;
	}
	return self.default_currency_charge;
}

- (NSString *)totalFareTextWithCurrencyCode:(NSString *)currencyCode {
	return [Utility currencyStringFromNumber:[self totalFareNumberWithCurrencyCode:currencyCode] currencyCode:currencyCode];
}

@end

@implementation _ETicket
@end

@implementation GetETicketsResponse
@end

@implementation CheckDuplicatedBooking

#pragma mark - Public

- (NSString *)innerXML {
	NSMutableString *string = [NSMutableString string];
	[string im_appendString:[CocoaUtils xmlStringWithProperties:[BeanUtils describeAccessibleSimple:self]]];
	if (self.travelerDetails) {
		NSMutableString *travelerDetails_xml = [NSMutableString string];
		for (_Entry *entry in self.travelerDetails) {
			[travelerDetails_xml im_appendString:[CocoaUtils xmlStringWithValue:[entry innerXML] forElement:@"entry"]];
		}
		[string im_appendString:[CocoaUtils xmlStringWithValue:travelerDetails_xml forElement:@"travelerDetails"]];
	}
	if (self.contactInfo) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[self.contactInfo innerXML] forElement:@"contactInfo"]];
	}
	return [NSString stringWithString:string];
}

@end

@implementation CheckDuplicatedBookingResponse
@end

@implementation BookGoods

- (instancetype)init {
	if (self = [super init]) {
		self.apiVersion = 2;

		self.contactInfo = [[Address alloc] init];
		self.paymentInfo = [[_PaymentInfo alloc] init];
		self.paymentInfo.credit_card = [[CreditCard alloc] init];
		self.paymentInfo.paypal_payment = [[_PaypalPayment alloc] init];
		self.paymentInfo.wechatpay_payment = [[_WechatpayPayment alloc] init];
		self.paymentInfo.alipay_payment = [[_AlipayPayment alloc] init];
		self.paymentInfo.unionpay_payment = [[_UnionpayPayment alloc] init];
	}
	return self;
}

#pragma mark - Public

- (NSString *)innerXML {
	NSMutableString *string = [NSMutableString string];
	[string im_appendString:[CocoaUtils xmlStringWithProperties:[BeanUtils describeAccessibleSimple:self]]];
	if (self.travelerDetails) {
		NSMutableString *travelerDetails_xml = [NSMutableString string];
		for (_Entry *entry in self.travelerDetails) {
			[travelerDetails_xml im_appendString:[CocoaUtils xmlStringWithValue:[entry innerXML] forElement:@"entry"]];
		}
		[string im_appendString:[CocoaUtils xmlStringWithValue:travelerDetails_xml forElement:@"travelerDetails"]];
	}
	if (self.contactInfo) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[self.contactInfo innerXML] forElement:@"contactInfo"]];
	}
	if (self.paymentInfo) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[self.paymentInfo innerXML] forElement:@"paymentInfo"]];
	}
	return [NSString stringWithString:string];
}

@end

@implementation Unifiedorder2Prepay
@end

@implementation BookGoodsResponse
@end

@implementation ExecuteReservation
@end

@implementation VerifyCreditCard
@end

@implementation VoidOrder
@end

@implementation GetPageContent
- (instancetype)init {
	if (self = [super init]) {
		self.apiVersion = 1;
	}
	return self;
}
@end

@implementation GetPageContentResponse

-(instancetype)initWithCoder:(NSCoder *)aDecoder{
	if (self = [super init]) {
		
		self.page_url = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(page_url))];
		self.page_title = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(page_title))];
		self.base_url = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(base_url))];
		self.html_string = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(html_string))];
		self.page_existed = [aDecoder decodeObjectForKey:NSStringFromSelector(@selector(page_existed))];
	}
	return  self;
}

-(void)encodeWithCoder:(NSCoder *)aCoder{
	[aCoder encodeObject:self.page_url forKey:NSStringFromSelector(@selector(page_url))];
	[aCoder encodeObject:self.page_title forKey:NSStringFromSelector(@selector(page_title))];
	[aCoder encodeObject:self.base_url forKey:NSStringFromSelector(@selector(base_url))];
	[aCoder encodeObject:self.html_string forKey:NSStringFromSelector(@selector(html_string))];
	[aCoder encodeObject:@(self.page_existed) forKey:NSStringFromSelector(@selector(page_existed))];
}
@end

@implementation UpdateAddress

#pragma mark - Public

- (NSString *)innerXML {
	NSMutableString *string = [NSMutableString string];
	[string im_appendString:[CocoaUtils xmlStringWithProperties:[BeanUtils describeAccessibleSimple:self]]];
	if (self.addressDetails) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[self.addressDetails innerXML] forElement:@"addressDetails"]];
	}
	return [NSString stringWithString:string];
}
@end

@implementation UpdateAddressResponse
@end

@implementation RemoveAddress
@end

@implementation RemoveAddressResponse
@end

@implementation UpdateCreditCard

#pragma mark - Public

- (NSString *)innerXML {
	NSMutableString *string = [NSMutableString string];
	[string im_appendString:[CocoaUtils xmlStringWithProperties:[BeanUtils describeAccessibleSimple:self]]];
	if (self.creditCardDetails) {
		[string im_appendString:[CocoaUtils xmlStringWithValue:[self.creditCardDetails innerXML] forElement:@"creditCardDetails"]];
	}
	return [NSString stringWithString:string];
}

@end

@implementation UpdateCreditCardResponse
@end

@implementation RemoveCreditCard
@end

@implementation RemoveCreditCardResponse
@end

@implementation GetOrderSummaryByOrder
@end

@implementation GetETicketByEntry
@end

@implementation GetClientPolicy
@end

@implementation GetClientPolicyResponse
@end

@implementation GetItineraryById
@end

@implementation GetItineraryByIdResponse
@end

@implementation GetTourSearchSourceResponse
+ (NSDictionary *)modelContainerPropertyGenericClass {
	return @{@"object_list" : [Area class]};
}
@end

@implementation GetsSearchDataSource
@end


@implementation GetsSearchDataSourceResponse
//+ (NSDictionary *)modelContainerPropertyGenericClass {
//	return @{@"object_list" : [Area class]};
//}
@end

