#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef NS_ENUM (NSInteger, AddressType) {
	AddressTypeShipping = 0,
	AddressTypeBilling,
	AddressTypeContactInfo,
};

@interface Address : NSObject <NSCopying>

@property (nonatomic, assign) NSInteger aid;
@property (nonatomic, assign) CGFloat latitude;
@property (nonatomic, assign) CGFloat longitude;
@property (nonatomic, strong) NSString *street;
@property (nonatomic, strong) NSString *street2;
@property (nonatomic, strong) NSString *city;
@property (nonatomic, strong) NSString *state;
@property (nonatomic, strong) NSString *other_state;
@property (nonatomic, strong) NSString *zipcode;
@property (nonatomic, strong) NSString *country;

@property (nonatomic, strong) NSString *first_name;
@property (nonatomic, strong) NSString *last_name;
@property (nonatomic, strong) NSString *phone;
@property (nonatomic, strong) NSString *phone2;
@property (nonatomic, strong) NSString *email;

@property (nonatomic, assign) BOOL isDefault;
@property (nonatomic, assign) BOOL transient;

@property (nonatomic, strong, readonly) NSString *fullName;
@property (nonatomic, strong, readonly) NSAttributedString *attributedEmailIfDefaultAppending;

- (instancetype)initWithType:(AddressType)type;
- (NSString *)innerXML;

+ (NSArray *)availableCountryCodes;
+ (NSArray *)availableCountryNames;
+ (NSArray *)knownStates;
+ (NSString *)preferredCountryCode;
+ (Address *)primaryOfAddresses:(NSArray *)addresses;
+ (Address *)defaultOfAddresses:(NSArray *)addresses;
+ (Address *)randomAddressWithType:(AddressType)type;

@end
