5 // Created by Mike Mayo on 12/7/10.
6 // The OpenStack project is provided under the Apache 2.0 license.
9 #import <Foundation/Foundation.h>
13 @interface Container : NSObject <NSCoding> {
15 // regular container attributes
18 unsigned long long bytes;
25 NSMutableDictionary *metadata;
27 // TODO: wade having trouble with directories without markers: user_files/12345/wade.jpg
29 // CDN container attributes
34 NSString *referrerACL;
35 NSString *useragentACL;
37 // containers don't really have a folder structure, but we're going
38 // to simulate on by parsing object names
41 // we have to use different API calls for CDN enabling for the first time
42 // vs CDN enabling later. this flag will let us know which call to use
43 BOOL hasEverBeenCDNEnabled;
46 // regular container attributes
47 @property (nonatomic, retain) NSString *name;
48 @property (nonatomic, assign) NSUInteger count;
49 @property (nonatomic, assign) unsigned long long bytes;
52 @property (nonatomic, retain) NSMutableDictionary *metadata;
55 @property (nonatomic, retain) NSString *versioning;
56 @property (nonatomic) NSUInteger quota;
58 -(NSString *)humanizedSize;
59 - (NSString *)osxStyleHumanizedSize;
61 // CDN container attributes
62 @property (nonatomic, assign) BOOL cdnEnabled;
63 @property (nonatomic, assign) NSUInteger ttl;
64 @property (nonatomic, retain) NSString *cdnURL;
65 @property (nonatomic, assign) BOOL logRetention;
66 @property (nonatomic, retain) NSString *referrerACL;
67 @property (nonatomic, retain) NSString *useragentACL;
68 @property (nonatomic, retain) Folder *rootFolder;
69 @property (nonatomic, retain) NSMutableDictionary *objectsBuffer;
71 @property (nonatomic, assign) BOOL hasEverBeenCDNEnabled;
73 + (Container *)fromJSON:(NSDictionary *)dict;
74 - (NSString *)humanizedBytes;
75 - (NSString *)osxStyleHumanizedBytes;
76 - (NSString *)humanizedCount;
77 - (NSString *)humanizedSize;