From 107704c6524d230c87984722addfda16575b5821 Mon Sep 17 00:00:00 2001 From: Jonathan Baker Date: Thu, 11 Jul 2024 20:53:24 +0000 Subject: [PATCH 1/8] Update schema to `2024-07`. --- Buy.xcodeproj/project.pbxproj | 648 ++++----- Buy/Generated/Storefront.Schema.swift | 2 +- .../Storefront/AvailableShippingRates.swift | 103 -- Buy/Generated/Storefront/Cart.swift | 42 +- .../CartAutomaticDiscountAllocation.swift | 22 + ... => CartBillingAddressUpdatePayload.swift} | 58 +- .../Storefront/CartBuyerIdentity.swift | 62 +- .../Storefront/CartBuyerIdentityInput.swift | 36 +- .../CartCodeDiscountAllocation.swift | 22 + .../CartCustomDiscountAllocation.swift | 22 + .../CartDeliveryCoordinatesPreference.swift | 125 ++ ...rtDeliveryCoordinatesPreferenceInput.swift | 81 ++ .../Storefront/CartDeliveryPreference.swift | 148 ++ .../CartDeliveryPreferenceInput.swift | 112 ++ .../Storefront/CartDiscountAllocation.swift | 24 + Buy/Generated/Storefront/CartErrorCode.swift | 3 + .../CartGiftCardCodesUpdatePayload.swift | 121 ++ Buy/Generated/Storefront/CartInput.swift | 27 +- .../Storefront/CartPreferences.swift | 123 ++ .../Storefront/CartPreferencesInput.swift | 94 ++ Buy/Generated/Storefront/Checkout.swift | 1067 --------------- .../CheckoutAttributesUpdateV2Input.swift | 110 -- .../CheckoutAttributesUpdateV2Payload.swift | 154 --- .../CheckoutCompleteFreePayload.swift | 154 --- ...ckoutCompleteWithCreditCardV2Payload.swift | 186 --- ...ompleteWithTokenizedPaymentV3Payload.swift | 186 --- .../Storefront/CheckoutCreateInput.swift | 194 --- .../Storefront/CheckoutCreatePayload.swift | 177 --- .../CheckoutCustomerAssociateV2Payload.swift | 186 --- ...heckoutCustomerDisassociateV2Payload.swift | 154 --- .../CheckoutDiscountCodeApplyV2Payload.swift | 154 --- .../CheckoutDiscountCodeRemovePayload.swift | 154 --- .../CheckoutEmailUpdateV2Payload.swift | 154 --- .../Storefront/CheckoutErrorCode.swift | 173 --- .../CheckoutGiftCardRemoveV2Payload.swift | 154 --- .../CheckoutGiftCardsAppendPayload.swift | 154 --- .../Storefront/CheckoutLineItem.swift | 254 ---- .../Storefront/CheckoutLineItemInput.swift | 91 -- .../CheckoutLineItemUpdateInput.swift | 123 -- .../CheckoutLineItemsAddPayload.swift | 154 --- .../CheckoutLineItemsRemovePayload.swift | 154 --- .../CheckoutLineItemsUpdatePayload.swift | 154 --- ...eckoutShippingAddressUpdateV2Payload.swift | 154 --- .../CheckoutShippingLineUpdatePayload.swift | 154 --- Buy/Generated/Storefront/CreditCard.swift | 235 ---- .../Storefront/CreditCardPaymentInputV2.swift | 110 -- Buy/Generated/Storefront/Customer.swift | 34 - .../Storefront/DeliveryAddressInput.swift | 28 +- .../Storefront/DisplayableError.swift | 22 +- Buy/Generated/Storefront/HasMetafields.swift | 12 + Buy/Generated/Storefront/MailingAddress.swift | 4 +- .../Storefront/MetafieldParentResource.swift | 11 + Buy/Generated/Storefront/Mutation.swift | 1191 +++-------------- Buy/Generated/Storefront/Node.swift | 56 +- Buy/Generated/Storefront/Order.swift | 33 + Buy/Generated/Storefront/Payment.swift | 388 ------ ...ift => PreferenceDeliveryMethodType.swift} | 29 +- Buy/Generated/Storefront/ProductOption.swift | 27 + .../Storefront/ProductOptionValue.swift | 136 ++ .../Storefront/ProductOptionValueSwatch.swift | 113 ++ Buy/Generated/Storefront/ProductVariant.swift | 148 ++ .../Storefront/ProductVariantComponent.swift | 109 ++ ...> ProductVariantComponentConnection.swift} | 54 +- ...wift => ProductVariantComponentEdge.swift} | 42 +- Buy/Generated/Storefront/QueryRoot.swift | 35 +- Buy/Generated/Storefront/SellingPlan.swift | 172 ++- ...y.swift => SellingPlanBillingPolicy.swift} | 55 +- .../SellingPlanDeliveryPolicy.swift | 81 ++ ...Status.swift => SellingPlanInterval.swift} | 22 +- .../SellingPlanRecurringBillingPolicy.swift | 95 ++ .../SellingPlanRecurringDeliveryPolicy.swift | 95 ++ Buy/Generated/Storefront/ShippingRate.swift | 162 --- .../Storefront/ShopPayPaymentRequest.swift | 427 ++++++ .../ShopPayPaymentRequestContactField.swift | 299 +++++ .../ShopPayPaymentRequestDeliveryMethod.swift | 223 +++ ...PayPaymentRequestDeliveryMethodInput.swift | 171 +++ ...PayPaymentRequestDeliveryMethodType.swift} | 23 +- .../ShopPayPaymentRequestDiscount.swift | 109 ++ .../ShopPayPaymentRequestDiscountInput.swift | 90 ++ .../ShopPayPaymentRequestImage.swift | 96 ++ ... => ShopPayPaymentRequestImageInput.swift} | 49 +- .../ShopPayPaymentRequestInput.swift | 239 ++++ .../ShopPayPaymentRequestLineItem.swift | 370 +++++ .../ShopPayPaymentRequestLineItemInput.swift | 228 ++++ .../ShopPayPaymentRequestReceipt.swift | 131 ++ .../ShopPayPaymentRequestSession.swift | 153 +++ ...ayPaymentRequestSessionCreatePayload.swift | 121 ++ ...ayPaymentRequestSessionSubmitPayload.swift | 121 ++ .../ShopPayPaymentRequestShippingLine.swift | 131 ++ ...opPayPaymentRequestShippingLineInput.swift | 106 ++ ...pPayPaymentRequestTotalShippingPrice.swift | 150 +++ ...aymentRequestTotalShippingPriceInput.swift | 107 ++ .../Storefront/TokenizedPaymentInputV3.swift | 136 -- Buy/Generated/Storefront/Transaction.swift | 209 --- ...pPayPaymentRequestSessionUserErrors.swift} | 36 +- ...yPaymentRequestSessionUserErrorsCode.swift | 44 + Buy/Info.plist | 2 +- Buy/Utilities/SDK.swift | 2 +- BuyTests/Info.plist | 2 +- Mobile-Buy-SDK.podspec | 2 +- Pay/Info.plist | 2 +- PayTests/Info.plist | 2 +- 102 files changed, 6172 insertions(+), 7732 deletions(-) delete mode 100644 Buy/Generated/Storefront/AvailableShippingRates.swift rename Buy/Generated/Storefront/{CheckoutLineItemsReplacePayload.swift => CartBillingAddressUpdatePayload.swift} (63%) create mode 100644 Buy/Generated/Storefront/CartDeliveryCoordinatesPreference.swift create mode 100644 Buy/Generated/Storefront/CartDeliveryCoordinatesPreferenceInput.swift create mode 100644 Buy/Generated/Storefront/CartDeliveryPreference.swift create mode 100644 Buy/Generated/Storefront/CartDeliveryPreferenceInput.swift create mode 100644 Buy/Generated/Storefront/CartGiftCardCodesUpdatePayload.swift create mode 100644 Buy/Generated/Storefront/CartPreferences.swift create mode 100644 Buy/Generated/Storefront/CartPreferencesInput.swift delete mode 100644 Buy/Generated/Storefront/Checkout.swift delete mode 100644 Buy/Generated/Storefront/CheckoutAttributesUpdateV2Input.swift delete mode 100644 Buy/Generated/Storefront/CheckoutAttributesUpdateV2Payload.swift delete mode 100644 Buy/Generated/Storefront/CheckoutCompleteFreePayload.swift delete mode 100644 Buy/Generated/Storefront/CheckoutCompleteWithCreditCardV2Payload.swift delete mode 100644 Buy/Generated/Storefront/CheckoutCompleteWithTokenizedPaymentV3Payload.swift delete mode 100644 Buy/Generated/Storefront/CheckoutCreateInput.swift delete mode 100644 Buy/Generated/Storefront/CheckoutCreatePayload.swift delete mode 100644 Buy/Generated/Storefront/CheckoutCustomerAssociateV2Payload.swift delete mode 100644 Buy/Generated/Storefront/CheckoutCustomerDisassociateV2Payload.swift delete mode 100644 Buy/Generated/Storefront/CheckoutDiscountCodeApplyV2Payload.swift delete mode 100644 Buy/Generated/Storefront/CheckoutDiscountCodeRemovePayload.swift delete mode 100644 Buy/Generated/Storefront/CheckoutEmailUpdateV2Payload.swift delete mode 100644 Buy/Generated/Storefront/CheckoutErrorCode.swift delete mode 100644 Buy/Generated/Storefront/CheckoutGiftCardRemoveV2Payload.swift delete mode 100644 Buy/Generated/Storefront/CheckoutGiftCardsAppendPayload.swift delete mode 100644 Buy/Generated/Storefront/CheckoutLineItem.swift delete mode 100644 Buy/Generated/Storefront/CheckoutLineItemInput.swift delete mode 100644 Buy/Generated/Storefront/CheckoutLineItemUpdateInput.swift delete mode 100644 Buy/Generated/Storefront/CheckoutLineItemsAddPayload.swift delete mode 100644 Buy/Generated/Storefront/CheckoutLineItemsRemovePayload.swift delete mode 100644 Buy/Generated/Storefront/CheckoutLineItemsUpdatePayload.swift delete mode 100644 Buy/Generated/Storefront/CheckoutShippingAddressUpdateV2Payload.swift delete mode 100644 Buy/Generated/Storefront/CheckoutShippingLineUpdatePayload.swift delete mode 100644 Buy/Generated/Storefront/CreditCard.swift delete mode 100644 Buy/Generated/Storefront/CreditCardPaymentInputV2.swift delete mode 100644 Buy/Generated/Storefront/Payment.swift rename Buy/Generated/Storefront/{TransactionKind.swift => PreferenceDeliveryMethodType.swift} (64%) create mode 100644 Buy/Generated/Storefront/ProductOptionValue.swift create mode 100644 Buy/Generated/Storefront/ProductOptionValueSwatch.swift create mode 100644 Buy/Generated/Storefront/ProductVariantComponent.swift rename Buy/Generated/Storefront/{CheckoutLineItemConnection.swift => ProductVariantComponentConnection.swift} (62%) rename Buy/Generated/Storefront/{CheckoutLineItemEdge.swift => ProductVariantComponentEdge.swift} (63%) rename Buy/Generated/Storefront/{CheckoutBuyerIdentity.swift => SellingPlanBillingPolicy.swift} (50%) create mode 100644 Buy/Generated/Storefront/SellingPlanDeliveryPolicy.swift rename Buy/Generated/Storefront/{TransactionStatus.swift => SellingPlanInterval.swift} (76%) create mode 100644 Buy/Generated/Storefront/SellingPlanRecurringBillingPolicy.swift create mode 100644 Buy/Generated/Storefront/SellingPlanRecurringDeliveryPolicy.swift delete mode 100644 Buy/Generated/Storefront/ShippingRate.swift create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequest.swift create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestContactField.swift create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestDeliveryMethod.swift create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestDeliveryMethodInput.swift rename Buy/Generated/Storefront/{PaymentTokenType.swift => ShopPayPaymentRequestDeliveryMethodType.swift} (74%) create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestDiscount.swift create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestDiscountInput.swift create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestImage.swift rename Buy/Generated/Storefront/{CheckoutBuyerIdentityInput.swift => ShopPayPaymentRequestImageInput.swift} (53%) create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestInput.swift create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestLineItem.swift create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestLineItemInput.swift create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestReceipt.swift create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestSession.swift create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestSessionCreatePayload.swift create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestSessionSubmitPayload.swift create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestShippingLine.swift create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestShippingLineInput.swift create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestTotalShippingPrice.swift create mode 100644 Buy/Generated/Storefront/ShopPayPaymentRequestTotalShippingPriceInput.swift delete mode 100644 Buy/Generated/Storefront/TokenizedPaymentInputV3.swift delete mode 100644 Buy/Generated/Storefront/Transaction.swift rename Buy/Generated/Storefront/{CheckoutUserError.swift => UserErrorsShopPayPaymentRequestSessionUserErrors.swift} (61%) create mode 100644 Buy/Generated/Storefront/UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift diff --git a/Buy.xcodeproj/project.pbxproj b/Buy.xcodeproj/project.pbxproj index a94ef711..461a2f8d 100644 --- a/Buy.xcodeproj/project.pbxproj +++ b/Buy.xcodeproj/project.pbxproj @@ -33,18 +33,9 @@ 21751EF3243D136A005001D4 /* CustomerActivateByUrlPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21751EE8243D1369005001D4 /* CustomerActivateByUrlPayload.swift */; }; 21751EF4243D136A005001D4 /* CustomerActivateByUrlPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21751EE8243D1369005001D4 /* CustomerActivateByUrlPayload.swift */; }; 21751EF5243D136A005001D4 /* CustomerActivateByUrlPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21751EE8243D1369005001D4 /* CustomerActivateByUrlPayload.swift */; }; - 21751EF6243D136A005001D4 /* CheckoutCompleteWithTokenizedPaymentV3Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21751EE9243D1369005001D4 /* CheckoutCompleteWithTokenizedPaymentV3Payload.swift */; }; - 21751EF7243D136A005001D4 /* CheckoutCompleteWithTokenizedPaymentV3Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21751EE9243D1369005001D4 /* CheckoutCompleteWithTokenizedPaymentV3Payload.swift */; }; - 21751EF8243D136A005001D4 /* CheckoutCompleteWithTokenizedPaymentV3Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21751EE9243D1369005001D4 /* CheckoutCompleteWithTokenizedPaymentV3Payload.swift */; }; 21751EF9243D136A005001D4 /* CustomerAccessTokenCreateWithMultipassPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21751EEA243D1369005001D4 /* CustomerAccessTokenCreateWithMultipassPayload.swift */; }; 21751EFA243D136A005001D4 /* CustomerAccessTokenCreateWithMultipassPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21751EEA243D1369005001D4 /* CustomerAccessTokenCreateWithMultipassPayload.swift */; }; 21751EFB243D136A005001D4 /* CustomerAccessTokenCreateWithMultipassPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21751EEA243D1369005001D4 /* CustomerAccessTokenCreateWithMultipassPayload.swift */; }; - 21751EFC243D136A005001D4 /* PaymentTokenType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21751EEB243D136A005001D4 /* PaymentTokenType.swift */; }; - 21751EFD243D136A005001D4 /* PaymentTokenType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21751EEB243D136A005001D4 /* PaymentTokenType.swift */; }; - 21751EFE243D136A005001D4 /* PaymentTokenType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21751EEB243D136A005001D4 /* PaymentTokenType.swift */; }; - 21751EFF243D136A005001D4 /* TokenizedPaymentInputV3.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21751EEC243D136A005001D4 /* TokenizedPaymentInputV3.swift */; }; - 21751F00243D136A005001D4 /* TokenizedPaymentInputV3.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21751EEC243D136A005001D4 /* TokenizedPaymentInputV3.swift */; }; - 21751F01243D136A005001D4 /* TokenizedPaymentInputV3.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21751EEC243D136A005001D4 /* TokenizedPaymentInputV3.swift */; }; 4E28FECE270780B500F9EBED /* CartDiscountCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E28FEB3270780B300F9EBED /* CartDiscountCode.swift */; }; 4E28FECF270780B500F9EBED /* CartDiscountCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E28FEB3270780B300F9EBED /* CartDiscountCode.swift */; }; 4E28FED0270780B500F9EBED /* CartDiscountCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E28FEB3270780B300F9EBED /* CartDiscountCode.swift */; }; @@ -378,6 +369,129 @@ 4EC215C32A55CB8800BD6148 /* SearchQuerySuggestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC215952A55CB8700BD6148 /* SearchQuerySuggestion.swift */; }; 4EC215C42A55CB8800BD6148 /* SearchQuerySuggestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC215952A55CB8700BD6148 /* SearchQuerySuggestion.swift */; }; 4EC215C52A55CB8800BD6148 /* SearchQuerySuggestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC215952A55CB8700BD6148 /* SearchQuerySuggestion.swift */; }; + 4EC30D9E2C407F5A00D9336D /* ShopPayPaymentRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D752C407F5800D9336D /* ShopPayPaymentRequest.swift */; }; + 4EC30D9F2C407F5A00D9336D /* ShopPayPaymentRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D752C407F5800D9336D /* ShopPayPaymentRequest.swift */; }; + 4EC30DA02C407F5A00D9336D /* ShopPayPaymentRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D752C407F5800D9336D /* ShopPayPaymentRequest.swift */; }; + 4EC30DA12C407F5A00D9336D /* SellingPlanInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D762C407F5900D9336D /* SellingPlanInterval.swift */; }; + 4EC30DA22C407F5A00D9336D /* SellingPlanInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D762C407F5900D9336D /* SellingPlanInterval.swift */; }; + 4EC30DA32C407F5A00D9336D /* SellingPlanInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D762C407F5900D9336D /* SellingPlanInterval.swift */; }; + 4EC30DA42C407F5A00D9336D /* CartPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D772C407F5900D9336D /* CartPreferences.swift */; }; + 4EC30DA52C407F5A00D9336D /* CartPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D772C407F5900D9336D /* CartPreferences.swift */; }; + 4EC30DA62C407F5A00D9336D /* CartPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D772C407F5900D9336D /* CartPreferences.swift */; }; + 4EC30DA72C407F5A00D9336D /* ShopPayPaymentRequestDiscountInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D782C407F5900D9336D /* ShopPayPaymentRequestDiscountInput.swift */; }; + 4EC30DA82C407F5A00D9336D /* ShopPayPaymentRequestDiscountInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D782C407F5900D9336D /* ShopPayPaymentRequestDiscountInput.swift */; }; + 4EC30DA92C407F5A00D9336D /* ShopPayPaymentRequestDiscountInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D782C407F5900D9336D /* ShopPayPaymentRequestDiscountInput.swift */; }; + 4EC30DAA2C407F5A00D9336D /* ShopPayPaymentRequestDeliveryMethodInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D792C407F5900D9336D /* ShopPayPaymentRequestDeliveryMethodInput.swift */; }; + 4EC30DAB2C407F5A00D9336D /* ShopPayPaymentRequestDeliveryMethodInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D792C407F5900D9336D /* ShopPayPaymentRequestDeliveryMethodInput.swift */; }; + 4EC30DAC2C407F5A00D9336D /* ShopPayPaymentRequestDeliveryMethodInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D792C407F5900D9336D /* ShopPayPaymentRequestDeliveryMethodInput.swift */; }; + 4EC30DAD2C407F5A00D9336D /* ProductVariantComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7A2C407F5900D9336D /* ProductVariantComponent.swift */; }; + 4EC30DAE2C407F5A00D9336D /* ProductVariantComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7A2C407F5900D9336D /* ProductVariantComponent.swift */; }; + 4EC30DAF2C407F5A00D9336D /* ProductVariantComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7A2C407F5900D9336D /* ProductVariantComponent.swift */; }; + 4EC30DB02C407F5A00D9336D /* ShopPayPaymentRequestSessionSubmitPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7B2C407F5900D9336D /* ShopPayPaymentRequestSessionSubmitPayload.swift */; }; + 4EC30DB12C407F5B00D9336D /* ShopPayPaymentRequestSessionSubmitPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7B2C407F5900D9336D /* ShopPayPaymentRequestSessionSubmitPayload.swift */; }; + 4EC30DB22C407F5B00D9336D /* ShopPayPaymentRequestSessionSubmitPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7B2C407F5900D9336D /* ShopPayPaymentRequestSessionSubmitPayload.swift */; }; + 4EC30DB32C407F5B00D9336D /* ShopPayPaymentRequestTotalShippingPriceInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7C2C407F5900D9336D /* ShopPayPaymentRequestTotalShippingPriceInput.swift */; }; + 4EC30DB42C407F5B00D9336D /* ShopPayPaymentRequestTotalShippingPriceInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7C2C407F5900D9336D /* ShopPayPaymentRequestTotalShippingPriceInput.swift */; }; + 4EC30DB52C407F5B00D9336D /* ShopPayPaymentRequestTotalShippingPriceInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7C2C407F5900D9336D /* ShopPayPaymentRequestTotalShippingPriceInput.swift */; }; + 4EC30DB62C407F5B00D9336D /* ShopPayPaymentRequestSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7D2C407F5900D9336D /* ShopPayPaymentRequestSession.swift */; }; + 4EC30DB72C407F5B00D9336D /* ShopPayPaymentRequestSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7D2C407F5900D9336D /* ShopPayPaymentRequestSession.swift */; }; + 4EC30DB82C407F5B00D9336D /* ShopPayPaymentRequestSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7D2C407F5900D9336D /* ShopPayPaymentRequestSession.swift */; }; + 4EC30DB92C407F5B00D9336D /* CartDeliveryPreferenceInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7E2C407F5900D9336D /* CartDeliveryPreferenceInput.swift */; }; + 4EC30DBA2C407F5B00D9336D /* CartDeliveryPreferenceInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7E2C407F5900D9336D /* CartDeliveryPreferenceInput.swift */; }; + 4EC30DBB2C407F5B00D9336D /* CartDeliveryPreferenceInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7E2C407F5900D9336D /* CartDeliveryPreferenceInput.swift */; }; + 4EC30DBC2C407F5B00D9336D /* ShopPayPaymentRequestContactField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7F2C407F5900D9336D /* ShopPayPaymentRequestContactField.swift */; }; + 4EC30DBD2C407F5B00D9336D /* ShopPayPaymentRequestContactField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7F2C407F5900D9336D /* ShopPayPaymentRequestContactField.swift */; }; + 4EC30DBE2C407F5B00D9336D /* ShopPayPaymentRequestContactField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D7F2C407F5900D9336D /* ShopPayPaymentRequestContactField.swift */; }; + 4EC30DBF2C407F5B00D9336D /* CartDeliveryCoordinatesPreference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D802C407F5900D9336D /* CartDeliveryCoordinatesPreference.swift */; }; + 4EC30DC02C407F5B00D9336D /* CartDeliveryCoordinatesPreference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D802C407F5900D9336D /* CartDeliveryCoordinatesPreference.swift */; }; + 4EC30DC12C407F5B00D9336D /* CartDeliveryCoordinatesPreference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D802C407F5900D9336D /* CartDeliveryCoordinatesPreference.swift */; }; + 4EC30DC22C407F5B00D9336D /* ShopPayPaymentRequestTotalShippingPrice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D812C407F5900D9336D /* ShopPayPaymentRequestTotalShippingPrice.swift */; }; + 4EC30DC32C407F5B00D9336D /* ShopPayPaymentRequestTotalShippingPrice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D812C407F5900D9336D /* ShopPayPaymentRequestTotalShippingPrice.swift */; }; + 4EC30DC42C407F5B00D9336D /* ShopPayPaymentRequestTotalShippingPrice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D812C407F5900D9336D /* ShopPayPaymentRequestTotalShippingPrice.swift */; }; + 4EC30DC52C407F5B00D9336D /* ShopPayPaymentRequestShippingLine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D822C407F5900D9336D /* ShopPayPaymentRequestShippingLine.swift */; }; + 4EC30DC62C407F5B00D9336D /* ShopPayPaymentRequestShippingLine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D822C407F5900D9336D /* ShopPayPaymentRequestShippingLine.swift */; }; + 4EC30DC72C407F5B00D9336D /* ShopPayPaymentRequestShippingLine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D822C407F5900D9336D /* ShopPayPaymentRequestShippingLine.swift */; }; + 4EC30DC82C407F5B00D9336D /* ShopPayPaymentRequestInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D832C407F5900D9336D /* ShopPayPaymentRequestInput.swift */; }; + 4EC30DC92C407F5B00D9336D /* ShopPayPaymentRequestInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D832C407F5900D9336D /* ShopPayPaymentRequestInput.swift */; }; + 4EC30DCA2C407F5B00D9336D /* ShopPayPaymentRequestInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D832C407F5900D9336D /* ShopPayPaymentRequestInput.swift */; }; + 4EC30DCB2C407F5B00D9336D /* SellingPlanRecurringBillingPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D842C407F5900D9336D /* SellingPlanRecurringBillingPolicy.swift */; }; + 4EC30DCC2C407F5B00D9336D /* SellingPlanRecurringBillingPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D842C407F5900D9336D /* SellingPlanRecurringBillingPolicy.swift */; }; + 4EC30DCD2C407F5B00D9336D /* SellingPlanRecurringBillingPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D842C407F5900D9336D /* SellingPlanRecurringBillingPolicy.swift */; }; + 4EC30DCE2C407F5B00D9336D /* CartGiftCardCodesUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D852C407F5900D9336D /* CartGiftCardCodesUpdatePayload.swift */; }; + 4EC30DCF2C407F5B00D9336D /* CartGiftCardCodesUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D852C407F5900D9336D /* CartGiftCardCodesUpdatePayload.swift */; }; + 4EC30DD02C407F5B00D9336D /* CartGiftCardCodesUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D852C407F5900D9336D /* CartGiftCardCodesUpdatePayload.swift */; }; + 4EC30DD12C407F5B00D9336D /* CartBillingAddressUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D862C407F5900D9336D /* CartBillingAddressUpdatePayload.swift */; }; + 4EC30DD22C407F5B00D9336D /* CartBillingAddressUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D862C407F5900D9336D /* CartBillingAddressUpdatePayload.swift */; }; + 4EC30DD32C407F5B00D9336D /* CartBillingAddressUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D862C407F5900D9336D /* CartBillingAddressUpdatePayload.swift */; }; + 4EC30DD42C407F5B00D9336D /* CartDeliveryCoordinatesPreferenceInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D872C407F5900D9336D /* CartDeliveryCoordinatesPreferenceInput.swift */; }; + 4EC30DD52C407F5B00D9336D /* CartDeliveryCoordinatesPreferenceInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D872C407F5900D9336D /* CartDeliveryCoordinatesPreferenceInput.swift */; }; + 4EC30DD62C407F5B00D9336D /* CartDeliveryCoordinatesPreferenceInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D872C407F5900D9336D /* CartDeliveryCoordinatesPreferenceInput.swift */; }; + 4EC30DD72C407F5B00D9336D /* ShopPayPaymentRequestDeliveryMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D882C407F5900D9336D /* ShopPayPaymentRequestDeliveryMethod.swift */; }; + 4EC30DD82C407F5B00D9336D /* ShopPayPaymentRequestDeliveryMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D882C407F5900D9336D /* ShopPayPaymentRequestDeliveryMethod.swift */; }; + 4EC30DD92C407F5B00D9336D /* ShopPayPaymentRequestDeliveryMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D882C407F5900D9336D /* ShopPayPaymentRequestDeliveryMethod.swift */; }; + 4EC30DDA2C407F5B00D9336D /* ShopPayPaymentRequestImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D892C407F5900D9336D /* ShopPayPaymentRequestImage.swift */; }; + 4EC30DDB2C407F5B00D9336D /* ShopPayPaymentRequestImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D892C407F5900D9336D /* ShopPayPaymentRequestImage.swift */; }; + 4EC30DDC2C407F5B00D9336D /* ShopPayPaymentRequestImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D892C407F5900D9336D /* ShopPayPaymentRequestImage.swift */; }; + 4EC30DDD2C407F5B00D9336D /* ProductOptionValueSwatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8A2C407F5A00D9336D /* ProductOptionValueSwatch.swift */; }; + 4EC30DDE2C407F5B00D9336D /* ProductOptionValueSwatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8A2C407F5A00D9336D /* ProductOptionValueSwatch.swift */; }; + 4EC30DDF2C407F5B00D9336D /* ProductOptionValueSwatch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8A2C407F5A00D9336D /* ProductOptionValueSwatch.swift */; }; + 4EC30DE02C407F5B00D9336D /* ProductOptionValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8B2C407F5A00D9336D /* ProductOptionValue.swift */; }; + 4EC30DE12C407F5B00D9336D /* ProductOptionValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8B2C407F5A00D9336D /* ProductOptionValue.swift */; }; + 4EC30DE22C407F5B00D9336D /* ProductOptionValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8B2C407F5A00D9336D /* ProductOptionValue.swift */; }; + 4EC30DE32C407F5B00D9336D /* ProductVariantComponentConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8C2C407F5A00D9336D /* ProductVariantComponentConnection.swift */; }; + 4EC30DE42C407F5B00D9336D /* ProductVariantComponentConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8C2C407F5A00D9336D /* ProductVariantComponentConnection.swift */; }; + 4EC30DE52C407F5B00D9336D /* ProductVariantComponentConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8C2C407F5A00D9336D /* ProductVariantComponentConnection.swift */; }; + 4EC30DE62C407F5B00D9336D /* ShopPayPaymentRequestSessionCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8D2C407F5A00D9336D /* ShopPayPaymentRequestSessionCreatePayload.swift */; }; + 4EC30DE72C407F5B00D9336D /* ShopPayPaymentRequestSessionCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8D2C407F5A00D9336D /* ShopPayPaymentRequestSessionCreatePayload.swift */; }; + 4EC30DE82C407F5B00D9336D /* ShopPayPaymentRequestSessionCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8D2C407F5A00D9336D /* ShopPayPaymentRequestSessionCreatePayload.swift */; }; + 4EC30DE92C407F5B00D9336D /* ShopPayPaymentRequestDeliveryMethodType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8E2C407F5A00D9336D /* ShopPayPaymentRequestDeliveryMethodType.swift */; }; + 4EC30DEA2C407F5B00D9336D /* ShopPayPaymentRequestDeliveryMethodType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8E2C407F5A00D9336D /* ShopPayPaymentRequestDeliveryMethodType.swift */; }; + 4EC30DEB2C407F5B00D9336D /* ShopPayPaymentRequestDeliveryMethodType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8E2C407F5A00D9336D /* ShopPayPaymentRequestDeliveryMethodType.swift */; }; + 4EC30DEC2C407F5B00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8F2C407F5A00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift */; }; + 4EC30DED2C407F5B00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8F2C407F5A00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift */; }; + 4EC30DEE2C407F5B00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D8F2C407F5A00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift */; }; + 4EC30DEF2C407F5B00D9336D /* ShopPayPaymentRequestLineItemInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D902C407F5A00D9336D /* ShopPayPaymentRequestLineItemInput.swift */; }; + 4EC30DF02C407F5B00D9336D /* ShopPayPaymentRequestLineItemInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D902C407F5A00D9336D /* ShopPayPaymentRequestLineItemInput.swift */; }; + 4EC30DF12C407F5B00D9336D /* ShopPayPaymentRequestLineItemInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D902C407F5A00D9336D /* ShopPayPaymentRequestLineItemInput.swift */; }; + 4EC30DF22C407F5B00D9336D /* ShopPayPaymentRequestLineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D912C407F5A00D9336D /* ShopPayPaymentRequestLineItem.swift */; }; + 4EC30DF32C407F5B00D9336D /* ShopPayPaymentRequestLineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D912C407F5A00D9336D /* ShopPayPaymentRequestLineItem.swift */; }; + 4EC30DF42C407F5B00D9336D /* ShopPayPaymentRequestLineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D912C407F5A00D9336D /* ShopPayPaymentRequestLineItem.swift */; }; + 4EC30DF52C407F5B00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D922C407F5A00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrors.swift */; }; + 4EC30DF62C407F5B00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D922C407F5A00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrors.swift */; }; + 4EC30DF72C407F5B00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D922C407F5A00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrors.swift */; }; + 4EC30DF82C407F5B00D9336D /* CartDeliveryPreference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D932C407F5A00D9336D /* CartDeliveryPreference.swift */; }; + 4EC30DF92C407F5B00D9336D /* CartDeliveryPreference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D932C407F5A00D9336D /* CartDeliveryPreference.swift */; }; + 4EC30DFA2C407F5B00D9336D /* CartDeliveryPreference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D932C407F5A00D9336D /* CartDeliveryPreference.swift */; }; + 4EC30DFB2C407F5B00D9336D /* ShopPayPaymentRequestImageInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D942C407F5A00D9336D /* ShopPayPaymentRequestImageInput.swift */; }; + 4EC30DFC2C407F5B00D9336D /* ShopPayPaymentRequestImageInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D942C407F5A00D9336D /* ShopPayPaymentRequestImageInput.swift */; }; + 4EC30DFD2C407F5B00D9336D /* ShopPayPaymentRequestImageInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D942C407F5A00D9336D /* ShopPayPaymentRequestImageInput.swift */; }; + 4EC30DFE2C407F5B00D9336D /* ShopPayPaymentRequestReceipt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D952C407F5A00D9336D /* ShopPayPaymentRequestReceipt.swift */; }; + 4EC30DFF2C407F5B00D9336D /* ShopPayPaymentRequestReceipt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D952C407F5A00D9336D /* ShopPayPaymentRequestReceipt.swift */; }; + 4EC30E002C407F5B00D9336D /* ShopPayPaymentRequestReceipt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D952C407F5A00D9336D /* ShopPayPaymentRequestReceipt.swift */; }; + 4EC30E012C407F5B00D9336D /* ShopPayPaymentRequestShippingLineInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D962C407F5A00D9336D /* ShopPayPaymentRequestShippingLineInput.swift */; }; + 4EC30E022C407F5B00D9336D /* ShopPayPaymentRequestShippingLineInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D962C407F5A00D9336D /* ShopPayPaymentRequestShippingLineInput.swift */; }; + 4EC30E032C407F5B00D9336D /* ShopPayPaymentRequestShippingLineInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D962C407F5A00D9336D /* ShopPayPaymentRequestShippingLineInput.swift */; }; + 4EC30E042C407F5B00D9336D /* ShopPayPaymentRequestDiscount.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D972C407F5A00D9336D /* ShopPayPaymentRequestDiscount.swift */; }; + 4EC30E052C407F5B00D9336D /* ShopPayPaymentRequestDiscount.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D972C407F5A00D9336D /* ShopPayPaymentRequestDiscount.swift */; }; + 4EC30E062C407F5B00D9336D /* ShopPayPaymentRequestDiscount.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D972C407F5A00D9336D /* ShopPayPaymentRequestDiscount.swift */; }; + 4EC30E072C407F5B00D9336D /* ProductVariantComponentEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D982C407F5A00D9336D /* ProductVariantComponentEdge.swift */; }; + 4EC30E082C407F5B00D9336D /* ProductVariantComponentEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D982C407F5A00D9336D /* ProductVariantComponentEdge.swift */; }; + 4EC30E092C407F5B00D9336D /* ProductVariantComponentEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D982C407F5A00D9336D /* ProductVariantComponentEdge.swift */; }; + 4EC30E0A2C407F5B00D9336D /* CartPreferencesInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D992C407F5A00D9336D /* CartPreferencesInput.swift */; }; + 4EC30E0B2C407F5B00D9336D /* CartPreferencesInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D992C407F5A00D9336D /* CartPreferencesInput.swift */; }; + 4EC30E0C2C407F5B00D9336D /* CartPreferencesInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D992C407F5A00D9336D /* CartPreferencesInput.swift */; }; + 4EC30E0D2C407F5B00D9336D /* PreferenceDeliveryMethodType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D9A2C407F5A00D9336D /* PreferenceDeliveryMethodType.swift */; }; + 4EC30E0E2C407F5B00D9336D /* PreferenceDeliveryMethodType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D9A2C407F5A00D9336D /* PreferenceDeliveryMethodType.swift */; }; + 4EC30E0F2C407F5B00D9336D /* PreferenceDeliveryMethodType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D9A2C407F5A00D9336D /* PreferenceDeliveryMethodType.swift */; }; + 4EC30E102C407F5B00D9336D /* SellingPlanBillingPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D9B2C407F5A00D9336D /* SellingPlanBillingPolicy.swift */; }; + 4EC30E112C407F5B00D9336D /* SellingPlanBillingPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D9B2C407F5A00D9336D /* SellingPlanBillingPolicy.swift */; }; + 4EC30E122C407F5B00D9336D /* SellingPlanBillingPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D9B2C407F5A00D9336D /* SellingPlanBillingPolicy.swift */; }; + 4EC30E132C407F5B00D9336D /* SellingPlanDeliveryPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D9C2C407F5A00D9336D /* SellingPlanDeliveryPolicy.swift */; }; + 4EC30E142C407F5B00D9336D /* SellingPlanDeliveryPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D9C2C407F5A00D9336D /* SellingPlanDeliveryPolicy.swift */; }; + 4EC30E152C407F5B00D9336D /* SellingPlanDeliveryPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D9C2C407F5A00D9336D /* SellingPlanDeliveryPolicy.swift */; }; + 4EC30E162C407F5B00D9336D /* SellingPlanRecurringDeliveryPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D9D2C407F5A00D9336D /* SellingPlanRecurringDeliveryPolicy.swift */; }; + 4EC30E172C407F5B00D9336D /* SellingPlanRecurringDeliveryPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D9D2C407F5A00D9336D /* SellingPlanRecurringDeliveryPolicy.swift */; }; + 4EC30E182C407F5B00D9336D /* SellingPlanRecurringDeliveryPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC30D9D2C407F5A00D9336D /* SellingPlanRecurringDeliveryPolicy.swift */; }; 4EC8A6F7278792B400FC193B /* MetafieldReference.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC8A6ED278792B400FC193B /* MetafieldReference.swift */; }; 4EC8A6F8278792B400FC193B /* Filter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC8A6EE278792B400FC193B /* Filter.swift */; }; 4EC8A6F9278792B400FC193B /* ProductFilter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EC8A6EF278792B400FC193B /* ProductFilter.swift */; }; @@ -480,9 +594,6 @@ 4EFBFADE2694B89D0054C426 /* LocationConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFABC2694B89B0054C426 /* LocationConnection.swift */; }; 4EFBFADF2694B89D0054C426 /* LocationConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFABC2694B89B0054C426 /* LocationConnection.swift */; }; 4EFBFAE02694B89D0054C426 /* LocationConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFABC2694B89B0054C426 /* LocationConnection.swift */; }; - 4EFBFAE12694B89D0054C426 /* CheckoutBuyerIdentity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFABD2694B89B0054C426 /* CheckoutBuyerIdentity.swift */; }; - 4EFBFAE22694B89D0054C426 /* CheckoutBuyerIdentity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFABD2694B89B0054C426 /* CheckoutBuyerIdentity.swift */; }; - 4EFBFAE32694B89D0054C426 /* CheckoutBuyerIdentity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFABD2694B89B0054C426 /* CheckoutBuyerIdentity.swift */; }; 4EFBFAE42694B89D0054C426 /* Currency.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFABE2694B89B0054C426 /* Currency.swift */; }; 4EFBFAE52694B89D0054C426 /* Currency.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFABE2694B89B0054C426 /* Currency.swift */; }; 4EFBFAE62694B89D0054C426 /* Currency.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFABE2694B89B0054C426 /* Currency.swift */; }; @@ -495,9 +606,6 @@ 4EFBFAED2694B89D0054C426 /* SellingPlanAllocationEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFAC12694B89C0054C426 /* SellingPlanAllocationEdge.swift */; }; 4EFBFAEE2694B89D0054C426 /* SellingPlanAllocationEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFAC12694B89C0054C426 /* SellingPlanAllocationEdge.swift */; }; 4EFBFAEF2694B89D0054C426 /* SellingPlanAllocationEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFAC12694B89C0054C426 /* SellingPlanAllocationEdge.swift */; }; - 4EFBFAF02694B89D0054C426 /* CheckoutBuyerIdentityInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFAC22694B89C0054C426 /* CheckoutBuyerIdentityInput.swift */; }; - 4EFBFAF12694B89D0054C426 /* CheckoutBuyerIdentityInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFAC22694B89C0054C426 /* CheckoutBuyerIdentityInput.swift */; }; - 4EFBFAF22694B89D0054C426 /* CheckoutBuyerIdentityInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFAC22694B89C0054C426 /* CheckoutBuyerIdentityInput.swift */; }; 4EFBFAF32694B89D0054C426 /* LocationSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFAC32694B89C0054C426 /* LocationSortKeys.swift */; }; 4EFBFAF42694B89D0054C426 /* LocationSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFAC32694B89C0054C426 /* LocationSortKeys.swift */; }; 4EFBFAF52694B89D0054C426 /* LocationSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EFBFAC32694B89C0054C426 /* LocationSortKeys.swift */; }; @@ -631,25 +739,10 @@ 9A0C80581EAA51C50020F187 /* AppliedGiftCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FF91EAA51C50020F187 /* AppliedGiftCard.swift */; }; 9A0C80591EAA51C50020F187 /* Attribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFA1EAA51C50020F187 /* Attribute.swift */; }; 9A0C805A1EAA51C50020F187 /* AttributeInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFB1EAA51C50020F187 /* AttributeInput.swift */; }; - 9A0C805B1EAA51C50020F187 /* AvailableShippingRates.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFC1EAA51C50020F187 /* AvailableShippingRates.swift */; }; - 9A0C805C1EAA51C50020F187 /* Checkout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFD1EAA51C50020F187 /* Checkout.swift */; }; - 9A0C805F1EAA51C50020F187 /* CheckoutCompleteFreePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80001EAA51C50020F187 /* CheckoutCompleteFreePayload.swift */; }; - 9A0C80621EAA51C50020F187 /* CheckoutCreateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80031EAA51C50020F187 /* CheckoutCreateInput.swift */; }; - 9A0C80631EAA51C50020F187 /* CheckoutCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80041EAA51C50020F187 /* CheckoutCreatePayload.swift */; }; - 9A0C80691EAA51C50020F187 /* CheckoutLineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800A1EAA51C50020F187 /* CheckoutLineItem.swift */; }; - 9A0C806A1EAA51C50020F187 /* CheckoutLineItemConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800B1EAA51C50020F187 /* CheckoutLineItemConnection.swift */; }; - 9A0C806B1EAA51C50020F187 /* CheckoutLineItemEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800C1EAA51C50020F187 /* CheckoutLineItemEdge.swift */; }; - 9A0C806C1EAA51C50020F187 /* CheckoutLineItemInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800D1EAA51C50020F187 /* CheckoutLineItemInput.swift */; }; - 9A0C806D1EAA51C50020F187 /* CheckoutLineItemsAddPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800E1EAA51C50020F187 /* CheckoutLineItemsAddPayload.swift */; }; - 9A0C806E1EAA51C50020F187 /* CheckoutLineItemsRemovePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800F1EAA51C50020F187 /* CheckoutLineItemsRemovePayload.swift */; }; - 9A0C806F1EAA51C50020F187 /* CheckoutLineItemsUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80101EAA51C50020F187 /* CheckoutLineItemsUpdatePayload.swift */; }; - 9A0C80701EAA51C50020F187 /* CheckoutLineItemUpdateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80111EAA51C50020F187 /* CheckoutLineItemUpdateInput.swift */; }; - 9A0C80721EAA51C50020F187 /* CheckoutShippingLineUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80131EAA51C50020F187 /* CheckoutShippingLineUpdatePayload.swift */; }; 9A0C80731EAA51C50020F187 /* Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80141EAA51C50020F187 /* Collection.swift */; }; 9A0C80741EAA51C50020F187 /* CollectionConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80151EAA51C50020F187 /* CollectionConnection.swift */; }; 9A0C80751EAA51C50020F187 /* CollectionEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80161EAA51C50020F187 /* CollectionEdge.swift */; }; 9A0C80761EAA51C50020F187 /* CollectionSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80171EAA51C50020F187 /* CollectionSortKeys.swift */; }; - 9A0C80771EAA51C50020F187 /* CreditCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80181EAA51C50020F187 /* CreditCard.swift */; }; 9A0C80791EAA51C50020F187 /* CropRegion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801A1EAA51C50020F187 /* CropRegion.swift */; }; 9A0C807A1EAA51C50020F187 /* CurrencyCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801B1EAA51C50020F187 /* CurrencyCode.swift */; }; 9A0C807B1EAA51C50020F187 /* Customer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801C1EAA51C50020F187 /* Customer.swift */; }; @@ -689,7 +782,6 @@ 9A0C809F1EAA51C50020F187 /* OrderLineItemEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80401EAA51C50020F187 /* OrderLineItemEdge.swift */; }; 9A0C80A01EAA51C50020F187 /* OrderSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80411EAA51C50020F187 /* OrderSortKeys.swift */; }; 9A0C80A11EAA51C50020F187 /* PageInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80421EAA51C50020F187 /* PageInfo.swift */; }; - 9A0C80A21EAA51C50020F187 /* Payment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80431EAA51C50020F187 /* Payment.swift */; }; 9A0C80A31EAA51C50020F187 /* Product.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80441EAA51C50020F187 /* Product.swift */; }; 9A0C80A41EAA51C50020F187 /* ProductConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80451EAA51C50020F187 /* ProductConnection.swift */; }; 9A0C80A51EAA51C50020F187 /* ProductEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80461EAA51C50020F187 /* ProductEdge.swift */; }; @@ -700,12 +792,8 @@ 9A0C80AA1EAA51C50020F187 /* ProductVariantEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804B1EAA51C50020F187 /* ProductVariantEdge.swift */; }; 9A0C80AB1EAA51C50020F187 /* QueryRoot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804C1EAA51C50020F187 /* QueryRoot.swift */; }; 9A0C80AC1EAA51C50020F187 /* SelectedOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804D1EAA51C50020F187 /* SelectedOption.swift */; }; - 9A0C80AD1EAA51C50020F187 /* ShippingRate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804E1EAA51C50020F187 /* ShippingRate.swift */; }; 9A0C80AE1EAA51C50020F187 /* Shop.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804F1EAA51C50020F187 /* Shop.swift */; }; 9A0C80AF1EAA51C50020F187 /* ShopPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80501EAA51C50020F187 /* ShopPolicy.swift */; }; - 9A0C80B11EAA51C50020F187 /* Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80521EAA51C50020F187 /* Transaction.swift */; }; - 9A0C80B21EAA51C50020F187 /* TransactionKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80531EAA51C50020F187 /* TransactionKind.swift */; }; - 9A0C80B31EAA51C50020F187 /* TransactionStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80541EAA51C50020F187 /* TransactionStatus.swift */; }; 9A0C80B41EAA51C50020F187 /* UserError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80551EAA51C50020F187 /* UserError.swift */; }; 9A0C80B51EAA51C50020F187 /* WeightUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80561EAA51C50020F187 /* WeightUnit.swift */; }; 9A0C80B61EAA51C50020F187 /* Storefront.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80571EAA51C50020F187 /* Storefront.swift */; }; @@ -735,9 +823,6 @@ 9A2ACDD721CABAC200C09FF7 /* PageSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A2ACDC421CABAC200C09FF7 /* PageSortKeys.swift */; }; 9A2ACDD821CABAC200C09FF7 /* PageSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A2ACDC421CABAC200C09FF7 /* PageSortKeys.swift */; }; 9A2ACDD921CABAC200C09FF7 /* PageSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A2ACDC421CABAC200C09FF7 /* PageSortKeys.swift */; }; - 9A2ACDDB21CABB7100C09FF7 /* CheckoutLineItemsReplacePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A2ACDDA21CABB7000C09FF7 /* CheckoutLineItemsReplacePayload.swift */; }; - 9A2ACDDC21CABB7100C09FF7 /* CheckoutLineItemsReplacePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A2ACDDA21CABB7000C09FF7 /* CheckoutLineItemsReplacePayload.swift */; }; - 9A2ACDDD21CABB7100C09FF7 /* CheckoutLineItemsReplacePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A2ACDDA21CABB7000C09FF7 /* CheckoutLineItemsReplacePayload.swift */; }; 9A2ACE2D21CD3C8700C09FF7 /* AutomaticDiscountApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A2ACE2C21CD3C8600C09FF7 /* AutomaticDiscountApplication.swift */; }; 9A2ACE2E21CD3C8700C09FF7 /* AutomaticDiscountApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A2ACE2C21CD3C8600C09FF7 /* AutomaticDiscountApplication.swift */; }; 9A2ACE2F21CD3C8700C09FF7 /* AutomaticDiscountApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A2ACE2C21CD3C8600C09FF7 /* AutomaticDiscountApplication.swift */; }; @@ -767,47 +852,14 @@ 9A41E2AA1F8509770059485A /* CustomerDefaultAddressUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A41E2A91F8509770059485A /* CustomerDefaultAddressUpdatePayload.swift */; }; 9A41E2AB1F8509770059485A /* CustomerDefaultAddressUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A41E2A91F8509770059485A /* CustomerDefaultAddressUpdatePayload.swift */; }; 9A41E2AC1F8509770059485A /* CustomerDefaultAddressUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A41E2A91F8509770059485A /* CustomerDefaultAddressUpdatePayload.swift */; }; - 9A43489B20C84A56005EAD56 /* CheckoutDiscountCodeRemovePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A43489A20C84A56005EAD56 /* CheckoutDiscountCodeRemovePayload.swift */; }; - 9A43489C20C84A56005EAD56 /* CheckoutDiscountCodeRemovePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A43489A20C84A56005EAD56 /* CheckoutDiscountCodeRemovePayload.swift */; }; - 9A43489D20C84A56005EAD56 /* CheckoutDiscountCodeRemovePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A43489A20C84A56005EAD56 /* CheckoutDiscountCodeRemovePayload.swift */; }; - 9A47C049218087880043525D /* CheckoutCustomerAssociateV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A47C046218087870043525D /* CheckoutCustomerAssociateV2Payload.swift */; }; - 9A47C04A218087880043525D /* CheckoutCustomerAssociateV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A47C046218087870043525D /* CheckoutCustomerAssociateV2Payload.swift */; }; - 9A47C04B218087880043525D /* CheckoutCustomerAssociateV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A47C046218087870043525D /* CheckoutCustomerAssociateV2Payload.swift */; }; - 9A47C04C218087880043525D /* CheckoutGiftCardRemoveV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A47C047218087880043525D /* CheckoutGiftCardRemoveV2Payload.swift */; }; - 9A47C04D218087880043525D /* CheckoutGiftCardRemoveV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A47C047218087880043525D /* CheckoutGiftCardRemoveV2Payload.swift */; }; - 9A47C04E218087880043525D /* CheckoutGiftCardRemoveV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A47C047218087880043525D /* CheckoutGiftCardRemoveV2Payload.swift */; }; - 9A47C04F218087880043525D /* CheckoutCustomerDisassociateV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A47C048218087880043525D /* CheckoutCustomerDisassociateV2Payload.swift */; }; - 9A47C050218087880043525D /* CheckoutCustomerDisassociateV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A47C048218087880043525D /* CheckoutCustomerDisassociateV2Payload.swift */; }; - 9A47C051218087880043525D /* CheckoutCustomerDisassociateV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A47C048218087880043525D /* CheckoutCustomerDisassociateV2Payload.swift */; }; 9A49DC831EC4AD580053710B /* Header.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A49DC821EC4AD580053710B /* Header.swift */; }; 9A52D3A21F3CA58E00C093C8 /* ProductImageSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3A01F3CA58E00C093C8 /* ProductImageSortKeys.swift */; }; 9A52D3A31F3CA58E00C093C8 /* CardBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3A11F3CA58E00C093C8 /* CardBrand.swift */; }; 9A52D3A51F3CA5DB00C093C8 /* DigitalWallet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3A41F3CA5DB00C093C8 /* DigitalWallet.swift */; }; 9A52D3B21F3CE99900C093C8 /* PayCardBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3B11F3CE99900C093C8 /* PayCardBrand.swift */; }; - 9A656CC02183B04700D3A41C /* CheckoutEmailUpdateV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A656CBD2183B04600D3A41C /* CheckoutEmailUpdateV2Payload.swift */; }; - 9A656CC12183B04700D3A41C /* CheckoutEmailUpdateV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A656CBD2183B04600D3A41C /* CheckoutEmailUpdateV2Payload.swift */; }; - 9A656CC22183B04700D3A41C /* CheckoutEmailUpdateV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A656CBD2183B04600D3A41C /* CheckoutEmailUpdateV2Payload.swift */; }; - 9A656CC32183B04700D3A41C /* CheckoutShippingAddressUpdateV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A656CBE2183B04700D3A41C /* CheckoutShippingAddressUpdateV2Payload.swift */; }; - 9A656CC42183B04700D3A41C /* CheckoutShippingAddressUpdateV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A656CBE2183B04700D3A41C /* CheckoutShippingAddressUpdateV2Payload.swift */; }; - 9A656CC52183B04700D3A41C /* CheckoutShippingAddressUpdateV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A656CBE2183B04700D3A41C /* CheckoutShippingAddressUpdateV2Payload.swift */; }; - 9A656CC62183B04700D3A41C /* CheckoutDiscountCodeApplyV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A656CBF2183B04700D3A41C /* CheckoutDiscountCodeApplyV2Payload.swift */; }; - 9A656CC72183B04700D3A41C /* CheckoutDiscountCodeApplyV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A656CBF2183B04700D3A41C /* CheckoutDiscountCodeApplyV2Payload.swift */; }; - 9A656CC82183B04700D3A41C /* CheckoutDiscountCodeApplyV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A656CBF2183B04700D3A41C /* CheckoutDiscountCodeApplyV2Payload.swift */; }; - 9A6711382166678500A57A3F /* CreditCardPaymentInputV2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A6711302166678100A57A3F /* CreditCardPaymentInputV2.swift */; }; - 9A6711392166678500A57A3F /* CreditCardPaymentInputV2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A6711302166678100A57A3F /* CreditCardPaymentInputV2.swift */; }; - 9A67113A2166678500A57A3F /* CreditCardPaymentInputV2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A6711302166678100A57A3F /* CreditCardPaymentInputV2.swift */; }; 9A67113B2166678500A57A3F /* MoneyInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A6711312166678300A57A3F /* MoneyInput.swift */; }; 9A67113C2166678500A57A3F /* MoneyInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A6711312166678300A57A3F /* MoneyInput.swift */; }; 9A67113D2166678500A57A3F /* MoneyInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A6711312166678300A57A3F /* MoneyInput.swift */; }; - 9A67113E2166678500A57A3F /* CheckoutCompleteWithCreditCardV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A6711372166678500A57A3F /* CheckoutCompleteWithCreditCardV2Payload.swift */; }; - 9A67113F2166678500A57A3F /* CheckoutCompleteWithCreditCardV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A6711372166678500A57A3F /* CheckoutCompleteWithCreditCardV2Payload.swift */; }; - 9A6711402166678500A57A3F /* CheckoutCompleteWithCreditCardV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A6711372166678500A57A3F /* CheckoutCompleteWithCreditCardV2Payload.swift */; }; - 9A67114221666A6700A57A3F /* CheckoutErrorCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A67114121666A6600A57A3F /* CheckoutErrorCode.swift */; }; - 9A67114321666A6700A57A3F /* CheckoutErrorCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A67114121666A6600A57A3F /* CheckoutErrorCode.swift */; }; - 9A67114421666A6700A57A3F /* CheckoutErrorCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A67114121666A6600A57A3F /* CheckoutErrorCode.swift */; }; - 9A67114621666A7700A57A3F /* CheckoutUserError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A67114521666A7700A57A3F /* CheckoutUserError.swift */; }; - 9A67114721666A7700A57A3F /* CheckoutUserError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A67114521666A7700A57A3F /* CheckoutUserError.swift */; }; - 9A67114821666A7700A57A3F /* CheckoutUserError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A67114521666A7700A57A3F /* CheckoutUserError.swift */; }; 9A67115521666AB200A57A3F /* ScriptDiscountApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A67114921666AAE00A57A3F /* ScriptDiscountApplication.swift */; }; 9A67115621666AB200A57A3F /* ScriptDiscountApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A67114921666AAE00A57A3F /* ScriptDiscountApplication.swift */; }; 9A67115721666AB200A57A3F /* ScriptDiscountApplication.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A67114921666AAE00A57A3F /* ScriptDiscountApplication.swift */; }; @@ -912,9 +964,6 @@ 9ABEB3BD2122FF8000A373F2 /* CustomerErrorCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABEB3B92122FF7F00A373F2 /* CustomerErrorCode.swift */; }; 9ABEB3BE2122FF8000A373F2 /* CustomerErrorCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABEB3B92122FF7F00A373F2 /* CustomerErrorCode.swift */; }; 9ABEB3BF2122FF8000A373F2 /* CustomerErrorCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABEB3B92122FF7F00A373F2 /* CustomerErrorCode.swift */; }; - 9ABEB3C12122FFE900A373F2 /* CheckoutGiftCardsAppendPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABEB3C02122FFE900A373F2 /* CheckoutGiftCardsAppendPayload.swift */; }; - 9ABEB3C22122FFE900A373F2 /* CheckoutGiftCardsAppendPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABEB3C02122FFE900A373F2 /* CheckoutGiftCardsAppendPayload.swift */; }; - 9ABEB3C32122FFE900A373F2 /* CheckoutGiftCardsAppendPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABEB3C02122FFE900A373F2 /* CheckoutGiftCardsAppendPayload.swift */; }; 9ABEB3D42123598800A373F2 /* PayGiftCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABEB3D32123598800A373F2 /* PayGiftCard.swift */; }; 9AC2EF391F6818180037E0D7 /* Attribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFA1EAA51C50020F187 /* Attribute.swift */; }; 9AC2EF3A1F6818180037E0D7 /* OrderLineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803E1EAA51C50020F187 /* OrderLineItem.swift */; }; @@ -923,9 +972,7 @@ 9AC2EF3D1F6818180037E0D7 /* ProductVariantSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AE1F8151F605F8F00147E77 /* ProductVariantSortKeys.swift */; }; 9AC2EF3E1F6818180037E0D7 /* ProductOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80471EAA51C50020F187 /* ProductOption.swift */; }; 9AC2EF3F1F6818180037E0D7 /* QueryRoot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804C1EAA51C50020F187 /* QueryRoot.swift */; }; - 9AC2EF401F6818180037E0D7 /* ShippingRate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804E1EAA51C50020F187 /* ShippingRate.swift */; }; 9AC2EF421F6818180037E0D7 /* Blog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CC1EE095B20060029B /* Blog.swift */; }; - 9AC2EF431F6818180037E0D7 /* AvailableShippingRates.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFC1EAA51C50020F187 /* AvailableShippingRates.swift */; }; 9AC2EF441F6818180037E0D7 /* CollectionConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80151EAA51C50020F187 /* CollectionConnection.swift */; }; 9AC2EF471F6818180037E0D7 /* ProductEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80461EAA51C50020F187 /* ProductEdge.swift */; }; 9AC2EF491F6818180037E0D7 /* WeightUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80561EAA51C50020F187 /* WeightUnit.swift */; }; @@ -938,21 +985,16 @@ 9AC2EF511F6818180037E0D7 /* Graph.RetryHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4069C91E8EA6DB000254CD /* Graph.RetryHandler.swift */; }; 9AC2EF521F6818180037E0D7 /* CurrencyCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801B1EAA51C50020F187 /* CurrencyCode.swift */; }; 9AC2EF531F6818180037E0D7 /* ShopPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80501EAA51C50020F187 /* ShopPolicy.swift */; }; - 9AC2EF541F6818180037E0D7 /* CheckoutShippingLineUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80131EAA51C50020F187 /* CheckoutShippingLineUpdatePayload.swift */; }; - 9AC2EF561F6818180037E0D7 /* CheckoutCompleteFreePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80001EAA51C50020F187 /* CheckoutCompleteFreePayload.swift */; }; 9AC2EF571F6818180037E0D7 /* DigitalWallet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3A41F3CA5DB00C093C8 /* DigitalWallet.swift */; }; 9AC2EF581F6818180037E0D7 /* MailingAddressInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80351EAA51C50020F187 /* MailingAddressInput.swift */; }; 9AC2EF591F6818180037E0D7 /* CustomerRecoverPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80291EAA51C50020F187 /* CustomerRecoverPayload.swift */; }; 9AC2EF5A1F6818180037E0D7 /* PaymentSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF1C1851F13ACCF0064AEA0 /* PaymentSettings.swift */; }; 9AC2EF5B1F6818180037E0D7 /* Domain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802E1EAA51C50020F187 /* Domain.swift */; }; 9AC2EF5C1F6818180037E0D7 /* Card.CreditCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80F11EB773520020F187 /* Card.CreditCard.swift */; }; - 9AC2EF5D1F6818180037E0D7 /* Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80521EAA51C50020F187 /* Transaction.swift */; }; - 9AC2EF5E1F6818180037E0D7 /* CheckoutCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80041EAA51C50020F187 /* CheckoutCreatePayload.swift */; }; 9AC2EF5F1F6818180037E0D7 /* Graph.Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C81041EBA66440020F187 /* Graph.Cache.swift */; }; 9AC2EF601F6818180037E0D7 /* Node.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80371EAA51C50020F187 /* Node.swift */; }; 9AC2EF621F6818180037E0D7 /* OrderLineItemEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80401EAA51C50020F187 /* OrderLineItemEdge.swift */; }; 9AC2EF631F6818180037E0D7 /* Card.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80EF1EB773310020F187 /* Card.swift */; }; - 9AC2EF641F6818180037E0D7 /* CheckoutLineItemUpdateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80111EAA51C50020F187 /* CheckoutLineItemUpdateInput.swift */; }; 9AC2EF651F6818180037E0D7 /* CustomerAccessTokenCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801F1EAA51C50020F187 /* CustomerAccessTokenCreatePayload.swift */; }; 9AC2EF661F6818180037E0D7 /* BlogEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CE1EE095B20060029B /* BlogEdge.swift */; }; 9AC2EF671F6818180037E0D7 /* Shop.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804F1EAA51C50020F187 /* Shop.swift */; }; @@ -967,7 +1009,6 @@ 9AC2EF701F6818180037E0D7 /* CustomerResetInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802A1EAA51C50020F187 /* CustomerResetInput.swift */; }; 9AC2EF711F6818180037E0D7 /* CustomerAccessTokenDeletePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80201EAA51C50020F187 /* CustomerAccessTokenDeletePayload.swift */; }; 9AC2EF731F6818180037E0D7 /* BlogConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CD1EE095B20060029B /* BlogConnection.swift */; }; - 9AC2EF741F6818180037E0D7 /* CreditCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80181EAA51C50020F187 /* CreditCard.swift */; }; 9AC2EF761F6818180037E0D7 /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802F1EAA51C50020F187 /* Image.swift */; }; 9AC2EF771F6818180037E0D7 /* CustomerAddressCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80241EAA51C50020F187 /* CustomerAddressCreatePayload.swift */; }; 9AC2EF781F6818180037E0D7 /* PageInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80421EAA51C50020F187 /* PageInfo.swift */; }; @@ -975,29 +1016,22 @@ 9AC2EF7A1F6818180037E0D7 /* CustomerAddressDeletePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80251EAA51C50020F187 /* CustomerAddressDeletePayload.swift */; }; 9AC2EF7B1F6818180037E0D7 /* Product.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80441EAA51C50020F187 /* Product.swift */; }; 9AC2EF7C1F6818180037E0D7 /* CustomerAddressUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80261EAA51C50020F187 /* CustomerAddressUpdatePayload.swift */; }; - 9AC2EF7D1F6818180037E0D7 /* Payment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80431EAA51C50020F187 /* Payment.swift */; }; 9AC2EF7E1F6818180037E0D7 /* ProductCollectionSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF1C1841F13ACCF0064AEA0 /* ProductCollectionSortKeys.swift */; }; - 9AC2EF7F1F6818180037E0D7 /* CheckoutLineItemsUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80101EAA51C50020F187 /* CheckoutLineItemsUpdatePayload.swift */; }; 9AC2EF801F6818180037E0D7 /* Global.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AAFAB711E60766E00864A17 /* Global.swift */; }; 9AC2EF811F6818180037E0D7 /* ImageConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80301EAA51C50020F187 /* ImageConnection.swift */; }; 9AC2EF821F6818180037E0D7 /* Graph.CachePolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C81061EBA66800020F187 /* Graph.CachePolicy.swift */; }; 9AC2EF831F6818180037E0D7 /* ProductVariant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80491EAA51C50020F187 /* ProductVariant.swift */; }; - 9AC2EF841F6818180037E0D7 /* TransactionStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80541EAA51C50020F187 /* TransactionStatus.swift */; }; 9AC2EF851F6818180037E0D7 /* CollectionSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80171EAA51C50020F187 /* CollectionSortKeys.swift */; }; 9AC2EF861F6818180037E0D7 /* CustomerCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80281EAA51C50020F187 /* CustomerCreatePayload.swift */; }; 9AC2EF871F6818180037E0D7 /* Article.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C21EE095AA0060029B /* Article.swift */; }; 9AC2EF881F6818180037E0D7 /* MailingAddress.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80321EAA51C50020F187 /* MailingAddress.swift */; }; 9AC2EF891F6818180037E0D7 /* ArticleConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C41EE095AA0060029B /* ArticleConnection.swift */; }; 9AC2EF8A1F6818180037E0D7 /* CropRegion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801A1EAA51C50020F187 /* CropRegion.swift */; }; - 9AC2EF8B1F6818180037E0D7 /* CheckoutLineItemsRemovePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800F1EAA51C50020F187 /* CheckoutLineItemsRemovePayload.swift */; }; 9AC2EF8C1F6818180037E0D7 /* StringConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A125CFE1F16A0D7008DCF38 /* StringConnection.swift */; }; 9AC2EF8D1F6818180037E0D7 /* Graph.CacheItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA7AC751EBB77660014D95D /* Graph.CacheItem.swift */; }; 9AC2EF8E1F6818180037E0D7 /* BlogSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CF1EE095B20060029B /* BlogSortKeys.swift */; }; - 9AC2EF8F1F6818180037E0D7 /* Checkout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFD1EAA51C50020F187 /* Checkout.swift */; }; - 9AC2EF901F6818180037E0D7 /* CheckoutLineItemConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800B1EAA51C50020F187 /* CheckoutLineItemConnection.swift */; }; 9AC2EF911F6818180037E0D7 /* MailingAddressEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80341EAA51C50020F187 /* MailingAddressEdge.swift */; }; 9AC2EF921F6818180037E0D7 /* CommentConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416D61EE095BB0060029B /* CommentConnection.swift */; }; - 9AC2EF931F6818180037E0D7 /* TransactionKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80531EAA51C50020F187 /* TransactionKind.swift */; }; 9AC2EF941F6818180037E0D7 /* CustomerCreateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80271EAA51C50020F187 /* CustomerCreateInput.swift */; }; 9AC2EF951F6818180037E0D7 /* ArticleEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C51EE095AA0060029B /* ArticleEdge.swift */; }; 9AC2EF961F6818180037E0D7 /* UserError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80551EAA51C50020F187 /* UserError.swift */; }; @@ -1011,7 +1045,6 @@ 9AC2EF9E1F6818180037E0D7 /* ArticleAuthor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C31EE095AA0060029B /* ArticleAuthor.swift */; }; 9AC2EF9F1F6818180037E0D7 /* SelectedOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804D1EAA51C50020F187 /* SelectedOption.swift */; }; 9AC2EFA01F6818180037E0D7 /* OrderLineItemConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803F1EAA51C50020F187 /* OrderLineItemConnection.swift */; }; - 9AC2EFA21F6818180037E0D7 /* CheckoutLineItemsAddPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800E1EAA51C50020F187 /* CheckoutLineItemsAddPayload.swift */; }; 9AC2EFA41F6818180037E0D7 /* StringEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A125CFD1F16A0D7008DCF38 /* StringEdge.swift */; }; 9AC2EFA51F6818180037E0D7 /* Graph.Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AEF61B81E5F64230067FA90 /* Graph.Client.swift */; }; 9AC2EFA61F6818180037E0D7 /* Graph.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4069CB1E8EA710000254CD /* Graph.swift */; }; @@ -1023,26 +1056,16 @@ 9AC2EFAD1F6818180037E0D7 /* CustomerResetPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802B1EAA51C50020F187 /* CustomerResetPayload.swift */; }; 9AC2EFAE1F6818180037E0D7 /* ArticleSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C61EE095AA0060029B /* ArticleSortKeys.swift */; }; 9AC2EFAF1F6818180037E0D7 /* CardBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3A11F3CA58E00C093C8 /* CardBrand.swift */; }; - 9AC2EFB01F6818180037E0D7 /* CheckoutCreateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80031EAA51C50020F187 /* CheckoutCreateInput.swift */; }; 9AC2EFB11F6818180037E0D7 /* OrderSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80411EAA51C50020F187 /* OrderSortKeys.swift */; }; - 9AC2EFB31F6818180037E0D7 /* CheckoutLineItemEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800C1EAA51C50020F187 /* CheckoutLineItemEdge.swift */; }; 9AC2EFB41F6818180037E0D7 /* ProductConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80451EAA51C50020F187 /* ProductConnection.swift */; }; 9AC2EFB51F6818180037E0D7 /* CustomerAccessToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801D1EAA51C50020F187 /* CustomerAccessToken.swift */; }; 9AC2EFB61F6818180037E0D7 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80381EAA51C50020F187 /* Order.swift */; }; - 9AC2EFB71F6818180037E0D7 /* CheckoutLineItemInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800D1EAA51C50020F187 /* CheckoutLineItemInput.swift */; }; - 9AC2EFB91F6818180037E0D7 /* CheckoutLineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800A1EAA51C50020F187 /* CheckoutLineItem.swift */; }; 9AC2EFBB1F6818180037E0D7 /* ProductVariantEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804B1EAA51C50020F187 /* ProductVariantEdge.swift */; }; 9AC2EFBC1F6818180037E0D7 /* AppliedGiftCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FF91EAA51C50020F187 /* AppliedGiftCard.swift */; }; 9AC2EFBE1F6818180037E0D7 /* CommentEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416D71EE095BB0060029B /* CommentEdge.swift */; }; 9AC2EFBF1F6818180037E0D7 /* GraphQL+ScalarSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AEF61A01E5F5A190067FA90 /* GraphQL+ScalarSupport.swift */; }; 9AC2EFC21F6818180037E0D7 /* Buy.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AEF60F61E5F42D90067FA90 /* Buy.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9AC2EFD71F686DB90037E0D7 /* Optional+Input.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AC2EFD61F686DB90037E0D7 /* Optional+Input.swift */; }; - 9AD577652153E315006BD1C5 /* CheckoutAttributesUpdateV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD577632153E314006BD1C5 /* CheckoutAttributesUpdateV2Payload.swift */; }; - 9AD577662153E315006BD1C5 /* CheckoutAttributesUpdateV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD577632153E314006BD1C5 /* CheckoutAttributesUpdateV2Payload.swift */; }; - 9AD577672153E315006BD1C5 /* CheckoutAttributesUpdateV2Payload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD577632153E314006BD1C5 /* CheckoutAttributesUpdateV2Payload.swift */; }; - 9AD577682153E315006BD1C5 /* CheckoutAttributesUpdateV2Input.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD577642153E315006BD1C5 /* CheckoutAttributesUpdateV2Input.swift */; }; - 9AD577692153E315006BD1C5 /* CheckoutAttributesUpdateV2Input.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD577642153E315006BD1C5 /* CheckoutAttributesUpdateV2Input.swift */; }; - 9AD5776A2153E315006BD1C5 /* CheckoutAttributesUpdateV2Input.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD577642153E315006BD1C5 /* CheckoutAttributesUpdateV2Input.swift */; }; 9AD5776C2153E350006BD1C5 /* CustomerResetByUrlPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD5776B2153E350006BD1C5 /* CustomerResetByUrlPayload.swift */; }; 9AD5776D2153E350006BD1C5 /* CustomerResetByUrlPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD5776B2153E350006BD1C5 /* CustomerResetByUrlPayload.swift */; }; 9AD5776E2153E350006BD1C5 /* CustomerResetByUrlPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD5776B2153E350006BD1C5 /* CustomerResetByUrlPayload.swift */; }; @@ -1064,9 +1087,7 @@ 9AF255B71F6FEE50005BB0C9 /* ProductVariantSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AE1F8151F605F8F00147E77 /* ProductVariantSortKeys.swift */; }; 9AF255B81F6FEE50005BB0C9 /* ProductOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80471EAA51C50020F187 /* ProductOption.swift */; }; 9AF255B91F6FEE50005BB0C9 /* QueryRoot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804C1EAA51C50020F187 /* QueryRoot.swift */; }; - 9AF255BA1F6FEE50005BB0C9 /* ShippingRate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804E1EAA51C50020F187 /* ShippingRate.swift */; }; 9AF255BC1F6FEE50005BB0C9 /* Blog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CC1EE095B20060029B /* Blog.swift */; }; - 9AF255BD1F6FEE50005BB0C9 /* AvailableShippingRates.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFC1EAA51C50020F187 /* AvailableShippingRates.swift */; }; 9AF255BE1F6FEE50005BB0C9 /* CollectionConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80151EAA51C50020F187 /* CollectionConnection.swift */; }; 9AF255C11F6FEE50005BB0C9 /* ProductEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80461EAA51C50020F187 /* ProductEdge.swift */; }; 9AF255C31F6FEE50005BB0C9 /* WeightUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80561EAA51C50020F187 /* WeightUnit.swift */; }; @@ -1079,21 +1100,16 @@ 9AF255CB1F6FEE50005BB0C9 /* Graph.RetryHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4069C91E8EA6DB000254CD /* Graph.RetryHandler.swift */; }; 9AF255CC1F6FEE50005BB0C9 /* CurrencyCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801B1EAA51C50020F187 /* CurrencyCode.swift */; }; 9AF255CD1F6FEE50005BB0C9 /* ShopPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80501EAA51C50020F187 /* ShopPolicy.swift */; }; - 9AF255CE1F6FEE50005BB0C9 /* CheckoutShippingLineUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80131EAA51C50020F187 /* CheckoutShippingLineUpdatePayload.swift */; }; - 9AF255D01F6FEE50005BB0C9 /* CheckoutCompleteFreePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80001EAA51C50020F187 /* CheckoutCompleteFreePayload.swift */; }; 9AF255D11F6FEE50005BB0C9 /* DigitalWallet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3A41F3CA5DB00C093C8 /* DigitalWallet.swift */; }; 9AF255D21F6FEE50005BB0C9 /* MailingAddressInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80351EAA51C50020F187 /* MailingAddressInput.swift */; }; 9AF255D31F6FEE50005BB0C9 /* CustomerRecoverPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80291EAA51C50020F187 /* CustomerRecoverPayload.swift */; }; 9AF255D41F6FEE50005BB0C9 /* PaymentSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF1C1851F13ACCF0064AEA0 /* PaymentSettings.swift */; }; 9AF255D51F6FEE50005BB0C9 /* Domain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802E1EAA51C50020F187 /* Domain.swift */; }; 9AF255D61F6FEE50005BB0C9 /* Card.CreditCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80F11EB773520020F187 /* Card.CreditCard.swift */; }; - 9AF255D71F6FEE50005BB0C9 /* Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80521EAA51C50020F187 /* Transaction.swift */; }; - 9AF255D81F6FEE50005BB0C9 /* CheckoutCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80041EAA51C50020F187 /* CheckoutCreatePayload.swift */; }; 9AF255D91F6FEE50005BB0C9 /* Graph.Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C81041EBA66440020F187 /* Graph.Cache.swift */; }; 9AF255DA1F6FEE50005BB0C9 /* Node.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80371EAA51C50020F187 /* Node.swift */; }; 9AF255DC1F6FEE50005BB0C9 /* OrderLineItemEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80401EAA51C50020F187 /* OrderLineItemEdge.swift */; }; 9AF255DD1F6FEE50005BB0C9 /* Card.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80EF1EB773310020F187 /* Card.swift */; }; - 9AF255DE1F6FEE50005BB0C9 /* CheckoutLineItemUpdateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80111EAA51C50020F187 /* CheckoutLineItemUpdateInput.swift */; }; 9AF255DF1F6FEE50005BB0C9 /* CustomerAccessTokenCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801F1EAA51C50020F187 /* CustomerAccessTokenCreatePayload.swift */; }; 9AF255E01F6FEE50005BB0C9 /* BlogEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CE1EE095B20060029B /* BlogEdge.swift */; }; 9AF255E11F6FEE50005BB0C9 /* Shop.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804F1EAA51C50020F187 /* Shop.swift */; }; @@ -1108,7 +1124,6 @@ 9AF255EA1F6FEE50005BB0C9 /* CustomerResetInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802A1EAA51C50020F187 /* CustomerResetInput.swift */; }; 9AF255EB1F6FEE50005BB0C9 /* CustomerAccessTokenDeletePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80201EAA51C50020F187 /* CustomerAccessTokenDeletePayload.swift */; }; 9AF255ED1F6FEE50005BB0C9 /* BlogConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CD1EE095B20060029B /* BlogConnection.swift */; }; - 9AF255EE1F6FEE50005BB0C9 /* CreditCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80181EAA51C50020F187 /* CreditCard.swift */; }; 9AF255F01F6FEE50005BB0C9 /* Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802F1EAA51C50020F187 /* Image.swift */; }; 9AF255F11F6FEE50005BB0C9 /* CustomerAddressCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80241EAA51C50020F187 /* CustomerAddressCreatePayload.swift */; }; 9AF255F21F6FEE50005BB0C9 /* PageInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80421EAA51C50020F187 /* PageInfo.swift */; }; @@ -1116,29 +1131,22 @@ 9AF255F41F6FEE50005BB0C9 /* CustomerAddressDeletePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80251EAA51C50020F187 /* CustomerAddressDeletePayload.swift */; }; 9AF255F51F6FEE50005BB0C9 /* Product.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80441EAA51C50020F187 /* Product.swift */; }; 9AF255F61F6FEE50005BB0C9 /* CustomerAddressUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80261EAA51C50020F187 /* CustomerAddressUpdatePayload.swift */; }; - 9AF255F71F6FEE50005BB0C9 /* Payment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80431EAA51C50020F187 /* Payment.swift */; }; 9AF255F81F6FEE50005BB0C9 /* ProductCollectionSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF1C1841F13ACCF0064AEA0 /* ProductCollectionSortKeys.swift */; }; - 9AF255F91F6FEE50005BB0C9 /* CheckoutLineItemsUpdatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80101EAA51C50020F187 /* CheckoutLineItemsUpdatePayload.swift */; }; 9AF255FA1F6FEE50005BB0C9 /* Global.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AAFAB711E60766E00864A17 /* Global.swift */; }; 9AF255FB1F6FEE50005BB0C9 /* ImageConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80301EAA51C50020F187 /* ImageConnection.swift */; }; 9AF255FC1F6FEE50005BB0C9 /* Graph.CachePolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C81061EBA66800020F187 /* Graph.CachePolicy.swift */; }; 9AF255FD1F6FEE50005BB0C9 /* ProductVariant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80491EAA51C50020F187 /* ProductVariant.swift */; }; - 9AF255FE1F6FEE50005BB0C9 /* TransactionStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80541EAA51C50020F187 /* TransactionStatus.swift */; }; 9AF255FF1F6FEE50005BB0C9 /* CollectionSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80171EAA51C50020F187 /* CollectionSortKeys.swift */; }; 9AF256001F6FEE50005BB0C9 /* CustomerCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80281EAA51C50020F187 /* CustomerCreatePayload.swift */; }; 9AF256011F6FEE50005BB0C9 /* Article.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C21EE095AA0060029B /* Article.swift */; }; 9AF256021F6FEE50005BB0C9 /* MailingAddress.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80321EAA51C50020F187 /* MailingAddress.swift */; }; 9AF256031F6FEE50005BB0C9 /* ArticleConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C41EE095AA0060029B /* ArticleConnection.swift */; }; 9AF256041F6FEE50005BB0C9 /* CropRegion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801A1EAA51C50020F187 /* CropRegion.swift */; }; - 9AF256051F6FEE50005BB0C9 /* CheckoutLineItemsRemovePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800F1EAA51C50020F187 /* CheckoutLineItemsRemovePayload.swift */; }; 9AF256061F6FEE50005BB0C9 /* StringConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A125CFE1F16A0D7008DCF38 /* StringConnection.swift */; }; 9AF256071F6FEE50005BB0C9 /* Graph.CacheItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA7AC751EBB77660014D95D /* Graph.CacheItem.swift */; }; 9AF256081F6FEE50005BB0C9 /* BlogSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CF1EE095B20060029B /* BlogSortKeys.swift */; }; - 9AF256091F6FEE50005BB0C9 /* Checkout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFD1EAA51C50020F187 /* Checkout.swift */; }; - 9AF2560A1F6FEE50005BB0C9 /* CheckoutLineItemConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800B1EAA51C50020F187 /* CheckoutLineItemConnection.swift */; }; 9AF2560B1F6FEE50005BB0C9 /* MailingAddressEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80341EAA51C50020F187 /* MailingAddressEdge.swift */; }; 9AF2560C1F6FEE50005BB0C9 /* CommentConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416D61EE095BB0060029B /* CommentConnection.swift */; }; - 9AF2560D1F6FEE50005BB0C9 /* TransactionKind.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80531EAA51C50020F187 /* TransactionKind.swift */; }; 9AF2560E1F6FEE50005BB0C9 /* CustomerCreateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80271EAA51C50020F187 /* CustomerCreateInput.swift */; }; 9AF2560F1F6FEE50005BB0C9 /* ArticleEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C51EE095AA0060029B /* ArticleEdge.swift */; }; 9AF256101F6FEE50005BB0C9 /* UserError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80551EAA51C50020F187 /* UserError.swift */; }; @@ -1152,7 +1160,6 @@ 9AF256181F6FEE50005BB0C9 /* ArticleAuthor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C31EE095AA0060029B /* ArticleAuthor.swift */; }; 9AF256191F6FEE50005BB0C9 /* SelectedOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804D1EAA51C50020F187 /* SelectedOption.swift */; }; 9AF2561A1F6FEE50005BB0C9 /* OrderLineItemConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803F1EAA51C50020F187 /* OrderLineItemConnection.swift */; }; - 9AF2561C1F6FEE50005BB0C9 /* CheckoutLineItemsAddPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800E1EAA51C50020F187 /* CheckoutLineItemsAddPayload.swift */; }; 9AF2561E1F6FEE50005BB0C9 /* StringEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A125CFD1F16A0D7008DCF38 /* StringEdge.swift */; }; 9AF2561F1F6FEE50005BB0C9 /* Graph.Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AEF61B81E5F64230067FA90 /* Graph.Client.swift */; }; 9AF256201F6FEE50005BB0C9 /* Graph.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4069CB1E8EA710000254CD /* Graph.swift */; }; @@ -1164,14 +1171,10 @@ 9AF256271F6FEE50005BB0C9 /* CustomerResetPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802B1EAA51C50020F187 /* CustomerResetPayload.swift */; }; 9AF256281F6FEE50005BB0C9 /* ArticleSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C61EE095AA0060029B /* ArticleSortKeys.swift */; }; 9AF256291F6FEE50005BB0C9 /* CardBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3A11F3CA58E00C093C8 /* CardBrand.swift */; }; - 9AF2562A1F6FEE50005BB0C9 /* CheckoutCreateInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80031EAA51C50020F187 /* CheckoutCreateInput.swift */; }; 9AF2562B1F6FEE50005BB0C9 /* OrderSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80411EAA51C50020F187 /* OrderSortKeys.swift */; }; - 9AF2562D1F6FEE50005BB0C9 /* CheckoutLineItemEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800C1EAA51C50020F187 /* CheckoutLineItemEdge.swift */; }; 9AF2562E1F6FEE50005BB0C9 /* ProductConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80451EAA51C50020F187 /* ProductConnection.swift */; }; 9AF2562F1F6FEE50005BB0C9 /* CustomerAccessToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801D1EAA51C50020F187 /* CustomerAccessToken.swift */; }; 9AF256301F6FEE50005BB0C9 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80381EAA51C50020F187 /* Order.swift */; }; - 9AF256311F6FEE50005BB0C9 /* CheckoutLineItemInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800D1EAA51C50020F187 /* CheckoutLineItemInput.swift */; }; - 9AF256331F6FEE50005BB0C9 /* CheckoutLineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C800A1EAA51C50020F187 /* CheckoutLineItem.swift */; }; 9AF256351F6FEE50005BB0C9 /* ProductVariantEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804B1EAA51C50020F187 /* ProductVariantEdge.swift */; }; 9AF256361F6FEE50005BB0C9 /* AppliedGiftCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FF91EAA51C50020F187 /* AppliedGiftCard.swift */; }; 9AF256381F6FEE50005BB0C9 /* CommentEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416D71EE095BB0060029B /* CommentEdge.swift */; }; @@ -1214,10 +1217,7 @@ 21751EE6243D1369005001D4 /* OrderFulfillmentStatus.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderFulfillmentStatus.swift; sourceTree = ""; }; 21751EE7243D1369005001D4 /* OrderFinancialStatus.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderFinancialStatus.swift; sourceTree = ""; }; 21751EE8243D1369005001D4 /* CustomerActivateByUrlPayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomerActivateByUrlPayload.swift; sourceTree = ""; }; - 21751EE9243D1369005001D4 /* CheckoutCompleteWithTokenizedPaymentV3Payload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutCompleteWithTokenizedPaymentV3Payload.swift; sourceTree = ""; }; 21751EEA243D1369005001D4 /* CustomerAccessTokenCreateWithMultipassPayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomerAccessTokenCreateWithMultipassPayload.swift; sourceTree = ""; }; - 21751EEB243D136A005001D4 /* PaymentTokenType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PaymentTokenType.swift; sourceTree = ""; }; - 21751EEC243D136A005001D4 /* TokenizedPaymentInputV3.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TokenizedPaymentInputV3.swift; sourceTree = ""; }; 4E28FEB3270780B300F9EBED /* CartDiscountCode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CartDiscountCode.swift; sourceTree = ""; }; 4E28FEB4270780B300F9EBED /* CartErrorCode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CartErrorCode.swift; sourceTree = ""; }; 4E28FEB5270780B400F9EBED /* CartAttributesUpdatePayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CartAttributesUpdatePayload.swift; sourceTree = ""; }; @@ -1329,6 +1329,47 @@ 4EC215932A55CB8700BD6148 /* SearchResultItemEdge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchResultItemEdge.swift; sourceTree = ""; }; 4EC215942A55CB8700BD6148 /* ComponentizableCartLine.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComponentizableCartLine.swift; sourceTree = ""; }; 4EC215952A55CB8700BD6148 /* SearchQuerySuggestion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchQuerySuggestion.swift; sourceTree = ""; }; + 4EC30D752C407F5800D9336D /* ShopPayPaymentRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequest.swift; sourceTree = ""; }; + 4EC30D762C407F5900D9336D /* SellingPlanInterval.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SellingPlanInterval.swift; sourceTree = ""; }; + 4EC30D772C407F5900D9336D /* CartPreferences.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CartPreferences.swift; sourceTree = ""; }; + 4EC30D782C407F5900D9336D /* ShopPayPaymentRequestDiscountInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestDiscountInput.swift; sourceTree = ""; }; + 4EC30D792C407F5900D9336D /* ShopPayPaymentRequestDeliveryMethodInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestDeliveryMethodInput.swift; sourceTree = ""; }; + 4EC30D7A2C407F5900D9336D /* ProductVariantComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductVariantComponent.swift; sourceTree = ""; }; + 4EC30D7B2C407F5900D9336D /* ShopPayPaymentRequestSessionSubmitPayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestSessionSubmitPayload.swift; sourceTree = ""; }; + 4EC30D7C2C407F5900D9336D /* ShopPayPaymentRequestTotalShippingPriceInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestTotalShippingPriceInput.swift; sourceTree = ""; }; + 4EC30D7D2C407F5900D9336D /* ShopPayPaymentRequestSession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestSession.swift; sourceTree = ""; }; + 4EC30D7E2C407F5900D9336D /* CartDeliveryPreferenceInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CartDeliveryPreferenceInput.swift; sourceTree = ""; }; + 4EC30D7F2C407F5900D9336D /* ShopPayPaymentRequestContactField.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestContactField.swift; sourceTree = ""; }; + 4EC30D802C407F5900D9336D /* CartDeliveryCoordinatesPreference.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CartDeliveryCoordinatesPreference.swift; sourceTree = ""; }; + 4EC30D812C407F5900D9336D /* ShopPayPaymentRequestTotalShippingPrice.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestTotalShippingPrice.swift; sourceTree = ""; }; + 4EC30D822C407F5900D9336D /* ShopPayPaymentRequestShippingLine.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestShippingLine.swift; sourceTree = ""; }; + 4EC30D832C407F5900D9336D /* ShopPayPaymentRequestInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestInput.swift; sourceTree = ""; }; + 4EC30D842C407F5900D9336D /* SellingPlanRecurringBillingPolicy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SellingPlanRecurringBillingPolicy.swift; sourceTree = ""; }; + 4EC30D852C407F5900D9336D /* CartGiftCardCodesUpdatePayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CartGiftCardCodesUpdatePayload.swift; sourceTree = ""; }; + 4EC30D862C407F5900D9336D /* CartBillingAddressUpdatePayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CartBillingAddressUpdatePayload.swift; sourceTree = ""; }; + 4EC30D872C407F5900D9336D /* CartDeliveryCoordinatesPreferenceInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CartDeliveryCoordinatesPreferenceInput.swift; sourceTree = ""; }; + 4EC30D882C407F5900D9336D /* ShopPayPaymentRequestDeliveryMethod.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestDeliveryMethod.swift; sourceTree = ""; }; + 4EC30D892C407F5900D9336D /* ShopPayPaymentRequestImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestImage.swift; sourceTree = ""; }; + 4EC30D8A2C407F5A00D9336D /* ProductOptionValueSwatch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductOptionValueSwatch.swift; sourceTree = ""; }; + 4EC30D8B2C407F5A00D9336D /* ProductOptionValue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductOptionValue.swift; sourceTree = ""; }; + 4EC30D8C2C407F5A00D9336D /* ProductVariantComponentConnection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductVariantComponentConnection.swift; sourceTree = ""; }; + 4EC30D8D2C407F5A00D9336D /* ShopPayPaymentRequestSessionCreatePayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestSessionCreatePayload.swift; sourceTree = ""; }; + 4EC30D8E2C407F5A00D9336D /* ShopPayPaymentRequestDeliveryMethodType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestDeliveryMethodType.swift; sourceTree = ""; }; + 4EC30D8F2C407F5A00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift; sourceTree = ""; }; + 4EC30D902C407F5A00D9336D /* ShopPayPaymentRequestLineItemInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestLineItemInput.swift; sourceTree = ""; }; + 4EC30D912C407F5A00D9336D /* ShopPayPaymentRequestLineItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestLineItem.swift; sourceTree = ""; }; + 4EC30D922C407F5A00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrors.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserErrorsShopPayPaymentRequestSessionUserErrors.swift; sourceTree = ""; }; + 4EC30D932C407F5A00D9336D /* CartDeliveryPreference.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CartDeliveryPreference.swift; sourceTree = ""; }; + 4EC30D942C407F5A00D9336D /* ShopPayPaymentRequestImageInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestImageInput.swift; sourceTree = ""; }; + 4EC30D952C407F5A00D9336D /* ShopPayPaymentRequestReceipt.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestReceipt.swift; sourceTree = ""; }; + 4EC30D962C407F5A00D9336D /* ShopPayPaymentRequestShippingLineInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestShippingLineInput.swift; sourceTree = ""; }; + 4EC30D972C407F5A00D9336D /* ShopPayPaymentRequestDiscount.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPayPaymentRequestDiscount.swift; sourceTree = ""; }; + 4EC30D982C407F5A00D9336D /* ProductVariantComponentEdge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductVariantComponentEdge.swift; sourceTree = ""; }; + 4EC30D992C407F5A00D9336D /* CartPreferencesInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CartPreferencesInput.swift; sourceTree = ""; }; + 4EC30D9A2C407F5A00D9336D /* PreferenceDeliveryMethodType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreferenceDeliveryMethodType.swift; sourceTree = ""; }; + 4EC30D9B2C407F5A00D9336D /* SellingPlanBillingPolicy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SellingPlanBillingPolicy.swift; sourceTree = ""; }; + 4EC30D9C2C407F5A00D9336D /* SellingPlanDeliveryPolicy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SellingPlanDeliveryPolicy.swift; sourceTree = ""; }; + 4EC30D9D2C407F5A00D9336D /* SellingPlanRecurringDeliveryPolicy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SellingPlanRecurringDeliveryPolicy.swift; sourceTree = ""; }; 4EC8A6ED278792B400FC193B /* MetafieldReference.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MetafieldReference.swift; sourceTree = ""; }; 4EC8A6EE278792B400FC193B /* Filter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Filter.swift; sourceTree = ""; }; 4EC8A6EF278792B400FC193B /* ProductFilter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductFilter.swift; sourceTree = ""; }; @@ -1363,12 +1404,10 @@ 4EFBFAB72694B88C0054C426 /* InContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = InContext.swift; sourceTree = ""; }; 4EFBFABB2694B89B0054C426 /* StoreAvailabilityEdge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAvailabilityEdge.swift; sourceTree = ""; }; 4EFBFABC2694B89B0054C426 /* LocationConnection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationConnection.swift; sourceTree = ""; }; - 4EFBFABD2694B89B0054C426 /* CheckoutBuyerIdentity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutBuyerIdentity.swift; sourceTree = ""; }; 4EFBFABE2694B89B0054C426 /* Currency.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Currency.swift; sourceTree = ""; }; 4EFBFABF2694B89C0054C426 /* UnitSystem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnitSystem.swift; sourceTree = ""; }; 4EFBFAC02694B89C0054C426 /* SellingPlanPriceAdjustmentValue.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SellingPlanPriceAdjustmentValue.swift; sourceTree = ""; }; 4EFBFAC12694B89C0054C426 /* SellingPlanAllocationEdge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SellingPlanAllocationEdge.swift; sourceTree = ""; }; - 4EFBFAC22694B89C0054C426 /* CheckoutBuyerIdentityInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutBuyerIdentityInput.swift; sourceTree = ""; }; 4EFBFAC32694B89C0054C426 /* LocationSortKeys.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationSortKeys.swift; sourceTree = ""; }; 4EFBFAC42694B89C0054C426 /* SellingPlanPercentagePriceAdjustment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SellingPlanPercentagePriceAdjustment.swift; sourceTree = ""; }; 4EFBFAC52694B89C0054C426 /* SellingPlanEdge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SellingPlanEdge.swift; sourceTree = ""; }; @@ -1419,25 +1458,10 @@ 9A0C7FF91EAA51C50020F187 /* AppliedGiftCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppliedGiftCard.swift; sourceTree = ""; }; 9A0C7FFA1EAA51C50020F187 /* Attribute.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Attribute.swift; sourceTree = ""; }; 9A0C7FFB1EAA51C50020F187 /* AttributeInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AttributeInput.swift; sourceTree = ""; }; - 9A0C7FFC1EAA51C50020F187 /* AvailableShippingRates.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AvailableShippingRates.swift; sourceTree = ""; }; - 9A0C7FFD1EAA51C50020F187 /* Checkout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Checkout.swift; sourceTree = ""; }; - 9A0C80001EAA51C50020F187 /* CheckoutCompleteFreePayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutCompleteFreePayload.swift; sourceTree = ""; }; - 9A0C80031EAA51C50020F187 /* CheckoutCreateInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutCreateInput.swift; sourceTree = ""; }; - 9A0C80041EAA51C50020F187 /* CheckoutCreatePayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutCreatePayload.swift; sourceTree = ""; }; - 9A0C800A1EAA51C50020F187 /* CheckoutLineItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutLineItem.swift; sourceTree = ""; }; - 9A0C800B1EAA51C50020F187 /* CheckoutLineItemConnection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutLineItemConnection.swift; sourceTree = ""; }; - 9A0C800C1EAA51C50020F187 /* CheckoutLineItemEdge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutLineItemEdge.swift; sourceTree = ""; }; - 9A0C800D1EAA51C50020F187 /* CheckoutLineItemInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutLineItemInput.swift; sourceTree = ""; }; - 9A0C800E1EAA51C50020F187 /* CheckoutLineItemsAddPayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutLineItemsAddPayload.swift; sourceTree = ""; }; - 9A0C800F1EAA51C50020F187 /* CheckoutLineItemsRemovePayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutLineItemsRemovePayload.swift; sourceTree = ""; }; - 9A0C80101EAA51C50020F187 /* CheckoutLineItemsUpdatePayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutLineItemsUpdatePayload.swift; sourceTree = ""; }; - 9A0C80111EAA51C50020F187 /* CheckoutLineItemUpdateInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutLineItemUpdateInput.swift; sourceTree = ""; }; - 9A0C80131EAA51C50020F187 /* CheckoutShippingLineUpdatePayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutShippingLineUpdatePayload.swift; sourceTree = ""; }; 9A0C80141EAA51C50020F187 /* Collection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Collection.swift; sourceTree = ""; }; 9A0C80151EAA51C50020F187 /* CollectionConnection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionConnection.swift; sourceTree = ""; }; 9A0C80161EAA51C50020F187 /* CollectionEdge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionEdge.swift; sourceTree = ""; }; 9A0C80171EAA51C50020F187 /* CollectionSortKeys.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionSortKeys.swift; sourceTree = ""; }; - 9A0C80181EAA51C50020F187 /* CreditCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreditCard.swift; sourceTree = ""; }; 9A0C801A1EAA51C50020F187 /* CropRegion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CropRegion.swift; sourceTree = ""; }; 9A0C801B1EAA51C50020F187 /* CurrencyCode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CurrencyCode.swift; sourceTree = ""; }; 9A0C801C1EAA51C50020F187 /* Customer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Customer.swift; sourceTree = ""; }; @@ -1477,7 +1501,6 @@ 9A0C80401EAA51C50020F187 /* OrderLineItemEdge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderLineItemEdge.swift; sourceTree = ""; }; 9A0C80411EAA51C50020F187 /* OrderSortKeys.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OrderSortKeys.swift; sourceTree = ""; }; 9A0C80421EAA51C50020F187 /* PageInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PageInfo.swift; sourceTree = ""; }; - 9A0C80431EAA51C50020F187 /* Payment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Payment.swift; sourceTree = ""; }; 9A0C80441EAA51C50020F187 /* Product.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Product.swift; sourceTree = ""; }; 9A0C80451EAA51C50020F187 /* ProductConnection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductConnection.swift; sourceTree = ""; }; 9A0C80461EAA51C50020F187 /* ProductEdge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductEdge.swift; sourceTree = ""; }; @@ -1488,12 +1511,8 @@ 9A0C804B1EAA51C50020F187 /* ProductVariantEdge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductVariantEdge.swift; sourceTree = ""; }; 9A0C804C1EAA51C50020F187 /* QueryRoot.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QueryRoot.swift; sourceTree = ""; }; 9A0C804D1EAA51C50020F187 /* SelectedOption.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectedOption.swift; sourceTree = ""; }; - 9A0C804E1EAA51C50020F187 /* ShippingRate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShippingRate.swift; sourceTree = ""; }; 9A0C804F1EAA51C50020F187 /* Shop.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Shop.swift; sourceTree = ""; }; 9A0C80501EAA51C50020F187 /* ShopPolicy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShopPolicy.swift; sourceTree = ""; }; - 9A0C80521EAA51C50020F187 /* Transaction.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Transaction.swift; sourceTree = ""; }; - 9A0C80531EAA51C50020F187 /* TransactionKind.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionKind.swift; sourceTree = ""; }; - 9A0C80541EAA51C50020F187 /* TransactionStatus.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TransactionStatus.swift; sourceTree = ""; }; 9A0C80551EAA51C50020F187 /* UserError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserError.swift; sourceTree = ""; }; 9A0C80561EAA51C50020F187 /* WeightUnit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WeightUnit.swift; sourceTree = ""; }; 9A0C80571EAA51C50020F187 /* Storefront.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Storefront.swift; sourceTree = ""; }; @@ -1513,7 +1532,6 @@ 9A2ACDC221CABAC100C09FF7 /* PageEdge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PageEdge.swift; sourceTree = ""; }; 9A2ACDC321CABAC200C09FF7 /* Page.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Page.swift; sourceTree = ""; }; 9A2ACDC421CABAC200C09FF7 /* PageSortKeys.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PageSortKeys.swift; sourceTree = ""; }; - 9A2ACDDA21CABB7000C09FF7 /* CheckoutLineItemsReplacePayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutLineItemsReplacePayload.swift; sourceTree = ""; }; 9A2ACE2C21CD3C8600C09FF7 /* AutomaticDiscountApplication.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutomaticDiscountApplication.swift; sourceTree = ""; }; 9A371409251A21B200FE742B /* GraphQL.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GraphQL.swift; sourceTree = ""; }; 9A371422251A24CF00FE742B /* Package.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; @@ -1537,24 +1555,13 @@ 9A4069CB1E8EA710000254CD /* Graph.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Graph.swift; sourceTree = ""; }; 9A4069CE1E8ED98A000254CD /* Graph.Task.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Graph.Task.swift; sourceTree = ""; }; 9A41E2A91F8509770059485A /* CustomerDefaultAddressUpdatePayload.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomerDefaultAddressUpdatePayload.swift; sourceTree = ""; }; - 9A43489A20C84A56005EAD56 /* CheckoutDiscountCodeRemovePayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutDiscountCodeRemovePayload.swift; sourceTree = ""; }; - 9A47C046218087870043525D /* CheckoutCustomerAssociateV2Payload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutCustomerAssociateV2Payload.swift; sourceTree = ""; }; - 9A47C047218087880043525D /* CheckoutGiftCardRemoveV2Payload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutGiftCardRemoveV2Payload.swift; sourceTree = ""; }; - 9A47C048218087880043525D /* CheckoutCustomerDisassociateV2Payload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutCustomerDisassociateV2Payload.swift; sourceTree = ""; }; 9A49DC821EC4AD580053710B /* Header.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Header.swift; sourceTree = ""; }; 9A52D3A01F3CA58E00C093C8 /* ProductImageSortKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductImageSortKeys.swift; sourceTree = ""; }; 9A52D3A11F3CA58E00C093C8 /* CardBrand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardBrand.swift; sourceTree = ""; }; 9A52D3A41F3CA5DB00C093C8 /* DigitalWallet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DigitalWallet.swift; sourceTree = ""; }; 9A52D3B11F3CE99900C093C8 /* PayCardBrand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PayCardBrand.swift; sourceTree = ""; }; - 9A656CBD2183B04600D3A41C /* CheckoutEmailUpdateV2Payload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutEmailUpdateV2Payload.swift; sourceTree = ""; }; - 9A656CBE2183B04700D3A41C /* CheckoutShippingAddressUpdateV2Payload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutShippingAddressUpdateV2Payload.swift; sourceTree = ""; }; - 9A656CBF2183B04700D3A41C /* CheckoutDiscountCodeApplyV2Payload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutDiscountCodeApplyV2Payload.swift; sourceTree = ""; }; 9A664D7F1EF159F8001BFB01 /* SHA256Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SHA256Tests.swift; sourceTree = ""; }; - 9A6711302166678100A57A3F /* CreditCardPaymentInputV2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CreditCardPaymentInputV2.swift; sourceTree = ""; }; 9A6711312166678300A57A3F /* MoneyInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoneyInput.swift; sourceTree = ""; }; - 9A6711372166678500A57A3F /* CheckoutCompleteWithCreditCardV2Payload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutCompleteWithCreditCardV2Payload.swift; sourceTree = ""; }; - 9A67114121666A6600A57A3F /* CheckoutErrorCode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutErrorCode.swift; sourceTree = ""; }; - 9A67114521666A7700A57A3F /* CheckoutUserError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutUserError.swift; sourceTree = ""; }; 9A67114921666AAE00A57A3F /* ScriptDiscountApplication.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScriptDiscountApplication.swift; sourceTree = ""; }; 9A67114A21666AAE00A57A3F /* DiscountApplicationEdge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DiscountApplicationEdge.swift; sourceTree = ""; }; 9A67114B21666AAE00A57A3F /* DiscountApplicationConnection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DiscountApplicationConnection.swift; sourceTree = ""; }; @@ -1613,12 +1620,9 @@ 9ABEB3A82122FF7700A373F2 /* FulfillmentLineItemEdge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FulfillmentLineItemEdge.swift; sourceTree = ""; }; 9ABEB3B82122FF7F00A373F2 /* CustomerUserError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomerUserError.swift; sourceTree = ""; }; 9ABEB3B92122FF7F00A373F2 /* CustomerErrorCode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomerErrorCode.swift; sourceTree = ""; }; - 9ABEB3C02122FFE900A373F2 /* CheckoutGiftCardsAppendPayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutGiftCardsAppendPayload.swift; sourceTree = ""; }; 9ABEB3D32123598800A373F2 /* PayGiftCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PayGiftCard.swift; sourceTree = ""; }; 9AC2EFC81F6818180037E0D7 /* Buy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Buy.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9AC2EFD61F686DB90037E0D7 /* Optional+Input.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Optional+Input.swift"; sourceTree = ""; }; - 9AD577632153E314006BD1C5 /* CheckoutAttributesUpdateV2Payload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutAttributesUpdateV2Payload.swift; sourceTree = ""; }; - 9AD577642153E315006BD1C5 /* CheckoutAttributesUpdateV2Input.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckoutAttributesUpdateV2Input.swift; sourceTree = ""; }; 9AD5776B2153E350006BD1C5 /* CustomerResetByUrlPayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomerResetByUrlPayload.swift; sourceTree = ""; }; 9AE1F8151F605F8F00147E77 /* ProductVariantSortKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductVariantSortKeys.swift; sourceTree = ""; }; 9AE2A1C11EC6373B00921247 /* Graph.CachePolicyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Graph.CachePolicyTests.swift; sourceTree = ""; }; @@ -1705,7 +1709,6 @@ 9A0C7FFA1EAA51C50020F187 /* Attribute.swift */, 9A0C7FFB1EAA51C50020F187 /* AttributeInput.swift */, 9A2ACE2C21CD3C8600C09FF7 /* AutomaticDiscountApplication.swift */, - 9A0C7FFC1EAA51C50020F187 /* AvailableShippingRates.swift */, 4EB4DACA29DC5FEE00C9A6BD /* BaseCartLine.swift */, 4EB4DABB29DC5FED00C9A6BD /* BaseCartLineConnection.swift */, 4EB4DAD129DC5FEE00C9A6BD /* BaseCartLineEdge.swift */, @@ -1721,6 +1724,7 @@ 4E28FEC2270780B400F9EBED /* Cart.swift */, 4E28FEB5270780B400F9EBED /* CartAttributesUpdatePayload.swift */, 4E28FEC0270780B400F9EBED /* CartAutomaticDiscountAllocation.swift */, + 4EC30D862C407F5900D9336D /* CartBillingAddressUpdatePayload.swift */, 4E28FECB270780B500F9EBED /* CartBuyerIdentity.swift */, 4E28FEB6270780B400F9EBED /* CartBuyerIdentityInput.swift */, 4E28FEC1270780B400F9EBED /* CartBuyerIdentityUpdatePayload.swift */, @@ -1735,11 +1739,15 @@ 4E87F1CF286F3B1900BFF389 /* CartCost.swift */, 4E28FEBB270780B400F9EBED /* CartCreatePayload.swift */, 4E87F1D7286F3B1900BFF389 /* CartCustomDiscountAllocation.swift */, + 4EC30D802C407F5900D9336D /* CartDeliveryCoordinatesPreference.swift */, + 4EC30D872C407F5900D9336D /* CartDeliveryCoordinatesPreferenceInput.swift */, 4ECBE3FF27FB45D200CB544E /* CartDeliveryGroup.swift */, 4ECBE40727FB45D200CB544E /* CartDeliveryGroupConnection.swift */, 4ECBE3FE27FB45D200CB544E /* CartDeliveryGroupEdge.swift */, 4E69B2452BBB2C0B00913BAA /* CartDeliveryGroupType.swift */, 4ECBE40027FB45D200CB544E /* CartDeliveryOption.swift */, + 4EC30D932C407F5A00D9336D /* CartDeliveryPreference.swift */, + 4EC30D7E2C407F5900D9336D /* CartDeliveryPreferenceInput.swift */, 4EB4DAC129DC5FED00C9A6BD /* CartDirectPaymentMethodInput.swift */, 4E28FEB9270780B400F9EBED /* CartDiscountAllocation.swift */, 4E28FEB3270780B300F9EBED /* CartDiscountCode.swift */, @@ -1747,6 +1755,7 @@ 4E28FEB4270780B300F9EBED /* CartErrorCode.swift */, 4E28FEC3270780B400F9EBED /* CartEstimatedCost.swift */, 4EB4DAB029DC5FED00C9A6BD /* CartFreePaymentMethodInput.swift */, + 4EC30D852C407F5900D9336D /* CartGiftCardCodesUpdatePayload.swift */, 4E28FEC4270780B400F9EBED /* CartInput.swift */, 4EB4DAC429DC5FED00C9A6BD /* CartInputMetafieldInput.swift */, 4E28FEBE270780B400F9EBED /* CartLine.swift */, @@ -1764,42 +1773,14 @@ 4E28FEC9270780B400F9EBED /* CartNoteUpdatePayload.swift */, 4EB4DAB329DC5FED00C9A6BD /* CartPaymentInput.swift */, 4EB4DAC929DC5FEE00C9A6BD /* CartPaymentUpdatePayload.swift */, + 4EC30D772C407F5900D9336D /* CartPreferences.swift */, + 4EC30D992C407F5A00D9336D /* CartPreferencesInput.swift */, 4EF3D32A28EB2182007215E6 /* CartSelectedDeliveryOptionInput.swift */, 4EF3D32728EB2182007215E6 /* CartSelectedDeliveryOptionsUpdatePayload.swift */, 4EB4DAC329DC5FED00C9A6BD /* CartSubmitForCompletionPayload.swift */, 4EB4DAAB29DC5FED00C9A6BD /* CartSubmitForCompletionResult.swift */, 4E28FEBD270780B400F9EBED /* CartUserError.swift */, 4EB4DAB829DC5FED00C9A6BD /* CartWalletPaymentMethodInput.swift */, - 9A0C7FFD1EAA51C50020F187 /* Checkout.swift */, - 9AD577642153E315006BD1C5 /* CheckoutAttributesUpdateV2Input.swift */, - 9AD577632153E314006BD1C5 /* CheckoutAttributesUpdateV2Payload.swift */, - 4EFBFABD2694B89B0054C426 /* CheckoutBuyerIdentity.swift */, - 4EFBFAC22694B89C0054C426 /* CheckoutBuyerIdentityInput.swift */, - 9A0C80001EAA51C50020F187 /* CheckoutCompleteFreePayload.swift */, - 9A6711372166678500A57A3F /* CheckoutCompleteWithCreditCardV2Payload.swift */, - 21751EE9243D1369005001D4 /* CheckoutCompleteWithTokenizedPaymentV3Payload.swift */, - 9A0C80031EAA51C50020F187 /* CheckoutCreateInput.swift */, - 9A0C80041EAA51C50020F187 /* CheckoutCreatePayload.swift */, - 9A47C046218087870043525D /* CheckoutCustomerAssociateV2Payload.swift */, - 9A47C048218087880043525D /* CheckoutCustomerDisassociateV2Payload.swift */, - 9A656CBF2183B04700D3A41C /* CheckoutDiscountCodeApplyV2Payload.swift */, - 9A43489A20C84A56005EAD56 /* CheckoutDiscountCodeRemovePayload.swift */, - 9A656CBD2183B04600D3A41C /* CheckoutEmailUpdateV2Payload.swift */, - 9A67114121666A6600A57A3F /* CheckoutErrorCode.swift */, - 9A47C047218087880043525D /* CheckoutGiftCardRemoveV2Payload.swift */, - 9ABEB3C02122FFE900A373F2 /* CheckoutGiftCardsAppendPayload.swift */, - 9A0C800A1EAA51C50020F187 /* CheckoutLineItem.swift */, - 9A0C800B1EAA51C50020F187 /* CheckoutLineItemConnection.swift */, - 9A0C800C1EAA51C50020F187 /* CheckoutLineItemEdge.swift */, - 9A0C800D1EAA51C50020F187 /* CheckoutLineItemInput.swift */, - 9A0C800E1EAA51C50020F187 /* CheckoutLineItemsAddPayload.swift */, - 9A0C800F1EAA51C50020F187 /* CheckoutLineItemsRemovePayload.swift */, - 9A2ACDDA21CABB7000C09FF7 /* CheckoutLineItemsReplacePayload.swift */, - 9A0C80101EAA51C50020F187 /* CheckoutLineItemsUpdatePayload.swift */, - 9A0C80111EAA51C50020F187 /* CheckoutLineItemUpdateInput.swift */, - 9A656CBE2183B04700D3A41C /* CheckoutShippingAddressUpdateV2Payload.swift */, - 9A0C80131EAA51C50020F187 /* CheckoutShippingLineUpdatePayload.swift */, - 9A67114521666A7700A57A3F /* CheckoutUserError.swift */, 9A0C80141EAA51C50020F187 /* Collection.swift */, 9A0C80151EAA51C50020F187 /* CollectionConnection.swift */, 9A0C80161EAA51C50020F187 /* CollectionEdge.swift */, @@ -1817,8 +1798,6 @@ 4EC215942A55CB8700BD6148 /* ComponentizableCartLine.swift */, 4EFBFAD12694B89D0054C426 /* Country.swift */, 9AF1C1861F13ACCF0064AEA0 /* CountryCode.swift */, - 9A0C80181EAA51C50020F187 /* CreditCard.swift */, - 9A6711302166678100A57A3F /* CreditCardPaymentInputV2.swift */, 9A0C801A1EAA51C50020F187 /* CropRegion.swift */, 4EFBFABE2694B89B0054C426 /* Currency.swift */, 9A0C801B1EAA51C50020F187 /* CurrencyCode.swift */, @@ -1946,12 +1925,11 @@ 9A2ACDC221CABAC100C09FF7 /* PageEdge.swift */, 9A0C80421EAA51C50020F187 /* PageInfo.swift */, 9A2ACDC421CABAC200C09FF7 /* PageSortKeys.swift */, - 9A0C80431EAA51C50020F187 /* Payment.swift */, 9AF1C1851F13ACCF0064AEA0 /* PaymentSettings.swift */, - 21751EEB243D136A005001D4 /* PaymentTokenType.swift */, 4EC215922A55CB8700BD6148 /* PredictiveSearchLimitScope.swift */, 4EC2158A2A55CB8700BD6148 /* PredictiveSearchResult.swift */, 4EC215912A55CB8700BD6148 /* PredictiveSearchType.swift */, + 4EC30D9A2C407F5A00D9336D /* PreferenceDeliveryMethodType.swift */, 4EC8A6F4278792B400FC193B /* PriceRangeFilter.swift */, 9A67115021666AB000A57A3F /* PricingPercentageValue.swift */, 9A67115121666AB000A57A3F /* PricingValue.swift */, @@ -1963,10 +1941,15 @@ 9A52D3A01F3CA58E00C093C8 /* ProductImageSortKeys.swift */, 2121506225A8C6C600191C61 /* ProductMediaSortKeys.swift */, 9A0C80471EAA51C50020F187 /* ProductOption.swift */, + 4EC30D8B2C407F5A00D9336D /* ProductOptionValue.swift */, + 4EC30D8A2C407F5A00D9336D /* ProductOptionValueSwatch.swift */, 9A9EA43B20AF0EBB002CB926 /* ProductPriceRange.swift */, 4EB4DACE29DC5FEE00C9A6BD /* ProductRecommendationIntent.swift */, 9A0C80481EAA51C50020F187 /* ProductSortKeys.swift */, 9A0C80491EAA51C50020F187 /* ProductVariant.swift */, + 4EC30D7A2C407F5900D9336D /* ProductVariantComponent.swift */, + 4EC30D8C2C407F5A00D9336D /* ProductVariantComponentConnection.swift */, + 4EC30D982C407F5A00D9336D /* ProductVariantComponentEdge.swift */, 9A0C804A1EAA51C50020F187 /* ProductVariantConnection.swift */, 9A0C804B1EAA51C50020F187 /* ProductVariantEdge.swift */, 9AE1F8151F605F8F00147E77 /* ProductVariantSortKeys.swift */, @@ -1993,11 +1976,13 @@ 4EFBFACA2694B89C0054C426 /* SellingPlanAllocationConnection.swift */, 4EFBFAC12694B89C0054C426 /* SellingPlanAllocationEdge.swift */, 4EFBFAD82694B89D0054C426 /* SellingPlanAllocationPriceAdjustment.swift */, + 4EC30D9B2C407F5A00D9336D /* SellingPlanBillingPolicy.swift */, 4E87F1D0286F3B1900BFF389 /* SellingPlanCheckoutCharge.swift */, 4E87F1D8286F3B1900BFF389 /* SellingPlanCheckoutChargePercentageValue.swift */, 4E87F1D3286F3B1900BFF389 /* SellingPlanCheckoutChargeType.swift */, 4E87F1D5286F3B1900BFF389 /* SellingPlanCheckoutChargeValue.swift */, 4EFBFAC72694B89C0054C426 /* SellingPlanConnection.swift */, + 4EC30D9C2C407F5A00D9336D /* SellingPlanDeliveryPolicy.swift */, 4EFBFAC52694B89C0054C426 /* SellingPlanEdge.swift */, 4EFBFAD22694B89D0054C426 /* SellingPlanFixedAmountPriceAdjustment.swift */, 4EFBFAD02694B89D0054C426 /* SellingPlanFixedPriceAdjustment.swift */, @@ -2005,13 +1990,35 @@ 4EFBFAD52694B89D0054C426 /* SellingPlanGroupConnection.swift */, 4EFBFAC82694B89C0054C426 /* SellingPlanGroupEdge.swift */, 4EFBFADA2694B89D0054C426 /* SellingPlanGroupOption.swift */, + 4EC30D762C407F5900D9336D /* SellingPlanInterval.swift */, 4EFBFAD92694B89D0054C426 /* SellingPlanOption.swift */, 4EFBFAC42694B89C0054C426 /* SellingPlanPercentagePriceAdjustment.swift */, 4EFBFAD32694B89D0054C426 /* SellingPlanPriceAdjustment.swift */, 4EFBFAC02694B89C0054C426 /* SellingPlanPriceAdjustmentValue.swift */, + 4EC30D842C407F5900D9336D /* SellingPlanRecurringBillingPolicy.swift */, + 4EC30D9D2C407F5A00D9336D /* SellingPlanRecurringDeliveryPolicy.swift */, B3B5A02F223FF6C3008ECA02 /* SEO.swift */, - 9A0C804E1EAA51C50020F187 /* ShippingRate.swift */, 9A0C804F1EAA51C50020F187 /* Shop.swift */, + 4EC30D752C407F5800D9336D /* ShopPayPaymentRequest.swift */, + 4EC30D7F2C407F5900D9336D /* ShopPayPaymentRequestContactField.swift */, + 4EC30D882C407F5900D9336D /* ShopPayPaymentRequestDeliveryMethod.swift */, + 4EC30D792C407F5900D9336D /* ShopPayPaymentRequestDeliveryMethodInput.swift */, + 4EC30D8E2C407F5A00D9336D /* ShopPayPaymentRequestDeliveryMethodType.swift */, + 4EC30D972C407F5A00D9336D /* ShopPayPaymentRequestDiscount.swift */, + 4EC30D782C407F5900D9336D /* ShopPayPaymentRequestDiscountInput.swift */, + 4EC30D892C407F5900D9336D /* ShopPayPaymentRequestImage.swift */, + 4EC30D942C407F5A00D9336D /* ShopPayPaymentRequestImageInput.swift */, + 4EC30D832C407F5900D9336D /* ShopPayPaymentRequestInput.swift */, + 4EC30D912C407F5A00D9336D /* ShopPayPaymentRequestLineItem.swift */, + 4EC30D902C407F5A00D9336D /* ShopPayPaymentRequestLineItemInput.swift */, + 4EC30D952C407F5A00D9336D /* ShopPayPaymentRequestReceipt.swift */, + 4EC30D7D2C407F5900D9336D /* ShopPayPaymentRequestSession.swift */, + 4EC30D8D2C407F5A00D9336D /* ShopPayPaymentRequestSessionCreatePayload.swift */, + 4EC30D7B2C407F5900D9336D /* ShopPayPaymentRequestSessionSubmitPayload.swift */, + 4EC30D822C407F5900D9336D /* ShopPayPaymentRequestShippingLine.swift */, + 4EC30D962C407F5A00D9336D /* ShopPayPaymentRequestShippingLineInput.swift */, + 4EC30D812C407F5900D9336D /* ShopPayPaymentRequestTotalShippingPrice.swift */, + 4EC30D7C2C407F5900D9336D /* ShopPayPaymentRequestTotalShippingPriceInput.swift */, 4EB4DAB529DC5FED00C9A6BD /* ShopPayWalletContentInput.swift */, 9A0C80501EAA51C50020F187 /* ShopPolicy.swift */, 4EC8A6F1278792B400FC193B /* ShopPolicyWithDefault.swift */, @@ -2027,11 +2034,7 @@ 4EB4DAA929DC5FED00C9A6BD /* SubmitSuccess.swift */, 4EB4DAAA29DC5FED00C9A6BD /* SubmitThrottled.swift */, 4E69B2392BBB2C0A00913BAA /* Swatch.swift */, - 21751EEC243D136A005001D4 /* TokenizedPaymentInputV3.swift */, 4EC215902A55CB8700BD6148 /* Trackable.swift */, - 9A0C80521EAA51C50020F187 /* Transaction.swift */, - 9A0C80531EAA51C50020F187 /* TransactionKind.swift */, - 9A0C80541EAA51C50020F187 /* TransactionStatus.swift */, 8128550523C4AC7E00ADA66E /* UnitPriceMeasurement.swift */, 8128551123C4AC7E00ADA66E /* UnitPriceMeasurementMeasuredType.swift */, 8128550823C4AC7E00ADA66E /* UnitPriceMeasurementMeasuredUnit.swift */, @@ -2040,6 +2043,8 @@ 4E87F1D4286F3B1900BFF389 /* UrlRedirectConnection.swift */, 4E87F1D2286F3B1900BFF389 /* UrlRedirectEdge.swift */, 9A0C80551EAA51C50020F187 /* UserError.swift */, + 4EC30D922C407F5A00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrors.swift */, + 4EC30D8F2C407F5A00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift */, 4EC8A6F2278792B400FC193B /* VariantOptionFilter.swift */, 8128550723C4AC7E00ADA66E /* Video.swift */, 8128550623C4AC7E00ADA66E /* VideoSource.swift */, @@ -2640,7 +2645,6 @@ 9AC2EF391F6818180037E0D7 /* Attribute.swift in Sources */, 9AC2EF991F6818180037E0D7 /* AttributeInput.swift in Sources */, 9A2ACE2E21CD3C8700C09FF7 /* AutomaticDiscountApplication.swift in Sources */, - 9AC2EF431F6818180037E0D7 /* AvailableShippingRates.swift in Sources */, 4EB4DB3729DC5FEE00C9A6BD /* BaseCartLine.swift in Sources */, 4EB4DB0A29DC5FEE00C9A6BD /* BaseCartLineConnection.swift in Sources */, 4EB4DB4C29DC5FEE00C9A6BD /* BaseCartLineEdge.swift in Sources */, @@ -2659,6 +2663,7 @@ 4E28FEFD270780B500F9EBED /* Cart.swift in Sources */, 4E28FED6270780B500F9EBED /* CartAttributesUpdatePayload.swift in Sources */, 4E28FEF7270780B500F9EBED /* CartAutomaticDiscountAllocation.swift in Sources */, + 4EC30DD32C407F5B00D9336D /* CartBillingAddressUpdatePayload.swift in Sources */, 4E28FF18270780B500F9EBED /* CartBuyerIdentity.swift in Sources */, 4E28FED9270780B500F9EBED /* CartBuyerIdentityInput.swift in Sources */, 4E28FEFA270780B500F9EBED /* CartBuyerIdentityUpdatePayload.swift in Sources */, @@ -2673,11 +2678,15 @@ 4E87F1DE286F3B1900BFF389 /* CartCost.swift in Sources */, 4E28FEE8270780B500F9EBED /* CartCreatePayload.swift in Sources */, 4E87F1F6286F3B1A00BFF389 /* CartCustomDiscountAllocation.swift in Sources */, + 4EC30DC12C407F5B00D9336D /* CartDeliveryCoordinatesPreference.swift in Sources */, + 4EC30DD62C407F5B00D9336D /* CartDeliveryCoordinatesPreferenceInput.swift in Sources */, 4ECBE40E27FB45D200CB544E /* CartDeliveryGroup.swift in Sources */, 4ECBE42627FB45D200CB544E /* CartDeliveryGroupConnection.swift in Sources */, 4ECBE40B27FB45D200CB544E /* CartDeliveryGroupEdge.swift in Sources */, 4E69B26C2BBB2C0B00913BAA /* CartDeliveryGroupType.swift in Sources */, 4ECBE41127FB45D200CB544E /* CartDeliveryOption.swift in Sources */, + 4EC30DFA2C407F5B00D9336D /* CartDeliveryPreference.swift in Sources */, + 4EC30DBB2C407F5B00D9336D /* CartDeliveryPreferenceInput.swift in Sources */, 4EB4DB1C29DC5FEE00C9A6BD /* CartDirectPaymentMethodInput.swift in Sources */, 4E28FEE2270780B500F9EBED /* CartDiscountAllocation.swift in Sources */, 4E28FED0270780B500F9EBED /* CartDiscountCode.swift in Sources */, @@ -2685,6 +2694,7 @@ 4E28FED3270780B500F9EBED /* CartErrorCode.swift in Sources */, 4E28FF00270780B500F9EBED /* CartEstimatedCost.swift in Sources */, 4EB4DAE929DC5FEE00C9A6BD /* CartFreePaymentMethodInput.swift in Sources */, + 4EC30DD02C407F5B00D9336D /* CartGiftCardCodesUpdatePayload.swift in Sources */, 4E28FF03270780B500F9EBED /* CartInput.swift in Sources */, 4EB4DB2529DC5FEE00C9A6BD /* CartInputMetafieldInput.swift in Sources */, 4E28FEF1270780B500F9EBED /* CartLine.swift in Sources */, @@ -2702,42 +2712,14 @@ 4E28FF12270780B500F9EBED /* CartNoteUpdatePayload.swift in Sources */, 4EB4DAF229DC5FEE00C9A6BD /* CartPaymentInput.swift in Sources */, 4EB4DB3429DC5FEE00C9A6BD /* CartPaymentUpdatePayload.swift in Sources */, + 4EC30DA62C407F5A00D9336D /* CartPreferences.swift in Sources */, + 4EC30E0C2C407F5B00D9336D /* CartPreferencesInput.swift in Sources */, 4EF3D33A28EB2182007215E6 /* CartSelectedDeliveryOptionInput.swift in Sources */, 4EF3D33128EB2182007215E6 /* CartSelectedDeliveryOptionsUpdatePayload.swift in Sources */, 4EB4DB2229DC5FEE00C9A6BD /* CartSubmitForCompletionPayload.swift in Sources */, 4EB4DADA29DC5FEE00C9A6BD /* CartSubmitForCompletionResult.swift in Sources */, 4E28FEEE270780B500F9EBED /* CartUserError.swift in Sources */, 4EB4DB0129DC5FEE00C9A6BD /* CartWalletPaymentMethodInput.swift in Sources */, - 9AC2EF8F1F6818180037E0D7 /* Checkout.swift in Sources */, - 9AD577692153E315006BD1C5 /* CheckoutAttributesUpdateV2Input.swift in Sources */, - 9AD577662153E315006BD1C5 /* CheckoutAttributesUpdateV2Payload.swift in Sources */, - 4EFBFAE22694B89D0054C426 /* CheckoutBuyerIdentity.swift in Sources */, - 4EFBFAF12694B89D0054C426 /* CheckoutBuyerIdentityInput.swift in Sources */, - 9AC2EF561F6818180037E0D7 /* CheckoutCompleteFreePayload.swift in Sources */, - 9A67113F2166678500A57A3F /* CheckoutCompleteWithCreditCardV2Payload.swift in Sources */, - 21751EF7243D136A005001D4 /* CheckoutCompleteWithTokenizedPaymentV3Payload.swift in Sources */, - 9AC2EFB01F6818180037E0D7 /* CheckoutCreateInput.swift in Sources */, - 9AC2EF5E1F6818180037E0D7 /* CheckoutCreatePayload.swift in Sources */, - 9A47C04A218087880043525D /* CheckoutCustomerAssociateV2Payload.swift in Sources */, - 9A47C050218087880043525D /* CheckoutCustomerDisassociateV2Payload.swift in Sources */, - 9A656CC72183B04700D3A41C /* CheckoutDiscountCodeApplyV2Payload.swift in Sources */, - 9A43489C20C84A56005EAD56 /* CheckoutDiscountCodeRemovePayload.swift in Sources */, - 9A656CC12183B04700D3A41C /* CheckoutEmailUpdateV2Payload.swift in Sources */, - 9A67114321666A6700A57A3F /* CheckoutErrorCode.swift in Sources */, - 9A47C04D218087880043525D /* CheckoutGiftCardRemoveV2Payload.swift in Sources */, - 9ABEB3C22122FFE900A373F2 /* CheckoutGiftCardsAppendPayload.swift in Sources */, - 9AC2EFB91F6818180037E0D7 /* CheckoutLineItem.swift in Sources */, - 9AC2EF901F6818180037E0D7 /* CheckoutLineItemConnection.swift in Sources */, - 9AC2EFB31F6818180037E0D7 /* CheckoutLineItemEdge.swift in Sources */, - 9AC2EFB71F6818180037E0D7 /* CheckoutLineItemInput.swift in Sources */, - 9AC2EFA21F6818180037E0D7 /* CheckoutLineItemsAddPayload.swift in Sources */, - 9AC2EF8B1F6818180037E0D7 /* CheckoutLineItemsRemovePayload.swift in Sources */, - 9A2ACDDC21CABB7100C09FF7 /* CheckoutLineItemsReplacePayload.swift in Sources */, - 9AC2EF7F1F6818180037E0D7 /* CheckoutLineItemsUpdatePayload.swift in Sources */, - 9AC2EF641F6818180037E0D7 /* CheckoutLineItemUpdateInput.swift in Sources */, - 9A656CC42183B04700D3A41C /* CheckoutShippingAddressUpdateV2Payload.swift in Sources */, - 9AC2EF541F6818180037E0D7 /* CheckoutShippingLineUpdatePayload.swift in Sources */, - 9A67114721666A7700A57A3F /* CheckoutUserError.swift in Sources */, 9AC2EFAC1F6818180037E0D7 /* Collection.swift in Sources */, 9AC2EF441F6818180037E0D7 /* CollectionConnection.swift in Sources */, 9AC2EF691F6818180037E0D7 /* CollectionEdge.swift in Sources */, @@ -2755,8 +2737,6 @@ 4EC215C22A55CB8800BD6148 /* ComponentizableCartLine.swift in Sources */, 4EFBFB1E2694B89D0054C426 /* Country.swift in Sources */, 9AC2EF9B1F6818180037E0D7 /* CountryCode.swift in Sources */, - 9AC2EF741F6818180037E0D7 /* CreditCard.swift in Sources */, - 9A6711392166678500A57A3F /* CreditCardPaymentInputV2.swift in Sources */, 9AC2EF8A1F6818180037E0D7 /* CropRegion.swift in Sources */, 4EFBFAE52694B89D0054C426 /* Currency.swift in Sources */, 9AC2EF521F6818180037E0D7 /* CurrencyCode.swift in Sources */, @@ -2899,12 +2879,11 @@ 9A2ACDD221CABAC200C09FF7 /* PageEdge.swift in Sources */, 9AC2EF781F6818180037E0D7 /* PageInfo.swift in Sources */, 9A2ACDD821CABAC200C09FF7 /* PageSortKeys.swift in Sources */, - 9AC2EF7D1F6818180037E0D7 /* Payment.swift in Sources */, 9AC2EF5A1F6818180037E0D7 /* PaymentSettings.swift in Sources */, - 21751EFD243D136A005001D4 /* PaymentTokenType.swift in Sources */, 4EC215BC2A55CB8800BD6148 /* PredictiveSearchLimitScope.swift in Sources */, 4EC215A42A55CB8800BD6148 /* PredictiveSearchResult.swift in Sources */, 4EC215B92A55CB8800BD6148 /* PredictiveSearchType.swift in Sources */, + 4EC30E0F2C407F5B00D9336D /* PreferenceDeliveryMethodType.swift in Sources */, 4EC8A7132787946400FC193B /* PriceRangeFilter.swift in Sources */, 9A67116B21666AB200A57A3F /* PricingPercentageValue.swift in Sources */, 9A67116E21666AB200A57A3F /* PricingValue.swift in Sources */, @@ -2916,10 +2895,15 @@ 9AC2EF681F6818180037E0D7 /* ProductImageSortKeys.swift in Sources */, 2121506425A8C6C600191C61 /* ProductMediaSortKeys.swift in Sources */, 9AC2EF3E1F6818180037E0D7 /* ProductOption.swift in Sources */, + 4EC30DE22C407F5B00D9336D /* ProductOptionValue.swift in Sources */, + 4EC30DDF2C407F5B00D9336D /* ProductOptionValueSwatch.swift in Sources */, 9A9EA44320AF0EBB002CB926 /* ProductPriceRange.swift in Sources */, 4EB4DB4329DC5FEE00C9A6BD /* ProductRecommendationIntent.swift in Sources */, 9AC2EFA71F6818180037E0D7 /* ProductSortKeys.swift in Sources */, 9AC2EF831F6818180037E0D7 /* ProductVariant.swift in Sources */, + 4EC30DAF2C407F5A00D9336D /* ProductVariantComponent.swift in Sources */, + 4EC30DE52C407F5B00D9336D /* ProductVariantComponentConnection.swift in Sources */, + 4EC30E092C407F5B00D9336D /* ProductVariantComponentEdge.swift in Sources */, 9AC2EF6E1F6818180037E0D7 /* ProductVariantConnection.swift in Sources */, 9AC2EFBB1F6818180037E0D7 /* ProductVariantEdge.swift in Sources */, 9AC2EF3D1F6818180037E0D7 /* ProductVariantSortKeys.swift in Sources */, @@ -2947,11 +2931,13 @@ 4EFBFB092694B89D0054C426 /* SellingPlanAllocationConnection.swift in Sources */, 4EFBFAEE2694B89D0054C426 /* SellingPlanAllocationEdge.swift in Sources */, 4EFBFB332694B89D0054C426 /* SellingPlanAllocationPriceAdjustment.swift in Sources */, + 4EC30E122C407F5B00D9336D /* SellingPlanBillingPolicy.swift in Sources */, 4E87F1E1286F3B1900BFF389 /* SellingPlanCheckoutCharge.swift in Sources */, 4E87F1F9286F3B1A00BFF389 /* SellingPlanCheckoutChargePercentageValue.swift in Sources */, 4E87F1EA286F3B1A00BFF389 /* SellingPlanCheckoutChargeType.swift in Sources */, 4E87F1F0286F3B1A00BFF389 /* SellingPlanCheckoutChargeValue.swift in Sources */, 4EFBFB002694B89D0054C426 /* SellingPlanConnection.swift in Sources */, + 4EC30E152C407F5B00D9336D /* SellingPlanDeliveryPolicy.swift in Sources */, 4EFBFAFA2694B89D0054C426 /* SellingPlanEdge.swift in Sources */, 4EFBFB212694B89D0054C426 /* SellingPlanFixedAmountPriceAdjustment.swift in Sources */, 4EFBFB1B2694B89D0054C426 /* SellingPlanFixedPriceAdjustment.swift in Sources */, @@ -2959,14 +2945,36 @@ 4EFBFB2A2694B89D0054C426 /* SellingPlanGroupConnection.swift in Sources */, 4EFBFB032694B89D0054C426 /* SellingPlanGroupEdge.swift in Sources */, 4EFBFB392694B89D0054C426 /* SellingPlanGroupOption.swift in Sources */, + 4EC30DA32C407F5A00D9336D /* SellingPlanInterval.swift in Sources */, 4EFBFB362694B89D0054C426 /* SellingPlanOption.swift in Sources */, 4EFBFAF72694B89D0054C426 /* SellingPlanPercentagePriceAdjustment.swift in Sources */, 4EFBFB242694B89D0054C426 /* SellingPlanPriceAdjustment.swift in Sources */, 4EFBFAEB2694B89D0054C426 /* SellingPlanPriceAdjustmentValue.swift in Sources */, + 4EC30DCD2C407F5B00D9336D /* SellingPlanRecurringBillingPolicy.swift in Sources */, + 4EC30E182C407F5B00D9336D /* SellingPlanRecurringDeliveryPolicy.swift in Sources */, B3B5A031223FF6C3008ECA02 /* SEO.swift in Sources */, 9A371465251A2AEC00FE742B /* SHA256.swift in Sources */, - 9AC2EF401F6818180037E0D7 /* ShippingRate.swift in Sources */, 9AC2EF671F6818180037E0D7 /* Shop.swift in Sources */, + 4EC30DA02C407F5A00D9336D /* ShopPayPaymentRequest.swift in Sources */, + 4EC30DBE2C407F5B00D9336D /* ShopPayPaymentRequestContactField.swift in Sources */, + 4EC30DD92C407F5B00D9336D /* ShopPayPaymentRequestDeliveryMethod.swift in Sources */, + 4EC30DAC2C407F5A00D9336D /* ShopPayPaymentRequestDeliveryMethodInput.swift in Sources */, + 4EC30DEB2C407F5B00D9336D /* ShopPayPaymentRequestDeliveryMethodType.swift in Sources */, + 4EC30E062C407F5B00D9336D /* ShopPayPaymentRequestDiscount.swift in Sources */, + 4EC30DA92C407F5A00D9336D /* ShopPayPaymentRequestDiscountInput.swift in Sources */, + 4EC30DDC2C407F5B00D9336D /* ShopPayPaymentRequestImage.swift in Sources */, + 4EC30DFD2C407F5B00D9336D /* ShopPayPaymentRequestImageInput.swift in Sources */, + 4EC30DCA2C407F5B00D9336D /* ShopPayPaymentRequestInput.swift in Sources */, + 4EC30DF42C407F5B00D9336D /* ShopPayPaymentRequestLineItem.swift in Sources */, + 4EC30DF12C407F5B00D9336D /* ShopPayPaymentRequestLineItemInput.swift in Sources */, + 4EC30E002C407F5B00D9336D /* ShopPayPaymentRequestReceipt.swift in Sources */, + 4EC30DB82C407F5B00D9336D /* ShopPayPaymentRequestSession.swift in Sources */, + 4EC30DE82C407F5B00D9336D /* ShopPayPaymentRequestSessionCreatePayload.swift in Sources */, + 4EC30DB22C407F5B00D9336D /* ShopPayPaymentRequestSessionSubmitPayload.swift in Sources */, + 4EC30DC72C407F5B00D9336D /* ShopPayPaymentRequestShippingLine.swift in Sources */, + 4EC30E032C407F5B00D9336D /* ShopPayPaymentRequestShippingLineInput.swift in Sources */, + 4EC30DC42C407F5B00D9336D /* ShopPayPaymentRequestTotalShippingPrice.swift in Sources */, + 4EC30DB52C407F5B00D9336D /* ShopPayPaymentRequestTotalShippingPriceInput.swift in Sources */, 4EB4DAF829DC5FEE00C9A6BD /* ShopPayWalletContentInput.swift in Sources */, 9AC2EF531F6818180037E0D7 /* ShopPolicy.swift in Sources */, 4EC8A7122787946400FC193B /* ShopPolicyWithDefault.swift in Sources */, @@ -2984,11 +2992,7 @@ 4EB4DAD429DC5FEE00C9A6BD /* SubmitSuccess.swift in Sources */, 4EB4DAD729DC5FEE00C9A6BD /* SubmitThrottled.swift in Sources */, 4E69B2482BBB2C0B00913BAA /* Swatch.swift in Sources */, - 21751F00243D136A005001D4 /* TokenizedPaymentInputV3.swift in Sources */, 4EC215B62A55CB8800BD6148 /* Trackable.swift in Sources */, - 9AC2EF5D1F6818180037E0D7 /* Transaction.swift in Sources */, - 9AC2EF931F6818180037E0D7 /* TransactionKind.swift in Sources */, - 9AC2EF841F6818180037E0D7 /* TransactionStatus.swift in Sources */, 815FAB5323C4B82D00F98749 /* UnitPriceMeasurement.swift in Sources */, 815FAB5423C4B82D00F98749 /* UnitPriceMeasurementMeasuredType.swift in Sources */, 815FAB5523C4B82D00F98749 /* UnitPriceMeasurementMeasuredUnit.swift in Sources */, @@ -2997,6 +3001,8 @@ 4E87F1ED286F3B1A00BFF389 /* UrlRedirectConnection.swift in Sources */, 4E87F1E7286F3B1900BFF389 /* UrlRedirectEdge.swift in Sources */, 9AC2EF961F6818180037E0D7 /* UserError.swift in Sources */, + 4EC30DF72C407F5B00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrors.swift in Sources */, + 4EC30DEE2C407F5B00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift in Sources */, 4EC8A70B2787946400FC193B /* VariantOptionFilter.swift in Sources */, 815FAB5623C4B82D00F98749 /* Video.swift in Sources */, 815FAB5723C4B82D00F98749 /* VideoSource.swift in Sources */, @@ -3020,7 +3026,6 @@ 9A0C80591EAA51C50020F187 /* Attribute.swift in Sources */, 9A0C805A1EAA51C50020F187 /* AttributeInput.swift in Sources */, 9A2ACE2D21CD3C8700C09FF7 /* AutomaticDiscountApplication.swift in Sources */, - 9A0C805B1EAA51C50020F187 /* AvailableShippingRates.swift in Sources */, 4EB4DB3529DC5FEE00C9A6BD /* BaseCartLine.swift in Sources */, 4EB4DB0829DC5FEE00C9A6BD /* BaseCartLineConnection.swift in Sources */, 4EB4DB4A29DC5FEE00C9A6BD /* BaseCartLineEdge.swift in Sources */, @@ -3039,6 +3044,7 @@ 4E28FEFB270780B500F9EBED /* Cart.swift in Sources */, 4E28FED4270780B500F9EBED /* CartAttributesUpdatePayload.swift in Sources */, 4E28FEF5270780B500F9EBED /* CartAutomaticDiscountAllocation.swift in Sources */, + 4EC30DD12C407F5B00D9336D /* CartBillingAddressUpdatePayload.swift in Sources */, 4E28FF16270780B500F9EBED /* CartBuyerIdentity.swift in Sources */, 4E28FED7270780B500F9EBED /* CartBuyerIdentityInput.swift in Sources */, 4E28FEF8270780B500F9EBED /* CartBuyerIdentityUpdatePayload.swift in Sources */, @@ -3053,11 +3059,15 @@ 4E87F1DC286F3B1900BFF389 /* CartCost.swift in Sources */, 4E28FEE6270780B500F9EBED /* CartCreatePayload.swift in Sources */, 4E87F1F4286F3B1A00BFF389 /* CartCustomDiscountAllocation.swift in Sources */, + 4EC30DBF2C407F5B00D9336D /* CartDeliveryCoordinatesPreference.swift in Sources */, + 4EC30DD42C407F5B00D9336D /* CartDeliveryCoordinatesPreferenceInput.swift in Sources */, 4ECBE40C27FB45D200CB544E /* CartDeliveryGroup.swift in Sources */, 4ECBE42427FB45D200CB544E /* CartDeliveryGroupConnection.swift in Sources */, 4ECBE40927FB45D200CB544E /* CartDeliveryGroupEdge.swift in Sources */, 4E69B26A2BBB2C0B00913BAA /* CartDeliveryGroupType.swift in Sources */, 4ECBE40F27FB45D200CB544E /* CartDeliveryOption.swift in Sources */, + 4EC30DF82C407F5B00D9336D /* CartDeliveryPreference.swift in Sources */, + 4EC30DB92C407F5B00D9336D /* CartDeliveryPreferenceInput.swift in Sources */, 4EB4DB1A29DC5FEE00C9A6BD /* CartDirectPaymentMethodInput.swift in Sources */, 4E28FEE0270780B500F9EBED /* CartDiscountAllocation.swift in Sources */, 4E28FECE270780B500F9EBED /* CartDiscountCode.swift in Sources */, @@ -3065,6 +3075,7 @@ 4E28FED1270780B500F9EBED /* CartErrorCode.swift in Sources */, 4E28FEFE270780B500F9EBED /* CartEstimatedCost.swift in Sources */, 4EB4DAE729DC5FEE00C9A6BD /* CartFreePaymentMethodInput.swift in Sources */, + 4EC30DCE2C407F5B00D9336D /* CartGiftCardCodesUpdatePayload.swift in Sources */, 4E28FF01270780B500F9EBED /* CartInput.swift in Sources */, 4EB4DB2329DC5FEE00C9A6BD /* CartInputMetafieldInput.swift in Sources */, 4E28FEEF270780B500F9EBED /* CartLine.swift in Sources */, @@ -3082,42 +3093,14 @@ 4E28FF10270780B500F9EBED /* CartNoteUpdatePayload.swift in Sources */, 4EB4DAF029DC5FEE00C9A6BD /* CartPaymentInput.swift in Sources */, 4EB4DB3229DC5FEE00C9A6BD /* CartPaymentUpdatePayload.swift in Sources */, + 4EC30DA42C407F5A00D9336D /* CartPreferences.swift in Sources */, + 4EC30E0A2C407F5B00D9336D /* CartPreferencesInput.swift in Sources */, 4EF3D33828EB2182007215E6 /* CartSelectedDeliveryOptionInput.swift in Sources */, 4EF3D32F28EB2182007215E6 /* CartSelectedDeliveryOptionsUpdatePayload.swift in Sources */, 4EB4DB2029DC5FEE00C9A6BD /* CartSubmitForCompletionPayload.swift in Sources */, 4EB4DAD829DC5FEE00C9A6BD /* CartSubmitForCompletionResult.swift in Sources */, 4E28FEEC270780B500F9EBED /* CartUserError.swift in Sources */, 4EB4DAFF29DC5FEE00C9A6BD /* CartWalletPaymentMethodInput.swift in Sources */, - 9A0C805C1EAA51C50020F187 /* Checkout.swift in Sources */, - 9AD577682153E315006BD1C5 /* CheckoutAttributesUpdateV2Input.swift in Sources */, - 9AD577652153E315006BD1C5 /* CheckoutAttributesUpdateV2Payload.swift in Sources */, - 4EFBFAE12694B89D0054C426 /* CheckoutBuyerIdentity.swift in Sources */, - 4EFBFAF02694B89D0054C426 /* CheckoutBuyerIdentityInput.swift in Sources */, - 9A0C805F1EAA51C50020F187 /* CheckoutCompleteFreePayload.swift in Sources */, - 9A67113E2166678500A57A3F /* CheckoutCompleteWithCreditCardV2Payload.swift in Sources */, - 21751EF6243D136A005001D4 /* CheckoutCompleteWithTokenizedPaymentV3Payload.swift in Sources */, - 9A0C80621EAA51C50020F187 /* CheckoutCreateInput.swift in Sources */, - 9A0C80631EAA51C50020F187 /* CheckoutCreatePayload.swift in Sources */, - 9A47C049218087880043525D /* CheckoutCustomerAssociateV2Payload.swift in Sources */, - 9A47C04F218087880043525D /* CheckoutCustomerDisassociateV2Payload.swift in Sources */, - 9A656CC62183B04700D3A41C /* CheckoutDiscountCodeApplyV2Payload.swift in Sources */, - 9A43489B20C84A56005EAD56 /* CheckoutDiscountCodeRemovePayload.swift in Sources */, - 9A656CC02183B04700D3A41C /* CheckoutEmailUpdateV2Payload.swift in Sources */, - 9A67114221666A6700A57A3F /* CheckoutErrorCode.swift in Sources */, - 9A47C04C218087880043525D /* CheckoutGiftCardRemoveV2Payload.swift in Sources */, - 9ABEB3C12122FFE900A373F2 /* CheckoutGiftCardsAppendPayload.swift in Sources */, - 9A0C80691EAA51C50020F187 /* CheckoutLineItem.swift in Sources */, - 9A0C806A1EAA51C50020F187 /* CheckoutLineItemConnection.swift in Sources */, - 9A0C806B1EAA51C50020F187 /* CheckoutLineItemEdge.swift in Sources */, - 9A0C806C1EAA51C50020F187 /* CheckoutLineItemInput.swift in Sources */, - 9A0C806D1EAA51C50020F187 /* CheckoutLineItemsAddPayload.swift in Sources */, - 9A0C806E1EAA51C50020F187 /* CheckoutLineItemsRemovePayload.swift in Sources */, - 9A2ACDDB21CABB7100C09FF7 /* CheckoutLineItemsReplacePayload.swift in Sources */, - 9A0C806F1EAA51C50020F187 /* CheckoutLineItemsUpdatePayload.swift in Sources */, - 9A0C80701EAA51C50020F187 /* CheckoutLineItemUpdateInput.swift in Sources */, - 9A656CC32183B04700D3A41C /* CheckoutShippingAddressUpdateV2Payload.swift in Sources */, - 9A0C80721EAA51C50020F187 /* CheckoutShippingLineUpdatePayload.swift in Sources */, - 9A67114621666A7700A57A3F /* CheckoutUserError.swift in Sources */, 9A0C80731EAA51C50020F187 /* Collection.swift in Sources */, 9A0C80741EAA51C50020F187 /* CollectionConnection.swift in Sources */, 9A0C80751EAA51C50020F187 /* CollectionEdge.swift in Sources */, @@ -3135,8 +3118,6 @@ 4EC215C02A55CB8800BD6148 /* ComponentizableCartLine.swift in Sources */, 4EFBFB1D2694B89D0054C426 /* Country.swift in Sources */, 9AF1C1871F13B4530064AEA0 /* CountryCode.swift in Sources */, - 9A0C80771EAA51C50020F187 /* CreditCard.swift in Sources */, - 9A6711382166678500A57A3F /* CreditCardPaymentInputV2.swift in Sources */, 9A0C80791EAA51C50020F187 /* CropRegion.swift in Sources */, 4EFBFAE42694B89D0054C426 /* Currency.swift in Sources */, 9A0C807A1EAA51C50020F187 /* CurrencyCode.swift in Sources */, @@ -3279,12 +3260,11 @@ 9A2ACDD121CABAC200C09FF7 /* PageEdge.swift in Sources */, 9A0C80A11EAA51C50020F187 /* PageInfo.swift in Sources */, 9A2ACDD721CABAC200C09FF7 /* PageSortKeys.swift in Sources */, - 9A0C80A21EAA51C50020F187 /* Payment.swift in Sources */, 9AF1C1881F13B45C0064AEA0 /* PaymentSettings.swift in Sources */, - 21751EFC243D136A005001D4 /* PaymentTokenType.swift in Sources */, 4EC215BA2A55CB8800BD6148 /* PredictiveSearchLimitScope.swift in Sources */, 4EC215A22A55CB8800BD6148 /* PredictiveSearchResult.swift in Sources */, 4EC215B72A55CB8800BD6148 /* PredictiveSearchType.swift in Sources */, + 4EC30E0D2C407F5B00D9336D /* PreferenceDeliveryMethodType.swift in Sources */, 4EC8A6FE278792B400FC193B /* PriceRangeFilter.swift in Sources */, 9A67116A21666AB200A57A3F /* PricingPercentageValue.swift in Sources */, 9A67116D21666AB200A57A3F /* PricingValue.swift in Sources */, @@ -3296,10 +3276,15 @@ 9A52D3A21F3CA58E00C093C8 /* ProductImageSortKeys.swift in Sources */, 2121506325A8C6C600191C61 /* ProductMediaSortKeys.swift in Sources */, 9A0C80A61EAA51C50020F187 /* ProductOption.swift in Sources */, + 4EC30DE02C407F5B00D9336D /* ProductOptionValue.swift in Sources */, + 4EC30DDD2C407F5B00D9336D /* ProductOptionValueSwatch.swift in Sources */, 9A9EA44220AF0EBB002CB926 /* ProductPriceRange.swift in Sources */, 4EB4DB4129DC5FEE00C9A6BD /* ProductRecommendationIntent.swift in Sources */, 9A0C80A71EAA51C50020F187 /* ProductSortKeys.swift in Sources */, 9A0C80A81EAA51C50020F187 /* ProductVariant.swift in Sources */, + 4EC30DAD2C407F5A00D9336D /* ProductVariantComponent.swift in Sources */, + 4EC30DE32C407F5B00D9336D /* ProductVariantComponentConnection.swift in Sources */, + 4EC30E072C407F5B00D9336D /* ProductVariantComponentEdge.swift in Sources */, 9A0C80A91EAA51C50020F187 /* ProductVariantConnection.swift in Sources */, 9A0C80AA1EAA51C50020F187 /* ProductVariantEdge.swift in Sources */, 9AE1F8161F605F8F00147E77 /* ProductVariantSortKeys.swift in Sources */, @@ -3327,11 +3312,13 @@ 4EFBFB082694B89D0054C426 /* SellingPlanAllocationConnection.swift in Sources */, 4EFBFAED2694B89D0054C426 /* SellingPlanAllocationEdge.swift in Sources */, 4EFBFB322694B89D0054C426 /* SellingPlanAllocationPriceAdjustment.swift in Sources */, + 4EC30E102C407F5B00D9336D /* SellingPlanBillingPolicy.swift in Sources */, 4E87F1DF286F3B1900BFF389 /* SellingPlanCheckoutCharge.swift in Sources */, 4E87F1F7286F3B1A00BFF389 /* SellingPlanCheckoutChargePercentageValue.swift in Sources */, 4E87F1E8286F3B1A00BFF389 /* SellingPlanCheckoutChargeType.swift in Sources */, 4E87F1EE286F3B1A00BFF389 /* SellingPlanCheckoutChargeValue.swift in Sources */, 4EFBFAFF2694B89D0054C426 /* SellingPlanConnection.swift in Sources */, + 4EC30E132C407F5B00D9336D /* SellingPlanDeliveryPolicy.swift in Sources */, 4EFBFAF92694B89D0054C426 /* SellingPlanEdge.swift in Sources */, 4EFBFB202694B89D0054C426 /* SellingPlanFixedAmountPriceAdjustment.swift in Sources */, 4EFBFB1A2694B89D0054C426 /* SellingPlanFixedPriceAdjustment.swift in Sources */, @@ -3339,14 +3326,36 @@ 4EFBFB292694B89D0054C426 /* SellingPlanGroupConnection.swift in Sources */, 4EFBFB022694B89D0054C426 /* SellingPlanGroupEdge.swift in Sources */, 4EFBFB382694B89D0054C426 /* SellingPlanGroupOption.swift in Sources */, + 4EC30DA12C407F5A00D9336D /* SellingPlanInterval.swift in Sources */, 4EFBFB352694B89D0054C426 /* SellingPlanOption.swift in Sources */, 4EFBFAF62694B89D0054C426 /* SellingPlanPercentagePriceAdjustment.swift in Sources */, 4EFBFB232694B89D0054C426 /* SellingPlanPriceAdjustment.swift in Sources */, 4EFBFAEA2694B89D0054C426 /* SellingPlanPriceAdjustmentValue.swift in Sources */, + 4EC30DCB2C407F5B00D9336D /* SellingPlanRecurringBillingPolicy.swift in Sources */, + 4EC30E162C407F5B00D9336D /* SellingPlanRecurringDeliveryPolicy.swift in Sources */, B3B5A030223FF6C3008ECA02 /* SEO.swift in Sources */, 9A371464251A2AEC00FE742B /* SHA256.swift in Sources */, - 9A0C80AD1EAA51C50020F187 /* ShippingRate.swift in Sources */, 9A0C80AE1EAA51C50020F187 /* Shop.swift in Sources */, + 4EC30D9E2C407F5A00D9336D /* ShopPayPaymentRequest.swift in Sources */, + 4EC30DBC2C407F5B00D9336D /* ShopPayPaymentRequestContactField.swift in Sources */, + 4EC30DD72C407F5B00D9336D /* ShopPayPaymentRequestDeliveryMethod.swift in Sources */, + 4EC30DAA2C407F5A00D9336D /* ShopPayPaymentRequestDeliveryMethodInput.swift in Sources */, + 4EC30DE92C407F5B00D9336D /* ShopPayPaymentRequestDeliveryMethodType.swift in Sources */, + 4EC30E042C407F5B00D9336D /* ShopPayPaymentRequestDiscount.swift in Sources */, + 4EC30DA72C407F5A00D9336D /* ShopPayPaymentRequestDiscountInput.swift in Sources */, + 4EC30DDA2C407F5B00D9336D /* ShopPayPaymentRequestImage.swift in Sources */, + 4EC30DFB2C407F5B00D9336D /* ShopPayPaymentRequestImageInput.swift in Sources */, + 4EC30DC82C407F5B00D9336D /* ShopPayPaymentRequestInput.swift in Sources */, + 4EC30DF22C407F5B00D9336D /* ShopPayPaymentRequestLineItem.swift in Sources */, + 4EC30DEF2C407F5B00D9336D /* ShopPayPaymentRequestLineItemInput.swift in Sources */, + 4EC30DFE2C407F5B00D9336D /* ShopPayPaymentRequestReceipt.swift in Sources */, + 4EC30DB62C407F5B00D9336D /* ShopPayPaymentRequestSession.swift in Sources */, + 4EC30DE62C407F5B00D9336D /* ShopPayPaymentRequestSessionCreatePayload.swift in Sources */, + 4EC30DB02C407F5A00D9336D /* ShopPayPaymentRequestSessionSubmitPayload.swift in Sources */, + 4EC30DC52C407F5B00D9336D /* ShopPayPaymentRequestShippingLine.swift in Sources */, + 4EC30E012C407F5B00D9336D /* ShopPayPaymentRequestShippingLineInput.swift in Sources */, + 4EC30DC22C407F5B00D9336D /* ShopPayPaymentRequestTotalShippingPrice.swift in Sources */, + 4EC30DB32C407F5B00D9336D /* ShopPayPaymentRequestTotalShippingPriceInput.swift in Sources */, 4EB4DAF629DC5FEE00C9A6BD /* ShopPayWalletContentInput.swift in Sources */, 9A0C80AF1EAA51C50020F187 /* ShopPolicy.swift in Sources */, 4EC8A6FB278792B400FC193B /* ShopPolicyWithDefault.swift in Sources */, @@ -3364,11 +3373,7 @@ 4EB4DAD229DC5FEE00C9A6BD /* SubmitSuccess.swift in Sources */, 4EB4DAD529DC5FEE00C9A6BD /* SubmitThrottled.swift in Sources */, 4E69B2462BBB2C0B00913BAA /* Swatch.swift in Sources */, - 21751EFF243D136A005001D4 /* TokenizedPaymentInputV3.swift in Sources */, 4EC215B42A55CB8800BD6148 /* Trackable.swift in Sources */, - 9A0C80B11EAA51C50020F187 /* Transaction.swift in Sources */, - 9A0C80B21EAA51C50020F187 /* TransactionKind.swift in Sources */, - 9A0C80B31EAA51C50020F187 /* TransactionStatus.swift in Sources */, 8128551423C4AC7E00ADA66E /* UnitPriceMeasurement.swift in Sources */, 8128552023C4AC7E00ADA66E /* UnitPriceMeasurementMeasuredType.swift in Sources */, 8128551723C4AC7E00ADA66E /* UnitPriceMeasurementMeasuredUnit.swift in Sources */, @@ -3377,6 +3382,8 @@ 4E87F1EB286F3B1A00BFF389 /* UrlRedirectConnection.swift in Sources */, 4E87F1E5286F3B1900BFF389 /* UrlRedirectEdge.swift in Sources */, 9A0C80B41EAA51C50020F187 /* UserError.swift in Sources */, + 4EC30DF52C407F5B00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrors.swift in Sources */, + 4EC30DEC2C407F5B00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift in Sources */, 4EC8A6FC278792B400FC193B /* VariantOptionFilter.swift in Sources */, 8128551623C4AC7E00ADA66E /* Video.swift in Sources */, 8128551523C4AC7E00ADA66E /* VideoSource.swift in Sources */, @@ -3400,7 +3407,6 @@ 9AF255B31F6FEE50005BB0C9 /* Attribute.swift in Sources */, 9AF256131F6FEE50005BB0C9 /* AttributeInput.swift in Sources */, 9A2ACE2F21CD3C8700C09FF7 /* AutomaticDiscountApplication.swift in Sources */, - 9AF255BD1F6FEE50005BB0C9 /* AvailableShippingRates.swift in Sources */, 4EB4DB3629DC5FEE00C9A6BD /* BaseCartLine.swift in Sources */, 4EB4DB0929DC5FEE00C9A6BD /* BaseCartLineConnection.swift in Sources */, 4EB4DB4B29DC5FEE00C9A6BD /* BaseCartLineEdge.swift in Sources */, @@ -3419,6 +3425,7 @@ 4E28FEFC270780B500F9EBED /* Cart.swift in Sources */, 4E28FED5270780B500F9EBED /* CartAttributesUpdatePayload.swift in Sources */, 4E28FEF6270780B500F9EBED /* CartAutomaticDiscountAllocation.swift in Sources */, + 4EC30DD22C407F5B00D9336D /* CartBillingAddressUpdatePayload.swift in Sources */, 4E28FF17270780B500F9EBED /* CartBuyerIdentity.swift in Sources */, 4E28FED8270780B500F9EBED /* CartBuyerIdentityInput.swift in Sources */, 4E28FEF9270780B500F9EBED /* CartBuyerIdentityUpdatePayload.swift in Sources */, @@ -3433,11 +3440,15 @@ 4E87F1DD286F3B1900BFF389 /* CartCost.swift in Sources */, 4E28FEE7270780B500F9EBED /* CartCreatePayload.swift in Sources */, 4E87F1F5286F3B1A00BFF389 /* CartCustomDiscountAllocation.swift in Sources */, + 4EC30DC02C407F5B00D9336D /* CartDeliveryCoordinatesPreference.swift in Sources */, + 4EC30DD52C407F5B00D9336D /* CartDeliveryCoordinatesPreferenceInput.swift in Sources */, 4ECBE40D27FB45D200CB544E /* CartDeliveryGroup.swift in Sources */, 4ECBE42527FB45D200CB544E /* CartDeliveryGroupConnection.swift in Sources */, 4ECBE40A27FB45D200CB544E /* CartDeliveryGroupEdge.swift in Sources */, 4E69B26B2BBB2C0B00913BAA /* CartDeliveryGroupType.swift in Sources */, 4ECBE41027FB45D200CB544E /* CartDeliveryOption.swift in Sources */, + 4EC30DF92C407F5B00D9336D /* CartDeliveryPreference.swift in Sources */, + 4EC30DBA2C407F5B00D9336D /* CartDeliveryPreferenceInput.swift in Sources */, 4EB4DB1B29DC5FEE00C9A6BD /* CartDirectPaymentMethodInput.swift in Sources */, 4E28FEE1270780B500F9EBED /* CartDiscountAllocation.swift in Sources */, 4E28FECF270780B500F9EBED /* CartDiscountCode.swift in Sources */, @@ -3445,6 +3456,7 @@ 4E28FED2270780B500F9EBED /* CartErrorCode.swift in Sources */, 4E28FEFF270780B500F9EBED /* CartEstimatedCost.swift in Sources */, 4EB4DAE829DC5FEE00C9A6BD /* CartFreePaymentMethodInput.swift in Sources */, + 4EC30DCF2C407F5B00D9336D /* CartGiftCardCodesUpdatePayload.swift in Sources */, 4E28FF02270780B500F9EBED /* CartInput.swift in Sources */, 4EB4DB2429DC5FEE00C9A6BD /* CartInputMetafieldInput.swift in Sources */, 4E28FEF0270780B500F9EBED /* CartLine.swift in Sources */, @@ -3462,42 +3474,14 @@ 4E28FF11270780B500F9EBED /* CartNoteUpdatePayload.swift in Sources */, 4EB4DAF129DC5FEE00C9A6BD /* CartPaymentInput.swift in Sources */, 4EB4DB3329DC5FEE00C9A6BD /* CartPaymentUpdatePayload.swift in Sources */, + 4EC30DA52C407F5A00D9336D /* CartPreferences.swift in Sources */, + 4EC30E0B2C407F5B00D9336D /* CartPreferencesInput.swift in Sources */, 4EF3D33928EB2182007215E6 /* CartSelectedDeliveryOptionInput.swift in Sources */, 4EF3D33028EB2182007215E6 /* CartSelectedDeliveryOptionsUpdatePayload.swift in Sources */, 4EB4DB2129DC5FEE00C9A6BD /* CartSubmitForCompletionPayload.swift in Sources */, 4EB4DAD929DC5FEE00C9A6BD /* CartSubmitForCompletionResult.swift in Sources */, 4E28FEED270780B500F9EBED /* CartUserError.swift in Sources */, 4EB4DB0029DC5FEE00C9A6BD /* CartWalletPaymentMethodInput.swift in Sources */, - 9AF256091F6FEE50005BB0C9 /* Checkout.swift in Sources */, - 9AD5776A2153E315006BD1C5 /* CheckoutAttributesUpdateV2Input.swift in Sources */, - 9AD577672153E315006BD1C5 /* CheckoutAttributesUpdateV2Payload.swift in Sources */, - 4EFBFAE32694B89D0054C426 /* CheckoutBuyerIdentity.swift in Sources */, - 4EFBFAF22694B89D0054C426 /* CheckoutBuyerIdentityInput.swift in Sources */, - 9AF255D01F6FEE50005BB0C9 /* CheckoutCompleteFreePayload.swift in Sources */, - 9A6711402166678500A57A3F /* CheckoutCompleteWithCreditCardV2Payload.swift in Sources */, - 21751EF8243D136A005001D4 /* CheckoutCompleteWithTokenizedPaymentV3Payload.swift in Sources */, - 9AF2562A1F6FEE50005BB0C9 /* CheckoutCreateInput.swift in Sources */, - 9AF255D81F6FEE50005BB0C9 /* CheckoutCreatePayload.swift in Sources */, - 9A47C04B218087880043525D /* CheckoutCustomerAssociateV2Payload.swift in Sources */, - 9A47C051218087880043525D /* CheckoutCustomerDisassociateV2Payload.swift in Sources */, - 9A656CC82183B04700D3A41C /* CheckoutDiscountCodeApplyV2Payload.swift in Sources */, - 9A43489D20C84A56005EAD56 /* CheckoutDiscountCodeRemovePayload.swift in Sources */, - 9A656CC22183B04700D3A41C /* CheckoutEmailUpdateV2Payload.swift in Sources */, - 9A67114421666A6700A57A3F /* CheckoutErrorCode.swift in Sources */, - 9A47C04E218087880043525D /* CheckoutGiftCardRemoveV2Payload.swift in Sources */, - 9ABEB3C32122FFE900A373F2 /* CheckoutGiftCardsAppendPayload.swift in Sources */, - 9AF256331F6FEE50005BB0C9 /* CheckoutLineItem.swift in Sources */, - 9AF2560A1F6FEE50005BB0C9 /* CheckoutLineItemConnection.swift in Sources */, - 9AF2562D1F6FEE50005BB0C9 /* CheckoutLineItemEdge.swift in Sources */, - 9AF256311F6FEE50005BB0C9 /* CheckoutLineItemInput.swift in Sources */, - 9AF2561C1F6FEE50005BB0C9 /* CheckoutLineItemsAddPayload.swift in Sources */, - 9AF256051F6FEE50005BB0C9 /* CheckoutLineItemsRemovePayload.swift in Sources */, - 9A2ACDDD21CABB7100C09FF7 /* CheckoutLineItemsReplacePayload.swift in Sources */, - 9AF255F91F6FEE50005BB0C9 /* CheckoutLineItemsUpdatePayload.swift in Sources */, - 9AF255DE1F6FEE50005BB0C9 /* CheckoutLineItemUpdateInput.swift in Sources */, - 9A656CC52183B04700D3A41C /* CheckoutShippingAddressUpdateV2Payload.swift in Sources */, - 9AF255CE1F6FEE50005BB0C9 /* CheckoutShippingLineUpdatePayload.swift in Sources */, - 9A67114821666A7700A57A3F /* CheckoutUserError.swift in Sources */, 9AF256261F6FEE50005BB0C9 /* Collection.swift in Sources */, 9AF255BE1F6FEE50005BB0C9 /* CollectionConnection.swift in Sources */, 9AF255E31F6FEE50005BB0C9 /* CollectionEdge.swift in Sources */, @@ -3515,8 +3499,6 @@ 4EC215C12A55CB8800BD6148 /* ComponentizableCartLine.swift in Sources */, 4EFBFB1F2694B89D0054C426 /* Country.swift in Sources */, 9AF256151F6FEE50005BB0C9 /* CountryCode.swift in Sources */, - 9AF255EE1F6FEE50005BB0C9 /* CreditCard.swift in Sources */, - 9A67113A2166678500A57A3F /* CreditCardPaymentInputV2.swift in Sources */, 9AF256041F6FEE50005BB0C9 /* CropRegion.swift in Sources */, 4EFBFAE62694B89D0054C426 /* Currency.swift in Sources */, 9AF255CC1F6FEE50005BB0C9 /* CurrencyCode.swift in Sources */, @@ -3659,12 +3641,11 @@ 9A2ACDD321CABAC200C09FF7 /* PageEdge.swift in Sources */, 9AF255F21F6FEE50005BB0C9 /* PageInfo.swift in Sources */, 9A2ACDD921CABAC200C09FF7 /* PageSortKeys.swift in Sources */, - 9AF255F71F6FEE50005BB0C9 /* Payment.swift in Sources */, 9AF255D41F6FEE50005BB0C9 /* PaymentSettings.swift in Sources */, - 21751EFE243D136A005001D4 /* PaymentTokenType.swift in Sources */, 4EC215BB2A55CB8800BD6148 /* PredictiveSearchLimitScope.swift in Sources */, 4EC215A32A55CB8800BD6148 /* PredictiveSearchResult.swift in Sources */, 4EC215B82A55CB8800BD6148 /* PredictiveSearchType.swift in Sources */, + 4EC30E0E2C407F5B00D9336D /* PreferenceDeliveryMethodType.swift in Sources */, 4EC8A7092787946300FC193B /* PriceRangeFilter.swift in Sources */, 9A67116C21666AB200A57A3F /* PricingPercentageValue.swift in Sources */, 9A67116F21666AB200A57A3F /* PricingValue.swift in Sources */, @@ -3676,10 +3657,15 @@ 9AF255E21F6FEE50005BB0C9 /* ProductImageSortKeys.swift in Sources */, 2121506525A8C6C600191C61 /* ProductMediaSortKeys.swift in Sources */, 9AF255B81F6FEE50005BB0C9 /* ProductOption.swift in Sources */, + 4EC30DE12C407F5B00D9336D /* ProductOptionValue.swift in Sources */, + 4EC30DDE2C407F5B00D9336D /* ProductOptionValueSwatch.swift in Sources */, 9A9EA44420AF0EBB002CB926 /* ProductPriceRange.swift in Sources */, 4EB4DB4229DC5FEE00C9A6BD /* ProductRecommendationIntent.swift in Sources */, 9AF256211F6FEE50005BB0C9 /* ProductSortKeys.swift in Sources */, 9AF255FD1F6FEE50005BB0C9 /* ProductVariant.swift in Sources */, + 4EC30DAE2C407F5A00D9336D /* ProductVariantComponent.swift in Sources */, + 4EC30DE42C407F5B00D9336D /* ProductVariantComponentConnection.swift in Sources */, + 4EC30E082C407F5B00D9336D /* ProductVariantComponentEdge.swift in Sources */, 9AF255E81F6FEE50005BB0C9 /* ProductVariantConnection.swift in Sources */, 9AF256351F6FEE50005BB0C9 /* ProductVariantEdge.swift in Sources */, 9AF255B71F6FEE50005BB0C9 /* ProductVariantSortKeys.swift in Sources */, @@ -3707,11 +3693,13 @@ 4EFBFB0A2694B89D0054C426 /* SellingPlanAllocationConnection.swift in Sources */, 4EFBFAEF2694B89D0054C426 /* SellingPlanAllocationEdge.swift in Sources */, 4EFBFB342694B89D0054C426 /* SellingPlanAllocationPriceAdjustment.swift in Sources */, + 4EC30E112C407F5B00D9336D /* SellingPlanBillingPolicy.swift in Sources */, 4E87F1E0286F3B1900BFF389 /* SellingPlanCheckoutCharge.swift in Sources */, 4E87F1F8286F3B1A00BFF389 /* SellingPlanCheckoutChargePercentageValue.swift in Sources */, 4E87F1E9286F3B1A00BFF389 /* SellingPlanCheckoutChargeType.swift in Sources */, 4E87F1EF286F3B1A00BFF389 /* SellingPlanCheckoutChargeValue.swift in Sources */, 4EFBFB012694B89D0054C426 /* SellingPlanConnection.swift in Sources */, + 4EC30E142C407F5B00D9336D /* SellingPlanDeliveryPolicy.swift in Sources */, 4EFBFAFB2694B89D0054C426 /* SellingPlanEdge.swift in Sources */, 4EFBFB222694B89D0054C426 /* SellingPlanFixedAmountPriceAdjustment.swift in Sources */, 4EFBFB1C2694B89D0054C426 /* SellingPlanFixedPriceAdjustment.swift in Sources */, @@ -3719,14 +3707,36 @@ 4EFBFB2B2694B89D0054C426 /* SellingPlanGroupConnection.swift in Sources */, 4EFBFB042694B89D0054C426 /* SellingPlanGroupEdge.swift in Sources */, 4EFBFB3A2694B89D0054C426 /* SellingPlanGroupOption.swift in Sources */, + 4EC30DA22C407F5A00D9336D /* SellingPlanInterval.swift in Sources */, 4EFBFB372694B89D0054C426 /* SellingPlanOption.swift in Sources */, 4EFBFAF82694B89D0054C426 /* SellingPlanPercentagePriceAdjustment.swift in Sources */, 4EFBFB252694B89D0054C426 /* SellingPlanPriceAdjustment.swift in Sources */, 4EFBFAEC2694B89D0054C426 /* SellingPlanPriceAdjustmentValue.swift in Sources */, + 4EC30DCC2C407F5B00D9336D /* SellingPlanRecurringBillingPolicy.swift in Sources */, + 4EC30E172C407F5B00D9336D /* SellingPlanRecurringDeliveryPolicy.swift in Sources */, B3B5A032223FF6C3008ECA02 /* SEO.swift in Sources */, 9A371466251A2AEC00FE742B /* SHA256.swift in Sources */, - 9AF255BA1F6FEE50005BB0C9 /* ShippingRate.swift in Sources */, 9AF255E11F6FEE50005BB0C9 /* Shop.swift in Sources */, + 4EC30D9F2C407F5A00D9336D /* ShopPayPaymentRequest.swift in Sources */, + 4EC30DBD2C407F5B00D9336D /* ShopPayPaymentRequestContactField.swift in Sources */, + 4EC30DD82C407F5B00D9336D /* ShopPayPaymentRequestDeliveryMethod.swift in Sources */, + 4EC30DAB2C407F5A00D9336D /* ShopPayPaymentRequestDeliveryMethodInput.swift in Sources */, + 4EC30DEA2C407F5B00D9336D /* ShopPayPaymentRequestDeliveryMethodType.swift in Sources */, + 4EC30E052C407F5B00D9336D /* ShopPayPaymentRequestDiscount.swift in Sources */, + 4EC30DA82C407F5A00D9336D /* ShopPayPaymentRequestDiscountInput.swift in Sources */, + 4EC30DDB2C407F5B00D9336D /* ShopPayPaymentRequestImage.swift in Sources */, + 4EC30DFC2C407F5B00D9336D /* ShopPayPaymentRequestImageInput.swift in Sources */, + 4EC30DC92C407F5B00D9336D /* ShopPayPaymentRequestInput.swift in Sources */, + 4EC30DF32C407F5B00D9336D /* ShopPayPaymentRequestLineItem.swift in Sources */, + 4EC30DF02C407F5B00D9336D /* ShopPayPaymentRequestLineItemInput.swift in Sources */, + 4EC30DFF2C407F5B00D9336D /* ShopPayPaymentRequestReceipt.swift in Sources */, + 4EC30DB72C407F5B00D9336D /* ShopPayPaymentRequestSession.swift in Sources */, + 4EC30DE72C407F5B00D9336D /* ShopPayPaymentRequestSessionCreatePayload.swift in Sources */, + 4EC30DB12C407F5B00D9336D /* ShopPayPaymentRequestSessionSubmitPayload.swift in Sources */, + 4EC30DC62C407F5B00D9336D /* ShopPayPaymentRequestShippingLine.swift in Sources */, + 4EC30E022C407F5B00D9336D /* ShopPayPaymentRequestShippingLineInput.swift in Sources */, + 4EC30DC32C407F5B00D9336D /* ShopPayPaymentRequestTotalShippingPrice.swift in Sources */, + 4EC30DB42C407F5B00D9336D /* ShopPayPaymentRequestTotalShippingPriceInput.swift in Sources */, 4EB4DAF729DC5FEE00C9A6BD /* ShopPayWalletContentInput.swift in Sources */, 9AF255CD1F6FEE50005BB0C9 /* ShopPolicy.swift in Sources */, 4EC8A7082787946300FC193B /* ShopPolicyWithDefault.swift in Sources */, @@ -3744,11 +3754,7 @@ 4EB4DAD329DC5FEE00C9A6BD /* SubmitSuccess.swift in Sources */, 4EB4DAD629DC5FEE00C9A6BD /* SubmitThrottled.swift in Sources */, 4E69B2472BBB2C0B00913BAA /* Swatch.swift in Sources */, - 21751F01243D136A005001D4 /* TokenizedPaymentInputV3.swift in Sources */, 4EC215B52A55CB8800BD6148 /* Trackable.swift in Sources */, - 9AF255D71F6FEE50005BB0C9 /* Transaction.swift in Sources */, - 9AF2560D1F6FEE50005BB0C9 /* TransactionKind.swift in Sources */, - 9AF255FE1F6FEE50005BB0C9 /* TransactionStatus.swift in Sources */, 815FAB4423C4B81500F98749 /* UnitPriceMeasurement.swift in Sources */, 815FAB4523C4B81500F98749 /* UnitPriceMeasurementMeasuredType.swift in Sources */, 815FAB4623C4B81500F98749 /* UnitPriceMeasurementMeasuredUnit.swift in Sources */, @@ -3757,6 +3763,8 @@ 4E87F1EC286F3B1A00BFF389 /* UrlRedirectConnection.swift in Sources */, 4E87F1E6286F3B1900BFF389 /* UrlRedirectEdge.swift in Sources */, 9AF256101F6FEE50005BB0C9 /* UserError.swift in Sources */, + 4EC30DF62C407F5B00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrors.swift in Sources */, + 4EC30DED2C407F5B00D9336D /* UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift in Sources */, 4EC8A7012787946300FC193B /* VariantOptionFilter.swift in Sources */, 815FAB4723C4B81500F98749 /* Video.swift in Sources */, 815FAB4823C4B81500F98749 /* VideoSource.swift in Sources */, diff --git a/Buy/Generated/Storefront.Schema.swift b/Buy/Generated/Storefront.Schema.swift index ec211c6c..fa6a1692 100644 --- a/Buy/Generated/Storefront.Schema.swift +++ b/Buy/Generated/Storefront.Schema.swift @@ -26,6 +26,6 @@ extension Storefront { enum Schema { - static let version = "2024-04" + static let version = "2024-07" } } diff --git a/Buy/Generated/Storefront/AvailableShippingRates.swift b/Buy/Generated/Storefront/AvailableShippingRates.swift deleted file mode 100644 index 086c5a5b..00000000 --- a/Buy/Generated/Storefront/AvailableShippingRates.swift +++ /dev/null @@ -1,103 +0,0 @@ -// -// AvailableShippingRates.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// A collection of available shipping rates for a checkout. - open class AvailableShippingRatesQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = AvailableShippingRates - - /// Whether or not the shipping rates are ready. The `shippingRates` field is - /// `null` when this value is `false`. This field should be polled until its - /// value becomes `true`. - @discardableResult - open func ready(alias: String? = nil) -> AvailableShippingRatesQuery { - addField(field: "ready", aliasSuffix: alias) - return self - } - - /// The fetched shipping rates. `null` until the `ready` field is `true`. - @discardableResult - open func shippingRates(alias: String? = nil, _ subfields: (ShippingRateQuery) -> Void) -> AvailableShippingRatesQuery { - let subquery = ShippingRateQuery() - subfields(subquery) - - addField(field: "shippingRates", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// A collection of available shipping rates for a checkout. - open class AvailableShippingRates: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = AvailableShippingRatesQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "ready": - guard let value = value as? Bool else { - throw SchemaViolationError(type: AvailableShippingRates.self, field: fieldName, value: fieldValue) - } - return value - - case "shippingRates": - if value is NSNull { return nil } - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: AvailableShippingRates.self, field: fieldName, value: fieldValue) - } - return try value.map { return try ShippingRate(fields: $0) } - - default: - throw SchemaViolationError(type: AvailableShippingRates.self, field: fieldName, value: fieldValue) - } - } - - /// Whether or not the shipping rates are ready. The `shippingRates` field is - /// `null` when this value is `false`. This field should be polled until its - /// value becomes `true`. - open var ready: Bool { - return internalGetReady() - } - - func internalGetReady(alias: String? = nil) -> Bool { - return field(field: "ready", aliasSuffix: alias) as! Bool - } - - /// The fetched shipping rates. `null` until the `ready` field is `true`. - open var shippingRates: [Storefront.ShippingRate]? { - return internalGetShippingRates() - } - - func internalGetShippingRates(alias: String? = nil) -> [Storefront.ShippingRate]? { - return field(field: "shippingRates", aliasSuffix: alias) as! [Storefront.ShippingRate]? - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - return [] - } - } -} diff --git a/Buy/Generated/Storefront/Cart.swift b/Buy/Generated/Storefront/Cart.swift index 999d0422..57f932d6 100644 --- a/Buy/Generated/Storefront/Cart.swift +++ b/Buy/Generated/Storefront/Cart.swift @@ -34,6 +34,16 @@ extension Storefront { open class CartQuery: GraphQL.AbstractQuery, GraphQLQuery { public typealias Response = Cart + /// The gift cards that have been applied to the cart. + @discardableResult + open func appliedGiftCards(alias: String? = nil, _ subfields: (AppliedGiftCardQuery) -> Void) -> CartQuery { + let subquery = AppliedGiftCardQuery() + subfields(subquery) + + addField(field: "appliedGiftCards", aliasSuffix: alias, subfields: subquery) + return self + } + /// An attribute associated with the cart. /// /// - parameters: @@ -112,9 +122,14 @@ extension Storefront { /// - last: Returns up to the last `n` elements from the list. /// - before: Returns the elements that come before the specified cursor. /// - reverse: Reverse the order of the underlying list. + /// - withCarrierRates: Whether to include [carrier-calculated delivery rates](https://help.shopify.com/en/manual/shipping/setting-up-and-managing-your-shipping/enabling-shipping-carriers) in the response. + /// + /// By default, only static shipping rates are returned. This argument requires mandatory usage of the [`@defer` directive](https://shopify.dev/docs/api/storefront#directives). + /// + /// For more information, refer to [fetching carrier-calculated rates for the cart using `@defer`](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/defer#fetching-carrier-calculated-rates-for-the-cart-using-defer). /// @discardableResult - open func deliveryGroups(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, _ subfields: (CartDeliveryGroupConnectionQuery) -> Void) -> CartQuery { + open func deliveryGroups(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, withCarrierRates: Bool? = nil, _ subfields: (CartDeliveryGroupConnectionQuery) -> Void) -> CartQuery { var args: [String] = [] if let first = first { @@ -137,6 +152,10 @@ extension Storefront { args.append("reverse:\(reverse)") } + if let withCarrierRates = withCarrierRates { + args.append("withCarrierRates:\(withCarrierRates)") + } + let argsString: String? = args.isEmpty ? nil : "(\(args.joined(separator: ",")))" let subquery = CartDeliveryGroupConnectionQuery() @@ -312,6 +331,12 @@ extension Storefront { internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { let fieldValue = value switch fieldName { + case "appliedGiftCards": + guard let value = value as? [[String: Any]] else { + throw SchemaViolationError(type: Cart.self, field: fieldName, value: fieldValue) + } + return try value.map { return try AppliedGiftCard(fields: $0) } + case "attribute": if value is NSNull { return nil } guard let value = value as? [String: Any] else { @@ -426,6 +451,15 @@ extension Storefront { } } + /// The gift cards that have been applied to the cart. + open var appliedGiftCards: [Storefront.AppliedGiftCard] { + return internalGetAppliedGiftCards() + } + + func internalGetAppliedGiftCards(alias: String? = nil) -> [Storefront.AppliedGiftCard] { + return field(field: "appliedGiftCards", aliasSuffix: alias) as! [Storefront.AppliedGiftCard] + } + /// An attribute associated with the cart. open var attribute: Storefront.Attribute? { return internalGetAttribute() @@ -617,6 +651,12 @@ extension Storefront { var response: [GraphQL.AbstractResponse] = [] objectMap.keys.forEach { switch($0) { + case "appliedGiftCards": + internalGetAppliedGiftCards().forEach { + response.append($0) + response.append(contentsOf: $0.childResponseObjectMap()) + } + case "attribute": if let value = internalGetAttribute() { response.append(value) diff --git a/Buy/Generated/Storefront/CartAutomaticDiscountAllocation.swift b/Buy/Generated/Storefront/CartAutomaticDiscountAllocation.swift index 5e956429..66a4cd09 100644 --- a/Buy/Generated/Storefront/CartAutomaticDiscountAllocation.swift +++ b/Buy/Generated/Storefront/CartAutomaticDiscountAllocation.swift @@ -42,6 +42,13 @@ extension Storefront { return self } + /// The type of line that the discount is applicable towards. + @discardableResult + open func targetType(alias: String? = nil) -> CartAutomaticDiscountAllocationQuery { + addField(field: "targetType", aliasSuffix: alias) + return self + } + /// The title of the allocated discount. @discardableResult open func title(alias: String? = nil) -> CartAutomaticDiscountAllocationQuery { @@ -64,6 +71,12 @@ extension Storefront { } return try MoneyV2(fields: value) + case "targetType": + guard let value = value as? String else { + throw SchemaViolationError(type: CartAutomaticDiscountAllocation.self, field: fieldName, value: fieldValue) + } + return DiscountApplicationTargetType(rawValue: value) ?? .unknownValue + case "title": guard let value = value as? String else { throw SchemaViolationError(type: CartAutomaticDiscountAllocation.self, field: fieldName, value: fieldValue) @@ -84,6 +97,15 @@ extension Storefront { return field(field: "discountedAmount", aliasSuffix: alias) as! Storefront.MoneyV2 } + /// The type of line that the discount is applicable towards. + open var targetType: Storefront.DiscountApplicationTargetType { + return internalGetTargetType() + } + + func internalGetTargetType(alias: String? = nil) -> Storefront.DiscountApplicationTargetType { + return field(field: "targetType", aliasSuffix: alias) as! Storefront.DiscountApplicationTargetType + } + /// The title of the allocated discount. open var title: String { return internalGetTitle() diff --git a/Buy/Generated/Storefront/CheckoutLineItemsReplacePayload.swift b/Buy/Generated/Storefront/CartBillingAddressUpdatePayload.swift similarity index 63% rename from Buy/Generated/Storefront/CheckoutLineItemsReplacePayload.swift rename to Buy/Generated/Storefront/CartBillingAddressUpdatePayload.swift index 0419b686..f48f4328 100644 --- a/Buy/Generated/Storefront/CheckoutLineItemsReplacePayload.swift +++ b/Buy/Generated/Storefront/CartBillingAddressUpdatePayload.swift @@ -1,5 +1,5 @@ // -// CheckoutLineItemsReplacePayload.swift +// CartBillingAddressUpdatePayload.swift // Buy // // Created by Shopify. @@ -27,24 +27,24 @@ import Foundation extension Storefront { - /// Return type for `checkoutLineItemsReplace` mutation. - open class CheckoutLineItemsReplacePayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutLineItemsReplacePayload + /// Return type for `cartBillingAddressUpdate` mutation. + open class CartBillingAddressUpdatePayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = CartBillingAddressUpdatePayload - /// The updated checkout object. + /// The updated cart. @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutLineItemsReplacePayloadQuery { - let subquery = CheckoutQuery() + open func cart(alias: String? = nil, _ subfields: (CartQuery) -> Void) -> CartBillingAddressUpdatePayloadQuery { + let subquery = CartQuery() subfields(subquery) - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) + addField(field: "cart", aliasSuffix: alias, subfields: subquery) return self } /// The list of errors that occurred from executing the mutation. @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutLineItemsReplacePayloadQuery { - let subquery = CheckoutUserErrorQuery() + open func userErrors(alias: String? = nil, _ subfields: (CartUserErrorQuery) -> Void) -> CartBillingAddressUpdatePayloadQuery { + let subquery = CartUserErrorQuery() subfields(subquery) addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) @@ -52,55 +52,55 @@ extension Storefront { } } - /// Return type for `checkoutLineItemsReplace` mutation. - open class CheckoutLineItemsReplacePayload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutLineItemsReplacePayloadQuery + /// Return type for `cartBillingAddressUpdate` mutation. + open class CartBillingAddressUpdatePayload: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = CartBillingAddressUpdatePayloadQuery internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { let fieldValue = value switch fieldName { - case "checkout": + case "cart": if value is NSNull { return nil } guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutLineItemsReplacePayload.self, field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CartBillingAddressUpdatePayload.self, field: fieldName, value: fieldValue) } - return try Checkout(fields: value) + return try Cart(fields: value) case "userErrors": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutLineItemsReplacePayload.self, field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CartBillingAddressUpdatePayload.self, field: fieldName, value: fieldValue) } - return try value.map { return try CheckoutUserError(fields: $0) } + return try value.map { return try CartUserError(fields: $0) } default: - throw SchemaViolationError(type: CheckoutLineItemsReplacePayload.self, field: fieldName, value: fieldValue) + throw SchemaViolationError(type: CartBillingAddressUpdatePayload.self, field: fieldName, value: fieldValue) } } - /// The updated checkout object. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() + /// The updated cart. + open var cart: Storefront.Cart? { + return internalGetCart() } - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? + func internalGetCart(alias: String? = nil) -> Storefront.Cart? { + return field(field: "cart", aliasSuffix: alias) as! Storefront.Cart? } /// The list of errors that occurred from executing the mutation. - open var userErrors: [Storefront.CheckoutUserError] { + open var userErrors: [Storefront.CartUserError] { return internalGetUserErrors() } - func internalGetUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] + func internalGetUserErrors(alias: String? = nil) -> [Storefront.CartUserError] { + return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.CartUserError] } internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { var response: [GraphQL.AbstractResponse] = [] objectMap.keys.forEach { switch($0) { - case "checkout": - if let value = internalGetCheckout() { + case "cart": + if let value = internalGetCart() { response.append(value) response.append(contentsOf: value.childResponseObjectMap()) } diff --git a/Buy/Generated/Storefront/CartBuyerIdentity.swift b/Buy/Generated/Storefront/CartBuyerIdentity.swift index 111ca06c..f8b623f6 100644 --- a/Buy/Generated/Storefront/CartBuyerIdentity.swift +++ b/Buy/Generated/Storefront/CartBuyerIdentity.swift @@ -75,22 +75,26 @@ extension Storefront { return self } - /// The purchasing company associated with the cart. + /// A set of preferences tied to the buyer interacting with the cart. + /// Preferences are used to prefill fields in at checkout to streamline + /// information collection. Preferences are not synced back to the cart if they + /// are overwritten. @discardableResult - open func purchasingCompany(alias: String? = nil, _ subfields: (PurchasingCompanyQuery) -> Void) -> CartBuyerIdentityQuery { - let subquery = PurchasingCompanyQuery() + open func preferences(alias: String? = nil, _ subfields: (CartPreferencesQuery) -> Void) -> CartBuyerIdentityQuery { + let subquery = CartPreferencesQuery() subfields(subquery) - addField(field: "purchasingCompany", aliasSuffix: alias, subfields: subquery) + addField(field: "preferences", aliasSuffix: alias, subfields: subquery) return self } - /// A set of wallet preferences tied to the buyer that is interacting with the - /// cart. Preferences can be used to populate relevant payment fields in the - /// checkout flow. + /// The purchasing company associated with the cart. @discardableResult - open func walletPreferences(alias: String? = nil) -> CartBuyerIdentityQuery { - addField(field: "walletPreferences", aliasSuffix: alias) + open func purchasingCompany(alias: String? = nil, _ subfields: (PurchasingCompanyQuery) -> Void) -> CartBuyerIdentityQuery { + let subquery = PurchasingCompanyQuery() + subfields(subquery) + + addField(field: "purchasingCompany", aliasSuffix: alias, subfields: subquery) return self } } @@ -136,18 +140,19 @@ extension Storefront { } return value - case "purchasingCompany": + case "preferences": if value is NSNull { return nil } guard let value = value as? [String: Any] else { throw SchemaViolationError(type: CartBuyerIdentity.self, field: fieldName, value: fieldValue) } - return try PurchasingCompany(fields: value) + return try CartPreferences(fields: value) - case "walletPreferences": - guard let value = value as? [String] else { + case "purchasingCompany": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { throw SchemaViolationError(type: CartBuyerIdentity.self, field: fieldName, value: fieldValue) } - return value.map { return $0 } + return try PurchasingCompany(fields: value) default: throw SchemaViolationError(type: CartBuyerIdentity.self, field: fieldName, value: fieldValue) @@ -202,6 +207,18 @@ extension Storefront { return field(field: "phone", aliasSuffix: alias) as! String? } + /// A set of preferences tied to the buyer interacting with the cart. + /// Preferences are used to prefill fields in at checkout to streamline + /// information collection. Preferences are not synced back to the cart if they + /// are overwritten. + open var preferences: Storefront.CartPreferences? { + return internalGetPreferences() + } + + func internalGetPreferences(alias: String? = nil) -> Storefront.CartPreferences? { + return field(field: "preferences", aliasSuffix: alias) as! Storefront.CartPreferences? + } + /// The purchasing company associated with the cart. open var purchasingCompany: Storefront.PurchasingCompany? { return internalGetPurchasingCompany() @@ -211,17 +228,6 @@ extension Storefront { return field(field: "purchasingCompany", aliasSuffix: alias) as! Storefront.PurchasingCompany? } - /// A set of wallet preferences tied to the buyer that is interacting with the - /// cart. Preferences can be used to populate relevant payment fields in the - /// checkout flow. - open var walletPreferences: [String] { - return internalGetWalletPreferences() - } - - func internalGetWalletPreferences(alias: String? = nil) -> [String] { - return field(field: "walletPreferences", aliasSuffix: alias) as! [String] - } - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { var response: [GraphQL.AbstractResponse] = [] objectMap.keys.forEach { @@ -238,6 +244,12 @@ extension Storefront { response.append(contentsOf: ($0 as! GraphQL.AbstractResponse).childResponseObjectMap()) } + case "preferences": + if let value = internalGetPreferences() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + case "purchasingCompany": if let value = internalGetPurchasingCompany() { response.append(value) diff --git a/Buy/Generated/Storefront/CartBuyerIdentityInput.swift b/Buy/Generated/Storefront/CartBuyerIdentityInput.swift index 357c9f05..ba343b1d 100644 --- a/Buy/Generated/Storefront/CartBuyerIdentityInput.swift +++ b/Buy/Generated/Storefront/CartBuyerIdentityInput.swift @@ -54,11 +54,11 @@ extension Storefront { /// values. open var deliveryAddressPreferences: Input<[DeliveryAddressInput]> - /// A set of wallet preferences tied to the buyer that is interacting with the - /// cart. Preferences can be used to populate relevant payment fields in the - /// checkout flow. Accepted value: `["shop_pay"]`. The input must not contain - /// more than `250` values. - open var walletPreferences: Input<[String]> + /// A set of preferences tied to the buyer interacting with the cart. + /// Preferences are used to prefill fields in at checkout to streamline + /// information collection. Preferences are not synced back to the cart if they + /// are overwritten. + open var preferences: Input /// Creates the input object. /// @@ -69,20 +69,20 @@ extension Storefront { /// - countryCode: The country where the buyer is located. /// - customerAccessToken: The access token used to identify the customer associated with the cart. /// - deliveryAddressPreferences: An ordered set of delivery addresses tied to the buyer that is interacting with the cart. The rank of the preferences is determined by the order of the addresses in the array. Preferences can be used to populate relevant fields in the checkout flow. The input must not contain more than `250` values. - /// - walletPreferences: A set of wallet preferences tied to the buyer that is interacting with the cart. Preferences can be used to populate relevant payment fields in the checkout flow. Accepted value: `["shop_pay"]`. The input must not contain more than `250` values. + /// - preferences: A set of preferences tied to the buyer interacting with the cart. Preferences are used to prefill fields in at checkout to streamline information collection. Preferences are not synced back to the cart if they are overwritten. /// - public static func create(email: Input = .undefined, phone: Input = .undefined, companyLocationId: Input = .undefined, countryCode: Input = .undefined, customerAccessToken: Input = .undefined, deliveryAddressPreferences: Input<[DeliveryAddressInput]> = .undefined, walletPreferences: Input<[String]> = .undefined) -> CartBuyerIdentityInput { - return CartBuyerIdentityInput(email: email, phone: phone, companyLocationId: companyLocationId, countryCode: countryCode, customerAccessToken: customerAccessToken, deliveryAddressPreferences: deliveryAddressPreferences, walletPreferences: walletPreferences) + public static func create(email: Input = .undefined, phone: Input = .undefined, companyLocationId: Input = .undefined, countryCode: Input = .undefined, customerAccessToken: Input = .undefined, deliveryAddressPreferences: Input<[DeliveryAddressInput]> = .undefined, preferences: Input = .undefined) -> CartBuyerIdentityInput { + return CartBuyerIdentityInput(email: email, phone: phone, companyLocationId: companyLocationId, countryCode: countryCode, customerAccessToken: customerAccessToken, deliveryAddressPreferences: deliveryAddressPreferences, preferences: preferences) } - private init(email: Input = .undefined, phone: Input = .undefined, companyLocationId: Input = .undefined, countryCode: Input = .undefined, customerAccessToken: Input = .undefined, deliveryAddressPreferences: Input<[DeliveryAddressInput]> = .undefined, walletPreferences: Input<[String]> = .undefined) { + private init(email: Input = .undefined, phone: Input = .undefined, companyLocationId: Input = .undefined, countryCode: Input = .undefined, customerAccessToken: Input = .undefined, deliveryAddressPreferences: Input<[DeliveryAddressInput]> = .undefined, preferences: Input = .undefined) { self.email = email self.phone = phone self.companyLocationId = companyLocationId self.countryCode = countryCode self.customerAccessToken = customerAccessToken self.deliveryAddressPreferences = deliveryAddressPreferences - self.walletPreferences = walletPreferences + self.preferences = preferences } /// Creates the input object. @@ -94,11 +94,11 @@ extension Storefront { /// - countryCode: The country where the buyer is located. /// - customerAccessToken: The access token used to identify the customer associated with the cart. /// - deliveryAddressPreferences: An ordered set of delivery addresses tied to the buyer that is interacting with the cart. The rank of the preferences is determined by the order of the addresses in the array. Preferences can be used to populate relevant fields in the checkout flow. The input must not contain more than `250` values. - /// - walletPreferences: A set of wallet preferences tied to the buyer that is interacting with the cart. Preferences can be used to populate relevant payment fields in the checkout flow. Accepted value: `["shop_pay"]`. The input must not contain more than `250` values. + /// - preferences: A set of preferences tied to the buyer interacting with the cart. Preferences are used to prefill fields in at checkout to streamline information collection. Preferences are not synced back to the cart if they are overwritten. /// @available(*, deprecated, message: "Use the static create() method instead.") - public convenience init(email: String? = nil, phone: String? = nil, companyLocationId: GraphQL.ID? = nil, countryCode: CountryCode? = nil, customerAccessToken: String? = nil, deliveryAddressPreferences: [DeliveryAddressInput]? = nil, walletPreferences: [String]? = nil) { - self.init(email: email.orUndefined, phone: phone.orUndefined, companyLocationId: companyLocationId.orUndefined, countryCode: countryCode.orUndefined, customerAccessToken: customerAccessToken.orUndefined, deliveryAddressPreferences: deliveryAddressPreferences.orUndefined, walletPreferences: walletPreferences.orUndefined) + public convenience init(email: String? = nil, phone: String? = nil, companyLocationId: GraphQL.ID? = nil, countryCode: CountryCode? = nil, customerAccessToken: String? = nil, deliveryAddressPreferences: [DeliveryAddressInput]? = nil, preferences: CartPreferencesInput? = nil) { + self.init(email: email.orUndefined, phone: phone.orUndefined, companyLocationId: companyLocationId.orUndefined, countryCode: countryCode.orUndefined, customerAccessToken: customerAccessToken.orUndefined, deliveryAddressPreferences: deliveryAddressPreferences.orUndefined, preferences: preferences.orUndefined) } internal func serialize() -> String { @@ -164,13 +164,13 @@ extension Storefront { case .undefined: break } - switch walletPreferences { - case .value(let walletPreferences): - guard let walletPreferences = walletPreferences else { - fields.append("walletPreferences:null") + switch preferences { + case .value(let preferences): + guard let preferences = preferences else { + fields.append("preferences:null") break } - fields.append("walletPreferences:[\(walletPreferences.map{ "\(GraphQL.quoteString(input: $0))" }.joined(separator: ","))]") + fields.append("preferences:\(preferences.serialize())") case .undefined: break } diff --git a/Buy/Generated/Storefront/CartCodeDiscountAllocation.swift b/Buy/Generated/Storefront/CartCodeDiscountAllocation.swift index cb66b6e0..cb85c933 100644 --- a/Buy/Generated/Storefront/CartCodeDiscountAllocation.swift +++ b/Buy/Generated/Storefront/CartCodeDiscountAllocation.swift @@ -47,6 +47,13 @@ extension Storefront { addField(field: "discountedAmount", aliasSuffix: alias, subfields: subquery) return self } + + /// The type of line that the discount is applicable towards. + @discardableResult + open func targetType(alias: String? = nil) -> CartCodeDiscountAllocationQuery { + addField(field: "targetType", aliasSuffix: alias) + return self + } } /// The discount that has been applied to the cart line using a discount code. @@ -68,6 +75,12 @@ extension Storefront { } return try MoneyV2(fields: value) + case "targetType": + guard let value = value as? String else { + throw SchemaViolationError(type: CartCodeDiscountAllocation.self, field: fieldName, value: fieldValue) + } + return DiscountApplicationTargetType(rawValue: value) ?? .unknownValue + default: throw SchemaViolationError(type: CartCodeDiscountAllocation.self, field: fieldName, value: fieldValue) } @@ -91,6 +104,15 @@ extension Storefront { return field(field: "discountedAmount", aliasSuffix: alias) as! Storefront.MoneyV2 } + /// The type of line that the discount is applicable towards. + open var targetType: Storefront.DiscountApplicationTargetType { + return internalGetTargetType() + } + + func internalGetTargetType(alias: String? = nil) -> Storefront.DiscountApplicationTargetType { + return field(field: "targetType", aliasSuffix: alias) as! Storefront.DiscountApplicationTargetType + } + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { var response: [GraphQL.AbstractResponse] = [] objectMap.keys.forEach { diff --git a/Buy/Generated/Storefront/CartCustomDiscountAllocation.swift b/Buy/Generated/Storefront/CartCustomDiscountAllocation.swift index d3ca0aee..8afe64a4 100644 --- a/Buy/Generated/Storefront/CartCustomDiscountAllocation.swift +++ b/Buy/Generated/Storefront/CartCustomDiscountAllocation.swift @@ -42,6 +42,13 @@ extension Storefront { return self } + /// The type of line that the discount is applicable towards. + @discardableResult + open func targetType(alias: String? = nil) -> CartCustomDiscountAllocationQuery { + addField(field: "targetType", aliasSuffix: alias) + return self + } + /// The title of the allocated discount. @discardableResult open func title(alias: String? = nil) -> CartCustomDiscountAllocationQuery { @@ -64,6 +71,12 @@ extension Storefront { } return try MoneyV2(fields: value) + case "targetType": + guard let value = value as? String else { + throw SchemaViolationError(type: CartCustomDiscountAllocation.self, field: fieldName, value: fieldValue) + } + return DiscountApplicationTargetType(rawValue: value) ?? .unknownValue + case "title": guard let value = value as? String else { throw SchemaViolationError(type: CartCustomDiscountAllocation.self, field: fieldName, value: fieldValue) @@ -84,6 +97,15 @@ extension Storefront { return field(field: "discountedAmount", aliasSuffix: alias) as! Storefront.MoneyV2 } + /// The type of line that the discount is applicable towards. + open var targetType: Storefront.DiscountApplicationTargetType { + return internalGetTargetType() + } + + func internalGetTargetType(alias: String? = nil) -> Storefront.DiscountApplicationTargetType { + return field(field: "targetType", aliasSuffix: alias) as! Storefront.DiscountApplicationTargetType + } + /// The title of the allocated discount. open var title: String { return internalGetTitle() diff --git a/Buy/Generated/Storefront/CartDeliveryCoordinatesPreference.swift b/Buy/Generated/Storefront/CartDeliveryCoordinatesPreference.swift new file mode 100644 index 00000000..a34c0cce --- /dev/null +++ b/Buy/Generated/Storefront/CartDeliveryCoordinatesPreference.swift @@ -0,0 +1,125 @@ +// +// CartDeliveryCoordinatesPreference.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Preferred location used to find the closest pick up point based on + /// coordinates. + open class CartDeliveryCoordinatesPreferenceQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = CartDeliveryCoordinatesPreference + + /// The two-letter code for the country of the preferred location. For example, + /// US. + @discardableResult + open func countryCode(alias: String? = nil) -> CartDeliveryCoordinatesPreferenceQuery { + addField(field: "countryCode", aliasSuffix: alias) + return self + } + + /// The geographic latitude for a given location. Coordinates are required in + /// order to set pickUpHandle for pickup points. + @discardableResult + open func latitude(alias: String? = nil) -> CartDeliveryCoordinatesPreferenceQuery { + addField(field: "latitude", aliasSuffix: alias) + return self + } + + /// The geographic longitude for a given location. Coordinates are required in + /// order to set pickUpHandle for pickup points. + @discardableResult + open func longitude(alias: String? = nil) -> CartDeliveryCoordinatesPreferenceQuery { + addField(field: "longitude", aliasSuffix: alias) + return self + } + } + + /// Preferred location used to find the closest pick up point based on + /// coordinates. + open class CartDeliveryCoordinatesPreference: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = CartDeliveryCoordinatesPreferenceQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "countryCode": + guard let value = value as? String else { + throw SchemaViolationError(type: CartDeliveryCoordinatesPreference.self, field: fieldName, value: fieldValue) + } + return CountryCode(rawValue: value) ?? .unknownValue + + case "latitude": + guard let value = value as? Double else { + throw SchemaViolationError(type: CartDeliveryCoordinatesPreference.self, field: fieldName, value: fieldValue) + } + return value + + case "longitude": + guard let value = value as? Double else { + throw SchemaViolationError(type: CartDeliveryCoordinatesPreference.self, field: fieldName, value: fieldValue) + } + return value + + default: + throw SchemaViolationError(type: CartDeliveryCoordinatesPreference.self, field: fieldName, value: fieldValue) + } + } + + /// The two-letter code for the country of the preferred location. For example, + /// US. + open var countryCode: Storefront.CountryCode { + return internalGetCountryCode() + } + + func internalGetCountryCode(alias: String? = nil) -> Storefront.CountryCode { + return field(field: "countryCode", aliasSuffix: alias) as! Storefront.CountryCode + } + + /// The geographic latitude for a given location. Coordinates are required in + /// order to set pickUpHandle for pickup points. + open var latitude: Double { + return internalGetLatitude() + } + + func internalGetLatitude(alias: String? = nil) -> Double { + return field(field: "latitude", aliasSuffix: alias) as! Double + } + + /// The geographic longitude for a given location. Coordinates are required in + /// order to set pickUpHandle for pickup points. + open var longitude: Double { + return internalGetLongitude() + } + + func internalGetLongitude(alias: String? = nil) -> Double { + return field(field: "longitude", aliasSuffix: alias) as! Double + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + return [] + } + } +} diff --git a/Buy/Generated/Storefront/CartDeliveryCoordinatesPreferenceInput.swift b/Buy/Generated/Storefront/CartDeliveryCoordinatesPreferenceInput.swift new file mode 100644 index 00000000..4abe5e07 --- /dev/null +++ b/Buy/Generated/Storefront/CartDeliveryCoordinatesPreferenceInput.swift @@ -0,0 +1,81 @@ +// +// CartDeliveryCoordinatesPreferenceInput.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Preferred location used to find the closest pick up point based on + /// coordinates. + open class CartDeliveryCoordinatesPreferenceInput { + /// The geographic latitude for a given location. Coordinates are required in + /// order to set pickUpHandle for pickup points. + open var latitude: Double + + /// The geographic longitude for a given location. Coordinates are required in + /// order to set pickUpHandle for pickup points. + open var longitude: Double + + /// The two-letter code for the country of the preferred location. For example, + /// US. + open var countryCode: CountryCode + + /// Creates the input object. + /// + /// - parameters: + /// - latitude: The geographic latitude for a given location. Coordinates are required in order to set pickUpHandle for pickup points. + /// - longitude: The geographic longitude for a given location. Coordinates are required in order to set pickUpHandle for pickup points. + /// - countryCode: The two-letter code for the country of the preferred location. For example, US. + /// + public static func create(latitude: Double, longitude: Double, countryCode: CountryCode) -> CartDeliveryCoordinatesPreferenceInput { + return CartDeliveryCoordinatesPreferenceInput(latitude: latitude, longitude: longitude, countryCode: countryCode) + } + + /// Creates the input object. + /// + /// - parameters: + /// - latitude: The geographic latitude for a given location. Coordinates are required in order to set pickUpHandle for pickup points. + /// - longitude: The geographic longitude for a given location. Coordinates are required in order to set pickUpHandle for pickup points. + /// - countryCode: The two-letter code for the country of the preferred location. For example, US. + /// + public init(latitude: Double, longitude: Double, countryCode: CountryCode) { + self.latitude = latitude + self.longitude = longitude + self.countryCode = countryCode + } + + internal func serialize() -> String { + var fields: [String] = [] + + fields.append("latitude:\(latitude)") + + fields.append("longitude:\(longitude)") + + fields.append("countryCode:\(countryCode.rawValue)") + + return "{\(fields.joined(separator: ","))}" + } + } +} diff --git a/Buy/Generated/Storefront/CartDeliveryPreference.swift b/Buy/Generated/Storefront/CartDeliveryPreference.swift new file mode 100644 index 00000000..04045ed7 --- /dev/null +++ b/Buy/Generated/Storefront/CartDeliveryPreference.swift @@ -0,0 +1,148 @@ +// +// CartDeliveryPreference.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// A set of preferences tied to the buyer interacting with the cart. + /// Preferences are used to prefill fields in at checkout to streamline + /// information collection. Preferences are not synced back to the cart if they + /// are overwritten. + open class CartDeliveryPreferenceQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = CartDeliveryPreference + + /// Preferred location used to find the closest pick up point based on + /// coordinates. + @discardableResult + open func coordinates(alias: String? = nil, _ subfields: (CartDeliveryCoordinatesPreferenceQuery) -> Void) -> CartDeliveryPreferenceQuery { + let subquery = CartDeliveryCoordinatesPreferenceQuery() + subfields(subquery) + + addField(field: "coordinates", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The preferred delivery methods such as shipping, local pickup or through + /// pickup points. + @discardableResult + open func deliveryMethod(alias: String? = nil) -> CartDeliveryPreferenceQuery { + addField(field: "deliveryMethod", aliasSuffix: alias) + return self + } + + /// The pickup handle prefills checkout fields with the location for either + /// local pickup or pickup points delivery methods. It accepts both location ID + /// for local pickup and external IDs for pickup points. + @discardableResult + open func pickupHandle(alias: String? = nil) -> CartDeliveryPreferenceQuery { + addField(field: "pickupHandle", aliasSuffix: alias) + return self + } + } + + /// A set of preferences tied to the buyer interacting with the cart. + /// Preferences are used to prefill fields in at checkout to streamline + /// information collection. Preferences are not synced back to the cart if they + /// are overwritten. + open class CartDeliveryPreference: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = CartDeliveryPreferenceQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "coordinates": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: CartDeliveryPreference.self, field: fieldName, value: fieldValue) + } + return try CartDeliveryCoordinatesPreference(fields: value) + + case "deliveryMethod": + guard let value = value as? [String] else { + throw SchemaViolationError(type: CartDeliveryPreference.self, field: fieldName, value: fieldValue) + } + return value.map { return PreferenceDeliveryMethodType(rawValue: $0) ?? .unknownValue } + + case "pickupHandle": + guard let value = value as? [String] else { + throw SchemaViolationError(type: CartDeliveryPreference.self, field: fieldName, value: fieldValue) + } + return value.map { return $0 } + + default: + throw SchemaViolationError(type: CartDeliveryPreference.self, field: fieldName, value: fieldValue) + } + } + + /// Preferred location used to find the closest pick up point based on + /// coordinates. + open var coordinates: Storefront.CartDeliveryCoordinatesPreference? { + return internalGetCoordinates() + } + + func internalGetCoordinates(alias: String? = nil) -> Storefront.CartDeliveryCoordinatesPreference? { + return field(field: "coordinates", aliasSuffix: alias) as! Storefront.CartDeliveryCoordinatesPreference? + } + + /// The preferred delivery methods such as shipping, local pickup or through + /// pickup points. + open var deliveryMethod: [Storefront.PreferenceDeliveryMethodType] { + return internalGetDeliveryMethod() + } + + func internalGetDeliveryMethod(alias: String? = nil) -> [Storefront.PreferenceDeliveryMethodType] { + return field(field: "deliveryMethod", aliasSuffix: alias) as! [Storefront.PreferenceDeliveryMethodType] + } + + /// The pickup handle prefills checkout fields with the location for either + /// local pickup or pickup points delivery methods. It accepts both location ID + /// for local pickup and external IDs for pickup points. + open var pickupHandle: [String] { + return internalGetPickupHandle() + } + + func internalGetPickupHandle(alias: String? = nil) -> [String] { + return field(field: "pickupHandle", aliasSuffix: alias) as! [String] + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + var response: [GraphQL.AbstractResponse] = [] + objectMap.keys.forEach { + switch($0) { + case "coordinates": + if let value = internalGetCoordinates() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + + default: + break + } + } + return response + } + } +} diff --git a/Buy/Generated/Storefront/CartDeliveryPreferenceInput.swift b/Buy/Generated/Storefront/CartDeliveryPreferenceInput.swift new file mode 100644 index 00000000..33e7144a --- /dev/null +++ b/Buy/Generated/Storefront/CartDeliveryPreferenceInput.swift @@ -0,0 +1,112 @@ +// +// CartDeliveryPreferenceInput.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Delivery preferences can be used to prefill the delivery section at + /// checkout. + open class CartDeliveryPreferenceInput { + /// The preferred delivery methods such as shipping, local pickup or through + /// pickup points. The input must not contain more than `250` values. + open var deliveryMethod: Input<[PreferenceDeliveryMethodType]> + + /// The pickup handle prefills checkout fields with the location for either + /// local pickup or pickup points delivery methods. It accepts both location ID + /// for local pickup and external IDs for pickup points. The input must not + /// contain more than `250` values. + open var pickupHandle: Input<[String]> + + /// The coordinates of a delivery location in order of preference. The input + /// must not contain more than `250` values. + open var coordinates: Input<[CartDeliveryCoordinatesPreferenceInput]> + + /// Creates the input object. + /// + /// - parameters: + /// - deliveryMethod: The preferred delivery methods such as shipping, local pickup or through pickup points. The input must not contain more than `250` values. + /// - pickupHandle: The pickup handle prefills checkout fields with the location for either local pickup or pickup points delivery methods. It accepts both location ID for local pickup and external IDs for pickup points. The input must not contain more than `250` values. + /// - coordinates: The coordinates of a delivery location in order of preference. The input must not contain more than `250` values. + /// + public static func create(deliveryMethod: Input<[PreferenceDeliveryMethodType]> = .undefined, pickupHandle: Input<[String]> = .undefined, coordinates: Input<[CartDeliveryCoordinatesPreferenceInput]> = .undefined) -> CartDeliveryPreferenceInput { + return CartDeliveryPreferenceInput(deliveryMethod: deliveryMethod, pickupHandle: pickupHandle, coordinates: coordinates) + } + + private init(deliveryMethod: Input<[PreferenceDeliveryMethodType]> = .undefined, pickupHandle: Input<[String]> = .undefined, coordinates: Input<[CartDeliveryCoordinatesPreferenceInput]> = .undefined) { + self.deliveryMethod = deliveryMethod + self.pickupHandle = pickupHandle + self.coordinates = coordinates + } + + /// Creates the input object. + /// + /// - parameters: + /// - deliveryMethod: The preferred delivery methods such as shipping, local pickup or through pickup points. The input must not contain more than `250` values. + /// - pickupHandle: The pickup handle prefills checkout fields with the location for either local pickup or pickup points delivery methods. It accepts both location ID for local pickup and external IDs for pickup points. The input must not contain more than `250` values. + /// - coordinates: The coordinates of a delivery location in order of preference. The input must not contain more than `250` values. + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(deliveryMethod: [PreferenceDeliveryMethodType]? = nil, pickupHandle: [String]? = nil, coordinates: [CartDeliveryCoordinatesPreferenceInput]? = nil) { + self.init(deliveryMethod: deliveryMethod.orUndefined, pickupHandle: pickupHandle.orUndefined, coordinates: coordinates.orUndefined) + } + + internal func serialize() -> String { + var fields: [String] = [] + + switch deliveryMethod { + case .value(let deliveryMethod): + guard let deliveryMethod = deliveryMethod else { + fields.append("deliveryMethod:null") + break + } + fields.append("deliveryMethod:[\(deliveryMethod.map{ "\($0.rawValue)" }.joined(separator: ","))]") + case .undefined: break + } + + switch pickupHandle { + case .value(let pickupHandle): + guard let pickupHandle = pickupHandle else { + fields.append("pickupHandle:null") + break + } + fields.append("pickupHandle:[\(pickupHandle.map{ "\(GraphQL.quoteString(input: $0))" }.joined(separator: ","))]") + case .undefined: break + } + + switch coordinates { + case .value(let coordinates): + guard let coordinates = coordinates else { + fields.append("coordinates:null") + break + } + fields.append("coordinates:[\(coordinates.map{ "\($0.serialize())" }.joined(separator: ","))]") + case .undefined: break + } + + return "{\(fields.joined(separator: ","))}" + } + } +} diff --git a/Buy/Generated/Storefront/CartDiscountAllocation.swift b/Buy/Generated/Storefront/CartDiscountAllocation.swift index bb94c868..7d717012 100644 --- a/Buy/Generated/Storefront/CartDiscountAllocation.swift +++ b/Buy/Generated/Storefront/CartDiscountAllocation.swift @@ -29,6 +29,8 @@ import Foundation /// The discounts that have been applied to the cart line. public protocol CartDiscountAllocation { var discountedAmount: Storefront.MoneyV2 { get } + + var targetType: Storefront.DiscountApplicationTargetType { get } } extension Storefront { @@ -46,6 +48,13 @@ extension Storefront { return self } + /// The type of line that the discount is applicable towards. + @discardableResult + open func targetType(alias: String? = nil) -> CartDiscountAllocationQuery { + addField(field: "targetType", aliasSuffix: alias) + return self + } + override init() { super.init() addField(field: "__typename") @@ -92,6 +101,12 @@ extension Storefront { } return try MoneyV2(fields: value) + case "targetType": + guard let value = value as? String else { + throw SchemaViolationError(type: UnknownCartDiscountAllocation.self, field: fieldName, value: fieldValue) + } + return DiscountApplicationTargetType(rawValue: value) ?? .unknownValue + default: throw SchemaViolationError(type: UnknownCartDiscountAllocation.self, field: fieldName, value: fieldValue) } @@ -122,6 +137,15 @@ extension Storefront { return field(field: "discountedAmount", aliasSuffix: alias) as! Storefront.MoneyV2 } + /// The type of line that the discount is applicable towards. + open var targetType: Storefront.DiscountApplicationTargetType { + return internalGetTargetType() + } + + func internalGetTargetType(alias: String? = nil) -> Storefront.DiscountApplicationTargetType { + return field(field: "targetType", aliasSuffix: alias) as! Storefront.DiscountApplicationTargetType + } + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { var response: [GraphQL.AbstractResponse] = [] objectMap.keys.forEach { diff --git a/Buy/Generated/Storefront/CartErrorCode.swift b/Buy/Generated/Storefront/CartErrorCode.swift index 45aa8dcd..808f101a 100644 --- a/Buy/Generated/Storefront/CartErrorCode.swift +++ b/Buy/Generated/Storefront/CartErrorCode.swift @@ -98,6 +98,9 @@ extension Storefront { /// Missing note. case missingNote = "MISSING_NOTE" + /// The note length must be below the specified maximum. + case noteTooLong = "NOTE_TOO_LONG" + /// The payment method is not supported. case paymentMethodNotSupported = "PAYMENT_METHOD_NOT_SUPPORTED" diff --git a/Buy/Generated/Storefront/CartGiftCardCodesUpdatePayload.swift b/Buy/Generated/Storefront/CartGiftCardCodesUpdatePayload.swift new file mode 100644 index 00000000..76684fb0 --- /dev/null +++ b/Buy/Generated/Storefront/CartGiftCardCodesUpdatePayload.swift @@ -0,0 +1,121 @@ +// +// CartGiftCardCodesUpdatePayload.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Return type for `cartGiftCardCodesUpdate` mutation. + open class CartGiftCardCodesUpdatePayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = CartGiftCardCodesUpdatePayload + + /// The updated cart. + @discardableResult + open func cart(alias: String? = nil, _ subfields: (CartQuery) -> Void) -> CartGiftCardCodesUpdatePayloadQuery { + let subquery = CartQuery() + subfields(subquery) + + addField(field: "cart", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The list of errors that occurred from executing the mutation. + @discardableResult + open func userErrors(alias: String? = nil, _ subfields: (CartUserErrorQuery) -> Void) -> CartGiftCardCodesUpdatePayloadQuery { + let subquery = CartUserErrorQuery() + subfields(subquery) + + addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) + return self + } + } + + /// Return type for `cartGiftCardCodesUpdate` mutation. + open class CartGiftCardCodesUpdatePayload: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = CartGiftCardCodesUpdatePayloadQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "cart": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: CartGiftCardCodesUpdatePayload.self, field: fieldName, value: fieldValue) + } + return try Cart(fields: value) + + case "userErrors": + guard let value = value as? [[String: Any]] else { + throw SchemaViolationError(type: CartGiftCardCodesUpdatePayload.self, field: fieldName, value: fieldValue) + } + return try value.map { return try CartUserError(fields: $0) } + + default: + throw SchemaViolationError(type: CartGiftCardCodesUpdatePayload.self, field: fieldName, value: fieldValue) + } + } + + /// The updated cart. + open var cart: Storefront.Cart? { + return internalGetCart() + } + + func internalGetCart(alias: String? = nil) -> Storefront.Cart? { + return field(field: "cart", aliasSuffix: alias) as! Storefront.Cart? + } + + /// The list of errors that occurred from executing the mutation. + open var userErrors: [Storefront.CartUserError] { + return internalGetUserErrors() + } + + func internalGetUserErrors(alias: String? = nil) -> [Storefront.CartUserError] { + return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.CartUserError] + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + var response: [GraphQL.AbstractResponse] = [] + objectMap.keys.forEach { + switch($0) { + case "cart": + if let value = internalGetCart() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + + case "userErrors": + internalGetUserErrors().forEach { + response.append($0) + response.append(contentsOf: $0.childResponseObjectMap()) + } + + default: + break + } + } + return response + } + } +} diff --git a/Buy/Generated/Storefront/CartInput.swift b/Buy/Generated/Storefront/CartInput.swift index eb99d019..b12941a7 100644 --- a/Buy/Generated/Storefront/CartInput.swift +++ b/Buy/Generated/Storefront/CartInput.swift @@ -41,6 +41,10 @@ extension Storefront { /// The input must not contain more than `250` values. open var discountCodes: Input<[String]> + /// The case-insensitive gift card codes. The input must not contain more than + /// `250` values. + open var giftCardCodes: Input<[String]> + /// A note that's associated with the cart. For example, the note can be a /// personalized message to the buyer. open var note: Input @@ -61,18 +65,20 @@ extension Storefront { /// - attributes: An array of key-value pairs that contains additional information about the cart. The input must not contain more than `250` values. /// - lines: A list of merchandise lines to add to the cart. The input must not contain more than `250` values. /// - discountCodes: The case-insensitive discount codes that the customer added at checkout. The input must not contain more than `250` values. + /// - giftCardCodes: The case-insensitive gift card codes. The input must not contain more than `250` values. /// - note: A note that's associated with the cart. For example, the note can be a personalized message to the buyer. /// - buyerIdentity: The customer associated with the cart. Used to determine [international pricing] (https://shopify.dev/custom-storefronts/internationalization/international-pricing). Buyer identity should match the customer's shipping address. /// - metafields: The metafields to associate with this cart. The input must not contain more than `250` values. /// - public static func create(attributes: Input<[AttributeInput]> = .undefined, lines: Input<[CartLineInput]> = .undefined, discountCodes: Input<[String]> = .undefined, note: Input = .undefined, buyerIdentity: Input = .undefined, metafields: Input<[CartInputMetafieldInput]> = .undefined) -> CartInput { - return CartInput(attributes: attributes, lines: lines, discountCodes: discountCodes, note: note, buyerIdentity: buyerIdentity, metafields: metafields) + public static func create(attributes: Input<[AttributeInput]> = .undefined, lines: Input<[CartLineInput]> = .undefined, discountCodes: Input<[String]> = .undefined, giftCardCodes: Input<[String]> = .undefined, note: Input = .undefined, buyerIdentity: Input = .undefined, metafields: Input<[CartInputMetafieldInput]> = .undefined) -> CartInput { + return CartInput(attributes: attributes, lines: lines, discountCodes: discountCodes, giftCardCodes: giftCardCodes, note: note, buyerIdentity: buyerIdentity, metafields: metafields) } - private init(attributes: Input<[AttributeInput]> = .undefined, lines: Input<[CartLineInput]> = .undefined, discountCodes: Input<[String]> = .undefined, note: Input = .undefined, buyerIdentity: Input = .undefined, metafields: Input<[CartInputMetafieldInput]> = .undefined) { + private init(attributes: Input<[AttributeInput]> = .undefined, lines: Input<[CartLineInput]> = .undefined, discountCodes: Input<[String]> = .undefined, giftCardCodes: Input<[String]> = .undefined, note: Input = .undefined, buyerIdentity: Input = .undefined, metafields: Input<[CartInputMetafieldInput]> = .undefined) { self.attributes = attributes self.lines = lines self.discountCodes = discountCodes + self.giftCardCodes = giftCardCodes self.note = note self.buyerIdentity = buyerIdentity self.metafields = metafields @@ -84,13 +90,14 @@ extension Storefront { /// - attributes: An array of key-value pairs that contains additional information about the cart. The input must not contain more than `250` values. /// - lines: A list of merchandise lines to add to the cart. The input must not contain more than `250` values. /// - discountCodes: The case-insensitive discount codes that the customer added at checkout. The input must not contain more than `250` values. + /// - giftCardCodes: The case-insensitive gift card codes. The input must not contain more than `250` values. /// - note: A note that's associated with the cart. For example, the note can be a personalized message to the buyer. /// - buyerIdentity: The customer associated with the cart. Used to determine [international pricing] (https://shopify.dev/custom-storefronts/internationalization/international-pricing). Buyer identity should match the customer's shipping address. /// - metafields: The metafields to associate with this cart. The input must not contain more than `250` values. /// @available(*, deprecated, message: "Use the static create() method instead.") - public convenience init(attributes: [AttributeInput]? = nil, lines: [CartLineInput]? = nil, discountCodes: [String]? = nil, note: String? = nil, buyerIdentity: CartBuyerIdentityInput? = nil, metafields: [CartInputMetafieldInput]? = nil) { - self.init(attributes: attributes.orUndefined, lines: lines.orUndefined, discountCodes: discountCodes.orUndefined, note: note.orUndefined, buyerIdentity: buyerIdentity.orUndefined, metafields: metafields.orUndefined) + public convenience init(attributes: [AttributeInput]? = nil, lines: [CartLineInput]? = nil, discountCodes: [String]? = nil, giftCardCodes: [String]? = nil, note: String? = nil, buyerIdentity: CartBuyerIdentityInput? = nil, metafields: [CartInputMetafieldInput]? = nil) { + self.init(attributes: attributes.orUndefined, lines: lines.orUndefined, discountCodes: discountCodes.orUndefined, giftCardCodes: giftCardCodes.orUndefined, note: note.orUndefined, buyerIdentity: buyerIdentity.orUndefined, metafields: metafields.orUndefined) } internal func serialize() -> String { @@ -126,6 +133,16 @@ extension Storefront { case .undefined: break } + switch giftCardCodes { + case .value(let giftCardCodes): + guard let giftCardCodes = giftCardCodes else { + fields.append("giftCardCodes:null") + break + } + fields.append("giftCardCodes:[\(giftCardCodes.map{ "\(GraphQL.quoteString(input: $0))" }.joined(separator: ","))]") + case .undefined: break + } + switch note { case .value(let note): guard let note = note else { diff --git a/Buy/Generated/Storefront/CartPreferences.swift b/Buy/Generated/Storefront/CartPreferences.swift new file mode 100644 index 00000000..90d1955f --- /dev/null +++ b/Buy/Generated/Storefront/CartPreferences.swift @@ -0,0 +1,123 @@ +// +// CartPreferences.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// A set of preferences tied to the buyer interacting with the cart. + /// Preferences are used to prefill fields in at checkout to streamline + /// information collection. Preferences are not synced back to the cart if they + /// are overwritten. + open class CartPreferencesQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = CartPreferences + + /// Delivery preferences can be used to prefill the delivery section in at + /// checkout. + @discardableResult + open func delivery(alias: String? = nil, _ subfields: (CartDeliveryPreferenceQuery) -> Void) -> CartPreferencesQuery { + let subquery = CartDeliveryPreferenceQuery() + subfields(subquery) + + addField(field: "delivery", aliasSuffix: alias, subfields: subquery) + return self + } + + /// Wallet preferences are used to populate relevant payment fields in the + /// checkout flow. Accepted value: `["shop_pay"]`. + @discardableResult + open func wallet(alias: String? = nil) -> CartPreferencesQuery { + addField(field: "wallet", aliasSuffix: alias) + return self + } + } + + /// A set of preferences tied to the buyer interacting with the cart. + /// Preferences are used to prefill fields in at checkout to streamline + /// information collection. Preferences are not synced back to the cart if they + /// are overwritten. + open class CartPreferences: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = CartPreferencesQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "delivery": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: CartPreferences.self, field: fieldName, value: fieldValue) + } + return try CartDeliveryPreference(fields: value) + + case "wallet": + if value is NSNull { return nil } + guard let value = value as? [String] else { + throw SchemaViolationError(type: CartPreferences.self, field: fieldName, value: fieldValue) + } + return value.map { return $0 } + + default: + throw SchemaViolationError(type: CartPreferences.self, field: fieldName, value: fieldValue) + } + } + + /// Delivery preferences can be used to prefill the delivery section in at + /// checkout. + open var delivery: Storefront.CartDeliveryPreference? { + return internalGetDelivery() + } + + func internalGetDelivery(alias: String? = nil) -> Storefront.CartDeliveryPreference? { + return field(field: "delivery", aliasSuffix: alias) as! Storefront.CartDeliveryPreference? + } + + /// Wallet preferences are used to populate relevant payment fields in the + /// checkout flow. Accepted value: `["shop_pay"]`. + open var wallet: [String]? { + return internalGetWallet() + } + + func internalGetWallet(alias: String? = nil) -> [String]? { + return field(field: "wallet", aliasSuffix: alias) as! [String]? + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + var response: [GraphQL.AbstractResponse] = [] + objectMap.keys.forEach { + switch($0) { + case "delivery": + if let value = internalGetDelivery() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + + default: + break + } + } + return response + } + } +} diff --git a/Buy/Generated/Storefront/CartPreferencesInput.swift b/Buy/Generated/Storefront/CartPreferencesInput.swift new file mode 100644 index 00000000..3f429e1f --- /dev/null +++ b/Buy/Generated/Storefront/CartPreferencesInput.swift @@ -0,0 +1,94 @@ +// +// CartPreferencesInput.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// The input fields represent preferences for the buyer that is interacting + /// with the cart. + open class CartPreferencesInput { + /// Delivery preferences can be used to prefill the delivery section in at + /// checkout. The input must not contain more than `250` values. + open var delivery: Input<[CartDeliveryPreferenceInput]> + + /// Wallet preferences are used to populate relevant payment fields in the + /// checkout flow. Accepted value: `["shop_pay"]`. The input must not contain + /// more than `250` values. + open var wallet: Input<[String]> + + /// Creates the input object. + /// + /// - parameters: + /// - delivery: Delivery preferences can be used to prefill the delivery section in at checkout. The input must not contain more than `250` values. + /// - wallet: Wallet preferences are used to populate relevant payment fields in the checkout flow. Accepted value: `["shop_pay"]`. The input must not contain more than `250` values. + /// + public static func create(delivery: Input<[CartDeliveryPreferenceInput]> = .undefined, wallet: Input<[String]> = .undefined) -> CartPreferencesInput { + return CartPreferencesInput(delivery: delivery, wallet: wallet) + } + + private init(delivery: Input<[CartDeliveryPreferenceInput]> = .undefined, wallet: Input<[String]> = .undefined) { + self.delivery = delivery + self.wallet = wallet + } + + /// Creates the input object. + /// + /// - parameters: + /// - delivery: Delivery preferences can be used to prefill the delivery section in at checkout. The input must not contain more than `250` values. + /// - wallet: Wallet preferences are used to populate relevant payment fields in the checkout flow. Accepted value: `["shop_pay"]`. The input must not contain more than `250` values. + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(delivery: [CartDeliveryPreferenceInput]? = nil, wallet: [String]? = nil) { + self.init(delivery: delivery.orUndefined, wallet: wallet.orUndefined) + } + + internal func serialize() -> String { + var fields: [String] = [] + + switch delivery { + case .value(let delivery): + guard let delivery = delivery else { + fields.append("delivery:null") + break + } + fields.append("delivery:[\(delivery.map{ "\($0.serialize())" }.joined(separator: ","))]") + case .undefined: break + } + + switch wallet { + case .value(let wallet): + guard let wallet = wallet else { + fields.append("wallet:null") + break + } + fields.append("wallet:[\(wallet.map{ "\(GraphQL.quoteString(input: $0))" }.joined(separator: ","))]") + case .undefined: break + } + + return "{\(fields.joined(separator: ","))}" + } + } +} diff --git a/Buy/Generated/Storefront/Checkout.swift b/Buy/Generated/Storefront/Checkout.swift deleted file mode 100644 index f09b714e..00000000 --- a/Buy/Generated/Storefront/Checkout.swift +++ /dev/null @@ -1,1067 +0,0 @@ -// -// Checkout.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// A container for all the information required to checkout items and pay. The - /// Storefront GraphQL Checkout API is deprecated and will be removed in a - /// future version. Please see - /// https://shopify.dev/changelog/deprecation-of-checkout-apis for more - /// information. - open class CheckoutQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = Checkout - - /// The gift cards used on the checkout. - @discardableResult - open func appliedGiftCards(alias: String? = nil, _ subfields: (AppliedGiftCardQuery) -> Void) -> CheckoutQuery { - let subquery = AppliedGiftCardQuery() - subfields(subquery) - - addField(field: "appliedGiftCards", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The available shipping rates for this Checkout. Should only be used when - /// checkout `requiresShipping` is `true` and the shipping address is valid. - @discardableResult - open func availableShippingRates(alias: String? = nil, _ subfields: (AvailableShippingRatesQuery) -> Void) -> CheckoutQuery { - let subquery = AvailableShippingRatesQuery() - subfields(subquery) - - addField(field: "availableShippingRates", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The identity of the customer associated with the checkout. - @discardableResult - open func buyerIdentity(alias: String? = nil, _ subfields: (CheckoutBuyerIdentityQuery) -> Void) -> CheckoutQuery { - let subquery = CheckoutBuyerIdentityQuery() - subfields(subquery) - - addField(field: "buyerIdentity", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The date and time when the checkout was completed. - @discardableResult - open func completedAt(alias: String? = nil) -> CheckoutQuery { - addField(field: "completedAt", aliasSuffix: alias) - return self - } - - /// The date and time when the checkout was created. - @discardableResult - open func createdAt(alias: String? = nil) -> CheckoutQuery { - addField(field: "createdAt", aliasSuffix: alias) - return self - } - - /// The currency code for the checkout. - @discardableResult - open func currencyCode(alias: String? = nil) -> CheckoutQuery { - addField(field: "currencyCode", aliasSuffix: alias) - return self - } - - /// A list of extra information that's added to the checkout. - @discardableResult - open func customAttributes(alias: String? = nil, _ subfields: (AttributeQuery) -> Void) -> CheckoutQuery { - let subquery = AttributeQuery() - subfields(subquery) - - addField(field: "customAttributes", aliasSuffix: alias, subfields: subquery) - return self - } - - /// Discounts that have been applied on the checkout. - /// - /// - parameters: - /// - first: Returns up to the first `n` elements from the list. - /// - after: Returns the elements that come after the specified cursor. - /// - last: Returns up to the last `n` elements from the list. - /// - before: Returns the elements that come before the specified cursor. - /// - reverse: Reverse the order of the underlying list. - /// - @discardableResult - open func discountApplications(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, _ subfields: (DiscountApplicationConnectionQuery) -> Void) -> CheckoutQuery { - var args: [String] = [] - - if let first = first { - args.append("first:\(first)") - } - - if let after = after { - args.append("after:\(GraphQL.quoteString(input: after))") - } - - if let last = last { - args.append("last:\(last)") - } - - if let before = before { - args.append("before:\(GraphQL.quoteString(input: before))") - } - - if let reverse = reverse { - args.append("reverse:\(reverse)") - } - - let argsString: String? = args.isEmpty ? nil : "(\(args.joined(separator: ",")))" - - let subquery = DiscountApplicationConnectionQuery() - subfields(subquery) - - addField(field: "discountApplications", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// The email attached to this checkout. - @discardableResult - open func email(alias: String? = nil) -> CheckoutQuery { - addField(field: "email", aliasSuffix: alias) - return self - } - - /// A globally-unique ID. - @discardableResult - open func id(alias: String? = nil) -> CheckoutQuery { - addField(field: "id", aliasSuffix: alias) - return self - } - - /// A list of line item objects, each one containing information about an item - /// in the checkout. - /// - /// - parameters: - /// - first: Returns up to the first `n` elements from the list. - /// - after: Returns the elements that come after the specified cursor. - /// - last: Returns up to the last `n` elements from the list. - /// - before: Returns the elements that come before the specified cursor. - /// - reverse: Reverse the order of the underlying list. - /// - @discardableResult - open func lineItems(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, reverse: Bool? = nil, _ subfields: (CheckoutLineItemConnectionQuery) -> Void) -> CheckoutQuery { - var args: [String] = [] - - if let first = first { - args.append("first:\(first)") - } - - if let after = after { - args.append("after:\(GraphQL.quoteString(input: after))") - } - - if let last = last { - args.append("last:\(last)") - } - - if let before = before { - args.append("before:\(GraphQL.quoteString(input: before))") - } - - if let reverse = reverse { - args.append("reverse:\(reverse)") - } - - let argsString: String? = args.isEmpty ? nil : "(\(args.joined(separator: ",")))" - - let subquery = CheckoutLineItemConnectionQuery() - subfields(subquery) - - addField(field: "lineItems", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// The sum of all the prices of all the items in the checkout. Duties, taxes, - /// shipping and discounts excluded. - @discardableResult - open func lineItemsSubtotalPrice(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> CheckoutQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "lineItemsSubtotalPrice", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The note associated with the checkout. - @discardableResult - open func note(alias: String? = nil) -> CheckoutQuery { - addField(field: "note", aliasSuffix: alias) - return self - } - - /// The resulting order from a paid checkout. - @discardableResult - open func order(alias: String? = nil, _ subfields: (OrderQuery) -> Void) -> CheckoutQuery { - let subquery = OrderQuery() - subfields(subquery) - - addField(field: "order", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The Order status page for this Checkout, null when checkout isn't - /// completed. - @discardableResult - open func orderStatusUrl(alias: String? = nil) -> CheckoutQuery { - addField(field: "orderStatusUrl", aliasSuffix: alias) - return self - } - - /// The amount left to be paid. This is equal to the cost of the line items, - /// taxes, and shipping, minus discounts and gift cards. - @discardableResult - open func paymentDue(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> CheckoutQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "paymentDue", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The amount left to be paid. This is equal to the cost of the line items, - /// duties, taxes, and shipping, minus discounts and gift cards. - @available(*, deprecated, message:"Use `paymentDue` instead.") - @discardableResult - open func paymentDueV2(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> CheckoutQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "paymentDueV2", aliasSuffix: alias, subfields: subquery) - return self - } - - /// Whether or not the Checkout is ready and can be completed. Checkouts may - /// have asynchronous operations that can take time to finish. If you want to - /// complete a checkout or ensure all the fields are populated and up to date, - /// polling is required until the value is true. - @discardableResult - open func ready(alias: String? = nil) -> CheckoutQuery { - addField(field: "ready", aliasSuffix: alias) - return self - } - - /// States whether or not the fulfillment requires shipping. - @discardableResult - open func requiresShipping(alias: String? = nil) -> CheckoutQuery { - addField(field: "requiresShipping", aliasSuffix: alias) - return self - } - - /// The shipping address to where the line items will be shipped. - @discardableResult - open func shippingAddress(alias: String? = nil, _ subfields: (MailingAddressQuery) -> Void) -> CheckoutQuery { - let subquery = MailingAddressQuery() - subfields(subquery) - - addField(field: "shippingAddress", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The discounts that have been allocated onto the shipping line by discount - /// applications. - @discardableResult - open func shippingDiscountAllocations(alias: String? = nil, _ subfields: (DiscountAllocationQuery) -> Void) -> CheckoutQuery { - let subquery = DiscountAllocationQuery() - subfields(subquery) - - addField(field: "shippingDiscountAllocations", aliasSuffix: alias, subfields: subquery) - return self - } - - /// Once a shipping rate is selected by the customer it's transitioned to a - /// `shipping_line` object. - @discardableResult - open func shippingLine(alias: String? = nil, _ subfields: (ShippingRateQuery) -> Void) -> CheckoutQuery { - let subquery = ShippingRateQuery() - subfields(subquery) - - addField(field: "shippingLine", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The price at checkout before shipping and taxes. - @discardableResult - open func subtotalPrice(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> CheckoutQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "subtotalPrice", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The price at checkout before duties, shipping, and taxes. - @available(*, deprecated, message:"Use `subtotalPrice` instead.") - @discardableResult - open func subtotalPriceV2(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> CheckoutQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "subtotalPriceV2", aliasSuffix: alias, subfields: subquery) - return self - } - - /// Whether the checkout is tax exempt. - @discardableResult - open func taxExempt(alias: String? = nil) -> CheckoutQuery { - addField(field: "taxExempt", aliasSuffix: alias) - return self - } - - /// Whether taxes are included in the line item and shipping line prices. - @discardableResult - open func taxesIncluded(alias: String? = nil) -> CheckoutQuery { - addField(field: "taxesIncluded", aliasSuffix: alias) - return self - } - - /// The sum of all the duties applied to the line items in the checkout. - @discardableResult - open func totalDuties(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> CheckoutQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "totalDuties", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The sum of all the prices of all the items in the checkout, including taxes - /// and duties. - @discardableResult - open func totalPrice(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> CheckoutQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "totalPrice", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The sum of all the prices of all the items in the checkout, including taxes - /// and duties. - @available(*, deprecated, message:"Use `totalPrice` instead.") - @discardableResult - open func totalPriceV2(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> CheckoutQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "totalPriceV2", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The sum of all the taxes applied to the line items and shipping lines in - /// the checkout. - @discardableResult - open func totalTax(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> CheckoutQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "totalTax", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The sum of all the taxes applied to the line items and shipping lines in - /// the checkout. - @available(*, deprecated, message:"Use `totalTax` instead.") - @discardableResult - open func totalTaxV2(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> CheckoutQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "totalTaxV2", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The date and time when the checkout was last updated. - @discardableResult - open func updatedAt(alias: String? = nil) -> CheckoutQuery { - addField(field: "updatedAt", aliasSuffix: alias) - return self - } - - /// The url pointing to the checkout accessible from the web. - @discardableResult - open func webUrl(alias: String? = nil) -> CheckoutQuery { - addField(field: "webUrl", aliasSuffix: alias) - return self - } - } - - /// A container for all the information required to checkout items and pay. The - /// Storefront GraphQL Checkout API is deprecated and will be removed in a - /// future version. Please see - /// https://shopify.dev/changelog/deprecation-of-checkout-apis for more - /// information. - open class Checkout: GraphQL.AbstractResponse, GraphQLObject, Node { - public typealias Query = CheckoutQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "appliedGiftCards": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try value.map { return try AppliedGiftCard(fields: $0) } - - case "availableShippingRates": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try AvailableShippingRates(fields: value) - - case "buyerIdentity": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try CheckoutBuyerIdentity(fields: value) - - case "completedAt": - if value is NSNull { return nil } - guard let value = value as? String else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return GraphQL.iso8601DateParser.date(from: value)! - - case "createdAt": - guard let value = value as? String else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return GraphQL.iso8601DateParser.date(from: value)! - - case "currencyCode": - guard let value = value as? String else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return CurrencyCode(rawValue: value) ?? .unknownValue - - case "customAttributes": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try value.map { return try Attribute(fields: $0) } - - case "discountApplications": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try DiscountApplicationConnection(fields: value) - - case "email": - if value is NSNull { return nil } - guard let value = value as? String else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return value - - case "id": - guard let value = value as? String else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return GraphQL.ID(rawValue: value) - - case "lineItems": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try CheckoutLineItemConnection(fields: value) - - case "lineItemsSubtotalPrice": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "note": - if value is NSNull { return nil } - guard let value = value as? String else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return value - - case "order": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try Order(fields: value) - - case "orderStatusUrl": - if value is NSNull { return nil } - guard let value = value as? String else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return URL(string: value)! - - case "paymentDue": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "paymentDueV2": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "ready": - guard let value = value as? Bool else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return value - - case "requiresShipping": - guard let value = value as? Bool else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return value - - case "shippingAddress": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try MailingAddress(fields: value) - - case "shippingDiscountAllocations": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try value.map { return try DiscountAllocation(fields: $0) } - - case "shippingLine": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try ShippingRate(fields: value) - - case "subtotalPrice": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "subtotalPriceV2": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "taxExempt": - guard let value = value as? Bool else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return value - - case "taxesIncluded": - guard let value = value as? Bool else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return value - - case "totalDuties": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "totalPrice": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "totalPriceV2": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "totalTax": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "totalTaxV2": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "updatedAt": - guard let value = value as? String else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return GraphQL.iso8601DateParser.date(from: value)! - - case "webUrl": - guard let value = value as? String else { - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - return URL(string: value)! - - default: - throw SchemaViolationError(type: Checkout.self, field: fieldName, value: fieldValue) - } - } - - /// The gift cards used on the checkout. - open var appliedGiftCards: [Storefront.AppliedGiftCard] { - return internalGetAppliedGiftCards() - } - - func internalGetAppliedGiftCards(alias: String? = nil) -> [Storefront.AppliedGiftCard] { - return field(field: "appliedGiftCards", aliasSuffix: alias) as! [Storefront.AppliedGiftCard] - } - - /// The available shipping rates for this Checkout. Should only be used when - /// checkout `requiresShipping` is `true` and the shipping address is valid. - open var availableShippingRates: Storefront.AvailableShippingRates? { - return internalGetAvailableShippingRates() - } - - func internalGetAvailableShippingRates(alias: String? = nil) -> Storefront.AvailableShippingRates? { - return field(field: "availableShippingRates", aliasSuffix: alias) as! Storefront.AvailableShippingRates? - } - - /// The identity of the customer associated with the checkout. - open var buyerIdentity: Storefront.CheckoutBuyerIdentity { - return internalGetBuyerIdentity() - } - - func internalGetBuyerIdentity(alias: String? = nil) -> Storefront.CheckoutBuyerIdentity { - return field(field: "buyerIdentity", aliasSuffix: alias) as! Storefront.CheckoutBuyerIdentity - } - - /// The date and time when the checkout was completed. - open var completedAt: Date? { - return internalGetCompletedAt() - } - - func internalGetCompletedAt(alias: String? = nil) -> Date? { - return field(field: "completedAt", aliasSuffix: alias) as! Date? - } - - /// The date and time when the checkout was created. - open var createdAt: Date { - return internalGetCreatedAt() - } - - func internalGetCreatedAt(alias: String? = nil) -> Date { - return field(field: "createdAt", aliasSuffix: alias) as! Date - } - - /// The currency code for the checkout. - open var currencyCode: Storefront.CurrencyCode { - return internalGetCurrencyCode() - } - - func internalGetCurrencyCode(alias: String? = nil) -> Storefront.CurrencyCode { - return field(field: "currencyCode", aliasSuffix: alias) as! Storefront.CurrencyCode - } - - /// A list of extra information that's added to the checkout. - open var customAttributes: [Storefront.Attribute] { - return internalGetCustomAttributes() - } - - func internalGetCustomAttributes(alias: String? = nil) -> [Storefront.Attribute] { - return field(field: "customAttributes", aliasSuffix: alias) as! [Storefront.Attribute] - } - - /// Discounts that have been applied on the checkout. - open var discountApplications: Storefront.DiscountApplicationConnection { - return internalGetDiscountApplications() - } - - open func aliasedDiscountApplications(alias: String) -> Storefront.DiscountApplicationConnection { - return internalGetDiscountApplications(alias: alias) - } - - func internalGetDiscountApplications(alias: String? = nil) -> Storefront.DiscountApplicationConnection { - return field(field: "discountApplications", aliasSuffix: alias) as! Storefront.DiscountApplicationConnection - } - - /// The email attached to this checkout. - open var email: String? { - return internalGetEmail() - } - - func internalGetEmail(alias: String? = nil) -> String? { - return field(field: "email", aliasSuffix: alias) as! String? - } - - /// A globally-unique ID. - open var id: GraphQL.ID { - return internalGetId() - } - - func internalGetId(alias: String? = nil) -> GraphQL.ID { - return field(field: "id", aliasSuffix: alias) as! GraphQL.ID - } - - /// A list of line item objects, each one containing information about an item - /// in the checkout. - open var lineItems: Storefront.CheckoutLineItemConnection { - return internalGetLineItems() - } - - open func aliasedLineItems(alias: String) -> Storefront.CheckoutLineItemConnection { - return internalGetLineItems(alias: alias) - } - - func internalGetLineItems(alias: String? = nil) -> Storefront.CheckoutLineItemConnection { - return field(field: "lineItems", aliasSuffix: alias) as! Storefront.CheckoutLineItemConnection - } - - /// The sum of all the prices of all the items in the checkout. Duties, taxes, - /// shipping and discounts excluded. - open var lineItemsSubtotalPrice: Storefront.MoneyV2 { - return internalGetLineItemsSubtotalPrice() - } - - func internalGetLineItemsSubtotalPrice(alias: String? = nil) -> Storefront.MoneyV2 { - return field(field: "lineItemsSubtotalPrice", aliasSuffix: alias) as! Storefront.MoneyV2 - } - - /// The note associated with the checkout. - open var note: String? { - return internalGetNote() - } - - func internalGetNote(alias: String? = nil) -> String? { - return field(field: "note", aliasSuffix: alias) as! String? - } - - /// The resulting order from a paid checkout. - open var order: Storefront.Order? { - return internalGetOrder() - } - - func internalGetOrder(alias: String? = nil) -> Storefront.Order? { - return field(field: "order", aliasSuffix: alias) as! Storefront.Order? - } - - /// The Order status page for this Checkout, null when checkout isn't - /// completed. - open var orderStatusUrl: URL? { - return internalGetOrderStatusUrl() - } - - func internalGetOrderStatusUrl(alias: String? = nil) -> URL? { - return field(field: "orderStatusUrl", aliasSuffix: alias) as! URL? - } - - /// The amount left to be paid. This is equal to the cost of the line items, - /// taxes, and shipping, minus discounts and gift cards. - open var paymentDue: Storefront.MoneyV2 { - return internalGetPaymentDue() - } - - func internalGetPaymentDue(alias: String? = nil) -> Storefront.MoneyV2 { - return field(field: "paymentDue", aliasSuffix: alias) as! Storefront.MoneyV2 - } - - /// The amount left to be paid. This is equal to the cost of the line items, - /// duties, taxes, and shipping, minus discounts and gift cards. - @available(*, deprecated, message:"Use `paymentDue` instead.") - open var paymentDueV2: Storefront.MoneyV2 { - return internalGetPaymentDueV2() - } - - func internalGetPaymentDueV2(alias: String? = nil) -> Storefront.MoneyV2 { - return field(field: "paymentDueV2", aliasSuffix: alias) as! Storefront.MoneyV2 - } - - /// Whether or not the Checkout is ready and can be completed. Checkouts may - /// have asynchronous operations that can take time to finish. If you want to - /// complete a checkout or ensure all the fields are populated and up to date, - /// polling is required until the value is true. - open var ready: Bool { - return internalGetReady() - } - - func internalGetReady(alias: String? = nil) -> Bool { - return field(field: "ready", aliasSuffix: alias) as! Bool - } - - /// States whether or not the fulfillment requires shipping. - open var requiresShipping: Bool { - return internalGetRequiresShipping() - } - - func internalGetRequiresShipping(alias: String? = nil) -> Bool { - return field(field: "requiresShipping", aliasSuffix: alias) as! Bool - } - - /// The shipping address to where the line items will be shipped. - open var shippingAddress: Storefront.MailingAddress? { - return internalGetShippingAddress() - } - - func internalGetShippingAddress(alias: String? = nil) -> Storefront.MailingAddress? { - return field(field: "shippingAddress", aliasSuffix: alias) as! Storefront.MailingAddress? - } - - /// The discounts that have been allocated onto the shipping line by discount - /// applications. - open var shippingDiscountAllocations: [Storefront.DiscountAllocation] { - return internalGetShippingDiscountAllocations() - } - - func internalGetShippingDiscountAllocations(alias: String? = nil) -> [Storefront.DiscountAllocation] { - return field(field: "shippingDiscountAllocations", aliasSuffix: alias) as! [Storefront.DiscountAllocation] - } - - /// Once a shipping rate is selected by the customer it's transitioned to a - /// `shipping_line` object. - open var shippingLine: Storefront.ShippingRate? { - return internalGetShippingLine() - } - - func internalGetShippingLine(alias: String? = nil) -> Storefront.ShippingRate? { - return field(field: "shippingLine", aliasSuffix: alias) as! Storefront.ShippingRate? - } - - /// The price at checkout before shipping and taxes. - open var subtotalPrice: Storefront.MoneyV2 { - return internalGetSubtotalPrice() - } - - func internalGetSubtotalPrice(alias: String? = nil) -> Storefront.MoneyV2 { - return field(field: "subtotalPrice", aliasSuffix: alias) as! Storefront.MoneyV2 - } - - /// The price at checkout before duties, shipping, and taxes. - @available(*, deprecated, message:"Use `subtotalPrice` instead.") - open var subtotalPriceV2: Storefront.MoneyV2 { - return internalGetSubtotalPriceV2() - } - - func internalGetSubtotalPriceV2(alias: String? = nil) -> Storefront.MoneyV2 { - return field(field: "subtotalPriceV2", aliasSuffix: alias) as! Storefront.MoneyV2 - } - - /// Whether the checkout is tax exempt. - open var taxExempt: Bool { - return internalGetTaxExempt() - } - - func internalGetTaxExempt(alias: String? = nil) -> Bool { - return field(field: "taxExempt", aliasSuffix: alias) as! Bool - } - - /// Whether taxes are included in the line item and shipping line prices. - open var taxesIncluded: Bool { - return internalGetTaxesIncluded() - } - - func internalGetTaxesIncluded(alias: String? = nil) -> Bool { - return field(field: "taxesIncluded", aliasSuffix: alias) as! Bool - } - - /// The sum of all the duties applied to the line items in the checkout. - open var totalDuties: Storefront.MoneyV2? { - return internalGetTotalDuties() - } - - func internalGetTotalDuties(alias: String? = nil) -> Storefront.MoneyV2? { - return field(field: "totalDuties", aliasSuffix: alias) as! Storefront.MoneyV2? - } - - /// The sum of all the prices of all the items in the checkout, including taxes - /// and duties. - open var totalPrice: Storefront.MoneyV2 { - return internalGetTotalPrice() - } - - func internalGetTotalPrice(alias: String? = nil) -> Storefront.MoneyV2 { - return field(field: "totalPrice", aliasSuffix: alias) as! Storefront.MoneyV2 - } - - /// The sum of all the prices of all the items in the checkout, including taxes - /// and duties. - @available(*, deprecated, message:"Use `totalPrice` instead.") - open var totalPriceV2: Storefront.MoneyV2 { - return internalGetTotalPriceV2() - } - - func internalGetTotalPriceV2(alias: String? = nil) -> Storefront.MoneyV2 { - return field(field: "totalPriceV2", aliasSuffix: alias) as! Storefront.MoneyV2 - } - - /// The sum of all the taxes applied to the line items and shipping lines in - /// the checkout. - open var totalTax: Storefront.MoneyV2 { - return internalGetTotalTax() - } - - func internalGetTotalTax(alias: String? = nil) -> Storefront.MoneyV2 { - return field(field: "totalTax", aliasSuffix: alias) as! Storefront.MoneyV2 - } - - /// The sum of all the taxes applied to the line items and shipping lines in - /// the checkout. - @available(*, deprecated, message:"Use `totalTax` instead.") - open var totalTaxV2: Storefront.MoneyV2 { - return internalGetTotalTaxV2() - } - - func internalGetTotalTaxV2(alias: String? = nil) -> Storefront.MoneyV2 { - return field(field: "totalTaxV2", aliasSuffix: alias) as! Storefront.MoneyV2 - } - - /// The date and time when the checkout was last updated. - open var updatedAt: Date { - return internalGetUpdatedAt() - } - - func internalGetUpdatedAt(alias: String? = nil) -> Date { - return field(field: "updatedAt", aliasSuffix: alias) as! Date - } - - /// The url pointing to the checkout accessible from the web. - open var webUrl: URL { - return internalGetWebUrl() - } - - func internalGetWebUrl(alias: String? = nil) -> URL { - return field(field: "webUrl", aliasSuffix: alias) as! URL - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "appliedGiftCards": - internalGetAppliedGiftCards().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "availableShippingRates": - if let value = internalGetAvailableShippingRates() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "buyerIdentity": - response.append(internalGetBuyerIdentity()) - response.append(contentsOf: internalGetBuyerIdentity().childResponseObjectMap()) - - case "customAttributes": - internalGetCustomAttributes().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "discountApplications": - response.append(internalGetDiscountApplications()) - response.append(contentsOf: internalGetDiscountApplications().childResponseObjectMap()) - - case "lineItems": - response.append(internalGetLineItems()) - response.append(contentsOf: internalGetLineItems().childResponseObjectMap()) - - case "lineItemsSubtotalPrice": - response.append(internalGetLineItemsSubtotalPrice()) - response.append(contentsOf: internalGetLineItemsSubtotalPrice().childResponseObjectMap()) - - case "order": - if let value = internalGetOrder() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "paymentDue": - response.append(internalGetPaymentDue()) - response.append(contentsOf: internalGetPaymentDue().childResponseObjectMap()) - - case "paymentDueV2": - response.append(internalGetPaymentDueV2()) - response.append(contentsOf: internalGetPaymentDueV2().childResponseObjectMap()) - - case "shippingAddress": - if let value = internalGetShippingAddress() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "shippingDiscountAllocations": - internalGetShippingDiscountAllocations().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "shippingLine": - if let value = internalGetShippingLine() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "subtotalPrice": - response.append(internalGetSubtotalPrice()) - response.append(contentsOf: internalGetSubtotalPrice().childResponseObjectMap()) - - case "subtotalPriceV2": - response.append(internalGetSubtotalPriceV2()) - response.append(contentsOf: internalGetSubtotalPriceV2().childResponseObjectMap()) - - case "totalDuties": - if let value = internalGetTotalDuties() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "totalPrice": - response.append(internalGetTotalPrice()) - response.append(contentsOf: internalGetTotalPrice().childResponseObjectMap()) - - case "totalPriceV2": - response.append(internalGetTotalPriceV2()) - response.append(contentsOf: internalGetTotalPriceV2().childResponseObjectMap()) - - case "totalTax": - response.append(internalGetTotalTax()) - response.append(contentsOf: internalGetTotalTax().childResponseObjectMap()) - - case "totalTaxV2": - response.append(internalGetTotalTaxV2()) - response.append(contentsOf: internalGetTotalTaxV2().childResponseObjectMap()) - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutAttributesUpdateV2Input.swift b/Buy/Generated/Storefront/CheckoutAttributesUpdateV2Input.swift deleted file mode 100644 index ab187a92..00000000 --- a/Buy/Generated/Storefront/CheckoutAttributesUpdateV2Input.swift +++ /dev/null @@ -1,110 +0,0 @@ -// -// CheckoutAttributesUpdateV2Input.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// The input fields required to update a checkout's attributes. - open class CheckoutAttributesUpdateV2Input { - /// The text of an optional note that a shop owner can attach to the checkout. - open var note: Input - - /// A list of extra information that's added to the checkout. The input must - /// not contain more than `250` values. - open var customAttributes: Input<[AttributeInput]> - - /// Allows setting partial addresses on a Checkout, skipping the full - /// validation of attributes. The required attributes are city, province, and - /// country. Full validation of the addresses is still done at completion time. - /// Defaults to `false` with each operation. - open var allowPartialAddresses: Input - - /// Creates the input object. - /// - /// - parameters: - /// - note: The text of an optional note that a shop owner can attach to the checkout. - /// - customAttributes: A list of extra information that's added to the checkout. The input must not contain more than `250` values. - /// - allowPartialAddresses: Allows setting partial addresses on a Checkout, skipping the full validation of attributes. The required attributes are city, province, and country. Full validation of the addresses is still done at completion time. Defaults to `false` with each operation. - /// - public static func create(note: Input = .undefined, customAttributes: Input<[AttributeInput]> = .undefined, allowPartialAddresses: Input = .undefined) -> CheckoutAttributesUpdateV2Input { - return CheckoutAttributesUpdateV2Input(note: note, customAttributes: customAttributes, allowPartialAddresses: allowPartialAddresses) - } - - private init(note: Input = .undefined, customAttributes: Input<[AttributeInput]> = .undefined, allowPartialAddresses: Input = .undefined) { - self.note = note - self.customAttributes = customAttributes - self.allowPartialAddresses = allowPartialAddresses - } - - /// Creates the input object. - /// - /// - parameters: - /// - note: The text of an optional note that a shop owner can attach to the checkout. - /// - customAttributes: A list of extra information that's added to the checkout. The input must not contain more than `250` values. - /// - allowPartialAddresses: Allows setting partial addresses on a Checkout, skipping the full validation of attributes. The required attributes are city, province, and country. Full validation of the addresses is still done at completion time. Defaults to `false` with each operation. - /// - @available(*, deprecated, message: "Use the static create() method instead.") - public convenience init(note: String? = nil, customAttributes: [AttributeInput]? = nil, allowPartialAddresses: Bool? = nil) { - self.init(note: note.orUndefined, customAttributes: customAttributes.orUndefined, allowPartialAddresses: allowPartialAddresses.orUndefined) - } - - internal func serialize() -> String { - var fields: [String] = [] - - switch note { - case .value(let note): - guard let note = note else { - fields.append("note:null") - break - } - fields.append("note:\(GraphQL.quoteString(input: note))") - case .undefined: break - } - - switch customAttributes { - case .value(let customAttributes): - guard let customAttributes = customAttributes else { - fields.append("customAttributes:null") - break - } - fields.append("customAttributes:[\(customAttributes.map{ "\($0.serialize())" }.joined(separator: ","))]") - case .undefined: break - } - - switch allowPartialAddresses { - case .value(let allowPartialAddresses): - guard let allowPartialAddresses = allowPartialAddresses else { - fields.append("allowPartialAddresses:null") - break - } - fields.append("allowPartialAddresses:\(allowPartialAddresses)") - case .undefined: break - } - - return "{\(fields.joined(separator: ","))}" - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutAttributesUpdateV2Payload.swift b/Buy/Generated/Storefront/CheckoutAttributesUpdateV2Payload.swift deleted file mode 100644 index d82a2afc..00000000 --- a/Buy/Generated/Storefront/CheckoutAttributesUpdateV2Payload.swift +++ /dev/null @@ -1,154 +0,0 @@ -// -// CheckoutAttributesUpdateV2Payload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutAttributesUpdateV2` mutation. - open class CheckoutAttributesUpdateV2PayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutAttributesUpdateV2Payload - - /// The updated checkout object. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutAttributesUpdateV2PayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutAttributesUpdateV2PayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutAttributesUpdateV2PayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutAttributesUpdateV2` mutation. - open class CheckoutAttributesUpdateV2Payload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutAttributesUpdateV2PayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutAttributesUpdateV2Payload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutAttributesUpdateV2Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutAttributesUpdateV2Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutAttributesUpdateV2Payload.self, field: fieldName, value: fieldValue) - } - } - - /// The updated checkout object. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutCompleteFreePayload.swift b/Buy/Generated/Storefront/CheckoutCompleteFreePayload.swift deleted file mode 100644 index 965124ce..00000000 --- a/Buy/Generated/Storefront/CheckoutCompleteFreePayload.swift +++ /dev/null @@ -1,154 +0,0 @@ -// -// CheckoutCompleteFreePayload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutCompleteFree` mutation. - open class CheckoutCompleteFreePayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutCompleteFreePayload - - /// The updated checkout object. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutCompleteFreePayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutCompleteFreePayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutCompleteFreePayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutCompleteFree` mutation. - open class CheckoutCompleteFreePayload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutCompleteFreePayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutCompleteFreePayload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutCompleteFreePayload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutCompleteFreePayload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutCompleteFreePayload.self, field: fieldName, value: fieldValue) - } - } - - /// The updated checkout object. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutCompleteWithCreditCardV2Payload.swift b/Buy/Generated/Storefront/CheckoutCompleteWithCreditCardV2Payload.swift deleted file mode 100644 index df81dd16..00000000 --- a/Buy/Generated/Storefront/CheckoutCompleteWithCreditCardV2Payload.swift +++ /dev/null @@ -1,186 +0,0 @@ -// -// CheckoutCompleteWithCreditCardV2Payload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutCompleteWithCreditCardV2` mutation. - open class CheckoutCompleteWithCreditCardV2PayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutCompleteWithCreditCardV2Payload - - /// The checkout on which the payment was applied. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutCompleteWithCreditCardV2PayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutCompleteWithCreditCardV2PayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// A representation of the attempted payment. - @discardableResult - open func payment(alias: String? = nil, _ subfields: (PaymentQuery) -> Void) -> CheckoutCompleteWithCreditCardV2PayloadQuery { - let subquery = PaymentQuery() - subfields(subquery) - - addField(field: "payment", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutCompleteWithCreditCardV2PayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutCompleteWithCreditCardV2` mutation. - open class CheckoutCompleteWithCreditCardV2Payload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutCompleteWithCreditCardV2PayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutCompleteWithCreditCardV2Payload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutCompleteWithCreditCardV2Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "payment": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutCompleteWithCreditCardV2Payload.self, field: fieldName, value: fieldValue) - } - return try Payment(fields: value) - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutCompleteWithCreditCardV2Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutCompleteWithCreditCardV2Payload.self, field: fieldName, value: fieldValue) - } - } - - /// The checkout on which the payment was applied. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// A representation of the attempted payment. - open var payment: Storefront.Payment? { - return internalGetPayment() - } - - func internalGetPayment(alias: String? = nil) -> Storefront.Payment? { - return field(field: "payment", aliasSuffix: alias) as! Storefront.Payment? - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "payment": - if let value = internalGetPayment() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutCompleteWithTokenizedPaymentV3Payload.swift b/Buy/Generated/Storefront/CheckoutCompleteWithTokenizedPaymentV3Payload.swift deleted file mode 100644 index 4945027e..00000000 --- a/Buy/Generated/Storefront/CheckoutCompleteWithTokenizedPaymentV3Payload.swift +++ /dev/null @@ -1,186 +0,0 @@ -// -// CheckoutCompleteWithTokenizedPaymentV3Payload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutCompleteWithTokenizedPaymentV3` mutation. - open class CheckoutCompleteWithTokenizedPaymentV3PayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutCompleteWithTokenizedPaymentV3Payload - - /// The checkout on which the payment was applied. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutCompleteWithTokenizedPaymentV3PayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutCompleteWithTokenizedPaymentV3PayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// A representation of the attempted payment. - @discardableResult - open func payment(alias: String? = nil, _ subfields: (PaymentQuery) -> Void) -> CheckoutCompleteWithTokenizedPaymentV3PayloadQuery { - let subquery = PaymentQuery() - subfields(subquery) - - addField(field: "payment", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutCompleteWithTokenizedPaymentV3PayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutCompleteWithTokenizedPaymentV3` mutation. - open class CheckoutCompleteWithTokenizedPaymentV3Payload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutCompleteWithTokenizedPaymentV3PayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutCompleteWithTokenizedPaymentV3Payload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutCompleteWithTokenizedPaymentV3Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "payment": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutCompleteWithTokenizedPaymentV3Payload.self, field: fieldName, value: fieldValue) - } - return try Payment(fields: value) - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutCompleteWithTokenizedPaymentV3Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutCompleteWithTokenizedPaymentV3Payload.self, field: fieldName, value: fieldValue) - } - } - - /// The checkout on which the payment was applied. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// A representation of the attempted payment. - open var payment: Storefront.Payment? { - return internalGetPayment() - } - - func internalGetPayment(alias: String? = nil) -> Storefront.Payment? { - return field(field: "payment", aliasSuffix: alias) as! Storefront.Payment? - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "payment": - if let value = internalGetPayment() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutCreateInput.swift b/Buy/Generated/Storefront/CheckoutCreateInput.swift deleted file mode 100644 index ae7fb52a..00000000 --- a/Buy/Generated/Storefront/CheckoutCreateInput.swift +++ /dev/null @@ -1,194 +0,0 @@ -// -// CheckoutCreateInput.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// The input fields required to create a checkout. - open class CheckoutCreateInput { - /// The email with which the customer wants to checkout. - open var email: Input - - /// A list of line item objects, each one containing information about an item - /// in the checkout. The input must not contain more than `250` values. - open var lineItems: Input<[CheckoutLineItemInput]> - - /// The shipping address to where the line items will be shipped. - open var shippingAddress: Input - - /// The text of an optional note that a shop owner can attach to the checkout. - open var note: Input - - /// A list of extra information that's added to the checkout. The input must - /// not contain more than `250` values. - open var customAttributes: Input<[AttributeInput]> - - /// Allows setting partial addresses on a Checkout, skipping the full - /// validation of attributes. The required attributes are city, province, and - /// country. Full validation of addresses is still done at completion time. - /// Defaults to `null`. - open var allowPartialAddresses: Input - - /// The three-letter currency code of one of the shop's enabled presentment - /// currencies. Including this field creates a checkout in the specified - /// currency. By default, new checkouts are created in the shop's primary - /// currency. - open var presentmentCurrencyCode: Input - - /// The identity of the customer associated with the checkout. - open var buyerIdentity: Input - - /// Creates the input object. - /// - /// - parameters: - /// - email: The email with which the customer wants to checkout. - /// - lineItems: A list of line item objects, each one containing information about an item in the checkout. The input must not contain more than `250` values. - /// - shippingAddress: The shipping address to where the line items will be shipped. - /// - note: The text of an optional note that a shop owner can attach to the checkout. - /// - customAttributes: A list of extra information that's added to the checkout. The input must not contain more than `250` values. - /// - allowPartialAddresses: Allows setting partial addresses on a Checkout, skipping the full validation of attributes. The required attributes are city, province, and country. Full validation of addresses is still done at completion time. Defaults to `null`. - /// - presentmentCurrencyCode: The three-letter currency code of one of the shop's enabled presentment currencies. Including this field creates a checkout in the specified currency. By default, new checkouts are created in the shop's primary currency. - /// - buyerIdentity: The identity of the customer associated with the checkout. - /// - public static func create(email: Input = .undefined, lineItems: Input<[CheckoutLineItemInput]> = .undefined, shippingAddress: Input = .undefined, note: Input = .undefined, customAttributes: Input<[AttributeInput]> = .undefined, allowPartialAddresses: Input = .undefined, presentmentCurrencyCode: Input = .undefined, buyerIdentity: Input = .undefined) -> CheckoutCreateInput { - return CheckoutCreateInput(email: email, lineItems: lineItems, shippingAddress: shippingAddress, note: note, customAttributes: customAttributes, allowPartialAddresses: allowPartialAddresses, presentmentCurrencyCode: presentmentCurrencyCode, buyerIdentity: buyerIdentity) - } - - private init(email: Input = .undefined, lineItems: Input<[CheckoutLineItemInput]> = .undefined, shippingAddress: Input = .undefined, note: Input = .undefined, customAttributes: Input<[AttributeInput]> = .undefined, allowPartialAddresses: Input = .undefined, presentmentCurrencyCode: Input = .undefined, buyerIdentity: Input = .undefined) { - self.email = email - self.lineItems = lineItems - self.shippingAddress = shippingAddress - self.note = note - self.customAttributes = customAttributes - self.allowPartialAddresses = allowPartialAddresses - self.presentmentCurrencyCode = presentmentCurrencyCode - self.buyerIdentity = buyerIdentity - } - - /// Creates the input object. - /// - /// - parameters: - /// - email: The email with which the customer wants to checkout. - /// - lineItems: A list of line item objects, each one containing information about an item in the checkout. The input must not contain more than `250` values. - /// - shippingAddress: The shipping address to where the line items will be shipped. - /// - note: The text of an optional note that a shop owner can attach to the checkout. - /// - customAttributes: A list of extra information that's added to the checkout. The input must not contain more than `250` values. - /// - allowPartialAddresses: Allows setting partial addresses on a Checkout, skipping the full validation of attributes. The required attributes are city, province, and country. Full validation of addresses is still done at completion time. Defaults to `null`. - /// - presentmentCurrencyCode: The three-letter currency code of one of the shop's enabled presentment currencies. Including this field creates a checkout in the specified currency. By default, new checkouts are created in the shop's primary currency. - /// - buyerIdentity: The identity of the customer associated with the checkout. - /// - @available(*, deprecated, message: "Use the static create() method instead.") - public convenience init(email: String? = nil, lineItems: [CheckoutLineItemInput]? = nil, shippingAddress: MailingAddressInput? = nil, note: String? = nil, customAttributes: [AttributeInput]? = nil, allowPartialAddresses: Bool? = nil, presentmentCurrencyCode: CurrencyCode? = nil, buyerIdentity: CheckoutBuyerIdentityInput? = nil) { - self.init(email: email.orUndefined, lineItems: lineItems.orUndefined, shippingAddress: shippingAddress.orUndefined, note: note.orUndefined, customAttributes: customAttributes.orUndefined, allowPartialAddresses: allowPartialAddresses.orUndefined, presentmentCurrencyCode: presentmentCurrencyCode.orUndefined, buyerIdentity: buyerIdentity.orUndefined) - } - - internal func serialize() -> String { - var fields: [String] = [] - - switch email { - case .value(let email): - guard let email = email else { - fields.append("email:null") - break - } - fields.append("email:\(GraphQL.quoteString(input: email))") - case .undefined: break - } - - switch lineItems { - case .value(let lineItems): - guard let lineItems = lineItems else { - fields.append("lineItems:null") - break - } - fields.append("lineItems:[\(lineItems.map{ "\($0.serialize())" }.joined(separator: ","))]") - case .undefined: break - } - - switch shippingAddress { - case .value(let shippingAddress): - guard let shippingAddress = shippingAddress else { - fields.append("shippingAddress:null") - break - } - fields.append("shippingAddress:\(shippingAddress.serialize())") - case .undefined: break - } - - switch note { - case .value(let note): - guard let note = note else { - fields.append("note:null") - break - } - fields.append("note:\(GraphQL.quoteString(input: note))") - case .undefined: break - } - - switch customAttributes { - case .value(let customAttributes): - guard let customAttributes = customAttributes else { - fields.append("customAttributes:null") - break - } - fields.append("customAttributes:[\(customAttributes.map{ "\($0.serialize())" }.joined(separator: ","))]") - case .undefined: break - } - - switch allowPartialAddresses { - case .value(let allowPartialAddresses): - guard let allowPartialAddresses = allowPartialAddresses else { - fields.append("allowPartialAddresses:null") - break - } - fields.append("allowPartialAddresses:\(allowPartialAddresses)") - case .undefined: break - } - - switch presentmentCurrencyCode { - case .value(let presentmentCurrencyCode): - guard let presentmentCurrencyCode = presentmentCurrencyCode else { - fields.append("presentmentCurrencyCode:null") - break - } - fields.append("presentmentCurrencyCode:\(presentmentCurrencyCode.rawValue)") - case .undefined: break - } - - switch buyerIdentity { - case .value(let buyerIdentity): - guard let buyerIdentity = buyerIdentity else { - fields.append("buyerIdentity:null") - break - } - fields.append("buyerIdentity:\(buyerIdentity.serialize())") - case .undefined: break - } - - return "{\(fields.joined(separator: ","))}" - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutCreatePayload.swift b/Buy/Generated/Storefront/CheckoutCreatePayload.swift deleted file mode 100644 index d4d4915d..00000000 --- a/Buy/Generated/Storefront/CheckoutCreatePayload.swift +++ /dev/null @@ -1,177 +0,0 @@ -// -// CheckoutCreatePayload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutCreate` mutation. - open class CheckoutCreatePayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutCreatePayload - - /// The new checkout object. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutCreatePayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutCreatePayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The checkout queue token. Available only to selected stores. - @discardableResult - open func queueToken(alias: String? = nil) -> CheckoutCreatePayloadQuery { - addField(field: "queueToken", aliasSuffix: alias) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutCreatePayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutCreate` mutation. - open class CheckoutCreatePayload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutCreatePayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutCreatePayload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutCreatePayload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "queueToken": - if value is NSNull { return nil } - guard let value = value as? String else { - throw SchemaViolationError(type: CheckoutCreatePayload.self, field: fieldName, value: fieldValue) - } - return value - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutCreatePayload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutCreatePayload.self, field: fieldName, value: fieldValue) - } - } - - /// The new checkout object. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// The checkout queue token. Available only to selected stores. - open var queueToken: String? { - return internalGetQueueToken() - } - - func internalGetQueueToken(alias: String? = nil) -> String? { - return field(field: "queueToken", aliasSuffix: alias) as! String? - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutCustomerAssociateV2Payload.swift b/Buy/Generated/Storefront/CheckoutCustomerAssociateV2Payload.swift deleted file mode 100644 index 76c456c3..00000000 --- a/Buy/Generated/Storefront/CheckoutCustomerAssociateV2Payload.swift +++ /dev/null @@ -1,186 +0,0 @@ -// -// CheckoutCustomerAssociateV2Payload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutCustomerAssociateV2` mutation. - open class CheckoutCustomerAssociateV2PayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutCustomerAssociateV2Payload - - /// The updated checkout object. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutCustomerAssociateV2PayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutCustomerAssociateV2PayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The associated customer object. - @discardableResult - open func customer(alias: String? = nil, _ subfields: (CustomerQuery) -> Void) -> CheckoutCustomerAssociateV2PayloadQuery { - let subquery = CustomerQuery() - subfields(subquery) - - addField(field: "customer", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutCustomerAssociateV2PayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutCustomerAssociateV2` mutation. - open class CheckoutCustomerAssociateV2Payload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutCustomerAssociateV2PayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutCustomerAssociateV2Payload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutCustomerAssociateV2Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "customer": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutCustomerAssociateV2Payload.self, field: fieldName, value: fieldValue) - } - return try Customer(fields: value) - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutCustomerAssociateV2Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutCustomerAssociateV2Payload.self, field: fieldName, value: fieldValue) - } - } - - /// The updated checkout object. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// The associated customer object. - open var customer: Storefront.Customer? { - return internalGetCustomer() - } - - func internalGetCustomer(alias: String? = nil) -> Storefront.Customer? { - return field(field: "customer", aliasSuffix: alias) as! Storefront.Customer? - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "customer": - if let value = internalGetCustomer() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutCustomerDisassociateV2Payload.swift b/Buy/Generated/Storefront/CheckoutCustomerDisassociateV2Payload.swift deleted file mode 100644 index 939bde28..00000000 --- a/Buy/Generated/Storefront/CheckoutCustomerDisassociateV2Payload.swift +++ /dev/null @@ -1,154 +0,0 @@ -// -// CheckoutCustomerDisassociateV2Payload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutCustomerDisassociateV2` mutation. - open class CheckoutCustomerDisassociateV2PayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutCustomerDisassociateV2Payload - - /// The updated checkout object. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutCustomerDisassociateV2PayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutCustomerDisassociateV2PayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutCustomerDisassociateV2PayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutCustomerDisassociateV2` mutation. - open class CheckoutCustomerDisassociateV2Payload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutCustomerDisassociateV2PayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutCustomerDisassociateV2Payload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutCustomerDisassociateV2Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutCustomerDisassociateV2Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutCustomerDisassociateV2Payload.self, field: fieldName, value: fieldValue) - } - } - - /// The updated checkout object. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutDiscountCodeApplyV2Payload.swift b/Buy/Generated/Storefront/CheckoutDiscountCodeApplyV2Payload.swift deleted file mode 100644 index c6609126..00000000 --- a/Buy/Generated/Storefront/CheckoutDiscountCodeApplyV2Payload.swift +++ /dev/null @@ -1,154 +0,0 @@ -// -// CheckoutDiscountCodeApplyV2Payload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutDiscountCodeApplyV2` mutation. - open class CheckoutDiscountCodeApplyV2PayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutDiscountCodeApplyV2Payload - - /// The updated checkout object. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutDiscountCodeApplyV2PayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutDiscountCodeApplyV2PayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutDiscountCodeApplyV2PayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutDiscountCodeApplyV2` mutation. - open class CheckoutDiscountCodeApplyV2Payload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutDiscountCodeApplyV2PayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutDiscountCodeApplyV2Payload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutDiscountCodeApplyV2Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutDiscountCodeApplyV2Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutDiscountCodeApplyV2Payload.self, field: fieldName, value: fieldValue) - } - } - - /// The updated checkout object. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutDiscountCodeRemovePayload.swift b/Buy/Generated/Storefront/CheckoutDiscountCodeRemovePayload.swift deleted file mode 100644 index 05cc80f0..00000000 --- a/Buy/Generated/Storefront/CheckoutDiscountCodeRemovePayload.swift +++ /dev/null @@ -1,154 +0,0 @@ -// -// CheckoutDiscountCodeRemovePayload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutDiscountCodeRemove` mutation. - open class CheckoutDiscountCodeRemovePayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutDiscountCodeRemovePayload - - /// The updated checkout object. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutDiscountCodeRemovePayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutDiscountCodeRemovePayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutDiscountCodeRemovePayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutDiscountCodeRemove` mutation. - open class CheckoutDiscountCodeRemovePayload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutDiscountCodeRemovePayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutDiscountCodeRemovePayload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutDiscountCodeRemovePayload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutDiscountCodeRemovePayload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutDiscountCodeRemovePayload.self, field: fieldName, value: fieldValue) - } - } - - /// The updated checkout object. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutEmailUpdateV2Payload.swift b/Buy/Generated/Storefront/CheckoutEmailUpdateV2Payload.swift deleted file mode 100644 index b1002ff4..00000000 --- a/Buy/Generated/Storefront/CheckoutEmailUpdateV2Payload.swift +++ /dev/null @@ -1,154 +0,0 @@ -// -// CheckoutEmailUpdateV2Payload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutEmailUpdateV2` mutation. - open class CheckoutEmailUpdateV2PayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutEmailUpdateV2Payload - - /// The checkout object with the updated email. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutEmailUpdateV2PayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutEmailUpdateV2PayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutEmailUpdateV2PayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutEmailUpdateV2` mutation. - open class CheckoutEmailUpdateV2Payload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutEmailUpdateV2PayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutEmailUpdateV2Payload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutEmailUpdateV2Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutEmailUpdateV2Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutEmailUpdateV2Payload.self, field: fieldName, value: fieldValue) - } - } - - /// The checkout object with the updated email. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutErrorCode.swift b/Buy/Generated/Storefront/CheckoutErrorCode.swift deleted file mode 100644 index f3670d4c..00000000 --- a/Buy/Generated/Storefront/CheckoutErrorCode.swift +++ /dev/null @@ -1,173 +0,0 @@ -// -// CheckoutErrorCode.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Possible error codes that can be returned by `CheckoutUserError`. - public enum CheckoutErrorCode: String { - /// Checkout is already completed. - case alreadyCompleted = "ALREADY_COMPLETED" - - /// Input email contains an invalid domain name. - case badDomain = "BAD_DOMAIN" - - /// The input value is blank. - case blank = "BLANK" - - /// Cart does not meet discount requirements notice. - case cartDoesNotMeetDiscountRequirementsNotice = "CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE" - - /// Customer already used once per customer discount notice. - case customerAlreadyUsedOncePerCustomerDiscountNotice = "CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE" - - /// Discount already applied. - case discountAlreadyApplied = "DISCOUNT_ALREADY_APPLIED" - - /// Discount code isn't working right now. Please contact us for help. - case discountCodeApplicationFailed = "DISCOUNT_CODE_APPLICATION_FAILED" - - /// Discount disabled. - case discountDisabled = "DISCOUNT_DISABLED" - - /// Discount expired. - case discountExpired = "DISCOUNT_EXPIRED" - - /// Discount limit reached. - case discountLimitReached = "DISCOUNT_LIMIT_REACHED" - - /// Discount not found. - case discountNotFound = "DISCOUNT_NOT_FOUND" - - /// Checkout is already completed. - case empty = "EMPTY" - - /// Queue token has expired. - case expiredQueueToken = "EXPIRED_QUEUE_TOKEN" - - /// Gift card has already been applied. - case giftCardAlreadyApplied = "GIFT_CARD_ALREADY_APPLIED" - - /// Gift card code is invalid. - case giftCardCodeInvalid = "GIFT_CARD_CODE_INVALID" - - /// Gift card currency does not match checkout currency. - case giftCardCurrencyMismatch = "GIFT_CARD_CURRENCY_MISMATCH" - - /// Gift card has no funds left. - case giftCardDepleted = "GIFT_CARD_DEPLETED" - - /// Gift card is disabled. - case giftCardDisabled = "GIFT_CARD_DISABLED" - - /// Gift card is expired. - case giftCardExpired = "GIFT_CARD_EXPIRED" - - /// Gift card was not found. - case giftCardNotFound = "GIFT_CARD_NOT_FOUND" - - /// Gift card cannot be applied to a checkout that contains a gift card. - case giftCardUnusable = "GIFT_CARD_UNUSABLE" - - /// The input value should be greater than or equal to the minimum value - /// allowed. - case greaterThanOrEqualTo = "GREATER_THAN_OR_EQUAL_TO" - - /// Higher value discount applied. - case higherValueDiscountApplied = "HIGHER_VALUE_DISCOUNT_APPLIED" - - /// The input value is invalid. - case invalid = "INVALID" - - /// Cannot specify country and presentment currency code. - case invalidCountryAndCurrency = "INVALID_COUNTRY_AND_CURRENCY" - - /// Input Zip is invalid for country provided. - case invalidForCountry = "INVALID_FOR_COUNTRY" - - /// Input Zip is invalid for country and province provided. - case invalidForCountryAndProvince = "INVALID_FOR_COUNTRY_AND_PROVINCE" - - /// Invalid province in country. - case invalidProvinceInCountry = "INVALID_PROVINCE_IN_COUNTRY" - - /// Queue token is invalid. - case invalidQueueToken = "INVALID_QUEUE_TOKEN" - - /// Invalid region in country. - case invalidRegionInCountry = "INVALID_REGION_IN_COUNTRY" - - /// Invalid state in country. - case invalidStateInCountry = "INVALID_STATE_IN_COUNTRY" - - /// The input value should be less than the maximum value allowed. - case lessThan = "LESS_THAN" - - /// The input value should be less than or equal to the maximum value allowed. - case lessThanOrEqualTo = "LESS_THAN_OR_EQUAL_TO" - - /// Line item was not found in checkout. - case lineItemNotFound = "LINE_ITEM_NOT_FOUND" - - /// Checkout is locked. - case locked = "LOCKED" - - /// Maximum number of discount codes limit reached. - case maximumDiscountCodeLimitReached = "MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED" - - /// Missing payment input. - case missingPaymentInput = "MISSING_PAYMENT_INPUT" - - /// Not enough in stock. - case notEnoughInStock = "NOT_ENOUGH_IN_STOCK" - - /// Input value is not supported. - case notSupported = "NOT_SUPPORTED" - - /// The input value needs to be blank. - case present = "PRESENT" - - /// Product is not published for this customer. - case productNotAvailable = "PRODUCT_NOT_AVAILABLE" - - /// Shipping rate expired. - case shippingRateExpired = "SHIPPING_RATE_EXPIRED" - - /// Throttled during checkout. - case throttledDuringCheckout = "THROTTLED_DURING_CHECKOUT" - - /// The input value is too long. - case tooLong = "TOO_LONG" - - /// The amount of the payment does not match the value to be paid. - case totalPriceMismatch = "TOTAL_PRICE_MISMATCH" - - /// Unable to apply discount. - case unableToApply = "UNABLE_TO_APPLY" - - case unknownValue = "" - } -} diff --git a/Buy/Generated/Storefront/CheckoutGiftCardRemoveV2Payload.swift b/Buy/Generated/Storefront/CheckoutGiftCardRemoveV2Payload.swift deleted file mode 100644 index 1d9e3450..00000000 --- a/Buy/Generated/Storefront/CheckoutGiftCardRemoveV2Payload.swift +++ /dev/null @@ -1,154 +0,0 @@ -// -// CheckoutGiftCardRemoveV2Payload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutGiftCardRemoveV2` mutation. - open class CheckoutGiftCardRemoveV2PayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutGiftCardRemoveV2Payload - - /// The updated checkout object. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutGiftCardRemoveV2PayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutGiftCardRemoveV2PayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutGiftCardRemoveV2PayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutGiftCardRemoveV2` mutation. - open class CheckoutGiftCardRemoveV2Payload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutGiftCardRemoveV2PayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutGiftCardRemoveV2Payload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutGiftCardRemoveV2Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutGiftCardRemoveV2Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutGiftCardRemoveV2Payload.self, field: fieldName, value: fieldValue) - } - } - - /// The updated checkout object. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutGiftCardsAppendPayload.swift b/Buy/Generated/Storefront/CheckoutGiftCardsAppendPayload.swift deleted file mode 100644 index 01fc49d9..00000000 --- a/Buy/Generated/Storefront/CheckoutGiftCardsAppendPayload.swift +++ /dev/null @@ -1,154 +0,0 @@ -// -// CheckoutGiftCardsAppendPayload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutGiftCardsAppend` mutation. - open class CheckoutGiftCardsAppendPayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutGiftCardsAppendPayload - - /// The updated checkout object. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutGiftCardsAppendPayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutGiftCardsAppendPayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutGiftCardsAppendPayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutGiftCardsAppend` mutation. - open class CheckoutGiftCardsAppendPayload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutGiftCardsAppendPayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutGiftCardsAppendPayload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutGiftCardsAppendPayload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutGiftCardsAppendPayload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutGiftCardsAppendPayload.self, field: fieldName, value: fieldValue) - } - } - - /// The updated checkout object. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutLineItem.swift b/Buy/Generated/Storefront/CheckoutLineItem.swift deleted file mode 100644 index 15e03bcf..00000000 --- a/Buy/Generated/Storefront/CheckoutLineItem.swift +++ /dev/null @@ -1,254 +0,0 @@ -// -// CheckoutLineItem.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// A single line item in the checkout, grouped by variant and attributes. - open class CheckoutLineItemQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutLineItem - - /// Extra information in the form of an array of Key-Value pairs about the line - /// item. - @discardableResult - open func customAttributes(alias: String? = nil, _ subfields: (AttributeQuery) -> Void) -> CheckoutLineItemQuery { - let subquery = AttributeQuery() - subfields(subquery) - - addField(field: "customAttributes", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The discounts that have been allocated onto the checkout line item by - /// discount applications. - @discardableResult - open func discountAllocations(alias: String? = nil, _ subfields: (DiscountAllocationQuery) -> Void) -> CheckoutLineItemQuery { - let subquery = DiscountAllocationQuery() - subfields(subquery) - - addField(field: "discountAllocations", aliasSuffix: alias, subfields: subquery) - return self - } - - /// A globally-unique ID. - @discardableResult - open func id(alias: String? = nil) -> CheckoutLineItemQuery { - addField(field: "id", aliasSuffix: alias) - return self - } - - /// The quantity of the line item. - @discardableResult - open func quantity(alias: String? = nil) -> CheckoutLineItemQuery { - addField(field: "quantity", aliasSuffix: alias) - return self - } - - /// Title of the line item. Defaults to the product's title. - @discardableResult - open func title(alias: String? = nil) -> CheckoutLineItemQuery { - addField(field: "title", aliasSuffix: alias) - return self - } - - /// Unit price of the line item. - @discardableResult - open func unitPrice(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> CheckoutLineItemQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "unitPrice", aliasSuffix: alias, subfields: subquery) - return self - } - - /// Product variant of the line item. - @discardableResult - open func variant(alias: String? = nil, _ subfields: (ProductVariantQuery) -> Void) -> CheckoutLineItemQuery { - let subquery = ProductVariantQuery() - subfields(subquery) - - addField(field: "variant", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// A single line item in the checkout, grouped by variant and attributes. - open class CheckoutLineItem: GraphQL.AbstractResponse, GraphQLObject, Node { - public typealias Query = CheckoutLineItemQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "customAttributes": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutLineItem.self, field: fieldName, value: fieldValue) - } - return try value.map { return try Attribute(fields: $0) } - - case "discountAllocations": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutLineItem.self, field: fieldName, value: fieldValue) - } - return try value.map { return try DiscountAllocation(fields: $0) } - - case "id": - guard let value = value as? String else { - throw SchemaViolationError(type: CheckoutLineItem.self, field: fieldName, value: fieldValue) - } - return GraphQL.ID(rawValue: value) - - case "quantity": - guard let value = value as? Int else { - throw SchemaViolationError(type: CheckoutLineItem.self, field: fieldName, value: fieldValue) - } - return Int32(value) - - case "title": - guard let value = value as? String else { - throw SchemaViolationError(type: CheckoutLineItem.self, field: fieldName, value: fieldValue) - } - return value - - case "unitPrice": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutLineItem.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "variant": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutLineItem.self, field: fieldName, value: fieldValue) - } - return try ProductVariant(fields: value) - - default: - throw SchemaViolationError(type: CheckoutLineItem.self, field: fieldName, value: fieldValue) - } - } - - /// Extra information in the form of an array of Key-Value pairs about the line - /// item. - open var customAttributes: [Storefront.Attribute] { - return internalGetCustomAttributes() - } - - func internalGetCustomAttributes(alias: String? = nil) -> [Storefront.Attribute] { - return field(field: "customAttributes", aliasSuffix: alias) as! [Storefront.Attribute] - } - - /// The discounts that have been allocated onto the checkout line item by - /// discount applications. - open var discountAllocations: [Storefront.DiscountAllocation] { - return internalGetDiscountAllocations() - } - - func internalGetDiscountAllocations(alias: String? = nil) -> [Storefront.DiscountAllocation] { - return field(field: "discountAllocations", aliasSuffix: alias) as! [Storefront.DiscountAllocation] - } - - /// A globally-unique ID. - open var id: GraphQL.ID { - return internalGetId() - } - - func internalGetId(alias: String? = nil) -> GraphQL.ID { - return field(field: "id", aliasSuffix: alias) as! GraphQL.ID - } - - /// The quantity of the line item. - open var quantity: Int32 { - return internalGetQuantity() - } - - func internalGetQuantity(alias: String? = nil) -> Int32 { - return field(field: "quantity", aliasSuffix: alias) as! Int32 - } - - /// Title of the line item. Defaults to the product's title. - open var title: String { - return internalGetTitle() - } - - func internalGetTitle(alias: String? = nil) -> String { - return field(field: "title", aliasSuffix: alias) as! String - } - - /// Unit price of the line item. - open var unitPrice: Storefront.MoneyV2? { - return internalGetUnitPrice() - } - - func internalGetUnitPrice(alias: String? = nil) -> Storefront.MoneyV2? { - return field(field: "unitPrice", aliasSuffix: alias) as! Storefront.MoneyV2? - } - - /// Product variant of the line item. - open var variant: Storefront.ProductVariant? { - return internalGetVariant() - } - - func internalGetVariant(alias: String? = nil) -> Storefront.ProductVariant? { - return field(field: "variant", aliasSuffix: alias) as! Storefront.ProductVariant? - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "customAttributes": - internalGetCustomAttributes().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "discountAllocations": - internalGetDiscountAllocations().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "unitPrice": - if let value = internalGetUnitPrice() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "variant": - if let value = internalGetVariant() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutLineItemInput.swift b/Buy/Generated/Storefront/CheckoutLineItemInput.swift deleted file mode 100644 index d9c6ce34..00000000 --- a/Buy/Generated/Storefront/CheckoutLineItemInput.swift +++ /dev/null @@ -1,91 +0,0 @@ -// -// CheckoutLineItemInput.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// The input fields to create a line item on a checkout. - open class CheckoutLineItemInput { - /// Extra information in the form of an array of Key-Value pairs about the line - /// item. The input must not contain more than `250` values. - open var customAttributes: Input<[AttributeInput]> - - /// The quantity of the line item. - open var quantity: Int32 - - /// The ID of the product variant for the line item. - open var variantId: GraphQL.ID - - /// Creates the input object. - /// - /// - parameters: - /// - customAttributes: Extra information in the form of an array of Key-Value pairs about the line item. The input must not contain more than `250` values. - /// - quantity: The quantity of the line item. - /// - variantId: The ID of the product variant for the line item. - /// - public static func create(quantity: Int32, variantId: GraphQL.ID, customAttributes: Input<[AttributeInput]> = .undefined) -> CheckoutLineItemInput { - return CheckoutLineItemInput(quantity: quantity, variantId: variantId, customAttributes: customAttributes) - } - - private init(quantity: Int32, variantId: GraphQL.ID, customAttributes: Input<[AttributeInput]> = .undefined) { - self.customAttributes = customAttributes - self.quantity = quantity - self.variantId = variantId - } - - /// Creates the input object. - /// - /// - parameters: - /// - customAttributes: Extra information in the form of an array of Key-Value pairs about the line item. The input must not contain more than `250` values. - /// - quantity: The quantity of the line item. - /// - variantId: The ID of the product variant for the line item. - /// - @available(*, deprecated, message: "Use the static create() method instead.") - public convenience init(quantity: Int32, variantId: GraphQL.ID, customAttributes: [AttributeInput]? = nil) { - self.init(quantity: quantity, variantId: variantId, customAttributes: customAttributes.orUndefined) - } - - internal func serialize() -> String { - var fields: [String] = [] - - switch customAttributes { - case .value(let customAttributes): - guard let customAttributes = customAttributes else { - fields.append("customAttributes:null") - break - } - fields.append("customAttributes:[\(customAttributes.map{ "\($0.serialize())" }.joined(separator: ","))]") - case .undefined: break - } - - fields.append("quantity:\(quantity)") - - fields.append("variantId:\(GraphQL.quoteString(input: "\(variantId.rawValue)"))") - - return "{\(fields.joined(separator: ","))}" - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutLineItemUpdateInput.swift b/Buy/Generated/Storefront/CheckoutLineItemUpdateInput.swift deleted file mode 100644 index 127e49cc..00000000 --- a/Buy/Generated/Storefront/CheckoutLineItemUpdateInput.swift +++ /dev/null @@ -1,123 +0,0 @@ -// -// CheckoutLineItemUpdateInput.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// The input fields to update a line item on the checkout. - open class CheckoutLineItemUpdateInput { - /// The ID of the line item. - open var id: Input - - /// The variant ID of the line item. - open var variantId: Input - - /// The quantity of the line item. - open var quantity: Input - - /// Extra information in the form of an array of Key-Value pairs about the line - /// item. The input must not contain more than `250` values. - open var customAttributes: Input<[AttributeInput]> - - /// Creates the input object. - /// - /// - parameters: - /// - id: The ID of the line item. - /// - variantId: The variant ID of the line item. - /// - quantity: The quantity of the line item. - /// - customAttributes: Extra information in the form of an array of Key-Value pairs about the line item. The input must not contain more than `250` values. - /// - public static func create(id: Input = .undefined, variantId: Input = .undefined, quantity: Input = .undefined, customAttributes: Input<[AttributeInput]> = .undefined) -> CheckoutLineItemUpdateInput { - return CheckoutLineItemUpdateInput(id: id, variantId: variantId, quantity: quantity, customAttributes: customAttributes) - } - - private init(id: Input = .undefined, variantId: Input = .undefined, quantity: Input = .undefined, customAttributes: Input<[AttributeInput]> = .undefined) { - self.id = id - self.variantId = variantId - self.quantity = quantity - self.customAttributes = customAttributes - } - - /// Creates the input object. - /// - /// - parameters: - /// - id: The ID of the line item. - /// - variantId: The variant ID of the line item. - /// - quantity: The quantity of the line item. - /// - customAttributes: Extra information in the form of an array of Key-Value pairs about the line item. The input must not contain more than `250` values. - /// - @available(*, deprecated, message: "Use the static create() method instead.") - public convenience init(id: GraphQL.ID? = nil, variantId: GraphQL.ID? = nil, quantity: Int32? = nil, customAttributes: [AttributeInput]? = nil) { - self.init(id: id.orUndefined, variantId: variantId.orUndefined, quantity: quantity.orUndefined, customAttributes: customAttributes.orUndefined) - } - - internal func serialize() -> String { - var fields: [String] = [] - - switch id { - case .value(let id): - guard let id = id else { - fields.append("id:null") - break - } - fields.append("id:\(GraphQL.quoteString(input: "\(id.rawValue)"))") - case .undefined: break - } - - switch variantId { - case .value(let variantId): - guard let variantId = variantId else { - fields.append("variantId:null") - break - } - fields.append("variantId:\(GraphQL.quoteString(input: "\(variantId.rawValue)"))") - case .undefined: break - } - - switch quantity { - case .value(let quantity): - guard let quantity = quantity else { - fields.append("quantity:null") - break - } - fields.append("quantity:\(quantity)") - case .undefined: break - } - - switch customAttributes { - case .value(let customAttributes): - guard let customAttributes = customAttributes else { - fields.append("customAttributes:null") - break - } - fields.append("customAttributes:[\(customAttributes.map{ "\($0.serialize())" }.joined(separator: ","))]") - case .undefined: break - } - - return "{\(fields.joined(separator: ","))}" - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutLineItemsAddPayload.swift b/Buy/Generated/Storefront/CheckoutLineItemsAddPayload.swift deleted file mode 100644 index e8006beb..00000000 --- a/Buy/Generated/Storefront/CheckoutLineItemsAddPayload.swift +++ /dev/null @@ -1,154 +0,0 @@ -// -// CheckoutLineItemsAddPayload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutLineItemsAdd` mutation. - open class CheckoutLineItemsAddPayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutLineItemsAddPayload - - /// The updated checkout object. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutLineItemsAddPayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutLineItemsAddPayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutLineItemsAddPayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutLineItemsAdd` mutation. - open class CheckoutLineItemsAddPayload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutLineItemsAddPayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutLineItemsAddPayload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutLineItemsAddPayload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutLineItemsAddPayload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutLineItemsAddPayload.self, field: fieldName, value: fieldValue) - } - } - - /// The updated checkout object. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutLineItemsRemovePayload.swift b/Buy/Generated/Storefront/CheckoutLineItemsRemovePayload.swift deleted file mode 100644 index 8076e76e..00000000 --- a/Buy/Generated/Storefront/CheckoutLineItemsRemovePayload.swift +++ /dev/null @@ -1,154 +0,0 @@ -// -// CheckoutLineItemsRemovePayload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutLineItemsRemove` mutation. - open class CheckoutLineItemsRemovePayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutLineItemsRemovePayload - - /// The updated checkout object. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutLineItemsRemovePayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutLineItemsRemovePayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutLineItemsRemovePayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutLineItemsRemove` mutation. - open class CheckoutLineItemsRemovePayload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutLineItemsRemovePayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutLineItemsRemovePayload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutLineItemsRemovePayload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutLineItemsRemovePayload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutLineItemsRemovePayload.self, field: fieldName, value: fieldValue) - } - } - - /// The updated checkout object. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutLineItemsUpdatePayload.swift b/Buy/Generated/Storefront/CheckoutLineItemsUpdatePayload.swift deleted file mode 100644 index 059c1d28..00000000 --- a/Buy/Generated/Storefront/CheckoutLineItemsUpdatePayload.swift +++ /dev/null @@ -1,154 +0,0 @@ -// -// CheckoutLineItemsUpdatePayload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutLineItemsUpdate` mutation. - open class CheckoutLineItemsUpdatePayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutLineItemsUpdatePayload - - /// The updated checkout object. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutLineItemsUpdatePayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutLineItemsUpdatePayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutLineItemsUpdatePayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutLineItemsUpdate` mutation. - open class CheckoutLineItemsUpdatePayload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutLineItemsUpdatePayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutLineItemsUpdatePayload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutLineItemsUpdatePayload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutLineItemsUpdatePayload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutLineItemsUpdatePayload.self, field: fieldName, value: fieldValue) - } - } - - /// The updated checkout object. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutShippingAddressUpdateV2Payload.swift b/Buy/Generated/Storefront/CheckoutShippingAddressUpdateV2Payload.swift deleted file mode 100644 index b549e027..00000000 --- a/Buy/Generated/Storefront/CheckoutShippingAddressUpdateV2Payload.swift +++ /dev/null @@ -1,154 +0,0 @@ -// -// CheckoutShippingAddressUpdateV2Payload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutShippingAddressUpdateV2` mutation. - open class CheckoutShippingAddressUpdateV2PayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutShippingAddressUpdateV2Payload - - /// The updated checkout object. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutShippingAddressUpdateV2PayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutShippingAddressUpdateV2PayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutShippingAddressUpdateV2PayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutShippingAddressUpdateV2` mutation. - open class CheckoutShippingAddressUpdateV2Payload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutShippingAddressUpdateV2PayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutShippingAddressUpdateV2Payload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutShippingAddressUpdateV2Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutShippingAddressUpdateV2Payload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutShippingAddressUpdateV2Payload.self, field: fieldName, value: fieldValue) - } - } - - /// The updated checkout object. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutShippingLineUpdatePayload.swift b/Buy/Generated/Storefront/CheckoutShippingLineUpdatePayload.swift deleted file mode 100644 index a5390484..00000000 --- a/Buy/Generated/Storefront/CheckoutShippingLineUpdatePayload.swift +++ /dev/null @@ -1,154 +0,0 @@ -// -// CheckoutShippingLineUpdatePayload.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Return type for `checkoutShippingLineUpdate` mutation. - open class CheckoutShippingLineUpdatePayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutShippingLineUpdatePayload - - /// The updated checkout object. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CheckoutShippingLineUpdatePayloadQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @discardableResult - open func checkoutUserErrors(alias: String? = nil, _ subfields: (CheckoutUserErrorQuery) -> Void) -> CheckoutShippingLineUpdatePayloadQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - - addField(field: "checkoutUserErrors", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - @discardableResult - open func userErrors(alias: String? = nil, _ subfields: (UserErrorQuery) -> Void) -> CheckoutShippingLineUpdatePayloadQuery { - let subquery = UserErrorQuery() - subfields(subquery) - - addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// Return type for `checkoutShippingLineUpdate` mutation. - open class CheckoutShippingLineUpdatePayload: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutShippingLineUpdatePayloadQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "checkout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutShippingLineUpdatePayload.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "checkoutUserErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutShippingLineUpdatePayload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try CheckoutUserError(fields: $0) } - - case "userErrors": - guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutShippingLineUpdatePayload.self, field: fieldName, value: fieldValue) - } - return try value.map { return try UserError(fields: $0) } - - default: - throw SchemaViolationError(type: CheckoutShippingLineUpdatePayload.self, field: fieldName, value: fieldValue) - } - } - - /// The updated checkout object. - open var checkout: Storefront.Checkout? { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout? - } - - /// The list of errors that occurred from executing the mutation. - open var checkoutUserErrors: [Storefront.CheckoutUserError] { - return internalGetCheckoutUserErrors() - } - - func internalGetCheckoutUserErrors(alias: String? = nil) -> [Storefront.CheckoutUserError] { - return field(field: "checkoutUserErrors", aliasSuffix: alias) as! [Storefront.CheckoutUserError] - } - - /// The list of errors that occurred from executing the mutation. - @available(*, deprecated, message:"Use `checkoutUserErrors` instead.") - open var userErrors: [Storefront.UserError] { - return internalGetUserErrors() - } - - func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserError] { - return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserError] - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "checkout": - if let value = internalGetCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutUserErrors": - internalGetCheckoutUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - case "userErrors": - internalGetUserErrors().forEach { - response.append($0) - response.append(contentsOf: $0.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CreditCard.swift b/Buy/Generated/Storefront/CreditCard.swift deleted file mode 100644 index fd28f9f1..00000000 --- a/Buy/Generated/Storefront/CreditCard.swift +++ /dev/null @@ -1,235 +0,0 @@ -// -// CreditCard.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Credit card information used for a payment. - open class CreditCardQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CreditCard - - /// The brand of the credit card. - @discardableResult - open func brand(alias: String? = nil) -> CreditCardQuery { - addField(field: "brand", aliasSuffix: alias) - return self - } - - /// The expiry month of the credit card. - @discardableResult - open func expiryMonth(alias: String? = nil) -> CreditCardQuery { - addField(field: "expiryMonth", aliasSuffix: alias) - return self - } - - /// The expiry year of the credit card. - @discardableResult - open func expiryYear(alias: String? = nil) -> CreditCardQuery { - addField(field: "expiryYear", aliasSuffix: alias) - return self - } - - /// The credit card's BIN number. - @discardableResult - open func firstDigits(alias: String? = nil) -> CreditCardQuery { - addField(field: "firstDigits", aliasSuffix: alias) - return self - } - - /// The first name of the card holder. - @discardableResult - open func firstName(alias: String? = nil) -> CreditCardQuery { - addField(field: "firstName", aliasSuffix: alias) - return self - } - - /// The last 4 digits of the credit card. - @discardableResult - open func lastDigits(alias: String? = nil) -> CreditCardQuery { - addField(field: "lastDigits", aliasSuffix: alias) - return self - } - - /// The last name of the card holder. - @discardableResult - open func lastName(alias: String? = nil) -> CreditCardQuery { - addField(field: "lastName", aliasSuffix: alias) - return self - } - - /// The masked credit card number with only the last 4 digits displayed. - @discardableResult - open func maskedNumber(alias: String? = nil) -> CreditCardQuery { - addField(field: "maskedNumber", aliasSuffix: alias) - return self - } - } - - /// Credit card information used for a payment. - open class CreditCard: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CreditCardQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "brand": - if value is NSNull { return nil } - guard let value = value as? String else { - throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) - } - return value - - case "expiryMonth": - if value is NSNull { return nil } - guard let value = value as? Int else { - throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) - } - return Int32(value) - - case "expiryYear": - if value is NSNull { return nil } - guard let value = value as? Int else { - throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) - } - return Int32(value) - - case "firstDigits": - if value is NSNull { return nil } - guard let value = value as? String else { - throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) - } - return value - - case "firstName": - if value is NSNull { return nil } - guard let value = value as? String else { - throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) - } - return value - - case "lastDigits": - if value is NSNull { return nil } - guard let value = value as? String else { - throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) - } - return value - - case "lastName": - if value is NSNull { return nil } - guard let value = value as? String else { - throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) - } - return value - - case "maskedNumber": - if value is NSNull { return nil } - guard let value = value as? String else { - throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) - } - return value - - default: - throw SchemaViolationError(type: CreditCard.self, field: fieldName, value: fieldValue) - } - } - - /// The brand of the credit card. - open var brand: String? { - return internalGetBrand() - } - - func internalGetBrand(alias: String? = nil) -> String? { - return field(field: "brand", aliasSuffix: alias) as! String? - } - - /// The expiry month of the credit card. - open var expiryMonth: Int32? { - return internalGetExpiryMonth() - } - - func internalGetExpiryMonth(alias: String? = nil) -> Int32? { - return field(field: "expiryMonth", aliasSuffix: alias) as! Int32? - } - - /// The expiry year of the credit card. - open var expiryYear: Int32? { - return internalGetExpiryYear() - } - - func internalGetExpiryYear(alias: String? = nil) -> Int32? { - return field(field: "expiryYear", aliasSuffix: alias) as! Int32? - } - - /// The credit card's BIN number. - open var firstDigits: String? { - return internalGetFirstDigits() - } - - func internalGetFirstDigits(alias: String? = nil) -> String? { - return field(field: "firstDigits", aliasSuffix: alias) as! String? - } - - /// The first name of the card holder. - open var firstName: String? { - return internalGetFirstName() - } - - func internalGetFirstName(alias: String? = nil) -> String? { - return field(field: "firstName", aliasSuffix: alias) as! String? - } - - /// The last 4 digits of the credit card. - open var lastDigits: String? { - return internalGetLastDigits() - } - - func internalGetLastDigits(alias: String? = nil) -> String? { - return field(field: "lastDigits", aliasSuffix: alias) as! String? - } - - /// The last name of the card holder. - open var lastName: String? { - return internalGetLastName() - } - - func internalGetLastName(alias: String? = nil) -> String? { - return field(field: "lastName", aliasSuffix: alias) as! String? - } - - /// The masked credit card number with only the last 4 digits displayed. - open var maskedNumber: String? { - return internalGetMaskedNumber() - } - - func internalGetMaskedNumber(alias: String? = nil) -> String? { - return field(field: "maskedNumber", aliasSuffix: alias) as! String? - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - return [] - } - } -} diff --git a/Buy/Generated/Storefront/CreditCardPaymentInputV2.swift b/Buy/Generated/Storefront/CreditCardPaymentInputV2.swift deleted file mode 100644 index 3275dbe1..00000000 --- a/Buy/Generated/Storefront/CreditCardPaymentInputV2.swift +++ /dev/null @@ -1,110 +0,0 @@ -// -// CreditCardPaymentInputV2.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Specifies the fields required to complete a checkout with a Shopify vaulted - /// credit card payment. - open class CreditCardPaymentInputV2 { - /// The amount and currency of the payment. - open var paymentAmount: MoneyInput - - /// A unique client generated key used to avoid duplicate charges. When a - /// duplicate payment is found, the original is returned instead of creating a - /// new one. For more information, refer to [Idempotent - /// requests](https://shopify.dev/api/usage/idempotent-requests). - open var idempotencyKey: String - - /// The billing address for the payment. - open var billingAddress: MailingAddressInput - - /// The ID returned by Shopify's Card Vault. - open var vaultId: String - - /// Executes the payment in test mode if possible. Defaults to `false`. - open var test: Input - - /// Creates the input object. - /// - /// - parameters: - /// - paymentAmount: The amount and currency of the payment. - /// - idempotencyKey: A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/api/usage/idempotent-requests). - /// - billingAddress: The billing address for the payment. - /// - vaultId: The ID returned by Shopify's Card Vault. - /// - test: Executes the payment in test mode if possible. Defaults to `false`. - /// - public static func create(paymentAmount: MoneyInput, idempotencyKey: String, billingAddress: MailingAddressInput, vaultId: String, test: Input = .undefined) -> CreditCardPaymentInputV2 { - return CreditCardPaymentInputV2(paymentAmount: paymentAmount, idempotencyKey: idempotencyKey, billingAddress: billingAddress, vaultId: vaultId, test: test) - } - - private init(paymentAmount: MoneyInput, idempotencyKey: String, billingAddress: MailingAddressInput, vaultId: String, test: Input = .undefined) { - self.paymentAmount = paymentAmount - self.idempotencyKey = idempotencyKey - self.billingAddress = billingAddress - self.vaultId = vaultId - self.test = test - } - - /// Creates the input object. - /// - /// - parameters: - /// - paymentAmount: The amount and currency of the payment. - /// - idempotencyKey: A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/api/usage/idempotent-requests). - /// - billingAddress: The billing address for the payment. - /// - vaultId: The ID returned by Shopify's Card Vault. - /// - test: Executes the payment in test mode if possible. Defaults to `false`. - /// - @available(*, deprecated, message: "Use the static create() method instead.") - public convenience init(paymentAmount: MoneyInput, idempotencyKey: String, billingAddress: MailingAddressInput, vaultId: String, test: Bool? = nil) { - self.init(paymentAmount: paymentAmount, idempotencyKey: idempotencyKey, billingAddress: billingAddress, vaultId: vaultId, test: test.orUndefined) - } - - internal func serialize() -> String { - var fields: [String] = [] - - fields.append("paymentAmount:\(paymentAmount.serialize())") - - fields.append("idempotencyKey:\(GraphQL.quoteString(input: idempotencyKey))") - - fields.append("billingAddress:\(billingAddress.serialize())") - - fields.append("vaultId:\(GraphQL.quoteString(input: vaultId))") - - switch test { - case .value(let test): - guard let test = test else { - fields.append("test:null") - break - } - fields.append("test:\(test)") - case .undefined: break - } - - return "{\(fields.joined(separator: ","))}" - } - } -} diff --git a/Buy/Generated/Storefront/Customer.swift b/Buy/Generated/Storefront/Customer.swift index e7b05bb1..7d6ed846 100644 --- a/Buy/Generated/Storefront/Customer.swift +++ b/Buy/Generated/Storefront/Customer.swift @@ -128,17 +128,6 @@ extension Storefront { return self } - /// The customer's most recently updated, incomplete checkout. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func lastIncompleteCheckout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> CustomerQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "lastIncompleteCheckout", aliasSuffix: alias, subfields: subquery) - return self - } - /// The customer’s last name. @discardableResult open func lastName(alias: String? = nil) -> CustomerQuery { @@ -341,13 +330,6 @@ extension Storefront { } return GraphQL.ID(rawValue: value) - case "lastIncompleteCheckout": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Customer.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - case "lastName": if value is NSNull { return nil } guard let value = value as? String else { @@ -485,16 +467,6 @@ extension Storefront { return field(field: "id", aliasSuffix: alias) as! GraphQL.ID } - /// The customer's most recently updated, incomplete checkout. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var lastIncompleteCheckout: Storefront.Checkout? { - return internalGetLastIncompleteCheckout() - } - - func internalGetLastIncompleteCheckout(alias: String? = nil) -> Storefront.Checkout? { - return field(field: "lastIncompleteCheckout", aliasSuffix: alias) as! Storefront.Checkout? - } - /// The customer’s last name. open var lastName: String? { return internalGetLastName() @@ -596,12 +568,6 @@ extension Storefront { response.append(contentsOf: value.childResponseObjectMap()) } - case "lastIncompleteCheckout": - if let value = internalGetLastIncompleteCheckout() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - case "metafield": if let value = internalGetMetafield() { response.append(value) diff --git a/Buy/Generated/Storefront/DeliveryAddressInput.swift b/Buy/Generated/Storefront/DeliveryAddressInput.swift index 53220205..cd386bee 100644 --- a/Buy/Generated/Storefront/DeliveryAddressInput.swift +++ b/Buy/Generated/Storefront/DeliveryAddressInput.swift @@ -32,6 +32,11 @@ extension Storefront { /// A delivery address preference of a buyer that is interacting with the cart. open var deliveryAddress: Input + /// Whether the given delivery address is considered to be a one-time use + /// address. One-time use addresses do not get persisted to the buyer's + /// personal addresses when checking out. + open var oneTimeUse: Input + /// Defines what kind of address validation is requested. open var deliveryAddressValidationStrategy: Input @@ -43,15 +48,17 @@ extension Storefront { /// /// - parameters: /// - deliveryAddress: A delivery address preference of a buyer that is interacting with the cart. + /// - oneTimeUse: Whether the given delivery address is considered to be a one-time use address. One-time use addresses do not get persisted to the buyer's personal addresses when checking out. /// - deliveryAddressValidationStrategy: Defines what kind of address validation is requested. /// - customerAddressId: The ID of a customer address that is associated with the buyer that is interacting with the cart. /// - public static func create(deliveryAddress: Input = .undefined, deliveryAddressValidationStrategy: Input = .undefined, customerAddressId: Input = .undefined) -> DeliveryAddressInput { - return DeliveryAddressInput(deliveryAddress: deliveryAddress, deliveryAddressValidationStrategy: deliveryAddressValidationStrategy, customerAddressId: customerAddressId) + public static func create(deliveryAddress: Input = .undefined, oneTimeUse: Input = .undefined, deliveryAddressValidationStrategy: Input = .undefined, customerAddressId: Input = .undefined) -> DeliveryAddressInput { + return DeliveryAddressInput(deliveryAddress: deliveryAddress, oneTimeUse: oneTimeUse, deliveryAddressValidationStrategy: deliveryAddressValidationStrategy, customerAddressId: customerAddressId) } - private init(deliveryAddress: Input = .undefined, deliveryAddressValidationStrategy: Input = .undefined, customerAddressId: Input = .undefined) { + private init(deliveryAddress: Input = .undefined, oneTimeUse: Input = .undefined, deliveryAddressValidationStrategy: Input = .undefined, customerAddressId: Input = .undefined) { self.deliveryAddress = deliveryAddress + self.oneTimeUse = oneTimeUse self.deliveryAddressValidationStrategy = deliveryAddressValidationStrategy self.customerAddressId = customerAddressId } @@ -60,12 +67,13 @@ extension Storefront { /// /// - parameters: /// - deliveryAddress: A delivery address preference of a buyer that is interacting with the cart. + /// - oneTimeUse: Whether the given delivery address is considered to be a one-time use address. One-time use addresses do not get persisted to the buyer's personal addresses when checking out. /// - deliveryAddressValidationStrategy: Defines what kind of address validation is requested. /// - customerAddressId: The ID of a customer address that is associated with the buyer that is interacting with the cart. /// @available(*, deprecated, message: "Use the static create() method instead.") - public convenience init(deliveryAddress: MailingAddressInput? = nil, deliveryAddressValidationStrategy: DeliveryAddressValidationStrategy? = nil, customerAddressId: GraphQL.ID? = nil) { - self.init(deliveryAddress: deliveryAddress.orUndefined, deliveryAddressValidationStrategy: deliveryAddressValidationStrategy.orUndefined, customerAddressId: customerAddressId.orUndefined) + public convenience init(deliveryAddress: MailingAddressInput? = nil, oneTimeUse: Bool? = nil, deliveryAddressValidationStrategy: DeliveryAddressValidationStrategy? = nil, customerAddressId: GraphQL.ID? = nil) { + self.init(deliveryAddress: deliveryAddress.orUndefined, oneTimeUse: oneTimeUse.orUndefined, deliveryAddressValidationStrategy: deliveryAddressValidationStrategy.orUndefined, customerAddressId: customerAddressId.orUndefined) } internal func serialize() -> String { @@ -81,6 +89,16 @@ extension Storefront { case .undefined: break } + switch oneTimeUse { + case .value(let oneTimeUse): + guard let oneTimeUse = oneTimeUse else { + fields.append("oneTimeUse:null") + break + } + fields.append("oneTimeUse:\(oneTimeUse)") + case .undefined: break + } + switch deliveryAddressValidationStrategy { case .value(let deliveryAddressValidationStrategy): guard let deliveryAddressValidationStrategy = deliveryAddressValidationStrategy else { diff --git a/Buy/Generated/Storefront/DisplayableError.swift b/Buy/Generated/Storefront/DisplayableError.swift index 66f0c685..fd818bd5 100644 --- a/Buy/Generated/Storefront/DisplayableError.swift +++ b/Buy/Generated/Storefront/DisplayableError.swift @@ -66,15 +66,6 @@ extension Storefront { return self } - /// Represents an error in the input of a mutation. - @discardableResult - open func onCheckoutUserError(subfields: (CheckoutUserErrorQuery) -> Void) -> DisplayableErrorQuery { - let subquery = CheckoutUserErrorQuery() - subfields(subquery) - addInlineFragment(on: "CheckoutUserError", subfields: subquery) - return self - } - /// Represents an error in the input of a mutation. @discardableResult open func onCustomerUserError(subfields: (CustomerUserErrorQuery) -> Void) -> DisplayableErrorQuery { @@ -110,6 +101,15 @@ extension Storefront { addInlineFragment(on: "UserError", subfields: subquery) return self } + + /// Represents an error in the input of a mutation. + @discardableResult + open func onUserErrorsShopPayPaymentRequestSessionUserErrors(subfields: (UserErrorsShopPayPaymentRequestSessionUserErrorsQuery) -> Void) -> DisplayableErrorQuery { + let subquery = UserErrorsShopPayPaymentRequestSessionUserErrorsQuery() + subfields(subquery) + addInlineFragment(on: "UserErrorsShopPayPaymentRequestSessionUserErrors", subfields: subquery) + return self + } } /// Represents an error in the input of a mutation. @@ -144,8 +144,6 @@ extension Storefront { switch typeName { case "CartUserError": return try CartUserError.init(fields: fields) - case "CheckoutUserError": return try CheckoutUserError.init(fields: fields) - case "CustomerUserError": return try CustomerUserError.init(fields: fields) case "MetafieldDeleteUserError": return try MetafieldDeleteUserError.init(fields: fields) @@ -154,6 +152,8 @@ extension Storefront { case "UserError": return try UserError.init(fields: fields) + case "UserErrorsShopPayPaymentRequestSessionUserErrors": return try UserErrorsShopPayPaymentRequestSessionUserErrors.init(fields: fields) + default: return try UnknownDisplayableError.init(fields: fields) } diff --git a/Buy/Generated/Storefront/HasMetafields.swift b/Buy/Generated/Storefront/HasMetafields.swift index 3fe4875c..a970f414 100644 --- a/Buy/Generated/Storefront/HasMetafields.swift +++ b/Buy/Generated/Storefront/HasMetafields.swift @@ -223,6 +223,16 @@ extension Storefront { return self } + /// Represents information about the metafields associated to the specified + /// resource. + @discardableResult + open func onSellingPlan(subfields: (SellingPlanQuery) -> Void) -> HasMetafieldsQuery { + let subquery = SellingPlanQuery() + subfields(subquery) + addInlineFragment(on: "SellingPlan", subfields: subquery) + return self + } + /// Represents information about the metafields associated to the specified /// resource. @discardableResult @@ -295,6 +305,8 @@ extension Storefront { case "ProductVariant": return try ProductVariant.init(fields: fields) + case "SellingPlan": return try SellingPlan.init(fields: fields) + case "Shop": return try Shop.init(fields: fields) default: diff --git a/Buy/Generated/Storefront/MailingAddress.swift b/Buy/Generated/Storefront/MailingAddress.swift index 018378f1..177e1d68 100644 --- a/Buy/Generated/Storefront/MailingAddress.swift +++ b/Buy/Generated/Storefront/MailingAddress.swift @@ -171,7 +171,7 @@ extension Storefront { return self } - /// The two-letter code for the region. For example, ON. + /// The alphanumeric code for the region. For example, ON. @discardableResult open func provinceCode(alias: String? = nil) -> MailingAddressQuery { addField(field: "provinceCode", aliasSuffix: alias) @@ -490,7 +490,7 @@ extension Storefront { return field(field: "province", aliasSuffix: alias) as! String? } - /// The two-letter code for the region. For example, ON. + /// The alphanumeric code for the region. For example, ON. open var provinceCode: String? { return internalGetProvinceCode() } diff --git a/Buy/Generated/Storefront/MetafieldParentResource.swift b/Buy/Generated/Storefront/MetafieldParentResource.swift index 43e52e43..aa9d7076 100644 --- a/Buy/Generated/Storefront/MetafieldParentResource.swift +++ b/Buy/Generated/Storefront/MetafieldParentResource.swift @@ -157,6 +157,15 @@ extension Storefront { return self } + /// A resource that the metafield belongs to. + @discardableResult + open func onSellingPlan(subfields: (SellingPlanQuery) -> Void) -> MetafieldParentResourceQuery { + let subquery = SellingPlanQuery() + subfields(subquery) + addInlineFragment(on: "SellingPlan", subfields: subquery) + return self + } + /// A resource that the metafield belongs to. @discardableResult open func onShop(subfields: (ShopQuery) -> Void) -> MetafieldParentResourceQuery { @@ -210,6 +219,8 @@ extension Storefront { case "ProductVariant": return try ProductVariant.init(fields: fields) + case "SellingPlan": return try SellingPlan.init(fields: fields) + case "Shop": return try Shop.init(fields: fields) default: diff --git a/Buy/Generated/Storefront/Mutation.swift b/Buy/Generated/Storefront/Mutation.swift index a4bf3c11..62fcf4f0 100644 --- a/Buy/Generated/Storefront/Mutation.swift +++ b/Buy/Generated/Storefront/Mutation.swift @@ -61,6 +61,31 @@ extension Storefront { return self } + /// Updates the billing address on the cart. + /// + /// - parameters: + /// - cartId: The ID of the cart. + /// - billingAddress: The customer's billing address. + /// + @discardableResult + open func cartBillingAddressUpdate(alias: String? = nil, cartId: GraphQL.ID, billingAddress: MailingAddressInput? = nil, _ subfields: (CartBillingAddressUpdatePayloadQuery) -> Void) -> MutationQuery { + var args: [String] = [] + + args.append("cartId:\(GraphQL.quoteString(input: "\(cartId.rawValue)"))") + + if let billingAddress = billingAddress { + args.append("billingAddress:\(billingAddress.serialize())") + } + + let argsString: String? = args.isEmpty ? nil : "(\(args.joined(separator: ",")))" + + let subquery = CartBillingAddressUpdatePayloadQuery() + subfields(subquery) + + addField(field: "cartBillingAddressUpdate", aliasSuffix: alias, args: argsString, subfields: subquery) + return self + } + /// Updates customer information associated with a cart. Buyer identity is used /// to determine [international /// pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing) @@ -138,6 +163,31 @@ extension Storefront { return self } + /// Updates the gift card codes applied to the cart. + /// + /// - parameters: + /// - cartId: The ID of the cart. + /// - giftCardCodes: The case-insensitive gift card codes. + /// + /// The input must not contain more than `250` values. + /// + @discardableResult + open func cartGiftCardCodesUpdate(alias: String? = nil, cartId: GraphQL.ID, giftCardCodes: [String], _ subfields: (CartGiftCardCodesUpdatePayloadQuery) -> Void) -> MutationQuery { + var args: [String] = [] + + args.append("cartId:\(GraphQL.quoteString(input: "\(cartId.rawValue)"))") + + args.append("giftCardCodes:[\(giftCardCodes.map{ "\(GraphQL.quoteString(input: $0))" }.joined(separator: ","))]") + + let argsString = "(\(args.joined(separator: ",")))" + + let subquery = CartGiftCardCodesUpdatePayloadQuery() + subfields(subquery) + + addField(field: "cartGiftCardCodesUpdate", aliasSuffix: alias, args: argsString, subfields: subquery) + return self + } + /// Adds a merchandise line to the cart. /// /// - parameters: @@ -352,446 +402,6 @@ extension Storefront { return self } - /// Updates the attributes of a checkout if `allowPartialAddresses` is `true`. - /// - /// - parameters: - /// - checkoutId: The ID of the checkout. - /// - input: The checkout attributes to update. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutAttributesUpdateV2(alias: String? = nil, checkoutId: GraphQL.ID, input: CheckoutAttributesUpdateV2Input, _ subfields: (CheckoutAttributesUpdateV2PayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - args.append("input:\(input.serialize())") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutAttributesUpdateV2PayloadQuery() - subfields(subquery) - - addField(field: "checkoutAttributesUpdateV2", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Completes a checkout without providing payment information. You can use - /// this mutation for free items or items whose purchase price is covered by a - /// gift card. - /// - /// - parameters: - /// - checkoutId: The ID of the checkout. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutCompleteFree(alias: String? = nil, checkoutId: GraphQL.ID, _ subfields: (CheckoutCompleteFreePayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutCompleteFreePayloadQuery() - subfields(subquery) - - addField(field: "checkoutCompleteFree", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Completes a checkout using a credit card token from Shopify's card vault. - /// Before you can complete checkouts using CheckoutCompleteWithCreditCardV2, - /// you need to [_request payment - /// processing_](https://shopify.dev/apps/channels/getting-started#request-payment-processing). - /// - /// - parameters: - /// - checkoutId: The ID of the checkout. - /// - payment: The credit card info to apply as a payment. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutCompleteWithCreditCardV2(alias: String? = nil, checkoutId: GraphQL.ID, payment: CreditCardPaymentInputV2, _ subfields: (CheckoutCompleteWithCreditCardV2PayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - args.append("payment:\(payment.serialize())") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutCompleteWithCreditCardV2PayloadQuery() - subfields(subquery) - - addField(field: "checkoutCompleteWithCreditCardV2", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Completes a checkout with a tokenized payment. - /// - /// - parameters: - /// - checkoutId: The ID of the checkout. - /// - payment: The info to apply as a tokenized payment. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutCompleteWithTokenizedPaymentV3(alias: String? = nil, checkoutId: GraphQL.ID, payment: TokenizedPaymentInputV3, _ subfields: (CheckoutCompleteWithTokenizedPaymentV3PayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - args.append("payment:\(payment.serialize())") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutCompleteWithTokenizedPaymentV3PayloadQuery() - subfields(subquery) - - addField(field: "checkoutCompleteWithTokenizedPaymentV3", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Creates a new checkout. - /// - /// - parameters: - /// - input: The fields used to create a checkout. - /// - queueToken: The checkout queue token. Available only to selected stores. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutCreate(alias: String? = nil, input: CheckoutCreateInput, queueToken: String? = nil, _ subfields: (CheckoutCreatePayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("input:\(input.serialize())") - - if let queueToken = queueToken { - args.append("queueToken:\(GraphQL.quoteString(input: queueToken))") - } - - let argsString: String? = args.isEmpty ? nil : "(\(args.joined(separator: ",")))" - - let subquery = CheckoutCreatePayloadQuery() - subfields(subquery) - - addField(field: "checkoutCreate", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Associates a customer to the checkout. - /// - /// - parameters: - /// - checkoutId: The ID of the checkout. - /// - customerAccessToken: The customer access token of the customer to associate. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutCustomerAssociateV2(alias: String? = nil, checkoutId: GraphQL.ID, customerAccessToken: String, _ subfields: (CheckoutCustomerAssociateV2PayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - args.append("customerAccessToken:\(GraphQL.quoteString(input: customerAccessToken))") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutCustomerAssociateV2PayloadQuery() - subfields(subquery) - - addField(field: "checkoutCustomerAssociateV2", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Disassociates the current checkout customer from the checkout. - /// - /// - parameters: - /// - checkoutId: The ID of the checkout. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutCustomerDisassociateV2(alias: String? = nil, checkoutId: GraphQL.ID, _ subfields: (CheckoutCustomerDisassociateV2PayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutCustomerDisassociateV2PayloadQuery() - subfields(subquery) - - addField(field: "checkoutCustomerDisassociateV2", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Applies a discount to an existing checkout using a discount code. - /// - /// - parameters: - /// - discountCode: The discount code to apply to the checkout. - /// - checkoutId: The ID of the checkout. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutDiscountCodeApplyV2(alias: String? = nil, discountCode: String, checkoutId: GraphQL.ID, _ subfields: (CheckoutDiscountCodeApplyV2PayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("discountCode:\(GraphQL.quoteString(input: discountCode))") - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutDiscountCodeApplyV2PayloadQuery() - subfields(subquery) - - addField(field: "checkoutDiscountCodeApplyV2", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Removes the applied discounts from an existing checkout. - /// - /// - parameters: - /// - checkoutId: The ID of the checkout. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutDiscountCodeRemove(alias: String? = nil, checkoutId: GraphQL.ID, _ subfields: (CheckoutDiscountCodeRemovePayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutDiscountCodeRemovePayloadQuery() - subfields(subquery) - - addField(field: "checkoutDiscountCodeRemove", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Updates the email on an existing checkout. - /// - /// - parameters: - /// - checkoutId: The ID of the checkout. - /// - email: The email to update the checkout with. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutEmailUpdateV2(alias: String? = nil, checkoutId: GraphQL.ID, email: String, _ subfields: (CheckoutEmailUpdateV2PayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - args.append("email:\(GraphQL.quoteString(input: email))") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutEmailUpdateV2PayloadQuery() - subfields(subquery) - - addField(field: "checkoutEmailUpdateV2", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Removes an applied gift card from the checkout. - /// - /// - parameters: - /// - appliedGiftCardId: The ID of the Applied Gift Card to remove from the Checkout. - /// - checkoutId: The ID of the checkout. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutGiftCardRemoveV2(alias: String? = nil, appliedGiftCardId: GraphQL.ID, checkoutId: GraphQL.ID, _ subfields: (CheckoutGiftCardRemoveV2PayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("appliedGiftCardId:\(GraphQL.quoteString(input: "\(appliedGiftCardId.rawValue)"))") - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutGiftCardRemoveV2PayloadQuery() - subfields(subquery) - - addField(field: "checkoutGiftCardRemoveV2", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Appends gift cards to an existing checkout. - /// - /// - parameters: - /// - giftCardCodes: A list of gift card codes to append to the checkout. - /// - /// The input must not contain more than `250` values. - /// - checkoutId: The ID of the checkout. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutGiftCardsAppend(alias: String? = nil, giftCardCodes: [String], checkoutId: GraphQL.ID, _ subfields: (CheckoutGiftCardsAppendPayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("giftCardCodes:[\(giftCardCodes.map{ "\(GraphQL.quoteString(input: $0))" }.joined(separator: ","))]") - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutGiftCardsAppendPayloadQuery() - subfields(subquery) - - addField(field: "checkoutGiftCardsAppend", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Adds a list of line items to a checkout. - /// - /// - parameters: - /// - lineItems: A list of line item objects to add to the checkout. - /// - /// The input must not contain more than `250` values. - /// - checkoutId: The ID of the checkout. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutLineItemsAdd(alias: String? = nil, lineItems: [CheckoutLineItemInput], checkoutId: GraphQL.ID, _ subfields: (CheckoutLineItemsAddPayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("lineItems:[\(lineItems.map{ "\($0.serialize())" }.joined(separator: ","))]") - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutLineItemsAddPayloadQuery() - subfields(subquery) - - addField(field: "checkoutLineItemsAdd", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Removes line items from an existing checkout. - /// - /// - parameters: - /// - checkoutId: The checkout on which to remove line items. - /// - lineItemIds: Line item ids to remove. - /// - /// The input must not contain more than `250` values. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutLineItemsRemove(alias: String? = nil, checkoutId: GraphQL.ID, lineItemIds: [GraphQL.ID], _ subfields: (CheckoutLineItemsRemovePayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - args.append("lineItemIds:[\(lineItemIds.map{ "\(GraphQL.quoteString(input: "\($0.rawValue)"))" }.joined(separator: ","))]") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutLineItemsRemovePayloadQuery() - subfields(subquery) - - addField(field: "checkoutLineItemsRemove", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Sets a list of line items to a checkout. - /// - /// - parameters: - /// - lineItems: A list of line item objects to set on the checkout. - /// - /// The input must not contain more than `250` values. - /// - checkoutId: The ID of the checkout. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutLineItemsReplace(alias: String? = nil, lineItems: [CheckoutLineItemInput], checkoutId: GraphQL.ID, _ subfields: (CheckoutLineItemsReplacePayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("lineItems:[\(lineItems.map{ "\($0.serialize())" }.joined(separator: ","))]") - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutLineItemsReplacePayloadQuery() - subfields(subquery) - - addField(field: "checkoutLineItemsReplace", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Updates line items on a checkout. - /// - /// - parameters: - /// - checkoutId: The checkout on which to update line items. - /// - lineItems: Line items to update. - /// - /// The input must not contain more than `250` values. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutLineItemsUpdate(alias: String? = nil, checkoutId: GraphQL.ID, lineItems: [CheckoutLineItemUpdateInput], _ subfields: (CheckoutLineItemsUpdatePayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - args.append("lineItems:[\(lineItems.map{ "\($0.serialize())" }.joined(separator: ","))]") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutLineItemsUpdatePayloadQuery() - subfields(subquery) - - addField(field: "checkoutLineItemsUpdate", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Updates the shipping address of an existing checkout. - /// - /// - parameters: - /// - shippingAddress: The shipping address to where the line items will be shipped. - /// - checkoutId: The ID of the checkout. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutShippingAddressUpdateV2(alias: String? = nil, shippingAddress: MailingAddressInput, checkoutId: GraphQL.ID, _ subfields: (CheckoutShippingAddressUpdateV2PayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("shippingAddress:\(shippingAddress.serialize())") - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutShippingAddressUpdateV2PayloadQuery() - subfields(subquery) - - addField(field: "checkoutShippingAddressUpdateV2", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - - /// Updates the shipping lines on an existing checkout. - /// - /// - parameters: - /// - checkoutId: The ID of the checkout. - /// - shippingRateHandle: A unique identifier to a Checkout’s shipping provider, price, and title combination, enabling the customer to select the availableShippingRates. - /// - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - @discardableResult - open func checkoutShippingLineUpdate(alias: String? = nil, checkoutId: GraphQL.ID, shippingRateHandle: String, _ subfields: (CheckoutShippingLineUpdatePayloadQuery) -> Void) -> MutationQuery { - var args: [String] = [] - - args.append("checkoutId:\(GraphQL.quoteString(input: "\(checkoutId.rawValue)"))") - - args.append("shippingRateHandle:\(GraphQL.quoteString(input: shippingRateHandle))") - - let argsString = "(\(args.joined(separator: ",")))" - - let subquery = CheckoutShippingLineUpdatePayloadQuery() - subfields(subquery) - - addField(field: "checkoutShippingLineUpdate", aliasSuffix: alias, args: argsString, subfields: subquery) - return self - } - /// Creates a customer access token. The customer access token is required to /// modify the customer object in any way. /// @@ -1146,6 +756,60 @@ extension Storefront { addField(field: "customerUpdate", aliasSuffix: alias, args: argsString, subfields: subquery) return self } + + /// Create a new Shop Pay payment request session. + /// + /// - parameters: + /// - sourceIdentifier: A unique identifier for the payment request session. + /// - paymentRequest: A payment request object. + /// + @discardableResult + open func shopPayPaymentRequestSessionCreate(alias: String? = nil, sourceIdentifier: String, paymentRequest: ShopPayPaymentRequestInput, _ subfields: (ShopPayPaymentRequestSessionCreatePayloadQuery) -> Void) -> MutationQuery { + var args: [String] = [] + + args.append("sourceIdentifier:\(GraphQL.quoteString(input: sourceIdentifier))") + + args.append("paymentRequest:\(paymentRequest.serialize())") + + let argsString = "(\(args.joined(separator: ",")))" + + let subquery = ShopPayPaymentRequestSessionCreatePayloadQuery() + subfields(subquery) + + addField(field: "shopPayPaymentRequestSessionCreate", aliasSuffix: alias, args: argsString, subfields: subquery) + return self + } + + /// Submits a Shop Pay payment request session. + /// + /// - parameters: + /// - token: A token representing a payment session request. + /// - paymentRequest: The final payment request object. + /// - idempotencyKey: The idempotency key is used to guarantee an idempotent result. + /// - orderName: The order name to be used for the order created from the payment request. + /// + @discardableResult + open func shopPayPaymentRequestSessionSubmit(alias: String? = nil, token: String, paymentRequest: ShopPayPaymentRequestInput, idempotencyKey: String, orderName: String? = nil, _ subfields: (ShopPayPaymentRequestSessionSubmitPayloadQuery) -> Void) -> MutationQuery { + var args: [String] = [] + + args.append("token:\(GraphQL.quoteString(input: token))") + + args.append("paymentRequest:\(paymentRequest.serialize())") + + args.append("idempotencyKey:\(GraphQL.quoteString(input: idempotencyKey))") + + if let orderName = orderName { + args.append("orderName:\(GraphQL.quoteString(input: orderName))") + } + + let argsString: String? = args.isEmpty ? nil : "(\(args.joined(separator: ",")))" + + let subquery = ShopPayPaymentRequestSessionSubmitPayloadQuery() + subfields(subquery) + + addField(field: "shopPayPaymentRequestSessionSubmit", aliasSuffix: alias, args: argsString, subfields: subquery) + return self + } } /// The schema’s entry-point for mutations. This acts as the public, top-level @@ -1163,6 +827,13 @@ extension Storefront { } return try CartAttributesUpdatePayload(fields: value) + case "cartBillingAddressUpdate": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) + } + return try CartBillingAddressUpdatePayload(fields: value) + case "cartBuyerIdentityUpdate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { @@ -1184,6 +855,13 @@ extension Storefront { } return try CartDiscountCodesUpdatePayload(fields: value) + case "cartGiftCardCodesUpdate": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) + } + return try CartGiftCardCodesUpdatePayload(fields: value) + case "cartLinesAdd": if value is NSNull { return nil } guard let value = value as? [String: Any] else { @@ -1219,159 +897,33 @@ extension Storefront { } return try CartMetafieldsSetPayload(fields: value) - case "cartNoteUpdate": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CartNoteUpdatePayload(fields: value) - - case "cartPaymentUpdate": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CartPaymentUpdatePayload(fields: value) - - case "cartSelectedDeliveryOptionsUpdate": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CartSelectedDeliveryOptionsUpdatePayload(fields: value) - - case "cartSubmitForCompletion": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CartSubmitForCompletionPayload(fields: value) - - case "checkoutAttributesUpdateV2": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CheckoutAttributesUpdateV2Payload(fields: value) - - case "checkoutCompleteFree": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CheckoutCompleteFreePayload(fields: value) - - case "checkoutCompleteWithCreditCardV2": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CheckoutCompleteWithCreditCardV2Payload(fields: value) - - case "checkoutCompleteWithTokenizedPaymentV3": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CheckoutCompleteWithTokenizedPaymentV3Payload(fields: value) - - case "checkoutCreate": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CheckoutCreatePayload(fields: value) - - case "checkoutCustomerAssociateV2": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CheckoutCustomerAssociateV2Payload(fields: value) - - case "checkoutCustomerDisassociateV2": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CheckoutCustomerDisassociateV2Payload(fields: value) - - case "checkoutDiscountCodeApplyV2": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CheckoutDiscountCodeApplyV2Payload(fields: value) - - case "checkoutDiscountCodeRemove": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CheckoutDiscountCodeRemovePayload(fields: value) - - case "checkoutEmailUpdateV2": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CheckoutEmailUpdateV2Payload(fields: value) - - case "checkoutGiftCardRemoveV2": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CheckoutGiftCardRemoveV2Payload(fields: value) - - case "checkoutGiftCardsAppend": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CheckoutGiftCardsAppendPayload(fields: value) - - case "checkoutLineItemsAdd": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CheckoutLineItemsAddPayload(fields: value) - - case "checkoutLineItemsRemove": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) - } - return try CheckoutLineItemsRemovePayload(fields: value) - - case "checkoutLineItemsReplace": + case "cartNoteUpdate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } - return try CheckoutLineItemsReplacePayload(fields: value) + return try CartNoteUpdatePayload(fields: value) - case "checkoutLineItemsUpdate": + case "cartPaymentUpdate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } - return try CheckoutLineItemsUpdatePayload(fields: value) + return try CartPaymentUpdatePayload(fields: value) - case "checkoutShippingAddressUpdateV2": + case "cartSelectedDeliveryOptionsUpdate": if value is NSNull { return nil } guard let value = value as? [String: Any] else { throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } - return try CheckoutShippingAddressUpdateV2Payload(fields: value) + return try CartSelectedDeliveryOptionsUpdatePayload(fields: value) - case "checkoutShippingLineUpdate": + case "cartSubmitForCompletion": if value is NSNull { return nil } guard let value = value as? [String: Any] else { throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } - return try CheckoutShippingLineUpdatePayload(fields: value) + return try CartSubmitForCompletionPayload(fields: value) case "customerAccessTokenCreate": if value is NSNull { return nil } @@ -1478,6 +1030,20 @@ extension Storefront { } return try CustomerUpdatePayload(fields: value) + case "shopPayPaymentRequestSessionCreate": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) + } + return try ShopPayPaymentRequestSessionCreatePayload(fields: value) + + case "shopPayPaymentRequestSessionSubmit": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) + } + return try ShopPayPaymentRequestSessionSubmitPayload(fields: value) + default: throw SchemaViolationError(type: Mutation.self, field: fieldName, value: fieldValue) } @@ -1496,6 +1062,19 @@ extension Storefront { return field(field: "cartAttributesUpdate", aliasSuffix: alias) as! Storefront.CartAttributesUpdatePayload? } + /// Updates the billing address on the cart. + open var cartBillingAddressUpdate: Storefront.CartBillingAddressUpdatePayload? { + return internalGetCartBillingAddressUpdate() + } + + open func aliasedCartBillingAddressUpdate(alias: String) -> Storefront.CartBillingAddressUpdatePayload? { + return internalGetCartBillingAddressUpdate(alias: alias) + } + + func internalGetCartBillingAddressUpdate(alias: String? = nil) -> Storefront.CartBillingAddressUpdatePayload? { + return field(field: "cartBillingAddressUpdate", aliasSuffix: alias) as! Storefront.CartBillingAddressUpdatePayload? + } + /// Updates customer information associated with a cart. Buyer identity is used /// to determine [international /// pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing) @@ -1538,6 +1117,19 @@ extension Storefront { return field(field: "cartDiscountCodesUpdate", aliasSuffix: alias) as! Storefront.CartDiscountCodesUpdatePayload? } + /// Updates the gift card codes applied to the cart. + open var cartGiftCardCodesUpdate: Storefront.CartGiftCardCodesUpdatePayload? { + return internalGetCartGiftCardCodesUpdate() + } + + open func aliasedCartGiftCardCodesUpdate(alias: String) -> Storefront.CartGiftCardCodesUpdatePayload? { + return internalGetCartGiftCardCodesUpdate(alias: alias) + } + + func internalGetCartGiftCardCodesUpdate(alias: String? = nil) -> Storefront.CartGiftCardCodesUpdatePayload? { + return field(field: "cartGiftCardCodesUpdate", aliasSuffix: alias) as! Storefront.CartGiftCardCodesUpdatePayload? + } + /// Adds a merchandise line to the cart. open var cartLinesAdd: Storefront.CartLinesAddPayload? { return internalGetCartLinesAdd() @@ -1657,299 +1249,6 @@ extension Storefront { return field(field: "cartSubmitForCompletion", aliasSuffix: alias) as! Storefront.CartSubmitForCompletionPayload? } - /// Updates the attributes of a checkout if `allowPartialAddresses` is `true`. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutAttributesUpdateV2: Storefront.CheckoutAttributesUpdateV2Payload? { - return internalGetCheckoutAttributesUpdateV2() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutAttributesUpdateV2(alias: String) -> Storefront.CheckoutAttributesUpdateV2Payload? { - return internalGetCheckoutAttributesUpdateV2(alias: alias) - } - - func internalGetCheckoutAttributesUpdateV2(alias: String? = nil) -> Storefront.CheckoutAttributesUpdateV2Payload? { - return field(field: "checkoutAttributesUpdateV2", aliasSuffix: alias) as! Storefront.CheckoutAttributesUpdateV2Payload? - } - - /// Completes a checkout without providing payment information. You can use - /// this mutation for free items or items whose purchase price is covered by a - /// gift card. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutCompleteFree: Storefront.CheckoutCompleteFreePayload? { - return internalGetCheckoutCompleteFree() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutCompleteFree(alias: String) -> Storefront.CheckoutCompleteFreePayload? { - return internalGetCheckoutCompleteFree(alias: alias) - } - - func internalGetCheckoutCompleteFree(alias: String? = nil) -> Storefront.CheckoutCompleteFreePayload? { - return field(field: "checkoutCompleteFree", aliasSuffix: alias) as! Storefront.CheckoutCompleteFreePayload? - } - - /// Completes a checkout using a credit card token from Shopify's card vault. - /// Before you can complete checkouts using CheckoutCompleteWithCreditCardV2, - /// you need to [_request payment - /// processing_](https://shopify.dev/apps/channels/getting-started#request-payment-processing). - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutCompleteWithCreditCardV2: Storefront.CheckoutCompleteWithCreditCardV2Payload? { - return internalGetCheckoutCompleteWithCreditCardV2() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutCompleteWithCreditCardV2(alias: String) -> Storefront.CheckoutCompleteWithCreditCardV2Payload? { - return internalGetCheckoutCompleteWithCreditCardV2(alias: alias) - } - - func internalGetCheckoutCompleteWithCreditCardV2(alias: String? = nil) -> Storefront.CheckoutCompleteWithCreditCardV2Payload? { - return field(field: "checkoutCompleteWithCreditCardV2", aliasSuffix: alias) as! Storefront.CheckoutCompleteWithCreditCardV2Payload? - } - - /// Completes a checkout with a tokenized payment. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutCompleteWithTokenizedPaymentV3: Storefront.CheckoutCompleteWithTokenizedPaymentV3Payload? { - return internalGetCheckoutCompleteWithTokenizedPaymentV3() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutCompleteWithTokenizedPaymentV3(alias: String) -> Storefront.CheckoutCompleteWithTokenizedPaymentV3Payload? { - return internalGetCheckoutCompleteWithTokenizedPaymentV3(alias: alias) - } - - func internalGetCheckoutCompleteWithTokenizedPaymentV3(alias: String? = nil) -> Storefront.CheckoutCompleteWithTokenizedPaymentV3Payload? { - return field(field: "checkoutCompleteWithTokenizedPaymentV3", aliasSuffix: alias) as! Storefront.CheckoutCompleteWithTokenizedPaymentV3Payload? - } - - /// Creates a new checkout. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutCreate: Storefront.CheckoutCreatePayload? { - return internalGetCheckoutCreate() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutCreate(alias: String) -> Storefront.CheckoutCreatePayload? { - return internalGetCheckoutCreate(alias: alias) - } - - func internalGetCheckoutCreate(alias: String? = nil) -> Storefront.CheckoutCreatePayload? { - return field(field: "checkoutCreate", aliasSuffix: alias) as! Storefront.CheckoutCreatePayload? - } - - /// Associates a customer to the checkout. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutCustomerAssociateV2: Storefront.CheckoutCustomerAssociateV2Payload? { - return internalGetCheckoutCustomerAssociateV2() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutCustomerAssociateV2(alias: String) -> Storefront.CheckoutCustomerAssociateV2Payload? { - return internalGetCheckoutCustomerAssociateV2(alias: alias) - } - - func internalGetCheckoutCustomerAssociateV2(alias: String? = nil) -> Storefront.CheckoutCustomerAssociateV2Payload? { - return field(field: "checkoutCustomerAssociateV2", aliasSuffix: alias) as! Storefront.CheckoutCustomerAssociateV2Payload? - } - - /// Disassociates the current checkout customer from the checkout. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutCustomerDisassociateV2: Storefront.CheckoutCustomerDisassociateV2Payload? { - return internalGetCheckoutCustomerDisassociateV2() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutCustomerDisassociateV2(alias: String) -> Storefront.CheckoutCustomerDisassociateV2Payload? { - return internalGetCheckoutCustomerDisassociateV2(alias: alias) - } - - func internalGetCheckoutCustomerDisassociateV2(alias: String? = nil) -> Storefront.CheckoutCustomerDisassociateV2Payload? { - return field(field: "checkoutCustomerDisassociateV2", aliasSuffix: alias) as! Storefront.CheckoutCustomerDisassociateV2Payload? - } - - /// Applies a discount to an existing checkout using a discount code. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutDiscountCodeApplyV2: Storefront.CheckoutDiscountCodeApplyV2Payload? { - return internalGetCheckoutDiscountCodeApplyV2() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutDiscountCodeApplyV2(alias: String) -> Storefront.CheckoutDiscountCodeApplyV2Payload? { - return internalGetCheckoutDiscountCodeApplyV2(alias: alias) - } - - func internalGetCheckoutDiscountCodeApplyV2(alias: String? = nil) -> Storefront.CheckoutDiscountCodeApplyV2Payload? { - return field(field: "checkoutDiscountCodeApplyV2", aliasSuffix: alias) as! Storefront.CheckoutDiscountCodeApplyV2Payload? - } - - /// Removes the applied discounts from an existing checkout. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutDiscountCodeRemove: Storefront.CheckoutDiscountCodeRemovePayload? { - return internalGetCheckoutDiscountCodeRemove() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutDiscountCodeRemove(alias: String) -> Storefront.CheckoutDiscountCodeRemovePayload? { - return internalGetCheckoutDiscountCodeRemove(alias: alias) - } - - func internalGetCheckoutDiscountCodeRemove(alias: String? = nil) -> Storefront.CheckoutDiscountCodeRemovePayload? { - return field(field: "checkoutDiscountCodeRemove", aliasSuffix: alias) as! Storefront.CheckoutDiscountCodeRemovePayload? - } - - /// Updates the email on an existing checkout. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutEmailUpdateV2: Storefront.CheckoutEmailUpdateV2Payload? { - return internalGetCheckoutEmailUpdateV2() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutEmailUpdateV2(alias: String) -> Storefront.CheckoutEmailUpdateV2Payload? { - return internalGetCheckoutEmailUpdateV2(alias: alias) - } - - func internalGetCheckoutEmailUpdateV2(alias: String? = nil) -> Storefront.CheckoutEmailUpdateV2Payload? { - return field(field: "checkoutEmailUpdateV2", aliasSuffix: alias) as! Storefront.CheckoutEmailUpdateV2Payload? - } - - /// Removes an applied gift card from the checkout. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutGiftCardRemoveV2: Storefront.CheckoutGiftCardRemoveV2Payload? { - return internalGetCheckoutGiftCardRemoveV2() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutGiftCardRemoveV2(alias: String) -> Storefront.CheckoutGiftCardRemoveV2Payload? { - return internalGetCheckoutGiftCardRemoveV2(alias: alias) - } - - func internalGetCheckoutGiftCardRemoveV2(alias: String? = nil) -> Storefront.CheckoutGiftCardRemoveV2Payload? { - return field(field: "checkoutGiftCardRemoveV2", aliasSuffix: alias) as! Storefront.CheckoutGiftCardRemoveV2Payload? - } - - /// Appends gift cards to an existing checkout. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutGiftCardsAppend: Storefront.CheckoutGiftCardsAppendPayload? { - return internalGetCheckoutGiftCardsAppend() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutGiftCardsAppend(alias: String) -> Storefront.CheckoutGiftCardsAppendPayload? { - return internalGetCheckoutGiftCardsAppend(alias: alias) - } - - func internalGetCheckoutGiftCardsAppend(alias: String? = nil) -> Storefront.CheckoutGiftCardsAppendPayload? { - return field(field: "checkoutGiftCardsAppend", aliasSuffix: alias) as! Storefront.CheckoutGiftCardsAppendPayload? - } - - /// Adds a list of line items to a checkout. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutLineItemsAdd: Storefront.CheckoutLineItemsAddPayload? { - return internalGetCheckoutLineItemsAdd() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutLineItemsAdd(alias: String) -> Storefront.CheckoutLineItemsAddPayload? { - return internalGetCheckoutLineItemsAdd(alias: alias) - } - - func internalGetCheckoutLineItemsAdd(alias: String? = nil) -> Storefront.CheckoutLineItemsAddPayload? { - return field(field: "checkoutLineItemsAdd", aliasSuffix: alias) as! Storefront.CheckoutLineItemsAddPayload? - } - - /// Removes line items from an existing checkout. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutLineItemsRemove: Storefront.CheckoutLineItemsRemovePayload? { - return internalGetCheckoutLineItemsRemove() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutLineItemsRemove(alias: String) -> Storefront.CheckoutLineItemsRemovePayload? { - return internalGetCheckoutLineItemsRemove(alias: alias) - } - - func internalGetCheckoutLineItemsRemove(alias: String? = nil) -> Storefront.CheckoutLineItemsRemovePayload? { - return field(field: "checkoutLineItemsRemove", aliasSuffix: alias) as! Storefront.CheckoutLineItemsRemovePayload? - } - - /// Sets a list of line items to a checkout. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutLineItemsReplace: Storefront.CheckoutLineItemsReplacePayload? { - return internalGetCheckoutLineItemsReplace() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutLineItemsReplace(alias: String) -> Storefront.CheckoutLineItemsReplacePayload? { - return internalGetCheckoutLineItemsReplace(alias: alias) - } - - func internalGetCheckoutLineItemsReplace(alias: String? = nil) -> Storefront.CheckoutLineItemsReplacePayload? { - return field(field: "checkoutLineItemsReplace", aliasSuffix: alias) as! Storefront.CheckoutLineItemsReplacePayload? - } - - /// Updates line items on a checkout. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutLineItemsUpdate: Storefront.CheckoutLineItemsUpdatePayload? { - return internalGetCheckoutLineItemsUpdate() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutLineItemsUpdate(alias: String) -> Storefront.CheckoutLineItemsUpdatePayload? { - return internalGetCheckoutLineItemsUpdate(alias: alias) - } - - func internalGetCheckoutLineItemsUpdate(alias: String? = nil) -> Storefront.CheckoutLineItemsUpdatePayload? { - return field(field: "checkoutLineItemsUpdate", aliasSuffix: alias) as! Storefront.CheckoutLineItemsUpdatePayload? - } - - /// Updates the shipping address of an existing checkout. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutShippingAddressUpdateV2: Storefront.CheckoutShippingAddressUpdateV2Payload? { - return internalGetCheckoutShippingAddressUpdateV2() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutShippingAddressUpdateV2(alias: String) -> Storefront.CheckoutShippingAddressUpdateV2Payload? { - return internalGetCheckoutShippingAddressUpdateV2(alias: alias) - } - - func internalGetCheckoutShippingAddressUpdateV2(alias: String? = nil) -> Storefront.CheckoutShippingAddressUpdateV2Payload? { - return field(field: "checkoutShippingAddressUpdateV2", aliasSuffix: alias) as! Storefront.CheckoutShippingAddressUpdateV2Payload? - } - - /// Updates the shipping lines on an existing checkout. - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - open var checkoutShippingLineUpdate: Storefront.CheckoutShippingLineUpdatePayload? { - return internalGetCheckoutShippingLineUpdate() - } - - @available(*, deprecated, message:"The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.") - - open func aliasedCheckoutShippingLineUpdate(alias: String) -> Storefront.CheckoutShippingLineUpdatePayload? { - return internalGetCheckoutShippingLineUpdate(alias: alias) - } - - func internalGetCheckoutShippingLineUpdate(alias: String? = nil) -> Storefront.CheckoutShippingLineUpdatePayload? { - return field(field: "checkoutShippingLineUpdate", aliasSuffix: alias) as! Storefront.CheckoutShippingLineUpdatePayload? - } - /// Creates a customer access token. The customer access token is required to /// modify the customer object in any way. open var customerAccessTokenCreate: Storefront.CustomerAccessTokenCreatePayload? { @@ -2170,6 +1469,32 @@ extension Storefront { return field(field: "customerUpdate", aliasSuffix: alias) as! Storefront.CustomerUpdatePayload? } + /// Create a new Shop Pay payment request session. + open var shopPayPaymentRequestSessionCreate: Storefront.ShopPayPaymentRequestSessionCreatePayload? { + return internalGetShopPayPaymentRequestSessionCreate() + } + + open func aliasedShopPayPaymentRequestSessionCreate(alias: String) -> Storefront.ShopPayPaymentRequestSessionCreatePayload? { + return internalGetShopPayPaymentRequestSessionCreate(alias: alias) + } + + func internalGetShopPayPaymentRequestSessionCreate(alias: String? = nil) -> Storefront.ShopPayPaymentRequestSessionCreatePayload? { + return field(field: "shopPayPaymentRequestSessionCreate", aliasSuffix: alias) as! Storefront.ShopPayPaymentRequestSessionCreatePayload? + } + + /// Submits a Shop Pay payment request session. + open var shopPayPaymentRequestSessionSubmit: Storefront.ShopPayPaymentRequestSessionSubmitPayload? { + return internalGetShopPayPaymentRequestSessionSubmit() + } + + open func aliasedShopPayPaymentRequestSessionSubmit(alias: String) -> Storefront.ShopPayPaymentRequestSessionSubmitPayload? { + return internalGetShopPayPaymentRequestSessionSubmit(alias: alias) + } + + func internalGetShopPayPaymentRequestSessionSubmit(alias: String? = nil) -> Storefront.ShopPayPaymentRequestSessionSubmitPayload? { + return field(field: "shopPayPaymentRequestSessionSubmit", aliasSuffix: alias) as! Storefront.ShopPayPaymentRequestSessionSubmitPayload? + } + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { var response: [GraphQL.AbstractResponse] = [] objectMap.keys.forEach { @@ -2180,6 +1505,12 @@ extension Storefront { response.append(contentsOf: value.childResponseObjectMap()) } + case "cartBillingAddressUpdate": + if let value = internalGetCartBillingAddressUpdate() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + case "cartBuyerIdentityUpdate": if let value = internalGetCartBuyerIdentityUpdate() { response.append(value) @@ -2198,6 +1529,12 @@ extension Storefront { response.append(contentsOf: value.childResponseObjectMap()) } + case "cartGiftCardCodesUpdate": + if let value = internalGetCartGiftCardCodesUpdate() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + case "cartLinesAdd": if let value = internalGetCartLinesAdd() { response.append(value) @@ -2252,114 +1589,6 @@ extension Storefront { response.append(contentsOf: value.childResponseObjectMap()) } - case "checkoutAttributesUpdateV2": - if let value = internalGetCheckoutAttributesUpdateV2() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutCompleteFree": - if let value = internalGetCheckoutCompleteFree() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutCompleteWithCreditCardV2": - if let value = internalGetCheckoutCompleteWithCreditCardV2() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutCompleteWithTokenizedPaymentV3": - if let value = internalGetCheckoutCompleteWithTokenizedPaymentV3() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutCreate": - if let value = internalGetCheckoutCreate() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutCustomerAssociateV2": - if let value = internalGetCheckoutCustomerAssociateV2() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutCustomerDisassociateV2": - if let value = internalGetCheckoutCustomerDisassociateV2() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutDiscountCodeApplyV2": - if let value = internalGetCheckoutDiscountCodeApplyV2() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutDiscountCodeRemove": - if let value = internalGetCheckoutDiscountCodeRemove() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutEmailUpdateV2": - if let value = internalGetCheckoutEmailUpdateV2() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutGiftCardRemoveV2": - if let value = internalGetCheckoutGiftCardRemoveV2() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutGiftCardsAppend": - if let value = internalGetCheckoutGiftCardsAppend() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutLineItemsAdd": - if let value = internalGetCheckoutLineItemsAdd() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutLineItemsRemove": - if let value = internalGetCheckoutLineItemsRemove() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutLineItemsReplace": - if let value = internalGetCheckoutLineItemsReplace() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutLineItemsUpdate": - if let value = internalGetCheckoutLineItemsUpdate() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutShippingAddressUpdateV2": - if let value = internalGetCheckoutShippingAddressUpdateV2() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkoutShippingLineUpdate": - if let value = internalGetCheckoutShippingLineUpdate() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - case "customerAccessTokenCreate": if let value = internalGetCustomerAccessTokenCreate() { response.append(value) @@ -2450,6 +1679,18 @@ extension Storefront { response.append(contentsOf: value.childResponseObjectMap()) } + case "shopPayPaymentRequestSessionCreate": + if let value = internalGetShopPayPaymentRequestSessionCreate() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + + case "shopPayPaymentRequestSessionSubmit": + if let value = internalGetShopPayPaymentRequestSessionSubmit() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + default: break } diff --git a/Buy/Generated/Storefront/Node.swift b/Buy/Generated/Storefront/Node.swift index 8b1262b6..3d859672 100644 --- a/Buy/Generated/Storefront/Node.swift +++ b/Buy/Generated/Storefront/Node.swift @@ -135,36 +135,6 @@ extension Storefront { return self } - /// An object with an ID field to support global identification, in accordance - /// with the [Relay - /// specification](https://relay.dev/graphql/objectidentification.htm#sec-Node-Interface). - /// This interface is used by the - /// [node](https://shopify.dev/api/admin-graphql/unstable/queries/node) and - /// [nodes](https://shopify.dev/api/admin-graphql/unstable/queries/nodes) - /// queries. - @discardableResult - open func onCheckout(subfields: (CheckoutQuery) -> Void) -> NodeQuery { - let subquery = CheckoutQuery() - subfields(subquery) - addInlineFragment(on: "Checkout", subfields: subquery) - return self - } - - /// An object with an ID field to support global identification, in accordance - /// with the [Relay - /// specification](https://relay.dev/graphql/objectidentification.htm#sec-Node-Interface). - /// This interface is used by the - /// [node](https://shopify.dev/api/admin-graphql/unstable/queries/node) and - /// [nodes](https://shopify.dev/api/admin-graphql/unstable/queries/nodes) - /// queries. - @discardableResult - open func onCheckoutLineItem(subfields: (CheckoutLineItemQuery) -> Void) -> NodeQuery { - let subquery = CheckoutLineItemQuery() - subfields(subquery) - addInlineFragment(on: "CheckoutLineItem", subfields: subquery) - return self - } - /// An object with an ID field to support global identification, in accordance /// with the [Relay /// specification](https://relay.dev/graphql/objectidentification.htm#sec-Node-Interface). @@ -473,10 +443,10 @@ extension Storefront { /// [nodes](https://shopify.dev/api/admin-graphql/unstable/queries/nodes) /// queries. @discardableResult - open func onPayment(subfields: (PaymentQuery) -> Void) -> NodeQuery { - let subquery = PaymentQuery() + open func onProduct(subfields: (ProductQuery) -> Void) -> NodeQuery { + let subquery = ProductQuery() subfields(subquery) - addInlineFragment(on: "Payment", subfields: subquery) + addInlineFragment(on: "Product", subfields: subquery) return self } @@ -488,10 +458,10 @@ extension Storefront { /// [nodes](https://shopify.dev/api/admin-graphql/unstable/queries/nodes) /// queries. @discardableResult - open func onProduct(subfields: (ProductQuery) -> Void) -> NodeQuery { - let subquery = ProductQuery() + open func onProductOption(subfields: (ProductOptionQuery) -> Void) -> NodeQuery { + let subquery = ProductOptionQuery() subfields(subquery) - addInlineFragment(on: "Product", subfields: subquery) + addInlineFragment(on: "ProductOption", subfields: subquery) return self } @@ -503,10 +473,10 @@ extension Storefront { /// [nodes](https://shopify.dev/api/admin-graphql/unstable/queries/nodes) /// queries. @discardableResult - open func onProductOption(subfields: (ProductOptionQuery) -> Void) -> NodeQuery { - let subquery = ProductOptionQuery() + open func onProductOptionValue(subfields: (ProductOptionValueQuery) -> Void) -> NodeQuery { + let subquery = ProductOptionValueQuery() subfields(subquery) - addInlineFragment(on: "ProductOption", subfields: subquery) + addInlineFragment(on: "ProductOptionValue", subfields: subquery) return self } @@ -625,10 +595,6 @@ extension Storefront { case "CartLine": return try CartLine.init(fields: fields) - case "Checkout": return try Checkout.init(fields: fields) - - case "CheckoutLineItem": return try CheckoutLineItem.init(fields: fields) - case "Collection": return try Collection.init(fields: fields) case "Comment": return try Comment.init(fields: fields) @@ -669,12 +635,12 @@ extension Storefront { case "Page": return try Page.init(fields: fields) - case "Payment": return try Payment.init(fields: fields) - case "Product": return try Product.init(fields: fields) case "ProductOption": return try ProductOption.init(fields: fields) + case "ProductOptionValue": return try ProductOptionValue.init(fields: fields) + case "ProductVariant": return try ProductVariant.init(fields: fields) case "Shop": return try Shop.init(fields: fields) diff --git a/Buy/Generated/Storefront/Order.swift b/Buy/Generated/Storefront/Order.swift index c3d0bc6e..ab2f1513 100644 --- a/Buy/Generated/Storefront/Order.swift +++ b/Buy/Generated/Storefront/Order.swift @@ -101,6 +101,18 @@ extension Storefront { return self } + /// The total cost of shipping, excluding shipping lines that have been + /// refunded or removed. Taxes aren't included unless the order is a + /// taxes-included order. + @discardableResult + open func currentTotalShippingPrice(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> OrderQuery { + let subquery = MoneyV2Query() + subfields(subquery) + + addField(field: "currentTotalShippingPrice", aliasSuffix: alias, subfields: subquery) + return self + } + /// The total of all taxes applied to the order, excluding taxes for returned /// line items. @discardableResult @@ -569,6 +581,12 @@ extension Storefront { } return try MoneyV2(fields: value) + case "currentTotalShippingPrice": + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) + } + return try MoneyV2(fields: value) + case "currentTotalTax": guard let value = value as? [String: Any] else { throw SchemaViolationError(type: Order.self, field: fieldName, value: fieldValue) @@ -858,6 +876,17 @@ extension Storefront { return field(field: "currentTotalPrice", aliasSuffix: alias) as! Storefront.MoneyV2 } + /// The total cost of shipping, excluding shipping lines that have been + /// refunded or removed. Taxes aren't included unless the order is a + /// taxes-included order. + open var currentTotalShippingPrice: Storefront.MoneyV2 { + return internalGetCurrentTotalShippingPrice() + } + + func internalGetCurrentTotalShippingPrice(alias: String? = nil) -> Storefront.MoneyV2 { + return field(field: "currentTotalShippingPrice", aliasSuffix: alias) as! Storefront.MoneyV2 + } + /// The total of all taxes applied to the order, excluding taxes for returned /// line items. open var currentTotalTax: Storefront.MoneyV2 { @@ -1213,6 +1242,10 @@ extension Storefront { response.append(internalGetCurrentTotalPrice()) response.append(contentsOf: internalGetCurrentTotalPrice().childResponseObjectMap()) + case "currentTotalShippingPrice": + response.append(internalGetCurrentTotalShippingPrice()) + response.append(contentsOf: internalGetCurrentTotalShippingPrice().childResponseObjectMap()) + case "currentTotalTax": response.append(internalGetCurrentTotalTax()) response.append(contentsOf: internalGetCurrentTotalTax().childResponseObjectMap()) diff --git a/Buy/Generated/Storefront/Payment.swift b/Buy/Generated/Storefront/Payment.swift deleted file mode 100644 index fc8d2f20..00000000 --- a/Buy/Generated/Storefront/Payment.swift +++ /dev/null @@ -1,388 +0,0 @@ -// -// Payment.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// A payment applied to a checkout. - open class PaymentQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = Payment - - /// The amount of the payment. - @discardableResult - open func amount(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> PaymentQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "amount", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The amount of the payment. - @available(*, deprecated, message:"Use `amount` instead.") - @discardableResult - open func amountV2(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> PaymentQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "amountV2", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The billing address for the payment. - @discardableResult - open func billingAddress(alias: String? = nil, _ subfields: (MailingAddressQuery) -> Void) -> PaymentQuery { - let subquery = MailingAddressQuery() - subfields(subquery) - - addField(field: "billingAddress", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The checkout to which the payment belongs. - @discardableResult - open func checkout(alias: String? = nil, _ subfields: (CheckoutQuery) -> Void) -> PaymentQuery { - let subquery = CheckoutQuery() - subfields(subquery) - - addField(field: "checkout", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The credit card used for the payment in the case of direct payments. - @discardableResult - open func creditCard(alias: String? = nil, _ subfields: (CreditCardQuery) -> Void) -> PaymentQuery { - let subquery = CreditCardQuery() - subfields(subquery) - - addField(field: "creditCard", aliasSuffix: alias, subfields: subquery) - return self - } - - /// A message describing a processing error during asynchronous processing. - @discardableResult - open func errorMessage(alias: String? = nil) -> PaymentQuery { - addField(field: "errorMessage", aliasSuffix: alias) - return self - } - - /// A globally-unique ID. - @discardableResult - open func id(alias: String? = nil) -> PaymentQuery { - addField(field: "id", aliasSuffix: alias) - return self - } - - /// A client-side generated token to identify a payment and perform idempotent - /// operations. For more information, refer to [Idempotent - /// requests](https://shopify.dev/api/usage/idempotent-requests). - @discardableResult - open func idempotencyKey(alias: String? = nil) -> PaymentQuery { - addField(field: "idempotencyKey", aliasSuffix: alias) - return self - } - - /// The URL where the customer needs to be redirected so they can complete the - /// 3D Secure payment flow. - @discardableResult - open func nextActionUrl(alias: String? = nil) -> PaymentQuery { - addField(field: "nextActionUrl", aliasSuffix: alias) - return self - } - - /// Whether the payment is still processing asynchronously. - @discardableResult - open func ready(alias: String? = nil) -> PaymentQuery { - addField(field: "ready", aliasSuffix: alias) - return self - } - - /// A flag to indicate if the payment is to be done in test mode for gateways - /// that support it. - @discardableResult - open func test(alias: String? = nil) -> PaymentQuery { - addField(field: "test", aliasSuffix: alias) - return self - } - - /// The actual transaction recorded by Shopify after having processed the - /// payment with the gateway. - @discardableResult - open func transaction(alias: String? = nil, _ subfields: (TransactionQuery) -> Void) -> PaymentQuery { - let subquery = TransactionQuery() - subfields(subquery) - - addField(field: "transaction", aliasSuffix: alias, subfields: subquery) - return self - } - } - - /// A payment applied to a checkout. - open class Payment: GraphQL.AbstractResponse, GraphQLObject, Node { - public typealias Query = PaymentQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "amount": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "amountV2": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "billingAddress": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) - } - return try MailingAddress(fields: value) - - case "checkout": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) - } - return try Checkout(fields: value) - - case "creditCard": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) - } - return try CreditCard(fields: value) - - case "errorMessage": - if value is NSNull { return nil } - guard let value = value as? String else { - throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) - } - return value - - case "id": - guard let value = value as? String else { - throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) - } - return GraphQL.ID(rawValue: value) - - case "idempotencyKey": - if value is NSNull { return nil } - guard let value = value as? String else { - throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) - } - return value - - case "nextActionUrl": - if value is NSNull { return nil } - guard let value = value as? String else { - throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) - } - return URL(string: value)! - - case "ready": - guard let value = value as? Bool else { - throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) - } - return value - - case "test": - guard let value = value as? Bool else { - throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) - } - return value - - case "transaction": - if value is NSNull { return nil } - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) - } - return try Transaction(fields: value) - - default: - throw SchemaViolationError(type: Payment.self, field: fieldName, value: fieldValue) - } - } - - /// The amount of the payment. - open var amount: Storefront.MoneyV2 { - return internalGetAmount() - } - - func internalGetAmount(alias: String? = nil) -> Storefront.MoneyV2 { - return field(field: "amount", aliasSuffix: alias) as! Storefront.MoneyV2 - } - - /// The amount of the payment. - @available(*, deprecated, message:"Use `amount` instead.") - open var amountV2: Storefront.MoneyV2 { - return internalGetAmountV2() - } - - func internalGetAmountV2(alias: String? = nil) -> Storefront.MoneyV2 { - return field(field: "amountV2", aliasSuffix: alias) as! Storefront.MoneyV2 - } - - /// The billing address for the payment. - open var billingAddress: Storefront.MailingAddress? { - return internalGetBillingAddress() - } - - func internalGetBillingAddress(alias: String? = nil) -> Storefront.MailingAddress? { - return field(field: "billingAddress", aliasSuffix: alias) as! Storefront.MailingAddress? - } - - /// The checkout to which the payment belongs. - open var checkout: Storefront.Checkout { - return internalGetCheckout() - } - - func internalGetCheckout(alias: String? = nil) -> Storefront.Checkout { - return field(field: "checkout", aliasSuffix: alias) as! Storefront.Checkout - } - - /// The credit card used for the payment in the case of direct payments. - open var creditCard: Storefront.CreditCard? { - return internalGetCreditCard() - } - - func internalGetCreditCard(alias: String? = nil) -> Storefront.CreditCard? { - return field(field: "creditCard", aliasSuffix: alias) as! Storefront.CreditCard? - } - - /// A message describing a processing error during asynchronous processing. - open var errorMessage: String? { - return internalGetErrorMessage() - } - - func internalGetErrorMessage(alias: String? = nil) -> String? { - return field(field: "errorMessage", aliasSuffix: alias) as! String? - } - - /// A globally-unique ID. - open var id: GraphQL.ID { - return internalGetId() - } - - func internalGetId(alias: String? = nil) -> GraphQL.ID { - return field(field: "id", aliasSuffix: alias) as! GraphQL.ID - } - - /// A client-side generated token to identify a payment and perform idempotent - /// operations. For more information, refer to [Idempotent - /// requests](https://shopify.dev/api/usage/idempotent-requests). - open var idempotencyKey: String? { - return internalGetIdempotencyKey() - } - - func internalGetIdempotencyKey(alias: String? = nil) -> String? { - return field(field: "idempotencyKey", aliasSuffix: alias) as! String? - } - - /// The URL where the customer needs to be redirected so they can complete the - /// 3D Secure payment flow. - open var nextActionUrl: URL? { - return internalGetNextActionUrl() - } - - func internalGetNextActionUrl(alias: String? = nil) -> URL? { - return field(field: "nextActionUrl", aliasSuffix: alias) as! URL? - } - - /// Whether the payment is still processing asynchronously. - open var ready: Bool { - return internalGetReady() - } - - func internalGetReady(alias: String? = nil) -> Bool { - return field(field: "ready", aliasSuffix: alias) as! Bool - } - - /// A flag to indicate if the payment is to be done in test mode for gateways - /// that support it. - open var test: Bool { - return internalGetTest() - } - - func internalGetTest(alias: String? = nil) -> Bool { - return field(field: "test", aliasSuffix: alias) as! Bool - } - - /// The actual transaction recorded by Shopify after having processed the - /// payment with the gateway. - open var transaction: Storefront.Transaction? { - return internalGetTransaction() - } - - func internalGetTransaction(alias: String? = nil) -> Storefront.Transaction? { - return field(field: "transaction", aliasSuffix: alias) as! Storefront.Transaction? - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "amount": - response.append(internalGetAmount()) - response.append(contentsOf: internalGetAmount().childResponseObjectMap()) - - case "amountV2": - response.append(internalGetAmountV2()) - response.append(contentsOf: internalGetAmountV2().childResponseObjectMap()) - - case "billingAddress": - if let value = internalGetBillingAddress() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "checkout": - response.append(internalGetCheckout()) - response.append(contentsOf: internalGetCheckout().childResponseObjectMap()) - - case "creditCard": - if let value = internalGetCreditCard() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - case "transaction": - if let value = internalGetTransaction() { - response.append(value) - response.append(contentsOf: value.childResponseObjectMap()) - } - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/TransactionKind.swift b/Buy/Generated/Storefront/PreferenceDeliveryMethodType.swift similarity index 64% rename from Buy/Generated/Storefront/TransactionKind.swift rename to Buy/Generated/Storefront/PreferenceDeliveryMethodType.swift index 7902231e..b6afeb2a 100644 --- a/Buy/Generated/Storefront/TransactionKind.swift +++ b/Buy/Generated/Storefront/PreferenceDeliveryMethodType.swift @@ -1,5 +1,5 @@ // -// TransactionKind.swift +// PreferenceDeliveryMethodType.swift // Buy // // Created by Shopify. @@ -27,23 +27,20 @@ import Foundation extension Storefront { - /// The different kinds of order transactions. - public enum TransactionKind: String { - /// An amount reserved against the cardholder's funding source. Money does not - /// change hands until the authorization is captured. - case authorization = "AUTHORIZATION" + /// The preferred delivery methods such as shipping, local pickup or through + /// pickup points. + public enum PreferenceDeliveryMethodType: String { + /// A delivery method used to let buyers collect purchases at designated + /// locations like parcel lockers. + case pickupPoint = "PICKUP_POINT" - /// A transfer of the money that was reserved during the authorization stage. - case capture = "CAPTURE" + /// A delivery method used to let buyers receive items directly from a specific + /// location within an area. + case pickUp = "PICK_UP" - /// Money returned to the customer when they have paid too much. - case change = "CHANGE" - - /// An authorization for a payment taken with an EMV credit card reader. - case emvAuthorization = "EMV_AUTHORIZATION" - - /// An authorization and capture performed together in a single step. - case sale = "SALE" + /// A delivery method used to send items directly to a buyer’s specified + /// address. + case shipping = "SHIPPING" case unknownValue = "" } diff --git a/Buy/Generated/Storefront/ProductOption.swift b/Buy/Generated/Storefront/ProductOption.swift index ce8eb2f7..739ba34d 100644 --- a/Buy/Generated/Storefront/ProductOption.swift +++ b/Buy/Generated/Storefront/ProductOption.swift @@ -47,7 +47,18 @@ extension Storefront { return self } + /// The corresponding option value to the product option. + @discardableResult + open func optionValues(alias: String? = nil, _ subfields: (ProductOptionValueQuery) -> Void) -> ProductOptionQuery { + let subquery = ProductOptionValueQuery() + subfields(subquery) + + addField(field: "optionValues", aliasSuffix: alias, subfields: subquery) + return self + } + /// The corresponding value to the product option name. + @available(*, deprecated, message:"Use `optionValues` instead.") @discardableResult open func values(alias: String? = nil) -> ProductOptionQuery { addField(field: "values", aliasSuffix: alias) @@ -76,6 +87,12 @@ extension Storefront { } return value + case "optionValues": + guard let value = value as? [[String: Any]] else { + throw SchemaViolationError(type: ProductOption.self, field: fieldName, value: fieldValue) + } + return try value.map { return try ProductOptionValue(fields: $0) } + case "values": guard let value = value as? [String] else { throw SchemaViolationError(type: ProductOption.self, field: fieldName, value: fieldValue) @@ -105,7 +122,17 @@ extension Storefront { return field(field: "name", aliasSuffix: alias) as! String } + /// The corresponding option value to the product option. + open var optionValues: [Storefront.ProductOptionValue] { + return internalGetOptionValues() + } + + func internalGetOptionValues(alias: String? = nil) -> [Storefront.ProductOptionValue] { + return field(field: "optionValues", aliasSuffix: alias) as! [Storefront.ProductOptionValue] + } + /// The corresponding value to the product option name. + @available(*, deprecated, message:"Use `optionValues` instead.") open var values: [String] { return internalGetValues() } diff --git a/Buy/Generated/Storefront/ProductOptionValue.swift b/Buy/Generated/Storefront/ProductOptionValue.swift new file mode 100644 index 00000000..0dc30144 --- /dev/null +++ b/Buy/Generated/Storefront/ProductOptionValue.swift @@ -0,0 +1,136 @@ +// +// ProductOptionValue.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// The product option value names. For example, "Red", "Blue", and "Green" for + /// a "Color" option. + open class ProductOptionValueQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ProductOptionValue + + /// A globally-unique ID. + @discardableResult + open func id(alias: String? = nil) -> ProductOptionValueQuery { + addField(field: "id", aliasSuffix: alias) + return self + } + + /// The name of the product option value. + @discardableResult + open func name(alias: String? = nil) -> ProductOptionValueQuery { + addField(field: "name", aliasSuffix: alias) + return self + } + + /// The swatch of the product option value. + @discardableResult + open func swatch(alias: String? = nil, _ subfields: (ProductOptionValueSwatchQuery) -> Void) -> ProductOptionValueQuery { + let subquery = ProductOptionValueSwatchQuery() + subfields(subquery) + + addField(field: "swatch", aliasSuffix: alias, subfields: subquery) + return self + } + } + + /// The product option value names. For example, "Red", "Blue", and "Green" for + /// a "Color" option. + open class ProductOptionValue: GraphQL.AbstractResponse, GraphQLObject, Node { + public typealias Query = ProductOptionValueQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "id": + guard let value = value as? String else { + throw SchemaViolationError(type: ProductOptionValue.self, field: fieldName, value: fieldValue) + } + return GraphQL.ID(rawValue: value) + + case "name": + guard let value = value as? String else { + throw SchemaViolationError(type: ProductOptionValue.self, field: fieldName, value: fieldValue) + } + return value + + case "swatch": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ProductOptionValue.self, field: fieldName, value: fieldValue) + } + return try ProductOptionValueSwatch(fields: value) + + default: + throw SchemaViolationError(type: ProductOptionValue.self, field: fieldName, value: fieldValue) + } + } + + /// A globally-unique ID. + open var id: GraphQL.ID { + return internalGetId() + } + + func internalGetId(alias: String? = nil) -> GraphQL.ID { + return field(field: "id", aliasSuffix: alias) as! GraphQL.ID + } + + /// The name of the product option value. + open var name: String { + return internalGetName() + } + + func internalGetName(alias: String? = nil) -> String { + return field(field: "name", aliasSuffix: alias) as! String + } + + /// The swatch of the product option value. + open var swatch: Storefront.ProductOptionValueSwatch? { + return internalGetSwatch() + } + + func internalGetSwatch(alias: String? = nil) -> Storefront.ProductOptionValueSwatch? { + return field(field: "swatch", aliasSuffix: alias) as! Storefront.ProductOptionValueSwatch? + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + var response: [GraphQL.AbstractResponse] = [] + objectMap.keys.forEach { + switch($0) { + case "swatch": + if let value = internalGetSwatch() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + + default: + break + } + } + return response + } + } +} diff --git a/Buy/Generated/Storefront/ProductOptionValueSwatch.swift b/Buy/Generated/Storefront/ProductOptionValueSwatch.swift new file mode 100644 index 00000000..812b5959 --- /dev/null +++ b/Buy/Generated/Storefront/ProductOptionValueSwatch.swift @@ -0,0 +1,113 @@ +// +// ProductOptionValueSwatch.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// The product option value swatch. + open class ProductOptionValueSwatchQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ProductOptionValueSwatch + + /// The swatch color. + @discardableResult + open func color(alias: String? = nil) -> ProductOptionValueSwatchQuery { + addField(field: "color", aliasSuffix: alias) + return self + } + + /// The swatch image. + @discardableResult + open func image(alias: String? = nil, _ subfields: (MediaQuery) -> Void) -> ProductOptionValueSwatchQuery { + let subquery = MediaQuery() + subfields(subquery) + + addField(field: "image", aliasSuffix: alias, subfields: subquery) + return self + } + } + + /// The product option value swatch. + open class ProductOptionValueSwatch: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = ProductOptionValueSwatchQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "color": + if value is NSNull { return nil } + guard let value = value as? String else { + throw SchemaViolationError(type: ProductOptionValueSwatch.self, field: fieldName, value: fieldValue) + } + return value + + case "image": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ProductOptionValueSwatch.self, field: fieldName, value: fieldValue) + } + return try UnknownMedia.create(fields: value) + + default: + throw SchemaViolationError(type: ProductOptionValueSwatch.self, field: fieldName, value: fieldValue) + } + } + + /// The swatch color. + open var color: String? { + return internalGetColor() + } + + func internalGetColor(alias: String? = nil) -> String? { + return field(field: "color", aliasSuffix: alias) as! String? + } + + /// The swatch image. + open var image: Media? { + return internalGetImage() + } + + func internalGetImage(alias: String? = nil) -> Media? { + return field(field: "image", aliasSuffix: alias) as! Media? + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + var response: [GraphQL.AbstractResponse] = [] + objectMap.keys.forEach { + switch($0) { + case "image": + if let value = internalGetImage() { + response.append((value as! GraphQL.AbstractResponse)) + response.append(contentsOf: (value as! GraphQL.AbstractResponse).childResponseObjectMap()) + } + + default: + break + } + } + return response + } + } +} diff --git a/Buy/Generated/Storefront/ProductVariant.swift b/Buy/Generated/Storefront/ProductVariant.swift index 04431612..3fcda0c3 100644 --- a/Buy/Generated/Storefront/ProductVariant.swift +++ b/Buy/Generated/Storefront/ProductVariant.swift @@ -69,6 +69,44 @@ extension Storefront { return self } + /// List of bundles components included in the variant considering only fixed + /// bundles. + /// + /// - parameters: + /// - first: Returns up to the first `n` elements from the list. + /// - after: Returns the elements that come after the specified cursor. + /// - last: Returns up to the last `n` elements from the list. + /// - before: Returns the elements that come before the specified cursor. + /// + @discardableResult + open func components(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, _ subfields: (ProductVariantComponentConnectionQuery) -> Void) -> ProductVariantQuery { + var args: [String] = [] + + if let first = first { + args.append("first:\(first)") + } + + if let after = after { + args.append("after:\(GraphQL.quoteString(input: after))") + } + + if let last = last { + args.append("last:\(last)") + } + + if let before = before { + args.append("before:\(GraphQL.quoteString(input: before))") + } + + let argsString: String? = args.isEmpty ? nil : "(\(args.joined(separator: ",")))" + + let subquery = ProductVariantComponentConnectionQuery() + subfields(subquery) + + addField(field: "components", aliasSuffix: alias, args: argsString, subfields: subquery) + return self + } + /// Whether a product is out of stock but still available for purchase (used /// for backorders). @discardableResult @@ -77,6 +115,43 @@ extension Storefront { return self } + /// List of bundles that include this variant considering only fixed bundles. + /// + /// - parameters: + /// - first: Returns up to the first `n` elements from the list. + /// - after: Returns the elements that come after the specified cursor. + /// - last: Returns up to the last `n` elements from the list. + /// - before: Returns the elements that come before the specified cursor. + /// + @discardableResult + open func groupedBy(alias: String? = nil, first: Int32? = nil, after: String? = nil, last: Int32? = nil, before: String? = nil, _ subfields: (ProductVariantConnectionQuery) -> Void) -> ProductVariantQuery { + var args: [String] = [] + + if let first = first { + args.append("first:\(first)") + } + + if let after = after { + args.append("after:\(GraphQL.quoteString(input: after))") + } + + if let last = last { + args.append("last:\(last)") + } + + if let before = before { + args.append("before:\(GraphQL.quoteString(input: before))") + } + + let argsString: String? = args.isEmpty ? nil : "(\(args.joined(separator: ",")))" + + let subquery = ProductVariantConnectionQuery() + subfields(subquery) + + addField(field: "groupedBy", aliasSuffix: alias, args: argsString, subfields: subquery) + return self + } + /// A globally-unique ID. @discardableResult open func id(alias: String? = nil) -> ProductVariantQuery { @@ -228,6 +303,15 @@ extension Storefront { return self } + /// Whether a product variant requires components. The default value is + /// `false`. If `true`, then the product variant can only be purchased as a + /// parent bundle with components. + @discardableResult + open func requiresComponents(alias: String? = nil) -> ProductVariantQuery { + addField(field: "requiresComponents", aliasSuffix: alias) + return self + } + /// Whether a customer needs to provide a shipping address when placing an /// order for the product variant. @discardableResult @@ -429,12 +513,24 @@ extension Storefront { } return try MoneyV2(fields: value) + case "components": + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) + } + return try ProductVariantComponentConnection(fields: value) + case "currentlyNotInStock": guard let value = value as? Bool else { throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) } return value + case "groupedBy": + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) + } + return try ProductVariantConnection(fields: value) + case "id": guard let value = value as? String else { throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) @@ -502,6 +598,12 @@ extension Storefront { } return try QuantityRule(fields: value) + case "requiresComponents": + guard let value = value as? Bool else { + throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) + } + return value + case "requiresShipping": guard let value = value as? Bool else { throw SchemaViolationError(type: ProductVariant.self, field: fieldName, value: fieldValue) @@ -616,6 +718,20 @@ extension Storefront { return field(field: "compareAtPriceV2", aliasSuffix: alias) as! Storefront.MoneyV2? } + /// List of bundles components included in the variant considering only fixed + /// bundles. + open var components: Storefront.ProductVariantComponentConnection { + return internalGetComponents() + } + + open func aliasedComponents(alias: String) -> Storefront.ProductVariantComponentConnection { + return internalGetComponents(alias: alias) + } + + func internalGetComponents(alias: String? = nil) -> Storefront.ProductVariantComponentConnection { + return field(field: "components", aliasSuffix: alias) as! Storefront.ProductVariantComponentConnection + } + /// Whether a product is out of stock but still available for purchase (used /// for backorders). open var currentlyNotInStock: Bool { @@ -626,6 +742,19 @@ extension Storefront { return field(field: "currentlyNotInStock", aliasSuffix: alias) as! Bool } + /// List of bundles that include this variant considering only fixed bundles. + open var groupedBy: Storefront.ProductVariantConnection { + return internalGetGroupedBy() + } + + open func aliasedGroupedBy(alias: String) -> Storefront.ProductVariantConnection { + return internalGetGroupedBy(alias: alias) + } + + func internalGetGroupedBy(alias: String? = nil) -> Storefront.ProductVariantConnection { + return field(field: "groupedBy", aliasSuffix: alias) as! Storefront.ProductVariantConnection + } + /// A globally-unique ID. open var id: GraphQL.ID { return internalGetId() @@ -731,6 +860,17 @@ extension Storefront { return field(field: "quantityRule", aliasSuffix: alias) as! Storefront.QuantityRule } + /// Whether a product variant requires components. The default value is + /// `false`. If `true`, then the product variant can only be purchased as a + /// parent bundle with components. + open var requiresComponents: Bool { + return internalGetRequiresComponents() + } + + func internalGetRequiresComponents(alias: String? = nil) -> Bool { + return field(field: "requiresComponents", aliasSuffix: alias) as! Bool + } + /// Whether a customer needs to provide a shipping address when placing an /// order for the product variant. open var requiresShipping: Bool { @@ -858,6 +998,14 @@ extension Storefront { response.append(contentsOf: value.childResponseObjectMap()) } + case "components": + response.append(internalGetComponents()) + response.append(contentsOf: internalGetComponents().childResponseObjectMap()) + + case "groupedBy": + response.append(internalGetGroupedBy()) + response.append(contentsOf: internalGetGroupedBy().childResponseObjectMap()) + case "image": if let value = internalGetImage() { response.append(value) diff --git a/Buy/Generated/Storefront/ProductVariantComponent.swift b/Buy/Generated/Storefront/ProductVariantComponent.swift new file mode 100644 index 00000000..b6521aa9 --- /dev/null +++ b/Buy/Generated/Storefront/ProductVariantComponent.swift @@ -0,0 +1,109 @@ +// +// ProductVariantComponent.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Represents a component of a bundle variant. + open class ProductVariantComponentQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ProductVariantComponent + + /// The product variant object that the component belongs to. + @discardableResult + open func productVariant(alias: String? = nil, _ subfields: (ProductVariantQuery) -> Void) -> ProductVariantComponentQuery { + let subquery = ProductVariantQuery() + subfields(subquery) + + addField(field: "productVariant", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The quantity of component present in the bundle. + @discardableResult + open func quantity(alias: String? = nil) -> ProductVariantComponentQuery { + addField(field: "quantity", aliasSuffix: alias) + return self + } + } + + /// Represents a component of a bundle variant. + open class ProductVariantComponent: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = ProductVariantComponentQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "productVariant": + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ProductVariantComponent.self, field: fieldName, value: fieldValue) + } + return try ProductVariant(fields: value) + + case "quantity": + guard let value = value as? Int else { + throw SchemaViolationError(type: ProductVariantComponent.self, field: fieldName, value: fieldValue) + } + return Int32(value) + + default: + throw SchemaViolationError(type: ProductVariantComponent.self, field: fieldName, value: fieldValue) + } + } + + /// The product variant object that the component belongs to. + open var productVariant: Storefront.ProductVariant { + return internalGetProductVariant() + } + + func internalGetProductVariant(alias: String? = nil) -> Storefront.ProductVariant { + return field(field: "productVariant", aliasSuffix: alias) as! Storefront.ProductVariant + } + + /// The quantity of component present in the bundle. + open var quantity: Int32 { + return internalGetQuantity() + } + + func internalGetQuantity(alias: String? = nil) -> Int32 { + return field(field: "quantity", aliasSuffix: alias) as! Int32 + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + var response: [GraphQL.AbstractResponse] = [] + objectMap.keys.forEach { + switch($0) { + case "productVariant": + response.append(internalGetProductVariant()) + response.append(contentsOf: internalGetProductVariant().childResponseObjectMap()) + + default: + break + } + } + return response + } + } +} diff --git a/Buy/Generated/Storefront/CheckoutLineItemConnection.swift b/Buy/Generated/Storefront/ProductVariantComponentConnection.swift similarity index 62% rename from Buy/Generated/Storefront/CheckoutLineItemConnection.swift rename to Buy/Generated/Storefront/ProductVariantComponentConnection.swift index c2e3ab38..dce9368b 100644 --- a/Buy/Generated/Storefront/CheckoutLineItemConnection.swift +++ b/Buy/Generated/Storefront/ProductVariantComponentConnection.swift @@ -1,5 +1,5 @@ // -// CheckoutLineItemConnection.swift +// ProductVariantComponentConnection.swift // Buy // // Created by Shopify. @@ -27,24 +27,25 @@ import Foundation extension Storefront { - /// An auto-generated type for paginating through multiple CheckoutLineItems. - open class CheckoutLineItemConnectionQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutLineItemConnection + /// An auto-generated type for paginating through multiple + /// ProductVariantComponents. + open class ProductVariantComponentConnectionQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ProductVariantComponentConnection /// A list of edges. @discardableResult - open func edges(alias: String? = nil, _ subfields: (CheckoutLineItemEdgeQuery) -> Void) -> CheckoutLineItemConnectionQuery { - let subquery = CheckoutLineItemEdgeQuery() + open func edges(alias: String? = nil, _ subfields: (ProductVariantComponentEdgeQuery) -> Void) -> ProductVariantComponentConnectionQuery { + let subquery = ProductVariantComponentEdgeQuery() subfields(subquery) addField(field: "edges", aliasSuffix: alias, subfields: subquery) return self } - /// A list of the nodes contained in CheckoutLineItemEdge. + /// A list of the nodes contained in ProductVariantComponentEdge. @discardableResult - open func nodes(alias: String? = nil, _ subfields: (CheckoutLineItemQuery) -> Void) -> CheckoutLineItemConnectionQuery { - let subquery = CheckoutLineItemQuery() + open func nodes(alias: String? = nil, _ subfields: (ProductVariantComponentQuery) -> Void) -> ProductVariantComponentConnectionQuery { + let subquery = ProductVariantComponentQuery() subfields(subquery) addField(field: "nodes", aliasSuffix: alias, subfields: subquery) @@ -53,7 +54,7 @@ extension Storefront { /// Information to aid in pagination. @discardableResult - open func pageInfo(alias: String? = nil, _ subfields: (PageInfoQuery) -> Void) -> CheckoutLineItemConnectionQuery { + open func pageInfo(alias: String? = nil, _ subfields: (PageInfoQuery) -> Void) -> ProductVariantComponentConnectionQuery { let subquery = PageInfoQuery() subfields(subquery) @@ -62,52 +63,53 @@ extension Storefront { } } - /// An auto-generated type for paginating through multiple CheckoutLineItems. - open class CheckoutLineItemConnection: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutLineItemConnectionQuery + /// An auto-generated type for paginating through multiple + /// ProductVariantComponents. + open class ProductVariantComponentConnection: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = ProductVariantComponentConnectionQuery internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { let fieldValue = value switch fieldName { case "edges": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutLineItemConnection.self, field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariantComponentConnection.self, field: fieldName, value: fieldValue) } - return try value.map { return try CheckoutLineItemEdge(fields: $0) } + return try value.map { return try ProductVariantComponentEdge(fields: $0) } case "nodes": guard let value = value as? [[String: Any]] else { - throw SchemaViolationError(type: CheckoutLineItemConnection.self, field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariantComponentConnection.self, field: fieldName, value: fieldValue) } - return try value.map { return try CheckoutLineItem(fields: $0) } + return try value.map { return try ProductVariantComponent(fields: $0) } case "pageInfo": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutLineItemConnection.self, field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariantComponentConnection.self, field: fieldName, value: fieldValue) } return try PageInfo(fields: value) default: - throw SchemaViolationError(type: CheckoutLineItemConnection.self, field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariantComponentConnection.self, field: fieldName, value: fieldValue) } } /// A list of edges. - open var edges: [Storefront.CheckoutLineItemEdge] { + open var edges: [Storefront.ProductVariantComponentEdge] { return internalGetEdges() } - func internalGetEdges(alias: String? = nil) -> [Storefront.CheckoutLineItemEdge] { - return field(field: "edges", aliasSuffix: alias) as! [Storefront.CheckoutLineItemEdge] + func internalGetEdges(alias: String? = nil) -> [Storefront.ProductVariantComponentEdge] { + return field(field: "edges", aliasSuffix: alias) as! [Storefront.ProductVariantComponentEdge] } - /// A list of the nodes contained in CheckoutLineItemEdge. - open var nodes: [Storefront.CheckoutLineItem] { + /// A list of the nodes contained in ProductVariantComponentEdge. + open var nodes: [Storefront.ProductVariantComponent] { return internalGetNodes() } - func internalGetNodes(alias: String? = nil) -> [Storefront.CheckoutLineItem] { - return field(field: "nodes", aliasSuffix: alias) as! [Storefront.CheckoutLineItem] + func internalGetNodes(alias: String? = nil) -> [Storefront.ProductVariantComponent] { + return field(field: "nodes", aliasSuffix: alias) as! [Storefront.ProductVariantComponent] } /// Information to aid in pagination. diff --git a/Buy/Generated/Storefront/CheckoutLineItemEdge.swift b/Buy/Generated/Storefront/ProductVariantComponentEdge.swift similarity index 63% rename from Buy/Generated/Storefront/CheckoutLineItemEdge.swift rename to Buy/Generated/Storefront/ProductVariantComponentEdge.swift index 25ec8982..538a3888 100644 --- a/Buy/Generated/Storefront/CheckoutLineItemEdge.swift +++ b/Buy/Generated/Storefront/ProductVariantComponentEdge.swift @@ -1,5 +1,5 @@ // -// CheckoutLineItemEdge.swift +// ProductVariantComponentEdge.swift // Buy // // Created by Shopify. @@ -27,22 +27,22 @@ import Foundation extension Storefront { - /// An auto-generated type which holds one CheckoutLineItem and a cursor during - /// pagination. - open class CheckoutLineItemEdgeQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutLineItemEdge + /// An auto-generated type which holds one ProductVariantComponent and a cursor + /// during pagination. + open class ProductVariantComponentEdgeQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ProductVariantComponentEdge /// A cursor for use in pagination. @discardableResult - open func cursor(alias: String? = nil) -> CheckoutLineItemEdgeQuery { + open func cursor(alias: String? = nil) -> ProductVariantComponentEdgeQuery { addField(field: "cursor", aliasSuffix: alias) return self } - /// The item at the end of CheckoutLineItemEdge. + /// The item at the end of ProductVariantComponentEdge. @discardableResult - open func node(alias: String? = nil, _ subfields: (CheckoutLineItemQuery) -> Void) -> CheckoutLineItemEdgeQuery { - let subquery = CheckoutLineItemQuery() + open func node(alias: String? = nil, _ subfields: (ProductVariantComponentQuery) -> Void) -> ProductVariantComponentEdgeQuery { + let subquery = ProductVariantComponentQuery() subfields(subquery) addField(field: "node", aliasSuffix: alias, subfields: subquery) @@ -50,28 +50,28 @@ extension Storefront { } } - /// An auto-generated type which holds one CheckoutLineItem and a cursor during - /// pagination. - open class CheckoutLineItemEdge: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutLineItemEdgeQuery + /// An auto-generated type which holds one ProductVariantComponent and a cursor + /// during pagination. + open class ProductVariantComponentEdge: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = ProductVariantComponentEdgeQuery internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { let fieldValue = value switch fieldName { case "cursor": guard let value = value as? String else { - throw SchemaViolationError(type: CheckoutLineItemEdge.self, field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariantComponentEdge.self, field: fieldName, value: fieldValue) } return value case "node": guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: CheckoutLineItemEdge.self, field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariantComponentEdge.self, field: fieldName, value: fieldValue) } - return try CheckoutLineItem(fields: value) + return try ProductVariantComponent(fields: value) default: - throw SchemaViolationError(type: CheckoutLineItemEdge.self, field: fieldName, value: fieldValue) + throw SchemaViolationError(type: ProductVariantComponentEdge.self, field: fieldName, value: fieldValue) } } @@ -84,13 +84,13 @@ extension Storefront { return field(field: "cursor", aliasSuffix: alias) as! String } - /// The item at the end of CheckoutLineItemEdge. - open var node: Storefront.CheckoutLineItem { + /// The item at the end of ProductVariantComponentEdge. + open var node: Storefront.ProductVariantComponent { return internalGetNode() } - func internalGetNode(alias: String? = nil) -> Storefront.CheckoutLineItem { - return field(field: "node", aliasSuffix: alias) as! Storefront.CheckoutLineItem + func internalGetNode(alias: String? = nil) -> Storefront.ProductVariantComponent { + return field(field: "node", aliasSuffix: alias) as! Storefront.ProductVariantComponent } internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { diff --git a/Buy/Generated/Storefront/QueryRoot.swift b/Buy/Generated/Storefront/QueryRoot.swift index b9d2f4e0..89c6cce1 100644 --- a/Buy/Generated/Storefront/QueryRoot.swift +++ b/Buy/Generated/Storefront/QueryRoot.swift @@ -120,21 +120,21 @@ extension Storefront { /// Fetch a specific `Blog` by one of its unique attributes. /// /// - parameters: - /// - id: The ID of the `Blog`. /// - handle: The handle of the `Blog`. + /// - id: The ID of the `Blog`. /// @discardableResult - open func blog(alias: String? = nil, id: GraphQL.ID? = nil, handle: String? = nil, _ subfields: (BlogQuery) -> Void) -> QueryRootQuery { + open func blog(alias: String? = nil, handle: String? = nil, id: GraphQL.ID? = nil, _ subfields: (BlogQuery) -> Void) -> QueryRootQuery { var args: [String] = [] - if let id = id { - args.append("id:\(GraphQL.quoteString(input: "\(id.rawValue)"))") - } - if let handle = handle { args.append("handle:\(GraphQL.quoteString(input: handle))") } + if let id = id { + args.append("id:\(GraphQL.quoteString(input: "\(id.rawValue)"))") + } + let argsString: String? = args.isEmpty ? nil : "(\(args.joined(separator: ",")))" let subquery = BlogQuery() @@ -601,21 +601,21 @@ extension Storefront { /// Fetch a specific `Page` by one of its unique attributes. /// /// - parameters: - /// - id: The ID of the `Page`. /// - handle: The handle of the `Page`. + /// - id: The ID of the `Page`. /// @discardableResult - open func page(alias: String? = nil, id: GraphQL.ID? = nil, handle: String? = nil, _ subfields: (PageQuery) -> Void) -> QueryRootQuery { + open func page(alias: String? = nil, handle: String? = nil, id: GraphQL.ID? = nil, _ subfields: (PageQuery) -> Void) -> QueryRootQuery { var args: [String] = [] - if let id = id { - args.append("id:\(GraphQL.quoteString(input: "\(id.rawValue)"))") - } - if let handle = handle { args.append("handle:\(GraphQL.quoteString(input: handle))") } + if let id = id { + args.append("id:\(GraphQL.quoteString(input: "\(id.rawValue)"))") + } + let argsString: String? = args.isEmpty ? nil : "(\(args.joined(separator: ",")))" let subquery = PageQuery() @@ -817,13 +817,20 @@ extension Storefront { /// /// - parameters: /// - productId: The id of the product. + /// - productHandle: The handle of the product. /// - intent: The recommendation intent that is used to generate product recommendations. You can use intent to generate product recommendations on various pages across the channels, according to different strategies. /// @discardableResult - open func productRecommendations(alias: String? = nil, productId: GraphQL.ID, intent: ProductRecommendationIntent? = nil, _ subfields: (ProductQuery) -> Void) -> QueryRootQuery { + open func productRecommendations(alias: String? = nil, productId: GraphQL.ID? = nil, productHandle: String? = nil, intent: ProductRecommendationIntent? = nil, _ subfields: (ProductQuery) -> Void) -> QueryRootQuery { var args: [String] = [] - args.append("productId:\(GraphQL.quoteString(input: "\(productId.rawValue)"))") + if let productId = productId { + args.append("productId:\(GraphQL.quoteString(input: "\(productId.rawValue)"))") + } + + if let productHandle = productHandle { + args.append("productHandle:\(GraphQL.quoteString(input: productHandle))") + } if let intent = intent { args.append("intent:\(intent.rawValue)") diff --git a/Buy/Generated/Storefront/SellingPlan.swift b/Buy/Generated/Storefront/SellingPlan.swift index e0f63aa3..93e83ab4 100644 --- a/Buy/Generated/Storefront/SellingPlan.swift +++ b/Buy/Generated/Storefront/SellingPlan.swift @@ -31,6 +31,16 @@ extension Storefront { open class SellingPlanQuery: GraphQL.AbstractQuery, GraphQLQuery { public typealias Response = SellingPlan + /// The billing policy for the selling plan. + @discardableResult + open func billingPolicy(alias: String? = nil, _ subfields: (SellingPlanBillingPolicyQuery) -> Void) -> SellingPlanQuery { + let subquery = SellingPlanBillingPolicyQuery() + subfields(subquery) + + addField(field: "billingPolicy", aliasSuffix: alias, subfields: subquery) + return self + } + /// The initial payment due for the purchase. @discardableResult open func checkoutCharge(alias: String? = nil, _ subfields: (SellingPlanCheckoutChargeQuery) -> Void) -> SellingPlanQuery { @@ -41,6 +51,16 @@ extension Storefront { return self } + /// The delivery policy for the selling plan. + @discardableResult + open func deliveryPolicy(alias: String? = nil, _ subfields: (SellingPlanDeliveryPolicyQuery) -> Void) -> SellingPlanQuery { + let subquery = SellingPlanDeliveryPolicyQuery() + subfields(subquery) + + addField(field: "deliveryPolicy", aliasSuffix: alias, subfields: subquery) + return self + } + /// The description of the selling plan. @discardableResult open func description(alias: String? = nil) -> SellingPlanQuery { @@ -55,6 +75,54 @@ extension Storefront { return self } + /// Returns a metafield found by namespace and key. + /// + /// - parameters: + /// - namespace: The container the metafield belongs to. If omitted, the app-reserved namespace will be used. + /// - key: The identifier for the metafield. + /// + @discardableResult + open func metafield(alias: String? = nil, namespace: String? = nil, key: String, _ subfields: (MetafieldQuery) -> Void) -> SellingPlanQuery { + var args: [String] = [] + + args.append("key:\(GraphQL.quoteString(input: key))") + + if let namespace = namespace { + args.append("namespace:\(GraphQL.quoteString(input: namespace))") + } + + let argsString: String? = args.isEmpty ? nil : "(\(args.joined(separator: ",")))" + + let subquery = MetafieldQuery() + subfields(subquery) + + addField(field: "metafield", aliasSuffix: alias, args: argsString, subfields: subquery) + return self + } + + /// The metafields associated with the resource matching the supplied list of + /// namespaces and keys. + /// + /// - parameters: + /// - identifiers: The list of metafields to retrieve by namespace and key. + /// + /// The input must not contain more than `250` values. + /// + @discardableResult + open func metafields(alias: String? = nil, identifiers: [HasMetafieldsIdentifier], _ subfields: (MetafieldQuery) -> Void) -> SellingPlanQuery { + var args: [String] = [] + + args.append("identifiers:[\(identifiers.map{ "\($0.serialize())" }.joined(separator: ","))]") + + let argsString = "(\(args.joined(separator: ",")))" + + let subquery = MetafieldQuery() + subfields(subquery) + + addField(field: "metafields", aliasSuffix: alias, args: argsString, subfields: subquery) + return self + } + /// The name of the selling plan. For example, '6 weeks of prepaid granola, /// delivered weekly'. @discardableResult @@ -100,18 +168,32 @@ extension Storefront { } /// Represents how products and variants can be sold and purchased. - open class SellingPlan: GraphQL.AbstractResponse, GraphQLObject { + open class SellingPlan: GraphQL.AbstractResponse, GraphQLObject, HasMetafields, MetafieldParentResource { public typealias Query = SellingPlanQuery internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { let fieldValue = value switch fieldName { + case "billingPolicy": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: SellingPlan.self, field: fieldName, value: fieldValue) + } + return try UnknownSellingPlanBillingPolicy.create(fields: value) + case "checkoutCharge": guard let value = value as? [String: Any] else { throw SchemaViolationError(type: SellingPlan.self, field: fieldName, value: fieldValue) } return try SellingPlanCheckoutCharge(fields: value) + case "deliveryPolicy": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: SellingPlan.self, field: fieldName, value: fieldValue) + } + return try UnknownSellingPlanDeliveryPolicy.create(fields: value) + case "description": if value is NSNull { return nil } guard let value = value as? String else { @@ -125,6 +207,23 @@ extension Storefront { } return GraphQL.ID(rawValue: value) + case "metafield": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: SellingPlan.self, field: fieldName, value: fieldValue) + } + return try Metafield(fields: value) + + case "metafields": + guard let value = value as? [Any] else { + throw SchemaViolationError(type: SellingPlan.self, field: fieldName, value: fieldValue) + } + return try value.map { if $0 is NSNull { return nil } + guard let value = $0 as? [String: Any] else { + throw SchemaViolationError(type: SellingPlan.self, field: fieldName, value: fieldValue) + } + return try Metafield(fields: value) } as [Any?] + case "name": guard let value = value as? String else { throw SchemaViolationError(type: SellingPlan.self, field: fieldName, value: fieldValue) @@ -154,6 +253,15 @@ extension Storefront { } } + /// The billing policy for the selling plan. + open var billingPolicy: SellingPlanBillingPolicy? { + return internalGetBillingPolicy() + } + + func internalGetBillingPolicy(alias: String? = nil) -> SellingPlanBillingPolicy? { + return field(field: "billingPolicy", aliasSuffix: alias) as! SellingPlanBillingPolicy? + } + /// The initial payment due for the purchase. open var checkoutCharge: Storefront.SellingPlanCheckoutCharge { return internalGetCheckoutCharge() @@ -163,6 +271,15 @@ extension Storefront { return field(field: "checkoutCharge", aliasSuffix: alias) as! Storefront.SellingPlanCheckoutCharge } + /// The delivery policy for the selling plan. + open var deliveryPolicy: SellingPlanDeliveryPolicy? { + return internalGetDeliveryPolicy() + } + + func internalGetDeliveryPolicy(alias: String? = nil) -> SellingPlanDeliveryPolicy? { + return field(field: "deliveryPolicy", aliasSuffix: alias) as! SellingPlanDeliveryPolicy? + } + /// The description of the selling plan. open var description: String? { return internalGetDescription() @@ -181,6 +298,33 @@ extension Storefront { return field(field: "id", aliasSuffix: alias) as! GraphQL.ID } + /// Returns a metafield found by namespace and key. + open var metafield: Storefront.Metafield? { + return internalGetMetafield() + } + + open func aliasedMetafield(alias: String) -> Storefront.Metafield? { + return internalGetMetafield(alias: alias) + } + + func internalGetMetafield(alias: String? = nil) -> Storefront.Metafield? { + return field(field: "metafield", aliasSuffix: alias) as! Storefront.Metafield? + } + + /// The metafields associated with the resource matching the supplied list of + /// namespaces and keys. + open var metafields: [Storefront.Metafield?] { + return internalGetMetafields() + } + + open func aliasedMetafields(alias: String) -> [Storefront.Metafield?] { + return internalGetMetafields(alias: alias) + } + + func internalGetMetafields(alias: String? = nil) -> [Storefront.Metafield?] { + return field(field: "metafields", aliasSuffix: alias) as! [Storefront.Metafield?] + } + /// The name of the selling plan. For example, '6 weeks of prepaid granola, /// delivered weekly'. open var name: String { @@ -230,10 +374,36 @@ extension Storefront { var response: [GraphQL.AbstractResponse] = [] objectMap.keys.forEach { switch($0) { + case "billingPolicy": + if let value = internalGetBillingPolicy() { + response.append((value as! GraphQL.AbstractResponse)) + response.append(contentsOf: (value as! GraphQL.AbstractResponse).childResponseObjectMap()) + } + case "checkoutCharge": response.append(internalGetCheckoutCharge()) response.append(contentsOf: internalGetCheckoutCharge().childResponseObjectMap()) + case "deliveryPolicy": + if let value = internalGetDeliveryPolicy() { + response.append((value as! GraphQL.AbstractResponse)) + response.append(contentsOf: (value as! GraphQL.AbstractResponse).childResponseObjectMap()) + } + + case "metafield": + if let value = internalGetMetafield() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + + case "metafields": + internalGetMetafields().forEach { + if let value = $0 { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + } + case "options": internalGetOptions().forEach { response.append($0) diff --git a/Buy/Generated/Storefront/CheckoutBuyerIdentity.swift b/Buy/Generated/Storefront/SellingPlanBillingPolicy.swift similarity index 50% rename from Buy/Generated/Storefront/CheckoutBuyerIdentity.swift rename to Buy/Generated/Storefront/SellingPlanBillingPolicy.swift index 2e6b34e8..353f3df7 100644 --- a/Buy/Generated/Storefront/CheckoutBuyerIdentity.swift +++ b/Buy/Generated/Storefront/SellingPlanBillingPolicy.swift @@ -1,5 +1,5 @@ // -// CheckoutBuyerIdentity.swift +// SellingPlanBillingPolicy.swift // Buy // // Created by Shopify. @@ -26,45 +26,52 @@ import Foundation +/// The selling plan billing policy. +public protocol SellingPlanBillingPolicy { +} + extension Storefront { - /// The identity of the customer associated with the checkout. - open class CheckoutBuyerIdentityQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutBuyerIdentity + /// The selling plan billing policy. + open class SellingPlanBillingPolicyQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = SellingPlanBillingPolicy - /// The country code for the checkout. For example, `CA`. + override init() { + super.init() + addField(field: "__typename") + } + + /// The selling plan billing policy. @discardableResult - open func countryCode(alias: String? = nil) -> CheckoutBuyerIdentityQuery { - addField(field: "countryCode", aliasSuffix: alias) + open func onSellingPlanRecurringBillingPolicy(subfields: (SellingPlanRecurringBillingPolicyQuery) -> Void) -> SellingPlanBillingPolicyQuery { + let subquery = SellingPlanRecurringBillingPolicyQuery() + subfields(subquery) + addInlineFragment(on: "SellingPlanRecurringBillingPolicy", subfields: subquery) return self } } - /// The identity of the customer associated with the checkout. - open class CheckoutBuyerIdentity: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = CheckoutBuyerIdentityQuery + /// The selling plan billing policy. + open class UnknownSellingPlanBillingPolicy: GraphQL.AbstractResponse, GraphQLObject, SellingPlanBillingPolicy { + public typealias Query = SellingPlanBillingPolicyQuery internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { let fieldValue = value switch fieldName { - case "countryCode": - if value is NSNull { return nil } - guard let value = value as? String else { - throw SchemaViolationError(type: CheckoutBuyerIdentity.self, field: fieldName, value: fieldValue) - } - return CountryCode(rawValue: value) ?? .unknownValue - default: - throw SchemaViolationError(type: CheckoutBuyerIdentity.self, field: fieldName, value: fieldValue) + throw SchemaViolationError(type: UnknownSellingPlanBillingPolicy.self, field: fieldName, value: fieldValue) } } - /// The country code for the checkout. For example, `CA`. - open var countryCode: Storefront.CountryCode? { - return internalGetCountryCode() - } + internal static func create(fields: [String: Any]) throws -> SellingPlanBillingPolicy { + guard let typeName = fields["__typename"] as? String else { + throw SchemaViolationError(type: UnknownSellingPlanBillingPolicy.self, field: "__typename", value: fields["__typename"] ?? NSNull()) + } + switch typeName { + case "SellingPlanRecurringBillingPolicy": return try SellingPlanRecurringBillingPolicy.init(fields: fields) - func internalGetCountryCode(alias: String? = nil) -> Storefront.CountryCode? { - return field(field: "countryCode", aliasSuffix: alias) as! Storefront.CountryCode? + default: + return try UnknownSellingPlanBillingPolicy.init(fields: fields) + } } internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { diff --git a/Buy/Generated/Storefront/SellingPlanDeliveryPolicy.swift b/Buy/Generated/Storefront/SellingPlanDeliveryPolicy.swift new file mode 100644 index 00000000..806456ed --- /dev/null +++ b/Buy/Generated/Storefront/SellingPlanDeliveryPolicy.swift @@ -0,0 +1,81 @@ +// +// SellingPlanDeliveryPolicy.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +/// The selling plan delivery policy. +public protocol SellingPlanDeliveryPolicy { +} + +extension Storefront { + /// The selling plan delivery policy. + open class SellingPlanDeliveryPolicyQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = SellingPlanDeliveryPolicy + + override init() { + super.init() + addField(field: "__typename") + } + + /// The selling plan delivery policy. + @discardableResult + open func onSellingPlanRecurringDeliveryPolicy(subfields: (SellingPlanRecurringDeliveryPolicyQuery) -> Void) -> SellingPlanDeliveryPolicyQuery { + let subquery = SellingPlanRecurringDeliveryPolicyQuery() + subfields(subquery) + addInlineFragment(on: "SellingPlanRecurringDeliveryPolicy", subfields: subquery) + return self + } + } + + /// The selling plan delivery policy. + open class UnknownSellingPlanDeliveryPolicy: GraphQL.AbstractResponse, GraphQLObject, SellingPlanDeliveryPolicy { + public typealias Query = SellingPlanDeliveryPolicyQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + default: + throw SchemaViolationError(type: UnknownSellingPlanDeliveryPolicy.self, field: fieldName, value: fieldValue) + } + } + + internal static func create(fields: [String: Any]) throws -> SellingPlanDeliveryPolicy { + guard let typeName = fields["__typename"] as? String else { + throw SchemaViolationError(type: UnknownSellingPlanDeliveryPolicy.self, field: "__typename", value: fields["__typename"] ?? NSNull()) + } + switch typeName { + case "SellingPlanRecurringDeliveryPolicy": return try SellingPlanRecurringDeliveryPolicy.init(fields: fields) + + default: + return try UnknownSellingPlanDeliveryPolicy.init(fields: fields) + } + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + return [] + } + } +} diff --git a/Buy/Generated/Storefront/TransactionStatus.swift b/Buy/Generated/Storefront/SellingPlanInterval.swift similarity index 76% rename from Buy/Generated/Storefront/TransactionStatus.swift rename to Buy/Generated/Storefront/SellingPlanInterval.swift index 03e82807..3996d559 100644 --- a/Buy/Generated/Storefront/TransactionStatus.swift +++ b/Buy/Generated/Storefront/SellingPlanInterval.swift @@ -1,5 +1,5 @@ // -// TransactionStatus.swift +// SellingPlanInterval.swift // Buy // // Created by Shopify. @@ -27,19 +27,19 @@ import Foundation extension Storefront { - /// Transaction statuses describe the status of a transaction. - public enum TransactionStatus: String { - /// There was an error while processing the transaction. - case error = "ERROR" + /// Represents a valid selling plan interval. + public enum SellingPlanInterval: String { + /// Day interval. + case day = "DAY" - /// The transaction failed. - case failure = "FAILURE" + /// Month interval. + case month = "MONTH" - /// The transaction is pending. - case pending = "PENDING" + /// Week interval. + case week = "WEEK" - /// The transaction succeeded. - case success = "SUCCESS" + /// Year interval. + case year = "YEAR" case unknownValue = "" } diff --git a/Buy/Generated/Storefront/SellingPlanRecurringBillingPolicy.swift b/Buy/Generated/Storefront/SellingPlanRecurringBillingPolicy.swift new file mode 100644 index 00000000..6852f9ca --- /dev/null +++ b/Buy/Generated/Storefront/SellingPlanRecurringBillingPolicy.swift @@ -0,0 +1,95 @@ +// +// SellingPlanRecurringBillingPolicy.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// The recurring billing policy for the selling plan. + open class SellingPlanRecurringBillingPolicyQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = SellingPlanRecurringBillingPolicy + + /// The billing frequency, it can be either: day, week, month or year. + @discardableResult + open func interval(alias: String? = nil) -> SellingPlanRecurringBillingPolicyQuery { + addField(field: "interval", aliasSuffix: alias) + return self + } + + /// The number of intervals between billings. + @discardableResult + open func intervalCount(alias: String? = nil) -> SellingPlanRecurringBillingPolicyQuery { + addField(field: "intervalCount", aliasSuffix: alias) + return self + } + } + + /// The recurring billing policy for the selling plan. + open class SellingPlanRecurringBillingPolicy: GraphQL.AbstractResponse, GraphQLObject, SellingPlanBillingPolicy { + public typealias Query = SellingPlanRecurringBillingPolicyQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "interval": + guard let value = value as? String else { + throw SchemaViolationError(type: SellingPlanRecurringBillingPolicy.self, field: fieldName, value: fieldValue) + } + return SellingPlanInterval(rawValue: value) ?? .unknownValue + + case "intervalCount": + guard let value = value as? Int else { + throw SchemaViolationError(type: SellingPlanRecurringBillingPolicy.self, field: fieldName, value: fieldValue) + } + return Int32(value) + + default: + throw SchemaViolationError(type: SellingPlanRecurringBillingPolicy.self, field: fieldName, value: fieldValue) + } + } + + /// The billing frequency, it can be either: day, week, month or year. + open var interval: Storefront.SellingPlanInterval { + return internalGetInterval() + } + + func internalGetInterval(alias: String? = nil) -> Storefront.SellingPlanInterval { + return field(field: "interval", aliasSuffix: alias) as! Storefront.SellingPlanInterval + } + + /// The number of intervals between billings. + open var intervalCount: Int32 { + return internalGetIntervalCount() + } + + func internalGetIntervalCount(alias: String? = nil) -> Int32 { + return field(field: "intervalCount", aliasSuffix: alias) as! Int32 + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + return [] + } + } +} diff --git a/Buy/Generated/Storefront/SellingPlanRecurringDeliveryPolicy.swift b/Buy/Generated/Storefront/SellingPlanRecurringDeliveryPolicy.swift new file mode 100644 index 00000000..9885de9c --- /dev/null +++ b/Buy/Generated/Storefront/SellingPlanRecurringDeliveryPolicy.swift @@ -0,0 +1,95 @@ +// +// SellingPlanRecurringDeliveryPolicy.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// The recurring delivery policy for the selling plan. + open class SellingPlanRecurringDeliveryPolicyQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = SellingPlanRecurringDeliveryPolicy + + /// The delivery frequency, it can be either: day, week, month or year. + @discardableResult + open func interval(alias: String? = nil) -> SellingPlanRecurringDeliveryPolicyQuery { + addField(field: "interval", aliasSuffix: alias) + return self + } + + /// The number of intervals between deliveries. + @discardableResult + open func intervalCount(alias: String? = nil) -> SellingPlanRecurringDeliveryPolicyQuery { + addField(field: "intervalCount", aliasSuffix: alias) + return self + } + } + + /// The recurring delivery policy for the selling plan. + open class SellingPlanRecurringDeliveryPolicy: GraphQL.AbstractResponse, GraphQLObject, SellingPlanDeliveryPolicy { + public typealias Query = SellingPlanRecurringDeliveryPolicyQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "interval": + guard let value = value as? String else { + throw SchemaViolationError(type: SellingPlanRecurringDeliveryPolicy.self, field: fieldName, value: fieldValue) + } + return SellingPlanInterval(rawValue: value) ?? .unknownValue + + case "intervalCount": + guard let value = value as? Int else { + throw SchemaViolationError(type: SellingPlanRecurringDeliveryPolicy.self, field: fieldName, value: fieldValue) + } + return Int32(value) + + default: + throw SchemaViolationError(type: SellingPlanRecurringDeliveryPolicy.self, field: fieldName, value: fieldValue) + } + } + + /// The delivery frequency, it can be either: day, week, month or year. + open var interval: Storefront.SellingPlanInterval { + return internalGetInterval() + } + + func internalGetInterval(alias: String? = nil) -> Storefront.SellingPlanInterval { + return field(field: "interval", aliasSuffix: alias) as! Storefront.SellingPlanInterval + } + + /// The number of intervals between deliveries. + open var intervalCount: Int32 { + return internalGetIntervalCount() + } + + func internalGetIntervalCount(alias: String? = nil) -> Int32 { + return field(field: "intervalCount", aliasSuffix: alias) as! Int32 + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + return [] + } + } +} diff --git a/Buy/Generated/Storefront/ShippingRate.swift b/Buy/Generated/Storefront/ShippingRate.swift deleted file mode 100644 index 9c85b318..00000000 --- a/Buy/Generated/Storefront/ShippingRate.swift +++ /dev/null @@ -1,162 +0,0 @@ -// -// ShippingRate.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// A shipping rate to be applied to a checkout. - open class ShippingRateQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = ShippingRate - - /// Human-readable unique identifier for this shipping rate. - @discardableResult - open func handle(alias: String? = nil) -> ShippingRateQuery { - addField(field: "handle", aliasSuffix: alias) - return self - } - - /// Price of this shipping rate. - @discardableResult - open func price(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> ShippingRateQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "price", aliasSuffix: alias, subfields: subquery) - return self - } - - /// Price of this shipping rate. - @available(*, deprecated, message:"Use `price` instead.") - @discardableResult - open func priceV2(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> ShippingRateQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "priceV2", aliasSuffix: alias, subfields: subquery) - return self - } - - /// Title of this shipping rate. - @discardableResult - open func title(alias: String? = nil) -> ShippingRateQuery { - addField(field: "title", aliasSuffix: alias) - return self - } - } - - /// A shipping rate to be applied to a checkout. - open class ShippingRate: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = ShippingRateQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "handle": - guard let value = value as? String else { - throw SchemaViolationError(type: ShippingRate.self, field: fieldName, value: fieldValue) - } - return value - - case "price": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: ShippingRate.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "priceV2": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: ShippingRate.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "title": - guard let value = value as? String else { - throw SchemaViolationError(type: ShippingRate.self, field: fieldName, value: fieldValue) - } - return value - - default: - throw SchemaViolationError(type: ShippingRate.self, field: fieldName, value: fieldValue) - } - } - - /// Human-readable unique identifier for this shipping rate. - open var handle: String { - return internalGetHandle() - } - - func internalGetHandle(alias: String? = nil) -> String { - return field(field: "handle", aliasSuffix: alias) as! String - } - - /// Price of this shipping rate. - open var price: Storefront.MoneyV2 { - return internalGetPrice() - } - - func internalGetPrice(alias: String? = nil) -> Storefront.MoneyV2 { - return field(field: "price", aliasSuffix: alias) as! Storefront.MoneyV2 - } - - /// Price of this shipping rate. - @available(*, deprecated, message:"Use `price` instead.") - open var priceV2: Storefront.MoneyV2 { - return internalGetPriceV2() - } - - func internalGetPriceV2(alias: String? = nil) -> Storefront.MoneyV2 { - return field(field: "priceV2", aliasSuffix: alias) as! Storefront.MoneyV2 - } - - /// Title of this shipping rate. - open var title: String { - return internalGetTitle() - } - - func internalGetTitle(alias: String? = nil) -> String { - return field(field: "title", aliasSuffix: alias) as! String - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "price": - response.append(internalGetPrice()) - response.append(contentsOf: internalGetPrice().childResponseObjectMap()) - - case "priceV2": - response.append(internalGetPriceV2()) - response.append(contentsOf: internalGetPriceV2().childResponseObjectMap()) - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequest.swift b/Buy/Generated/Storefront/ShopPayPaymentRequest.swift new file mode 100644 index 00000000..bb556e19 --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequest.swift @@ -0,0 +1,427 @@ +// +// ShopPayPaymentRequest.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Represents a Shop Pay payment request. + open class ShopPayPaymentRequestQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ShopPayPaymentRequest + + /// The delivery methods for the payment request. + @discardableResult + open func deliveryMethods(alias: String? = nil, _ subfields: (ShopPayPaymentRequestDeliveryMethodQuery) -> Void) -> ShopPayPaymentRequestQuery { + let subquery = ShopPayPaymentRequestDeliveryMethodQuery() + subfields(subquery) + + addField(field: "deliveryMethods", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The discount codes for the payment request. + @discardableResult + open func discountCodes(alias: String? = nil) -> ShopPayPaymentRequestQuery { + addField(field: "discountCodes", aliasSuffix: alias) + return self + } + + /// The discounts for the payment request order. + @discardableResult + open func discounts(alias: String? = nil, _ subfields: (ShopPayPaymentRequestDiscountQuery) -> Void) -> ShopPayPaymentRequestQuery { + let subquery = ShopPayPaymentRequestDiscountQuery() + subfields(subquery) + + addField(field: "discounts", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The line items for the payment request. + @discardableResult + open func lineItems(alias: String? = nil, _ subfields: (ShopPayPaymentRequestLineItemQuery) -> Void) -> ShopPayPaymentRequestQuery { + let subquery = ShopPayPaymentRequestLineItemQuery() + subfields(subquery) + + addField(field: "lineItems", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The locale for the payment request. + @discardableResult + open func locale(alias: String? = nil) -> ShopPayPaymentRequestQuery { + addField(field: "locale", aliasSuffix: alias) + return self + } + + /// The presentment currency for the payment request. + @discardableResult + open func presentmentCurrency(alias: String? = nil) -> ShopPayPaymentRequestQuery { + addField(field: "presentmentCurrency", aliasSuffix: alias) + return self + } + + /// The delivery method type for the payment request. + @discardableResult + open func selectedDeliveryMethodType(alias: String? = nil) -> ShopPayPaymentRequestQuery { + addField(field: "selectedDeliveryMethodType", aliasSuffix: alias) + return self + } + + /// The shipping address for the payment request. + @discardableResult + open func shippingAddress(alias: String? = nil, _ subfields: (ShopPayPaymentRequestContactFieldQuery) -> Void) -> ShopPayPaymentRequestQuery { + let subquery = ShopPayPaymentRequestContactFieldQuery() + subfields(subquery) + + addField(field: "shippingAddress", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The shipping lines for the payment request. + @discardableResult + open func shippingLines(alias: String? = nil, _ subfields: (ShopPayPaymentRequestShippingLineQuery) -> Void) -> ShopPayPaymentRequestQuery { + let subquery = ShopPayPaymentRequestShippingLineQuery() + subfields(subquery) + + addField(field: "shippingLines", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The subtotal amount for the payment request. + @discardableResult + open func subtotal(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> ShopPayPaymentRequestQuery { + let subquery = MoneyV2Query() + subfields(subquery) + + addField(field: "subtotal", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The total amount for the payment request. + @discardableResult + open func total(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> ShopPayPaymentRequestQuery { + let subquery = MoneyV2Query() + subfields(subquery) + + addField(field: "total", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The total shipping price for the payment request. + @discardableResult + open func totalShippingPrice(alias: String? = nil, _ subfields: (ShopPayPaymentRequestTotalShippingPriceQuery) -> Void) -> ShopPayPaymentRequestQuery { + let subquery = ShopPayPaymentRequestTotalShippingPriceQuery() + subfields(subquery) + + addField(field: "totalShippingPrice", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The total tax for the payment request. + @discardableResult + open func totalTax(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> ShopPayPaymentRequestQuery { + let subquery = MoneyV2Query() + subfields(subquery) + + addField(field: "totalTax", aliasSuffix: alias, subfields: subquery) + return self + } + } + + /// Represents a Shop Pay payment request. + open class ShopPayPaymentRequest: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = ShopPayPaymentRequestQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "deliveryMethods": + guard let value = value as? [[String: Any]] else { + throw SchemaViolationError(type: ShopPayPaymentRequest.self, field: fieldName, value: fieldValue) + } + return try value.map { return try ShopPayPaymentRequestDeliveryMethod(fields: $0) } + + case "discountCodes": + guard let value = value as? [String] else { + throw SchemaViolationError(type: ShopPayPaymentRequest.self, field: fieldName, value: fieldValue) + } + return value.map { return $0 } + + case "discounts": + if value is NSNull { return nil } + guard let value = value as? [[String: Any]] else { + throw SchemaViolationError(type: ShopPayPaymentRequest.self, field: fieldName, value: fieldValue) + } + return try value.map { return try ShopPayPaymentRequestDiscount(fields: $0) } + + case "lineItems": + guard let value = value as? [[String: Any]] else { + throw SchemaViolationError(type: ShopPayPaymentRequest.self, field: fieldName, value: fieldValue) + } + return try value.map { return try ShopPayPaymentRequestLineItem(fields: $0) } + + case "locale": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequest.self, field: fieldName, value: fieldValue) + } + return value + + case "presentmentCurrency": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequest.self, field: fieldName, value: fieldValue) + } + return CurrencyCode(rawValue: value) ?? .unknownValue + + case "selectedDeliveryMethodType": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequest.self, field: fieldName, value: fieldValue) + } + return ShopPayPaymentRequestDeliveryMethodType(rawValue: value) ?? .unknownValue + + case "shippingAddress": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequest.self, field: fieldName, value: fieldValue) + } + return try ShopPayPaymentRequestContactField(fields: value) + + case "shippingLines": + guard let value = value as? [[String: Any]] else { + throw SchemaViolationError(type: ShopPayPaymentRequest.self, field: fieldName, value: fieldValue) + } + return try value.map { return try ShopPayPaymentRequestShippingLine(fields: $0) } + + case "subtotal": + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequest.self, field: fieldName, value: fieldValue) + } + return try MoneyV2(fields: value) + + case "total": + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequest.self, field: fieldName, value: fieldValue) + } + return try MoneyV2(fields: value) + + case "totalShippingPrice": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequest.self, field: fieldName, value: fieldValue) + } + return try ShopPayPaymentRequestTotalShippingPrice(fields: value) + + case "totalTax": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequest.self, field: fieldName, value: fieldValue) + } + return try MoneyV2(fields: value) + + default: + throw SchemaViolationError(type: ShopPayPaymentRequest.self, field: fieldName, value: fieldValue) + } + } + + /// The delivery methods for the payment request. + open var deliveryMethods: [Storefront.ShopPayPaymentRequestDeliveryMethod] { + return internalGetDeliveryMethods() + } + + func internalGetDeliveryMethods(alias: String? = nil) -> [Storefront.ShopPayPaymentRequestDeliveryMethod] { + return field(field: "deliveryMethods", aliasSuffix: alias) as! [Storefront.ShopPayPaymentRequestDeliveryMethod] + } + + /// The discount codes for the payment request. + open var discountCodes: [String] { + return internalGetDiscountCodes() + } + + func internalGetDiscountCodes(alias: String? = nil) -> [String] { + return field(field: "discountCodes", aliasSuffix: alias) as! [String] + } + + /// The discounts for the payment request order. + open var discounts: [Storefront.ShopPayPaymentRequestDiscount]? { + return internalGetDiscounts() + } + + func internalGetDiscounts(alias: String? = nil) -> [Storefront.ShopPayPaymentRequestDiscount]? { + return field(field: "discounts", aliasSuffix: alias) as! [Storefront.ShopPayPaymentRequestDiscount]? + } + + /// The line items for the payment request. + open var lineItems: [Storefront.ShopPayPaymentRequestLineItem] { + return internalGetLineItems() + } + + func internalGetLineItems(alias: String? = nil) -> [Storefront.ShopPayPaymentRequestLineItem] { + return field(field: "lineItems", aliasSuffix: alias) as! [Storefront.ShopPayPaymentRequestLineItem] + } + + /// The locale for the payment request. + open var locale: String { + return internalGetLocale() + } + + func internalGetLocale(alias: String? = nil) -> String { + return field(field: "locale", aliasSuffix: alias) as! String + } + + /// The presentment currency for the payment request. + open var presentmentCurrency: Storefront.CurrencyCode { + return internalGetPresentmentCurrency() + } + + func internalGetPresentmentCurrency(alias: String? = nil) -> Storefront.CurrencyCode { + return field(field: "presentmentCurrency", aliasSuffix: alias) as! Storefront.CurrencyCode + } + + /// The delivery method type for the payment request. + open var selectedDeliveryMethodType: Storefront.ShopPayPaymentRequestDeliveryMethodType { + return internalGetSelectedDeliveryMethodType() + } + + func internalGetSelectedDeliveryMethodType(alias: String? = nil) -> Storefront.ShopPayPaymentRequestDeliveryMethodType { + return field(field: "selectedDeliveryMethodType", aliasSuffix: alias) as! Storefront.ShopPayPaymentRequestDeliveryMethodType + } + + /// The shipping address for the payment request. + open var shippingAddress: Storefront.ShopPayPaymentRequestContactField? { + return internalGetShippingAddress() + } + + func internalGetShippingAddress(alias: String? = nil) -> Storefront.ShopPayPaymentRequestContactField? { + return field(field: "shippingAddress", aliasSuffix: alias) as! Storefront.ShopPayPaymentRequestContactField? + } + + /// The shipping lines for the payment request. + open var shippingLines: [Storefront.ShopPayPaymentRequestShippingLine] { + return internalGetShippingLines() + } + + func internalGetShippingLines(alias: String? = nil) -> [Storefront.ShopPayPaymentRequestShippingLine] { + return field(field: "shippingLines", aliasSuffix: alias) as! [Storefront.ShopPayPaymentRequestShippingLine] + } + + /// The subtotal amount for the payment request. + open var subtotal: Storefront.MoneyV2 { + return internalGetSubtotal() + } + + func internalGetSubtotal(alias: String? = nil) -> Storefront.MoneyV2 { + return field(field: "subtotal", aliasSuffix: alias) as! Storefront.MoneyV2 + } + + /// The total amount for the payment request. + open var total: Storefront.MoneyV2 { + return internalGetTotal() + } + + func internalGetTotal(alias: String? = nil) -> Storefront.MoneyV2 { + return field(field: "total", aliasSuffix: alias) as! Storefront.MoneyV2 + } + + /// The total shipping price for the payment request. + open var totalShippingPrice: Storefront.ShopPayPaymentRequestTotalShippingPrice? { + return internalGetTotalShippingPrice() + } + + func internalGetTotalShippingPrice(alias: String? = nil) -> Storefront.ShopPayPaymentRequestTotalShippingPrice? { + return field(field: "totalShippingPrice", aliasSuffix: alias) as! Storefront.ShopPayPaymentRequestTotalShippingPrice? + } + + /// The total tax for the payment request. + open var totalTax: Storefront.MoneyV2? { + return internalGetTotalTax() + } + + func internalGetTotalTax(alias: String? = nil) -> Storefront.MoneyV2? { + return field(field: "totalTax", aliasSuffix: alias) as! Storefront.MoneyV2? + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + var response: [GraphQL.AbstractResponse] = [] + objectMap.keys.forEach { + switch($0) { + case "deliveryMethods": + internalGetDeliveryMethods().forEach { + response.append($0) + response.append(contentsOf: $0.childResponseObjectMap()) + } + + case "discounts": + if let value = internalGetDiscounts() { + value.forEach { + response.append($0) + response.append(contentsOf: $0.childResponseObjectMap()) + } + } + + case "lineItems": + internalGetLineItems().forEach { + response.append($0) + response.append(contentsOf: $0.childResponseObjectMap()) + } + + case "shippingAddress": + if let value = internalGetShippingAddress() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + + case "shippingLines": + internalGetShippingLines().forEach { + response.append($0) + response.append(contentsOf: $0.childResponseObjectMap()) + } + + case "subtotal": + response.append(internalGetSubtotal()) + response.append(contentsOf: internalGetSubtotal().childResponseObjectMap()) + + case "total": + response.append(internalGetTotal()) + response.append(contentsOf: internalGetTotal().childResponseObjectMap()) + + case "totalShippingPrice": + if let value = internalGetTotalShippingPrice() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + + case "totalTax": + if let value = internalGetTotalTax() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + + default: + break + } + } + return response + } + } +} diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestContactField.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestContactField.swift new file mode 100644 index 00000000..a5abc1a2 --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestContactField.swift @@ -0,0 +1,299 @@ +// +// ShopPayPaymentRequestContactField.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Represents a contact field for a Shop Pay payment request. + open class ShopPayPaymentRequestContactFieldQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ShopPayPaymentRequestContactField + + /// The first address line of the contact field. + @discardableResult + open func address1(alias: String? = nil) -> ShopPayPaymentRequestContactFieldQuery { + addField(field: "address1", aliasSuffix: alias) + return self + } + + /// The second address line of the contact field. + @discardableResult + open func address2(alias: String? = nil) -> ShopPayPaymentRequestContactFieldQuery { + addField(field: "address2", aliasSuffix: alias) + return self + } + + /// The city of the contact field. + @discardableResult + open func city(alias: String? = nil) -> ShopPayPaymentRequestContactFieldQuery { + addField(field: "city", aliasSuffix: alias) + return self + } + + /// The company name of the contact field. + @discardableResult + open func companyName(alias: String? = nil) -> ShopPayPaymentRequestContactFieldQuery { + addField(field: "companyName", aliasSuffix: alias) + return self + } + + /// The country of the contact field. + @discardableResult + open func countryCode(alias: String? = nil) -> ShopPayPaymentRequestContactFieldQuery { + addField(field: "countryCode", aliasSuffix: alias) + return self + } + + /// The email of the contact field. + @discardableResult + open func email(alias: String? = nil) -> ShopPayPaymentRequestContactFieldQuery { + addField(field: "email", aliasSuffix: alias) + return self + } + + /// The first name of the contact field. + @discardableResult + open func firstName(alias: String? = nil) -> ShopPayPaymentRequestContactFieldQuery { + addField(field: "firstName", aliasSuffix: alias) + return self + } + + /// The first name of the contact field. + @discardableResult + open func lastName(alias: String? = nil) -> ShopPayPaymentRequestContactFieldQuery { + addField(field: "lastName", aliasSuffix: alias) + return self + } + + /// The phone number of the contact field. + @discardableResult + open func phone(alias: String? = nil) -> ShopPayPaymentRequestContactFieldQuery { + addField(field: "phone", aliasSuffix: alias) + return self + } + + /// The postal code of the contact field. + @discardableResult + open func postalCode(alias: String? = nil) -> ShopPayPaymentRequestContactFieldQuery { + addField(field: "postalCode", aliasSuffix: alias) + return self + } + + /// The province of the contact field. + @discardableResult + open func provinceCode(alias: String? = nil) -> ShopPayPaymentRequestContactFieldQuery { + addField(field: "provinceCode", aliasSuffix: alias) + return self + } + } + + /// Represents a contact field for a Shop Pay payment request. + open class ShopPayPaymentRequestContactField: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = ShopPayPaymentRequestContactFieldQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "address1": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestContactField.self, field: fieldName, value: fieldValue) + } + return value + + case "address2": + if value is NSNull { return nil } + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestContactField.self, field: fieldName, value: fieldValue) + } + return value + + case "city": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestContactField.self, field: fieldName, value: fieldValue) + } + return value + + case "companyName": + if value is NSNull { return nil } + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestContactField.self, field: fieldName, value: fieldValue) + } + return value + + case "countryCode": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestContactField.self, field: fieldName, value: fieldValue) + } + return value + + case "email": + if value is NSNull { return nil } + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestContactField.self, field: fieldName, value: fieldValue) + } + return value + + case "firstName": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestContactField.self, field: fieldName, value: fieldValue) + } + return value + + case "lastName": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestContactField.self, field: fieldName, value: fieldValue) + } + return value + + case "phone": + if value is NSNull { return nil } + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestContactField.self, field: fieldName, value: fieldValue) + } + return value + + case "postalCode": + if value is NSNull { return nil } + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestContactField.self, field: fieldName, value: fieldValue) + } + return value + + case "provinceCode": + if value is NSNull { return nil } + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestContactField.self, field: fieldName, value: fieldValue) + } + return value + + default: + throw SchemaViolationError(type: ShopPayPaymentRequestContactField.self, field: fieldName, value: fieldValue) + } + } + + /// The first address line of the contact field. + open var address1: String { + return internalGetAddress1() + } + + func internalGetAddress1(alias: String? = nil) -> String { + return field(field: "address1", aliasSuffix: alias) as! String + } + + /// The second address line of the contact field. + open var address2: String? { + return internalGetAddress2() + } + + func internalGetAddress2(alias: String? = nil) -> String? { + return field(field: "address2", aliasSuffix: alias) as! String? + } + + /// The city of the contact field. + open var city: String { + return internalGetCity() + } + + func internalGetCity(alias: String? = nil) -> String { + return field(field: "city", aliasSuffix: alias) as! String + } + + /// The company name of the contact field. + open var companyName: String? { + return internalGetCompanyName() + } + + func internalGetCompanyName(alias: String? = nil) -> String? { + return field(field: "companyName", aliasSuffix: alias) as! String? + } + + /// The country of the contact field. + open var countryCode: String { + return internalGetCountryCode() + } + + func internalGetCountryCode(alias: String? = nil) -> String { + return field(field: "countryCode", aliasSuffix: alias) as! String + } + + /// The email of the contact field. + open var email: String? { + return internalGetEmail() + } + + func internalGetEmail(alias: String? = nil) -> String? { + return field(field: "email", aliasSuffix: alias) as! String? + } + + /// The first name of the contact field. + open var firstName: String { + return internalGetFirstName() + } + + func internalGetFirstName(alias: String? = nil) -> String { + return field(field: "firstName", aliasSuffix: alias) as! String + } + + /// The first name of the contact field. + open var lastName: String { + return internalGetLastName() + } + + func internalGetLastName(alias: String? = nil) -> String { + return field(field: "lastName", aliasSuffix: alias) as! String + } + + /// The phone number of the contact field. + open var phone: String? { + return internalGetPhone() + } + + func internalGetPhone(alias: String? = nil) -> String? { + return field(field: "phone", aliasSuffix: alias) as! String? + } + + /// The postal code of the contact field. + open var postalCode: String? { + return internalGetPostalCode() + } + + func internalGetPostalCode(alias: String? = nil) -> String? { + return field(field: "postalCode", aliasSuffix: alias) as! String? + } + + /// The province of the contact field. + open var provinceCode: String? { + return internalGetProvinceCode() + } + + func internalGetProvinceCode(alias: String? = nil) -> String? { + return field(field: "provinceCode", aliasSuffix: alias) as! String? + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + return [] + } + } +} diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestDeliveryMethod.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestDeliveryMethod.swift new file mode 100644 index 00000000..5454f420 --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestDeliveryMethod.swift @@ -0,0 +1,223 @@ +// +// ShopPayPaymentRequestDeliveryMethod.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Represents a delivery method for a Shop Pay payment request. + open class ShopPayPaymentRequestDeliveryMethodQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ShopPayPaymentRequestDeliveryMethod + + /// The amount for the delivery method. + @discardableResult + open func amount(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> ShopPayPaymentRequestDeliveryMethodQuery { + let subquery = MoneyV2Query() + subfields(subquery) + + addField(field: "amount", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The code of the delivery method. + @discardableResult + open func code(alias: String? = nil) -> ShopPayPaymentRequestDeliveryMethodQuery { + addField(field: "code", aliasSuffix: alias) + return self + } + + /// The detail about when the delivery may be expected. + @discardableResult + open func deliveryExpectationLabel(alias: String? = nil) -> ShopPayPaymentRequestDeliveryMethodQuery { + addField(field: "deliveryExpectationLabel", aliasSuffix: alias) + return self + } + + /// The detail of the delivery method. + @discardableResult + open func detail(alias: String? = nil) -> ShopPayPaymentRequestDeliveryMethodQuery { + addField(field: "detail", aliasSuffix: alias) + return self + } + + /// The label of the delivery method. + @discardableResult + open func label(alias: String? = nil) -> ShopPayPaymentRequestDeliveryMethodQuery { + addField(field: "label", aliasSuffix: alias) + return self + } + + /// The maximum delivery date for the delivery method. + @discardableResult + open func maxDeliveryDate(alias: String? = nil) -> ShopPayPaymentRequestDeliveryMethodQuery { + addField(field: "maxDeliveryDate", aliasSuffix: alias) + return self + } + + /// The minimum delivery date for the delivery method. + @discardableResult + open func minDeliveryDate(alias: String? = nil) -> ShopPayPaymentRequestDeliveryMethodQuery { + addField(field: "minDeliveryDate", aliasSuffix: alias) + return self + } + } + + /// Represents a delivery method for a Shop Pay payment request. + open class ShopPayPaymentRequestDeliveryMethod: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = ShopPayPaymentRequestDeliveryMethodQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "amount": + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequestDeliveryMethod.self, field: fieldName, value: fieldValue) + } + return try MoneyV2(fields: value) + + case "code": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestDeliveryMethod.self, field: fieldName, value: fieldValue) + } + return value + + case "deliveryExpectationLabel": + if value is NSNull { return nil } + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestDeliveryMethod.self, field: fieldName, value: fieldValue) + } + return value + + case "detail": + if value is NSNull { return nil } + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestDeliveryMethod.self, field: fieldName, value: fieldValue) + } + return value + + case "label": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestDeliveryMethod.self, field: fieldName, value: fieldValue) + } + return value + + case "maxDeliveryDate": + if value is NSNull { return nil } + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestDeliveryMethod.self, field: fieldName, value: fieldValue) + } + return value + + case "minDeliveryDate": + if value is NSNull { return nil } + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestDeliveryMethod.self, field: fieldName, value: fieldValue) + } + return value + + default: + throw SchemaViolationError(type: ShopPayPaymentRequestDeliveryMethod.self, field: fieldName, value: fieldValue) + } + } + + /// The amount for the delivery method. + open var amount: Storefront.MoneyV2 { + return internalGetAmount() + } + + func internalGetAmount(alias: String? = nil) -> Storefront.MoneyV2 { + return field(field: "amount", aliasSuffix: alias) as! Storefront.MoneyV2 + } + + /// The code of the delivery method. + open var code: String { + return internalGetCode() + } + + func internalGetCode(alias: String? = nil) -> String { + return field(field: "code", aliasSuffix: alias) as! String + } + + /// The detail about when the delivery may be expected. + open var deliveryExpectationLabel: String? { + return internalGetDeliveryExpectationLabel() + } + + func internalGetDeliveryExpectationLabel(alias: String? = nil) -> String? { + return field(field: "deliveryExpectationLabel", aliasSuffix: alias) as! String? + } + + /// The detail of the delivery method. + open var detail: String? { + return internalGetDetail() + } + + func internalGetDetail(alias: String? = nil) -> String? { + return field(field: "detail", aliasSuffix: alias) as! String? + } + + /// The label of the delivery method. + open var label: String { + return internalGetLabel() + } + + func internalGetLabel(alias: String? = nil) -> String { + return field(field: "label", aliasSuffix: alias) as! String + } + + /// The maximum delivery date for the delivery method. + open var maxDeliveryDate: String? { + return internalGetMaxDeliveryDate() + } + + func internalGetMaxDeliveryDate(alias: String? = nil) -> String? { + return field(field: "maxDeliveryDate", aliasSuffix: alias) as! String? + } + + /// The minimum delivery date for the delivery method. + open var minDeliveryDate: String? { + return internalGetMinDeliveryDate() + } + + func internalGetMinDeliveryDate(alias: String? = nil) -> String? { + return field(field: "minDeliveryDate", aliasSuffix: alias) as! String? + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + var response: [GraphQL.AbstractResponse] = [] + objectMap.keys.forEach { + switch($0) { + case "amount": + response.append(internalGetAmount()) + response.append(contentsOf: internalGetAmount().childResponseObjectMap()) + + default: + break + } + } + return response + } + } +} diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestDeliveryMethodInput.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestDeliveryMethodInput.swift new file mode 100644 index 00000000..df72a37c --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestDeliveryMethodInput.swift @@ -0,0 +1,171 @@ +// +// ShopPayPaymentRequestDeliveryMethodInput.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// The input fields to create a delivery method for a Shop Pay payment + /// request. + open class ShopPayPaymentRequestDeliveryMethodInput { + /// The code of the delivery method. + open var code: Input + + /// The label of the delivery method. + open var label: Input + + /// The detail of the delivery method. + open var detail: Input + + /// The amount for the delivery method. + open var amount: Input + + /// The minimum delivery date for the delivery method. + open var minDeliveryDate: Input + + /// The maximum delivery date for the delivery method. + open var maxDeliveryDate: Input + + /// The detail about when the delivery may be expected. + open var deliveryExpectationLabel: Input + + /// Creates the input object. + /// + /// - parameters: + /// - code: The code of the delivery method. + /// - label: The label of the delivery method. + /// - detail: The detail of the delivery method. + /// - amount: The amount for the delivery method. + /// - minDeliveryDate: The minimum delivery date for the delivery method. + /// - maxDeliveryDate: The maximum delivery date for the delivery method. + /// - deliveryExpectationLabel: The detail about when the delivery may be expected. + /// + public static func create(code: Input = .undefined, label: Input = .undefined, detail: Input = .undefined, amount: Input = .undefined, minDeliveryDate: Input = .undefined, maxDeliveryDate: Input = .undefined, deliveryExpectationLabel: Input = .undefined) -> ShopPayPaymentRequestDeliveryMethodInput { + return ShopPayPaymentRequestDeliveryMethodInput(code: code, label: label, detail: detail, amount: amount, minDeliveryDate: minDeliveryDate, maxDeliveryDate: maxDeliveryDate, deliveryExpectationLabel: deliveryExpectationLabel) + } + + private init(code: Input = .undefined, label: Input = .undefined, detail: Input = .undefined, amount: Input = .undefined, minDeliveryDate: Input = .undefined, maxDeliveryDate: Input = .undefined, deliveryExpectationLabel: Input = .undefined) { + self.code = code + self.label = label + self.detail = detail + self.amount = amount + self.minDeliveryDate = minDeliveryDate + self.maxDeliveryDate = maxDeliveryDate + self.deliveryExpectationLabel = deliveryExpectationLabel + } + + /// Creates the input object. + /// + /// - parameters: + /// - code: The code of the delivery method. + /// - label: The label of the delivery method. + /// - detail: The detail of the delivery method. + /// - amount: The amount for the delivery method. + /// - minDeliveryDate: The minimum delivery date for the delivery method. + /// - maxDeliveryDate: The maximum delivery date for the delivery method. + /// - deliveryExpectationLabel: The detail about when the delivery may be expected. + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(code: String? = nil, label: String? = nil, detail: String? = nil, amount: MoneyInput? = nil, minDeliveryDate: String? = nil, maxDeliveryDate: String? = nil, deliveryExpectationLabel: String? = nil) { + self.init(code: code.orUndefined, label: label.orUndefined, detail: detail.orUndefined, amount: amount.orUndefined, minDeliveryDate: minDeliveryDate.orUndefined, maxDeliveryDate: maxDeliveryDate.orUndefined, deliveryExpectationLabel: deliveryExpectationLabel.orUndefined) + } + + internal func serialize() -> String { + var fields: [String] = [] + + switch code { + case .value(let code): + guard let code = code else { + fields.append("code:null") + break + } + fields.append("code:\(GraphQL.quoteString(input: code))") + case .undefined: break + } + + switch label { + case .value(let label): + guard let label = label else { + fields.append("label:null") + break + } + fields.append("label:\(GraphQL.quoteString(input: label))") + case .undefined: break + } + + switch detail { + case .value(let detail): + guard let detail = detail else { + fields.append("detail:null") + break + } + fields.append("detail:\(GraphQL.quoteString(input: detail))") + case .undefined: break + } + + switch amount { + case .value(let amount): + guard let amount = amount else { + fields.append("amount:null") + break + } + fields.append("amount:\(amount.serialize())") + case .undefined: break + } + + switch minDeliveryDate { + case .value(let minDeliveryDate): + guard let minDeliveryDate = minDeliveryDate else { + fields.append("minDeliveryDate:null") + break + } + fields.append("minDeliveryDate:\(GraphQL.quoteString(input: minDeliveryDate))") + case .undefined: break + } + + switch maxDeliveryDate { + case .value(let maxDeliveryDate): + guard let maxDeliveryDate = maxDeliveryDate else { + fields.append("maxDeliveryDate:null") + break + } + fields.append("maxDeliveryDate:\(GraphQL.quoteString(input: maxDeliveryDate))") + case .undefined: break + } + + switch deliveryExpectationLabel { + case .value(let deliveryExpectationLabel): + guard let deliveryExpectationLabel = deliveryExpectationLabel else { + fields.append("deliveryExpectationLabel:null") + break + } + fields.append("deliveryExpectationLabel:\(GraphQL.quoteString(input: deliveryExpectationLabel))") + case .undefined: break + } + + return "{\(fields.joined(separator: ","))}" + } + } +} diff --git a/Buy/Generated/Storefront/PaymentTokenType.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestDeliveryMethodType.swift similarity index 74% rename from Buy/Generated/Storefront/PaymentTokenType.swift rename to Buy/Generated/Storefront/ShopPayPaymentRequestDeliveryMethodType.swift index 64f6a36b..0c3fb37c 100644 --- a/Buy/Generated/Storefront/PaymentTokenType.swift +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestDeliveryMethodType.swift @@ -1,5 +1,5 @@ // -// PaymentTokenType.swift +// ShopPayPaymentRequestDeliveryMethodType.swift // Buy // // Created by Shopify. @@ -27,22 +27,13 @@ import Foundation extension Storefront { - /// The valid values for the types of payment token. - public enum PaymentTokenType: String { - /// Apple Pay token type. - case applePay = "APPLE_PAY" + /// Represents the delivery method type for a Shop Pay payment request. + public enum ShopPayPaymentRequestDeliveryMethodType: String { + /// The delivery method type is pickup. + case pickup = "PICKUP" - /// Google Pay token type. - case googlePay = "GOOGLE_PAY" - - /// Shopify Pay token type. - case shopifyPay = "SHOPIFY_PAY" - - /// Stripe token type. - case stripeVaultToken = "STRIPE_VAULT_TOKEN" - - /// Vault payment token type. - case vault = "VAULT" + /// The delivery method type is shipping. + case shipping = "SHIPPING" case unknownValue = "" } diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestDiscount.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestDiscount.swift new file mode 100644 index 00000000..64138358 --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestDiscount.swift @@ -0,0 +1,109 @@ +// +// ShopPayPaymentRequestDiscount.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Represents a discount for a Shop Pay payment request. + open class ShopPayPaymentRequestDiscountQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ShopPayPaymentRequestDiscount + + /// The amount of the discount. + @discardableResult + open func amount(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> ShopPayPaymentRequestDiscountQuery { + let subquery = MoneyV2Query() + subfields(subquery) + + addField(field: "amount", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The label of the discount. + @discardableResult + open func label(alias: String? = nil) -> ShopPayPaymentRequestDiscountQuery { + addField(field: "label", aliasSuffix: alias) + return self + } + } + + /// Represents a discount for a Shop Pay payment request. + open class ShopPayPaymentRequestDiscount: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = ShopPayPaymentRequestDiscountQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "amount": + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequestDiscount.self, field: fieldName, value: fieldValue) + } + return try MoneyV2(fields: value) + + case "label": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestDiscount.self, field: fieldName, value: fieldValue) + } + return value + + default: + throw SchemaViolationError(type: ShopPayPaymentRequestDiscount.self, field: fieldName, value: fieldValue) + } + } + + /// The amount of the discount. + open var amount: Storefront.MoneyV2 { + return internalGetAmount() + } + + func internalGetAmount(alias: String? = nil) -> Storefront.MoneyV2 { + return field(field: "amount", aliasSuffix: alias) as! Storefront.MoneyV2 + } + + /// The label of the discount. + open var label: String { + return internalGetLabel() + } + + func internalGetLabel(alias: String? = nil) -> String { + return field(field: "label", aliasSuffix: alias) as! String + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + var response: [GraphQL.AbstractResponse] = [] + objectMap.keys.forEach { + switch($0) { + case "amount": + response.append(internalGetAmount()) + response.append(contentsOf: internalGetAmount().childResponseObjectMap()) + + default: + break + } + } + return response + } + } +} diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestDiscountInput.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestDiscountInput.swift new file mode 100644 index 00000000..6807afbe --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestDiscountInput.swift @@ -0,0 +1,90 @@ +// +// ShopPayPaymentRequestDiscountInput.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// The input fields to create a discount for a Shop Pay payment request. + open class ShopPayPaymentRequestDiscountInput { + /// The label of the discount. + open var label: Input + + /// The amount of the discount. + open var amount: Input + + /// Creates the input object. + /// + /// - parameters: + /// - label: The label of the discount. + /// - amount: The amount of the discount. + /// + public static func create(label: Input = .undefined, amount: Input = .undefined) -> ShopPayPaymentRequestDiscountInput { + return ShopPayPaymentRequestDiscountInput(label: label, amount: amount) + } + + private init(label: Input = .undefined, amount: Input = .undefined) { + self.label = label + self.amount = amount + } + + /// Creates the input object. + /// + /// - parameters: + /// - label: The label of the discount. + /// - amount: The amount of the discount. + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(label: String? = nil, amount: MoneyInput? = nil) { + self.init(label: label.orUndefined, amount: amount.orUndefined) + } + + internal func serialize() -> String { + var fields: [String] = [] + + switch label { + case .value(let label): + guard let label = label else { + fields.append("label:null") + break + } + fields.append("label:\(GraphQL.quoteString(input: label))") + case .undefined: break + } + + switch amount { + case .value(let amount): + guard let amount = amount else { + fields.append("amount:null") + break + } + fields.append("amount:\(amount.serialize())") + case .undefined: break + } + + return "{\(fields.joined(separator: ","))}" + } + } +} diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestImage.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestImage.swift new file mode 100644 index 00000000..4b2466a5 --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestImage.swift @@ -0,0 +1,96 @@ +// +// ShopPayPaymentRequestImage.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Represents an image for a Shop Pay payment request line item. + open class ShopPayPaymentRequestImageQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ShopPayPaymentRequestImage + + /// The alt text of the image. + @discardableResult + open func alt(alias: String? = nil) -> ShopPayPaymentRequestImageQuery { + addField(field: "alt", aliasSuffix: alias) + return self + } + + /// The source URL of the image. + @discardableResult + open func url(alias: String? = nil) -> ShopPayPaymentRequestImageQuery { + addField(field: "url", aliasSuffix: alias) + return self + } + } + + /// Represents an image for a Shop Pay payment request line item. + open class ShopPayPaymentRequestImage: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = ShopPayPaymentRequestImageQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "alt": + if value is NSNull { return nil } + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestImage.self, field: fieldName, value: fieldValue) + } + return value + + case "url": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestImage.self, field: fieldName, value: fieldValue) + } + return value + + default: + throw SchemaViolationError(type: ShopPayPaymentRequestImage.self, field: fieldName, value: fieldValue) + } + } + + /// The alt text of the image. + open var alt: String? { + return internalGetAlt() + } + + func internalGetAlt(alias: String? = nil) -> String? { + return field(field: "alt", aliasSuffix: alias) as! String? + } + + /// The source URL of the image. + open var url: String { + return internalGetUrl() + } + + func internalGetUrl(alias: String? = nil) -> String { + return field(field: "url", aliasSuffix: alias) as! String + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + return [] + } + } +} diff --git a/Buy/Generated/Storefront/CheckoutBuyerIdentityInput.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestImageInput.swift similarity index 53% rename from Buy/Generated/Storefront/CheckoutBuyerIdentityInput.swift rename to Buy/Generated/Storefront/ShopPayPaymentRequestImageInput.swift index d3bee578..d88f70ad 100644 --- a/Buy/Generated/Storefront/CheckoutBuyerIdentityInput.swift +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestImageInput.swift @@ -1,5 +1,5 @@ // -// CheckoutBuyerIdentityInput.swift +// ShopPayPaymentRequestImageInput.swift // Buy // // Created by Shopify. @@ -27,37 +27,54 @@ import Foundation extension Storefront { - /// The input fields for the identity of the customer associated with the - /// checkout. - open class CheckoutBuyerIdentityInput { - /// The country code of one of the shop's [enabled - /// countries](https://help.shopify.com/en/manual/payments/shopify-payments/multi-currency/setup). - /// For example, `CA`. Including this field creates a checkout in the specified - /// country's currency. - open var countryCode: CountryCode + /// The input fields to create an image for a Shop Pay payment request. + open class ShopPayPaymentRequestImageInput { + /// The source URL of the image. + open var url: String + + /// The alt text of the image. + open var alt: Input /// Creates the input object. /// /// - parameters: - /// - countryCode: The country code of one of the shop's [enabled countries](https://help.shopify.com/en/manual/payments/shopify-payments/multi-currency/setup). For example, `CA`. Including this field creates a checkout in the specified country's currency. + /// - url: The source URL of the image. + /// - alt: The alt text of the image. /// - public static func create(countryCode: CountryCode) -> CheckoutBuyerIdentityInput { - return CheckoutBuyerIdentityInput(countryCode: countryCode) + public static func create(url: String, alt: Input = .undefined) -> ShopPayPaymentRequestImageInput { + return ShopPayPaymentRequestImageInput(url: url, alt: alt) + } + + private init(url: String, alt: Input = .undefined) { + self.url = url + self.alt = alt } /// Creates the input object. /// /// - parameters: - /// - countryCode: The country code of one of the shop's [enabled countries](https://help.shopify.com/en/manual/payments/shopify-payments/multi-currency/setup). For example, `CA`. Including this field creates a checkout in the specified country's currency. + /// - url: The source URL of the image. + /// - alt: The alt text of the image. /// - public init(countryCode: CountryCode) { - self.countryCode = countryCode + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(url: String, alt: String? = nil) { + self.init(url: url, alt: alt.orUndefined) } internal func serialize() -> String { var fields: [String] = [] - fields.append("countryCode:\(countryCode.rawValue)") + fields.append("url:\(GraphQL.quoteString(input: url))") + + switch alt { + case .value(let alt): + guard let alt = alt else { + fields.append("alt:null") + break + } + fields.append("alt:\(GraphQL.quoteString(input: alt))") + case .undefined: break + } return "{\(fields.joined(separator: ","))}" } diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestInput.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestInput.swift new file mode 100644 index 00000000..b608fa80 --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestInput.swift @@ -0,0 +1,239 @@ +// +// ShopPayPaymentRequestInput.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// The input fields represent a Shop Pay payment request. + open class ShopPayPaymentRequestInput { + /// The discount codes for the payment request. The input must not contain more + /// than `250` values. + open var discountCodes: Input<[String]> + + /// The line items for the payment request. The input must not contain more + /// than `250` values. + open var lineItems: Input<[ShopPayPaymentRequestLineItemInput]> + + /// The shipping lines for the payment request. The input must not contain more + /// than `250` values. + open var shippingLines: Input<[ShopPayPaymentRequestShippingLineInput]> + + /// The total amount for the payment request. + open var total: MoneyInput + + /// The subtotal amount for the payment request. + open var subtotal: MoneyInput + + /// The discounts for the payment request order. The input must not contain + /// more than `250` values. + open var discounts: Input<[ShopPayPaymentRequestDiscountInput]> + + /// The total shipping price for the payment request. + open var totalShippingPrice: Input + + /// The total tax for the payment request. + open var totalTax: Input + + /// The delivery methods for the payment request. The input must not contain + /// more than `250` values. + open var deliveryMethods: Input<[ShopPayPaymentRequestDeliveryMethodInput]> + + /// The delivery method type for the payment request. + open var selectedDeliveryMethodType: Input + + /// The locale for the payment request. + open var locale: String + + /// The presentment currency for the payment request. + open var presentmentCurrency: CurrencyCode + + /// The encrypted payment method for the payment request. + open var paymentMethod: Input + + /// Creates the input object. + /// + /// - parameters: + /// - discountCodes: The discount codes for the payment request. The input must not contain more than `250` values. + /// - lineItems: The line items for the payment request. The input must not contain more than `250` values. + /// - shippingLines: The shipping lines for the payment request. The input must not contain more than `250` values. + /// - total: The total amount for the payment request. + /// - subtotal: The subtotal amount for the payment request. + /// - discounts: The discounts for the payment request order. The input must not contain more than `250` values. + /// - totalShippingPrice: The total shipping price for the payment request. + /// - totalTax: The total tax for the payment request. + /// - deliveryMethods: The delivery methods for the payment request. The input must not contain more than `250` values. + /// - selectedDeliveryMethodType: The delivery method type for the payment request. + /// - locale: The locale for the payment request. + /// - presentmentCurrency: The presentment currency for the payment request. + /// - paymentMethod: The encrypted payment method for the payment request. + /// + public static func create(total: MoneyInput, subtotal: MoneyInput, locale: String, presentmentCurrency: CurrencyCode, discountCodes: Input<[String]> = .undefined, lineItems: Input<[ShopPayPaymentRequestLineItemInput]> = .undefined, shippingLines: Input<[ShopPayPaymentRequestShippingLineInput]> = .undefined, discounts: Input<[ShopPayPaymentRequestDiscountInput]> = .undefined, totalShippingPrice: Input = .undefined, totalTax: Input = .undefined, deliveryMethods: Input<[ShopPayPaymentRequestDeliveryMethodInput]> = .undefined, selectedDeliveryMethodType: Input = .undefined, paymentMethod: Input = .undefined) -> ShopPayPaymentRequestInput { + return ShopPayPaymentRequestInput(total: total, subtotal: subtotal, locale: locale, presentmentCurrency: presentmentCurrency, discountCodes: discountCodes, lineItems: lineItems, shippingLines: shippingLines, discounts: discounts, totalShippingPrice: totalShippingPrice, totalTax: totalTax, deliveryMethods: deliveryMethods, selectedDeliveryMethodType: selectedDeliveryMethodType, paymentMethod: paymentMethod) + } + + private init(total: MoneyInput, subtotal: MoneyInput, locale: String, presentmentCurrency: CurrencyCode, discountCodes: Input<[String]> = .undefined, lineItems: Input<[ShopPayPaymentRequestLineItemInput]> = .undefined, shippingLines: Input<[ShopPayPaymentRequestShippingLineInput]> = .undefined, discounts: Input<[ShopPayPaymentRequestDiscountInput]> = .undefined, totalShippingPrice: Input = .undefined, totalTax: Input = .undefined, deliveryMethods: Input<[ShopPayPaymentRequestDeliveryMethodInput]> = .undefined, selectedDeliveryMethodType: Input = .undefined, paymentMethod: Input = .undefined) { + self.discountCodes = discountCodes + self.lineItems = lineItems + self.shippingLines = shippingLines + self.total = total + self.subtotal = subtotal + self.discounts = discounts + self.totalShippingPrice = totalShippingPrice + self.totalTax = totalTax + self.deliveryMethods = deliveryMethods + self.selectedDeliveryMethodType = selectedDeliveryMethodType + self.locale = locale + self.presentmentCurrency = presentmentCurrency + self.paymentMethod = paymentMethod + } + + /// Creates the input object. + /// + /// - parameters: + /// - discountCodes: The discount codes for the payment request. The input must not contain more than `250` values. + /// - lineItems: The line items for the payment request. The input must not contain more than `250` values. + /// - shippingLines: The shipping lines for the payment request. The input must not contain more than `250` values. + /// - total: The total amount for the payment request. + /// - subtotal: The subtotal amount for the payment request. + /// - discounts: The discounts for the payment request order. The input must not contain more than `250` values. + /// - totalShippingPrice: The total shipping price for the payment request. + /// - totalTax: The total tax for the payment request. + /// - deliveryMethods: The delivery methods for the payment request. The input must not contain more than `250` values. + /// - selectedDeliveryMethodType: The delivery method type for the payment request. + /// - locale: The locale for the payment request. + /// - presentmentCurrency: The presentment currency for the payment request. + /// - paymentMethod: The encrypted payment method for the payment request. + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(total: MoneyInput, subtotal: MoneyInput, locale: String, presentmentCurrency: CurrencyCode, discountCodes: [String]? = nil, lineItems: [ShopPayPaymentRequestLineItemInput]? = nil, shippingLines: [ShopPayPaymentRequestShippingLineInput]? = nil, discounts: [ShopPayPaymentRequestDiscountInput]? = nil, totalShippingPrice: ShopPayPaymentRequestTotalShippingPriceInput? = nil, totalTax: MoneyInput? = nil, deliveryMethods: [ShopPayPaymentRequestDeliveryMethodInput]? = nil, selectedDeliveryMethodType: ShopPayPaymentRequestDeliveryMethodType? = nil, paymentMethod: String? = nil) { + self.init(total: total, subtotal: subtotal, locale: locale, presentmentCurrency: presentmentCurrency, discountCodes: discountCodes.orUndefined, lineItems: lineItems.orUndefined, shippingLines: shippingLines.orUndefined, discounts: discounts.orUndefined, totalShippingPrice: totalShippingPrice.orUndefined, totalTax: totalTax.orUndefined, deliveryMethods: deliveryMethods.orUndefined, selectedDeliveryMethodType: selectedDeliveryMethodType.orUndefined, paymentMethod: paymentMethod.orUndefined) + } + + internal func serialize() -> String { + var fields: [String] = [] + + switch discountCodes { + case .value(let discountCodes): + guard let discountCodes = discountCodes else { + fields.append("discountCodes:null") + break + } + fields.append("discountCodes:[\(discountCodes.map{ "\(GraphQL.quoteString(input: $0))" }.joined(separator: ","))]") + case .undefined: break + } + + switch lineItems { + case .value(let lineItems): + guard let lineItems = lineItems else { + fields.append("lineItems:null") + break + } + fields.append("lineItems:[\(lineItems.map{ "\($0.serialize())" }.joined(separator: ","))]") + case .undefined: break + } + + switch shippingLines { + case .value(let shippingLines): + guard let shippingLines = shippingLines else { + fields.append("shippingLines:null") + break + } + fields.append("shippingLines:[\(shippingLines.map{ "\($0.serialize())" }.joined(separator: ","))]") + case .undefined: break + } + + fields.append("total:\(total.serialize())") + + fields.append("subtotal:\(subtotal.serialize())") + + switch discounts { + case .value(let discounts): + guard let discounts = discounts else { + fields.append("discounts:null") + break + } + fields.append("discounts:[\(discounts.map{ "\($0.serialize())" }.joined(separator: ","))]") + case .undefined: break + } + + switch totalShippingPrice { + case .value(let totalShippingPrice): + guard let totalShippingPrice = totalShippingPrice else { + fields.append("totalShippingPrice:null") + break + } + fields.append("totalShippingPrice:\(totalShippingPrice.serialize())") + case .undefined: break + } + + switch totalTax { + case .value(let totalTax): + guard let totalTax = totalTax else { + fields.append("totalTax:null") + break + } + fields.append("totalTax:\(totalTax.serialize())") + case .undefined: break + } + + switch deliveryMethods { + case .value(let deliveryMethods): + guard let deliveryMethods = deliveryMethods else { + fields.append("deliveryMethods:null") + break + } + fields.append("deliveryMethods:[\(deliveryMethods.map{ "\($0.serialize())" }.joined(separator: ","))]") + case .undefined: break + } + + switch selectedDeliveryMethodType { + case .value(let selectedDeliveryMethodType): + guard let selectedDeliveryMethodType = selectedDeliveryMethodType else { + fields.append("selectedDeliveryMethodType:null") + break + } + fields.append("selectedDeliveryMethodType:\(selectedDeliveryMethodType.rawValue)") + case .undefined: break + } + + fields.append("locale:\(GraphQL.quoteString(input: locale))") + + fields.append("presentmentCurrency:\(presentmentCurrency.rawValue)") + + switch paymentMethod { + case .value(let paymentMethod): + guard let paymentMethod = paymentMethod else { + fields.append("paymentMethod:null") + break + } + fields.append("paymentMethod:\(GraphQL.quoteString(input: paymentMethod))") + case .undefined: break + } + + return "{\(fields.joined(separator: ","))}" + } + } +} diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestLineItem.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestLineItem.swift new file mode 100644 index 00000000..38852723 --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestLineItem.swift @@ -0,0 +1,370 @@ +// +// ShopPayPaymentRequestLineItem.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Represents a line item for a Shop Pay payment request. + open class ShopPayPaymentRequestLineItemQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ShopPayPaymentRequestLineItem + + /// The final item price for the line item. + @discardableResult + open func finalItemPrice(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> ShopPayPaymentRequestLineItemQuery { + let subquery = MoneyV2Query() + subfields(subquery) + + addField(field: "finalItemPrice", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The final line price for the line item. + @discardableResult + open func finalLinePrice(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> ShopPayPaymentRequestLineItemQuery { + let subquery = MoneyV2Query() + subfields(subquery) + + addField(field: "finalLinePrice", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The image of the line item. + @discardableResult + open func image(alias: String? = nil, _ subfields: (ShopPayPaymentRequestImageQuery) -> Void) -> ShopPayPaymentRequestLineItemQuery { + let subquery = ShopPayPaymentRequestImageQuery() + subfields(subquery) + + addField(field: "image", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The item discounts for the line item. + @discardableResult + open func itemDiscounts(alias: String? = nil, _ subfields: (ShopPayPaymentRequestDiscountQuery) -> Void) -> ShopPayPaymentRequestLineItemQuery { + let subquery = ShopPayPaymentRequestDiscountQuery() + subfields(subquery) + + addField(field: "itemDiscounts", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The label of the line item. + @discardableResult + open func label(alias: String? = nil) -> ShopPayPaymentRequestLineItemQuery { + addField(field: "label", aliasSuffix: alias) + return self + } + + /// The line discounts for the line item. + @discardableResult + open func lineDiscounts(alias: String? = nil, _ subfields: (ShopPayPaymentRequestDiscountQuery) -> Void) -> ShopPayPaymentRequestLineItemQuery { + let subquery = ShopPayPaymentRequestDiscountQuery() + subfields(subquery) + + addField(field: "lineDiscounts", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The original item price for the line item. + @discardableResult + open func originalItemPrice(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> ShopPayPaymentRequestLineItemQuery { + let subquery = MoneyV2Query() + subfields(subquery) + + addField(field: "originalItemPrice", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The original line price for the line item. + @discardableResult + open func originalLinePrice(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> ShopPayPaymentRequestLineItemQuery { + let subquery = MoneyV2Query() + subfields(subquery) + + addField(field: "originalLinePrice", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The quantity of the line item. + @discardableResult + open func quantity(alias: String? = nil) -> ShopPayPaymentRequestLineItemQuery { + addField(field: "quantity", aliasSuffix: alias) + return self + } + + /// Whether the line item requires shipping. + @discardableResult + open func requiresShipping(alias: String? = nil) -> ShopPayPaymentRequestLineItemQuery { + addField(field: "requiresShipping", aliasSuffix: alias) + return self + } + + /// The SKU of the line item. + @discardableResult + open func sku(alias: String? = nil) -> ShopPayPaymentRequestLineItemQuery { + addField(field: "sku", aliasSuffix: alias) + return self + } + } + + /// Represents a line item for a Shop Pay payment request. + open class ShopPayPaymentRequestLineItem: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = ShopPayPaymentRequestLineItemQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "finalItemPrice": + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequestLineItem.self, field: fieldName, value: fieldValue) + } + return try MoneyV2(fields: value) + + case "finalLinePrice": + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequestLineItem.self, field: fieldName, value: fieldValue) + } + return try MoneyV2(fields: value) + + case "image": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequestLineItem.self, field: fieldName, value: fieldValue) + } + return try ShopPayPaymentRequestImage(fields: value) + + case "itemDiscounts": + if value is NSNull { return nil } + guard let value = value as? [[String: Any]] else { + throw SchemaViolationError(type: ShopPayPaymentRequestLineItem.self, field: fieldName, value: fieldValue) + } + return try value.map { return try ShopPayPaymentRequestDiscount(fields: $0) } + + case "label": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestLineItem.self, field: fieldName, value: fieldValue) + } + return value + + case "lineDiscounts": + if value is NSNull { return nil } + guard let value = value as? [[String: Any]] else { + throw SchemaViolationError(type: ShopPayPaymentRequestLineItem.self, field: fieldName, value: fieldValue) + } + return try value.map { return try ShopPayPaymentRequestDiscount(fields: $0) } + + case "originalItemPrice": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequestLineItem.self, field: fieldName, value: fieldValue) + } + return try MoneyV2(fields: value) + + case "originalLinePrice": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequestLineItem.self, field: fieldName, value: fieldValue) + } + return try MoneyV2(fields: value) + + case "quantity": + guard let value = value as? Int else { + throw SchemaViolationError(type: ShopPayPaymentRequestLineItem.self, field: fieldName, value: fieldValue) + } + return Int32(value) + + case "requiresShipping": + if value is NSNull { return nil } + guard let value = value as? Bool else { + throw SchemaViolationError(type: ShopPayPaymentRequestLineItem.self, field: fieldName, value: fieldValue) + } + return value + + case "sku": + if value is NSNull { return nil } + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestLineItem.self, field: fieldName, value: fieldValue) + } + return value + + default: + throw SchemaViolationError(type: ShopPayPaymentRequestLineItem.self, field: fieldName, value: fieldValue) + } + } + + /// The final item price for the line item. + open var finalItemPrice: Storefront.MoneyV2 { + return internalGetFinalItemPrice() + } + + func internalGetFinalItemPrice(alias: String? = nil) -> Storefront.MoneyV2 { + return field(field: "finalItemPrice", aliasSuffix: alias) as! Storefront.MoneyV2 + } + + /// The final line price for the line item. + open var finalLinePrice: Storefront.MoneyV2 { + return internalGetFinalLinePrice() + } + + func internalGetFinalLinePrice(alias: String? = nil) -> Storefront.MoneyV2 { + return field(field: "finalLinePrice", aliasSuffix: alias) as! Storefront.MoneyV2 + } + + /// The image of the line item. + open var image: Storefront.ShopPayPaymentRequestImage? { + return internalGetImage() + } + + func internalGetImage(alias: String? = nil) -> Storefront.ShopPayPaymentRequestImage? { + return field(field: "image", aliasSuffix: alias) as! Storefront.ShopPayPaymentRequestImage? + } + + /// The item discounts for the line item. + open var itemDiscounts: [Storefront.ShopPayPaymentRequestDiscount]? { + return internalGetItemDiscounts() + } + + func internalGetItemDiscounts(alias: String? = nil) -> [Storefront.ShopPayPaymentRequestDiscount]? { + return field(field: "itemDiscounts", aliasSuffix: alias) as! [Storefront.ShopPayPaymentRequestDiscount]? + } + + /// The label of the line item. + open var label: String { + return internalGetLabel() + } + + func internalGetLabel(alias: String? = nil) -> String { + return field(field: "label", aliasSuffix: alias) as! String + } + + /// The line discounts for the line item. + open var lineDiscounts: [Storefront.ShopPayPaymentRequestDiscount]? { + return internalGetLineDiscounts() + } + + func internalGetLineDiscounts(alias: String? = nil) -> [Storefront.ShopPayPaymentRequestDiscount]? { + return field(field: "lineDiscounts", aliasSuffix: alias) as! [Storefront.ShopPayPaymentRequestDiscount]? + } + + /// The original item price for the line item. + open var originalItemPrice: Storefront.MoneyV2? { + return internalGetOriginalItemPrice() + } + + func internalGetOriginalItemPrice(alias: String? = nil) -> Storefront.MoneyV2? { + return field(field: "originalItemPrice", aliasSuffix: alias) as! Storefront.MoneyV2? + } + + /// The original line price for the line item. + open var originalLinePrice: Storefront.MoneyV2? { + return internalGetOriginalLinePrice() + } + + func internalGetOriginalLinePrice(alias: String? = nil) -> Storefront.MoneyV2? { + return field(field: "originalLinePrice", aliasSuffix: alias) as! Storefront.MoneyV2? + } + + /// The quantity of the line item. + open var quantity: Int32 { + return internalGetQuantity() + } + + func internalGetQuantity(alias: String? = nil) -> Int32 { + return field(field: "quantity", aliasSuffix: alias) as! Int32 + } + + /// Whether the line item requires shipping. + open var requiresShipping: Bool? { + return internalGetRequiresShipping() + } + + func internalGetRequiresShipping(alias: String? = nil) -> Bool? { + return field(field: "requiresShipping", aliasSuffix: alias) as! Bool? + } + + /// The SKU of the line item. + open var sku: String? { + return internalGetSku() + } + + func internalGetSku(alias: String? = nil) -> String? { + return field(field: "sku", aliasSuffix: alias) as! String? + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + var response: [GraphQL.AbstractResponse] = [] + objectMap.keys.forEach { + switch($0) { + case "finalItemPrice": + response.append(internalGetFinalItemPrice()) + response.append(contentsOf: internalGetFinalItemPrice().childResponseObjectMap()) + + case "finalLinePrice": + response.append(internalGetFinalLinePrice()) + response.append(contentsOf: internalGetFinalLinePrice().childResponseObjectMap()) + + case "image": + if let value = internalGetImage() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + + case "itemDiscounts": + if let value = internalGetItemDiscounts() { + value.forEach { + response.append($0) + response.append(contentsOf: $0.childResponseObjectMap()) + } + } + + case "lineDiscounts": + if let value = internalGetLineDiscounts() { + value.forEach { + response.append($0) + response.append(contentsOf: $0.childResponseObjectMap()) + } + } + + case "originalItemPrice": + if let value = internalGetOriginalItemPrice() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + + case "originalLinePrice": + if let value = internalGetOriginalLinePrice() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + + default: + break + } + } + return response + } + } +} diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestLineItemInput.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestLineItemInput.swift new file mode 100644 index 00000000..dd73e4cd --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestLineItemInput.swift @@ -0,0 +1,228 @@ +// +// ShopPayPaymentRequestLineItemInput.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// The input fields to create a line item for a Shop Pay payment request. + open class ShopPayPaymentRequestLineItemInput { + /// The label of the line item. + open var label: Input + + /// The quantity of the line item. + open var quantity: Int32 + + /// The SKU of the line item. + open var sku: Input + + /// Whether the line item requires shipping. + open var requiresShipping: Input + + /// The image of the line item. + open var image: Input + + /// The original line price for the line item. + open var originalLinePrice: Input + + /// The final line price for the line item. + open var finalLinePrice: Input + + /// The line discounts for the line item. The input must not contain more than + /// `250` values. + open var lineDiscounts: Input<[ShopPayPaymentRequestDiscountInput]> + + /// The original item price for the line item. + open var originalItemPrice: Input + + /// The final item price for the line item. + open var finalItemPrice: Input + + /// The item discounts for the line item. The input must not contain more than + /// `250` values. + open var itemDiscounts: Input<[ShopPayPaymentRequestDiscountInput]> + + /// Creates the input object. + /// + /// - parameters: + /// - label: The label of the line item. + /// - quantity: The quantity of the line item. + /// - sku: The SKU of the line item. + /// - requiresShipping: Whether the line item requires shipping. + /// - image: The image of the line item. + /// - originalLinePrice: The original line price for the line item. + /// - finalLinePrice: The final line price for the line item. + /// - lineDiscounts: The line discounts for the line item. The input must not contain more than `250` values. + /// - originalItemPrice: The original item price for the line item. + /// - finalItemPrice: The final item price for the line item. + /// - itemDiscounts: The item discounts for the line item. The input must not contain more than `250` values. + /// + public static func create(quantity: Int32, label: Input = .undefined, sku: Input = .undefined, requiresShipping: Input = .undefined, image: Input = .undefined, originalLinePrice: Input = .undefined, finalLinePrice: Input = .undefined, lineDiscounts: Input<[ShopPayPaymentRequestDiscountInput]> = .undefined, originalItemPrice: Input = .undefined, finalItemPrice: Input = .undefined, itemDiscounts: Input<[ShopPayPaymentRequestDiscountInput]> = .undefined) -> ShopPayPaymentRequestLineItemInput { + return ShopPayPaymentRequestLineItemInput(quantity: quantity, label: label, sku: sku, requiresShipping: requiresShipping, image: image, originalLinePrice: originalLinePrice, finalLinePrice: finalLinePrice, lineDiscounts: lineDiscounts, originalItemPrice: originalItemPrice, finalItemPrice: finalItemPrice, itemDiscounts: itemDiscounts) + } + + private init(quantity: Int32, label: Input = .undefined, sku: Input = .undefined, requiresShipping: Input = .undefined, image: Input = .undefined, originalLinePrice: Input = .undefined, finalLinePrice: Input = .undefined, lineDiscounts: Input<[ShopPayPaymentRequestDiscountInput]> = .undefined, originalItemPrice: Input = .undefined, finalItemPrice: Input = .undefined, itemDiscounts: Input<[ShopPayPaymentRequestDiscountInput]> = .undefined) { + self.label = label + self.quantity = quantity + self.sku = sku + self.requiresShipping = requiresShipping + self.image = image + self.originalLinePrice = originalLinePrice + self.finalLinePrice = finalLinePrice + self.lineDiscounts = lineDiscounts + self.originalItemPrice = originalItemPrice + self.finalItemPrice = finalItemPrice + self.itemDiscounts = itemDiscounts + } + + /// Creates the input object. + /// + /// - parameters: + /// - label: The label of the line item. + /// - quantity: The quantity of the line item. + /// - sku: The SKU of the line item. + /// - requiresShipping: Whether the line item requires shipping. + /// - image: The image of the line item. + /// - originalLinePrice: The original line price for the line item. + /// - finalLinePrice: The final line price for the line item. + /// - lineDiscounts: The line discounts for the line item. The input must not contain more than `250` values. + /// - originalItemPrice: The original item price for the line item. + /// - finalItemPrice: The final item price for the line item. + /// - itemDiscounts: The item discounts for the line item. The input must not contain more than `250` values. + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(quantity: Int32, label: String? = nil, sku: String? = nil, requiresShipping: Bool? = nil, image: ShopPayPaymentRequestImageInput? = nil, originalLinePrice: MoneyInput? = nil, finalLinePrice: MoneyInput? = nil, lineDiscounts: [ShopPayPaymentRequestDiscountInput]? = nil, originalItemPrice: MoneyInput? = nil, finalItemPrice: MoneyInput? = nil, itemDiscounts: [ShopPayPaymentRequestDiscountInput]? = nil) { + self.init(quantity: quantity, label: label.orUndefined, sku: sku.orUndefined, requiresShipping: requiresShipping.orUndefined, image: image.orUndefined, originalLinePrice: originalLinePrice.orUndefined, finalLinePrice: finalLinePrice.orUndefined, lineDiscounts: lineDiscounts.orUndefined, originalItemPrice: originalItemPrice.orUndefined, finalItemPrice: finalItemPrice.orUndefined, itemDiscounts: itemDiscounts.orUndefined) + } + + internal func serialize() -> String { + var fields: [String] = [] + + switch label { + case .value(let label): + guard let label = label else { + fields.append("label:null") + break + } + fields.append("label:\(GraphQL.quoteString(input: label))") + case .undefined: break + } + + fields.append("quantity:\(quantity)") + + switch sku { + case .value(let sku): + guard let sku = sku else { + fields.append("sku:null") + break + } + fields.append("sku:\(GraphQL.quoteString(input: sku))") + case .undefined: break + } + + switch requiresShipping { + case .value(let requiresShipping): + guard let requiresShipping = requiresShipping else { + fields.append("requiresShipping:null") + break + } + fields.append("requiresShipping:\(requiresShipping)") + case .undefined: break + } + + switch image { + case .value(let image): + guard let image = image else { + fields.append("image:null") + break + } + fields.append("image:\(image.serialize())") + case .undefined: break + } + + switch originalLinePrice { + case .value(let originalLinePrice): + guard let originalLinePrice = originalLinePrice else { + fields.append("originalLinePrice:null") + break + } + fields.append("originalLinePrice:\(originalLinePrice.serialize())") + case .undefined: break + } + + switch finalLinePrice { + case .value(let finalLinePrice): + guard let finalLinePrice = finalLinePrice else { + fields.append("finalLinePrice:null") + break + } + fields.append("finalLinePrice:\(finalLinePrice.serialize())") + case .undefined: break + } + + switch lineDiscounts { + case .value(let lineDiscounts): + guard let lineDiscounts = lineDiscounts else { + fields.append("lineDiscounts:null") + break + } + fields.append("lineDiscounts:[\(lineDiscounts.map{ "\($0.serialize())" }.joined(separator: ","))]") + case .undefined: break + } + + switch originalItemPrice { + case .value(let originalItemPrice): + guard let originalItemPrice = originalItemPrice else { + fields.append("originalItemPrice:null") + break + } + fields.append("originalItemPrice:\(originalItemPrice.serialize())") + case .undefined: break + } + + switch finalItemPrice { + case .value(let finalItemPrice): + guard let finalItemPrice = finalItemPrice else { + fields.append("finalItemPrice:null") + break + } + fields.append("finalItemPrice:\(finalItemPrice.serialize())") + case .undefined: break + } + + switch itemDiscounts { + case .value(let itemDiscounts): + guard let itemDiscounts = itemDiscounts else { + fields.append("itemDiscounts:null") + break + } + fields.append("itemDiscounts:[\(itemDiscounts.map{ "\($0.serialize())" }.joined(separator: ","))]") + case .undefined: break + } + + return "{\(fields.joined(separator: ","))}" + } + } +} diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestReceipt.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestReceipt.swift new file mode 100644 index 00000000..33f76982 --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestReceipt.swift @@ -0,0 +1,131 @@ +// +// ShopPayPaymentRequestReceipt.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Represents a receipt for a Shop Pay payment request. + open class ShopPayPaymentRequestReceiptQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ShopPayPaymentRequestReceipt + + /// The payment request object. + @discardableResult + open func paymentRequest(alias: String? = nil, _ subfields: (ShopPayPaymentRequestQuery) -> Void) -> ShopPayPaymentRequestReceiptQuery { + let subquery = ShopPayPaymentRequestQuery() + subfields(subquery) + + addField(field: "paymentRequest", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The processing status. + @discardableResult + open func processingStatusType(alias: String? = nil) -> ShopPayPaymentRequestReceiptQuery { + addField(field: "processingStatusType", aliasSuffix: alias) + return self + } + + /// The token of the receipt. + @discardableResult + open func token(alias: String? = nil) -> ShopPayPaymentRequestReceiptQuery { + addField(field: "token", aliasSuffix: alias) + return self + } + } + + /// Represents a receipt for a Shop Pay payment request. + open class ShopPayPaymentRequestReceipt: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = ShopPayPaymentRequestReceiptQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "paymentRequest": + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequestReceipt.self, field: fieldName, value: fieldValue) + } + return try ShopPayPaymentRequest(fields: value) + + case "processingStatusType": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestReceipt.self, field: fieldName, value: fieldValue) + } + return value + + case "token": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestReceipt.self, field: fieldName, value: fieldValue) + } + return value + + default: + throw SchemaViolationError(type: ShopPayPaymentRequestReceipt.self, field: fieldName, value: fieldValue) + } + } + + /// The payment request object. + open var paymentRequest: Storefront.ShopPayPaymentRequest { + return internalGetPaymentRequest() + } + + func internalGetPaymentRequest(alias: String? = nil) -> Storefront.ShopPayPaymentRequest { + return field(field: "paymentRequest", aliasSuffix: alias) as! Storefront.ShopPayPaymentRequest + } + + /// The processing status. + open var processingStatusType: String { + return internalGetProcessingStatusType() + } + + func internalGetProcessingStatusType(alias: String? = nil) -> String { + return field(field: "processingStatusType", aliasSuffix: alias) as! String + } + + /// The token of the receipt. + open var token: String { + return internalGetToken() + } + + func internalGetToken(alias: String? = nil) -> String { + return field(field: "token", aliasSuffix: alias) as! String + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + var response: [GraphQL.AbstractResponse] = [] + objectMap.keys.forEach { + switch($0) { + case "paymentRequest": + response.append(internalGetPaymentRequest()) + response.append(contentsOf: internalGetPaymentRequest().childResponseObjectMap()) + + default: + break + } + } + return response + } + } +} diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestSession.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestSession.swift new file mode 100644 index 00000000..1cb8dcce --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestSession.swift @@ -0,0 +1,153 @@ +// +// ShopPayPaymentRequestSession.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Represents a Shop Pay payment request session. + open class ShopPayPaymentRequestSessionQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ShopPayPaymentRequestSession + + /// The checkout URL of the Shop Pay payment request session. + @discardableResult + open func checkoutUrl(alias: String? = nil) -> ShopPayPaymentRequestSessionQuery { + addField(field: "checkoutUrl", aliasSuffix: alias) + return self + } + + /// The payment request associated with the Shop Pay payment request session. + @discardableResult + open func paymentRequest(alias: String? = nil, _ subfields: (ShopPayPaymentRequestQuery) -> Void) -> ShopPayPaymentRequestSessionQuery { + let subquery = ShopPayPaymentRequestQuery() + subfields(subquery) + + addField(field: "paymentRequest", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The source identifier of the Shop Pay payment request session. + @discardableResult + open func sourceIdentifier(alias: String? = nil) -> ShopPayPaymentRequestSessionQuery { + addField(field: "sourceIdentifier", aliasSuffix: alias) + return self + } + + /// The token of the Shop Pay payment request session. + @discardableResult + open func token(alias: String? = nil) -> ShopPayPaymentRequestSessionQuery { + addField(field: "token", aliasSuffix: alias) + return self + } + } + + /// Represents a Shop Pay payment request session. + open class ShopPayPaymentRequestSession: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = ShopPayPaymentRequestSessionQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "checkoutUrl": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestSession.self, field: fieldName, value: fieldValue) + } + return URL(string: value)! + + case "paymentRequest": + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequestSession.self, field: fieldName, value: fieldValue) + } + return try ShopPayPaymentRequest(fields: value) + + case "sourceIdentifier": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestSession.self, field: fieldName, value: fieldValue) + } + return value + + case "token": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestSession.self, field: fieldName, value: fieldValue) + } + return value + + default: + throw SchemaViolationError(type: ShopPayPaymentRequestSession.self, field: fieldName, value: fieldValue) + } + } + + /// The checkout URL of the Shop Pay payment request session. + open var checkoutUrl: URL { + return internalGetCheckoutUrl() + } + + func internalGetCheckoutUrl(alias: String? = nil) -> URL { + return field(field: "checkoutUrl", aliasSuffix: alias) as! URL + } + + /// The payment request associated with the Shop Pay payment request session. + open var paymentRequest: Storefront.ShopPayPaymentRequest { + return internalGetPaymentRequest() + } + + func internalGetPaymentRequest(alias: String? = nil) -> Storefront.ShopPayPaymentRequest { + return field(field: "paymentRequest", aliasSuffix: alias) as! Storefront.ShopPayPaymentRequest + } + + /// The source identifier of the Shop Pay payment request session. + open var sourceIdentifier: String { + return internalGetSourceIdentifier() + } + + func internalGetSourceIdentifier(alias: String? = nil) -> String { + return field(field: "sourceIdentifier", aliasSuffix: alias) as! String + } + + /// The token of the Shop Pay payment request session. + open var token: String { + return internalGetToken() + } + + func internalGetToken(alias: String? = nil) -> String { + return field(field: "token", aliasSuffix: alias) as! String + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + var response: [GraphQL.AbstractResponse] = [] + objectMap.keys.forEach { + switch($0) { + case "paymentRequest": + response.append(internalGetPaymentRequest()) + response.append(contentsOf: internalGetPaymentRequest().childResponseObjectMap()) + + default: + break + } + } + return response + } + } +} diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestSessionCreatePayload.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestSessionCreatePayload.swift new file mode 100644 index 00000000..7adc1c75 --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestSessionCreatePayload.swift @@ -0,0 +1,121 @@ +// +// ShopPayPaymentRequestSessionCreatePayload.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Return type for `shopPayPaymentRequestSessionCreate` mutation. + open class ShopPayPaymentRequestSessionCreatePayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ShopPayPaymentRequestSessionCreatePayload + + /// The new Shop Pay payment request session object. + @discardableResult + open func shopPayPaymentRequestSession(alias: String? = nil, _ subfields: (ShopPayPaymentRequestSessionQuery) -> Void) -> ShopPayPaymentRequestSessionCreatePayloadQuery { + let subquery = ShopPayPaymentRequestSessionQuery() + subfields(subquery) + + addField(field: "shopPayPaymentRequestSession", aliasSuffix: alias, subfields: subquery) + return self + } + + /// Error codes for failed Shop Pay payment request session mutations. + @discardableResult + open func userErrors(alias: String? = nil, _ subfields: (UserErrorsShopPayPaymentRequestSessionUserErrorsQuery) -> Void) -> ShopPayPaymentRequestSessionCreatePayloadQuery { + let subquery = UserErrorsShopPayPaymentRequestSessionUserErrorsQuery() + subfields(subquery) + + addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) + return self + } + } + + /// Return type for `shopPayPaymentRequestSessionCreate` mutation. + open class ShopPayPaymentRequestSessionCreatePayload: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = ShopPayPaymentRequestSessionCreatePayloadQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "shopPayPaymentRequestSession": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequestSessionCreatePayload.self, field: fieldName, value: fieldValue) + } + return try ShopPayPaymentRequestSession(fields: value) + + case "userErrors": + guard let value = value as? [[String: Any]] else { + throw SchemaViolationError(type: ShopPayPaymentRequestSessionCreatePayload.self, field: fieldName, value: fieldValue) + } + return try value.map { return try UserErrorsShopPayPaymentRequestSessionUserErrors(fields: $0) } + + default: + throw SchemaViolationError(type: ShopPayPaymentRequestSessionCreatePayload.self, field: fieldName, value: fieldValue) + } + } + + /// The new Shop Pay payment request session object. + open var shopPayPaymentRequestSession: Storefront.ShopPayPaymentRequestSession? { + return internalGetShopPayPaymentRequestSession() + } + + func internalGetShopPayPaymentRequestSession(alias: String? = nil) -> Storefront.ShopPayPaymentRequestSession? { + return field(field: "shopPayPaymentRequestSession", aliasSuffix: alias) as! Storefront.ShopPayPaymentRequestSession? + } + + /// Error codes for failed Shop Pay payment request session mutations. + open var userErrors: [Storefront.UserErrorsShopPayPaymentRequestSessionUserErrors] { + return internalGetUserErrors() + } + + func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserErrorsShopPayPaymentRequestSessionUserErrors] { + return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserErrorsShopPayPaymentRequestSessionUserErrors] + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + var response: [GraphQL.AbstractResponse] = [] + objectMap.keys.forEach { + switch($0) { + case "shopPayPaymentRequestSession": + if let value = internalGetShopPayPaymentRequestSession() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + + case "userErrors": + internalGetUserErrors().forEach { + response.append($0) + response.append(contentsOf: $0.childResponseObjectMap()) + } + + default: + break + } + } + return response + } + } +} diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestSessionSubmitPayload.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestSessionSubmitPayload.swift new file mode 100644 index 00000000..9200e16f --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestSessionSubmitPayload.swift @@ -0,0 +1,121 @@ +// +// ShopPayPaymentRequestSessionSubmitPayload.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Return type for `shopPayPaymentRequestSessionSubmit` mutation. + open class ShopPayPaymentRequestSessionSubmitPayloadQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ShopPayPaymentRequestSessionSubmitPayload + + /// The checkout on which the payment was applied. + @discardableResult + open func paymentRequestReceipt(alias: String? = nil, _ subfields: (ShopPayPaymentRequestReceiptQuery) -> Void) -> ShopPayPaymentRequestSessionSubmitPayloadQuery { + let subquery = ShopPayPaymentRequestReceiptQuery() + subfields(subquery) + + addField(field: "paymentRequestReceipt", aliasSuffix: alias, subfields: subquery) + return self + } + + /// Error codes for failed Shop Pay payment request session mutations. + @discardableResult + open func userErrors(alias: String? = nil, _ subfields: (UserErrorsShopPayPaymentRequestSessionUserErrorsQuery) -> Void) -> ShopPayPaymentRequestSessionSubmitPayloadQuery { + let subquery = UserErrorsShopPayPaymentRequestSessionUserErrorsQuery() + subfields(subquery) + + addField(field: "userErrors", aliasSuffix: alias, subfields: subquery) + return self + } + } + + /// Return type for `shopPayPaymentRequestSessionSubmit` mutation. + open class ShopPayPaymentRequestSessionSubmitPayload: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = ShopPayPaymentRequestSessionSubmitPayloadQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "paymentRequestReceipt": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequestSessionSubmitPayload.self, field: fieldName, value: fieldValue) + } + return try ShopPayPaymentRequestReceipt(fields: value) + + case "userErrors": + guard let value = value as? [[String: Any]] else { + throw SchemaViolationError(type: ShopPayPaymentRequestSessionSubmitPayload.self, field: fieldName, value: fieldValue) + } + return try value.map { return try UserErrorsShopPayPaymentRequestSessionUserErrors(fields: $0) } + + default: + throw SchemaViolationError(type: ShopPayPaymentRequestSessionSubmitPayload.self, field: fieldName, value: fieldValue) + } + } + + /// The checkout on which the payment was applied. + open var paymentRequestReceipt: Storefront.ShopPayPaymentRequestReceipt? { + return internalGetPaymentRequestReceipt() + } + + func internalGetPaymentRequestReceipt(alias: String? = nil) -> Storefront.ShopPayPaymentRequestReceipt? { + return field(field: "paymentRequestReceipt", aliasSuffix: alias) as! Storefront.ShopPayPaymentRequestReceipt? + } + + /// Error codes for failed Shop Pay payment request session mutations. + open var userErrors: [Storefront.UserErrorsShopPayPaymentRequestSessionUserErrors] { + return internalGetUserErrors() + } + + func internalGetUserErrors(alias: String? = nil) -> [Storefront.UserErrorsShopPayPaymentRequestSessionUserErrors] { + return field(field: "userErrors", aliasSuffix: alias) as! [Storefront.UserErrorsShopPayPaymentRequestSessionUserErrors] + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + var response: [GraphQL.AbstractResponse] = [] + objectMap.keys.forEach { + switch($0) { + case "paymentRequestReceipt": + if let value = internalGetPaymentRequestReceipt() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + + case "userErrors": + internalGetUserErrors().forEach { + response.append($0) + response.append(contentsOf: $0.childResponseObjectMap()) + } + + default: + break + } + } + return response + } + } +} diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestShippingLine.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestShippingLine.swift new file mode 100644 index 00000000..77c21c48 --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestShippingLine.swift @@ -0,0 +1,131 @@ +// +// ShopPayPaymentRequestShippingLine.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Represents a shipping line for a Shop Pay payment request. + open class ShopPayPaymentRequestShippingLineQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ShopPayPaymentRequestShippingLine + + /// The amount for the shipping line. + @discardableResult + open func amount(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> ShopPayPaymentRequestShippingLineQuery { + let subquery = MoneyV2Query() + subfields(subquery) + + addField(field: "amount", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The code of the shipping line. + @discardableResult + open func code(alias: String? = nil) -> ShopPayPaymentRequestShippingLineQuery { + addField(field: "code", aliasSuffix: alias) + return self + } + + /// The label of the shipping line. + @discardableResult + open func label(alias: String? = nil) -> ShopPayPaymentRequestShippingLineQuery { + addField(field: "label", aliasSuffix: alias) + return self + } + } + + /// Represents a shipping line for a Shop Pay payment request. + open class ShopPayPaymentRequestShippingLine: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = ShopPayPaymentRequestShippingLineQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "amount": + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequestShippingLine.self, field: fieldName, value: fieldValue) + } + return try MoneyV2(fields: value) + + case "code": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestShippingLine.self, field: fieldName, value: fieldValue) + } + return value + + case "label": + guard let value = value as? String else { + throw SchemaViolationError(type: ShopPayPaymentRequestShippingLine.self, field: fieldName, value: fieldValue) + } + return value + + default: + throw SchemaViolationError(type: ShopPayPaymentRequestShippingLine.self, field: fieldName, value: fieldValue) + } + } + + /// The amount for the shipping line. + open var amount: Storefront.MoneyV2 { + return internalGetAmount() + } + + func internalGetAmount(alias: String? = nil) -> Storefront.MoneyV2 { + return field(field: "amount", aliasSuffix: alias) as! Storefront.MoneyV2 + } + + /// The code of the shipping line. + open var code: String { + return internalGetCode() + } + + func internalGetCode(alias: String? = nil) -> String { + return field(field: "code", aliasSuffix: alias) as! String + } + + /// The label of the shipping line. + open var label: String { + return internalGetLabel() + } + + func internalGetLabel(alias: String? = nil) -> String { + return field(field: "label", aliasSuffix: alias) as! String + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + var response: [GraphQL.AbstractResponse] = [] + objectMap.keys.forEach { + switch($0) { + case "amount": + response.append(internalGetAmount()) + response.append(contentsOf: internalGetAmount().childResponseObjectMap()) + + default: + break + } + } + return response + } + } +} diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestShippingLineInput.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestShippingLineInput.swift new file mode 100644 index 00000000..27f8dca0 --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestShippingLineInput.swift @@ -0,0 +1,106 @@ +// +// ShopPayPaymentRequestShippingLineInput.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// The input fields to create a shipping line for a Shop Pay payment request. + open class ShopPayPaymentRequestShippingLineInput { + /// The code of the shipping line. + open var code: Input + + /// The label of the shipping line. + open var label: Input + + /// The amount for the shipping line. + open var amount: Input + + /// Creates the input object. + /// + /// - parameters: + /// - code: The code of the shipping line. + /// - label: The label of the shipping line. + /// - amount: The amount for the shipping line. + /// + public static func create(code: Input = .undefined, label: Input = .undefined, amount: Input = .undefined) -> ShopPayPaymentRequestShippingLineInput { + return ShopPayPaymentRequestShippingLineInput(code: code, label: label, amount: amount) + } + + private init(code: Input = .undefined, label: Input = .undefined, amount: Input = .undefined) { + self.code = code + self.label = label + self.amount = amount + } + + /// Creates the input object. + /// + /// - parameters: + /// - code: The code of the shipping line. + /// - label: The label of the shipping line. + /// - amount: The amount for the shipping line. + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(code: String? = nil, label: String? = nil, amount: MoneyInput? = nil) { + self.init(code: code.orUndefined, label: label.orUndefined, amount: amount.orUndefined) + } + + internal func serialize() -> String { + var fields: [String] = [] + + switch code { + case .value(let code): + guard let code = code else { + fields.append("code:null") + break + } + fields.append("code:\(GraphQL.quoteString(input: code))") + case .undefined: break + } + + switch label { + case .value(let label): + guard let label = label else { + fields.append("label:null") + break + } + fields.append("label:\(GraphQL.quoteString(input: label))") + case .undefined: break + } + + switch amount { + case .value(let amount): + guard let amount = amount else { + fields.append("amount:null") + break + } + fields.append("amount:\(amount.serialize())") + case .undefined: break + } + + return "{\(fields.joined(separator: ","))}" + } + } +} diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestTotalShippingPrice.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestTotalShippingPrice.swift new file mode 100644 index 00000000..c52f3fec --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestTotalShippingPrice.swift @@ -0,0 +1,150 @@ +// +// ShopPayPaymentRequestTotalShippingPrice.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Represents a shipping total for a Shop Pay payment request. + open class ShopPayPaymentRequestTotalShippingPriceQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = ShopPayPaymentRequestTotalShippingPrice + + /// The discounts for the shipping total. + @discardableResult + open func discounts(alias: String? = nil, _ subfields: (ShopPayPaymentRequestDiscountQuery) -> Void) -> ShopPayPaymentRequestTotalShippingPriceQuery { + let subquery = ShopPayPaymentRequestDiscountQuery() + subfields(subquery) + + addField(field: "discounts", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The final total for the shipping total. + @discardableResult + open func finalTotal(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> ShopPayPaymentRequestTotalShippingPriceQuery { + let subquery = MoneyV2Query() + subfields(subquery) + + addField(field: "finalTotal", aliasSuffix: alias, subfields: subquery) + return self + } + + /// The original total for the shipping total. + @discardableResult + open func originalTotal(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> ShopPayPaymentRequestTotalShippingPriceQuery { + let subquery = MoneyV2Query() + subfields(subquery) + + addField(field: "originalTotal", aliasSuffix: alias, subfields: subquery) + return self + } + } + + /// Represents a shipping total for a Shop Pay payment request. + open class ShopPayPaymentRequestTotalShippingPrice: GraphQL.AbstractResponse, GraphQLObject { + public typealias Query = ShopPayPaymentRequestTotalShippingPriceQuery + + internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { + let fieldValue = value + switch fieldName { + case "discounts": + guard let value = value as? [[String: Any]] else { + throw SchemaViolationError(type: ShopPayPaymentRequestTotalShippingPrice.self, field: fieldName, value: fieldValue) + } + return try value.map { return try ShopPayPaymentRequestDiscount(fields: $0) } + + case "finalTotal": + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequestTotalShippingPrice.self, field: fieldName, value: fieldValue) + } + return try MoneyV2(fields: value) + + case "originalTotal": + if value is NSNull { return nil } + guard let value = value as? [String: Any] else { + throw SchemaViolationError(type: ShopPayPaymentRequestTotalShippingPrice.self, field: fieldName, value: fieldValue) + } + return try MoneyV2(fields: value) + + default: + throw SchemaViolationError(type: ShopPayPaymentRequestTotalShippingPrice.self, field: fieldName, value: fieldValue) + } + } + + /// The discounts for the shipping total. + open var discounts: [Storefront.ShopPayPaymentRequestDiscount] { + return internalGetDiscounts() + } + + func internalGetDiscounts(alias: String? = nil) -> [Storefront.ShopPayPaymentRequestDiscount] { + return field(field: "discounts", aliasSuffix: alias) as! [Storefront.ShopPayPaymentRequestDiscount] + } + + /// The final total for the shipping total. + open var finalTotal: Storefront.MoneyV2 { + return internalGetFinalTotal() + } + + func internalGetFinalTotal(alias: String? = nil) -> Storefront.MoneyV2 { + return field(field: "finalTotal", aliasSuffix: alias) as! Storefront.MoneyV2 + } + + /// The original total for the shipping total. + open var originalTotal: Storefront.MoneyV2? { + return internalGetOriginalTotal() + } + + func internalGetOriginalTotal(alias: String? = nil) -> Storefront.MoneyV2? { + return field(field: "originalTotal", aliasSuffix: alias) as! Storefront.MoneyV2? + } + + internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { + var response: [GraphQL.AbstractResponse] = [] + objectMap.keys.forEach { + switch($0) { + case "discounts": + internalGetDiscounts().forEach { + response.append($0) + response.append(contentsOf: $0.childResponseObjectMap()) + } + + case "finalTotal": + response.append(internalGetFinalTotal()) + response.append(contentsOf: internalGetFinalTotal().childResponseObjectMap()) + + case "originalTotal": + if let value = internalGetOriginalTotal() { + response.append(value) + response.append(contentsOf: value.childResponseObjectMap()) + } + + default: + break + } + } + return response + } + } +} diff --git a/Buy/Generated/Storefront/ShopPayPaymentRequestTotalShippingPriceInput.swift b/Buy/Generated/Storefront/ShopPayPaymentRequestTotalShippingPriceInput.swift new file mode 100644 index 00000000..f8edd6b3 --- /dev/null +++ b/Buy/Generated/Storefront/ShopPayPaymentRequestTotalShippingPriceInput.swift @@ -0,0 +1,107 @@ +// +// ShopPayPaymentRequestTotalShippingPriceInput.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// The input fields to create a shipping total for a Shop Pay payment request. + open class ShopPayPaymentRequestTotalShippingPriceInput { + /// The discounts for the shipping total. The input must not contain more than + /// `250` values. + open var discounts: Input<[ShopPayPaymentRequestDiscountInput]> + + /// The original total for the shipping total. + open var originalTotal: Input + + /// The final total for the shipping total. + open var finalTotal: Input + + /// Creates the input object. + /// + /// - parameters: + /// - discounts: The discounts for the shipping total. The input must not contain more than `250` values. + /// - originalTotal: The original total for the shipping total. + /// - finalTotal: The final total for the shipping total. + /// + public static func create(discounts: Input<[ShopPayPaymentRequestDiscountInput]> = .undefined, originalTotal: Input = .undefined, finalTotal: Input = .undefined) -> ShopPayPaymentRequestTotalShippingPriceInput { + return ShopPayPaymentRequestTotalShippingPriceInput(discounts: discounts, originalTotal: originalTotal, finalTotal: finalTotal) + } + + private init(discounts: Input<[ShopPayPaymentRequestDiscountInput]> = .undefined, originalTotal: Input = .undefined, finalTotal: Input = .undefined) { + self.discounts = discounts + self.originalTotal = originalTotal + self.finalTotal = finalTotal + } + + /// Creates the input object. + /// + /// - parameters: + /// - discounts: The discounts for the shipping total. The input must not contain more than `250` values. + /// - originalTotal: The original total for the shipping total. + /// - finalTotal: The final total for the shipping total. + /// + @available(*, deprecated, message: "Use the static create() method instead.") + public convenience init(discounts: [ShopPayPaymentRequestDiscountInput]? = nil, originalTotal: MoneyInput? = nil, finalTotal: MoneyInput? = nil) { + self.init(discounts: discounts.orUndefined, originalTotal: originalTotal.orUndefined, finalTotal: finalTotal.orUndefined) + } + + internal func serialize() -> String { + var fields: [String] = [] + + switch discounts { + case .value(let discounts): + guard let discounts = discounts else { + fields.append("discounts:null") + break + } + fields.append("discounts:[\(discounts.map{ "\($0.serialize())" }.joined(separator: ","))]") + case .undefined: break + } + + switch originalTotal { + case .value(let originalTotal): + guard let originalTotal = originalTotal else { + fields.append("originalTotal:null") + break + } + fields.append("originalTotal:\(originalTotal.serialize())") + case .undefined: break + } + + switch finalTotal { + case .value(let finalTotal): + guard let finalTotal = finalTotal else { + fields.append("finalTotal:null") + break + } + fields.append("finalTotal:\(finalTotal.serialize())") + case .undefined: break + } + + return "{\(fields.joined(separator: ","))}" + } + } +} diff --git a/Buy/Generated/Storefront/TokenizedPaymentInputV3.swift b/Buy/Generated/Storefront/TokenizedPaymentInputV3.swift deleted file mode 100644 index 70223324..00000000 --- a/Buy/Generated/Storefront/TokenizedPaymentInputV3.swift +++ /dev/null @@ -1,136 +0,0 @@ -// -// TokenizedPaymentInputV3.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// Specifies the fields required to complete a checkout with a tokenized - /// payment. - open class TokenizedPaymentInputV3 { - /// The amount and currency of the payment. - open var paymentAmount: MoneyInput - - /// A unique client generated key used to avoid duplicate charges. When a - /// duplicate payment is found, the original is returned instead of creating a - /// new one. For more information, refer to [Idempotent - /// requests](https://shopify.dev/api/usage/idempotent-requests). - open var idempotencyKey: String - - /// The billing address for the payment. - open var billingAddress: MailingAddressInput - - /// A simple string or JSON containing the required payment data for the - /// tokenized payment. - open var paymentData: String - - /// Whether to execute the payment in test mode, if possible. Test mode isn't - /// supported in production stores. Defaults to `false`. - open var test: Input - - /// Public Hash Key used for AndroidPay payments only. - open var identifier: Input - - /// The type of payment token. - open var type: PaymentTokenType - - /// Creates the input object. - /// - /// - parameters: - /// - paymentAmount: The amount and currency of the payment. - /// - idempotencyKey: A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/api/usage/idempotent-requests). - /// - billingAddress: The billing address for the payment. - /// - paymentData: A simple string or JSON containing the required payment data for the tokenized payment. - /// - test: Whether to execute the payment in test mode, if possible. Test mode isn't supported in production stores. Defaults to `false`. - /// - identifier: Public Hash Key used for AndroidPay payments only. - /// - type: The type of payment token. - /// - public static func create(paymentAmount: MoneyInput, idempotencyKey: String, billingAddress: MailingAddressInput, paymentData: String, type: PaymentTokenType, test: Input = .undefined, identifier: Input = .undefined) -> TokenizedPaymentInputV3 { - return TokenizedPaymentInputV3(paymentAmount: paymentAmount, idempotencyKey: idempotencyKey, billingAddress: billingAddress, paymentData: paymentData, type: type, test: test, identifier: identifier) - } - - private init(paymentAmount: MoneyInput, idempotencyKey: String, billingAddress: MailingAddressInput, paymentData: String, type: PaymentTokenType, test: Input = .undefined, identifier: Input = .undefined) { - self.paymentAmount = paymentAmount - self.idempotencyKey = idempotencyKey - self.billingAddress = billingAddress - self.paymentData = paymentData - self.test = test - self.identifier = identifier - self.type = type - } - - /// Creates the input object. - /// - /// - parameters: - /// - paymentAmount: The amount and currency of the payment. - /// - idempotencyKey: A unique client generated key used to avoid duplicate charges. When a duplicate payment is found, the original is returned instead of creating a new one. For more information, refer to [Idempotent requests](https://shopify.dev/api/usage/idempotent-requests). - /// - billingAddress: The billing address for the payment. - /// - paymentData: A simple string or JSON containing the required payment data for the tokenized payment. - /// - test: Whether to execute the payment in test mode, if possible. Test mode isn't supported in production stores. Defaults to `false`. - /// - identifier: Public Hash Key used for AndroidPay payments only. - /// - type: The type of payment token. - /// - @available(*, deprecated, message: "Use the static create() method instead.") - public convenience init(paymentAmount: MoneyInput, idempotencyKey: String, billingAddress: MailingAddressInput, paymentData: String, type: PaymentTokenType, test: Bool? = nil, identifier: String? = nil) { - self.init(paymentAmount: paymentAmount, idempotencyKey: idempotencyKey, billingAddress: billingAddress, paymentData: paymentData, type: type, test: test.orUndefined, identifier: identifier.orUndefined) - } - - internal func serialize() -> String { - var fields: [String] = [] - - fields.append("paymentAmount:\(paymentAmount.serialize())") - - fields.append("idempotencyKey:\(GraphQL.quoteString(input: idempotencyKey))") - - fields.append("billingAddress:\(billingAddress.serialize())") - - fields.append("paymentData:\(GraphQL.quoteString(input: paymentData))") - - switch test { - case .value(let test): - guard let test = test else { - fields.append("test:null") - break - } - fields.append("test:\(test)") - case .undefined: break - } - - switch identifier { - case .value(let identifier): - guard let identifier = identifier else { - fields.append("identifier:null") - break - } - fields.append("identifier:\(GraphQL.quoteString(input: identifier))") - case .undefined: break - } - - fields.append("type:\(type.rawValue)") - - return "{\(fields.joined(separator: ","))}" - } - } -} diff --git a/Buy/Generated/Storefront/Transaction.swift b/Buy/Generated/Storefront/Transaction.swift deleted file mode 100644 index f103c874..00000000 --- a/Buy/Generated/Storefront/Transaction.swift +++ /dev/null @@ -1,209 +0,0 @@ -// -// Transaction.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -extension Storefront { - /// An object representing exchange of money for a product or service. - open class TransactionQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = Transaction - - /// The amount of money that the transaction was for. - @discardableResult - open func amount(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> TransactionQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "amount", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The amount of money that the transaction was for. - @available(*, deprecated, message:"Use `amount` instead.") - @discardableResult - open func amountV2(alias: String? = nil, _ subfields: (MoneyV2Query) -> Void) -> TransactionQuery { - let subquery = MoneyV2Query() - subfields(subquery) - - addField(field: "amountV2", aliasSuffix: alias, subfields: subquery) - return self - } - - /// The kind of the transaction. - @discardableResult - open func kind(alias: String? = nil) -> TransactionQuery { - addField(field: "kind", aliasSuffix: alias) - return self - } - - /// The status of the transaction. - @available(*, deprecated, message:"Use `statusV2` instead.") - @discardableResult - open func status(alias: String? = nil) -> TransactionQuery { - addField(field: "status", aliasSuffix: alias) - return self - } - - /// The status of the transaction. - @discardableResult - open func statusV2(alias: String? = nil) -> TransactionQuery { - addField(field: "statusV2", aliasSuffix: alias) - return self - } - - /// Whether the transaction was done in test mode or not. - @discardableResult - open func test(alias: String? = nil) -> TransactionQuery { - addField(field: "test", aliasSuffix: alias) - return self - } - } - - /// An object representing exchange of money for a product or service. - open class Transaction: GraphQL.AbstractResponse, GraphQLObject { - public typealias Query = TransactionQuery - - internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { - let fieldValue = value - switch fieldName { - case "amount": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Transaction.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "amountV2": - guard let value = value as? [String: Any] else { - throw SchemaViolationError(type: Transaction.self, field: fieldName, value: fieldValue) - } - return try MoneyV2(fields: value) - - case "kind": - guard let value = value as? String else { - throw SchemaViolationError(type: Transaction.self, field: fieldName, value: fieldValue) - } - return TransactionKind(rawValue: value) ?? .unknownValue - - case "status": - guard let value = value as? String else { - throw SchemaViolationError(type: Transaction.self, field: fieldName, value: fieldValue) - } - return TransactionStatus(rawValue: value) ?? .unknownValue - - case "statusV2": - if value is NSNull { return nil } - guard let value = value as? String else { - throw SchemaViolationError(type: Transaction.self, field: fieldName, value: fieldValue) - } - return TransactionStatus(rawValue: value) ?? .unknownValue - - case "test": - guard let value = value as? Bool else { - throw SchemaViolationError(type: Transaction.self, field: fieldName, value: fieldValue) - } - return value - - default: - throw SchemaViolationError(type: Transaction.self, field: fieldName, value: fieldValue) - } - } - - /// The amount of money that the transaction was for. - open var amount: Storefront.MoneyV2 { - return internalGetAmount() - } - - func internalGetAmount(alias: String? = nil) -> Storefront.MoneyV2 { - return field(field: "amount", aliasSuffix: alias) as! Storefront.MoneyV2 - } - - /// The amount of money that the transaction was for. - @available(*, deprecated, message:"Use `amount` instead.") - open var amountV2: Storefront.MoneyV2 { - return internalGetAmountV2() - } - - func internalGetAmountV2(alias: String? = nil) -> Storefront.MoneyV2 { - return field(field: "amountV2", aliasSuffix: alias) as! Storefront.MoneyV2 - } - - /// The kind of the transaction. - open var kind: Storefront.TransactionKind { - return internalGetKind() - } - - func internalGetKind(alias: String? = nil) -> Storefront.TransactionKind { - return field(field: "kind", aliasSuffix: alias) as! Storefront.TransactionKind - } - - /// The status of the transaction. - @available(*, deprecated, message:"Use `statusV2` instead.") - open var status: Storefront.TransactionStatus { - return internalGetStatus() - } - - func internalGetStatus(alias: String? = nil) -> Storefront.TransactionStatus { - return field(field: "status", aliasSuffix: alias) as! Storefront.TransactionStatus - } - - /// The status of the transaction. - open var statusV2: Storefront.TransactionStatus? { - return internalGetStatusV2() - } - - func internalGetStatusV2(alias: String? = nil) -> Storefront.TransactionStatus? { - return field(field: "statusV2", aliasSuffix: alias) as! Storefront.TransactionStatus? - } - - /// Whether the transaction was done in test mode or not. - open var test: Bool { - return internalGetTest() - } - - func internalGetTest(alias: String? = nil) -> Bool { - return field(field: "test", aliasSuffix: alias) as! Bool - } - - internal override func childResponseObjectMap() -> [GraphQL.AbstractResponse] { - var response: [GraphQL.AbstractResponse] = [] - objectMap.keys.forEach { - switch($0) { - case "amount": - response.append(internalGetAmount()) - response.append(contentsOf: internalGetAmount().childResponseObjectMap()) - - case "amountV2": - response.append(internalGetAmountV2()) - response.append(contentsOf: internalGetAmountV2().childResponseObjectMap()) - - default: - break - } - } - return response - } - } -} diff --git a/Buy/Generated/Storefront/CheckoutUserError.swift b/Buy/Generated/Storefront/UserErrorsShopPayPaymentRequestSessionUserErrors.swift similarity index 61% rename from Buy/Generated/Storefront/CheckoutUserError.swift rename to Buy/Generated/Storefront/UserErrorsShopPayPaymentRequestSessionUserErrors.swift index 704589d9..7bc05feb 100644 --- a/Buy/Generated/Storefront/CheckoutUserError.swift +++ b/Buy/Generated/Storefront/UserErrorsShopPayPaymentRequestSessionUserErrors.swift @@ -1,5 +1,5 @@ // -// CheckoutUserError.swift +// UserErrorsShopPayPaymentRequestSessionUserErrors.swift // Buy // // Created by Shopify. @@ -27,35 +27,35 @@ import Foundation extension Storefront { - /// Represents an error that happens during execution of a checkout mutation. - open class CheckoutUserErrorQuery: GraphQL.AbstractQuery, GraphQLQuery { - public typealias Response = CheckoutUserError + /// Represents an error that happens during execution of a customer mutation. + open class UserErrorsShopPayPaymentRequestSessionUserErrorsQuery: GraphQL.AbstractQuery, GraphQLQuery { + public typealias Response = UserErrorsShopPayPaymentRequestSessionUserErrors /// The error code. @discardableResult - open func code(alias: String? = nil) -> CheckoutUserErrorQuery { + open func code(alias: String? = nil) -> UserErrorsShopPayPaymentRequestSessionUserErrorsQuery { addField(field: "code", aliasSuffix: alias) return self } /// The path to the input field that caused the error. @discardableResult - open func field(alias: String? = nil) -> CheckoutUserErrorQuery { + open func field(alias: String? = nil) -> UserErrorsShopPayPaymentRequestSessionUserErrorsQuery { addField(field: "field", aliasSuffix: alias) return self } /// The error message. @discardableResult - open func message(alias: String? = nil) -> CheckoutUserErrorQuery { + open func message(alias: String? = nil) -> UserErrorsShopPayPaymentRequestSessionUserErrorsQuery { addField(field: "message", aliasSuffix: alias) return self } } - /// Represents an error that happens during execution of a checkout mutation. - open class CheckoutUserError: GraphQL.AbstractResponse, GraphQLObject, DisplayableError { - public typealias Query = CheckoutUserErrorQuery + /// Represents an error that happens during execution of a customer mutation. + open class UserErrorsShopPayPaymentRequestSessionUserErrors: GraphQL.AbstractResponse, GraphQLObject, DisplayableError { + public typealias Query = UserErrorsShopPayPaymentRequestSessionUserErrorsQuery internal override func deserializeValue(fieldName: String, value: Any) throws -> Any? { let fieldValue = value @@ -63,35 +63,35 @@ extension Storefront { case "code": if value is NSNull { return nil } guard let value = value as? String else { - throw SchemaViolationError(type: CheckoutUserError.self, field: fieldName, value: fieldValue) + throw SchemaViolationError(type: UserErrorsShopPayPaymentRequestSessionUserErrors.self, field: fieldName, value: fieldValue) } - return CheckoutErrorCode(rawValue: value) ?? .unknownValue + return UserErrorsShopPayPaymentRequestSessionUserErrorsCode(rawValue: value) ?? .unknownValue case "field": if value is NSNull { return nil } guard let value = value as? [String] else { - throw SchemaViolationError(type: CheckoutUserError.self, field: fieldName, value: fieldValue) + throw SchemaViolationError(type: UserErrorsShopPayPaymentRequestSessionUserErrors.self, field: fieldName, value: fieldValue) } return value.map { return $0 } case "message": guard let value = value as? String else { - throw SchemaViolationError(type: CheckoutUserError.self, field: fieldName, value: fieldValue) + throw SchemaViolationError(type: UserErrorsShopPayPaymentRequestSessionUserErrors.self, field: fieldName, value: fieldValue) } return value default: - throw SchemaViolationError(type: CheckoutUserError.self, field: fieldName, value: fieldValue) + throw SchemaViolationError(type: UserErrorsShopPayPaymentRequestSessionUserErrors.self, field: fieldName, value: fieldValue) } } /// The error code. - open var code: Storefront.CheckoutErrorCode? { + open var code: Storefront.UserErrorsShopPayPaymentRequestSessionUserErrorsCode? { return internalGetCode() } - func internalGetCode(alias: String? = nil) -> Storefront.CheckoutErrorCode? { - return field(field: "code", aliasSuffix: alias) as! Storefront.CheckoutErrorCode? + func internalGetCode(alias: String? = nil) -> Storefront.UserErrorsShopPayPaymentRequestSessionUserErrorsCode? { + return field(field: "code", aliasSuffix: alias) as! Storefront.UserErrorsShopPayPaymentRequestSessionUserErrorsCode? } /// The path to the input field that caused the error. diff --git a/Buy/Generated/Storefront/UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift b/Buy/Generated/Storefront/UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift new file mode 100644 index 00000000..bc8c622a --- /dev/null +++ b/Buy/Generated/Storefront/UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift @@ -0,0 +1,44 @@ +// +// UserErrorsShopPayPaymentRequestSessionUserErrorsCode.swift +// Buy +// +// Created by Shopify. +// Copyright (c) 2017 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 Foundation + +extension Storefront { + /// Possible error codes that can be returned by + /// `ShopPayPaymentRequestSessionUserErrors`. + public enum UserErrorsShopPayPaymentRequestSessionUserErrorsCode: String { + /// Idempotency key has already been used. + case idempotencyKeyAlreadyUsed = "IDEMPOTENCY_KEY_ALREADY_USED" + + /// Payment request input is invalid. + case paymentRequestInvalidInput = "PAYMENT_REQUEST_INVALID_INPUT" + + /// Payment request not found. + case paymentRequestNotFound = "PAYMENT_REQUEST_NOT_FOUND" + + case unknownValue = "" + } +} diff --git a/Buy/Info.plist b/Buy/Info.plist index 93b5c7b2..0e3cb91e 100644 --- a/Buy/Info.plist +++ b/Buy/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 12.0.0 + 12.1.0 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/Buy/Utilities/SDK.swift b/Buy/Utilities/SDK.swift index c30cf58e..70759f35 100644 --- a/Buy/Utilities/SDK.swift +++ b/Buy/Utilities/SDK.swift @@ -27,5 +27,5 @@ import Foundation internal enum SDK { - static let version = "12.0.0" + static let version = "12.1.0" } diff --git a/BuyTests/Info.plist b/BuyTests/Info.plist index 83e5f15b..2c4e8817 100644 --- a/BuyTests/Info.plist +++ b/BuyTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 12.0.0 + 12.1.0 CFBundleVersion 1 diff --git a/Mobile-Buy-SDK.podspec b/Mobile-Buy-SDK.podspec index 2fab1d54..2075c229 100644 --- a/Mobile-Buy-SDK.podspec +++ b/Mobile-Buy-SDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'Mobile-Buy-SDK' - s.version = '12.0.0' + s.version = '12.1.0' s.summary = 'Create custom Shopify storefront on iOS.' s.description = 'Shopify’s Mobile Buy SDK makes it simple to create custom storefronts in your mobile app. Utitlizing the power and flexibility of GraphQL you can build native storefront experiences using the Shopify platform.' s.homepage = 'https://github.com/Shopify/mobile-buy-sdk-ios' diff --git a/Pay/Info.plist b/Pay/Info.plist index 93b5c7b2..0e3cb91e 100644 --- a/Pay/Info.plist +++ b/Pay/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 12.0.0 + 12.1.0 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/PayTests/Info.plist b/PayTests/Info.plist index 83e5f15b..2c4e8817 100644 --- a/PayTests/Info.plist +++ b/PayTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 12.0.0 + 12.1.0 CFBundleVersion 1 From 425191380c6fbbdcd9964c06ff738187c3437280 Mon Sep 17 00:00:00 2001 From: Jonathan Baker Date: Thu, 11 Jul 2024 18:17:30 -0400 Subject: [PATCH 2/8] Update Graph.ClientTests.swift --- BuyTests/Client/Graph.ClientTests.swift | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/BuyTests/Client/Graph.ClientTests.swift b/BuyTests/Client/Graph.ClientTests.swift index 6d889d0f..95b76f1e 100644 --- a/BuyTests/Client/Graph.ClientTests.swift +++ b/BuyTests/Client/Graph.ClientTests.swift @@ -153,19 +153,19 @@ class Graph_ClientTests: XCTestCase { private func defaultMutationPayload() -> (mutation: Storefront.MutationQuery, response: [String: Any]) { let mutation = Storefront.buildMutation { $0 - .checkoutEmailUpdateV2(checkoutId: GraphQL.ID(rawValue: "123"), email: "john.smith@gmail.com") { $0 - .checkoutUserErrors { $0 - .code() - .message() - .field() - } - } + .cartCreate() { $0 + .userErrors { $0 + .code() + .message() + .field() + } + } } let response = [ "data": [ - "checkoutEmailUpdateV2": [ - "checkoutUserErrors": [] + "cartCreate": [ + "userErrors": [] ] ] ] From ec06b2631a9132a4be10ee88a253c062ffe3b2b1 Mon Sep 17 00:00:00 2001 From: Jonathan Baker Date: Thu, 11 Jul 2024 18:26:15 -0400 Subject: [PATCH 3/8] Remove `Pay` library target. --- .github/workflows/test.yml | 3 - .../xcode/xcshareddata/xcschemes/Buy.xcscheme | 77 --- .../xcschemes/Mobile Buy SDK-Package.xcscheme | 129 ---- .../xcode/xcshareddata/xcschemes/Pay.xcscheme | 77 --- Buy.xcodeproj/project.pbxproj | 376 ----------- .../xcshareddata/xcschemes/Pay.xcscheme | 96 --- .../xcshareddata/xcschemes/PayTests.xcscheme | 87 --- Mobile-Buy-SDK.podspec | 3 - Package.swift | 16 - Pay/Info.plist | 24 - Pay/PassKit+PayCardBrand.swift | 63 -- Pay/PassKit+SummaryItems.swift | 55 -- Pay/Pay.h | 37 -- Pay/PayAddress.swift | 228 ------- Pay/PayAuthorization.swift | 56 -- Pay/PayCardBrand.swift | 36 -- Pay/PayCheckout.swift | 155 ----- Pay/PayCurrency.swift | 46 -- Pay/PayDiscount.swift | 46 -- Pay/PayGiftCard.swift | 54 -- Pay/PayLineItem.swift | 52 -- Pay/PaySession.swift | 375 ----------- Pay/PayShippingRate.swift | 147 ----- Pay/Utilities/Log.swift | 33 - PayTests/Info.plist | 22 - .../Mocks/MockAuthorizationController.swift | 117 ---- PayTests/Mocks/MockPaySession.swift | 80 --- PayTests/Mocks/MockPayment.swift | 66 -- PayTests/Mocks/MockPaymentMethod.swift | 60 -- PayTests/Mocks/MockPaymentToken.swift | 58 -- PayTests/Mocks/MockSessionDelegate.swift | 74 --- PayTests/Models/Models.swift | 195 ------ PayTests/PassKit+SummaryItemTests.swift | 47 -- PayTests/PayAddressTests.swift | 205 ------ PayTests/PayAuthorizationTests.swift | 56 -- PayTests/PayCardBrandTests.swift | 73 --- PayTests/PayCheckoutTests.swift | 254 -------- PayTests/PayCurrencyTests.swift | 41 -- PayTests/PayDiscountTests.swift | 41 -- PayTests/PayLineItemTests.swift | 55 -- PayTests/PaySessionTests.swift | 594 ------------------ PayTests/PayShippingRateTests.swift | 135 ---- Scripts/test_pay | 11 - 43 files changed, 4455 deletions(-) delete mode 100644 .swiftpm/xcode/xcshareddata/xcschemes/Buy.xcscheme delete mode 100644 .swiftpm/xcode/xcshareddata/xcschemes/Mobile Buy SDK-Package.xcscheme delete mode 100644 .swiftpm/xcode/xcshareddata/xcschemes/Pay.xcscheme delete mode 100644 Buy.xcodeproj/xcshareddata/xcschemes/Pay.xcscheme delete mode 100644 Buy.xcodeproj/xcshareddata/xcschemes/PayTests.xcscheme delete mode 100644 Pay/Info.plist delete mode 100644 Pay/PassKit+PayCardBrand.swift delete mode 100644 Pay/PassKit+SummaryItems.swift delete mode 100644 Pay/Pay.h delete mode 100644 Pay/PayAddress.swift delete mode 100644 Pay/PayAuthorization.swift delete mode 100644 Pay/PayCardBrand.swift delete mode 100644 Pay/PayCheckout.swift delete mode 100644 Pay/PayCurrency.swift delete mode 100644 Pay/PayDiscount.swift delete mode 100644 Pay/PayGiftCard.swift delete mode 100644 Pay/PayLineItem.swift delete mode 100644 Pay/PaySession.swift delete mode 100644 Pay/PayShippingRate.swift delete mode 100644 Pay/Utilities/Log.swift delete mode 100644 PayTests/Info.plist delete mode 100644 PayTests/Mocks/MockAuthorizationController.swift delete mode 100644 PayTests/Mocks/MockPaySession.swift delete mode 100644 PayTests/Mocks/MockPayment.swift delete mode 100644 PayTests/Mocks/MockPaymentMethod.swift delete mode 100644 PayTests/Mocks/MockPaymentToken.swift delete mode 100644 PayTests/Mocks/MockSessionDelegate.swift delete mode 100644 PayTests/Models/Models.swift delete mode 100644 PayTests/PassKit+SummaryItemTests.swift delete mode 100644 PayTests/PayAddressTests.swift delete mode 100644 PayTests/PayAuthorizationTests.swift delete mode 100644 PayTests/PayCardBrandTests.swift delete mode 100644 PayTests/PayCheckoutTests.swift delete mode 100644 PayTests/PayCurrencyTests.swift delete mode 100644 PayTests/PayDiscountTests.swift delete mode 100644 PayTests/PayLineItemTests.swift delete mode 100644 PayTests/PaySessionTests.swift delete mode 100644 PayTests/PayShippingRateTests.swift delete mode 100755 Scripts/test_pay diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3ee2a7d7..69132580 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,8 +37,5 @@ jobs: - name: Test Buy Watch run: ./Scripts/test_buy_watch - - name: Test Pay - run: ./Scripts/test_pay - - name: Test Swift Package run: swift test 2>&1 | xcpretty diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/Buy.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/Buy.xcscheme deleted file mode 100644 index 392afd2e..00000000 --- a/.swiftpm/xcode/xcshareddata/xcschemes/Buy.xcscheme +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/Mobile Buy SDK-Package.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/Mobile Buy SDK-Package.xcscheme deleted file mode 100644 index 6e0d9cd1..00000000 --- a/.swiftpm/xcode/xcshareddata/xcschemes/Mobile Buy SDK-Package.xcscheme +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.swiftpm/xcode/xcshareddata/xcschemes/Pay.xcscheme b/.swiftpm/xcode/xcshareddata/xcschemes/Pay.xcscheme deleted file mode 100644 index 74f939a8..00000000 --- a/.swiftpm/xcode/xcshareddata/xcschemes/Pay.xcscheme +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Buy.xcodeproj/project.pbxproj b/Buy.xcodeproj/project.pbxproj index 461a2f8d..0420566f 100644 --- a/Buy.xcodeproj/project.pbxproj +++ b/Buy.xcodeproj/project.pbxproj @@ -720,15 +720,6 @@ 81F02041243391F100826BEC /* Storefront.Schema.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81F02040243391F000826BEC /* Storefront.Schema.swift */; }; 81F02042243391F100826BEC /* Storefront.Schema.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81F02040243391F000826BEC /* Storefront.Schema.swift */; }; 81F02043243391F100826BEC /* Storefront.Schema.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81F02040243391F000826BEC /* Storefront.Schema.swift */; }; - 9A0C7FCD1EA6631B0020F187 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FCC1EA6631B0020F187 /* Models.swift */; }; - 9A0C7FD11EA669C80020F187 /* PayDiscount.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FD01EA669C80020F187 /* PayDiscount.swift */; }; - 9A0C7FD31EA66DF70020F187 /* PayDiscountTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FD21EA66DF70020F187 /* PayDiscountTests.swift */; }; - 9A0C7FD51EA682640020F187 /* PayLineItemTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FD41EA682640020F187 /* PayLineItemTests.swift */; }; - 9A0C7FD71EA686240020F187 /* PayCurrencyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FD61EA686240020F187 /* PayCurrencyTests.swift */; }; - 9A0C7FD91EA686A20020F187 /* PayAddressTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FD81EA686A20020F187 /* PayAddressTests.swift */; }; - 9A0C7FDD1EA699280020F187 /* PayShippingRateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FDC1EA699280020F187 /* PayShippingRateTests.swift */; }; - 9A0C7FE31EA7981C0020F187 /* PayAuthorizationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FE21EA7981C0020F187 /* PayAuthorizationTests.swift */; }; - 9A0C7FE51EA79EA70020F187 /* PassKit+SummaryItemTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FE41EA79EA70020F187 /* PassKit+SummaryItemTests.swift */; }; 9A0C7FEB1EAA3F7E0020F187 /* MockSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA89E8A1E9BDC590075AC74 /* MockSession.swift */; }; 9A0C7FEC1EAA3F7E0020F187 /* MockSessionDataTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA89E8C1E9BDC650075AC74 /* MockSessionDataTask.swift */; }; 9A0C7FED1EAA3F7E0020F187 /* GraphQL+ScalarSupportTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA6B6D61E9D563C00CE9F18 /* GraphQL+ScalarSupportTests.swift */; }; @@ -832,20 +823,9 @@ 9A371464251A2AEC00FE742B /* SHA256.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A371463251A2AEC00FE742B /* SHA256.swift */; }; 9A371465251A2AEC00FE742B /* SHA256.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A371463251A2AEC00FE742B /* SHA256.swift */; }; 9A371466251A2AEC00FE742B /* SHA256.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A371463251A2AEC00FE742B /* SHA256.swift */; }; - 9A3714AF251A808800FE742B /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A3714AE251A806D00FE742B /* Log.swift */; }; 9A3D4CD5251B9EF200B702E0 /* SDK.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D4CD4251B9EF200B702E0 /* SDK.swift */; }; 9A3D4CD6251B9EF200B702E0 /* SDK.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D4CD4251B9EF200B702E0 /* SDK.swift */; }; 9A3D4CD7251B9EF200B702E0 /* SDK.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D4CD4251B9EF200B702E0 /* SDK.swift */; }; - 9A4068E51E8E7659000254CD /* Pay.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A4068DC1E8E7658000254CD /* Pay.framework */; }; - 9A4068EA1E8E7659000254CD /* PaySessionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4068E91E8E7659000254CD /* PaySessionTests.swift */; }; - 9A4068EC1E8E7659000254CD /* Pay.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A4068DE1E8E7659000254CD /* Pay.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 9A4068F91E8E767B000254CD /* PayAddress.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4068F31E8E767B000254CD /* PayAddress.swift */; }; - 9A4068FA1E8E767B000254CD /* PayCheckout.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4068F41E8E767B000254CD /* PayCheckout.swift */; }; - 9A4068FB1E8E767B000254CD /* PaySession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4068F51E8E767B000254CD /* PaySession.swift */; }; - 9A4068FC1E8E767B000254CD /* PayCurrency.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4068F61E8E767B000254CD /* PayCurrency.swift */; }; - 9A4068FD1E8E767B000254CD /* PayLineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4068F71E8E767B000254CD /* PayLineItem.swift */; }; - 9A4068FE1E8E767B000254CD /* PayShippingRate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4068F81E8E767B000254CD /* PayShippingRate.swift */; }; - 9A40690A1E8E82E2000254CD /* PassKit+SummaryItems.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4069091E8E82E2000254CD /* PassKit+SummaryItems.swift */; }; 9A4069CA1E8EA6DB000254CD /* Graph.RetryHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4069C91E8EA6DB000254CD /* Graph.RetryHandler.swift */; }; 9A4069CC1E8EA710000254CD /* Graph.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4069CB1E8EA710000254CD /* Graph.swift */; }; 9A4069CF1E8ED98A000254CD /* Graph.Task.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A4069CE1E8ED98A000254CD /* Graph.Task.swift */; }; @@ -856,7 +836,6 @@ 9A52D3A21F3CA58E00C093C8 /* ProductImageSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3A01F3CA58E00C093C8 /* ProductImageSortKeys.swift */; }; 9A52D3A31F3CA58E00C093C8 /* CardBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3A11F3CA58E00C093C8 /* CardBrand.swift */; }; 9A52D3A51F3CA5DB00C093C8 /* DigitalWallet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3A41F3CA5DB00C093C8 /* DigitalWallet.swift */; }; - 9A52D3B21F3CE99900C093C8 /* PayCardBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A52D3B11F3CE99900C093C8 /* PayCardBrand.swift */; }; 9A67113B2166678500A57A3F /* MoneyInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A6711312166678300A57A3F /* MoneyInput.swift */; }; 9A67113C2166678500A57A3F /* MoneyInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A6711312166678300A57A3F /* MoneyInput.swift */; }; 9A67113D2166678500A57A3F /* MoneyInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A6711312166678300A57A3F /* MoneyInput.swift */; }; @@ -906,8 +885,6 @@ 9A9EA44220AF0EBB002CB926 /* ProductPriceRange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A9EA43B20AF0EBB002CB926 /* ProductPriceRange.swift */; }; 9A9EA44320AF0EBB002CB926 /* ProductPriceRange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A9EA43B20AF0EBB002CB926 /* ProductPriceRange.swift */; }; 9A9EA44420AF0EBB002CB926 /* ProductPriceRange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A9EA43B20AF0EBB002CB926 /* ProductPriceRange.swift */; }; - 9AA01A5F1F3DEBF6007F5380 /* PassKit+PayCardBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA01A5E1F3DEBF6007F5380 /* PassKit+PayCardBrand.swift */; }; - 9AA01A621F3E2035007F5380 /* PayCardBrandTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA01A611F3E2035007F5380 /* PayCardBrandTests.swift */; }; 9AA416C71EE095AA0060029B /* Article.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C21EE095AA0060029B /* Article.swift */; }; 9AA416C81EE095AA0060029B /* ArticleAuthor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C31EE095AA0060029B /* ArticleAuthor.swift */; }; 9AA416C91EE095AA0060029B /* ArticleConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C41EE095AA0060029B /* ArticleConnection.swift */; }; @@ -935,13 +912,8 @@ 9AA9A4032279E7AF0002DFDA /* HasMetafields.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA9A4022279E7AF0002DFDA /* HasMetafields.swift */; }; 9AA9A4042279E7AF0002DFDA /* HasMetafields.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA9A4022279E7AF0002DFDA /* HasMetafields.swift */; }; 9AA9A4052279E7AF0002DFDA /* HasMetafields.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA9A4022279E7AF0002DFDA /* HasMetafields.swift */; }; - 9AADF1C71EA63ED000D22740 /* MockPaymentMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AADF1C61EA63ED000D22740 /* MockPaymentMethod.swift */; }; - 9AADF1C91EA63FB900D22740 /* MockPaymentToken.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AADF1C81EA63FB900D22740 /* MockPaymentToken.swift */; }; - 9AADF1CB1EA640C000D22740 /* MockPayment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AADF1CA1EA640C000D22740 /* MockPayment.swift */; }; - 9AADF1CD1EA6618800D22740 /* PayCheckoutTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AADF1CC1EA6618800D22740 /* PayCheckoutTests.swift */; }; 9AAFAB721E60766E00864A17 /* Global.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AAFAB711E60766E00864A17 /* Global.swift */; }; 9AAFAB771E6080A500864A17 /* Graph.QueryError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AAFAB761E6080A500864A17 /* Graph.QueryError.swift */; }; - 9AB421B11E93CA45005098C4 /* PayAuthorization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AB421B01E93CA45005098C4 /* PayAuthorization.swift */; }; 9ABC3E221F02DDC0004CF078 /* SHA256Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A664D7F1EF159F8001BFB01 /* SHA256Tests.swift */; }; 9ABEB3A92122FF7700A373F2 /* Fulfillment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABEB3A42122FF7500A373F2 /* Fulfillment.swift */; }; 9ABEB3AA2122FF7700A373F2 /* Fulfillment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABEB3A42122FF7500A373F2 /* Fulfillment.swift */; }; @@ -964,7 +936,6 @@ 9ABEB3BD2122FF8000A373F2 /* CustomerErrorCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABEB3B92122FF7F00A373F2 /* CustomerErrorCode.swift */; }; 9ABEB3BE2122FF8000A373F2 /* CustomerErrorCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABEB3B92122FF7F00A373F2 /* CustomerErrorCode.swift */; }; 9ABEB3BF2122FF8000A373F2 /* CustomerErrorCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABEB3B92122FF7F00A373F2 /* CustomerErrorCode.swift */; }; - 9ABEB3D42123598800A373F2 /* PayGiftCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ABEB3D32123598800A373F2 /* PayGiftCard.swift */; }; 9AC2EF391F6818180037E0D7 /* Attribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C7FFA1EAA51C50020F187 /* Attribute.swift */; }; 9AC2EF3A1F6818180037E0D7 /* OrderLineItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803E1EAA51C50020F187 /* OrderLineItem.swift */; }; 9AC2EF3B1F6818180037E0D7 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AE2A1C51EC9EE1D00921247 /* Log.swift */; }; @@ -1072,8 +1043,6 @@ 9AE1F8161F605F8F00147E77 /* ProductVariantSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AE1F8151F605F8F00147E77 /* ProductVariantSortKeys.swift */; }; 9AE2A1C21EC6373B00921247 /* Graph.CachePolicyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AE2A1C11EC6373B00921247 /* Graph.CachePolicyTests.swift */; }; 9AE2A1C61EC9EE1D00921247 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AE2A1C51EC9EE1D00921247 /* Log.swift */; }; - 9AEC90E21E9FFA7F008C6E1C /* MockSessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AEC90E11E9FFA7F008C6E1C /* MockSessionDelegate.swift */; }; - 9AEC90E41E9FFAA6008C6E1C /* MockAuthorizationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AEC90E31E9FFAA6008C6E1C /* MockAuthorizationController.swift */; }; 9AEF60F81E5F42D90067FA90 /* Buy.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AEF60F61E5F42D90067FA90 /* Buy.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9AEF61A11E5F5A190067FA90 /* GraphQL+ScalarSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AEF61A01E5F5A190067FA90 /* GraphQL+ScalarSupport.swift */; }; 9AEF61B91E5F64230067FA90 /* Graph.Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AEF61B81E5F64230067FA90 /* Graph.Client.swift */; }; @@ -1183,7 +1152,6 @@ 9AF256441F6FEFCD005BB0C9 /* Optional+Input.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AC2EFD61F686DB90037E0D7 /* Optional+Input.swift */; }; 9AF256451F6FEFCD005BB0C9 /* Optional+Input.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AC2EFD61F686DB90037E0D7 /* Optional+Input.swift */; }; 9AFA38EF1E64850A0056C5AA /* Buy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9AEF60F31E5F42D90067FA90 /* Buy.framework */; }; - 9AFEF46E1F72DB64003FA8C5 /* MockPaySession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AFEF46D1F72DB64003FA8C5 /* MockPaySession.swift */; }; B3B5A030223FF6C3008ECA02 /* SEO.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3B5A02F223FF6C3008ECA02 /* SEO.swift */; }; B3B5A031223FF6C3008ECA02 /* SEO.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3B5A02F223FF6C3008ECA02 /* SEO.swift */; }; B3B5A032223FF6C3008ECA02 /* SEO.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3B5A02F223FF6C3008ECA02 /* SEO.swift */; }; @@ -1196,13 +1164,6 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 9A4068E61E8E7659000254CD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9AEF60EA1E5F42D90067FA90 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9A4068DB1E8E7658000254CD; - remoteInfo = Pay; - }; 9AFA38F01E64850A0056C5AA /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 9AEF60EA1E5F42D90067FA90 /* Project object */; @@ -1446,15 +1407,6 @@ 8128551023C4AC7E00ADA66E /* MediaImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaImage.swift; sourceTree = ""; }; 8128551123C4AC7E00ADA66E /* UnitPriceMeasurementMeasuredType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UnitPriceMeasurementMeasuredType.swift; sourceTree = ""; }; 81F02040243391F000826BEC /* Storefront.Schema.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Storefront.Schema.swift; path = Buy/Generated/Storefront.Schema.swift; sourceTree = SOURCE_ROOT; }; - 9A0C7FCC1EA6631B0020F187 /* Models.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; - 9A0C7FD01EA669C80020F187 /* PayDiscount.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PayDiscount.swift; sourceTree = ""; }; - 9A0C7FD21EA66DF70020F187 /* PayDiscountTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PayDiscountTests.swift; sourceTree = ""; }; - 9A0C7FD41EA682640020F187 /* PayLineItemTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PayLineItemTests.swift; sourceTree = ""; }; - 9A0C7FD61EA686240020F187 /* PayCurrencyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PayCurrencyTests.swift; sourceTree = ""; }; - 9A0C7FD81EA686A20020F187 /* PayAddressTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PayAddressTests.swift; sourceTree = ""; }; - 9A0C7FDC1EA699280020F187 /* PayShippingRateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PayShippingRateTests.swift; sourceTree = ""; }; - 9A0C7FE21EA7981C0020F187 /* PayAuthorizationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PayAuthorizationTests.swift; sourceTree = ""; }; - 9A0C7FE41EA79EA70020F187 /* PassKit+SummaryItemTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "PassKit+SummaryItemTests.swift"; sourceTree = ""; }; 9A0C7FF91EAA51C50020F187 /* AppliedGiftCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppliedGiftCard.swift; sourceTree = ""; }; 9A0C7FFA1EAA51C50020F187 /* Attribute.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Attribute.swift; sourceTree = ""; }; 9A0C7FFB1EAA51C50020F187 /* AttributeInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AttributeInput.swift; sourceTree = ""; }; @@ -1536,21 +1488,7 @@ 9A371409251A21B200FE742B /* GraphQL.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GraphQL.swift; sourceTree = ""; }; 9A371422251A24CF00FE742B /* Package.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; 9A371463251A2AEC00FE742B /* SHA256.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SHA256.swift; sourceTree = ""; }; - 9A3714AE251A806D00FE742B /* Log.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = ""; }; 9A3D4CD4251B9EF200B702E0 /* SDK.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SDK.swift; sourceTree = ""; }; - 9A4068DC1E8E7658000254CD /* Pay.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pay.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 9A4068DE1E8E7659000254CD /* Pay.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Pay.h; sourceTree = ""; }; - 9A4068DF1E8E7659000254CD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 9A4068E41E8E7659000254CD /* PayTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PayTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 9A4068E91E8E7659000254CD /* PaySessionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PaySessionTests.swift; sourceTree = ""; }; - 9A4068EB1E8E7659000254CD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 9A4068F31E8E767B000254CD /* PayAddress.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PayAddress.swift; sourceTree = ""; }; - 9A4068F41E8E767B000254CD /* PayCheckout.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PayCheckout.swift; sourceTree = ""; }; - 9A4068F51E8E767B000254CD /* PaySession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PaySession.swift; sourceTree = ""; }; - 9A4068F61E8E767B000254CD /* PayCurrency.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PayCurrency.swift; sourceTree = ""; }; - 9A4068F71E8E767B000254CD /* PayLineItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PayLineItem.swift; sourceTree = ""; }; - 9A4068F81E8E767B000254CD /* PayShippingRate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PayShippingRate.swift; sourceTree = ""; }; - 9A4069091E8E82E2000254CD /* PassKit+SummaryItems.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "PassKit+SummaryItems.swift"; sourceTree = ""; }; 9A4069C91E8EA6DB000254CD /* Graph.RetryHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Graph.RetryHandler.swift; sourceTree = ""; }; 9A4069CB1E8EA710000254CD /* Graph.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Graph.swift; sourceTree = ""; }; 9A4069CE1E8ED98A000254CD /* Graph.Task.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Graph.Task.swift; sourceTree = ""; }; @@ -1559,7 +1497,6 @@ 9A52D3A01F3CA58E00C093C8 /* ProductImageSortKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductImageSortKeys.swift; sourceTree = ""; }; 9A52D3A11F3CA58E00C093C8 /* CardBrand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardBrand.swift; sourceTree = ""; }; 9A52D3A41F3CA5DB00C093C8 /* DigitalWallet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DigitalWallet.swift; sourceTree = ""; }; - 9A52D3B11F3CE99900C093C8 /* PayCardBrand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PayCardBrand.swift; sourceTree = ""; }; 9A664D7F1EF159F8001BFB01 /* SHA256Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SHA256Tests.swift; sourceTree = ""; }; 9A6711312166678300A57A3F /* MoneyInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoneyInput.swift; sourceTree = ""; }; 9A67114921666AAE00A57A3F /* ScriptDiscountApplication.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScriptDiscountApplication.swift; sourceTree = ""; }; @@ -1578,8 +1515,6 @@ 9A9EA43920AF0EBA002CB926 /* DisplayableError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DisplayableError.swift; sourceTree = ""; }; 9A9EA43A20AF0EBA002CB926 /* MoneyV2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MoneyV2.swift; sourceTree = ""; }; 9A9EA43B20AF0EBB002CB926 /* ProductPriceRange.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProductPriceRange.swift; sourceTree = ""; }; - 9AA01A5E1F3DEBF6007F5380 /* PassKit+PayCardBrand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PassKit+PayCardBrand.swift"; sourceTree = ""; }; - 9AA01A611F3E2035007F5380 /* PayCardBrandTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PayCardBrandTests.swift; sourceTree = ""; }; 9AA416C21EE095AA0060029B /* Article.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Article.swift; sourceTree = ""; }; 9AA416C31EE095AA0060029B /* ArticleAuthor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArticleAuthor.swift; sourceTree = ""; }; 9AA416C41EE095AA0060029B /* ArticleConnection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ArticleConnection.swift; sourceTree = ""; }; @@ -1606,13 +1541,8 @@ 9AA9A3EE2279E7990002DFDA /* MetafieldParentResource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MetafieldParentResource.swift; sourceTree = ""; }; 9AA9A3EF2279E79A0002DFDA /* Metafield.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Metafield.swift; sourceTree = ""; }; 9AA9A4022279E7AF0002DFDA /* HasMetafields.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HasMetafields.swift; sourceTree = ""; }; - 9AADF1C61EA63ED000D22740 /* MockPaymentMethod.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockPaymentMethod.swift; sourceTree = ""; }; - 9AADF1C81EA63FB900D22740 /* MockPaymentToken.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockPaymentToken.swift; sourceTree = ""; }; - 9AADF1CA1EA640C000D22740 /* MockPayment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockPayment.swift; sourceTree = ""; }; - 9AADF1CC1EA6618800D22740 /* PayCheckoutTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PayCheckoutTests.swift; sourceTree = ""; }; 9AAFAB711E60766E00864A17 /* Global.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Global.swift; sourceTree = ""; }; 9AAFAB761E6080A500864A17 /* Graph.QueryError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Graph.QueryError.swift; sourceTree = ""; }; - 9AB421B01E93CA45005098C4 /* PayAuthorization.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PayAuthorization.swift; sourceTree = ""; }; 9ABEB3A42122FF7500A373F2 /* Fulfillment.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Fulfillment.swift; sourceTree = ""; }; 9ABEB3A52122FF7600A373F2 /* FulfillmentLineItemConnection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FulfillmentLineItemConnection.swift; sourceTree = ""; }; 9ABEB3A62122FF7600A373F2 /* FulfillmentLineItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FulfillmentLineItem.swift; sourceTree = ""; }; @@ -1620,15 +1550,12 @@ 9ABEB3A82122FF7700A373F2 /* FulfillmentLineItemEdge.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FulfillmentLineItemEdge.swift; sourceTree = ""; }; 9ABEB3B82122FF7F00A373F2 /* CustomerUserError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomerUserError.swift; sourceTree = ""; }; 9ABEB3B92122FF7F00A373F2 /* CustomerErrorCode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomerErrorCode.swift; sourceTree = ""; }; - 9ABEB3D32123598800A373F2 /* PayGiftCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PayGiftCard.swift; sourceTree = ""; }; 9AC2EFC81F6818180037E0D7 /* Buy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Buy.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9AC2EFD61F686DB90037E0D7 /* Optional+Input.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Optional+Input.swift"; sourceTree = ""; }; 9AD5776B2153E350006BD1C5 /* CustomerResetByUrlPayload.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomerResetByUrlPayload.swift; sourceTree = ""; }; 9AE1F8151F605F8F00147E77 /* ProductVariantSortKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductVariantSortKeys.swift; sourceTree = ""; }; 9AE2A1C11EC6373B00921247 /* Graph.CachePolicyTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Graph.CachePolicyTests.swift; sourceTree = ""; }; 9AE2A1C51EC9EE1D00921247 /* Log.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = ""; }; - 9AEC90E11E9FFA7F008C6E1C /* MockSessionDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockSessionDelegate.swift; sourceTree = ""; }; - 9AEC90E31E9FFAA6008C6E1C /* MockAuthorizationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockAuthorizationController.swift; sourceTree = ""; }; 9AEF60F31E5F42D90067FA90 /* Buy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Buy.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9AEF60F61E5F42D90067FA90 /* Buy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Buy.h; sourceTree = ""; }; 9AEF60F71E5F42D90067FA90 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -1640,28 +1567,12 @@ 9AF256421F6FEE50005BB0C9 /* Buy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Buy.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9AFA38EA1E64850A0056C5AA /* BuyTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BuyTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 9AFA38EE1E64850A0056C5AA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 9AFEF46D1F72DB64003FA8C5 /* MockPaySession.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockPaySession.swift; sourceTree = ""; }; B3B5A02F223FF6C3008ECA02 /* SEO.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SEO.swift; sourceTree = ""; }; BFACC99B261CB85B00E7C8AA /* MediaHost.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaHost.swift; sourceTree = ""; }; FB7707D722CD488E00ED289E /* ApiVersion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApiVersion.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 9A4068D81E8E7658000254CD /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 9A4068E11E8E7659000254CD /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9A4068E51E8E7659000254CD /* Pay.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 9AC2EFC01F6818180037E0D7 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -2069,56 +1980,6 @@ path = Support; sourceTree = ""; }; - 9A3714AD251A806700FE742B /* Utilities */ = { - isa = PBXGroup; - children = ( - 9A3714AE251A806D00FE742B /* Log.swift */, - ); - path = Utilities; - sourceTree = ""; - }; - 9A4068DD1E8E7659000254CD /* Pay */ = { - isa = PBXGroup; - children = ( - 9A4068DF1E8E7659000254CD /* Info.plist */, - 9AA01A5E1F3DEBF6007F5380 /* PassKit+PayCardBrand.swift */, - 9A4069091E8E82E2000254CD /* PassKit+SummaryItems.swift */, - 9A4068DE1E8E7659000254CD /* Pay.h */, - 9A4068F31E8E767B000254CD /* PayAddress.swift */, - 9AB421B01E93CA45005098C4 /* PayAuthorization.swift */, - 9A52D3B11F3CE99900C093C8 /* PayCardBrand.swift */, - 9A4068F41E8E767B000254CD /* PayCheckout.swift */, - 9A4068F61E8E767B000254CD /* PayCurrency.swift */, - 9A0C7FD01EA669C80020F187 /* PayDiscount.swift */, - 9ABEB3D32123598800A373F2 /* PayGiftCard.swift */, - 9A4068F71E8E767B000254CD /* PayLineItem.swift */, - 9A4068F51E8E767B000254CD /* PaySession.swift */, - 9A4068F81E8E767B000254CD /* PayShippingRate.swift */, - 9A3714AD251A806700FE742B /* Utilities */, - ); - path = Pay; - sourceTree = ""; - }; - 9A4068E81E8E7659000254CD /* PayTests */ = { - isa = PBXGroup; - children = ( - 9A4068EB1E8E7659000254CD /* Info.plist */, - 9A4666121EF191B600A41625 /* Mocks */, - 9A4666111EF191B300A41625 /* Models */, - 9A0C7FE41EA79EA70020F187 /* PassKit+SummaryItemTests.swift */, - 9A0C7FD81EA686A20020F187 /* PayAddressTests.swift */, - 9A0C7FE21EA7981C0020F187 /* PayAuthorizationTests.swift */, - 9AA01A611F3E2035007F5380 /* PayCardBrandTests.swift */, - 9AADF1CC1EA6618800D22740 /* PayCheckoutTests.swift */, - 9A0C7FD61EA686240020F187 /* PayCurrencyTests.swift */, - 9A0C7FD21EA66DF70020F187 /* PayDiscountTests.swift */, - 9A0C7FD41EA682640020F187 /* PayLineItemTests.swift */, - 9A4068E91E8E7659000254CD /* PaySessionTests.swift */, - 9A0C7FDC1EA699280020F187 /* PayShippingRateTests.swift */, - ); - path = PayTests; - sourceTree = ""; - }; 9A46660D1EF1914000A41625 /* Client */ = { isa = PBXGroup; children = ( @@ -2159,27 +2020,6 @@ path = Mocks; sourceTree = ""; }; - 9A4666111EF191B300A41625 /* Models */ = { - isa = PBXGroup; - children = ( - 9A0C7FCC1EA6631B0020F187 /* Models.swift */, - ); - path = Models; - sourceTree = ""; - }; - 9A4666121EF191B600A41625 /* Mocks */ = { - isa = PBXGroup; - children = ( - 9AEC90E31E9FFAA6008C6E1C /* MockAuthorizationController.swift */, - 9AADF1CA1EA640C000D22740 /* MockPayment.swift */, - 9AADF1C61EA63ED000D22740 /* MockPaymentMethod.swift */, - 9AADF1C81EA63FB900D22740 /* MockPaymentToken.swift */, - 9AFEF46D1F72DB64003FA8C5 /* MockPaySession.swift */, - 9AEC90E11E9FFA7F008C6E1C /* MockSessionDelegate.swift */, - ); - path = Mocks; - sourceTree = ""; - }; 9A7497491EF059F600D3F673 /* Utilities */ = { isa = PBXGroup; children = ( @@ -2239,8 +2079,6 @@ 9AEF60F51E5F42D90067FA90 /* Buy */, 9AFA38EB1E64850A0056C5AA /* BuyTests */, 9A371422251A24CF00FE742B /* Package.swift */, - 9A4068DD1E8E7659000254CD /* Pay */, - 9A4068E81E8E7659000254CD /* PayTests */, 9AEF60F41E5F42D90067FA90 /* Products */, ); sourceTree = ""; @@ -2252,8 +2090,6 @@ 9AC2EFC81F6818180037E0D7 /* Buy.framework */, 9AF256421F6FEE50005BB0C9 /* Buy.framework */, 9AFA38EA1E64850A0056C5AA /* BuyTests.xctest */, - 9A4068DC1E8E7658000254CD /* Pay.framework */, - 9A4068E41E8E7659000254CD /* PayTests.xctest */, ); name = Products; sourceTree = ""; @@ -2310,14 +2146,6 @@ /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ - 9A4068D91E8E7658000254CD /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 9A4068EC1E8E7659000254CD /* Pay.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 9AC2EFC11F6818180037E0D7 /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -2345,42 +2173,6 @@ /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ - 9A4068DB1E8E7658000254CD /* Pay */ = { - isa = PBXNativeTarget; - buildConfigurationList = 9A4068F11E8E7659000254CD /* Build configuration list for PBXNativeTarget "Pay" */; - buildPhases = ( - 9A4068D71E8E7658000254CD /* Sources */, - 9A4068D81E8E7658000254CD /* Frameworks */, - 9A4068D91E8E7658000254CD /* Headers */, - 9A4068DA1E8E7658000254CD /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Pay; - productName = Pay; - productReference = 9A4068DC1E8E7658000254CD /* Pay.framework */; - productType = "com.apple.product-type.framework"; - }; - 9A4068E31E8E7659000254CD /* PayTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 9A4068F21E8E7659000254CD /* Build configuration list for PBXNativeTarget "PayTests" */; - buildPhases = ( - 9A4068E01E8E7659000254CD /* Sources */, - 9A4068E11E8E7659000254CD /* Frameworks */, - 9A4068E21E8E7659000254CD /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 9A4068E71E8E7659000254CD /* PBXTargetDependency */, - ); - name = PayTests; - productName = PayTests; - productReference = 9A4068E41E8E7659000254CD /* PayTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; 9AC2EF371F6818180037E0D7 /* Buy watchOS */ = { isa = PBXNativeTarget; buildConfigurationList = 9AC2EFC51F6818180037E0D7 /* Build configuration list for PBXNativeTarget "Buy watchOS" */; @@ -2468,15 +2260,6 @@ DevelopmentTeam = A7XGC83MZE; ProvisioningStyle = Automatic; }; - 9A4068DB1E8E7658000254CD = { - CreatedOnToolsVersion = 8.3; - LastSwiftMigration = 1020; - ProvisioningStyle = Automatic; - }; - 9A4068E31E8E7659000254CD = { - CreatedOnToolsVersion = 8.3; - ProvisioningStyle = Automatic; - }; 9AC2EF371F6818180037E0D7 = { ProvisioningStyle = Automatic; }; @@ -2513,27 +2296,11 @@ 9AC2EF371F6818180037E0D7 /* Buy watchOS */, 9AFA38E91E64850A0056C5AA /* BuyTests */, 9A0C80C51EAE73840020F187 /* Documentation */, - 9A4068DB1E8E7658000254CD /* Pay */, - 9A4068E31E8E7659000254CD /* PayTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 9A4068DA1E8E7658000254CD /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 9A4068E21E8E7659000254CD /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 9AC2EFC41F6818180037E0D7 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -2585,50 +2352,6 @@ /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 9A4068D71E8E7658000254CD /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 9A3714AF251A808800FE742B /* Log.swift in Sources */, - 9AA01A5F1F3DEBF6007F5380 /* PassKit+PayCardBrand.swift in Sources */, - 9A40690A1E8E82E2000254CD /* PassKit+SummaryItems.swift in Sources */, - 9A4068F91E8E767B000254CD /* PayAddress.swift in Sources */, - 9AB421B11E93CA45005098C4 /* PayAuthorization.swift in Sources */, - 9A52D3B21F3CE99900C093C8 /* PayCardBrand.swift in Sources */, - 9A4068FA1E8E767B000254CD /* PayCheckout.swift in Sources */, - 9A4068FC1E8E767B000254CD /* PayCurrency.swift in Sources */, - 9A0C7FD11EA669C80020F187 /* PayDiscount.swift in Sources */, - 9ABEB3D42123598800A373F2 /* PayGiftCard.swift in Sources */, - 9A4068FD1E8E767B000254CD /* PayLineItem.swift in Sources */, - 9A4068FB1E8E767B000254CD /* PaySession.swift in Sources */, - 9A4068FE1E8E767B000254CD /* PayShippingRate.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 9A4068E01E8E7659000254CD /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 9AEC90E41E9FFAA6008C6E1C /* MockAuthorizationController.swift in Sources */, - 9AADF1CB1EA640C000D22740 /* MockPayment.swift in Sources */, - 9AADF1C71EA63ED000D22740 /* MockPaymentMethod.swift in Sources */, - 9AADF1C91EA63FB900D22740 /* MockPaymentToken.swift in Sources */, - 9AFEF46E1F72DB64003FA8C5 /* MockPaySession.swift in Sources */, - 9AEC90E21E9FFA7F008C6E1C /* MockSessionDelegate.swift in Sources */, - 9A0C7FCD1EA6631B0020F187 /* Models.swift in Sources */, - 9A0C7FE51EA79EA70020F187 /* PassKit+SummaryItemTests.swift in Sources */, - 9A0C7FD91EA686A20020F187 /* PayAddressTests.swift in Sources */, - 9A0C7FE31EA7981C0020F187 /* PayAuthorizationTests.swift in Sources */, - 9AA01A621F3E2035007F5380 /* PayCardBrandTests.swift in Sources */, - 9AADF1CD1EA6618800D22740 /* PayCheckoutTests.swift in Sources */, - 9A0C7FD71EA686240020F187 /* PayCurrencyTests.swift in Sources */, - 9A0C7FD31EA66DF70020F187 /* PayDiscountTests.swift in Sources */, - 9A0C7FD51EA682640020F187 /* PayLineItemTests.swift in Sources */, - 9A4068EA1E8E7659000254CD /* PaySessionTests.swift in Sources */, - 9A0C7FDD1EA699280020F187 /* PayShippingRateTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 9AC2EF381F6818180037E0D7 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -3796,11 +3519,6 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 9A4068E71E8E7659000254CD /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 9A4068DB1E8E7658000254CD /* Pay */; - targetProxy = 9A4068E61E8E7659000254CD /* PBXContainerItemProxy */; - }; 9AFA38F11E64850A0056C5AA /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 9AEF60F21E5F42D90067FA90 /* Buy */; @@ -3825,82 +3543,6 @@ }; name = Release; }; - 9A4068ED1E8E7659000254CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = ""; - DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Pay/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 6.0.0; - OTHER_SWIFT_FLAGS = ""; - PRODUCT_BUNDLE_IDENTIFIER = com.shopify.Pay; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - 9A4068EE1E8E7659000254CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_IDENTITY = ""; - DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = Pay/Info.plist; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 6.0.0; - PRODUCT_BUNDLE_IDENTIFIER = com.shopify.Pay; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; - 9A4068EF1E8E7659000254CD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = PayTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.shopify.PayTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - 9A4068F01E8E7659000254CD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - DEVELOPMENT_TEAM = ""; - INFOPLIST_FILE = PayTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.shopify.PayTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; 9AC2EFC61F6818180037E0D7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -4209,24 +3851,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 9A4068F11E8E7659000254CD /* Build configuration list for PBXNativeTarget "Pay" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 9A4068ED1E8E7659000254CD /* Debug */, - 9A4068EE1E8E7659000254CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 9A4068F21E8E7659000254CD /* Build configuration list for PBXNativeTarget "PayTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 9A4068EF1E8E7659000254CD /* Debug */, - 9A4068F01E8E7659000254CD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 9AC2EFC51F6818180037E0D7 /* Build configuration list for PBXNativeTarget "Buy watchOS" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Buy.xcodeproj/xcshareddata/xcschemes/Pay.xcscheme b/Buy.xcodeproj/xcshareddata/xcschemes/Pay.xcscheme deleted file mode 100644 index b026664f..00000000 --- a/Buy.xcodeproj/xcshareddata/xcschemes/Pay.xcscheme +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Buy.xcodeproj/xcshareddata/xcschemes/PayTests.xcscheme b/Buy.xcodeproj/xcshareddata/xcschemes/PayTests.xcscheme deleted file mode 100644 index d51b26af..00000000 --- a/Buy.xcodeproj/xcshareddata/xcschemes/PayTests.xcscheme +++ /dev/null @@ -1,87 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Mobile-Buy-SDK.podspec b/Mobile-Buy-SDK.podspec index 2075c229..040de31a 100644 --- a/Mobile-Buy-SDK.podspec +++ b/Mobile-Buy-SDK.podspec @@ -27,8 +27,5 @@ Pod::Spec.new do |s| s.swift_version = '5.0' s.source_files = 'Buy/**/*.{swift}' - s.exclude_files = 'Pay/Utilities/Log.swift' - s.ios.source_files = 'Pay/**/*.{swift}' - s.watchos.source_files = 'Pay/**/*.{swift}' end diff --git a/Package.swift b/Package.swift index 8dc57a28..46d61f64 100644 --- a/Package.swift +++ b/Package.swift @@ -16,10 +16,6 @@ let package = Package( name: "Buy", targets: ["Buy"] ), - .library( - name: "Pay", - targets: ["Pay"] - ), ], dependencies: [], targets: [ @@ -29,23 +25,11 @@ let package = Package( path: "Buy", exclude: ["Info.plist"] ), - .target( - name: "Pay", - dependencies: [], - path: "Pay", - exclude: ["Info.plist"] - ), .testTarget( name: "BuyTests", dependencies: ["Buy"], path: "BuyTests", exclude: ["Info.plist"] ), - .testTarget( - name: "PayTests", - dependencies: ["Pay"], - path: "PayTests", - exclude: ["Info.plist"] - ), ] ) diff --git a/Pay/Info.plist b/Pay/Info.plist deleted file mode 100644 index 0e3cb91e..00000000 --- a/Pay/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 12.1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - diff --git a/Pay/PassKit+PayCardBrand.swift b/Pay/PassKit+PayCardBrand.swift deleted file mode 100644 index 20eea6da..00000000 --- a/Pay/PassKit+PayCardBrand.swift +++ /dev/null @@ -1,63 +0,0 @@ -// -// PassKit+PayCardBrand.swift -// Pay -// -// Created by Shopify. -// Copyright (c) 2017 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. -// - -#if canImport(PassKit) - -import PassKit - -extension PayCardBrand { - - var paymentNetwork: PKPaymentNetwork? { - switch self { - case .visa: return .visa - case .masterCard: return .masterCard - case .discover: return .discover - case .americanExpress: return .amex - case .jcb: - - if #available(iOS 10.1, *) { - return .JCB - } else { - Log("WARNING: Attempting to convert PayCardBrand.jcb to PKPaymentNetwork on iOS 10.0 or lower. PKPaymentNetwork.JCB requires iOS 10.1 or higher.") - return nil - } - - default: - return nil - } - } -} - -extension Array where Element == PayCardBrand { - - var paymentNetworks: [PKPaymentNetwork] { - return self.compactMap { - $0.paymentNetwork - } - } -} - -#endif diff --git a/Pay/PassKit+SummaryItems.swift b/Pay/PassKit+SummaryItems.swift deleted file mode 100644 index 320e9b1a..00000000 --- a/Pay/PassKit+SummaryItems.swift +++ /dev/null @@ -1,55 +0,0 @@ -// -// PassKit+SummaryItems.swift -// Pay -// -// Created by Shopify. -// Copyright (c) 2017 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. -// - -#if canImport(PassKit) - -import PassKit - -// ---------------------------------- -// MARK: - Decimal - -// -internal extension Decimal { - - var negative: Decimal { - return self * -1.0 - } - - func summaryItemNamed(_ name: String) -> PKPaymentSummaryItem { - return PKPaymentSummaryItem(label: name, amount: self) - } -} - -// ---------------------------------- -// MARK: - PKPaymentSummaryItem - -// -internal extension PKPaymentSummaryItem { - - convenience init(label: String, amount: Decimal) { - self.init(label: label, amount: amount as NSDecimalNumber) - } -} - -#endif diff --git a/Pay/Pay.h b/Pay/Pay.h deleted file mode 100644 index c649d782..00000000 --- a/Pay/Pay.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// Pay.h -// Pay -// -// Created by Shopify. -// Copyright (c) 2017 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 - -//! Project version number for Pay. -FOUNDATION_EXPORT double PayVersionNumber; - -//! Project version string for Pay. -FOUNDATION_EXPORT const unsigned char PayVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - - diff --git a/Pay/PayAddress.swift b/Pay/PayAddress.swift deleted file mode 100644 index 89df53e7..00000000 --- a/Pay/PayAddress.swift +++ /dev/null @@ -1,228 +0,0 @@ -// -// PayAddress.swift -// Pay -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -/// Represents a partial address without street information. -/// -public struct PayPostalAddress { - - /// City (eg: "Toronto") - public let city: String? - - /// Country (eg: "Canada") - public let country: String? - - /// ISO country code (eg: "ca") - public let countryCode: String? - - /// Province (eg: "ON" or "Ontario") - public let province: String? - - /// Zip or postal code (eg: "M5V 2J4") - public let zip: String? - - /// True if the zip or postal code has been padded. For example, - /// if the value passed in was "M5V", this property will return - /// `true` and `zip` will be "M5V 0Z0" - public let isPadded: Bool - - /// The original, non-padded zip code that was used to create the address - internal let originalZip: String? - - // ---------------------------------- - // MARK: - Init - - // - public init(city: String? = nil, - country: String? = nil, - countryCode: String? = nil, - province: String? = nil, - zip: String? = nil) { - - self.city = city - self.country = country - self.countryCode = countryCode - self.province = province - self.originalZip = zip - - /* ----------------------------------- - ** If we're dealing with postal codes - ** in Canada or United Kingdom, we are - ** likely dealing with a partial code. - ** We'll have to pad it to make it - ** compatible with Shopify. - */ - let countryCode = self.countryCode?.lowercased() ?? "" - if let zip = zip { - - let trimmedZip = zip.trimmingCharacters(in: .whitespacesAndNewlines) - if trimmedZip.count < 4 { - let (zip, isPadded) = PayPostalAddress.paddedPostalCode(trimmedZip, for: countryCode) - self.zip = zip - self.isPadded = isPadded - } else { - self.zip = trimmedZip - self.isPadded = false - } - - } else { - self.zip = nil - self.isPadded = false - } - } - - // ---------------------------------- - // MARK: - Postal Code - - // - private static func paddedPostalCode(_ postalCode: String, for countryCode: String) -> (postalCode: String, isModified: Bool) { - switch countryCode { - case "ca": - return ("\(postalCode) 0Z0", true) - - case "gb": - return ("\(postalCode) 0ZZ", true) - - default: - return (postalCode, false) - } - } -} - -/// Represents a complete address including first name, last name, phone, and email address. -/// -public struct PayAddress { - - /// First address line (eg: "Spadina 80") - public let addressLine1: String? - - /// Second address line (eg: "Suite 400") - public let addressLine2: String? - - /// City (eg: "Toronto") - public let city: String? - - /// Country (eg: "Canada") - public let country: String? - - /// Province (eg: "ON" or "Ontario") - public let province: String? - - /// Zip or postal code (eg: "M5V 2J4") - public let zip: String? - - /// First name (eg: "John") - public let firstName: String? - - /// Last name (eg: "Smith") - public let lastName: String? - - /// Phone number (eg: "1234567890") - public let phone: String? - - /// Email address (eg: "john.smith@gmail.com") - public let email: String? - - // ---------------------------------- - // MARK: - Init - - // - public init(addressLine1: String? = nil, - addressLine2: String? = nil, - city: String? = nil, - country: String? = nil, - province: String? = nil, - zip: String? = nil, - - firstName: String? = nil, - lastName: String? = nil, - phone: String? = nil, - email: String? = nil) { - - self.addressLine1 = addressLine1 - self.addressLine2 = addressLine2 - self.city = city - self.country = country - self.province = province - self.zip = zip - - self.firstName = firstName - self.lastName = lastName - self.phone = phone - self.email = email - } -} - -#if canImport(PassKit) - -import PassKit - -// ---------------------------------- -// MARK: - PassKit - -// -internal extension PayPostalAddress { - - init(with address: CNPostalAddress) { - self.init( - city: address.city, - country: address.country, - countryCode: address.isoCountryCode, - province: address.state, - zip: address.postalCode - ) - } -} - -internal extension PayAddress { - - init(with contact: PKContact) { - - var line1: String? - var line2: String? - - if let address = contact.postalAddress { - let street = address.street - if !street.isEmpty { - let lines = street.components(separatedBy: .newlines) - line1 = lines.count > 0 ? lines[0] : nil - line2 = lines.count > 1 ? lines[1] : nil - } - } - - self.init( - addressLine1: line1, - addressLine2: line2, - city: contact.postalAddress?.city, - country: contact.postalAddress?.country, - province: contact.postalAddress?.state, - zip: contact.postalAddress?.postalCode, - firstName: contact.name?.givenName, - lastName: contact.name?.familyName, - phone: contact.phoneNumber?.stringValue, - email: contact.emailAddress - ) - } -} - -#endif diff --git a/Pay/PayAuthorization.swift b/Pay/PayAuthorization.swift deleted file mode 100644 index 7f79c112..00000000 --- a/Pay/PayAuthorization.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// PayAuthorization.swift -// Pay -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -/// Encapsulates the encrypted JSON payload provided by Apple Pay after an authorized payment request. In addition to -/// the `token`, this structure includes final information that is available *only* after payment authorization, -/// such as `billingAddress` and a complete `shippingAddress`. -/// -public struct PayAuthorization { - - /// Encrypted JSON payment data represented by a string - public let token: String - - /// Billing address that was selected by the user - public let billingAddress: PayAddress - - /// Shipping address that was selected by the user - public let shippingAddress: PayAddress - - /// Shipping rate that was selected by the user - public let shippingRate: PayShippingRate? - - // ---------------------------------- - // MARK: - Init - - // - internal init(paymentData: Data, billingAddress: PayAddress, shippingAddress: PayAddress, shippingRate: PayShippingRate?) { - self.token = String(data: paymentData, encoding: .utf8)! - self.billingAddress = billingAddress - self.shippingAddress = shippingAddress - self.shippingRate = shippingRate - } -} diff --git a/Pay/PayCardBrand.swift b/Pay/PayCardBrand.swift deleted file mode 100644 index df853ca8..00000000 --- a/Pay/PayCardBrand.swift +++ /dev/null @@ -1,36 +0,0 @@ -// -// PayCardBrand.swift -// Pay -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -public enum PayCardBrand: String { - case visa = "VISA" - case masterCard = "MASTERCARD" - case discover = "DISCOVER" - case americanExpress = "AMERICAN_EXPRESS" - case dinersClub = "DINERS_CLUB" - case jcb = "JCB" -} diff --git a/Pay/PayCheckout.swift b/Pay/PayCheckout.swift deleted file mode 100644 index 9afde172..00000000 --- a/Pay/PayCheckout.swift +++ /dev/null @@ -1,155 +0,0 @@ -// -// PayCheckout.swift -// Pay -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -/// Encapsulates all fields required for invoking the Apple Pay -/// dialog. It also creates summary items for cart total, -/// subtotal, taxes, shipping, and more. -/// -public struct PayCheckout { - - public let id: String - public let hasLineItems: Bool - public let needsShipping: Bool - - public let giftCards: [PayGiftCard]? - public let discount: PayDiscount? - public let shippingDiscount: PayDiscount? - public let lineItems: [PayLineItem] - public let shippingAddress: PayAddress? - public let shippingRate: PayShippingRate? - - public let currencyCode: String - public let totalDuties: Decimal? - public let subtotalPrice: Decimal - public let totalTax: Decimal - public let paymentDue: Decimal - - // ---------------------------------- - // MARK: - Init - - // - public init(id: String, lineItems: [PayLineItem], giftCards: [PayGiftCard]?, discount: PayDiscount?, shippingDiscount: PayDiscount?, shippingAddress: PayAddress?, shippingRate: PayShippingRate?, currencyCode: String, totalDuties: Decimal?, subtotalPrice: Decimal, needsShipping: Bool, totalTax: Decimal, paymentDue: Decimal) { - - self.id = id - self.lineItems = lineItems - self.shippingAddress = shippingAddress - self.shippingRate = shippingRate - - self.giftCards = giftCards - self.discount = discount - self.shippingDiscount = shippingDiscount - - self.currencyCode = currencyCode - self.totalDuties = totalDuties - self.subtotalPrice = subtotalPrice - self.totalTax = totalTax - self.paymentDue = paymentDue - - self.hasLineItems = !lineItems.isEmpty - self.needsShipping = needsShipping - } -} - -#if canImport(PassKit) - -import PassKit - -// ---------------------------------- -// MARK: - PassKits - -// -internal extension PayCheckout { - - func summaryItems(for shop: String) -> [PKPaymentSummaryItem] { - var summaryItems: [PKPaymentSummaryItem] = [] - - // Cart total - - if self.hasLineItems || self.discount != nil { - summaryItems.append(self.lineItems.totalPrice.summaryItemNamed("CART TOTAL")) - } - - // Discount - - if let discount = self.discount { - let title = discount.code.isEmpty ? "DISCOUNT" : "DISCOUNT (\(discount.code))" - summaryItems.append(discount.amount.negative.summaryItemNamed(title)) - } - - // Subtotal - - summaryItems.append(self.subtotalPrice.summaryItemNamed("SUBTOTAL")) - - // Shipping - - if let shippingRate = self.shippingRate, shippingRate.price > 0.0 { - summaryItems.append(shippingRate.price.summaryItemNamed("SHIPPING")) - } - - // Shipping Discount - - if let discount = self.shippingDiscount { - let title = discount.code.isEmpty ? "DISCOUNT" : "DISCOUNT (\(discount.code))" - summaryItems.append(discount.amount.negative.summaryItemNamed(title)) - } - - // Duties - - if let duties = self.totalDuties { - summaryItems.append(duties.summaryItemNamed("DUTIES")) - } - - // Taxes - - if self.totalTax > 0.0 { - summaryItems.append(self.totalTax.summaryItemNamed("TAXES")) - } - - // Gift cards - - if let giftCards = self.giftCards, !giftCards.isEmpty { - if giftCards.count == 1 { - let giftCard = giftCards[0] - let appliedTotal = giftCard.amount - summaryItems.append(appliedTotal.negative.summaryItemNamed("GIFT CARD (•••• \(giftCard.lastCharacters))")) - - } else { - let appliedTotal = giftCards.reduce(0) { - $0 + $1.amount - } - summaryItems.append(appliedTotal.negative.summaryItemNamed("GIFT CARDS (\(giftCards.count))")) - } - } - - // Shop name - - summaryItems.append(self.paymentDue.summaryItemNamed(shop)) - - return summaryItems - } -} - -#endif diff --git a/Pay/PayCurrency.swift b/Pay/PayCurrency.swift deleted file mode 100644 index 1d3f7491..00000000 --- a/Pay/PayCurrency.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// PayCurrency.swift -// Pay -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -/// Represents the currency used in a transaction. -/// -public struct PayCurrency { - - /// A string representing an ISO 4217 currency code (eg: "USD") - public let currencyCode: String - - // A string representing an ISO Alpha-2 country code (eg: "US") - public let countryCode: String - - // ---------------------------------- - // MARK: - Init - - // - public init(currencyCode: String, countryCode: String) { - self.currencyCode = currencyCode - self.countryCode = countryCode - } -} diff --git a/Pay/PayDiscount.swift b/Pay/PayDiscount.swift deleted file mode 100644 index 25f1cc83..00000000 --- a/Pay/PayDiscount.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// PayDiscount.swift -// Pay -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -/// Represents a discount to be applied to the checkout. If the code -/// is a zero-length string, then it is treated as an "anonymous" discount -/// in the checkout summary item. Otherwise, the code is shown in the -/// item label. -/// -public struct PayDiscount { - - public let code: String - public let amount: Decimal - - // ---------------------------------- - // MARK: - Init - - // - public init(code: String, amount: Decimal) { - self.code = code - self.amount = amount - } -} diff --git a/Pay/PayGiftCard.swift b/Pay/PayGiftCard.swift deleted file mode 100644 index a4424171..00000000 --- a/Pay/PayGiftCard.swift +++ /dev/null @@ -1,54 +0,0 @@ -// -// PayGiftCard.swift -// Pay -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -/// Represents a gift card to be applied to the checkout. -/// -public struct PayGiftCard { - - /// Globally unique identifier. - public let id: String - - /// The amount left on the Gift Card. - public let balance: Decimal - - /// The amount that was used taken from the Gift Card by applying it. - public let amount: Decimal - - /// The last characters of the Gift Card code - public let lastCharacters: String - - // ---------------------------------- - // MARK: - Init - - // - public init(id: String, balance: Decimal, amount: Decimal, lastCharacters: String) { - self.id = id - self.balance = balance - self.amount = amount - self.lastCharacters = lastCharacters - } -} diff --git a/Pay/PayLineItem.swift b/Pay/PayLineItem.swift deleted file mode 100644 index 7862c4a6..00000000 --- a/Pay/PayLineItem.swift +++ /dev/null @@ -1,52 +0,0 @@ -// -// PayLineItem.swift -// Pay -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -/// Represents a line item in checkout with a quantity and single-unit price. -/// -public struct PayLineItem { - - public let price: Decimal - public let quantity: Int - - // ---------------------------------- - // MARK: - Init - - // - public init(price: Decimal, quantity: Int) { - self.price = price - self.quantity = quantity - } -} - -public extension Array where Element == PayLineItem { - - var totalPrice: Decimal { - return self.reduce(0) { - $0 + $1.price * Decimal($1.quantity) - } - } -} diff --git a/Pay/PaySession.swift b/Pay/PaySession.swift deleted file mode 100644 index f3413ff6..00000000 --- a/Pay/PaySession.swift +++ /dev/null @@ -1,375 +0,0 @@ -// -// PaySession.swift -// Pay -// -// Created by Shopify. -// Copyright (c) 2017 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. -// - -#if canImport(PassKit) - -import Foundation -import PassKit - -/// The delegate will be called when user interaction modifies the information -/// that affects checkout. Whenever such events occur, you should perform any -/// API calls required to mutate the existing checkout and provide the updated -/// object in the `provide` handler. -/// -@available(iOS 10.0, *) -public protocol PaySessionDelegate: class { - - /// This callback is invoked if the user updates the `shippingContact` and the current address used for shipping is invalidated. - /// You should make any necessary API calls to obtain shipping rates here and provide an array of `PayShippingRate` objects. - /// - /// - parameters: - /// - paySession: The session that invoked the callback. - /// - address: A partial address that you can use to obtain relevant shipping rates. This address is missing `addressLine1` and `addressLine2`. This information is only available after the user has authorized payment. - /// - checkout: The current checkout state. - /// - provide: A completion handler that **must** be invoked with an updated `PayCheckout` and an array of `[PayShippingRate]`. If the `PayPostalAddress` is invalid or you were unable to obtain shipping rates, then returning `nil` or empty shipping rates will result in an invalid address error in Apple Pay. - /// - /// - Important: - /// The `address` passed into this method is _partial_, and doesn't include address lines or a complete zip / postal code. It is sufficient for obtaining shipping rates _only_. **You must update the checkout with a full address before completing the payment.** The complete address will be available in `paySession(_:didAuthorizePayment:checkout:completeTransaction:)`. - /// - func paySession(_ paySession: PaySession, didRequestShippingRatesFor address: PayPostalAddress, checkout: PayCheckout, provide: @escaping (PayCheckout?, [PayShippingRate]) -> Void) - - /// This callback is invoked if the user updates the `shippingContact` and the current address is invalidated. This method is called *only* for - /// checkouts that don't require shipping. - /// You should make any necessary API calls to update the checkout with the provided address in order to obtain accurate tax information. - /// - /// - parameters: - /// - paySession: The session that invoked the callback. - /// - address: A partial address that you can use to obtain relevant tax information for the checkout. This address is missing `addressLine1` and `addressLine2`. This information is only available after the user has authorized payment. - /// - checkout: The current checkout state. - /// - provide: A completion handler that **must** be invoked with an updated `PayCheckout`. Returning `nil` will result in a generic failure in the Apple Pay dialog. - /// - /// - Important: - /// The `address` passed into this method is _partial_, and doesn't include address lines or a complete zip / postal code. It is sufficient for obtaining shipping rates _only_. **You must update the checkout with a full address before completing the payment.** The complete address will be available in `paySession(_:didAuthorizePayment:checkout:completeTransaction:)`. - /// - func paySession(_ paySession: PaySession, didUpdateShippingAddress address: PayPostalAddress, checkout: PayCheckout, provide: @escaping (PayCheckout?) -> Void) - - /// This callback is invoked when the user selects a shipping rate or an initial array of shipping rates is provided. In the latter case, the first shipping rate in the array will be used. You should make any necessary API calls to update the checkout with the selected shipping rate here. - /// - /// - parameters: - /// - paySession: The session that invoked the callback. - /// - shippingRate: The selected shipping rate. - /// - checkout: The current checkout state. - /// - provide: A completion handler that **must** be invoked with an updated `PayCheckout`. Returning `nil` will result in a generic failure in the Apple Pay dialog. - /// - func paySession(_ paySession: PaySession, didSelectShippingRate shippingRate: PayShippingRate, checkout: PayCheckout, provide: @escaping (PayCheckout?) -> Void) - - /// This callback is invoked when the user authorizes payment using Touch ID or passcode. You should make necessary API calls to update and complete the checkout with final information here (eg: billing address). - /// - /// - parameters: - /// - paySession: The session that invoked the callback. - /// - authorization: Authorization object that encapsulates the token and other relevant information: billing address, complete shipping address, and shipping rate. - /// - checkout: The current checkout state. - /// - completeTransaction: A completion handler that **must** be invoked with the final transaction status. - /// - /// - Important: - /// If you previously set a partial address on checkout (eg: for obtaining shipping rates), you **MUST** update the checkout with the complete address provided by `authorization.shippingAddress`. - /// - func paySession(_ paySession: PaySession, didAuthorizePayment authorization: PayAuthorization, checkout: PayCheckout, completeTransaction: @escaping (PaySession.TransactionStatus) -> Void) - - /// This callback is invoked when the Apple Pay authorization controller is dismissed. - /// - /// - parameters: - /// - paySession: The session that invoked the callback. - /// - func paySessionDidFinish(_ paySession: PaySession) -} - -/// The `PaySession` coordinates the communication -/// between `PKPaymentAuthorizationController` and your application to -/// provide easier support for Apple Pay. -/// -@available(iOS 10.0, *) -public class PaySession: NSObject { - - /// A status that determines whether a transaction has completed - /// successfully or failed. - /// - public enum TransactionStatus { - case success - case failure - } - - /// A delegate for receiving updates from `PaySession`. - public weak var delegate: PaySessionDelegate? - - /// Types of credit cards accepted for payment. - public var acceptedCardBrands: [PayCardBrand] = [.visa, .masterCard, .americanExpress] - - /// The name of your shop. Display in the Apple Pay dialog - /// during checkout. It is _very_ important that `shopName` - /// accurately reflects the shop customers will be paying to. - public let shopName: String - - /// The currency description that will be used in this Apple Pay transaction. - public let currency: PayCurrency - - /// The merchant ID provided on initialization. It should match the merchant ID used to setup Apple Pay in the developer portal. - public let merchantID: String - - /// Idempotency identifier of this session. - public let identifier: String - - internal var checkout: PayCheckout - internal var shippingRates: [PayShippingRate] = [] - - private let controllerType: PKPaymentAuthorizationController.Type - - // ---------------------------------- - // MARK: - Init - - // - /// An instance of `PaySession` represents a single transaction using Apple Pay. - /// To create one requires a `PayCheckout` and `PayCurrency`. - /// - /// - parameters: - /// - checkout: A `PayCheckout` that will be used to create summary items. - /// - currency: Represents the country and currency that will be used for the transaction. - /// - merchantID: The merchant ID that you've registered to use for Apple Pay. - /// - controllerType: Reserved for testing. - /// - public init(shopName: String, checkout: PayCheckout, currency: PayCurrency, merchantID: String, controllerType: PKPaymentAuthorizationController.Type = PKPaymentAuthorizationController.self) { - self.shopName = shopName - self.checkout = checkout - self.currency = currency - self.merchantID = merchantID - self.identifier = UUID().uuidString - self.controllerType = controllerType - - super.init() - } - - @available(*, deprecated, message: "PaySession requires a shop name to display during checkout. Use init(shopName:checkout:currency:merchantID:controllerType:) instead.") - public convenience init(checkout: PayCheckout, currency: PayCurrency, merchantID: String, controllerType: PKPaymentAuthorizationController.Type = PKPaymentAuthorizationController.self) { - self.init(shopName: "TOTAL", checkout: checkout, currency: currency, merchantID: merchantID, controllerType: controllerType) - } - - // ---------------------------------- - // MARK: - Begin Checkout - - // - /// Invoking `authorize()` will create a payment request and present the - /// Apple Pay dialog. The `delegate` will then be called when the user - /// begins changing billing address, shipping address, and shipping rates. - /// - public func authorize() { - let paymentRequest = self.paymentRequestUsing(self.checkout, currency: self.currency, merchantID: self.merchantID) - let controller = self.controllerType.init(paymentRequest: paymentRequest) - controller.delegate = self - controller.present(completion: nil) - } - - // ---------------------------------- - // MARK: - Payment Creation - - // - func paymentRequestUsing(_ checkout: PayCheckout, currency: PayCurrency, merchantID: String) -> PKPaymentRequest { - let request = PKPaymentRequest() - request.countryCode = currency.countryCode - request.currencyCode = currency.currencyCode - request.merchantIdentifier = merchantID - request.requiredBillingAddressFields = .all - request.requiredShippingAddressFields = .all - request.supportedNetworks = self.acceptedCardBrands.paymentNetworks - request.merchantCapabilities = [.capability3DS] - request.paymentSummaryItems = checkout.summaryItems(for: self.shopName) - - return request - } -} - -// ------------------------------------------------------ -// MARK: - PKPaymentAuthorizationControllerDelegate - -// -@available(iOS 10.0, *) -extension PaySession: PKPaymentAuthorizationControllerDelegate { - - // ------------------------------------------------------- - // MARK: - PKPaymentAuthorizationControllerDelegate - - // - @available(iOS 11.0, watchOS 4.0, *) - public func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler completion: @escaping (PKPaymentAuthorizationResult) -> Void) { - self.paymentAuthorizationController(controller, didAuthorizePayment: payment) { (status: PKPaymentAuthorizationStatus) in - let result = PKPaymentAuthorizationResult(status: status, errors: nil) - completion(result) - } - } - - public func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) { - - var shippingRate: PayShippingRate? - - if self.checkout.needsShipping { - shippingRate = self.shippingRates.shippingRateFor(payment.shippingMethod!) - } - - /* ----------------------------------------------- - ** The PKPayment object provides `billingContact` - ** and `shippingContact` only when required fields - ** are set on the payment request, which they are. - ** We can then safely force-unwrap both contacts. - */ - let authorization = PayAuthorization( - paymentData: payment.token.paymentData, - billingAddress: PayAddress(with: payment.billingContact!), - shippingAddress: PayAddress(with: payment.shippingContact!), - shippingRate: shippingRate - ) - - Log("Authorized payment. Completing...") - self.delegate?.paySession(self, didAuthorizePayment: authorization, checkout: self.checkout, completeTransaction: { status in - Log("Completion status : \(status)") - - switch status { - case .success: completion(.success) - case .failure: completion(.failure) - } - }) - } - - @available(iOS 11.0, watchOS 4.0, *) - public func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, handler completion: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) { - - self.paymentAuthorizationController(controller, didSelectShippingContact: contact) { status, shippingMethod, summaryItems in - let result = PKPaymentRequestShippingContactUpdate(errors: nil, paymentSummaryItems: summaryItems, shippingMethods: shippingMethod) - result.status = status - completion(result) - } - } - - public func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) { - Log("Selecting shipping contact...") - - guard let postalAddress = contact.postalAddress else { - completion(.invalidShippingPostalAddress, [], self.checkout.summaryItems(for: self.shopName)) - return - } - - let payPostalAddress = PayPostalAddress(with: postalAddress) - - /* --------------------------------- - ** If the checkout doesn't require - ** shipping, we still need to notify - ** the delegate about the shipping - ** address but we have to skip fetching - ** shipping rates. - */ - guard self.checkout.needsShipping else { - Log("Checkout doesn't require shipping. Updating address...") - - self.delegate?.paySession(self, didUpdateShippingAddress: payPostalAddress, checkout: self.checkout, provide: { updatedCheckout in - if let updatedCheckout = updatedCheckout { - self.checkout = updatedCheckout - - completion(.success, [], updatedCheckout.summaryItems(for: self.shopName)) - } else { - completion(.failure, [], []) - } - }) - return - } - - /* --------------------------------- - ** Request the delegate to provide - ** shipping rates for the given - ** postal address. The partial info - ** should be enough to obtain rates. - */ - self.delegate?.paySession(self, didRequestShippingRatesFor: payPostalAddress, checkout: self.checkout, provide: { updatedCheckout, shippingRates in - - /* --------------------------------- - ** The delegate has an opportunity - ** to return empty shipping rates - ** which indicates invalid or incomplete - ** postal address. - */ - guard let updatedCheckout = updatedCheckout, !shippingRates.isEmpty else { - completion(.invalidShippingPostalAddress, [], self.checkout.summaryItems(for: self.shopName)) - return - } - - self.checkout = updatedCheckout - self.shippingRates = shippingRates - - /* ----------------------------------------- - ** Give the delegate a chance to update the - ** checkout with the first shipping rate as - ** the default. Apple Pay selects it but - ** doesn't invoke the delegate method. - */ - self.delegate?.paySession(self, didSelectShippingRate: shippingRates.first!, checkout: updatedCheckout, provide: { updatedCheckout in - if let updatedCheckout = updatedCheckout { - self.checkout = updatedCheckout - - Log("Selected shipping contact.") - completion(.success, shippingRates.summaryItems, updatedCheckout.summaryItems(for: self.shopName)) - } else { - completion(.failure, [], []) - } - }) - }) - } - - @available(iOS 11.0, watchOS 4.0, *) - public func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, handler completion: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) { - self.paymentAuthorizationController(controller, didSelectShippingMethod: shippingMethod) { status, summaryItems in - let result = PKPaymentRequestShippingMethodUpdate(paymentSummaryItems: summaryItems) - result.status = status - completion(result) - } - } - - public func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) { - Log("Selecting delivery method...") - - /* -------------------------------------- - ** This should never fail since shipping - ** methods are mapped 1:1 from shipping - ** rates. - */ - guard let shippingRate = self.shippingRates.shippingRateFor(shippingMethod) else { - completion(.failure, self.checkout.summaryItems(for: self.shopName)) - return - } - - self.delegate?.paySession(self, didSelectShippingRate: shippingRate, checkout: self.checkout, provide: { updatedCheckout in - if let updatedCheckout = updatedCheckout { - self.checkout = updatedCheckout - - Log("Selected delivery method.") - completion(.success, updatedCheckout.summaryItems(for: self.shopName)) - } else { - completion(.failure, []) - } - }) - } - - public func paymentAuthorizationControllerDidFinish(_ controller: PKPaymentAuthorizationController) { - - Log("Dismissing authorization controller.") - controller.dismiss(completion: nil) - - self.delegate?.paySessionDidFinish(self) - } -} - -#endif diff --git a/Pay/PayShippingRate.swift b/Pay/PayShippingRate.swift deleted file mode 100644 index 951b7157..00000000 --- a/Pay/PayShippingRate.swift +++ /dev/null @@ -1,147 +0,0 @@ -// -// PayShippingRate.swift -// Pay -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -/// Represents a shipping rate quote, usually provided for a specific address. -/// -public struct PayShippingRate { - - /// Represents a `from` and `to` date for the expected delivery time frame. If the `to` date is `nil`, then the expected delivery window is roughly around the `from` date. - /// - public struct DeliveryRange { - - /// Delivery is expected no earlier than `from` date. - public let from: Date - - /// Delivery is expected no later than `to` date. - public let to: Date? - - /// Create a delivery range. - /// - /// - parameters: - /// - from: A date from which to expect delivery. - /// - to: A date until which to expect delivery. - /// - public init(from: Date, to: Date? = nil) { - self.from = from - self.to = to - } - - /// A string that describes how many days until expected delivery (eg: "1 - 2 days"). - public func descriptionFrom(_ date: Date) -> String { - let firstDelta = date.daysUntil(self.from) - - guard let toDate = self.to else { - let suffix = firstDelta == 1 ? "" : "s" - return "\(firstDelta) day\(suffix)" - } - - let secondDelta = date.daysUntil(toDate) - return "\(firstDelta) - \(secondDelta) days" - } - } - - /// A handle that uniquely identifies this shipping rate. - public let handle: String - - /// A human-friendly name for this shipping rate. - public let title: String - - /// Shipping rate price. - public let price: Decimal - - /// A delivery range that represents a timeframe during which a delivery is expected. - public let deliveryRange: DeliveryRange? - - // ---------------------------------- - // MARK: - Init - - // - public init(handle: String, title: String, price: Decimal, deliveryRange: DeliveryRange? = nil) { - self.handle = handle - self.title = title - self.price = price - self.deliveryRange = deliveryRange - } -} - -// ---------------------------------- -// MARK: - Date - -// -private extension Date { - - static let calendar = Calendar.current - - func daysUntil(_ date: Date) -> Int { - - let calendar = Date.calendar - let start = calendar.startOfDay(for: self) - let end = calendar.startOfDay(for: date) - let delta = calendar.dateComponents([.day], from: start, to: end) - - return delta.day! - } -} - -#if canImport(PassKit) - -import PassKit - -// ---------------------------------- -// MARK: - PassKit - -// -internal extension PayShippingRate { - - var summaryItem: PKShippingMethod { - let item = PKShippingMethod(label: self.title, amount: self.price) - - if let deliveryRange = self.deliveryRange { - item.detail = deliveryRange.descriptionFrom(Date()) - } else { - item.detail = "No delivery estimate provided." - } - item.identifier = self.handle - - return item - } -} - -internal extension Array where Element == PayShippingRate { - - var summaryItems: [PKShippingMethod] { - return self.map { - $0.summaryItem - } - } - - func shippingRateFor(_ shippingMethod: PKShippingMethod) -> Element? { - return self.filter { - $0.handle == shippingMethod.identifier! - }.first - } -} - -#endif diff --git a/Pay/Utilities/Log.swift b/Pay/Utilities/Log.swift deleted file mode 100644 index ad6fd6b0..00000000 --- a/Pay/Utilities/Log.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// Log.swift -// Pay -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -func Log(_ string: String) { -#if DEBUG - print(string) -#endif -} diff --git a/PayTests/Info.plist b/PayTests/Info.plist deleted file mode 100644 index 2c4e8817..00000000 --- a/PayTests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 12.1.0 - CFBundleVersion - 1 - - diff --git a/PayTests/Mocks/MockAuthorizationController.swift b/PayTests/Mocks/MockAuthorizationController.swift deleted file mode 100644 index af459d5e..00000000 --- a/PayTests/Mocks/MockAuthorizationController.swift +++ /dev/null @@ -1,117 +0,0 @@ -// -// MockAuthorizationController.swift -// PayTests -// -// Created by Shopify. -// Copyright (c) 2017 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. -// - -#if canImport(PassKit) - -import Foundation -import PassKit - -final class MockAuthorizationController: PKPaymentAuthorizationController { - - private static var instances: [MockAuthorizationController] = [] - - // ---------------------------------- - // MARK: - Instance Management - - // - override init(paymentRequest request: PKPaymentRequest) { - super.init(paymentRequest: request) - - type(of: self).instances.append(self) - } - - // ---------------------------------- - // MARK: - Disable Defaults - - // - override func present(completion: ((Bool) -> Void)? = nil) { - // Do nothing - } - - // ---------------------------------- - // MARK: - Invoke Delegate Calls - - // - static func invokeDidSelectShippingContact(_ contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) { - - self.instances.forEach { authorizationController in - authorizationController.delegate?.paymentAuthorizationController?(authorizationController, didSelectShippingContact: contact, completion: completion) - } - } - - static func invokeDidAuthorizePayment(_ payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) { - - self.instances.forEach { authorizationController in - authorizationController.delegate?.paymentAuthorizationController?(authorizationController, didAuthorizePayment: payment, completion: completion) - } - } - - static func invokeDidFinish() { - self.instances.forEach { authorizationController in - authorizationController.delegate?.paymentAuthorizationControllerDidFinish(authorizationController) - } - } - - static func invokeDidSelectShippingMethod(_ shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) { - - self.instances.forEach { authorizationController in - authorizationController.delegate?.paymentAuthorizationController?(authorizationController, didSelectShippingMethod: shippingMethod, completion: completion) - } - } - - static func invokeDidSelectPaymentMethod(_ paymentMethod: PKPaymentMethod, completion: @escaping ([PKPaymentSummaryItem]) -> Void) { - - self.instances.forEach { authorizationController in - authorizationController.delegate?.paymentAuthorizationController?(authorizationController, didSelectPaymentMethod: paymentMethod, completion: completion) - } - } - - // ---------------------------------- - // MARK: - iOS 11 - - // - @available(iOS 11.0, *) - static func invokeDidAuthorizePaymentHandler(_ payment: PKPayment, handler: @escaping (PKPaymentAuthorizationResult) -> Void) { - - self.instances.forEach { authorizationController in - authorizationController.delegate?.paymentAuthorizationController?(authorizationController, didAuthorizePayment: payment, handler: handler) - } - } - - @available(iOS 11.0, *) - static func invokeDidSelectShippingContactHandler(_ contact: PKContact, handler: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) { - - self.instances.forEach { authorizationController in - authorizationController.delegate?.paymentAuthorizationController?(authorizationController, didSelectShippingContact: contact, handler: handler) - } - } - - @available(iOS 11.0, *) - static func invokeDidSelectShippingMethodHandler(_ shippingMethod: PKShippingMethod, handler: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) { - - self.instances.forEach { authorizationController in - authorizationController.delegate?.paymentAuthorizationController?(authorizationController, didSelectShippingMethod: shippingMethod, handler: handler) - } - } -} - -#endif diff --git a/PayTests/Mocks/MockPaySession.swift b/PayTests/Mocks/MockPaySession.swift deleted file mode 100644 index f3fa7c66..00000000 --- a/PayTests/Mocks/MockPaySession.swift +++ /dev/null @@ -1,80 +0,0 @@ -// -// MockPaySession.swift -// PayTests -// -// Created by Dima Bart on 2017-09-20. -// Copyright © 2017 Shopify Inc. All rights reserved. -// - -#if canImport(PassKit) - -import Foundation -import PassKit -@testable import Pay - -@available(iOS 11.0, *) -class MockPaySession: PaySession { - - enum Status { - case handled - case unhandled - } - - // ---------------------------------- - // MARK: - iOS 11 - - // - var didSelectShippingContactHandler: ((PKPaymentAuthorizationController, PKContact, @escaping (PKPaymentRequestShippingContactUpdate) -> Void) -> Status)? - var didSelectShippingMethodHandler: ((PKPaymentAuthorizationController, PKShippingMethod, @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) -> Status)? - var didAuthorizePaymentHandler: ((PKPaymentAuthorizationController, PKPayment, @escaping (PKPaymentAuthorizationResult) -> Void) -> Status)? - - override func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, handler: @escaping (PKPaymentRequestShippingContactUpdate) -> Void) { - let status = self.didSelectShippingContactHandler?(controller, contact, handler) ?? .unhandled - if status == .unhandled { - super.paymentAuthorizationController(controller, didSelectShippingContact: contact, handler: handler) - } - } - - override func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, handler: @escaping (PKPaymentRequestShippingMethodUpdate) -> Void) { - let status = self.didSelectShippingMethodHandler?(controller, shippingMethod, handler) ?? .unhandled - if status == .unhandled { - super.paymentAuthorizationController(controller, didSelectShippingMethod: shippingMethod, handler: handler) - } - } - - override func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, handler: @escaping (PKPaymentAuthorizationResult) -> Void) { - let status = self.didAuthorizePaymentHandler?(controller, payment, handler) ?? .unhandled - if status == .unhandled { - super.paymentAuthorizationController(controller, didAuthorizePayment: payment, handler: handler) - } - } - - // ---------------------------------- - // MARK: - Delegate Callbacks - - // - var didSelectShippingContact: ((PKPaymentAuthorizationController, PKContact, @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) -> Status)? - var didSelectShippingMethod: ((PKPaymentAuthorizationController, PKShippingMethod, @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) -> Status)? - var didAuthorizePayment: ((PKPaymentAuthorizationController, PKPayment, @escaping (PKPaymentAuthorizationStatus) -> Void) -> Status)? - - override func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingContact contact: PKContact, completion: @escaping (PKPaymentAuthorizationStatus, [PKShippingMethod], [PKPaymentSummaryItem]) -> Void) { - let status = self.didSelectShippingContact?(controller, contact, completion) ?? .unhandled - if status == .unhandled { - super.paymentAuthorizationController(controller, didSelectShippingContact: contact, completion: completion) - } - } - - override func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didSelectShippingMethod shippingMethod: PKShippingMethod, completion: @escaping (PKPaymentAuthorizationStatus, [PKPaymentSummaryItem]) -> Void) { - let status = self.didSelectShippingMethod?(controller, shippingMethod, completion) ?? .unhandled - if status == .unhandled { - super.paymentAuthorizationController(controller, didSelectShippingMethod: shippingMethod, completion: completion) - } - } - - override func paymentAuthorizationController(_ controller: PKPaymentAuthorizationController, didAuthorizePayment payment: PKPayment, completion: @escaping (PKPaymentAuthorizationStatus) -> Void) { - let status = self.didAuthorizePayment?(controller, payment, completion) ?? .unhandled - if status == .unhandled { - super.paymentAuthorizationController(controller, didAuthorizePayment: payment, completion: completion) - } - } -} - -#endif diff --git a/PayTests/Mocks/MockPayment.swift b/PayTests/Mocks/MockPayment.swift deleted file mode 100644 index 2062874f..00000000 --- a/PayTests/Mocks/MockPayment.swift +++ /dev/null @@ -1,66 +0,0 @@ -// -// MockPayment.swift -// PayTests -// -// Created by Shopify. -// Copyright (c) 2017 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. -// - -#if canImport(PassKit) - -import Foundation -import PassKit - -class MockPayment: PKPayment { - - override var token: PKPaymentToken { - return self._token - } - - override var billingContact: PKContact? { - return self._billingContact - } - - override var shippingContact: PKContact? { - return self._shippingContact - } - - override var shippingMethod: PKShippingMethod? { - return self._shippingMethod - } - - let _token: MockPaymentToken - let _billingContact: PKContact? - let _shippingContact: PKContact? - let _shippingMethod: PKShippingMethod? - - // ---------------------------------- - // MARK: - Init - - // - init(token: MockPaymentToken, billingContact: PKContact? = nil, shippingContact: PKContact? = nil, shippingMethod: PKShippingMethod? = nil) { - self._token = token - self._billingContact = billingContact - self._shippingContact = shippingContact - self._shippingMethod = shippingMethod - } -} - -#endif diff --git a/PayTests/Mocks/MockPaymentMethod.swift b/PayTests/Mocks/MockPaymentMethod.swift deleted file mode 100644 index 2d21d74a..00000000 --- a/PayTests/Mocks/MockPaymentMethod.swift +++ /dev/null @@ -1,60 +0,0 @@ -// -// MockPaymentMethod.swift -// PayTests -// -// Created by Shopify. -// Copyright (c) 2017 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. -// - -#if canImport(PassKit) - -import Foundation -import PassKit - -class MockPaymentMethod: PKPaymentMethod { - - override var displayName: String? { - return self._displayName - } - - override var network: PKPaymentNetwork? { - return self._network - } - - override var type: PKPaymentMethodType { - return self._type - } - - private let _displayName: String - private let _network: PKPaymentNetwork - private let _type: PKPaymentMethodType - - // ---------------------------------- - // MARK: - Init - - // - init(displayName: String, network: PKPaymentNetwork, type: PKPaymentMethodType) { - self._displayName = displayName - self._network = network - self._type = type - } -} - -#endif diff --git a/PayTests/Mocks/MockPaymentToken.swift b/PayTests/Mocks/MockPaymentToken.swift deleted file mode 100644 index 59a6d173..00000000 --- a/PayTests/Mocks/MockPaymentToken.swift +++ /dev/null @@ -1,58 +0,0 @@ -// -// MockToken.swift -// PayTests -// -// Created by Shopify. -// Copyright (c) 2017 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. -// - -#if canImport(PassKit) - -import Foundation -import PassKit - -class MockPaymentToken: PKPaymentToken { - - override var paymentMethod: PKPaymentMethod { - return self._paymentMethod - } - - override var transactionIdentifier: String { - return self._transactionIdentifier - } - - override var paymentData: Data { - return self._paymentData - } - - let _paymentMethod: MockPaymentMethod - let _transactionIdentifier = UUID().uuidString - let _paymentData = UUID().uuidString.data(using: .utf8)! - - // ---------------------------------- - // MARK: - Init - - // - init(paymentMethod: MockPaymentMethod) { - self._paymentMethod = paymentMethod - } -} - -#endif diff --git a/PayTests/Mocks/MockSessionDelegate.swift b/PayTests/Mocks/MockSessionDelegate.swift deleted file mode 100644 index b56e21f1..00000000 --- a/PayTests/Mocks/MockSessionDelegate.swift +++ /dev/null @@ -1,74 +0,0 @@ -// -// MockSessionDelegate.swift -// PayTests -// -// Created by Shopify. -// Copyright (c) 2017 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. -// - -#if canImport(PassKit) - -import Foundation -import Pay - -final class MockSessionDelegate: PaySessionDelegate { - - var didSelectShippingRate: ((PaySession, PayShippingRate, PayCheckout, (PayCheckout?) -> Void) -> Void)? - var didAuthorizePayment: ((PaySession, PayAuthorization, PayCheckout, (PaySession.TransactionStatus) -> Void) -> Void)? - var didRequestShippingRates: ((PaySession, PayPostalAddress, PayCheckout, (PayCheckout?, [PayShippingRate]) -> Void) -> Void)? - var didUpdateShippingAddress: ((PaySession, PayPostalAddress, PayCheckout, (PayCheckout?) -> Void) -> Void)? - var didFinish: ((PaySession) -> Void)? - - let session: PaySession - - // ---------------------------------- - // MARK: - Init - - // - init(session: PaySession) { - self.session = session - self.session.delegate = self - } - - // ---------------------------------- - // MARK: - Delegate - - // - func paySession(_ paySession: PaySession, didSelectShippingRate shippingRate: PayShippingRate, checkout: PayCheckout, provide: @escaping (PayCheckout?) -> Void) { - self.didSelectShippingRate?(paySession, shippingRate, checkout, provide) - } - - func paySession(_ paySession: PaySession, didAuthorizePayment authorization: PayAuthorization, checkout: PayCheckout, completeTransaction: @escaping (PaySession.TransactionStatus) -> Void) { - self.didAuthorizePayment?(paySession, authorization, checkout, completeTransaction) - } - - func paySession(_ paySession: PaySession, didRequestShippingRatesFor address: PayPostalAddress, checkout: PayCheckout, provide: @escaping (PayCheckout?, [PayShippingRate]) -> Void) { - self.didRequestShippingRates?(paySession, address, checkout, provide) - } - - func paySession(_ paySession: PaySession, didUpdateShippingAddress address: PayPostalAddress, checkout: PayCheckout, provide: @escaping (PayCheckout?) -> Void) { - self.didUpdateShippingAddress?(paySession, address, checkout, provide) - } - - func paySessionDidFinish(_ paySession: PaySession) { - self.didFinish?(paySession) - } -} - -#endif diff --git a/PayTests/Models/Models.swift b/PayTests/Models/Models.swift deleted file mode 100644 index 8b0e1fcf..00000000 --- a/PayTests/Models/Models.swift +++ /dev/null @@ -1,195 +0,0 @@ -// -// Models.swift -// PayTests -// -// Created by Shopify. -// Copyright (c) 2017 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. -// - -#if canImport(PassKit) - -import Foundation -import PassKit -import Pay - -@available(iOS 11.0, *) -struct Models { - - static func createShippingMethod(identifier: String? = nil) -> PKShippingMethod { - let method = PKShippingMethod(label: "CanadaPost", amount: 15.00 as NSDecimalNumber) - method.identifier = identifier - return method - } - - static func createContact() -> PKContact { - let contact = PKContact() - contact.name = { - var c = PersonNameComponents() - c.givenName = "John" - c.familyName = "Smith" - return c - }() - contact.phoneNumber = CNPhoneNumber(stringValue: "1234567890") - contact.postalAddress = self.createPostalAddress() - contact.emailAddress = "john.smith@gmail.com" - - return contact - } - - static func createPostalAddress() -> CNPostalAddress { - let address = CNMutablePostalAddress() - address.street = "80 Spadina" - address.city = "Toronto" - address.country = "Canada" - address.state = "ON" - address.postalCode = "M5V 2J4" - - return address.copy() as! CNPostalAddress - } - - // ---------------------------------- - // MARK: - Pay Models - - // - static func createSession(checkout: PayCheckout, currency: PayCurrency) -> MockPaySession { - return MockPaySession(shopName: "Jaded Labs", checkout: checkout, currency: currency, merchantID: "com.merchant.identifier", controllerType: MockAuthorizationController.self) - } - - static func createGiftCard() -> PayGiftCard { - return PayGiftCard( - id: "123", - balance: 20.00, - amount: 5.00, - lastCharacters: "A1B2" - ) - } - - static func createGiftCardSecondary() -> PayGiftCard { - return PayGiftCard( - id: "234", - balance: 10.00, - amount: 2.50, - lastCharacters: "C3D4" - ) - } - - static func createDiscount() -> PayDiscount { - return PayDiscount(code: "WIN20", amount: 20.0) - } - - static func createShippingDiscount() -> PayDiscount { - return PayDiscount(code: "FREESHIP", amount: 10.0) - } - - static func createAnonymousDiscount() -> PayDiscount { - return PayDiscount(code: "", amount: 20.0) - } - - static func createAnonymousShippingDiscount() -> PayDiscount { - return PayDiscount(code: "", amount: 10.0) - } - - static func createCurrency() -> PayCurrency { - return PayCurrency(currencyCode: "USD", countryCode: "US") - } - - static func createCheckout(requiresShipping: Bool = true, giftCards: [PayGiftCard]? = nil, discount: PayDiscount? = nil, shippingDiscount: PayDiscount? = nil, shippingAddress: PayAddress? = nil, shippingRate: PayShippingRate? = nil, duties: Decimal? = nil, empty: Bool = false, hasTax: Bool = true) -> PayCheckout { - - let lineItems = [ - self.createLineItem1(), - self.createLineItem2(), - ] - - return PayCheckout( - id: "123", - lineItems: !empty ? lineItems : [], - giftCards: giftCards, - discount: discount, - shippingDiscount: shippingDiscount, - shippingAddress: shippingAddress, - shippingRate: shippingRate, - currencyCode: "CAD", - totalDuties: duties, - subtotalPrice: 44.0, - needsShipping: requiresShipping, - totalTax: hasTax ? 6.0 : 0.0, - paymentDue: 50.0 - ) - } - - static func createLineItem1() -> PayLineItem { - return PayLineItem(price: 16.0, quantity: 2) - } - - static func createLineItem2() -> PayLineItem { - return PayLineItem(price: 12.0, quantity: 1) - } - - static func createAddress() -> PayAddress { - return PayAddress( - addressLine1: "80 Spadina", - addressLine2: nil, - city: "Toronto", - country: "Canada", - province: "ON", - zip: "M5V 2J4", - firstName: "John", - lastName: "Smith", - phone: "1234567890", - email: "john.smith@gmail.com" - ) - } - - static func createShippingRate() -> PayShippingRate { - return PayShippingRate(handle: "shipping-rate", title: "UPS Standard", price: 12.0) - } - - static func createShippingRates() -> [PayShippingRate] { - return [ - PayShippingRate(handle: "123", title: "USPS", price: 11.0), - PayShippingRate(handle: "234", title: "UPS", price: 12.0), - PayShippingRate(handle: "345", title: "FexEx", price: 13.0), - ] - } - - static func createDeliveryRangeFromSingle() -> (orderDate: Date, range: PayShippingRate.DeliveryRange) { - let order = Date(timeIntervalSince1970: 1483228800) - let from = Date(timeIntervalSince1970: 1483315200) - - return (order, PayShippingRate.DeliveryRange(from: from)) - } - - static func createDeliveryRangeFromMulti() -> (orderDate: Date, range: PayShippingRate.DeliveryRange) { - let order = Date(timeIntervalSince1970: 1483228800) - let from = Date(timeIntervalSince1970: 1483401600) - - return (order, PayShippingRate.DeliveryRange(from: from)) - } - - static func createDeliveryRange() -> (orderDate: Date, range: PayShippingRate.DeliveryRange) { - let order = Date(timeIntervalSince1970: 1483228800) - let from = Date(timeIntervalSince1970: 1483315200) - let to = Date(timeIntervalSince1970: 1483747200) - - return (order, PayShippingRate.DeliveryRange(from: from, to: to)) - } -} - -#endif diff --git a/PayTests/PassKit+SummaryItemTests.swift b/PayTests/PassKit+SummaryItemTests.swift deleted file mode 100644 index 5d0e4eda..00000000 --- a/PayTests/PassKit+SummaryItemTests.swift +++ /dev/null @@ -1,47 +0,0 @@ -// -// PassKit+SummaryItemTests.swift -// PayTests -// -// Created by Shopify. -// Copyright (c) 2017 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. -// - -#if canImport(PassKit) - -import XCTest -@testable import Pay - -class PassKit_SummaryItemTests: XCTestCase { - - // ---------------------------------- - // MARK: - Init - - // - func testDecimalSummaryItem() { - let value: Decimal = 15.0 - let item = value.summaryItemNamed("TOTAL") - - XCTAssertEqual(item.label, "TOTAL") - XCTAssertEqual(item.amount, 15.0) - XCTAssertEqual(item.type, .final) - } -} - -#endif diff --git a/PayTests/PayAddressTests.swift b/PayTests/PayAddressTests.swift deleted file mode 100644 index 60d7025e..00000000 --- a/PayTests/PayAddressTests.swift +++ /dev/null @@ -1,205 +0,0 @@ -// -// PayAddressTests.swift -// PayTests -// -// Created by Shopify. -// Copyright (c) 2017 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 XCTest -@testable import Pay - -#if canImport(PassKit) -import PassKit -#endif - -@available(iOS 11.0, *) -class PayAddressTests: XCTestCase { - - // ---------------------------------- - // MARK: - Init - - // - func testInitPostalAddress() { - let address = PayPostalAddress( - city: "Brooklyn", - country: "United States", - countryCode: "US", - province: "NY", - zip: "11217" - ) - - XCTAssertEqual(address.city, "Brooklyn") - XCTAssertEqual(address.country, "United States") - XCTAssertEqual(address.province, "NY") - XCTAssertEqual(address.zip, "11217") - XCTAssertEqual(address.originalZip, "11217") - XCTAssertEqual(address.isPadded, false) - } - - func testInitPostalAddressInUnitedStates() { - let address = PayPostalAddress( - city: "Brooklyn", - country: "United States", - countryCode: "US", - province: "NY", - zip: "112" - ) - - XCTAssertEqual(address.city, "Brooklyn") - XCTAssertEqual(address.country, "United States") - XCTAssertEqual(address.province, "NY") - XCTAssertEqual(address.zip, "112") - XCTAssertEqual(address.originalZip, "112") - XCTAssertEqual(address.isPadded, false) - } - - func testInitPartialPostalAddressInCanada() { - let address = PayPostalAddress( - city: "Toronto", - country: "Canada", - countryCode: "CA", - province: "ON", - zip: "L5S " - ) - - XCTAssertEqual(address.city, "Toronto") - XCTAssertEqual(address.country, "Canada") - XCTAssertEqual(address.province, "ON") - XCTAssertEqual(address.zip, "L5S 0Z0") - XCTAssertEqual(address.originalZip, "L5S ") - XCTAssertEqual(address.isPadded, true) - } - - func testInitPartialPostalAddressInUnitedKingdom() { - let address = PayPostalAddress( - city: "London", - country: "United Kingdom", - countryCode: "gb", - province: "ON", - zip: "W1A" - ) - - XCTAssertEqual(address.city, "London") - XCTAssertEqual(address.country, "United Kingdom") - XCTAssertEqual(address.province, "ON") - XCTAssertEqual(address.zip, "W1A 0ZZ") - XCTAssertEqual(address.originalZip, "W1A") - XCTAssertEqual(address.isPadded, true) - } - - func testInitEmptyZipAddress() { - let address = PayPostalAddress( - city: "London", - country: "United Kingdom", - countryCode: nil, - province: "ON", - zip: nil - ) - - XCTAssertEqual(address.city, "London") - XCTAssertEqual(address.country, "United Kingdom") - XCTAssertEqual(address.province, "ON") - XCTAssertEqual(address.zip, nil) - XCTAssertEqual(address.originalZip, nil) - XCTAssertEqual(address.isPadded, false) - } - - func testInitAddress() { - let address = PayAddress( - addressLine1: "123 Lakeshore Blvd.", - addressLine2: "Unit 9876", - city: "Toronto", - country: "Canada", - province: "ON", - zip: "A1B 2C3", - firstName: "John", - lastName: "Smith", - phone: "1-123-456-7890", - email: "john.smith@gmail.com" - ) - - XCTAssertEqual(address.addressLine1, "123 Lakeshore Blvd.") - XCTAssertEqual(address.addressLine2, "Unit 9876") - XCTAssertEqual(address.city, "Toronto") - XCTAssertEqual(address.country, "Canada") - XCTAssertEqual(address.province, "ON") - XCTAssertEqual(address.zip, "A1B 2C3") - XCTAssertEqual(address.firstName, "John") - XCTAssertEqual(address.lastName, "Smith") - XCTAssertEqual(address.phone, "1-123-456-7890") - XCTAssertEqual(address.email, "john.smith@gmail.com") - } - - #if canImport(PassKit) - - // ---------------------------------- - // MARK: - CNPostalAddress - - // - func testInitFromPassKitAddress() { - let passKitAddress = Models.createPostalAddress() - let address = PayPostalAddress(with: passKitAddress) - - XCTAssertEqual(address.city, "Toronto") - XCTAssertEqual(address.country, "Canada") - XCTAssertEqual(address.province, "ON") - XCTAssertEqual(address.zip, "M5V 2J4") - XCTAssertEqual(address.originalZip, "M5V 2J4") - XCTAssertEqual(address.isPadded, false) - } - - // ---------------------------------- - // MARK: - PKContact - - // - func testInitFromPassKitContact() { - let contact = Models.createContact() - let postalAddress = contact.postalAddress!.mutableCopy() as! CNMutablePostalAddress - let address = PayAddress(with: contact) - - XCTAssertEqual(address.addressLine1, "80 Spadina") - XCTAssertEqual(address.addressLine2, nil) - XCTAssertEqual(address.city, "Toronto") - XCTAssertEqual(address.country, "Canada") - XCTAssertEqual(address.province, "ON") - XCTAssertEqual(address.zip, "M5V 2J4") - XCTAssertEqual(address.firstName, "John") - XCTAssertEqual(address.lastName, "Smith") - XCTAssertEqual(address.phone, "1234567890") - XCTAssertEqual(address.email, "john.smith@gmail.com") - - postalAddress.street = "123 Lakeshore Blvd\nUnit 987" - contact.postalAddress = postalAddress - - let address2 = PayAddress(with: contact) - - XCTAssertEqual(address2.addressLine1, "123 Lakeshore Blvd") - XCTAssertEqual(address2.addressLine2, "Unit 987") - - postalAddress.street = "" - contact.postalAddress = postalAddress - - let address3 = PayAddress(with: contact) - - XCTAssertEqual(address3.addressLine1, nil) - XCTAssertEqual(address3.addressLine2, nil) - } - - #endif -} diff --git a/PayTests/PayAuthorizationTests.swift b/PayTests/PayAuthorizationTests.swift deleted file mode 100644 index 99efb984..00000000 --- a/PayTests/PayAuthorizationTests.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// PayAuthorizationTests.swift -// PayTests -// -// Created by Shopify. -// Copyright (c) 2017 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. -// - -#if canImport(PassKit) - -import XCTest -@testable import Pay - -@available(iOS 11.0, *) -class PayAuthorizationTests: XCTestCase { - - // ---------------------------------- - // MARK: - Init - - // - func testInit() { - let paymentData = "123".data(using: .utf8)! - let address = Models.createAddress() - let rate = Models.createShippingRate() - let authorization = PayAuthorization( - paymentData: paymentData, - billingAddress: address, - shippingAddress: address, - shippingRate: rate - ) - - XCTAssertEqual(authorization.token, "123") - XCTAssertEqual(authorization.billingAddress.firstName, address.firstName) - XCTAssertEqual(authorization.shippingAddress.firstName, address.firstName) - XCTAssertEqual(authorization.shippingRate!.handle, rate.handle) - } -} - -#endif diff --git a/PayTests/PayCardBrandTests.swift b/PayTests/PayCardBrandTests.swift deleted file mode 100644 index 71832751..00000000 --- a/PayTests/PayCardBrandTests.swift +++ /dev/null @@ -1,73 +0,0 @@ -// -// PayCardBrandTests.swift -// PayTests -// -// Created by Shopify. -// Copyright (c) 2017 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. -// - -#if canImport(PassKit) - -import XCTest -import PassKit -@testable import Pay - -class PayCardBrandTests: XCTestCase { - - // ---------------------------------- - // MARK: - Init - - // - func testValues() { - XCTAssertEqual(PayCardBrand.visa.rawValue, "VISA") - XCTAssertEqual(PayCardBrand.masterCard.rawValue, "MASTERCARD") - XCTAssertEqual(PayCardBrand.discover.rawValue, "DISCOVER") - XCTAssertEqual(PayCardBrand.americanExpress.rawValue, "AMERICAN_EXPRESS") - XCTAssertEqual(PayCardBrand.dinersClub.rawValue, "DINERS_CLUB") - XCTAssertEqual(PayCardBrand.jcb.rawValue, "JCB") - } - - // ---------------------------------- - // MARK: - Conversion - - // - func testPaymentNetworkConversion() { - XCTAssertEqual(PayCardBrand.visa.paymentNetwork, .visa) - XCTAssertEqual(PayCardBrand.masterCard.paymentNetwork, .masterCard) - XCTAssertEqual(PayCardBrand.discover.paymentNetwork, .discover) - XCTAssertEqual(PayCardBrand.americanExpress.paymentNetwork, .amex) - XCTAssertEqual(PayCardBrand.dinersClub.paymentNetwork, nil) - XCTAssertEqual(PayCardBrand.jcb.paymentNetwork, .JCB) - } - - func testNetworksConversion() { - let cardBrands: [PayCardBrand] = [ - .visa, - .masterCard, - ] - - let networks = cardBrands.paymentNetworks - - XCTAssertEqual(networks.count, 2) - XCTAssertEqual(networks[0], .visa) - XCTAssertEqual(networks[1], .masterCard) - } -} - -#endif diff --git a/PayTests/PayCheckoutTests.swift b/PayTests/PayCheckoutTests.swift deleted file mode 100644 index 17e34123..00000000 --- a/PayTests/PayCheckoutTests.swift +++ /dev/null @@ -1,254 +0,0 @@ -// -// PayCheckoutTests.swift -// PayTests -// -// Created by Shopify. -// Copyright (c) 2017 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. -// - -#if canImport(PassKit) - -import XCTest -@testable import Pay - -@available(iOS 11.0, *) -class PayCheckoutTests: XCTestCase { - - private let shopName = "SHOPIFY" - - // ---------------------------------- - // MARK: - Init - - // - func testInit() { - let giftCard = Models.createGiftCard() - let discount = Models.createDiscount() - let shipping = Models.createShippingDiscount() - let address = Models.createAddress() - let rate = Models.createShippingRate() - let checkout = PayCheckout( - id: "123", - lineItems: [ - PayLineItem(price: 10.0, quantity: 1), - PayLineItem(price: 20.0, quantity: 1), - ], - giftCards: [giftCard], - discount: discount, - shippingDiscount: shipping, - shippingAddress: address, - shippingRate: rate, - currencyCode: "CAD", - totalDuties: 9.95, - subtotalPrice: 30.0, - needsShipping: true, - totalTax: 15.0, - paymentDue: 35.0 - ) - - XCTAssertEqual(checkout.id, "123") - XCTAssertEqual(checkout.lineItems.count, 2) - XCTAssertEqual(checkout.shippingAddress!.city, address.city) - XCTAssertEqual(checkout.shippingRate!.handle, rate.handle) - XCTAssertEqual(checkout.giftCards!.first!.amount, 5.00) - XCTAssertEqual(checkout.discount!.amount, 20.0) - XCTAssertEqual(checkout.shippingDiscount!.amount, 10.0) - XCTAssertEqual(checkout.currencyCode, "CAD") - XCTAssertEqual(checkout.subtotalPrice, 30.0) - XCTAssertEqual(checkout.totalDuties, 9.95) - XCTAssertEqual(checkout.needsShipping, true) - XCTAssertEqual(checkout.totalTax, 15.0) - XCTAssertEqual(checkout.paymentDue, 35.0) - } - - // ---------------------------------- - // MARK: - Summary Items - - // - func testSummaryItemsWithTaxes() { - let checkout = Models.createCheckout(requiresShipping: false) - let summaryItems = checkout.summaryItems(for: self.shopName) - - XCTAssertEqual(summaryItems.count, 4) - XCTAssertEqual(summaryItems[0].label, "CART TOTAL") - XCTAssertEqual(summaryItems[1].label, "SUBTOTAL") - XCTAssertEqual(summaryItems[2].label, "TAXES") - XCTAssertEqual(summaryItems[3].label, "SHOPIFY") - } - - func testSummaryItemsWithDuties() { - let checkout = Models.createCheckout(requiresShipping: false, duties: 24.99) - let summaryItems = checkout.summaryItems(for: self.shopName) - - XCTAssertEqual(summaryItems.count, 5) - XCTAssertEqual(summaryItems[0].label, "CART TOTAL") - XCTAssertEqual(summaryItems[1].label, "SUBTOTAL") - XCTAssertEqual(summaryItems[2].label, "DUTIES") - XCTAssertEqual(summaryItems[2].amount as Decimal, 24.99) - XCTAssertEqual(summaryItems[3].label, "TAXES") - XCTAssertEqual(summaryItems[4].label, "SHOPIFY") - } - - func testSummaryItemsWithDutiesAmountZero() { - let checkout = Models.createCheckout(requiresShipping: false, duties: 0) - let summaryItems = checkout.summaryItems(for: self.shopName) - - XCTAssertEqual(summaryItems.count, 5) - XCTAssertEqual(summaryItems[0].label, "CART TOTAL") - XCTAssertEqual(summaryItems[1].label, "SUBTOTAL") - XCTAssertEqual(summaryItems[2].label, "DUTIES") - XCTAssertEqual(summaryItems[2].amount as Decimal, 0) - XCTAssertEqual(summaryItems[3].label, "TAXES") - XCTAssertEqual(summaryItems[4].label, "SHOPIFY") - } - - func testSummaryItemsWithShipping() { - let address = Models.createAddress() - let rate = Models.createShippingRate() - let checkout = Models.createCheckout(requiresShipping: true, shippingAddress: address, shippingRate: rate) - let summaryItems = checkout.summaryItems(for: self.shopName) - - XCTAssertEqual(summaryItems.count, 5) - XCTAssertEqual(summaryItems[0].label, "CART TOTAL") - XCTAssertEqual(summaryItems[1].label, "SUBTOTAL") - XCTAssertEqual(summaryItems[2].label, "SHIPPING") - XCTAssertEqual(summaryItems[3].label, "TAXES") - XCTAssertEqual(summaryItems[4].label, "SHOPIFY") - } - - func testSummaryItemsWithoutTax() { - let checkout = Models.createCheckout(requiresShipping: false, hasTax: false) - let summaryItems = checkout.summaryItems(for: self.shopName) - - XCTAssertEqual(summaryItems.count, 3) - XCTAssertEqual(summaryItems[0].label, "CART TOTAL") - XCTAssertEqual(summaryItems[1].label, "SUBTOTAL") - XCTAssertEqual(summaryItems[2].label, "SHOPIFY") - } - - func testSummaryItemsWithGiftCard() { - let giftCards = [Models.createGiftCard()] - let checkout = Models.createCheckout(giftCards: giftCards, hasTax: false) - let summaryItems = checkout.summaryItems(for: self.shopName) - - XCTAssertEqual(summaryItems.count, 4) - XCTAssertEqual(summaryItems[0].label, "CART TOTAL") - XCTAssertEqual(summaryItems[1].label, "SUBTOTAL") - XCTAssertEqual(summaryItems[2].label, "GIFT CARD (•••• A1B2)") - XCTAssertEqual(summaryItems[3].label, "SHOPIFY") - - XCTAssertEqual(summaryItems[2].amount as Decimal, giftCards[0].amount.negative) - } - - func testSummaryItemsWithMultipleGiftCards() { - let giftCards = [ - Models.createGiftCard(), - Models.createGiftCardSecondary(), - ] - - let checkout = Models.createCheckout(giftCards: giftCards, hasTax: false) - let summaryItems = checkout.summaryItems(for: self.shopName) - - XCTAssertEqual(summaryItems.count, 4) - XCTAssertEqual(summaryItems[0].label, "CART TOTAL") - XCTAssertEqual(summaryItems[1].label, "SUBTOTAL") - XCTAssertEqual(summaryItems[2].label, "GIFT CARDS (2)") - XCTAssertEqual(summaryItems[3].label, "SHOPIFY") - - let totalGiftCards = giftCards.reduce(0) { $0 + $1.amount } - XCTAssertEqual(summaryItems[2].amount as Decimal, totalGiftCards.negative) - } - - func testSummaryItemsWithItemDiscount() { - let discount = Models.createDiscount() - let checkout = Models.createCheckout(requiresShipping: false, discount: discount, empty: true, hasTax: false) - var summaryItems = checkout.summaryItems(for: self.shopName) - - XCTAssertEqual(summaryItems.count, 4) - XCTAssertEqual(summaryItems[0].label, "CART TOTAL") - XCTAssertEqual(summaryItems[1].label, "DISCOUNT (WIN20)") - XCTAssertEqual(summaryItems[2].label, "SUBTOTAL") - XCTAssertEqual(summaryItems[3].label, "SHOPIFY") - - XCTAssertEqual(summaryItems[1].amount as Decimal, discount.amount.negative) - - let anonymousDiscount = Models.createAnonymousDiscount() - let checkout2 = Models.createCheckout(requiresShipping: false, discount: anonymousDiscount, empty: true, hasTax: false) - - summaryItems = checkout2.summaryItems(for: self.shopName) - - XCTAssertEqual(summaryItems[1].label, "DISCOUNT") - XCTAssertEqual(summaryItems[1].amount as Decimal, anonymousDiscount.amount.negative) - } - - func testSummaryItemsWithShippingDiscount() { - let discount = Models.createShippingDiscount() - let checkout = Models.createCheckout(requiresShipping: false, shippingDiscount: discount, empty: true, hasTax: false) - var summaryItems = checkout.summaryItems(for: self.shopName) - - XCTAssertEqual(summaryItems.count, 3) - XCTAssertEqual(summaryItems[0].label, "SUBTOTAL") - XCTAssertEqual(summaryItems[1].label, "DISCOUNT (FREESHIP)") - XCTAssertEqual(summaryItems[2].label, "SHOPIFY") - - XCTAssertEqual(summaryItems[1].amount as Decimal, discount.amount.negative) - - let anonymousDiscount = Models.createAnonymousShippingDiscount() - let checkout2 = Models.createCheckout(requiresShipping: false, shippingDiscount: anonymousDiscount, empty: true, hasTax: false) - - summaryItems = checkout2.summaryItems(for: self.shopName) - - XCTAssertEqual(summaryItems[1].label, "DISCOUNT") - XCTAssertEqual(summaryItems[1].amount as Decimal, anonymousDiscount.amount.negative) - } - - func testSummaryItemsFullyLoaded() { - let giftCards = [Models.createGiftCard()] - let discount = Models.createDiscount() - let shippingDiscount = Models.createShippingDiscount() - let address = Models.createAddress() - let shippingRate = Models.createShippingRate() - let checkout = Models.createCheckout( - requiresShipping: true, - giftCards: giftCards, - discount: discount, - shippingDiscount: shippingDiscount, - shippingAddress: address, - shippingRate: shippingRate, - empty: false, - hasTax: true - ) - let summaryItems = checkout.summaryItems(for: self.shopName) - - XCTAssertEqual(summaryItems.count, 8) - XCTAssertEqual(summaryItems[0].label, "CART TOTAL") - XCTAssertEqual(summaryItems[1].label, "DISCOUNT (WIN20)") - XCTAssertEqual(summaryItems[2].label, "SUBTOTAL") - XCTAssertEqual(summaryItems[3].label, "SHIPPING") - XCTAssertEqual(summaryItems[4].label, "DISCOUNT (FREESHIP)") - XCTAssertEqual(summaryItems[5].label, "TAXES") - XCTAssertEqual(summaryItems[6].label, "GIFT CARD (•••• A1B2)") - XCTAssertEqual(summaryItems[7].label, "SHOPIFY") - - XCTAssertEqual(summaryItems[1].amount as Decimal, discount.amount.negative) - XCTAssertEqual(summaryItems[4].amount as Decimal, shippingDiscount.amount.negative) - XCTAssertEqual(summaryItems[6].amount as Decimal, giftCards[0].amount.negative) - } -} - -#endif diff --git a/PayTests/PayCurrencyTests.swift b/PayTests/PayCurrencyTests.swift deleted file mode 100644 index d6786d36..00000000 --- a/PayTests/PayCurrencyTests.swift +++ /dev/null @@ -1,41 +0,0 @@ -// -// PayCurrencyTests.swift -// PayTests -// -// Created by Shopify. -// Copyright (c) 2017 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 XCTest -@testable import Pay - -class PayCurrencyTests: XCTestCase { - - // ---------------------------------- - // MARK: - Init - - // - func testInit() { - let currency = PayCurrency(currencyCode: "CAD", countryCode: "CA") - - XCTAssertEqual(currency.currencyCode, "CAD") - XCTAssertEqual(currency.countryCode, "CA") - } -} diff --git a/PayTests/PayDiscountTests.swift b/PayTests/PayDiscountTests.swift deleted file mode 100644 index b1032cb3..00000000 --- a/PayTests/PayDiscountTests.swift +++ /dev/null @@ -1,41 +0,0 @@ -// -// PayDiscountTests.swift -// PayTests -// -// Created by Shopify. -// Copyright (c) 2017 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 XCTest -@testable import Pay - -class PayDiscountTests: XCTestCase { - - // ---------------------------------- - // MARK: - Init - - // - func testInit() { - let discount = PayDiscount(code: "WINBIG", amount: 5.0) - - XCTAssertEqual(discount.code, "WINBIG") - XCTAssertEqual(discount.amount, 5.0) - } -} diff --git a/PayTests/PayLineItemTests.swift b/PayTests/PayLineItemTests.swift deleted file mode 100644 index b2c01080..00000000 --- a/PayTests/PayLineItemTests.swift +++ /dev/null @@ -1,55 +0,0 @@ -// -// PayLineItemTests.swift -// PayTests -// -// Created by Shopify. -// Copyright (c) 2017 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 XCTest -@testable import Pay - -class PayLineItemTests: XCTestCase { - - // ---------------------------------- - // MARK: - Init - - // - func testInit() { - let item = PayLineItem(price: 10.0, quantity: 2) - - XCTAssertEqual(item.price, 10.0) - XCTAssertEqual(item.quantity, 2) - } - - // ---------------------------------- - // MARK: - Collection Total - - // - func testCollectionTotalPrice() { - let items = [ - PayLineItem(price: 10.0, quantity: 1), - PayLineItem(price: 5.0, quantity: 5), - PayLineItem(price: 12.0, quantity: 3), - PayLineItem(price: 10.0, quantity: 0), - ] - - XCTAssertEqual(items.totalPrice, 71.0) - } -} diff --git a/PayTests/PaySessionTests.swift b/PayTests/PaySessionTests.swift deleted file mode 100644 index fc0267c8..00000000 --- a/PayTests/PaySessionTests.swift +++ /dev/null @@ -1,594 +0,0 @@ -// -// PaySessionTests.swift -// PayTests -// -// Created by Shopify. -// Copyright (c) 2017 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. -// - -#if canImport(PassKit) - -import XCTest -import PassKit -@testable import Pay - -@available(iOS 11.0, *) -class PaySessionTests: XCTestCase { - - private let shopName = "Jaded Labs" - - // ---------------------------------- - // MARK: - Init - - // - func testInit() { - let checkout = Models.createCheckout() - let currency = Models.createCurrency() - let session = PaySession(shopName: shopName, checkout: checkout, currency: currency, merchantID: "some-id") - - XCTAssertEqual(session.merchantID, "some-id") - XCTAssertEqual(session.currency.countryCode, currency.countryCode) - - XCTAssertFalse(session.identifier.isEmpty) - } - - func testDeprecatedInit() { - let checkout = Models.createCheckout() - let currency = Models.createCurrency() - let session = PaySession(checkout: checkout, currency: currency, merchantID: "some-id") - - XCTAssertEqual(session.shopName, "TOTAL") - } - - func testUniqueIdentifier() { - let checkout = Models.createCheckout() - let currency = Models.createCurrency() - - let session1 = Models.createSession(checkout: checkout, currency: currency) - let session2 = Models.createSession(checkout: checkout, currency: currency) - let session3 = Models.createSession(checkout: checkout, currency: currency) - - XCTAssertNotEqual(session1.identifier, session2.identifier) - XCTAssertNotEqual(session2.identifier, session3.identifier) - } - - // ---------------------------------- - // MARK: - Payment Request - - // - func testPaymentRequest() { - let checkout = Models.createCheckout() - let currency = Models.createCurrency() - let session = Models.createSession(checkout: checkout, currency: currency) - - let digitalCheckout = Models.createCheckout(requiresShipping: false) - let digitalRequest = session.paymentRequestUsing(digitalCheckout, currency: currency, merchantID: session.merchantID) - - XCTAssertEqual(digitalRequest.countryCode, currency.countryCode) - XCTAssertEqual(digitalRequest.currencyCode, currency.currencyCode) - XCTAssertEqual(digitalRequest.merchantIdentifier, session.merchantID) - XCTAssertEqual(digitalRequest.requiredBillingAddressFields, [.all]) - XCTAssertEqual(digitalRequest.requiredShippingAddressFields, [.all]) - XCTAssertEqual(digitalRequest.supportedNetworks, [.visa, .masterCard, .amex]) - XCTAssertEqual(digitalRequest.merchantCapabilities, [.capability3DS]) - XCTAssertFalse(digitalRequest.paymentSummaryItems.isEmpty) - - let shippingCheckout = Models.createCheckout(requiresShipping: true) - let shippingRequest = session.paymentRequestUsing(shippingCheckout, currency: currency, merchantID: session.merchantID) - - XCTAssertEqual(shippingRequest.requiredShippingAddressFields, [.all]) - } - - // ---------------------------------- - // MARK: - Payment Authorization - - // - func testPaymentAuthorization() { - - let contact = Models.createContact() - let shippingRate = Models.createShippingRate() - - let payMethod = MockPaymentMethod(displayName: "John's Mastercard", network: .masterCard, type: .credit) - let token = MockPaymentToken(paymentMethod: payMethod) - let payment = MockPayment(token: token, billingContact: contact, shippingContact: contact, shippingMethod: shippingRate.summaryItem) - - let checkout = Models.createCheckout(requiresShipping: true) - let delegate = self.setupDelegateForMockSessionWith(checkout) { session in - session.shippingRates = [ - shippingRate - ] - } - - /* ------------------- - ** Success invocation - */ - delegate.didAuthorizePayment = { session, authorization, checkout, complete in - - let tokenString = String(data: token.paymentData, encoding: .utf8) - XCTAssertEqual(authorization.token, tokenString) - XCTAssertEqual(authorization.billingAddress.city, contact.postalAddress!.city) - XCTAssertEqual(authorization.shippingAddress.city, contact.postalAddress!.city) - - XCTAssertNotNil(authorization.shippingRate) - XCTAssertEqual(authorization.shippingRate!.handle, shippingRate.handle) - - complete(.success) - } - - let expectationSuccess = self.expectation(description: "") - - MockAuthorizationController.invokeDidAuthorizePayment(payment) { status in - XCTAssertEqual(status, .success) - expectationSuccess.fulfill() - } - - self.wait(for: [expectationSuccess], timeout: 10.0) - - /* ------------------- - ** Failure invocation - */ - delegate.didAuthorizePayment = { session, authorization, checkout, complete in - complete(.failure) - } - - let expectationFailure = self.expectation(description: "") - - MockAuthorizationController.invokeDidAuthorizePayment(payment) { status in - XCTAssertEqual(status, .failure) - expectationFailure.fulfill() - } - - self.wait(for: [expectationFailure], timeout: 10.0) - } - - // ---------------------------------- - // MARK: - Select Shipping Contact - - // - func testSelectShippingContactWithInvalidAddress() { - - let checkout = Models.createCheckout(requiresShipping: true) - let delegate = self.setupDelegateForMockSessionWith(checkout) - - delegate.didRequestShippingRates = { session, postalAddress, checkout, provide in - XCTFail() - } - - let expectation = self.expectation(description: "") - - MockAuthorizationController.invokeDidSelectShippingContact(PKContact()) { status, shippingMethods, summaryItems in - XCTAssertEqual(status, .invalidShippingPostalAddress) - XCTAssertEqual(shippingMethods, []) - XCTAssertEqual(summaryItems, checkout.summaryItems(for: self.shopName)) - - expectation.fulfill() - } - - self.wait(for: [expectation], timeout: 10.0) - } - - func testSelectShippingContactWithEmptyRates() { - - let checkout = Models.createCheckout(requiresShipping: true) - let delegate = self.setupDelegateForMockSessionWith(checkout) - - let shippingContact = Models.createContact() - let invalidExpectation = self.expectation(description: "") - - delegate.didRequestShippingRates = { session, postalAddress, checkout, provide in - invalidExpectation.fulfill() - provide(checkout, []) - } - - let expectation = self.expectation(description: "") - - MockAuthorizationController.invokeDidSelectShippingContact(shippingContact) { status, shippingMethods, summaryItems in - XCTAssertEqual(status, .invalidShippingPostalAddress) - XCTAssertEqual(shippingMethods, []) - XCTAssertEqual(summaryItems, checkout.summaryItems(for: self.shopName)) - - expectation.fulfill() - } - - self.wait(for: [invalidExpectation, expectation], timeout: 0) - } - - func testSelectShippingContact() { - - let checkout = Models.createCheckout(requiresShipping: true) - let delegate = self.setupDelegateForMockSessionWith(checkout) - - let shippingContact = Models.createContact() - let shippingAddress = Models.createAddress() - let shippingRate = Models.createShippingRate() - let addressCheckout = Models.createCheckout(shippingAddress: shippingAddress) - let shippingCheckout = Models.createCheckout(shippingRate: shippingRate) - - let e1 = self.expectation(description: "") - delegate.didRequestShippingRates = { session, postalAddress, checkout, provide in - e1.fulfill() - - XCTAssertNil(checkout.shippingAddress) - XCTAssertNil(checkout.shippingRate) - - provide(addressCheckout, [shippingRate]) - } - - let e2 = self.expectation(description: "") - delegate.didSelectShippingRate = { session, shippingRate, checkout, provide in - e2.fulfill() - - XCTAssertNotNil(checkout.shippingAddress) - XCTAssertNil(checkout.shippingRate) - - provide(shippingCheckout) - } - - let expectation = self.expectation(description: "") - - MockAuthorizationController.invokeDidSelectShippingContact(shippingContact) { status, shippingMethods, summaryItems in - - XCTAssertEqual(status, .success) - XCTAssertEqual(shippingMethods.count, 1) - XCTAssertEqual(summaryItems, shippingCheckout.summaryItems(for: self.shopName)) - - expectation.fulfill() - } - - self.wait(for: [e1, e2, expectation], timeout: 0) - } - - func testSelectShippingContactWithoutShippingSuccess() { - - let checkout = Models.createCheckout(requiresShipping: false) - let delegate = self.setupDelegateForMockSessionWith(checkout) - - let shippingContact = Models.createContact() - let shippingAddress = Models.createAddress() - let addressCheckout = Models.createCheckout(requiresShipping: false, shippingAddress: shippingAddress) - - let e1 = self.expectation(description: "") - delegate.didUpdateShippingAddress = { session, postalAddress, checkout, provide in - e1.fulfill() - - XCTAssertNil(checkout.shippingAddress) - - provide(addressCheckout) - } - - let expectation = self.expectation(description: "") - - MockAuthorizationController.invokeDidSelectShippingContact(shippingContact) { status, shippingMethods, summaryItems in - - XCTAssertEqual(status, .success) - XCTAssertEqual(shippingMethods.count, 0) - XCTAssertEqual(summaryItems, checkout.summaryItems(for: self.shopName)) - - expectation.fulfill() - } - - self.wait(for: [e1, expectation], timeout: 0) - } - - func testSelectShippingContactWithoutShippingFailure() { - - let checkout = Models.createCheckout(requiresShipping: false) - let delegate = self.setupDelegateForMockSessionWith(checkout) - - let shippingContact = Models.createContact() - - let e1 = self.expectation(description: "") - delegate.didUpdateShippingAddress = { session, postalAddress, checkout, provide in - e1.fulfill() - - XCTAssertNil(checkout.shippingAddress) - - provide(nil) - } - - let expectation = self.expectation(description: "") - - MockAuthorizationController.invokeDidSelectShippingContact(shippingContact) { status, shippingMethods, summaryItems in - - XCTAssertEqual(status, .failure) - XCTAssertTrue(shippingMethods.isEmpty) - XCTAssertTrue(summaryItems.isEmpty) - - expectation.fulfill() - } - - self.wait(for: [e1, expectation], timeout: 0) - } - - func testSelectShippingContactFailure() { - - let checkout = Models.createCheckout(requiresShipping: true) - let delegate = self.setupDelegateForMockSessionWith(checkout) - - let shippingContact = Models.createContact() - let shippingAddress = Models.createAddress() - let shippingRate = Models.createShippingRate() - let addressCheckout = Models.createCheckout(shippingAddress: shippingAddress) - - let e1 = self.expectation(description: "") - delegate.didRequestShippingRates = { session, postalAddress, checkout, provide in - e1.fulfill() - provide(addressCheckout, [shippingRate]) - } - - let e2 = self.expectation(description: "") - delegate.didSelectShippingRate = { session, shippingRate, checkout, provide in - e2.fulfill() - - XCTAssertNotNil(checkout.shippingAddress) - XCTAssertNil(checkout.shippingRate) - - provide(nil) - } - - let expectation = self.expectation(description: "") - - MockAuthorizationController.invokeDidSelectShippingContact(shippingContact) { status, shippingMethods, summaryItems in - - XCTAssertEqual(status, .failure) - XCTAssertTrue(shippingMethods.isEmpty) - XCTAssertTrue(summaryItems.isEmpty) - - expectation.fulfill() - } - - self.wait(for: [e1, e2, expectation], timeout: 0) - } - - // ---------------------------------- - // MARK: - Select Shipping Method - - // - func testSelectShippingMethodWithoutShippingRates() { - - let checkout = Models.createCheckout(requiresShipping: true) - let delegate = self.setupDelegateForMockSessionWith(checkout) - - delegate.didSelectShippingRate = { session, shippingRate, checkout, provide in - XCTFail() - } - - let shippingRate = Models.createShippingRate() - let shippingMethod = shippingRate.summaryItem - - let expectation = self.expectation(description: "") - - MockAuthorizationController.invokeDidSelectShippingMethod(shippingMethod) { status, summaryItems in - XCTAssertEqual(status, .failure) - XCTAssertEqual(summaryItems, checkout.summaryItems(for: self.shopName)) - - expectation.fulfill() - } - - self.wait(for: [expectation], timeout: 10.0) - } - - func testSelectShippingMethodWithNilCheckout() { - - let shippingRate = Models.createShippingRate() - let shippingMethod = shippingRate.summaryItem - - let checkout = Models.createCheckout(requiresShipping: true) - let delegate = self.setupDelegateForMockSessionWith(checkout) { session in - - session.checkout = checkout - session.shippingRates = [ - shippingRate - ] - } - - delegate.didSelectShippingRate = { session, selectedShippingRate, checkoutToUpdate, provide in - provide(nil) - } - - let expectation = self.expectation(description: "") - - MockAuthorizationController.invokeDidSelectShippingMethod(shippingMethod) { status, summaryItems in - XCTAssertEqual(status, .failure) - XCTAssertTrue(summaryItems.isEmpty) - - expectation.fulfill() - } - - self.wait(for: [expectation], timeout: 10.0) - } - - func testSelectShippingMethod() { - - let shippingRate = Models.createShippingRate() - let shippingMethod = shippingRate.summaryItem - - let checkout = Models.createCheckout(requiresShipping: true) - let delegate = self.setupDelegateForMockSessionWith(checkout) { session in - - session.checkout = checkout - session.shippingRates = [ - shippingRate - ] - } - - let updatedCheckout = Models.createCheckout( - requiresShipping: true, - shippingRate: shippingRate - ) - - delegate.didSelectShippingRate = { session, selectedShippingRate, checkoutToUpdate, provide in - provide(updatedCheckout) - } - - XCTAssertNil(checkout.shippingRate) - - let expectation = self.expectation(description: "") - - MockAuthorizationController.invokeDidSelectShippingMethod(shippingMethod) { status, summaryItems in - XCTAssertEqual(status, .success) - XCTAssertEqual(updatedCheckout.summaryItems(for: self.shopName), summaryItems) - - expectation.fulfill() - } - - self.wait(for: [expectation], timeout: 10.0) - } - - // ---------------------------------- - // MARK: - Payment Authorization - - // - func testAuthorizationFinished() { - - let checkout = Models.createCheckout(requiresShipping: true) - let delegate = self.setupDelegateForMockSessionWith(checkout) - let expectation = self.expectation(description: "") - - delegate.didFinish = { session in - expectation.fulfill() - } - MockAuthorizationController.invokeDidFinish() - - self.wait(for: [expectation], timeout: 10) - } - - // ---------------------------------- - // MARK: - iOS 11 Support - - // - @available(iOS 11.0, *) - func testSessionForwardsShippingContact() { - let checkout = Models.createCheckout(requiresShipping: true) - let session = Models.createSession(checkout: checkout, currency: Models.createCurrency()) - - let shippingContact = Models.createContact() - let shippingMethods = [Models.createShippingMethod()] - let summaryItems = checkout.summaryItems(for: self.shopName) - - let e2 = self.expectation(description: "") - session.didSelectShippingContactHandler = { controller, contact, handler in - XCTAssertTrue(contact === shippingContact) - e2.fulfill() - return .unhandled - } - - let e1 = self.expectation(description: "") - session.didSelectShippingContact = { controller, contact, completion in - completion(.success, shippingMethods, summaryItems) - e1.fulfill() - return .handled - } - - session.authorize() - - let e3 = self.expectation(description: "") - MockAuthorizationController.invokeDidSelectShippingContactHandler(shippingContact) { result in - - XCTAssertEqual(result.status, .success) - XCTAssertEqual(result.shippingMethods, shippingMethods) - XCTAssertEqual(result.paymentSummaryItems, summaryItems) - - e3.fulfill() - } - - self.wait(for: [e1, e2, e3], timeout: 2.0) - } - - @available(iOS 11.0, *) - func testSessionForwardsShippingMethod() { - - let shippingMethod = Models.createShippingMethod() - let checkout = Models.createCheckout(requiresShipping: true, shippingRate: Models.createShippingRate()) - let session = Models.createSession(checkout: checkout, currency: Models.createCurrency()) - let summaryItems = checkout.summaryItems(for: self.shopName) - - let e2 = self.expectation(description: "") - session.didSelectShippingMethodHandler = { controller, method, handler in - XCTAssertTrue(method === shippingMethod) - e2.fulfill() - return .unhandled - } - - let e1 = self.expectation(description: "") - session.didSelectShippingMethod = { controller, shippingMethod, completion in - completion(.success, summaryItems) - e1.fulfill() - return .handled - } - - session.authorize() - - let e3 = self.expectation(description: "") - MockAuthorizationController.invokeDidSelectShippingMethodHandler(shippingMethod) { result in - XCTAssertEqual(result.status, .success) - XCTAssertEqual(result.paymentSummaryItems, summaryItems) - e3.fulfill() - } - - self.wait(for: [e1, e2, e3], timeout: 2.0) - } - - @available(iOS 11.0, *) - func testSessionForwardsAuthorizedPayment() { - - let checkout = Models.createCheckout(requiresShipping: true, shippingRate: Models.createShippingRate()) - let session = Models.createSession(checkout: checkout, currency: Models.createCurrency()) - - let method = MockPaymentMethod(displayName: "Test Payment", network: .amex, type: .credit) - let token = MockPaymentToken(paymentMethod: method) - let payment = MockPayment(token: token) - - let e2 = self.expectation(description: "") - session.didAuthorizePaymentHandler = { controller, currentPayment, handler in - XCTAssertTrue(currentPayment === payment) - e2.fulfill() - return .unhandled - } - - let e1 = self.expectation(description: "") - session.didAuthorizePayment = { controller, payment, completion in - completion(.success) - e1.fulfill() - return .handled - } - - session.authorize() - - let e3 = self.expectation(description: "") - MockAuthorizationController.invokeDidAuthorizePaymentHandler(payment) { result in - XCTAssertEqual(result.status, .success) - e3.fulfill() - } - - self.wait(for: [e1, e2, e3], timeout: 2.0) - } - - // ---------------------------------- - // MARK: - Session Delegate - - // - private func setupDelegateForMockSessionWith(_ checkout: PayCheckout, configure: ((PaySession) -> Void)? = nil) -> MockSessionDelegate { - let currency = Models.createCurrency() - let session = Models.createSession(checkout: checkout, currency: currency) - let delegate = MockSessionDelegate(session: session) - - configure?(session) - - session.authorize() - - return delegate - } -} - -#endif diff --git a/PayTests/PayShippingRateTests.swift b/PayTests/PayShippingRateTests.swift deleted file mode 100644 index 142fcf2e..00000000 --- a/PayTests/PayShippingRateTests.swift +++ /dev/null @@ -1,135 +0,0 @@ -// -// PayShippingRateTests.swift -// PayTests -// -// Created by Shopify. -// Copyright (c) 2017 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. -// - -#if canImport(PassKit) - -import XCTest -import PassKit -@testable import Pay - -@available(iOS 11.0, *) -class PayShippingRateTests: XCTestCase { - - // ---------------------------------- - // MARK: - Init - - // - func testShippingRateInit() { - let range = Models.createDeliveryRangeFromSingle().range - let rate = PayShippingRate(handle: "abc-123", title: "UPS", price: 15.0, deliveryRange: range) - - XCTAssertEqual(rate.handle, "abc-123") - XCTAssertEqual(rate.title, "UPS") - XCTAssertEqual(rate.price, 15.0) - XCTAssertEqual(rate.deliveryRange!.from, range.from) - XCTAssertEqual(rate.deliveryRange!.to, range.to) - } - - // ---------------------------------- - // MARK: - Delivery Range - - // - func testDeliveryRangeSingle() { - let result = Models.createDeliveryRangeFromSingle() - let date = result.orderDate - let range = result.range - - let description = range.descriptionFrom(date) - - XCTAssertNotNil(range.from) - XCTAssertNil(range.to) - XCTAssertEqual(description, "1 day") - } - - func testDeliveryRangeMulti() { - let result = Models.createDeliveryRangeFromMulti() - let date = result.orderDate - let range = result.range - - let description = range.descriptionFrom(date) - - XCTAssertNotNil(range.from) - XCTAssertNil(range.to) - XCTAssertEqual(description, "2 days") - } - - func testDeliveryRange() { - let result = Models.createDeliveryRange() - let date = result.orderDate - let range = result.range - - let description = range.descriptionFrom(date) - - XCTAssertNotNil(range.from) - XCTAssertNotNil(range.to) - XCTAssertEqual(description, "1 - 6 days") - } - - // ---------------------------------- - // MARK: - PassKit - - // - func testSummaryItem() { - let rate = Models.createShippingRate() - let item = rate.summaryItem - - XCTAssertEqual(item.label, "UPS Standard") - XCTAssertEqual(item.amount, 12.0 as NSDecimalNumber) - XCTAssertEqual(item.identifier, "shipping-rate") - XCTAssertEqual(item.detail, "No delivery estimate provided.") - } - - func testSummaryItemWithDeliveryRange() { - let tomorrow = Date(timeIntervalSince1970: Date().timeIntervalSince1970 + 86400) - let range = PayShippingRate.DeliveryRange(from: tomorrow) - let rate = PayShippingRate(handle: "shipping-rate", title: "UPS Standard", price: 12.0, deliveryRange: range) - let item = rate.summaryItem - - XCTAssertEqual(item.label, "UPS Standard") - XCTAssertEqual(item.amount, 12.0 as NSDecimalNumber) - XCTAssertEqual(item.identifier, "shipping-rate") - XCTAssertEqual(item.detail, "1 day") - } - - func testSummaryItemsCollection() { - let rates = Models.createShippingRates() - let items = rates.summaryItems - - XCTAssertEqual(items.count, 3) - XCTAssertEqual(items[0].identifier, rates[0].handle) - XCTAssertEqual(items[1].identifier, rates[1].handle) - XCTAssertEqual(items[2].identifier, rates[2].handle) - } - - func testFindShippingRateForMethod() { - let rates = Models.createShippingRates() - let method = Models.createShippingMethod(identifier: "234") - - let rate = rates.shippingRateFor(method) - - XCTAssertNotNil(rate) - XCTAssertEqual(rate!.handle, "234") - } -} - -#endif diff --git a/Scripts/test_pay b/Scripts/test_pay deleted file mode 100755 index 6ce5f79c..00000000 --- a/Scripts/test_pay +++ /dev/null @@ -1,11 +0,0 @@ - #!/usr/bin/env bash - -set -ex -set -eo pipefail - -xcodebuild test \ --project "Buy.xcodeproj" \ --scheme "Pay" \ --sdk iphonesimulator \ --destination "id=$CURRENT_SIMULATOR_UUID" \ - | xcpretty -c From 472b27bae893a0688c8c21dbb654ba891826f036 Mon Sep 17 00:00:00 2001 From: Jonathan Baker Date: Thu, 11 Jul 2024 18:38:22 -0400 Subject: [PATCH 4/8] Fix build action commit email. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1482d488..cd49d79f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,9 +38,9 @@ jobs: echo "Generating schema for $API_VERSION" ./Scripts/build $API_VERSION git add ./Buy/Generated - git config user.name github-actions - git config user.email github-actions@github.com - git commit -m "Update schema (auto-generated)" + git config user.name "${GITHUB_ACTOR}" + git config user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" + git commit -m "Update schema for `${API_VERSION}` version." git push --set-upstream --force origin $BRANCH_NAME - name: Create pull request From 640a45d6f50aefe73c698cad222c5f653687641b Mon Sep 17 00:00:00 2001 From: Jonathan Baker Date: Thu, 11 Jul 2024 18:44:39 -0400 Subject: [PATCH 5/8] Remove defunct `docs/` folder and references. --- Buy.xcodeproj/project.pbxproj | 65 ---------------- .../xcschemes/Documentation.xcscheme | 76 ------------------- Docs/.buy.yml | 28 ------- Docs/.pay.yml | 33 -------- Docs/gen | 38 ---------- README.md | 6 -- 6 files changed, 246 deletions(-) delete mode 100644 Buy.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme delete mode 100644 Docs/.buy.yml delete mode 100644 Docs/.pay.yml delete mode 100755 Docs/gen diff --git a/Buy.xcodeproj/project.pbxproj b/Buy.xcodeproj/project.pbxproj index 0420566f..ad6d288d 100644 --- a/Buy.xcodeproj/project.pbxproj +++ b/Buy.xcodeproj/project.pbxproj @@ -6,20 +6,6 @@ objectVersion = 46; objects = { -/* Begin PBXAggregateTarget section */ - 9A0C80C51EAE73840020F187 /* Documentation */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 9A0C80C81EAE73840020F187 /* Build configuration list for PBXAggregateTarget "Documentation" */; - buildPhases = ( - 9A0C80C91EAE738D0020F187 /* ShellScript */, - ); - dependencies = ( - ); - name = Documentation; - productName = Documentation; - }; -/* End PBXAggregateTarget section */ - /* Begin PBXBuildFile section */ 2121506325A8C6C600191C61 /* ProductMediaSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2121506225A8C6C600191C61 /* ProductMediaSortKeys.swift */; }; 2121506425A8C6C600191C61 /* ProductMediaSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2121506225A8C6C600191C61 /* ProductMediaSortKeys.swift */; }; @@ -2255,11 +2241,6 @@ LastUpgradeCheck = 1200; ORGANIZATIONNAME = "Shopify Inc."; TargetAttributes = { - 9A0C80C51EAE73840020F187 = { - CreatedOnToolsVersion = 8.3.1; - DevelopmentTeam = A7XGC83MZE; - ProvisioningStyle = Automatic; - }; 9AC2EF371F6818180037E0D7 = { ProvisioningStyle = Automatic; }; @@ -2295,7 +2276,6 @@ 9AF255B11F6FEE50005BB0C9 /* Buy tvOS */, 9AC2EF371F6818180037E0D7 /* Buy watchOS */, 9AFA38E91E64850A0056C5AA /* BuyTests */, - 9A0C80C51EAE73840020F187 /* Documentation */, ); }; /* End PBXProject section */ @@ -2331,26 +2311,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - 9A0C80C91EAE738D0020F187 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "$(SRCROOT)/Pay/", - "$(SRCROOT)/Buy/", - ); - outputPaths = ( - "$(SRCROOT)/Docs/Docsets/Buy.docset/", - "$(SRCROOT)/Docs/Docsets/Pay.docset/", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Docs/gen\"\n"; - }; -/* End PBXShellScriptBuildPhase section */ - /* Begin PBXSourcesBuildPhase section */ 9AC2EF381F6818180037E0D7 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -3527,22 +3487,6 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 9A0C80C61EAE73840020F187 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEVELOPMENT_TEAM = A7XGC83MZE; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 9A0C80C71EAE73840020F187 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - DEVELOPMENT_TEAM = A7XGC83MZE; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; 9AC2EFC61F6818180037E0D7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -3842,15 +3786,6 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 9A0C80C81EAE73840020F187 /* Build configuration list for PBXAggregateTarget "Documentation" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 9A0C80C61EAE73840020F187 /* Debug */, - 9A0C80C71EAE73840020F187 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 9AC2EFC51F6818180037E0D7 /* Build configuration list for PBXNativeTarget "Buy watchOS" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Buy.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme b/Buy.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme deleted file mode 100644 index a704a49b..00000000 --- a/Buy.xcodeproj/xcshareddata/xcschemes/Documentation.xcscheme +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Docs/.buy.yml b/Docs/.buy.yml deleted file mode 100644 index 84087f94..00000000 --- a/Docs/.buy.yml +++ /dev/null @@ -1,28 +0,0 @@ -source_directory: .. -module: Buy -author: Shopify Inc. -github_url: https://github.com/Shopify/mobile-buy-sdk-ios -exclude: - - "**/Generated/*.swift" - -theme: fullwidth -output: Buy -docset_path: ../Docsets/Buy.docset - -clean: true -disable_search: true -skip_undocumented: true - -xcodebuild_arguments: - - -scheme - - Buy - -custom_categories: - - name: Graph - children: - - Graph - - - name: Client Handlers - children: - - MutationCompletion - - QueryCompletion diff --git a/Docs/.pay.yml b/Docs/.pay.yml deleted file mode 100644 index 1b900b3d..00000000 --- a/Docs/.pay.yml +++ /dev/null @@ -1,33 +0,0 @@ -source_directory: .. -module: Pay -author: Shopify Inc. -github_url: https://github.com/Shopify/mobile-buy-sdk-ios - -theme: fullwidth -output: Pay -docset_path: ../Docsets/Pay.docset - -clean: true -disable_search: true -skip_undocumented: true - -xcodebuild_arguments: - - -scheme - - Pay - -custom_categories: - - name: Session - children: - - PaySession - - PaySessionDelegate - - - name: Models - children: - - PayAddress - - PayAuthorization - - PayCheckout - - PayCurrency - - PayDiscount - - PayLineItem - - PayPostalAddress - - PayShippingRate diff --git a/Docs/gen b/Docs/gen deleted file mode 100755 index 9092d0c9..00000000 --- a/Docs/gen +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -if hash jazzy 2>/dev/null -then - - BUY_YML="./Docs/.buy.yml" - PAY_YML="./Docs/.pay.yml" - - README_PATH="./README.md" - BACKUP_PATH="./README.md.backup" - - # Backup the readme file - # ###################### - - cp $README_PATH $BACKUP_PATH - - # Find and replace code blocks - # ############################ - - sed -i "" -e 's/```[a-zA-Z0-9]*/```/g' $README_PATH - - # Invoke Jazzy doc generation - # ########################### - - jazzy --config $BUY_YML - jazzy --config $PAY_YML - - # Revert README changes - # ##################### - - rm $README_PATH - mv $BACKUP_PATH $README_PATH - -else - echo "Jazzy is not installed." - echo "Install by running: gem install jazzy" - exit 1 -fi diff --git a/README.md b/README.md index ce27183c..8c820390 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,6 @@ The Mobile Buy SDK makes it easy to create custom storefronts in your mobile app. The SDK connects to the Shopify platform using the Storefront GraphQL API and supports a wide range of native storefront experiences. -### Documentation - -You can generate complete `.html` and `.docset` documentation by running the `Documentation` scheme. You can then use a documentation browser like [Dash](https://kapeli.com/dash) to access the `.docset` artifact, or browse the HTML directly in the `Docs/Buy` and `Docs/Pay` directories. - -The documentation is generated using [Jazzy](https://github.com/realm/jazzy). - ## Installation Download the latest version From 674845c7ef1eabec59f6b7d2f05b6e0033209c5c Mon Sep 17 00:00:00 2001 From: Jonathan Baker Date: Thu, 11 Jul 2024 18:47:16 -0400 Subject: [PATCH 6/8] Bump Version: 13.0.0 --- Buy/Info.plist | 2 +- Buy/Utilities/SDK.swift | 2 +- BuyTests/Info.plist | 2 +- Mobile-Buy-SDK.podspec | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Buy/Info.plist b/Buy/Info.plist index 0e3cb91e..b8646cb8 100644 --- a/Buy/Info.plist +++ b/Buy/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 12.1.0 + 13.0.0 CFBundleVersion $(CURRENT_PROJECT_VERSION) NSPrincipalClass diff --git a/Buy/Utilities/SDK.swift b/Buy/Utilities/SDK.swift index 70759f35..918f921b 100644 --- a/Buy/Utilities/SDK.swift +++ b/Buy/Utilities/SDK.swift @@ -27,5 +27,5 @@ import Foundation internal enum SDK { - static let version = "12.1.0" + static let version = "13.0.0" } diff --git a/BuyTests/Info.plist b/BuyTests/Info.plist index 2c4e8817..5b5aa45b 100644 --- a/BuyTests/Info.plist +++ b/BuyTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 12.1.0 + 13.0.0 CFBundleVersion 1 diff --git a/Mobile-Buy-SDK.podspec b/Mobile-Buy-SDK.podspec index 040de31a..a1ee362a 100644 --- a/Mobile-Buy-SDK.podspec +++ b/Mobile-Buy-SDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = 'Mobile-Buy-SDK' - s.version = '12.1.0' + s.version = '13.0.0' s.summary = 'Create custom Shopify storefront on iOS.' s.description = 'Shopify’s Mobile Buy SDK makes it simple to create custom storefronts in your mobile app. Utitlizing the power and flexibility of GraphQL you can build native storefront experiences using the Shopify platform.' s.homepage = 'https://github.com/Shopify/mobile-buy-sdk-ios' From be7e82a8a757d487c8e571c1276786ff1ffd51b5 Mon Sep 17 00:00:00 2001 From: Jonathan Baker Date: Tue, 16 Jul 2024 08:27:18 -0400 Subject: [PATCH 7/8] Add `.swiftpm` to the gitignore. --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 69a7148a..96374ee4 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,5 @@ xcuserdata ## Obj-C/Swift specific *.hmap *.ipa + +.swiftpm From 7346b3f38562b2589d1e2402200278503602e750 Mon Sep 17 00:00:00 2001 From: Jonathan Baker Date: Tue, 16 Jul 2024 08:51:34 -0400 Subject: [PATCH 8/8] Remove `Card.Client` and related types. --- Buy.xcodeproj/project.pbxproj | 48 ------- Buy/Card/Card.Client.swift | 106 --------------- Buy/Card/Card.CreditCard.swift | 105 --------------- Buy/Card/Card.swift | 29 ----- BuyTests/Card/Card.ClientTests.swift | 159 ----------------------- BuyTests/Card/Card.CreditCardTests.swift | 114 ---------------- 6 files changed, 561 deletions(-) delete mode 100644 Buy/Card/Card.Client.swift delete mode 100644 Buy/Card/Card.CreditCard.swift delete mode 100644 Buy/Card/Card.swift delete mode 100644 BuyTests/Card/Card.ClientTests.swift delete mode 100644 BuyTests/Card/Card.CreditCardTests.swift diff --git a/Buy.xcodeproj/project.pbxproj b/Buy.xcodeproj/project.pbxproj index ad6d288d..e628a15f 100644 --- a/Buy.xcodeproj/project.pbxproj +++ b/Buy.xcodeproj/project.pbxproj @@ -774,11 +774,6 @@ 9A0C80B41EAA51C50020F187 /* UserError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80551EAA51C50020F187 /* UserError.swift */; }; 9A0C80B51EAA51C50020F187 /* WeightUnit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80561EAA51C50020F187 /* WeightUnit.swift */; }; 9A0C80B61EAA51C50020F187 /* Storefront.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80571EAA51C50020F187 /* Storefront.swift */; }; - 9A0C80F01EB773310020F187 /* Card.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80EF1EB773310020F187 /* Card.swift */; }; - 9A0C80F21EB773520020F187 /* Card.CreditCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80F11EB773520020F187 /* Card.CreditCard.swift */; }; - 9A0C80F41EB785310020F187 /* Card.Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80F31EB785310020F187 /* Card.Client.swift */; }; - 9A0C80F71EB7B61B0020F187 /* Card.ClientTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80F61EB7B61B0020F187 /* Card.ClientTests.swift */; }; - 9A0C80F91EB7BAEF0020F187 /* Card.CreditCardTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80F81EB7BAEF0020F187 /* Card.CreditCardTests.swift */; }; 9A0C80FC1EBA27970020F187 /* SelectedOptionInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80FB1EBA27970020F187 /* SelectedOptionInput.swift */; }; 9A0C81051EBA66440020F187 /* Graph.Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C81041EBA66440020F187 /* Graph.Cache.swift */; }; 9A0C81071EBA66800020F187 /* Graph.CachePolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C81061EBA66800020F187 /* Graph.CachePolicy.swift */; }; @@ -947,11 +942,9 @@ 9AC2EF591F6818180037E0D7 /* CustomerRecoverPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80291EAA51C50020F187 /* CustomerRecoverPayload.swift */; }; 9AC2EF5A1F6818180037E0D7 /* PaymentSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF1C1851F13ACCF0064AEA0 /* PaymentSettings.swift */; }; 9AC2EF5B1F6818180037E0D7 /* Domain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802E1EAA51C50020F187 /* Domain.swift */; }; - 9AC2EF5C1F6818180037E0D7 /* Card.CreditCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80F11EB773520020F187 /* Card.CreditCard.swift */; }; 9AC2EF5F1F6818180037E0D7 /* Graph.Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C81041EBA66440020F187 /* Graph.Cache.swift */; }; 9AC2EF601F6818180037E0D7 /* Node.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80371EAA51C50020F187 /* Node.swift */; }; 9AC2EF621F6818180037E0D7 /* OrderLineItemEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80401EAA51C50020F187 /* OrderLineItemEdge.swift */; }; - 9AC2EF631F6818180037E0D7 /* Card.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80EF1EB773310020F187 /* Card.swift */; }; 9AC2EF651F6818180037E0D7 /* CustomerAccessTokenCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801F1EAA51C50020F187 /* CustomerAccessTokenCreatePayload.swift */; }; 9AC2EF661F6818180037E0D7 /* BlogEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CE1EE095B20060029B /* BlogEdge.swift */; }; 9AC2EF671F6818180037E0D7 /* Shop.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804F1EAA51C50020F187 /* Shop.swift */; }; @@ -1008,7 +1001,6 @@ 9AC2EFA71F6818180037E0D7 /* ProductSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80481EAA51C50020F187 /* ProductSortKeys.swift */; }; 9AC2EFA81F6818180037E0D7 /* Graph.QueryError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AAFAB761E6080A500864A17 /* Graph.QueryError.swift */; }; 9AC2EFA91F6818180037E0D7 /* OrderEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803D1EAA51C50020F187 /* OrderEdge.swift */; }; - 9AC2EFAB1F6818180037E0D7 /* Card.Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80F31EB785310020F187 /* Card.Client.swift */; }; 9AC2EFAC1F6818180037E0D7 /* Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80141EAA51C50020F187 /* Collection.swift */; }; 9AC2EFAD1F6818180037E0D7 /* CustomerResetPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802B1EAA51C50020F187 /* CustomerResetPayload.swift */; }; 9AC2EFAE1F6818180037E0D7 /* ArticleSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C61EE095AA0060029B /* ArticleSortKeys.swift */; }; @@ -1060,11 +1052,9 @@ 9AF255D31F6FEE50005BB0C9 /* CustomerRecoverPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80291EAA51C50020F187 /* CustomerRecoverPayload.swift */; }; 9AF255D41F6FEE50005BB0C9 /* PaymentSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AF1C1851F13ACCF0064AEA0 /* PaymentSettings.swift */; }; 9AF255D51F6FEE50005BB0C9 /* Domain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802E1EAA51C50020F187 /* Domain.swift */; }; - 9AF255D61F6FEE50005BB0C9 /* Card.CreditCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80F11EB773520020F187 /* Card.CreditCard.swift */; }; 9AF255D91F6FEE50005BB0C9 /* Graph.Cache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C81041EBA66440020F187 /* Graph.Cache.swift */; }; 9AF255DA1F6FEE50005BB0C9 /* Node.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80371EAA51C50020F187 /* Node.swift */; }; 9AF255DC1F6FEE50005BB0C9 /* OrderLineItemEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80401EAA51C50020F187 /* OrderLineItemEdge.swift */; }; - 9AF255DD1F6FEE50005BB0C9 /* Card.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80EF1EB773310020F187 /* Card.swift */; }; 9AF255DF1F6FEE50005BB0C9 /* CustomerAccessTokenCreatePayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C801F1EAA51C50020F187 /* CustomerAccessTokenCreatePayload.swift */; }; 9AF255E01F6FEE50005BB0C9 /* BlogEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416CE1EE095B20060029B /* BlogEdge.swift */; }; 9AF255E11F6FEE50005BB0C9 /* Shop.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C804F1EAA51C50020F187 /* Shop.swift */; }; @@ -1121,7 +1111,6 @@ 9AF256211F6FEE50005BB0C9 /* ProductSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80481EAA51C50020F187 /* ProductSortKeys.swift */; }; 9AF256221F6FEE50005BB0C9 /* Graph.QueryError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AAFAB761E6080A500864A17 /* Graph.QueryError.swift */; }; 9AF256231F6FEE50005BB0C9 /* OrderEdge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C803D1EAA51C50020F187 /* OrderEdge.swift */; }; - 9AF256251F6FEE50005BB0C9 /* Card.Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80F31EB785310020F187 /* Card.Client.swift */; }; 9AF256261F6FEE50005BB0C9 /* Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C80141EAA51C50020F187 /* Collection.swift */; }; 9AF256271F6FEE50005BB0C9 /* CustomerResetPayload.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0C802B1EAA51C50020F187 /* CustomerResetPayload.swift */; }; 9AF256281F6FEE50005BB0C9 /* ArticleSortKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AA416C61EE095AA0060029B /* ArticleSortKeys.swift */; }; @@ -1454,11 +1443,6 @@ 9A0C80551EAA51C50020F187 /* UserError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserError.swift; sourceTree = ""; }; 9A0C80561EAA51C50020F187 /* WeightUnit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WeightUnit.swift; sourceTree = ""; }; 9A0C80571EAA51C50020F187 /* Storefront.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Storefront.swift; sourceTree = ""; }; - 9A0C80EF1EB773310020F187 /* Card.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Card.swift; sourceTree = ""; }; - 9A0C80F11EB773520020F187 /* Card.CreditCard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Card.CreditCard.swift; sourceTree = ""; }; - 9A0C80F31EB785310020F187 /* Card.Client.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Card.Client.swift; sourceTree = ""; }; - 9A0C80F61EB7B61B0020F187 /* Card.ClientTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Card.ClientTests.swift; sourceTree = ""; }; - 9A0C80F81EB7BAEF0020F187 /* Card.CreditCardTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Card.CreditCardTests.swift; sourceTree = ""; }; 9A0C80FB1EBA27970020F187 /* SelectedOptionInput.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SelectedOptionInput.swift; sourceTree = ""; }; 9A0C81041EBA66440020F187 /* Graph.Cache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Graph.Cache.swift; sourceTree = ""; }; 9A0C81061EBA66800020F187 /* Graph.CachePolicy.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Graph.CachePolicy.swift; sourceTree = ""; }; @@ -1980,15 +1964,6 @@ path = Client; sourceTree = ""; }; - 9A46660E1EF1915400A41625 /* Card */ = { - isa = PBXGroup; - children = ( - 9A0C80F61EB7B61B0020F187 /* Card.ClientTests.swift */, - 9A0C80F81EB7BAEF0020F187 /* Card.CreditCardTests.swift */, - ); - path = Card; - sourceTree = ""; - }; 9A46660F1EF1916300A41625 /* Custom */ = { isa = PBXGroup; children = ( @@ -2033,16 +2008,6 @@ path = Client; sourceTree = ""; }; - 9A74974B1EF05A2900D3F673 /* Card */ = { - isa = PBXGroup; - children = ( - 9A0C80EF1EB773310020F187 /* Card.swift */, - 9A0C80F31EB785310020F187 /* Card.Client.swift */, - 9A0C80F11EB773520020F187 /* Card.CreditCard.swift */, - ); - path = Card; - sourceTree = ""; - }; 9A9C513B1F02A0CA003363E7 /* Crypto */ = { isa = PBXGroup; children = ( @@ -2084,7 +2049,6 @@ isa = PBXGroup; children = ( 9AEF60F61E5F42D90067FA90 /* Buy.h */, - 9A74974B1EF05A2900D3F673 /* Card */, 9A74974A1EF05A0E00D3F673 /* Client */, 9A9C513B1F02A0CA003363E7 /* Crypto */, 9AEF619F1E5F5A050067FA90 /* Custom */, @@ -2118,7 +2082,6 @@ 9AFA38EB1E64850A0056C5AA /* BuyTests */ = { isa = PBXGroup; children = ( - 9A46660E1EF1915400A41625 /* Card */, 9A46660D1EF1914000A41625 /* Client */, 9A9C513E1F02A691003363E7 /* Crypto */, 9A46660F1EF1916300A41625 /* Custom */, @@ -2339,9 +2302,6 @@ 4EF3D34928EB2287007215E6 /* BrandColorGroup.swift in Sources */, 4EF3D34328EB2287007215E6 /* BrandColors.swift in Sources */, 4E69B2572BBB2C0B00913BAA /* BuyerInput.swift in Sources */, - 9AC2EF631F6818180037E0D7 /* Card.swift in Sources */, - 9AC2EFAB1F6818180037E0D7 /* Card.Client.swift in Sources */, - 9AC2EF5C1F6818180037E0D7 /* Card.CreditCard.swift in Sources */, 9AC2EFAF1F6818180037E0D7 /* CardBrand.swift in Sources */, 4E28FEFD270780B500F9EBED /* Cart.swift in Sources */, 4E28FED6270780B500F9EBED /* CartAttributesUpdatePayload.swift in Sources */, @@ -2720,9 +2680,6 @@ 4EF3D34728EB2287007215E6 /* BrandColorGroup.swift in Sources */, 4EF3D34128EB2287007215E6 /* BrandColors.swift in Sources */, 4E69B2552BBB2C0B00913BAA /* BuyerInput.swift in Sources */, - 9A0C80F01EB773310020F187 /* Card.swift in Sources */, - 9A0C80F41EB785310020F187 /* Card.Client.swift in Sources */, - 9A0C80F21EB773520020F187 /* Card.CreditCard.swift in Sources */, 9A52D3A31F3CA58E00C093C8 /* CardBrand.swift in Sources */, 4E28FEFB270780B500F9EBED /* Cart.swift in Sources */, 4E28FED4270780B500F9EBED /* CartAttributesUpdatePayload.swift in Sources */, @@ -3101,9 +3058,6 @@ 4EF3D34828EB2287007215E6 /* BrandColorGroup.swift in Sources */, 4EF3D34228EB2287007215E6 /* BrandColors.swift in Sources */, 4E69B2562BBB2C0B00913BAA /* BuyerInput.swift in Sources */, - 9AF255DD1F6FEE50005BB0C9 /* Card.swift in Sources */, - 9AF256251F6FEE50005BB0C9 /* Card.Client.swift in Sources */, - 9AF255D61F6FEE50005BB0C9 /* Card.CreditCard.swift in Sources */, 9AF256291F6FEE50005BB0C9 /* CardBrand.swift in Sources */, 4E28FEFC270780B500F9EBED /* Cart.swift in Sources */, 4E28FED5270780B500F9EBED /* CartAttributesUpdatePayload.swift in Sources */, @@ -3459,8 +3413,6 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9A0C80F71EB7B61B0020F187 /* Card.ClientTests.swift in Sources */, - 9A0C80F91EB7BAEF0020F187 /* Card.CreditCardTests.swift in Sources */, 9AA7AC781EBB78160014D95D /* Graph.CacheItemTests.swift in Sources */, 9AE2A1C21EC6373B00921247 /* Graph.CachePolicyTests.swift in Sources */, 9A6F3BA91EBB6A7500B149F4 /* Graph.CacheTests.swift in Sources */, diff --git a/Buy/Card/Card.Client.swift b/Buy/Card/Card.Client.swift deleted file mode 100644 index 71579bfc..00000000 --- a/Buy/Card/Card.Client.swift +++ /dev/null @@ -1,106 +0,0 @@ -// -// Card.Client.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -public extension Card { - - typealias VaultCompletion = (_ token: String?, _ error: Error?) -> Void - - /// The `Vault.Client` is a network layer designed to abstract the communication with the Shopify's - /// credit card server. For PCI-compliance reasons, this is a standalone service, separate from the - /// main `Graph.Client` service. - /// - class Client { - - /// The `URLSession` backing all `Client` network operations. You may provide your own session when initializing a new `Client`. - public let session: URLSession - - // ---------------------------------- - // MARK: - Init - - // - /// Creates and initialized a new `Client`. - /// - /// - parameters: - /// - session: A `URLSession` to use for this client. If left blank, a session with a `default` configuration will be created. - /// - public init(session: URLSession = URLSession(configuration: URLSessionConfiguration.default)) { - self.session = session - } - - // ---------------------------------- - // MARK: - Request Generation - - // - func requestFor(_ creditCard: CreditCard, to url: URL) -> URLRequest { - var request = URLRequest(url: url) - - request.httpMethod = "POST" - request.httpBody = try! JSONSerialization.data(withJSONObject: creditCard.dictionary(), options: []) - request.httpShouldHandleCookies = false - - request.setValue("application/json", forHTTPHeaderField: Header.accept) - request.setValue("application/json", forHTTPHeaderField: Header.contentType) - - return request - } - - // ---------------------------------- - // MARK: - Vaulting - - // - /// Stores the raw credit data on Shopify's card server and exchanges it for a token - /// that can be used to complete a checkout. - /// - /// - parameters: - /// - creditCard: The credit card to vault - /// - url: The `vaultUrl` obtained from a `Storefront.Checkout` - /// - completion: The completion handler that will be executed with the token after a card has has been vaulted. - /// - /// - returns: - /// A reference to a `Task` representing this vault operation. - /// - public func vault(_ creditCard: CreditCard, to url: URL, completion: @escaping VaultCompletion) -> Task { - let task = self.session.dataTask(with: self.requestFor(creditCard, to: url)) { data, response, error in - - guard let data = data else { - completion(nil, error) - return - } - - do { - let object = try JSONSerialization.jsonObject(with: data, options: []) as! [String : Any] - let token = object["id"] as! String - - completion(token, nil) - - } catch let jsonError { - completion(nil, jsonError) - } - } - - return task - } - } -} diff --git a/Buy/Card/Card.CreditCard.swift b/Buy/Card/Card.CreditCard.swift deleted file mode 100644 index e9a9c491..00000000 --- a/Buy/Card/Card.CreditCard.swift +++ /dev/null @@ -1,105 +0,0 @@ -// -// Card.CreditCard.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -public extension Card { - struct CreditCard { - - /// First name as shown on the credit card - public let firstName: String - - /// Middle name as shown on the credit card - public let middleName: String? - - /// Last name as shown on the credit card - public let lastName: String - - /// Credit card number without spaces, only digits - public let number: String - - /// The last two digits of the credit card expiry month (ex: December would be "12" and July would be "7") - public let expiryMonth: String - - /// The last two digits of the credit card expiry year (ex: 2019 would be "19") - public let expiryYear: String - - /// The verification code displayed on the back or the front of the card - public let verificationCode: String? - - // ---------------------------------- - // MARK: - Init - - // - /// Creates and initializes a new credit card for submitting to the vaulting service. - /// - /// - parameters: - /// - firstName: First name as shown on the credit card - /// - middleName: Middle name as shown on the credit card - /// - lastName: Last name as shown on the credit card - /// - number: Credit card number without spaces, only digits - /// - expiryMonth: The last two digits of the credit card expiry month (ex: December would be "12" and July would be "7") - /// - expiryYear: The last two digits of the credit card expiry year (ex: 2019 would be "19") - /// - verification: The verification code displayed on the back or the front of the card - /// - public init(firstName: String, middleName: String? = nil, lastName: String, number: String, expiryMonth: String, expiryYear: String, verificationCode: String? = nil) { - self.firstName = firstName - self.middleName = middleName - self.lastName = lastName - - self.number = number - self.expiryMonth = expiryMonth - self.expiryYear = expiryYear - self.verificationCode = verificationCode - } - - // ---------------------------------- - // MARK: - Dictionary - - // - internal func dictionary() -> [String: Any] { - - var firstName = self.firstName - if let middleName = self.middleName { - firstName = "\(firstName) \(middleName)" - } - - var json: [String : String] = [ - "number" : self.number, - "first_name" : firstName, - "last_name" : self.lastName, - "month" : self.expiryMonth, - "year" : self.expiryYear, - ] - - if let verificationCode = self.verificationCode { - json["verification_value"] = verificationCode - } - - return [ - "credit_card": json, - ] - } - } -} diff --git a/Buy/Card/Card.swift b/Buy/Card/Card.swift deleted file mode 100644 index b639e555..00000000 --- a/Buy/Card/Card.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// Card.swift -// Buy -// -// Created by Shopify. -// Copyright (c) 2017 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 Foundation - -public struct Card {} diff --git a/BuyTests/Card/Card.ClientTests.swift b/BuyTests/Card/Card.ClientTests.swift deleted file mode 100644 index d6233c53..00000000 --- a/BuyTests/Card/Card.ClientTests.swift +++ /dev/null @@ -1,159 +0,0 @@ -// -// Card.ClientTests.swift -// BuyTests -// -// Created by Shopify. -// Copyright (c) 2017 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 XCTest -@testable import Buy - -class Card_ClientTests: XCTestCase { - - let mockSession = MockSession() - - // ---------------------------------- - // MARK: - Init - - // - func testInit() { - let session = URLSession(configuration: .default) - let client = Card.Client(session: session) - - XCTAssertTrue(client.session === session) - } - - // ---------------------------------- - // MARK: - Requests - - // - func testRequestGeneration() { - let card = self.defaultCreditCard() - let client = self.defaultClient() - let url = self.defaultURL() - let request = client.requestFor(card, to: url) - - XCTAssertEqual(request.url, url) - XCTAssertEqual(request.httpMethod, "POST") - XCTAssertFalse(request.httpShouldHandleCookies) - XCTAssertEqual(request.value(forHTTPHeaderField: "Accept"), "application/json") - XCTAssertEqual(request.value(forHTTPHeaderField: "Content-Type"), "application/json") - - let expectedCard = card.dictionary() - let json = try! JSONSerialization.jsonObject(with: request.httpBody!, options: []) as! [String: Any] - - XCTAssertEqual(json.count, expectedCard.count) - XCTAssertEqual(json["credit_card"]! as! [String : String], expectedCard["credit_card"]! as! [String : String]) - } - - // ---------------------------------- - // MARK: - Vaulting - - // - func testVaultSuccess() { - let card = self.defaultCreditCard() - let response = [ - "id": "token-123" - ] - - let responseData = try! JSONSerialization.data(withJSONObject: response, options: []) - - self.testVaultUsing(card, configuration: { task in - task.responseCode = 200 - task.responseData = responseData - }, assertions: { token, error in - XCTAssertEqual(token, "token-123") - XCTAssertNil(error) - }) - } - - func testVaultEmptyData() { - let card = self.defaultCreditCard() - - self.testVaultUsing(card, configuration: { task in - task.responseCode = 200 - task.responseData = nil - task.responseError = ("No data", 890) - - }, assertions: { token, error in - XCTAssertNil(token) - XCTAssertNotNil(error) - - let vaultError = error! as NSError - XCTAssertEqual(vaultError.domain, "No data") - XCTAssertEqual(vaultError.code, 890) - }) - } - - func testVaultInvalidJson() { - let card = self.defaultCreditCard() - - self.testVaultUsing(card, configuration: { task in - task.responseCode = 200 - task.responseData = "abc".data(using: .utf8) - task.responseError = ("Invalid json", 400) - - }, assertions: { token, error in - XCTAssertNil(token) - XCTAssertNotNil(error) - - let vaultError = error! as NSError - XCTAssertEqual(vaultError.domain, NSCocoaErrorDomain) - XCTAssertEqual(vaultError.code, 3840) - }) - } - - private func testVaultUsing(_ card: Card.CreditCard, configuration: (MockDataTask) -> Void, assertions: @escaping (String?, Error?) -> Void) { - let e = self.expectation(description: "") - - let client = self.defaultClient() - let url = self.defaultURL() - let task = client.vault(card, to: url) { token, error in - assertions(token, error) - e.fulfill() - } - - configuration(task as! MockDataTask) - - task.resume() - self.wait(for: [e], timeout: 10) - } - - // ---------------------------------- - // MARK: - Private - - // - private func defaultURL() -> URL { - return URL(string: "https://www.google.com")! - } - - private func defaultClient() -> Card.Client { - return Card.Client(session: self.mockSession) - } - - private func defaultCreditCard() -> Card.CreditCard { - return Card.CreditCard( - firstName: "John", - lastName: "Smith", - number: "1234567812345678", - expiryMonth: "07", - expiryYear: "19", - verificationCode: "1234" - ) - } -} diff --git a/BuyTests/Card/Card.CreditCardTests.swift b/BuyTests/Card/Card.CreditCardTests.swift deleted file mode 100644 index f1439be4..00000000 --- a/BuyTests/Card/Card.CreditCardTests.swift +++ /dev/null @@ -1,114 +0,0 @@ -// -// Card.CreditCardTests.swift -// BuyTests -// -// Created by Shopify. -// Copyright (c) 2017 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 XCTest -@testable import Buy - -class Card_CreditCardTests: XCTestCase { - - // ---------------------------------- - // MARK: - Init - - // - func testInitComplete() { - let card = self.creditCard() - - XCTAssertEqual(card.firstName, "John") - XCTAssertEqual(card.middleName, "Singleton") - XCTAssertEqual(card.lastName, "Smith") - XCTAssertEqual(card.number, "1234567812345678") - XCTAssertEqual(card.expiryMonth, "07") - XCTAssertEqual(card.expiryYear, "19") - XCTAssertEqual(card.verificationCode, "1234") - } - - func testInitPartial() { - let card = self.partialCreditCard() - - XCTAssertNil(card.middleName) - XCTAssertNil(card.verificationCode) - } - - // ---------------------------------- - // MARK: - Serialization - - // - func testSerializationComplete() { - let card = self.creditCard() - let dictionary = card.dictionary() - - XCTAssertEqual(dictionary.count, 1) - - let creditCard = dictionary["credit_card"] as! JSON - - XCTAssertEqual(creditCard.count, 6) - XCTAssertEqual(creditCard["number"] as! String, "1234567812345678") - XCTAssertEqual(creditCard["first_name"] as! String, "John Singleton") - XCTAssertEqual(creditCard["last_name"] as! String, "Smith") - XCTAssertEqual(creditCard["month"] as! String, "07") - XCTAssertEqual(creditCard["year"] as! String, "19") - XCTAssertEqual(creditCard["verification_value"] as! String, "1234") - } - - func testSerializationPartial() { - let card = self.partialCreditCard() - let dictionary = card.dictionary() - - XCTAssertEqual(dictionary.count, 1) - - let creditCard = dictionary["credit_card"] as! JSON - - XCTAssertEqual(creditCard.count, 5) - XCTAssertEqual(creditCard["number"] as! String, "1234567812345678") - XCTAssertEqual(creditCard["first_name"] as! String, "John") - XCTAssertEqual(creditCard["last_name"] as! String, "Smith") - XCTAssertEqual(creditCard["month"] as! String, "07") - XCTAssertEqual(creditCard["year"] as! String, "19") - } - - // ---------------------------------- - // MARK: - Private - - // - private func creditCard() -> Card.CreditCard { - return Card.CreditCard( - firstName: "John", - middleName: "Singleton", - lastName: "Smith", - number: "1234567812345678", - expiryMonth: "07", - expiryYear: "19", - verificationCode: "1234" - ) - } - - private func partialCreditCard() -> Card.CreditCard { - return Card.CreditCard( - firstName: "John", - lastName: "Smith", - number: "1234567812345678", - expiryMonth: "07", - expiryYear: "19" - ) - } -}