//
// PerlWS.m
// LiveProject
//
// Created by haibara on 9/18/15.
//
//

#import "PerlWS.h"
#import "Lang.h"
#import "SDK.h"
#import "CocoaUtils.h"
#import "BeanUtils.h"
#import <BlocksKit/BlocksKit.h>

@implementation PerlWS
@end

@implementation AppInfoResponse
@end

@implementation SearchSales

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

@end

@implementation FindUniqueOrder

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

@end

@implementation BookingSummary

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

@end


@implementation BookingSummaryResponse
@end

/////////////////////////////////////////////////////////////////////

@interface GetAllBusRoute ()
@property (nonatomic, assign) BOOL returnJson;
@end

@implementation GetAllBusRoute

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

@end

@implementation GetDynamicPrice
@end

@implementation GetDynamicPriceResponse
@end

@implementation GetBusVendorReviews
@end

@implementation BusVendorReviewsSummary
@end

@implementation GetBusVendorReviewsResponse
@end

@implementation GetBusOptions
@end

@implementation BookBus
@end

@implementation TrackBusStatus

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

@end

@implementation TrackBusStatusResponse
@end

@implementation GetReschedulePolicy : WebService
@end

@implementation GetReschedulePolicyResponseLabel
@end

@implementation GetReschedulePolicyResponseSection
@end

@implementation GetReschedulePolicyResponse
@end

@implementation CheckRescheduleFee

#pragma mark - Public

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

@end

@implementation CheckRescheduleFeeResponse
@end

@implementation FinishReschedule

#pragma mark - Public

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

@end

@implementation FinishRescheduleResponse
@end

@implementation PostBusVendorReview

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

@end

@implementation PostBusVendorReviewResponse
@end

@implementation RegisterSupportDevice
@end

@implementation RegisterSupportDeviceResponse
@end

@implementation GetSupportTimeClockStatus
@end

@implementation GetSupportTimeClockStatusResponse
@end

@implementation PunchSupportTimeClock
@end

@implementation PunchSupportTimeClockResponse
@end

@implementation PrefetchLoginPostData

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

#pragma mark - Public

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

@end

@implementation PrefetchLoginPostDataResponse
@end

@implementation QuickScanTicket : WebService
@end

@implementation QuickScanTicketResponse
@end

@implementation ChangeBusStatus
@end

