Skip to content

Commit

Permalink
Merge pull request #981 from Shopify/develop
Browse files Browse the repository at this point in the history
SDK 3.4.0
  • Loading branch information
jmignac authored Apr 2, 2019
2 parents 81cb622 + 9793d82 commit 670ff4f
Show file tree
Hide file tree
Showing 12 changed files with 437 additions and 32 deletions.
32 changes: 16 additions & 16 deletions Buy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2335,11 +2335,11 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CURRENT_PROJECT_VERSION = 3.3.2;
CURRENT_PROJECT_VERSION = 3.4.0;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 3.3.3;
DYLIB_CURRENT_VERSION = 3.4.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Pay/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand All @@ -2360,11 +2360,11 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CURRENT_PROJECT_VERSION = 3.3.2;
CURRENT_PROJECT_VERSION = 3.4.0;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 3.3.3;
DYLIB_CURRENT_VERSION = 3.4.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Pay/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down Expand Up @@ -2413,11 +2413,11 @@
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3.3.2;
CURRENT_PROJECT_VERSION = 3.4.0;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 3.3.3;
DYLIB_CURRENT_VERSION = 3.4.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Buy/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand All @@ -2441,11 +2441,11 @@
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3.3.2;
CURRENT_PROJECT_VERSION = 3.4.0;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 3.3.3;
DYLIB_CURRENT_VERSION = 3.4.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Buy/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down Expand Up @@ -2581,11 +2581,11 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "";
CURRENT_PROJECT_VERSION = 3.3.2;
CURRENT_PROJECT_VERSION = 3.4.0;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 3.3.3;
DYLIB_CURRENT_VERSION = 3.4.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Buy/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand All @@ -2603,11 +2603,11 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "";
CURRENT_PROJECT_VERSION = 3.3.2;
CURRENT_PROJECT_VERSION = 3.4.0;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 3.3.3;
DYLIB_CURRENT_VERSION = 3.4.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Buy/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand All @@ -2626,11 +2626,11 @@
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3.3.2;
CURRENT_PROJECT_VERSION = 3.4.0;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 3.3.3;
DYLIB_CURRENT_VERSION = 3.4.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Buy/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand All @@ -2655,11 +2655,11 @@
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 3.3.2;
CURRENT_PROJECT_VERSION = 3.4.0;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 3.3.3;
DYLIB_CURRENT_VERSION = 3.4.0;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Buy/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
Expand Down
71 changes: 70 additions & 1 deletion Buy/Generated/Storefront/AppliedGiftCard.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,41 @@ extension Storefront {
public typealias Response = AppliedGiftCard

/// The amount that was used taken from the Gift Card by applying it.
@available(*, deprecated, message:"Use `amountUsedV2` instead")
@discardableResult
open func amountUsed(alias: String? = nil) -> AppliedGiftCardQuery {
addField(field: "amountUsed", aliasSuffix: alias)
return self
}

/// The amount that was used taken from the Gift Card by applying it.
@discardableResult
open func amountUsedV2(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> AppliedGiftCardQuery {
let subquery = MoneyV2Query()
subfields(subquery)

addField(field: "amountUsedV2", aliasSuffix: alias, subfields: subquery)
return self
}

/// The amount left on the Gift Card.
@available(*, deprecated, message:"Use `balanceV2` instead")
@discardableResult
open func balance(alias: String? = nil) -> AppliedGiftCardQuery {
addField(field: "balance", aliasSuffix: alias)
return self
}

/// The amount left on the Gift Card.
@discardableResult
open func balanceV2(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> AppliedGiftCardQuery {
let subquery = MoneyV2Query()
subfields(subquery)

addField(field: "balanceV2", aliasSuffix: alias, subfields: subquery)
return self
}

/// Globally unique identifier.
@discardableResult
open func id(alias: String? = nil) -> AppliedGiftCardQuery {
Expand Down Expand Up @@ -73,12 +95,24 @@ extension Storefront {
}
return Decimal(string: value, locale: GraphQL.posixLocale)

case "amountUsedV2":
guard let value = value as? [String: Any] else {
throw SchemaViolationError(type: AppliedGiftCard.self, field: fieldName, value: fieldValue)
}
return try MoneyV2(fields: value)

case "balance":
guard let value = value as? String else {
throw SchemaViolationError(type: AppliedGiftCard.self, field: fieldName, value: fieldValue)
}
return Decimal(string: value, locale: GraphQL.posixLocale)

case "balanceV2":
guard let value = value as? [String: Any] else {
throw SchemaViolationError(type: AppliedGiftCard.self, field: fieldName, value: fieldValue)
}
return try MoneyV2(fields: value)

case "id":
guard let value = value as? String else {
throw SchemaViolationError(type: AppliedGiftCard.self, field: fieldName, value: fieldValue)
Expand All @@ -97,6 +131,7 @@ extension Storefront {
}

/// The amount that was used taken from the Gift Card by applying it.
@available(*, deprecated, message:"Use `amountUsedV2` instead")
open var amountUsed: Decimal {
return internalGetAmountUsed()
}
Expand All @@ -105,7 +140,17 @@ extension Storefront {
return field(field: "amountUsed", aliasSuffix: alias) as! Decimal
}

/// The amount that was used taken from the Gift Card by applying it.
open var amountUsedV2: Storefront.MoneyV2 {
return internalGetAmountUsedV2()
}

func internalGetAmountUsedV2(alias: String? = nil) -> Storefront.MoneyV2 {
return field(field: "amountUsedV2", aliasSuffix: alias) as! Storefront.MoneyV2
}

/// The amount left on the Gift Card.
@available(*, deprecated, message:"Use `balanceV2` instead")
open var balance: Decimal {
return internalGetBalance()
}
Expand All @@ -114,6 +159,15 @@ extension Storefront {
return field(field: "balance", aliasSuffix: alias) as! Decimal
}

/// The amount left on the Gift Card.
open var balanceV2: Storefront.MoneyV2 {
return internalGetBalanceV2()
}

func internalGetBalanceV2(alias: String? = nil) -> Storefront.MoneyV2 {
return field(field: "balanceV2", aliasSuffix: alias) as! Storefront.MoneyV2
}

/// Globally unique identifier.
open var id: GraphQL.ID {
return internalGetId()
Expand All @@ -133,7 +187,22 @@ extension Storefront {
}

internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] {
return []
var response: [GraphQL.AbstractResponse] = []
objectMap.keys.forEach {
switch($0) {
case "amountUsedV2":
response.append(internalGetAmountUsedV2())
response.append(contentsOf: internalGetAmountUsedV2().childResponseObjectMap())

case "balanceV2":
response.append(internalGetBalanceV2())
response.append(contentsOf: internalGetBalanceV2().childResponseObjectMap())

default:
break
}
}
return response
}
}
}
Loading

0 comments on commit 670ff4f

Please sign in to comment.