Commit d2d1cf3b by Brent Gulanowski

Add Buy Model file, new build phase, and machine-generated files.

parent b52082c0
//
// _BUYCustomer.h
// Mobile Buy SDK
//
// 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.
//
#import <Buy/_BUYCustomer.h>
@interface BUYCustomer : _BUYCustomer {}
@property (nonatomic, readonly) NSSet *addresses;
@property (readonly) NSString *fullName;
@end
@interface BUYModelManager (BUYCustomer)
- (BUYCustomer *)customerWithJSONDictionary:(NSDictionary *)json;
@end
//
// _BUYCustomer.m
// Mobile Buy SDK
//
// 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.
//
#import "BUYCustomer.h"
@implementation BUYCustomer
@synthesize addresses=_addresses;
- (NSString *)fullName
{
if (self.firstName.length > 0 || self.lastName.length > 0) {
return [NSString stringWithFormat:@"%@ %@", self.firstName, self.lastName];
}
return @"";
}
@end
@implementation BUYModelManager (BUYCustomer)
- (BUYCustomer *)customerWithJSONDictionary:(NSDictionary *)json
{
NSDictionary *customerDictionary = [json objectForKey:@"customer"];
return (id)[self buy_objectWithEntityName:[BUYCustomer entityName] JSONDictionary:customerDictionary];
}
@end
\ No newline at end of file
//
// _BUYCart.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYCart.h instead.
#import <Buy/BUYManagedObject.h>
#import "BUYModelManager.h"
extern const struct BUYCartRelationships {
__unsafe_unretained NSString *lineItems;
} BUYCartRelationships;
extern const struct BUYCartUserInfo {
__unsafe_unretained NSString *discussion;
__unsafe_unretained NSString *documentation;
__unsafe_unretained NSString *private;
} BUYCartUserInfo;
@class BUYCartLineItem;
@class BUYCart;
@interface BUYModelManager (BUYCartInserting)
- (NSArray<BUYCart *> *)allCartObjects;
- (BUYCart *)fetchCartWithIdentifierValue:(int64_t)identifier;
- (BUYCart *)insertCartWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYCart *> *)insertCartsWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
/**
* A collection of products the user intends to purchase.
*
* The BUYCart is the starting point for the Checkout API. You are responsible for building a cart, then transforming it into a BUYCheckout using the BUYDataClient. Private to app.
*/
@interface _BUYCart : BUYCachedObject
+ (NSString *)entityName;
/**
* Array of BUYCartLineItem objects in the cart
*
* These are different from BUYLineItem objects. The line item objects do include the BUYProductVariant.
*/
@property (nonatomic, strong) NSOrderedSet *lineItems;
- (NSMutableOrderedSet *)lineItemsSet;
@end
@interface _BUYCart (LineItemsCoreDataGeneratedAccessors)
- (void)insertObject:(BUYCartLineItem *)value inLineItemsAtIndex:(NSUInteger)idx;
- (void)removeObjectFromLineItemsAtIndex:(NSUInteger)idx;
- (void)insertLineItems:(NSArray *)value atIndexes:(NSIndexSet *)indexes;
- (void)removeLineItemsAtIndexes:(NSIndexSet *)indexes;
- (void)replaceObjectInLineItemsAtIndex:(NSUInteger)idx withObject:(BUYCartLineItem *)value;
- (void)replaceLineItemsAtIndexes:(NSIndexSet *)indexes withLineItems:(NSArray *)values;
@end
@interface _BUYCart (CoreDataGeneratedPrimitiveAccessors)
- (NSMutableOrderedSet *)primitiveLineItems;
- (void)setPrimitiveLineItems:(NSMutableOrderedSet *)value;
@end
//
// _BUYCart.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYCart.m instead.
#import "_BUYCart.h"
const struct BUYCartRelationships BUYCartRelationships = {
.lineItems = @"lineItems",
};
const struct BUYCartUserInfo BUYCartUserInfo = {
.discussion = @"The BUYCart is the starting point for the Checkout API. You are responsible for building a cart, then transforming it into a BUYCheckout using the BUYDataClient. Private to app.",
.documentation = @"A collection of products the user intends to purchase.",
.private = @"YES",
};
@implementation _BUYCart
+ (NSString *)entityName {
return @"Cart";
}
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
return keyPaths;
}
#if defined CORE_DATA_PERSISTENCE
#endif
#if defined CORE_DATA_PERSISTENCE
@dynamic lineItems;
#endif
- (NSMutableOrderedSet *)lineItemsSet {
[self willAccessValueForKey:@"lineItems"];
NSMutableOrderedSet *result = (NSMutableOrderedSet *)[self mutableOrderedSetValueForKey:@"lineItems"];
[self didAccessValueForKey:@"lineItems"];
return result;
}
@end
#pragma mark -
@implementation BUYModelManager (BUYCartInserting)
- (BUYCart *)insertCartWithJSONDictionary:(NSDictionary *)dictionary
{
return (BUYCart *)[self buy_objectWithEntityName:@"Cart" JSONDictionary:dictionary];
}
- (NSArray<BUYCart *> *)insertCartsWithJSONArray:(NSArray <NSDictionary *> *)array
{
return (NSArray<BUYCart *> *)[self buy_objectsWithEntityName:@"Cart" JSONArray:array];
}
- (NSArray<BUYCart *> *)allCartObjects
{
return (NSArray<BUYCart *> *)[self buy_objectsWithEntityName:@"Cart" identifiers:nil];
}
- (BUYCart *)fetchCartWithIdentifierValue:(int64_t)identifier
{
return (BUYCart *)[self buy_objectWithEntityName:@"Cart" identifier:@(identifier)];
}
@end
//
// _BUYCartLineItem.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYCartLineItem.h instead.
#import <Buy/BUYManagedObject.h>
#import "BUYModelManager.h"
extern const struct BUYCartLineItemAttributes {
__unsafe_unretained NSString *quantity;
} BUYCartLineItemAttributes;
extern const struct BUYCartLineItemRelationships {
__unsafe_unretained NSString *cart;
__unsafe_unretained NSString *variant;
} BUYCartLineItemRelationships;
extern const struct BUYCartLineItemUserInfo {
__unsafe_unretained NSString *documentation;
__unsafe_unretained NSString *private;
} BUYCartLineItemUserInfo;
@class BUYCart;
@class BUYProductVariant;
@class BUYCartLineItem;
@interface BUYModelManager (BUYCartLineItemInserting)
- (NSArray<BUYCartLineItem *> *)allCartLineItemObjects;
- (BUYCartLineItem *)fetchCartLineItemWithIdentifierValue:(int64_t)identifier;
- (BUYCartLineItem *)insertCartLineItemWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYCartLineItem *> *)insertCartLineItemsWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
/**
* A line item that references a product variant. Private to app.
*/
@interface _BUYCartLineItem : BUYCachedObject
+ (NSString *)entityName;
/**
* The quantity of the line item.
*/
@property (nonatomic, strong) NSDecimalNumber* quantity;
/**
* The inverse relationship of Cart.lineItems.
*/
@property (nonatomic, strong) BUYCart *cart;
/**
* The BUYProductVariant object associated with the line item when created using the preferred `initWithVariant:` initializer.
*/
@property (nonatomic, strong) BUYProductVariant *variant;
@end
@interface _BUYCartLineItem (CoreDataGeneratedPrimitiveAccessors)
- (NSDecimalNumber*)primitiveQuantity;
- (void)setPrimitiveQuantity:(NSDecimalNumber*)value;
- (BUYCart *)primitiveCart;
- (void)setPrimitiveCart:(BUYCart *)value;
- (BUYProductVariant *)primitiveVariant;
- (void)setPrimitiveVariant:(BUYProductVariant *)value;
@end
//
// _BUYCartLineItem.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYCartLineItem.m instead.
#import "_BUYCartLineItem.h"
const struct BUYCartLineItemAttributes BUYCartLineItemAttributes = {
.quantity = @"quantity",
};
const struct BUYCartLineItemRelationships BUYCartLineItemRelationships = {
.cart = @"cart",
.variant = @"variant",
};
const struct BUYCartLineItemUserInfo BUYCartLineItemUserInfo = {
.documentation = @"A line item that references a product variant. Private to app.",
.private = @"YES",
};
@implementation _BUYCartLineItem
+ (NSString *)entityName {
return @"CartLineItem";
}
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
return keyPaths;
}
#if defined CORE_DATA_PERSISTENCE
- (NSDecimalNumber*)quantity {
[self willAccessValueForKey:@"quantity"];
id value = [self primitiveValueForKey:@"quantity"];
[self didAccessValueForKey:@"quantity"];
return value;
}
- (void)setQuantity:(NSDecimalNumber*)value_ {
[self willChangeValueForKey:@"quantity"];
[self setPrimitiveValue:value_ forKey:@"quantity"];
[self didChangeValueForKey:@"quantity"];
}
#endif
#if defined CORE_DATA_PERSISTENCE
@dynamic cart;
#endif
#if defined CORE_DATA_PERSISTENCE
@dynamic variant;
#endif
@end
#pragma mark -
@implementation BUYModelManager (BUYCartLineItemInserting)
- (BUYCartLineItem *)insertCartLineItemWithJSONDictionary:(NSDictionary *)dictionary
{
return (BUYCartLineItem *)[self buy_objectWithEntityName:@"CartLineItem" JSONDictionary:dictionary];
}
- (NSArray<BUYCartLineItem *> *)insertCartLineItemsWithJSONArray:(NSArray <NSDictionary *> *)array
{
return (NSArray<BUYCartLineItem *> *)[self buy_objectsWithEntityName:@"CartLineItem" JSONArray:array];
}
- (NSArray<BUYCartLineItem *> *)allCartLineItemObjects
{
return (NSArray<BUYCartLineItem *> *)[self buy_objectsWithEntityName:@"CartLineItem" identifiers:nil];
}
- (BUYCartLineItem *)fetchCartLineItemWithIdentifierValue:(int64_t)identifier
{
return (BUYCartLineItem *)[self buy_objectWithEntityName:@"CartLineItem" identifier:@(identifier)];
}
@end
//
// _BUYCollection.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYCollection.h instead.
#import <Buy/BUYManagedObject.h>
#import "BUYModelManager.h"
extern const struct BUYCollectionAttributes {
__unsafe_unretained NSString *collectionId;
__unsafe_unretained NSString *createdAt;
__unsafe_unretained NSString *handle;
__unsafe_unretained NSString *htmlDescription;
__unsafe_unretained NSString *identifier;
__unsafe_unretained NSString *published;
__unsafe_unretained NSString *publishedAt;
__unsafe_unretained NSString *title;
__unsafe_unretained NSString *updatedAt;
} BUYCollectionAttributes;
extern const struct BUYCollectionRelationships {
__unsafe_unretained NSString *image;
__unsafe_unretained NSString *products;
} BUYCollectionRelationships;
extern const struct BUYCollectionUserInfo {
__unsafe_unretained NSString *documentation;
} BUYCollectionUserInfo;
@class BUYImageLink;
@class BUYProduct;
@class BUYCollection;
@interface BUYModelManager (BUYCollectionInserting)
- (NSArray<BUYCollection *> *)allCollectionObjects;
- (BUYCollection *)fetchCollectionWithIdentifierValue:(int64_t)identifier;
- (BUYCollection *)insertCollectionWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYCollection *> *)insertCollectionsWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
/**
* Represents a collection of products on the shop.
*/
@interface _BUYCollection : BUYCachedObject
+ (NSString *)entityName;
/**
* The unique collection ID in the channel.
*/
@property (nonatomic, strong) NSNumber* collectionId;
@property (atomic) int64_t collectionIdValue;
- (int64_t)collectionIdValue;
- (void)setCollectionIdValue:(int64_t)value_;
@property (nonatomic, strong) NSDate* createdAt;
/**
* The handle of the collection.
*/
@property (nonatomic, strong) NSString* handle;
/**
* The html description.
*
* Maps to "body_html" in JSON.
*/
@property (nonatomic, strong) NSString* htmlDescription;
@property (nonatomic, strong) NSNumber* identifier;
@property (atomic) int64_t identifierValue;
- (int64_t)identifierValue;
- (void)setIdentifierValue:(int64_t)value_;
/**
* The state of whether the collection is currently published or not.
*/
@property (nonatomic, strong) NSNumber* published;
@property (atomic) BOOL publishedValue;
- (BOOL)publishedValue;
- (void)setPublishedValue:(BOOL)value_;
/**
* The publish date for the collection.
*/
@property (nonatomic, strong) NSDate* publishedAt;
/**
* The title of the collection.
*/
@property (nonatomic, strong) NSString* title;
@property (nonatomic, strong) NSDate* updatedAt;
@property (nonatomic, strong) BUYImageLink *image;
/**
* Inverse of Product.collections.
*/
@property (nonatomic, strong) NSOrderedSet *products;
- (NSMutableOrderedSet *)productsSet;
@end
@interface _BUYCollection (ProductsCoreDataGeneratedAccessors)
- (void)insertObject:(BUYProduct *)value inProductsAtIndex:(NSUInteger)idx;
- (void)removeObjectFromProductsAtIndex:(NSUInteger)idx;
- (void)insertProducts:(NSArray *)value atIndexes:(NSIndexSet *)indexes;
- (void)removeProductsAtIndexes:(NSIndexSet *)indexes;
- (void)replaceObjectInProductsAtIndex:(NSUInteger)idx withObject:(BUYProduct *)value;
- (void)replaceProductsAtIndexes:(NSIndexSet *)indexes withProducts:(NSArray *)values;
@end
@interface _BUYCollection (CoreDataGeneratedPrimitiveAccessors)
- (NSNumber*)primitiveCollectionId;
- (void)setPrimitiveCollectionId:(NSNumber*)value;
- (NSDate*)primitiveCreatedAt;
- (void)setPrimitiveCreatedAt:(NSDate*)value;
- (NSString*)primitiveHandle;
- (void)setPrimitiveHandle:(NSString*)value;
- (NSString*)primitiveHtmlDescription;
- (void)setPrimitiveHtmlDescription:(NSString*)value;
- (NSNumber*)primitiveIdentifier;
- (void)setPrimitiveIdentifier:(NSNumber*)value;
- (NSNumber*)primitivePublished;
- (void)setPrimitivePublished:(NSNumber*)value;
- (NSDate*)primitivePublishedAt;
- (void)setPrimitivePublishedAt:(NSDate*)value;
- (NSString*)primitiveTitle;
- (void)setPrimitiveTitle:(NSString*)value;
- (NSDate*)primitiveUpdatedAt;
- (void)setPrimitiveUpdatedAt:(NSDate*)value;
- (BUYImageLink *)primitiveImage;
- (void)setPrimitiveImage:(BUYImageLink *)value;
- (NSMutableOrderedSet *)primitiveProducts;
- (void)setPrimitiveProducts:(NSMutableOrderedSet *)value;
@end
//
// _BUYCollection.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYCollection.m instead.
#import "_BUYCollection.h"
const struct BUYCollectionAttributes BUYCollectionAttributes = {
.collectionId = @"collectionId",
.createdAt = @"createdAt",
.handle = @"handle",
.htmlDescription = @"htmlDescription",
.identifier = @"identifier",
.published = @"published",
.publishedAt = @"publishedAt",
.title = @"title",
.updatedAt = @"updatedAt",
};
const struct BUYCollectionRelationships BUYCollectionRelationships = {
.image = @"image",
.products = @"products",
};
const struct BUYCollectionUserInfo BUYCollectionUserInfo = {
.documentation = @"Represents a collection of products on the shop.",
};
@implementation _BUYCollection
+ (NSString *)entityName {
return @"Collection";
}
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
if ([key isEqualToString:@"collectionIdValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"collectionId"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
if ([key isEqualToString:@"identifierValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"identifier"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
if ([key isEqualToString:@"publishedValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"published"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
return keyPaths;
}
#if defined CORE_DATA_PERSISTENCE
- (NSNumber*)collectionId {
[self willAccessValueForKey:@"collectionId"];
id value = [self primitiveValueForKey:@"collectionId"];
[self didAccessValueForKey:@"collectionId"];
return value;
}
- (void)setCollectionId:(NSNumber*)value_ {
[self willChangeValueForKey:@"collectionId"];
[self setPrimitiveValue:value_ forKey:@"collectionId"];
[self didChangeValueForKey:@"collectionId"];
}
- (NSDate*)createdAt {
[self willAccessValueForKey:@"createdAt"];
id value = [self primitiveValueForKey:@"createdAt"];
[self didAccessValueForKey:@"createdAt"];
return value;
}
- (void)setCreatedAt:(NSDate*)value_ {
[self willChangeValueForKey:@"createdAt"];
[self setPrimitiveValue:value_ forKey:@"createdAt"];
[self didChangeValueForKey:@"createdAt"];
}
- (NSString*)handle {
[self willAccessValueForKey:@"handle"];
id value = [self primitiveValueForKey:@"handle"];
[self didAccessValueForKey:@"handle"];
return value;
}
- (void)setHandle:(NSString*)value_ {
[self willChangeValueForKey:@"handle"];
[self setPrimitiveValue:value_ forKey:@"handle"];
[self didChangeValueForKey:@"handle"];
}
- (NSString*)htmlDescription {
[self willAccessValueForKey:@"htmlDescription"];
id value = [self primitiveValueForKey:@"htmlDescription"];
[self didAccessValueForKey:@"htmlDescription"];
return value;
}
- (void)setHtmlDescription:(NSString*)value_ {
[self willChangeValueForKey:@"htmlDescription"];
[self setPrimitiveValue:value_ forKey:@"htmlDescription"];
[self didChangeValueForKey:@"htmlDescription"];
}
- (NSNumber*)identifier {
[self willAccessValueForKey:@"identifier"];
id value = [self primitiveValueForKey:@"identifier"];
[self didAccessValueForKey:@"identifier"];
return value;
}
- (void)setIdentifier:(NSNumber*)value_ {
[self willChangeValueForKey:@"identifier"];
[self setPrimitiveValue:value_ forKey:@"identifier"];
[self didChangeValueForKey:@"identifier"];
}
- (NSNumber*)published {
[self willAccessValueForKey:@"published"];
id value = [self primitiveValueForKey:@"published"];
[self didAccessValueForKey:@"published"];
return value;
}
- (void)setPublished:(NSNumber*)value_ {
[self willChangeValueForKey:@"published"];
[self setPrimitiveValue:value_ forKey:@"published"];
[self didChangeValueForKey:@"published"];
}
- (NSDate*)publishedAt {
[self willAccessValueForKey:@"publishedAt"];
id value = [self primitiveValueForKey:@"publishedAt"];
[self didAccessValueForKey:@"publishedAt"];
return value;
}
- (void)setPublishedAt:(NSDate*)value_ {
[self willChangeValueForKey:@"publishedAt"];
[self setPrimitiveValue:value_ forKey:@"publishedAt"];
[self didChangeValueForKey:@"publishedAt"];
}
- (NSString*)title {
[self willAccessValueForKey:@"title"];
id value = [self primitiveValueForKey:@"title"];
[self didAccessValueForKey:@"title"];
return value;
}
- (void)setTitle:(NSString*)value_ {
[self willChangeValueForKey:@"title"];
[self setPrimitiveValue:value_ forKey:@"title"];
[self didChangeValueForKey:@"title"];
}
- (NSDate*)updatedAt {
[self willAccessValueForKey:@"updatedAt"];
id value = [self primitiveValueForKey:@"updatedAt"];
[self didAccessValueForKey:@"updatedAt"];
return value;
}
- (void)setUpdatedAt:(NSDate*)value_ {
[self willChangeValueForKey:@"updatedAt"];
[self setPrimitiveValue:value_ forKey:@"updatedAt"];
[self didChangeValueForKey:@"updatedAt"];
}
#endif
- (int64_t)collectionIdValue {
NSNumber *result = [self collectionId];
return [result longLongValue];
}
- (void)setCollectionIdValue:(int64_t)value_ {
[self setCollectionId:@(value_)];
}
- (int64_t)identifierValue {
NSNumber *result = [self identifier];
return [result longLongValue];
}
- (void)setIdentifierValue:(int64_t)value_ {
[self setIdentifier:@(value_)];
}
- (BOOL)publishedValue {
NSNumber *result = [self published];
return [result boolValue];
}
- (void)setPublishedValue:(BOOL)value_ {
[self setPublished:@(value_)];
}
#if defined CORE_DATA_PERSISTENCE
@dynamic image;
#endif
#if defined CORE_DATA_PERSISTENCE
@dynamic products;
#endif
- (NSMutableOrderedSet *)productsSet {
[self willAccessValueForKey:@"products"];
NSMutableOrderedSet *result = (NSMutableOrderedSet *)[self mutableOrderedSetValueForKey:@"products"];
[self didAccessValueForKey:@"products"];
return result;
}
@end
#pragma mark -
@implementation BUYModelManager (BUYCollectionInserting)
- (BUYCollection *)insertCollectionWithJSONDictionary:(NSDictionary *)dictionary
{
return (BUYCollection *)[self buy_objectWithEntityName:@"Collection" JSONDictionary:dictionary];
}
- (NSArray<BUYCollection *> *)insertCollectionsWithJSONArray:(NSArray <NSDictionary *> *)array
{
return (NSArray<BUYCollection *> *)[self buy_objectsWithEntityName:@"Collection" JSONArray:array];
}
- (NSArray<BUYCollection *> *)allCollectionObjects
{
return (NSArray<BUYCollection *> *)[self buy_objectsWithEntityName:@"Collection" identifiers:nil];
}
- (BUYCollection *)fetchCollectionWithIdentifierValue:(int64_t)identifier
{
return (BUYCollection *)[self buy_objectWithEntityName:@"Collection" identifier:@(identifier)];
}
@end
//
// _BUYCustomer.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYCustomer.h instead.
#import <Buy/BUYManagedObject.h>
#import "BUYModelManager.h"
extern const struct BUYCustomerAttributes {
__unsafe_unretained NSString *acceptsMarketing;
__unsafe_unretained NSString *createdAt;
__unsafe_unretained NSString *customerState;
__unsafe_unretained NSString *email;
__unsafe_unretained NSString *firstName;
__unsafe_unretained NSString *identifier;
__unsafe_unretained NSString *lastName;
__unsafe_unretained NSString *lastOrderID;
__unsafe_unretained NSString *lastOrderName;
__unsafe_unretained NSString *multipassIdentifier;
__unsafe_unretained NSString *note;
__unsafe_unretained NSString *ordersCount;
__unsafe_unretained NSString *tags;
__unsafe_unretained NSString *taxExempt;
__unsafe_unretained NSString *totalSpent;
__unsafe_unretained NSString *updatedAt;
__unsafe_unretained NSString *verifiedEmail;
} BUYCustomerAttributes;
@class BUYCustomer;
@interface BUYModelManager (BUYCustomerInserting)
- (NSArray<BUYCustomer *> *)allCustomerObjects;
- (BUYCustomer *)fetchCustomerWithIdentifierValue:(int64_t)identifier;
- (BUYCustomer *)insertCustomerWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYCustomer *> *)insertCustomersWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
@interface _BUYCustomer : BUYCachedObject
+ (NSString *)entityName;
@property (nonatomic, strong) NSNumber* acceptsMarketing;
@property (atomic) BOOL acceptsMarketingValue;
- (BOOL)acceptsMarketingValue;
- (void)setAcceptsMarketingValue:(BOOL)value_;
@property (nonatomic, strong) NSDate* createdAt;
@property (nonatomic, strong) NSNumber* customerState;
@property (atomic) BOOL customerStateValue;
- (BOOL)customerStateValue;
- (void)setCustomerStateValue:(BOOL)value_;
@property (nonatomic, strong) NSString* email;
@property (nonatomic, strong) NSString* firstName;
@property (nonatomic, strong) NSNumber* identifier;
@property (atomic) int64_t identifierValue;
- (int64_t)identifierValue;
- (void)setIdentifierValue:(int64_t)value_;
@property (nonatomic, strong) NSString* lastName;
@property (nonatomic, strong) NSNumber* lastOrderID;
@property (atomic) int64_t lastOrderIDValue;
- (int64_t)lastOrderIDValue;
- (void)setLastOrderIDValue:(int64_t)value_;
@property (nonatomic, strong) NSString* lastOrderName;
@property (nonatomic, strong) NSString* multipassIdentifier;
@property (nonatomic, strong) NSString* note;
@property (nonatomic, strong) NSNumber* ordersCount;
@property (atomic) int16_t ordersCountValue;
- (int16_t)ordersCountValue;
- (void)setOrdersCountValue:(int16_t)value_;
@property (nonatomic, strong) NSString* tags;
@property (nonatomic, strong) NSNumber* taxExempt;
@property (atomic) BOOL taxExemptValue;
- (BOOL)taxExemptValue;
- (void)setTaxExemptValue:(BOOL)value_;
@property (nonatomic, strong) NSDecimalNumber* totalSpent;
@property (nonatomic, strong) NSDate* updatedAt;
@property (nonatomic, strong) NSNumber* verifiedEmail;
@property (atomic) BOOL verifiedEmailValue;
- (BOOL)verifiedEmailValue;
- (void)setVerifiedEmailValue:(BOOL)value_;
@end
@interface _BUYCustomer (CoreDataGeneratedPrimitiveAccessors)
- (NSNumber*)primitiveAcceptsMarketing;
- (void)setPrimitiveAcceptsMarketing:(NSNumber*)value;
- (NSDate*)primitiveCreatedAt;
- (void)setPrimitiveCreatedAt:(NSDate*)value;
- (NSNumber*)primitiveCustomerState;
- (void)setPrimitiveCustomerState:(NSNumber*)value;
- (NSString*)primitiveEmail;
- (void)setPrimitiveEmail:(NSString*)value;
- (NSString*)primitiveFirstName;
- (void)setPrimitiveFirstName:(NSString*)value;
- (NSNumber*)primitiveIdentifier;
- (void)setPrimitiveIdentifier:(NSNumber*)value;
- (NSString*)primitiveLastName;
- (void)setPrimitiveLastName:(NSString*)value;
- (NSNumber*)primitiveLastOrderID;
- (void)setPrimitiveLastOrderID:(NSNumber*)value;
- (NSString*)primitiveLastOrderName;
- (void)setPrimitiveLastOrderName:(NSString*)value;
- (NSString*)primitiveMultipassIdentifier;
- (void)setPrimitiveMultipassIdentifier:(NSString*)value;
- (NSString*)primitiveNote;
- (void)setPrimitiveNote:(NSString*)value;
- (NSNumber*)primitiveOrdersCount;
- (void)setPrimitiveOrdersCount:(NSNumber*)value;
- (NSString*)primitiveTags;
- (void)setPrimitiveTags:(NSString*)value;
- (NSNumber*)primitiveTaxExempt;
- (void)setPrimitiveTaxExempt:(NSNumber*)value;
- (NSDecimalNumber*)primitiveTotalSpent;
- (void)setPrimitiveTotalSpent:(NSDecimalNumber*)value;
- (NSDate*)primitiveUpdatedAt;
- (void)setPrimitiveUpdatedAt:(NSDate*)value;
- (NSNumber*)primitiveVerifiedEmail;
- (void)setPrimitiveVerifiedEmail:(NSNumber*)value;
@end
//
// _BUYImageLink.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYImageLink.h instead.
#import <Buy/BUYManagedObject.h>
#import "BUYModelManager.h"
extern const struct BUYImageLinkAttributes {
__unsafe_unretained NSString *createdAt;
__unsafe_unretained NSString *identifier;
__unsafe_unretained NSString *position;
__unsafe_unretained NSString *sourceURL;
__unsafe_unretained NSString *updatedAt;
__unsafe_unretained NSString *variantIds;
} BUYImageLinkAttributes;
extern const struct BUYImageLinkRelationships {
__unsafe_unretained NSString *collection;
__unsafe_unretained NSString *product;
} BUYImageLinkRelationships;
extern const struct BUYImageLinkUserInfo {
__unsafe_unretained NSString *documentation;
} BUYImageLinkUserInfo;
@class BUYCollection;
@class BUYProduct;
@class NSURL;
@class NSArray;
@class BUYImageLink;
@interface BUYModelManager (BUYImageLinkInserting)
- (NSArray<BUYImageLink *> *)allImageLinkObjects;
- (BUYImageLink *)fetchImageLinkWithIdentifierValue:(int64_t)identifier;
- (BUYImageLink *)insertImageLinkWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYImageLink *> *)insertImageLinksWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
/**
* A link to an image representing a product or collection.
*/
@interface _BUYImageLink : BUYCachedObject
+ (NSString *)entityName;
@property (nonatomic, strong) NSDate* createdAt;
@property (nonatomic, strong) NSNumber* identifier;
@property (atomic) int64_t identifierValue;
- (int64_t)identifierValue;
- (void)setIdentifierValue:(int64_t)value_;
/**
* The position of the image for the product.
*/
@property (nonatomic, strong) NSNumber* position;
@property (atomic) int32_t positionValue;
- (int32_t)positionValue;
- (void)setPositionValue:(int32_t)value_;
/**
* Specifies the location of the product image.
*
* Maps to "src" in JSON.
*/
@property (nonatomic, strong) NSURL* sourceURL;
@property (nonatomic, strong) NSDate* updatedAt;
@property (nonatomic, strong) NSArray* variantIds;
@property (nonatomic, strong) BUYCollection *collection;
/**
* Inverse of Product.images.
*
* Maps to "product_id" in JSON.
*/
@property (nonatomic, strong) BUYProduct *product;
@end
@interface _BUYImageLink (CoreDataGeneratedPrimitiveAccessors)
- (NSDate*)primitiveCreatedAt;
- (void)setPrimitiveCreatedAt:(NSDate*)value;
- (NSNumber*)primitiveIdentifier;
- (void)setPrimitiveIdentifier:(NSNumber*)value;
- (NSNumber*)primitivePosition;
- (void)setPrimitivePosition:(NSNumber*)value;
- (NSURL*)primitiveSourceURL;
- (void)setPrimitiveSourceURL:(NSURL*)value;
- (NSDate*)primitiveUpdatedAt;
- (void)setPrimitiveUpdatedAt:(NSDate*)value;
- (NSArray*)primitiveVariantIds;
- (void)setPrimitiveVariantIds:(NSArray*)value;
- (BUYCollection *)primitiveCollection;
- (void)setPrimitiveCollection:(BUYCollection *)value;
- (BUYProduct *)primitiveProduct;
- (void)setPrimitiveProduct:(BUYProduct *)value;
@end
//
// _BUYImageLink.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYImageLink.m instead.
#import "_BUYImageLink.h"
const struct BUYImageLinkAttributes BUYImageLinkAttributes = {
.createdAt = @"createdAt",
.identifier = @"identifier",
.position = @"position",
.sourceURL = @"sourceURL",
.updatedAt = @"updatedAt",
.variantIds = @"variantIds",
};
const struct BUYImageLinkRelationships BUYImageLinkRelationships = {
.collection = @"collection",
.product = @"product",
};
const struct BUYImageLinkUserInfo BUYImageLinkUserInfo = {
.documentation = @"A link to an image representing a product or collection.",
};
@implementation _BUYImageLink
+ (NSString *)entityName {
return @"ImageLink";
}
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
if ([key isEqualToString:@"identifierValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"identifier"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
if ([key isEqualToString:@"positionValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"position"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
return keyPaths;
}
#if defined CORE_DATA_PERSISTENCE
- (NSDate*)createdAt {
[self willAccessValueForKey:@"createdAt"];
id value = [self primitiveValueForKey:@"createdAt"];
[self didAccessValueForKey:@"createdAt"];
return value;
}
- (void)setCreatedAt:(NSDate*)value_ {
[self willChangeValueForKey:@"createdAt"];
[self setPrimitiveValue:value_ forKey:@"createdAt"];
[self didChangeValueForKey:@"createdAt"];
}
- (NSNumber*)identifier {
[self willAccessValueForKey:@"identifier"];
id value = [self primitiveValueForKey:@"identifier"];
[self didAccessValueForKey:@"identifier"];
return value;
}
- (void)setIdentifier:(NSNumber*)value_ {
[self willChangeValueForKey:@"identifier"];
[self setPrimitiveValue:value_ forKey:@"identifier"];
[self didChangeValueForKey:@"identifier"];
}
- (NSNumber*)position {
[self willAccessValueForKey:@"position"];
id value = [self primitiveValueForKey:@"position"];
[self didAccessValueForKey:@"position"];
return value;
}
- (void)setPosition:(NSNumber*)value_ {
[self willChangeValueForKey:@"position"];
[self setPrimitiveValue:value_ forKey:@"position"];
[self didChangeValueForKey:@"position"];
}
- (NSURL*)sourceURL {
[self willAccessValueForKey:@"sourceURL"];
id value = [self primitiveValueForKey:@"sourceURL"];
[self didAccessValueForKey:@"sourceURL"];
return value;
}
- (void)setSourceURL:(NSURL*)value_ {
[self willChangeValueForKey:@"sourceURL"];
[self setPrimitiveValue:value_ forKey:@"sourceURL"];
[self didChangeValueForKey:@"sourceURL"];
}
- (NSDate*)updatedAt {
[self willAccessValueForKey:@"updatedAt"];
id value = [self primitiveValueForKey:@"updatedAt"];
[self didAccessValueForKey:@"updatedAt"];
return value;
}
- (void)setUpdatedAt:(NSDate*)value_ {
[self willChangeValueForKey:@"updatedAt"];
[self setPrimitiveValue:value_ forKey:@"updatedAt"];
[self didChangeValueForKey:@"updatedAt"];
}
- (NSArray*)variantIds {
[self willAccessValueForKey:@"variantIds"];
id value = [self primitiveValueForKey:@"variantIds"];
[self didAccessValueForKey:@"variantIds"];
return value;
}
- (void)setVariantIds:(NSArray*)value_ {
[self willChangeValueForKey:@"variantIds"];
[self setPrimitiveValue:value_ forKey:@"variantIds"];
[self didChangeValueForKey:@"variantIds"];
}
#endif
- (int64_t)identifierValue {
NSNumber *result = [self identifier];
return [result longLongValue];
}
- (void)setIdentifierValue:(int64_t)value_ {
[self setIdentifier:@(value_)];
}
- (int32_t)positionValue {
NSNumber *result = [self position];
return [result intValue];
}
- (void)setPositionValue:(int32_t)value_ {
[self setPosition:@(value_)];
}
#if defined CORE_DATA_PERSISTENCE
@dynamic collection;
#endif
#if defined CORE_DATA_PERSISTENCE
@dynamic product;
#endif
@end
#pragma mark -
@implementation BUYModelManager (BUYImageLinkInserting)
- (BUYImageLink *)insertImageLinkWithJSONDictionary:(NSDictionary *)dictionary
{
return (BUYImageLink *)[self buy_objectWithEntityName:@"ImageLink" JSONDictionary:dictionary];
}
- (NSArray<BUYImageLink *> *)insertImageLinksWithJSONArray:(NSArray <NSDictionary *> *)array
{
return (NSArray<BUYImageLink *> *)[self buy_objectsWithEntityName:@"ImageLink" JSONArray:array];
}
- (NSArray<BUYImageLink *> *)allImageLinkObjects
{
return (NSArray<BUYImageLink *> *)[self buy_objectsWithEntityName:@"ImageLink" identifiers:nil];
}
- (BUYImageLink *)fetchImageLinkWithIdentifierValue:(int64_t)identifier
{
return (BUYImageLink *)[self buy_objectWithEntityName:@"ImageLink" identifier:@(identifier)];
}
@end
//
// _BUYLineItem.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYLineItem.h instead.
#import <Buy/BUYManagedObject.h>
#import "BUYModelManager.h"
extern const struct BUYLineItemAttributes {
__unsafe_unretained NSString *compareAtPrice;
__unsafe_unretained NSString *fulfilled;
__unsafe_unretained NSString *fulfillmentService;
__unsafe_unretained NSString *grams;
__unsafe_unretained NSString *identifier;
__unsafe_unretained NSString *linePrice;
__unsafe_unretained NSString *price;
__unsafe_unretained NSString *productId;
__unsafe_unretained NSString *properties;
__unsafe_unretained NSString *quantity;
__unsafe_unretained NSString *requiresShipping;
__unsafe_unretained NSString *sku;
__unsafe_unretained NSString *taxable;
__unsafe_unretained NSString *title;
__unsafe_unretained NSString *variantId;
__unsafe_unretained NSString *variantTitle;
} BUYLineItemAttributes;
extern const struct BUYLineItemRelationships {
__unsafe_unretained NSString *checkout;
__unsafe_unretained NSString *order;
} BUYLineItemRelationships;
extern const struct BUYLineItemUserInfo {
__unsafe_unretained NSString *documentation;
} BUYLineItemUserInfo;
@class BUYCheckout;
@class BUYOrder;
@class NSDictionary;
@class BUYLineItem;
@interface BUYModelManager (BUYLineItemInserting)
- (NSArray<BUYLineItem *> *)allLineItemObjects;
- (BUYLineItem *)fetchLineItemWithIdentifierValue:(int64_t)identifier;
- (BUYLineItem *)insertLineItemWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYLineItem *> *)insertLineItemsWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
/**
* This represents a BUYLineItem on a BUYCart or on a BUYCheckout.
*/
@interface _BUYLineItem : BUYCachedObject
+ (NSString *)entityName;
/**
* The competitor's prices for the same item.
*/
@property (nonatomic, strong) NSDecimalNumber* compareAtPrice;
@property (nonatomic, strong) NSNumber* fulfilled;
@property (atomic) BOOL fulfilledValue;
- (BOOL)fulfilledValue;
- (void)setFulfilledValue:(BOOL)value_;
/**
* Service provider who is doing the fulfillment.
*/
@property (nonatomic, strong) NSString* fulfillmentService;
/**
* The weight of the BUYProductVariant in grams.
*/
@property (nonatomic, strong) NSDecimalNumber* grams;
@property (nonatomic, strong) NSString* identifier;
/**
* The line price of the item (price * quantity).
*/
@property (nonatomic, strong) NSDecimalNumber* linePrice;
/**
* The price of the BUYLineItem.
*
* This price does not need to match the product variant.
*/
@property (nonatomic, strong) NSDecimalNumber* price;
@property (nonatomic, strong) NSNumber* productId;
@property (atomic) int64_t productIdValue;
- (int64_t)productIdValue;
- (void)setProductIdValue:(int64_t)value_;
/**
* Custom properties set on the line item.
*/
@property (nonatomic, strong) NSDictionary* properties;
/**
* The quantity of the BUYLineItem.
*/
@property (nonatomic, strong) NSDecimalNumber* quantity;
/**
* Whether this BUYLineItem requires shipping.
*
* This needs to match the product variant.
*/
@property (nonatomic, strong) NSNumber* requiresShipping;
@property (atomic) BOOL requiresShippingValue;
- (BOOL)requiresShippingValue;
- (void)setRequiresShippingValue:(BOOL)value_;
/**
* The unique SKU for the line item.
*/
@property (nonatomic, strong) NSString* sku;
/**
* Whether the line item is taxable.
*/
@property (nonatomic, strong) NSNumber* taxable;
@property (atomic) BOOL taxableValue;
- (BOOL)taxableValue;
- (void)setTaxableValue:(BOOL)value_;
/**
* The title of the BUYLineItem.
*
* The title does not need to match the product variant.
*/
@property (nonatomic, strong) NSString* title;
/**
* BUYProductVariant identifer.
*
* Keep a reference to a cart or products if you wish to display information for product variants in a BUYCheckout.
*/
@property (nonatomic, strong) NSNumber* variantId;
@property (atomic) int64_t variantIdValue;
- (int64_t)variantIdValue;
- (void)setVariantIdValue:(int64_t)value_;
/**
* The title for the variant in the line item.
*/
@property (nonatomic, strong) NSString* variantTitle;
/**
* Inverse of Checkout.lineItem.
*/
@property (nonatomic, strong) BUYCheckout *checkout;
@property (nonatomic, strong) BUYOrder *order;
@end
@interface _BUYLineItem (CoreDataGeneratedPrimitiveAccessors)
- (NSDecimalNumber*)primitiveCompareAtPrice;
- (void)setPrimitiveCompareAtPrice:(NSDecimalNumber*)value;
- (NSNumber*)primitiveFulfilled;
- (void)setPrimitiveFulfilled:(NSNumber*)value;
- (NSString*)primitiveFulfillmentService;
- (void)setPrimitiveFulfillmentService:(NSString*)value;
- (NSDecimalNumber*)primitiveGrams;
- (void)setPrimitiveGrams:(NSDecimalNumber*)value;
- (NSString*)primitiveIdentifier;
- (void)setPrimitiveIdentifier:(NSString*)value;
- (NSDecimalNumber*)primitiveLinePrice;
- (void)setPrimitiveLinePrice:(NSDecimalNumber*)value;
- (NSDecimalNumber*)primitivePrice;
- (void)setPrimitivePrice:(NSDecimalNumber*)value;
- (NSNumber*)primitiveProductId;
- (void)setPrimitiveProductId:(NSNumber*)value;
- (NSDictionary*)primitiveProperties;
- (void)setPrimitiveProperties:(NSDictionary*)value;
- (NSDecimalNumber*)primitiveQuantity;
- (void)setPrimitiveQuantity:(NSDecimalNumber*)value;
- (NSNumber*)primitiveRequiresShipping;
- (void)setPrimitiveRequiresShipping:(NSNumber*)value;
- (NSString*)primitiveSku;
- (void)setPrimitiveSku:(NSString*)value;
- (NSNumber*)primitiveTaxable;
- (void)setPrimitiveTaxable:(NSNumber*)value;
- (NSString*)primitiveTitle;
- (void)setPrimitiveTitle:(NSString*)value;
- (NSNumber*)primitiveVariantId;
- (void)setPrimitiveVariantId:(NSNumber*)value;
- (NSString*)primitiveVariantTitle;
- (void)setPrimitiveVariantTitle:(NSString*)value;
- (BUYCheckout *)primitiveCheckout;
- (void)setPrimitiveCheckout:(BUYCheckout *)value;
- (BUYOrder *)primitiveOrder;
- (void)setPrimitiveOrder:(BUYOrder *)value;
@end
//
// _BUYOption.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYOption.h instead.
#import <Buy/BUYManagedObject.h>
#import "BUYModelManager.h"
extern const struct BUYOptionAttributes {
__unsafe_unretained NSString *identifier;
__unsafe_unretained NSString *name;
__unsafe_unretained NSString *position;
} BUYOptionAttributes;
extern const struct BUYOptionRelationships {
__unsafe_unretained NSString *product;
} BUYOptionRelationships;
extern const struct BUYOptionUserInfo {
__unsafe_unretained NSString *documentation;
} BUYOptionUserInfo;
@class BUYProduct;
@class BUYOption;
@interface BUYModelManager (BUYOptionInserting)
- (NSArray<BUYOption *> *)allOptionObjects;
- (BUYOption *)fetchOptionWithIdentifierValue:(int64_t)identifier;
- (BUYOption *)insertOptionWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYOption *> *)insertOptionsWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
/**
* The associated product for this option.
*/
@interface _BUYOption : BUYCachedObject
+ (NSString *)entityName;
@property (nonatomic, strong) NSNumber* identifier;
@property (atomic) int64_t identifierValue;
- (int64_t)identifierValue;
- (void)setIdentifierValue:(int64_t)value_;
/**
* Custom product property names like "Size", "Color", and "Material".
*
* 255 characters limit each.
*/
@property (nonatomic, strong) NSString* name;
/**
* The order in which the option should optionally appear.
*/
@property (nonatomic, strong) NSNumber* position;
@property (atomic) int32_t positionValue;
- (int32_t)positionValue;
- (void)setPositionValue:(int32_t)value_;
/**
* Inverse of Product.options.
*/
@property (nonatomic, strong) BUYProduct *product;
@end
@interface _BUYOption (CoreDataGeneratedPrimitiveAccessors)
- (NSNumber*)primitiveIdentifier;
- (void)setPrimitiveIdentifier:(NSNumber*)value;
- (NSString*)primitiveName;
- (void)setPrimitiveName:(NSString*)value;
- (NSNumber*)primitivePosition;
- (void)setPrimitivePosition:(NSNumber*)value;
- (BUYProduct *)primitiveProduct;
- (void)setPrimitiveProduct:(BUYProduct *)value;
@end
//
// _BUYOption.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYOption.m instead.
#import "_BUYOption.h"
const struct BUYOptionAttributes BUYOptionAttributes = {
.identifier = @"identifier",
.name = @"name",
.position = @"position",
};
const struct BUYOptionRelationships BUYOptionRelationships = {
.product = @"product",
};
const struct BUYOptionUserInfo BUYOptionUserInfo = {
.documentation = @"The associated product for this option.",
};
@implementation _BUYOption
+ (NSString *)entityName {
return @"Option";
}
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
if ([key isEqualToString:@"identifierValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"identifier"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
if ([key isEqualToString:@"positionValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"position"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
return keyPaths;
}
#if defined CORE_DATA_PERSISTENCE
- (NSNumber*)identifier {
[self willAccessValueForKey:@"identifier"];
id value = [self primitiveValueForKey:@"identifier"];
[self didAccessValueForKey:@"identifier"];
return value;
}
- (void)setIdentifier:(NSNumber*)value_ {
[self willChangeValueForKey:@"identifier"];
[self setPrimitiveValue:value_ forKey:@"identifier"];
[self didChangeValueForKey:@"identifier"];
}
- (NSString*)name {
[self willAccessValueForKey:@"name"];
id value = [self primitiveValueForKey:@"name"];
[self didAccessValueForKey:@"name"];
return value;
}
- (void)setName:(NSString*)value_ {
[self willChangeValueForKey:@"name"];
[self setPrimitiveValue:value_ forKey:@"name"];
[self didChangeValueForKey:@"name"];
}
- (NSNumber*)position {
[self willAccessValueForKey:@"position"];
id value = [self primitiveValueForKey:@"position"];
[self didAccessValueForKey:@"position"];
return value;
}
- (void)setPosition:(NSNumber*)value_ {
[self willChangeValueForKey:@"position"];
[self setPrimitiveValue:value_ forKey:@"position"];
[self didChangeValueForKey:@"position"];
}
#endif
- (int64_t)identifierValue {
NSNumber *result = [self identifier];
return [result longLongValue];
}
- (void)setIdentifierValue:(int64_t)value_ {
[self setIdentifier:@(value_)];
}
- (int32_t)positionValue {
NSNumber *result = [self position];
return [result intValue];
}
- (void)setPositionValue:(int32_t)value_ {
[self setPosition:@(value_)];
}
#if defined CORE_DATA_PERSISTENCE
@dynamic product;
#endif
@end
#pragma mark -
@implementation BUYModelManager (BUYOptionInserting)
- (BUYOption *)insertOptionWithJSONDictionary:(NSDictionary *)dictionary
{
return (BUYOption *)[self buy_objectWithEntityName:@"Option" JSONDictionary:dictionary];
}
- (NSArray<BUYOption *> *)insertOptionsWithJSONArray:(NSArray <NSDictionary *> *)array
{
return (NSArray<BUYOption *> *)[self buy_objectsWithEntityName:@"Option" JSONArray:array];
}
- (NSArray<BUYOption *> *)allOptionObjects
{
return (NSArray<BUYOption *> *)[self buy_objectsWithEntityName:@"Option" identifiers:nil];
}
- (BUYOption *)fetchOptionWithIdentifierValue:(int64_t)identifier
{
return (BUYOption *)[self buy_objectWithEntityName:@"Option" identifier:@(identifier)];
}
@end
//
// _BUYOptionValue.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYOptionValue.h instead.
#import <Buy/BUYManagedObject.h>
#import "BUYModelManager.h"
extern const struct BUYOptionValueAttributes {
__unsafe_unretained NSString *name;
__unsafe_unretained NSString *optionId;
__unsafe_unretained NSString *value;
} BUYOptionValueAttributes;
extern const struct BUYOptionValueRelationships {
__unsafe_unretained NSString *variants;
} BUYOptionValueRelationships;
@class BUYProductVariant;
@class BUYOptionValue;
@interface BUYModelManager (BUYOptionValueInserting)
- (NSArray<BUYOptionValue *> *)allOptionValueObjects;
- (BUYOptionValue *)fetchOptionValueWithIdentifierValue:(int64_t)identifier;
- (BUYOptionValue *)insertOptionValueWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYOptionValue *> *)insertOptionValuesWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
@interface _BUYOptionValue : BUYCachedObject
+ (NSString *)entityName;
/**
* Custom product property names like "Size", "Color", and "Material".
*
* The same as the name of the owning option. 255 characters max.
*/
@property (nonatomic, strong) NSString* name;
@property (nonatomic, strong) NSNumber* optionId;
@property (atomic) int64_t optionIdValue;
- (int64_t)optionIdValue;
- (void)setOptionIdValue:(int64_t)value_;
/**
* The value of the option.
*
* For example, "Small", "Medium" or "Large".
*/
@property (nonatomic, strong) NSString* value;
/**
* Inverse of ProductVariant.optionValue.
*/
@property (nonatomic, strong) NSSet *variants;
- (NSMutableSet *)variantsSet;
@end
@interface _BUYOptionValue (VariantsCoreDataGeneratedAccessors)
@end
@interface _BUYOptionValue (CoreDataGeneratedPrimitiveAccessors)
- (NSString*)primitiveName;
- (void)setPrimitiveName:(NSString*)value;
- (NSNumber*)primitiveOptionId;
- (void)setPrimitiveOptionId:(NSNumber*)value;
- (NSString*)primitiveValue;
- (void)setPrimitiveValue:(NSString*)value;
- (NSMutableSet *)primitiveVariants;
- (void)setPrimitiveVariants:(NSMutableSet *)value;
@end
//
// _BUYOptionValue.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYOptionValue.m instead.
#import "_BUYOptionValue.h"
const struct BUYOptionValueAttributes BUYOptionValueAttributes = {
.name = @"name",
.optionId = @"optionId",
.value = @"value",
};
const struct BUYOptionValueRelationships BUYOptionValueRelationships = {
.variants = @"variants",
};
@implementation _BUYOptionValue
+ (NSString *)entityName {
return @"OptionValue";
}
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
if ([key isEqualToString:@"optionIdValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"optionId"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
return keyPaths;
}
#if defined CORE_DATA_PERSISTENCE
- (NSString*)name {
[self willAccessValueForKey:@"name"];
id value = [self primitiveValueForKey:@"name"];
[self didAccessValueForKey:@"name"];
return value;
}
- (void)setName:(NSString*)value_ {
[self willChangeValueForKey:@"name"];
[self setPrimitiveValue:value_ forKey:@"name"];
[self didChangeValueForKey:@"name"];
}
- (NSNumber*)optionId {
[self willAccessValueForKey:@"optionId"];
id value = [self primitiveValueForKey:@"optionId"];
[self didAccessValueForKey:@"optionId"];
return value;
}
- (void)setOptionId:(NSNumber*)value_ {
[self willChangeValueForKey:@"optionId"];
[self setPrimitiveValue:value_ forKey:@"optionId"];
[self didChangeValueForKey:@"optionId"];
}
- (NSString*)value {
[self willAccessValueForKey:@"value"];
id value = [self primitiveValueForKey:@"value"];
[self didAccessValueForKey:@"value"];
return value;
}
- (void)setValue:(NSString*)value_ {
[self willChangeValueForKey:@"value"];
[self setPrimitiveValue:value_ forKey:@"value"];
[self didChangeValueForKey:@"value"];
}
#endif
- (int64_t)optionIdValue {
NSNumber *result = [self optionId];
return [result longLongValue];
}
- (void)setOptionIdValue:(int64_t)value_ {
[self setOptionId:@(value_)];
}
#if defined CORE_DATA_PERSISTENCE
@dynamic variants;
#endif
- (NSMutableSet *)variantsSet {
[self willAccessValueForKey:@"variants"];
NSMutableSet *result = (NSMutableSet *)[self mutableSetValueForKey:@"variants"];
[self didAccessValueForKey:@"variants"];
return result;
}
@end
#pragma mark -
@implementation BUYModelManager (BUYOptionValueInserting)
- (BUYOptionValue *)insertOptionValueWithJSONDictionary:(NSDictionary *)dictionary
{
return (BUYOptionValue *)[self buy_objectWithEntityName:@"OptionValue" JSONDictionary:dictionary];
}
- (NSArray<BUYOptionValue *> *)insertOptionValuesWithJSONArray:(NSArray <NSDictionary *> *)array
{
return (NSArray<BUYOptionValue *> *)[self buy_objectsWithEntityName:@"OptionValue" JSONArray:array];
}
- (NSArray<BUYOptionValue *> *)allOptionValueObjects
{
return (NSArray<BUYOptionValue *> *)[self buy_objectsWithEntityName:@"OptionValue" identifiers:nil];
}
- (BUYOptionValue *)fetchOptionValueWithIdentifierValue:(int64_t)identifier
{
return (BUYOptionValue *)[self buy_objectWithEntityName:@"OptionValue" identifier:@(identifier)];
}
@end
//
// _BUYOrder.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYOrder.h instead.
#import <Buy/BUYManagedObject.h>
#import "BUYModelManager.h"
extern const struct BUYOrderAttributes {
__unsafe_unretained NSString *identifier;
__unsafe_unretained NSString *name;
__unsafe_unretained NSString *orderStatusURL;
__unsafe_unretained NSString *processedAt;
__unsafe_unretained NSString *statusURL;
__unsafe_unretained NSString *subtotalPrice;
__unsafe_unretained NSString *totalPrice;
} BUYOrderAttributes;
extern const struct BUYOrderRelationships {
__unsafe_unretained NSString *checkout;
__unsafe_unretained NSString *lineItems;
} BUYOrderRelationships;
extern const struct BUYOrderUserInfo {
__unsafe_unretained NSString *attributeValueClassName;
__unsafe_unretained NSString *documentation;
} BUYOrderUserInfo;
@class BUYCheckout;
@class BUYLineItem;
@class NSURL;
@class NSURL;
@class BUYOrder;
@interface BUYModelManager (BUYOrderInserting)
- (NSArray<BUYOrder *> *)allOrderObjects;
- (BUYOrder *)fetchOrderWithIdentifierValue:(int64_t)identifier;
- (BUYOrder *)insertOrderWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYOrder *> *)insertOrdersWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
/**
* URL for the website showing the order status, doesn't require a customer token.
*/
@interface _BUYOrder : BUYCachedObject
+ (NSString *)entityName;
@property (nonatomic, strong) NSNumber* identifier;
@property (atomic) int64_t identifierValue;
- (int64_t)identifierValue;
- (void)setIdentifierValue:(int64_t)value_;
/**
* The customer's order name as represented by a number.
*/
@property (nonatomic, strong) NSString* name;
/**
* URL for the website showing the order status.
*/
@property (nonatomic, strong) NSURL* orderStatusURL;
@property (nonatomic, strong) NSDate* processedAt;
@property (nonatomic, strong) NSURL* statusURL;
@property (nonatomic, strong) NSDecimalNumber* subtotalPrice;
@property (nonatomic, strong) NSDecimalNumber* totalPrice;
/**
* Inverse of Checkout.order.
*/
@property (nonatomic, strong) BUYCheckout *checkout;
@property (nonatomic, strong) NSOrderedSet *lineItems;
- (NSMutableOrderedSet *)lineItemsSet;
@end
@interface _BUYOrder (LineItemsCoreDataGeneratedAccessors)
- (void)insertObject:(BUYLineItem *)value inLineItemsAtIndex:(NSUInteger)idx;
- (void)removeObjectFromLineItemsAtIndex:(NSUInteger)idx;
- (void)insertLineItems:(NSArray *)value atIndexes:(NSIndexSet *)indexes;
- (void)removeLineItemsAtIndexes:(NSIndexSet *)indexes;
- (void)replaceObjectInLineItemsAtIndex:(NSUInteger)idx withObject:(BUYLineItem *)value;
- (void)replaceLineItemsAtIndexes:(NSIndexSet *)indexes withLineItems:(NSArray *)values;
@end
@interface _BUYOrder (CoreDataGeneratedPrimitiveAccessors)
- (NSNumber*)primitiveIdentifier;
- (void)setPrimitiveIdentifier:(NSNumber*)value;
- (NSString*)primitiveName;
- (void)setPrimitiveName:(NSString*)value;
- (NSURL*)primitiveOrderStatusURL;
- (void)setPrimitiveOrderStatusURL:(NSURL*)value;
- (NSDate*)primitiveProcessedAt;
- (void)setPrimitiveProcessedAt:(NSDate*)value;
- (NSURL*)primitiveStatusURL;
- (void)setPrimitiveStatusURL:(NSURL*)value;
- (NSDecimalNumber*)primitiveSubtotalPrice;
- (void)setPrimitiveSubtotalPrice:(NSDecimalNumber*)value;
- (NSDecimalNumber*)primitiveTotalPrice;
- (void)setPrimitiveTotalPrice:(NSDecimalNumber*)value;
- (BUYCheckout *)primitiveCheckout;
- (void)setPrimitiveCheckout:(BUYCheckout *)value;
- (NSMutableOrderedSet *)primitiveLineItems;
- (void)setPrimitiveLineItems:(NSMutableOrderedSet *)value;
@end
//
// _BUYOrder.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYOrder.m instead.
#import "_BUYOrder.h"
const struct BUYOrderAttributes BUYOrderAttributes = {
.identifier = @"identifier",
.name = @"name",
.orderStatusURL = @"orderStatusURL",
.processedAt = @"processedAt",
.statusURL = @"statusURL",
.subtotalPrice = @"subtotalPrice",
.totalPrice = @"totalPrice",
};
const struct BUYOrderRelationships BUYOrderRelationships = {
.checkout = @"checkout",
.lineItems = @"lineItems",
};
const struct BUYOrderUserInfo BUYOrderUserInfo = {
.attributeValueClassName = @"URL",
.documentation = @"URL for the website showing the order status, doesn't require a customer token.",
};
@implementation _BUYOrder
+ (NSString *)entityName {
return @"Order";
}
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
if ([key isEqualToString:@"identifierValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"identifier"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
return keyPaths;
}
#if defined CORE_DATA_PERSISTENCE
- (NSNumber*)identifier {
[self willAccessValueForKey:@"identifier"];
id value = [self primitiveValueForKey:@"identifier"];
[self didAccessValueForKey:@"identifier"];
return value;
}
- (void)setIdentifier:(NSNumber*)value_ {
[self willChangeValueForKey:@"identifier"];
[self setPrimitiveValue:value_ forKey:@"identifier"];
[self didChangeValueForKey:@"identifier"];
}
- (NSString*)name {
[self willAccessValueForKey:@"name"];
id value = [self primitiveValueForKey:@"name"];
[self didAccessValueForKey:@"name"];
return value;
}
- (void)setName:(NSString*)value_ {
[self willChangeValueForKey:@"name"];
[self setPrimitiveValue:value_ forKey:@"name"];
[self didChangeValueForKey:@"name"];
}
- (NSURL*)orderStatusURL {
[self willAccessValueForKey:@"orderStatusURL"];
id value = [self primitiveValueForKey:@"orderStatusURL"];
[self didAccessValueForKey:@"orderStatusURL"];
return value;
}
- (void)setOrderStatusURL:(NSURL*)value_ {
[self willChangeValueForKey:@"orderStatusURL"];
[self setPrimitiveValue:value_ forKey:@"orderStatusURL"];
[self didChangeValueForKey:@"orderStatusURL"];
}
- (NSDate*)processedAt {
[self willAccessValueForKey:@"processedAt"];
id value = [self primitiveValueForKey:@"processedAt"];
[self didAccessValueForKey:@"processedAt"];
return value;
}
- (void)setProcessedAt:(NSDate*)value_ {
[self willChangeValueForKey:@"processedAt"];
[self setPrimitiveValue:value_ forKey:@"processedAt"];
[self didChangeValueForKey:@"processedAt"];
}
- (NSURL*)statusURL {
[self willAccessValueForKey:@"statusURL"];
id value = [self primitiveValueForKey:@"statusURL"];
[self didAccessValueForKey:@"statusURL"];
return value;
}
- (void)setStatusURL:(NSURL*)value_ {
[self willChangeValueForKey:@"statusURL"];
[self setPrimitiveValue:value_ forKey:@"statusURL"];
[self didChangeValueForKey:@"statusURL"];
}
- (NSDecimalNumber*)subtotalPrice {
[self willAccessValueForKey:@"subtotalPrice"];
id value = [self primitiveValueForKey:@"subtotalPrice"];
[self didAccessValueForKey:@"subtotalPrice"];
return value;
}
- (void)setSubtotalPrice:(NSDecimalNumber*)value_ {
[self willChangeValueForKey:@"subtotalPrice"];
[self setPrimitiveValue:value_ forKey:@"subtotalPrice"];
[self didChangeValueForKey:@"subtotalPrice"];
}
- (NSDecimalNumber*)totalPrice {
[self willAccessValueForKey:@"totalPrice"];
id value = [self primitiveValueForKey:@"totalPrice"];
[self didAccessValueForKey:@"totalPrice"];
return value;
}
- (void)setTotalPrice:(NSDecimalNumber*)value_ {
[self willChangeValueForKey:@"totalPrice"];
[self setPrimitiveValue:value_ forKey:@"totalPrice"];
[self didChangeValueForKey:@"totalPrice"];
}
#endif
- (int64_t)identifierValue {
NSNumber *result = [self identifier];
return [result longLongValue];
}
- (void)setIdentifierValue:(int64_t)value_ {
[self setIdentifier:@(value_)];
}
#if defined CORE_DATA_PERSISTENCE
@dynamic checkout;
#endif
#if defined CORE_DATA_PERSISTENCE
@dynamic lineItems;
#endif
- (NSMutableOrderedSet *)lineItemsSet {
[self willAccessValueForKey:@"lineItems"];
NSMutableOrderedSet *result = (NSMutableOrderedSet *)[self mutableOrderedSetValueForKey:@"lineItems"];
[self didAccessValueForKey:@"lineItems"];
return result;
}
@end
#pragma mark -
@implementation BUYModelManager (BUYOrderInserting)
- (BUYOrder *)insertOrderWithJSONDictionary:(NSDictionary *)dictionary
{
return (BUYOrder *)[self buy_objectWithEntityName:@"Order" JSONDictionary:dictionary];
}
- (NSArray<BUYOrder *> *)insertOrdersWithJSONArray:(NSArray <NSDictionary *> *)array
{
return (NSArray<BUYOrder *> *)[self buy_objectsWithEntityName:@"Order" JSONArray:array];
}
- (NSArray<BUYOrder *> *)allOrderObjects
{
return (NSArray<BUYOrder *> *)[self buy_objectsWithEntityName:@"Order" identifiers:nil];
}
- (BUYOrder *)fetchOrderWithIdentifierValue:(int64_t)identifier
{
return (BUYOrder *)[self buy_objectWithEntityName:@"Order" identifier:@(identifier)];
}
@end
//
// _BUYProduct.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYProduct.h instead.
#import <Buy/BUYManagedObject.h>
#import "BUYModelManager.h"
extern const struct BUYProductAttributes {
__unsafe_unretained NSString *available;
__unsafe_unretained NSString *createdAt;
__unsafe_unretained NSString *handle;
__unsafe_unretained NSString *htmlDescription;
__unsafe_unretained NSString *identifier;
__unsafe_unretained NSString *productId;
__unsafe_unretained NSString *productType;
__unsafe_unretained NSString *publicURL;
__unsafe_unretained NSString *published;
__unsafe_unretained NSString *publishedAt;
__unsafe_unretained NSString *tags;
__unsafe_unretained NSString *title;
__unsafe_unretained NSString *updatedAt;
__unsafe_unretained NSString *vendor;
} BUYProductAttributes;
extern const struct BUYProductRelationships {
__unsafe_unretained NSString *collections;
__unsafe_unretained NSString *images;
__unsafe_unretained NSString *options;
__unsafe_unretained NSString *variants;
} BUYProductRelationships;
extern const struct BUYProductUserInfo {
__unsafe_unretained NSString *documentation;
} BUYProductUserInfo;
@class BUYCollection;
@class BUYImageLink;
@class BUYOption;
@class BUYProductVariant;
@class NSURL;
@class NSSet;
@class BUYProduct;
@interface BUYModelManager (BUYProductInserting)
- (NSArray<BUYProduct *> *)allProductObjects;
- (BUYProduct *)fetchProductWithIdentifierValue:(int64_t)identifier;
- (BUYProduct *)insertProductWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYProduct *> *)insertProductsWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
/**
* A BUYProduct is an individual item for sale in a Shopify shop.
*/
@interface _BUYProduct : BUYCachedObject
+ (NSString *)entityName;
/**
* If the product is in stock. See each variant for their specific availability.
*/
@property (nonatomic, strong) NSNumber* available;
@property (atomic) BOOL availableValue;
- (BOOL)availableValue;
- (void)setAvailableValue:(BOOL)value_;
/**
* The creation date for a product.
*/
@property (nonatomic, strong) NSDate* createdAt;
/**
* The handle of the product. Can be used to construct links to the web page for the product.
*/
@property (nonatomic, strong) NSString* handle;
/**
* The description of the product, complete with HTML formatting.
*
* Maps to "body_html" in JSON.
*/
@property (nonatomic, strong) NSString* htmlDescription;
@property (nonatomic, strong) NSNumber* identifier;
@property (atomic) int64_t identifierValue;
- (int64_t)identifierValue;
- (void)setIdentifierValue:(int64_t)value_;
/**
* The channel product ID.
*/
@property (nonatomic, strong) NSNumber* productId;
@property (atomic) int64_t productIdValue;
- (int64_t)productIdValue;
- (void)setProductIdValue:(int64_t)value_;
/**
* A categorization that a product can be tagged with, commonly used for filtering and searching.
*/
@property (nonatomic, strong) NSString* productType;
/**
* A publically accessible link to the product web page
*/
@property (nonatomic, strong) NSURL* publicURL;
/**
* The product is published on the current sales channel.
*/
@property (nonatomic, strong) NSNumber* published;
@property (atomic) BOOL publishedValue;
- (BOOL)publishedValue;
- (void)setPublishedValue:(BOOL)value_;
/**
* The publish date for a product.
*/
@property (nonatomic, strong) NSDate* publishedAt;
/**
* A categorization that a product can be tagged with.
*
* Commonly used for filtering and searching. Each tag has a imit of 255 characters.
*/
@property (nonatomic, strong) NSSet* tags;
/**
* The name of the product.
*
* In a shop's catalog, clicking on a product's title takes you to that product's page. On a product's page, the product's title typically appears in a large font.
*/
@property (nonatomic, strong) NSString* title;
/**
* The updated date for a product.
*/
@property (nonatomic, strong) NSDate* updatedAt;
/**
* The name of the vendor of the product.
*/
@property (nonatomic, strong) NSString* vendor;
/**
* The collections in which this product appears.
*
* Maps to "collection_ids" in JSON.
*/
@property (nonatomic, strong) NSSet *collections;
- (NSMutableSet *)collectionsSet;
/**
* A list of BUYImageLink objects, each one representing an image associated with the product.
*/
@property (nonatomic, strong) NSOrderedSet *images;
- (NSMutableOrderedSet *)imagesSet;
/**
* Custom product property names like "Size", "Color", and "Material".
*
* Products are based on permutations of these options. A product may have a maximum of 3 options. 255 characters limit each.
*/
@property (nonatomic, strong) NSOrderedSet *options;
- (NSMutableOrderedSet *)optionsSet;
/**
* A list of BUYProductVariant objects, each one representing a slightly different version of the product.
*/
@property (nonatomic, strong) NSOrderedSet *variants;
- (NSMutableOrderedSet *)variantsSet;
@end
@interface _BUYProduct (CollectionsCoreDataGeneratedAccessors)
@end
@interface _BUYProduct (ImagesCoreDataGeneratedAccessors)
- (void)insertObject:(BUYImageLink *)value inImagesAtIndex:(NSUInteger)idx;
- (void)removeObjectFromImagesAtIndex:(NSUInteger)idx;
- (void)insertImages:(NSArray *)value atIndexes:(NSIndexSet *)indexes;
- (void)removeImagesAtIndexes:(NSIndexSet *)indexes;
- (void)replaceObjectInImagesAtIndex:(NSUInteger)idx withObject:(BUYImageLink *)value;
- (void)replaceImagesAtIndexes:(NSIndexSet *)indexes withImages:(NSArray *)values;
@end
@interface _BUYProduct (OptionsCoreDataGeneratedAccessors)
- (void)insertObject:(BUYOption *)value inOptionsAtIndex:(NSUInteger)idx;
- (void)removeObjectFromOptionsAtIndex:(NSUInteger)idx;
- (void)insertOptions:(NSArray *)value atIndexes:(NSIndexSet *)indexes;
- (void)removeOptionsAtIndexes:(NSIndexSet *)indexes;
- (void)replaceObjectInOptionsAtIndex:(NSUInteger)idx withObject:(BUYOption *)value;
- (void)replaceOptionsAtIndexes:(NSIndexSet *)indexes withOptions:(NSArray *)values;
@end
@interface _BUYProduct (VariantsCoreDataGeneratedAccessors)
- (void)insertObject:(BUYProductVariant *)value inVariantsAtIndex:(NSUInteger)idx;
- (void)removeObjectFromVariantsAtIndex:(NSUInteger)idx;
- (void)insertVariants:(NSArray *)value atIndexes:(NSIndexSet *)indexes;
- (void)removeVariantsAtIndexes:(NSIndexSet *)indexes;
- (void)replaceObjectInVariantsAtIndex:(NSUInteger)idx withObject:(BUYProductVariant *)value;
- (void)replaceVariantsAtIndexes:(NSIndexSet *)indexes withVariants:(NSArray *)values;
@end
@interface _BUYProduct (CoreDataGeneratedPrimitiveAccessors)
- (NSNumber*)primitiveAvailable;
- (void)setPrimitiveAvailable:(NSNumber*)value;
- (NSDate*)primitiveCreatedAt;
- (void)setPrimitiveCreatedAt:(NSDate*)value;
- (NSString*)primitiveHandle;
- (void)setPrimitiveHandle:(NSString*)value;
- (NSString*)primitiveHtmlDescription;
- (void)setPrimitiveHtmlDescription:(NSString*)value;
- (NSNumber*)primitiveIdentifier;
- (void)setPrimitiveIdentifier:(NSNumber*)value;
- (NSNumber*)primitiveProductId;
- (void)setPrimitiveProductId:(NSNumber*)value;
- (NSString*)primitiveProductType;
- (void)setPrimitiveProductType:(NSString*)value;
- (NSURL*)primitivePublicURL;
- (void)setPrimitivePublicURL:(NSURL*)value;
- (NSNumber*)primitivePublished;
- (void)setPrimitivePublished:(NSNumber*)value;
- (NSDate*)primitivePublishedAt;
- (void)setPrimitivePublishedAt:(NSDate*)value;
- (NSSet*)primitiveTags;
- (void)setPrimitiveTags:(NSSet*)value;
- (NSString*)primitiveTitle;
- (void)setPrimitiveTitle:(NSString*)value;
- (NSDate*)primitiveUpdatedAt;
- (void)setPrimitiveUpdatedAt:(NSDate*)value;
- (NSString*)primitiveVendor;
- (void)setPrimitiveVendor:(NSString*)value;
- (NSMutableSet *)primitiveCollections;
- (void)setPrimitiveCollections:(NSMutableSet *)value;
- (NSMutableOrderedSet *)primitiveImages;
- (void)setPrimitiveImages:(NSMutableOrderedSet *)value;
- (NSMutableOrderedSet *)primitiveOptions;
- (void)setPrimitiveOptions:(NSMutableOrderedSet *)value;
- (NSMutableOrderedSet *)primitiveVariants;
- (void)setPrimitiveVariants:(NSMutableOrderedSet *)value;
@end
//
// _BUYProductVariant.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYProductVariant.h instead.
#import <Buy/BUYManagedObject.h>
#import "BUYModelManager.h"
extern const struct BUYProductVariantAttributes {
__unsafe_unretained NSString *available;
__unsafe_unretained NSString *compareAtPrice;
__unsafe_unretained NSString *grams;
__unsafe_unretained NSString *identifier;
__unsafe_unretained NSString *position;
__unsafe_unretained NSString *price;
__unsafe_unretained NSString *requiresShipping;
__unsafe_unretained NSString *sku;
__unsafe_unretained NSString *taxable;
__unsafe_unretained NSString *title;
} BUYProductVariantAttributes;
extern const struct BUYProductVariantRelationships {
__unsafe_unretained NSString *cartLineItems;
__unsafe_unretained NSString *options;
__unsafe_unretained NSString *product;
} BUYProductVariantRelationships;
extern const struct BUYProductVariantUserInfo {
__unsafe_unretained NSString *documentation;
} BUYProductVariantUserInfo;
@class BUYCartLineItem;
@class BUYOptionValue;
@class BUYProduct;
@class BUYProductVariant;
@interface BUYModelManager (BUYProductVariantInserting)
- (NSArray<BUYProductVariant *> *)allProductVariantObjects;
- (BUYProductVariant *)fetchProductVariantWithIdentifierValue:(int64_t)identifier;
- (BUYProductVariant *)insertProductVariantWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYProductVariant *> *)insertProductVariantsWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
/**
* A BUYProductVariant is a different version of a product, such as differing sizes or differing colours.
*/
@interface _BUYProductVariant : BUYCachedObject
+ (NSString *)entityName;
/**
* If the variant is in stock.
*/
@property (nonatomic, strong) NSNumber* available;
@property (atomic) BOOL availableValue;
- (BOOL)availableValue;
- (void)setAvailableValue:(BOOL)value_;
/**
* The competitor's prices for the same item.
*/
@property (nonatomic, strong) NSDecimalNumber* compareAtPrice;
/**
* The weight of the BUYProductVariant in grams.
*/
@property (nonatomic, strong) NSDecimalNumber* grams;
@property (nonatomic, strong) NSNumber* identifier;
@property (atomic) int64_t identifierValue;
- (int64_t)identifierValue;
- (void)setIdentifierValue:(int64_t)value_;
/**
* The order of the BUYProductVariant in the list of product variants. 1 is the first position.
*/
@property (nonatomic, strong) NSNumber* position;
@property (atomic) int32_t positionValue;
- (int32_t)positionValue;
- (void)setPositionValue:(int32_t)value_;
/**
* The price of the BUYProductVariant.
*/
@property (nonatomic, strong) NSDecimalNumber* price;
/**
* Whether or not a customer needs to provide a shipping address when placing an order for this BUYProductVariant.
*/
@property (nonatomic, strong) NSNumber* requiresShipping;
@property (atomic) BOOL requiresShippingValue;
- (BOOL)requiresShippingValue;
- (void)setRequiresShippingValue:(BOOL)value_;
/**
* A unique identifier for the product in the shop.
*/
@property (nonatomic, strong) NSString* sku;
/**
* Specifies whether or not a tax is charged when the BUYProductVariant is sold.
*/
@property (nonatomic, strong) NSNumber* taxable;
@property (atomic) BOOL taxableValue;
- (BOOL)taxableValue;
- (void)setTaxableValue:(BOOL)value_;
/**
* The title of the BUYProductVariant.
*/
@property (nonatomic, strong) NSString* title;
/**
* Inverse of CartLineItem.variant.
*/
@property (nonatomic, strong) NSSet *cartLineItems;
- (NSMutableSet *)cartLineItemsSet;
/**
* Custom properties that a shop owner can use to define BUYProductVariants.
*/
@property (nonatomic, strong) NSSet *options;
- (NSMutableSet *)optionsSet;
@property (nonatomic, strong) BUYProduct *product;
@end
@interface _BUYProductVariant (CartLineItemsCoreDataGeneratedAccessors)
@end
@interface _BUYProductVariant (OptionsCoreDataGeneratedAccessors)
@end
@interface _BUYProductVariant (CoreDataGeneratedPrimitiveAccessors)
- (NSNumber*)primitiveAvailable;
- (void)setPrimitiveAvailable:(NSNumber*)value;
- (NSDecimalNumber*)primitiveCompareAtPrice;
- (void)setPrimitiveCompareAtPrice:(NSDecimalNumber*)value;
- (NSDecimalNumber*)primitiveGrams;
- (void)setPrimitiveGrams:(NSDecimalNumber*)value;
- (NSNumber*)primitiveIdentifier;
- (void)setPrimitiveIdentifier:(NSNumber*)value;
- (NSNumber*)primitivePosition;
- (void)setPrimitivePosition:(NSNumber*)value;
- (NSDecimalNumber*)primitivePrice;
- (void)setPrimitivePrice:(NSDecimalNumber*)value;
- (NSNumber*)primitiveRequiresShipping;
- (void)setPrimitiveRequiresShipping:(NSNumber*)value;
- (NSString*)primitiveSku;
- (void)setPrimitiveSku:(NSString*)value;
- (NSNumber*)primitiveTaxable;
- (void)setPrimitiveTaxable:(NSNumber*)value;
- (NSString*)primitiveTitle;
- (void)setPrimitiveTitle:(NSString*)value;
- (NSMutableSet *)primitiveCartLineItems;
- (void)setPrimitiveCartLineItems:(NSMutableSet *)value;
- (NSMutableSet *)primitiveOptions;
- (void)setPrimitiveOptions:(NSMutableSet *)value;
- (BUYProduct *)primitiveProduct;
- (void)setPrimitiveProduct:(BUYProduct *)value;
@end
//
// _BUYProductVariant.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYProductVariant.m instead.
#import "_BUYProductVariant.h"
const struct BUYProductVariantAttributes BUYProductVariantAttributes = {
.available = @"available",
.compareAtPrice = @"compareAtPrice",
.grams = @"grams",
.identifier = @"identifier",
.position = @"position",
.price = @"price",
.requiresShipping = @"requiresShipping",
.sku = @"sku",
.taxable = @"taxable",
.title = @"title",
};
const struct BUYProductVariantRelationships BUYProductVariantRelationships = {
.cartLineItems = @"cartLineItems",
.options = @"options",
.product = @"product",
};
const struct BUYProductVariantUserInfo BUYProductVariantUserInfo = {
.documentation = @"A BUYProductVariant is a different version of a product, such as differing sizes or differing colours.",
};
@implementation _BUYProductVariant
+ (NSString *)entityName {
return @"ProductVariant";
}
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
if ([key isEqualToString:@"availableValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"available"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
if ([key isEqualToString:@"identifierValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"identifier"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
if ([key isEqualToString:@"positionValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"position"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
if ([key isEqualToString:@"requiresShippingValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"requiresShipping"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
if ([key isEqualToString:@"taxableValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"taxable"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
return keyPaths;
}
#if defined CORE_DATA_PERSISTENCE
- (NSNumber*)available {
[self willAccessValueForKey:@"available"];
id value = [self primitiveValueForKey:@"available"];
[self didAccessValueForKey:@"available"];
return value;
}
- (void)setAvailable:(NSNumber*)value_ {
[self willChangeValueForKey:@"available"];
[self setPrimitiveValue:value_ forKey:@"available"];
[self didChangeValueForKey:@"available"];
}
- (NSDecimalNumber*)compareAtPrice {
[self willAccessValueForKey:@"compareAtPrice"];
id value = [self primitiveValueForKey:@"compareAtPrice"];
[self didAccessValueForKey:@"compareAtPrice"];
return value;
}
- (void)setCompareAtPrice:(NSDecimalNumber*)value_ {
[self willChangeValueForKey:@"compareAtPrice"];
[self setPrimitiveValue:value_ forKey:@"compareAtPrice"];
[self didChangeValueForKey:@"compareAtPrice"];
}
- (NSDecimalNumber*)grams {
[self willAccessValueForKey:@"grams"];
id value = [self primitiveValueForKey:@"grams"];
[self didAccessValueForKey:@"grams"];
return value;
}
- (void)setGrams:(NSDecimalNumber*)value_ {
[self willChangeValueForKey:@"grams"];
[self setPrimitiveValue:value_ forKey:@"grams"];
[self didChangeValueForKey:@"grams"];
}
- (NSNumber*)identifier {
[self willAccessValueForKey:@"identifier"];
id value = [self primitiveValueForKey:@"identifier"];
[self didAccessValueForKey:@"identifier"];
return value;
}
- (void)setIdentifier:(NSNumber*)value_ {
[self willChangeValueForKey:@"identifier"];
[self setPrimitiveValue:value_ forKey:@"identifier"];
[self didChangeValueForKey:@"identifier"];
}
- (NSNumber*)position {
[self willAccessValueForKey:@"position"];
id value = [self primitiveValueForKey:@"position"];
[self didAccessValueForKey:@"position"];
return value;
}
- (void)setPosition:(NSNumber*)value_ {
[self willChangeValueForKey:@"position"];
[self setPrimitiveValue:value_ forKey:@"position"];
[self didChangeValueForKey:@"position"];
}
- (NSDecimalNumber*)price {
[self willAccessValueForKey:@"price"];
id value = [self primitiveValueForKey:@"price"];
[self didAccessValueForKey:@"price"];
return value;
}
- (void)setPrice:(NSDecimalNumber*)value_ {
[self willChangeValueForKey:@"price"];
[self setPrimitiveValue:value_ forKey:@"price"];
[self didChangeValueForKey:@"price"];
}
- (NSNumber*)requiresShipping {
[self willAccessValueForKey:@"requiresShipping"];
id value = [self primitiveValueForKey:@"requiresShipping"];
[self didAccessValueForKey:@"requiresShipping"];
return value;
}
- (void)setRequiresShipping:(NSNumber*)value_ {
[self willChangeValueForKey:@"requiresShipping"];
[self setPrimitiveValue:value_ forKey:@"requiresShipping"];
[self didChangeValueForKey:@"requiresShipping"];
}
- (NSString*)sku {
[self willAccessValueForKey:@"sku"];
id value = [self primitiveValueForKey:@"sku"];
[self didAccessValueForKey:@"sku"];
return value;
}
- (void)setSku:(NSString*)value_ {
[self willChangeValueForKey:@"sku"];
[self setPrimitiveValue:value_ forKey:@"sku"];
[self didChangeValueForKey:@"sku"];
}
- (NSNumber*)taxable {
[self willAccessValueForKey:@"taxable"];
id value = [self primitiveValueForKey:@"taxable"];
[self didAccessValueForKey:@"taxable"];
return value;
}
- (void)setTaxable:(NSNumber*)value_ {
[self willChangeValueForKey:@"taxable"];
[self setPrimitiveValue:value_ forKey:@"taxable"];
[self didChangeValueForKey:@"taxable"];
}
- (NSString*)title {
[self willAccessValueForKey:@"title"];
id value = [self primitiveValueForKey:@"title"];
[self didAccessValueForKey:@"title"];
return value;
}
- (void)setTitle:(NSString*)value_ {
[self willChangeValueForKey:@"title"];
[self setPrimitiveValue:value_ forKey:@"title"];
[self didChangeValueForKey:@"title"];
}
#endif
- (BOOL)availableValue {
NSNumber *result = [self available];
return [result boolValue];
}
- (void)setAvailableValue:(BOOL)value_ {
[self setAvailable:@(value_)];
}
- (int64_t)identifierValue {
NSNumber *result = [self identifier];
return [result longLongValue];
}
- (void)setIdentifierValue:(int64_t)value_ {
[self setIdentifier:@(value_)];
}
- (int32_t)positionValue {
NSNumber *result = [self position];
return [result intValue];
}
- (void)setPositionValue:(int32_t)value_ {
[self setPosition:@(value_)];
}
- (BOOL)requiresShippingValue {
NSNumber *result = [self requiresShipping];
return [result boolValue];
}
- (void)setRequiresShippingValue:(BOOL)value_ {
[self setRequiresShipping:@(value_)];
}
- (BOOL)taxableValue {
NSNumber *result = [self taxable];
return [result boolValue];
}
- (void)setTaxableValue:(BOOL)value_ {
[self setTaxable:@(value_)];
}
#if defined CORE_DATA_PERSISTENCE
@dynamic cartLineItems;
#endif
- (NSMutableSet *)cartLineItemsSet {
[self willAccessValueForKey:@"cartLineItems"];
NSMutableSet *result = (NSMutableSet *)[self mutableSetValueForKey:@"cartLineItems"];
[self didAccessValueForKey:@"cartLineItems"];
return result;
}
#if defined CORE_DATA_PERSISTENCE
@dynamic options;
#endif
- (NSMutableSet *)optionsSet {
[self willAccessValueForKey:@"options"];
NSMutableSet *result = (NSMutableSet *)[self mutableSetValueForKey:@"options"];
[self didAccessValueForKey:@"options"];
return result;
}
#if defined CORE_DATA_PERSISTENCE
@dynamic product;
#endif
@end
#pragma mark -
@implementation BUYModelManager (BUYProductVariantInserting)
- (BUYProductVariant *)insertProductVariantWithJSONDictionary:(NSDictionary *)dictionary
{
return (BUYProductVariant *)[self buy_objectWithEntityName:@"ProductVariant" JSONDictionary:dictionary];
}
- (NSArray<BUYProductVariant *> *)insertProductVariantsWithJSONArray:(NSArray <NSDictionary *> *)array
{
return (NSArray<BUYProductVariant *> *)[self buy_objectsWithEntityName:@"ProductVariant" JSONArray:array];
}
- (NSArray<BUYProductVariant *> *)allProductVariantObjects
{
return (NSArray<BUYProductVariant *> *)[self buy_objectsWithEntityName:@"ProductVariant" identifiers:nil];
}
- (BUYProductVariant *)fetchProductVariantWithIdentifierValue:(int64_t)identifier
{
return (BUYProductVariant *)[self buy_objectWithEntityName:@"ProductVariant" identifier:@(identifier)];
}
@end
//
// _BUYShop.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYShop.h instead.
#import <Buy/BUYManagedObject.h>
#import "BUYModelManager.h"
extern const struct BUYShopAttributes {
__unsafe_unretained NSString *city;
__unsafe_unretained NSString *country;
__unsafe_unretained NSString *currency;
__unsafe_unretained NSString *domain;
__unsafe_unretained NSString *identifier;
__unsafe_unretained NSString *moneyFormat;
__unsafe_unretained NSString *myShopifyURL;
__unsafe_unretained NSString *name;
__unsafe_unretained NSString *province;
__unsafe_unretained NSString *publishedCollectionsCount;
__unsafe_unretained NSString *publishedProductsCount;
__unsafe_unretained NSString *shipsToCountries;
__unsafe_unretained NSString *shopDescription;
__unsafe_unretained NSString *shopURL;
} BUYShopAttributes;
extern const struct BUYShopUserInfo {
__unsafe_unretained NSString *documentation;
} BUYShopUserInfo;
@class NSURL;
@class NSArray;
@class NSURL;
@class BUYShop;
@interface BUYModelManager (BUYShopInserting)
- (NSArray<BUYShop *> *)allShopObjects;
- (BUYShop *)fetchShopWithIdentifierValue:(int64_t)identifier;
- (BUYShop *)insertShopWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYShop *> *)insertShopsWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
/**
* The BUYShop object is a collection of the general settings and information about the shop.
*/
@interface _BUYShop : BUYCachedObject
+ (NSString *)entityName;
/**
* The city in which the shop is located.
*/
@property (nonatomic, strong) NSString* city;
/**
* The country in which the shop is located.
*/
@property (nonatomic, strong) NSString* country;
/**
* The three-letter code for the currency that the shop accepts.
*/
@property (nonatomic, strong) NSString* currency;
/**
* The shop's domain.
*/
@property (nonatomic, strong) NSString* domain;
@property (nonatomic, strong) NSNumber* identifier;
@property (atomic) int64_t identifierValue;
- (int64_t)identifierValue;
- (void)setIdentifierValue:(int64_t)value_;
/**
* A string representing the way currency is formatted when the currency isn't specified.
*/
@property (nonatomic, strong) NSString* moneyFormat;
/**
* The shop's 'myshopify.com' domain.
*
* Maps to "myshopify_domain" in JSON.
*/
@property (nonatomic, strong) NSURL* myShopifyURL;
/**
* The name of the shop.
*/
@property (nonatomic, strong) NSString* name;
/**
* The shop's normalized province or state name.
*/
@property (nonatomic, strong) NSString* province;
@property (nonatomic, strong) NSNumber* publishedCollectionsCount;
@property (atomic) int64_t publishedCollectionsCountValue;
- (int64_t)publishedCollectionsCountValue;
- (void)setPublishedCollectionsCountValue:(int64_t)value_;
@property (nonatomic, strong) NSNumber* publishedProductsCount;
@property (atomic) int64_t publishedProductsCountValue;
- (int64_t)publishedProductsCountValue;
- (void)setPublishedProductsCountValue:(int64_t)value_;
/**
* A list of two-letter country codes identifying the countries that the shop ships to.
*/
@property (nonatomic, strong) NSArray* shipsToCountries;
/**
* The shop's description.
*
* Maps to "description" in JSON.
*/
@property (nonatomic, strong) NSString* shopDescription;
@property (nonatomic, strong) NSURL* shopURL;
@end
@interface _BUYShop (CoreDataGeneratedPrimitiveAccessors)
- (NSString*)primitiveCity;
- (void)setPrimitiveCity:(NSString*)value;
- (NSString*)primitiveCountry;
- (void)setPrimitiveCountry:(NSString*)value;
- (NSString*)primitiveCurrency;
- (void)setPrimitiveCurrency:(NSString*)value;
- (NSString*)primitiveDomain;
- (void)setPrimitiveDomain:(NSString*)value;
- (NSNumber*)primitiveIdentifier;
- (void)setPrimitiveIdentifier:(NSNumber*)value;
- (NSString*)primitiveMoneyFormat;
- (void)setPrimitiveMoneyFormat:(NSString*)value;
- (NSURL*)primitiveMyShopifyURL;
- (void)setPrimitiveMyShopifyURL:(NSURL*)value;
- (NSString*)primitiveName;
- (void)setPrimitiveName:(NSString*)value;
- (NSString*)primitiveProvince;
- (void)setPrimitiveProvince:(NSString*)value;
- (NSNumber*)primitivePublishedCollectionsCount;
- (void)setPrimitivePublishedCollectionsCount:(NSNumber*)value;
- (NSNumber*)primitivePublishedProductsCount;
- (void)setPrimitivePublishedProductsCount:(NSNumber*)value;
- (NSArray*)primitiveShipsToCountries;
- (void)setPrimitiveShipsToCountries:(NSArray*)value;
- (NSString*)primitiveShopDescription;
- (void)setPrimitiveShopDescription:(NSString*)value;
- (NSURL*)primitiveShopURL;
- (void)setPrimitiveShopURL:(NSURL*)value;
@end
//
// _BUYAddress.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYAddress.h instead.
#import "BUYObject.h"
#import <Buy/BUYModelManager.h>
extern const struct BUYAddressAttributes {
__unsafe_unretained NSString *address1;
__unsafe_unretained NSString *address2;
__unsafe_unretained NSString *city;
__unsafe_unretained NSString *company;
__unsafe_unretained NSString *country;
__unsafe_unretained NSString *countryCode;
__unsafe_unretained NSString *firstName;
__unsafe_unretained NSString *lastName;
__unsafe_unretained NSString *phone;
__unsafe_unretained NSString *province;
__unsafe_unretained NSString *provinceCode;
__unsafe_unretained NSString *zip;
} BUYAddressAttributes;
extern const struct BUYAddressUserInfo {
__unsafe_unretained NSString *documentation;
} BUYAddressUserInfo;
@class BUYAddress;
@interface BUYModelManager (BUYAddressInserting)
- (NSArray<BUYAddress *> *)allAddressObjects;
- (BUYAddress *)fetchAddressWithIdentifierValue:(int64_t)identifier;
- (BUYAddress *)insertAddressWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYAddress *> *)insertAddresssWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
/**
* A BUYAddress represents a shipping or billing address on an order. This will be associated with the customer upon completion.
*/
@interface _BUYAddress : BUYObject
+ (NSString *)entityName;
/**
* The street address of the address.
*/
@property (nonatomic, strong) NSString* address1;
/**
* An optional additional field for the street address of the address.
*/
@property (nonatomic, strong) NSString* address2;
/**
* The city of the address.
*/
@property (nonatomic, strong) NSString* city;
/**
* The company of the person associated with the address (optional).
*/
@property (nonatomic, strong) NSString* company;
/**
* The name of the country of the address.
*/
@property (nonatomic, strong) NSString* country;
/**
* The two-letter code (ISO 3166-1 alpha-2 two-letter country code) for the country of the address.
*/
@property (nonatomic, strong) NSString* countryCode;
/**
* The first name of the person associated with the payment method.
*/
@property (nonatomic, strong) NSString* firstName;
/**
* The last name of the person associated with the payment method.
*/
@property (nonatomic, strong) NSString* lastName;
/**
* The phone number at the address.
*/
@property (nonatomic, strong) NSString* phone;
/**
* The name of the state or province of the address
*/
@property (nonatomic, strong) NSString* province;
/**
* The two-letter abbreviation of the state or province of the address.
*/
@property (nonatomic, strong) NSString* provinceCode;
/**
* The zip or postal code of the address.
*/
@property (nonatomic, strong) NSString* zip;
@end
//
// _BUYAddress.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYAddress.m instead.
#import "_BUYAddress.h"
const struct BUYAddressAttributes BUYAddressAttributes = {
.address1 = @"address1",
.address2 = @"address2",
.city = @"city",
.company = @"company",
.country = @"country",
.countryCode = @"countryCode",
.firstName = @"firstName",
.lastName = @"lastName",
.phone = @"phone",
.province = @"province",
.provinceCode = @"provinceCode",
.zip = @"zip",
};
const struct BUYAddressUserInfo BUYAddressUserInfo = {
.documentation = @"A BUYAddress represents a shipping or billing address on an order. This will be associated with the customer upon completion.",
};
@implementation _BUYAddress
+ (NSString *)entityName {
return @"Address";
}
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
return keyPaths;
}
@end
#pragma mark -
@implementation BUYModelManager (BUYAddressInserting)
- (BUYAddress *)insertAddressWithJSONDictionary:(NSDictionary *)dictionary
{
return (BUYAddress *)[self buy_objectWithEntityName:@"Address" JSONDictionary:dictionary];
}
- (NSArray<BUYAddress *> *)insertAddresssWithJSONArray:(NSArray <NSDictionary *> *)array
{
return (NSArray<BUYAddress *> *)[self buy_objectsWithEntityName:@"Address" JSONArray:array];
}
- (NSArray<BUYAddress *> *)allAddressObjects
{
return (NSArray<BUYAddress *> *)[self buy_objectsWithEntityName:@"Address" identifiers:nil];
}
- (BUYAddress *)fetchAddressWithIdentifierValue:(int64_t)identifier
{
return (BUYAddress *)[self buy_objectWithEntityName:@"Address" identifier:@(identifier)];
}
@end
//
// _BUYDiscount.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYDiscount.h instead.
#import "BUYObject.h"
#import <Buy/BUYModelManager.h>
extern const struct BUYDiscountAttributes {
__unsafe_unretained NSString *amount;
__unsafe_unretained NSString *applicable;
__unsafe_unretained NSString *code;
} BUYDiscountAttributes;
extern const struct BUYDiscountRelationships {
__unsafe_unretained NSString *checkout;
} BUYDiscountRelationships;
extern const struct BUYDiscountUserInfo {
__unsafe_unretained NSString *documentation;
} BUYDiscountUserInfo;
@class BUYCheckout;
@class BUYDiscount;
@interface BUYModelManager (BUYDiscountInserting)
- (NSArray<BUYDiscount *> *)allDiscountObjects;
- (BUYDiscount *)fetchDiscountWithIdentifierValue:(int64_t)identifier;
- (BUYDiscount *)insertDiscountWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYDiscount *> *)insertDiscountsWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
/**
* BUYDiscount represents a discount that is applied to the BUYCheckout.
*/
@interface _BUYDiscount : BUYObject
+ (NSString *)entityName;
/**
* The amount that is deducted from `paymentDue` on BUYCheckout.
*/
@property (nonatomic, strong) NSDecimalNumber* amount;
/**
* Whether this discount code can be applied to the checkout.
*/
@property (nonatomic, strong) NSNumber* applicable;
@property (atomic) BOOL applicableValue;
- (BOOL)applicableValue;
- (void)setApplicableValue:(BOOL)value_;
/**
* The unique identifier for the discount code.
*/
@property (nonatomic, strong) NSString* code;
@property (nonatomic, strong) BUYCheckout *checkout;
@end
//
// _BUYDiscount.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYDiscount.m instead.
#import "_BUYDiscount.h"
const struct BUYDiscountAttributes BUYDiscountAttributes = {
.amount = @"amount",
.applicable = @"applicable",
.code = @"code",
};
const struct BUYDiscountRelationships BUYDiscountRelationships = {
.checkout = @"checkout",
};
const struct BUYDiscountUserInfo BUYDiscountUserInfo = {
.documentation = @"BUYDiscount represents a discount that is applied to the BUYCheckout.",
};
@implementation _BUYDiscount
+ (NSString *)entityName {
return @"Discount";
}
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
if ([key isEqualToString:@"applicableValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"applicable"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
return keyPaths;
}
- (BOOL)applicableValue {
NSNumber *result = [self applicable];
return [result boolValue];
}
- (void)setApplicableValue:(BOOL)value_ {
[self setApplicable:@(value_)];
}
@end
#pragma mark -
@implementation BUYModelManager (BUYDiscountInserting)
- (BUYDiscount *)insertDiscountWithJSONDictionary:(NSDictionary *)dictionary
{
return (BUYDiscount *)[self buy_objectWithEntityName:@"Discount" JSONDictionary:dictionary];
}
- (NSArray<BUYDiscount *> *)insertDiscountsWithJSONArray:(NSArray <NSDictionary *> *)array
{
return (NSArray<BUYDiscount *> *)[self buy_objectsWithEntityName:@"Discount" JSONArray:array];
}
- (NSArray<BUYDiscount *> *)allDiscountObjects
{
return (NSArray<BUYDiscount *> *)[self buy_objectsWithEntityName:@"Discount" identifiers:nil];
}
- (BUYDiscount *)fetchDiscountWithIdentifierValue:(int64_t)identifier
{
return (BUYDiscount *)[self buy_objectWithEntityName:@"Discount" identifier:@(identifier)];
}
@end
//
// _BUYGiftCard.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYGiftCard.h instead.
#import "BUYObject.h"
#import <Buy/BUYModelManager.h>
extern const struct BUYGiftCardAttributes {
__unsafe_unretained NSString *amountUsed;
__unsafe_unretained NSString *balance;
__unsafe_unretained NSString *code;
__unsafe_unretained NSString *identifier;
__unsafe_unretained NSString *lastCharacters;
} BUYGiftCardAttributes;
extern const struct BUYGiftCardRelationships {
__unsafe_unretained NSString *redemptions;
} BUYGiftCardRelationships;
extern const struct BUYGiftCardUserInfo {
__unsafe_unretained NSString *documentation;
} BUYGiftCardUserInfo;
@class BUYCheckout;
@class BUYGiftCard;
@interface BUYModelManager (BUYGiftCardInserting)
- (NSArray<BUYGiftCard *> *)allGiftCardObjects;
- (BUYGiftCard *)fetchGiftCardWithIdentifierValue:(int64_t)identifier;
- (BUYGiftCard *)insertGiftCardWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYGiftCard *> *)insertGiftCardsWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
/**
* A gift card redeemed as payment on the checkout.
*/
@interface _BUYGiftCard : BUYObject
+ (NSString *)entityName;
/**
* The amount of the gift card used by this checkout.
*/
@property (nonatomic, strong) NSDecimalNumber* amountUsed;
/**
* The amount left on the gift card after being applied to this checkout.
*/
@property (nonatomic, strong) NSDecimalNumber* balance;
/**
* The gift card code.
*
* This is only used when applying a gift card and is not visible on a BUYCheckout object synced with Shopify.
*/
@property (nonatomic, strong) NSString* code;
@property (nonatomic, strong) NSNumber* identifier;
@property (atomic) int64_t identifierValue;
- (int64_t)identifierValue;
- (void)setIdentifierValue:(int64_t)value_;
/**
* The last characters of the applied gift card code.
*/
@property (nonatomic, strong) NSString* lastCharacters;
/**
* Inverse of Checkout.giftCard.
*/
@property (nonatomic, strong) NSSet *redemptions;
- (NSMutableSet*)redemptionsSet;
@end
@interface _BUYGiftCard (RedemptionsCoreDataGeneratedAccessors)
@end
//
// _BUYGiftCard.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYGiftCard.m instead.
#import "_BUYGiftCard.h"
const struct BUYGiftCardAttributes BUYGiftCardAttributes = {
.amountUsed = @"amountUsed",
.balance = @"balance",
.code = @"code",
.identifier = @"identifier",
.lastCharacters = @"lastCharacters",
};
const struct BUYGiftCardRelationships BUYGiftCardRelationships = {
.redemptions = @"redemptions",
};
const struct BUYGiftCardUserInfo BUYGiftCardUserInfo = {
.documentation = @"A gift card redeemed as payment on the checkout.",
};
@implementation _BUYGiftCard
+ (NSString *)entityName {
return @"GiftCard";
}
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
if ([key isEqualToString:@"identifierValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"identifier"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
return keyPaths;
}
- (int64_t)identifierValue {
NSNumber *result = [self identifier];
return [result longLongValue];
}
- (void)setIdentifierValue:(int64_t)value_ {
[self setIdentifier:@(value_)];
}
- (NSMutableSet*)redemptionsSet {
return (NSMutableSet*)[self mutableSetValueForKey:@"redemptions"];
}
@end
#pragma mark -
@implementation BUYModelManager (BUYGiftCardInserting)
- (BUYGiftCard *)insertGiftCardWithJSONDictionary:(NSDictionary *)dictionary
{
return (BUYGiftCard *)[self buy_objectWithEntityName:@"GiftCard" JSONDictionary:dictionary];
}
- (NSArray<BUYGiftCard *> *)insertGiftCardsWithJSONArray:(NSArray <NSDictionary *> *)array
{
return (NSArray<BUYGiftCard *> *)[self buy_objectsWithEntityName:@"GiftCard" JSONArray:array];
}
- (NSArray<BUYGiftCard *> *)allGiftCardObjects
{
return (NSArray<BUYGiftCard *> *)[self buy_objectsWithEntityName:@"GiftCard" identifiers:nil];
}
- (BUYGiftCard *)fetchGiftCardWithIdentifierValue:(int64_t)identifier
{
return (BUYGiftCard *)[self buy_objectWithEntityName:@"GiftCard" identifier:@(identifier)];
}
@end
//
// _BUYMaskedCreditCard.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYMaskedCreditCard.h instead.
#import "BUYObject.h"
#import <Buy/BUYModelManager.h>
extern const struct BUYMaskedCreditCardAttributes {
__unsafe_unretained NSString *expiryMonth;
__unsafe_unretained NSString *expiryYear;
__unsafe_unretained NSString *firstDigits;
__unsafe_unretained NSString *firstName;
__unsafe_unretained NSString *lastDigits;
__unsafe_unretained NSString *lastName;
} BUYMaskedCreditCardAttributes;
extern const struct BUYMaskedCreditCardRelationships {
__unsafe_unretained NSString *checkout;
} BUYMaskedCreditCardRelationships;
extern const struct BUYMaskedCreditCardUserInfo {
__unsafe_unretained NSString *Transient;
__unsafe_unretained NSString *documentation;
} BUYMaskedCreditCardUserInfo;
@class BUYCheckout;
@class BUYMaskedCreditCard;
@interface BUYModelManager (BUYMaskedCreditCardInserting)
- (NSArray<BUYMaskedCreditCard *> *)allMaskedCreditCardObjects;
- (BUYMaskedCreditCard *)fetchMaskedCreditCardWithIdentifierValue:(int64_t)identifier;
- (BUYMaskedCreditCard *)insertMaskedCreditCardWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYMaskedCreditCard *> *)insertMaskedCreditCardsWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
/**
* This represents a masked credit card that has been applied to a checkout.
*/
@interface _BUYMaskedCreditCard : BUYObject
+ (NSString *)entityName;
/**
* The two digits representing the month the card expires.
*/
@property (nonatomic, strong) NSNumber* expiryMonth;
@property (atomic) int16_t expiryMonthValue;
- (int16_t)expiryMonthValue;
- (void)setExpiryMonthValue:(int16_t)value_;
/**
* The year the card expires.
*/
@property (nonatomic, strong) NSNumber* expiryYear;
@property (atomic) int32_t expiryYearValue;
- (int32_t)expiryYearValue;
- (void)setExpiryYearValue:(int32_t)value_;
/**
* The first digits of credit card number.
*/
@property (nonatomic, strong) NSString* firstDigits;
/**
* The first name on the credit card.
*/
@property (nonatomic, strong) NSString* firstName;
/**
* The last digits of credit card number.
*/
@property (nonatomic, strong) NSString* lastDigits;
/**
* The last name on the credit card.
*/
@property (nonatomic, strong) NSString* lastName;
/**
* Inverse of Checkout.creditCard.
*/
@property (nonatomic, strong) BUYCheckout *checkout;
@end
//
// _BUYMaskedCreditCard.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYMaskedCreditCard.m instead.
#import "_BUYMaskedCreditCard.h"
const struct BUYMaskedCreditCardAttributes BUYMaskedCreditCardAttributes = {
.expiryMonth = @"expiryMonth",
.expiryYear = @"expiryYear",
.firstDigits = @"firstDigits",
.firstName = @"firstName",
.lastDigits = @"lastDigits",
.lastName = @"lastName",
};
const struct BUYMaskedCreditCardRelationships BUYMaskedCreditCardRelationships = {
.checkout = @"checkout",
};
const struct BUYMaskedCreditCardUserInfo BUYMaskedCreditCardUserInfo = {
.Transient = @"YES",
.documentation = @"This represents a masked credit card that has been applied to a checkout.",
};
@implementation _BUYMaskedCreditCard
+ (NSString *)entityName {
return @"MaskedCreditCard";
}
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
if ([key isEqualToString:@"expiryMonthValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"expiryMonth"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
if ([key isEqualToString:@"expiryYearValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"expiryYear"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
return keyPaths;
}
- (int16_t)expiryMonthValue {
NSNumber *result = [self expiryMonth];
return [result shortValue];
}
- (void)setExpiryMonthValue:(int16_t)value_ {
[self setExpiryMonth:@(value_)];
}
- (int32_t)expiryYearValue {
NSNumber *result = [self expiryYear];
return [result intValue];
}
- (void)setExpiryYearValue:(int32_t)value_ {
[self setExpiryYear:@(value_)];
}
@end
#pragma mark -
@implementation BUYModelManager (BUYMaskedCreditCardInserting)
- (BUYMaskedCreditCard *)insertMaskedCreditCardWithJSONDictionary:(NSDictionary *)dictionary
{
return (BUYMaskedCreditCard *)[self buy_objectWithEntityName:@"MaskedCreditCard" JSONDictionary:dictionary];
}
- (NSArray<BUYMaskedCreditCard *> *)insertMaskedCreditCardsWithJSONArray:(NSArray <NSDictionary *> *)array
{
return (NSArray<BUYMaskedCreditCard *> *)[self buy_objectsWithEntityName:@"MaskedCreditCard" JSONArray:array];
}
- (NSArray<BUYMaskedCreditCard *> *)allMaskedCreditCardObjects
{
return (NSArray<BUYMaskedCreditCard *> *)[self buy_objectsWithEntityName:@"MaskedCreditCard" identifiers:nil];
}
- (BUYMaskedCreditCard *)fetchMaskedCreditCardWithIdentifierValue:(int64_t)identifier
{
return (BUYMaskedCreditCard *)[self buy_objectWithEntityName:@"MaskedCreditCard" identifier:@(identifier)];
}
@end
//
// _BUYShippingRate.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYShippingRate.h instead.
#import "BUYObject.h"
#import <Buy/BUYModelManager.h>
extern const struct BUYShippingRateAttributes {
__unsafe_unretained NSString *deliveryRange;
__unsafe_unretained NSString *identifier;
__unsafe_unretained NSString *price;
__unsafe_unretained NSString *shippingRateIdentifier;
__unsafe_unretained NSString *title;
} BUYShippingRateAttributes;
extern const struct BUYShippingRateRelationships {
__unsafe_unretained NSString *checkout;
} BUYShippingRateRelationships;
extern const struct BUYShippingRateUserInfo {
__unsafe_unretained NSString *Transient;
__unsafe_unretained NSString *documentation;
} BUYShippingRateUserInfo;
@class BUYCheckout;
@class NSArray;
@class BUYShippingRate;
@interface BUYModelManager (BUYShippingRateInserting)
- (NSArray<BUYShippingRate *> *)allShippingRateObjects;
- (BUYShippingRate *)fetchShippingRateWithIdentifierValue:(int64_t)identifier;
- (BUYShippingRate *)insertShippingRateWithJSONDictionary:(NSDictionary *)dictionary;
- (NSArray<BUYShippingRate *> *)insertShippingRatesWithJSONArray:(NSArray <NSDictionary *> *)array;
@end
/**
* BUYShippingRate represents the amount that the merchant is charging a customer for shipping to the specified address.
*/
@interface _BUYShippingRate : BUYObject
+ (NSString *)entityName;
/**
* One or two NSDate objects of the potential delivery dates.
*/
@property (nonatomic, strong) NSArray* deliveryRange;
@property (nonatomic, strong) NSNumber* identifier;
@property (atomic) int64_t identifierValue;
- (int64_t)identifierValue;
- (void)setIdentifierValue:(int64_t)value_;
/**
* The price of this shipping method.
*/
@property (nonatomic, strong) NSDecimalNumber* price;
/**
* A reference to the shipping method.
*/
@property (nonatomic, strong) NSString* shippingRateIdentifier;
/**
* The shipping method name.
*/
@property (nonatomic, strong) NSString* title;
@property (nonatomic, strong) BUYCheckout *checkout;
@end
//
// _BUYShippingRate.h
// Mobile Buy SDK
//
// 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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to BUYShippingRate.m instead.
#import "_BUYShippingRate.h"
const struct BUYShippingRateAttributes BUYShippingRateAttributes = {
.deliveryRange = @"deliveryRange",
.identifier = @"identifier",
.price = @"price",
.shippingRateIdentifier = @"shippingRateIdentifier",
.title = @"title",
};
const struct BUYShippingRateRelationships BUYShippingRateRelationships = {
.checkout = @"checkout",
};
const struct BUYShippingRateUserInfo BUYShippingRateUserInfo = {
.Transient = @"YES",
.documentation = @"BUYShippingRate represents the amount that the merchant is charging a customer for shipping to the specified address.",
};
@implementation _BUYShippingRate
+ (NSString *)entityName {
return @"ShippingRate";
}
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
if ([key isEqualToString:@"identifierValue"]) {
NSSet *affectingKey = [NSSet setWithObject:@"identifier"];
keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey];
return keyPaths;
}
return keyPaths;
}
- (int64_t)identifierValue {
NSNumber *result = [self identifier];
return [result longLongValue];
}
- (void)setIdentifierValue:(int64_t)value_ {
[self setIdentifier:@(value_)];
}
@end
#pragma mark -
@implementation BUYModelManager (BUYShippingRateInserting)
- (BUYShippingRate *)insertShippingRateWithJSONDictionary:(NSDictionary *)dictionary
{
return (BUYShippingRate *)[self buy_objectWithEntityName:@"ShippingRate" JSONDictionary:dictionary];
}
- (NSArray<BUYShippingRate *> *)insertShippingRatesWithJSONArray:(NSArray <NSDictionary *> *)array
{
return (NSArray<BUYShippingRate *> *)[self buy_objectsWithEntityName:@"ShippingRate" JSONArray:array];
}
- (NSArray<BUYShippingRate *> *)allShippingRateObjects
{
return (NSArray<BUYShippingRate *> *)[self buy_objectsWithEntityName:@"ShippingRate" identifiers:nil];
}
- (BUYShippingRate *)fetchShippingRateWithIdentifierValue:(int64_t)identifier
{
return (BUYShippingRate *)[self buy_objectWithEntityName:@"ShippingRate" identifier:@(identifier)];
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment