TestModel.h 2.78 KB
Newer Older
1 2 3 4
//
//  TestModel.h
//  Mobile Buy SDK
//
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
//  Created by Shopify.
//  Copyright (c) 2015 Shopify Inc. All rights reserved.
//
//  Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
25 26 27
//

#import <Foundation/Foundation.h>
28 29
#import <Buy/BUYObjectProtocol.h>
#import <Buy/BUYModelManagerProtocol.h>
30 31 32 33 34 35 36 37 38 39 40

@class NSManagedObjectModel;

@interface TestModelManager : NSObject<BUYModelManager>
@property (nonatomic) NSManagedObjectModel *model;
@end

@interface TestModel : NSObject<BUYObject>
@property (nonatomic, strong) TestModelManager *modelManager;
@end

41
@class Leaf, Nest, Researcher, Root;
42 43 44 45

@interface Bird : TestModel
@property (nonatomic) NSNumber *identifier;
@property (nonatomic) NSString *colour;
46
@property (nonatomic) NSSet<Nest *> *nests;
47
@property (nonatomic) NSSet<Researcher *> *researchers;
48 49 50 51 52 53 54 55 56
+ (instancetype)birdWithIdentifier:(NSNumber *)identifier;
@end

@interface Branch : TestModel
@property (nonatomic) NSArray<NSString *> *ornaments;
@property (nonatomic) NSSet<Leaf *> *leaves;
@property (nonatomic) Nest *nest;
@end

57 58 59 60
@interface Forest : TestModel
@property (nonatomic) NSSet<Root *> *trees;
@end

61
@interface Leaf : TestModel
62
@property (nonatomic) Branch *branch;
63 64 65 66 67 68 69
@property (nonatomic) NSDate *date;
@property (nonatomic) NSSet<NSString *> *tags;
@end

@interface Nest : TestModel
@property (nonatomic) NSNumber *eggCount;
@property (nonatomic) Bird *bird;
70
@property (nonatomic) Branch *branch;
71 72
@end

73 74 75 76 77
@interface Researcher : TestModel
@property (nonatomic) NSString *name;
@property (nonatomic) NSSet<Bird *> *birds;
@end

78 79 80 81 82
@interface Root : TestModel
@property (nonatomic) NSNumber *identifier;
@property (nonatomic) NSDecimalNumber *age;
@property (nonatomic) NSString *name;
@property (nonatomic) NSURL *url;
83 84
@property (nonatomic) NSSet<Branch *> *branches;
@property (nonatomic) Forest *forest;
85
@end