diff --git a/MobileBuy/buy3/gradle.properties b/MobileBuy/buy3/gradle.properties index 8729ff438..4debe90d7 100644 --- a/MobileBuy/buy3/gradle.properties +++ b/MobileBuy/buy3/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=17.0.0 +VERSION_NAME=18.0.0 POM_ARTIFACT_ID=buy3 POM_GROUP_ID=com.shopify.mobilebuysdk diff --git a/MobileBuy/buy3/src/main/java/com/shopify/buy3/CardClient.kt b/MobileBuy/buy3/src/main/java/com/shopify/buy3/CardClient.kt deleted file mode 100644 index 353c4532f..000000000 --- a/MobileBuy/buy3/src/main/java/com/shopify/buy3/CardClient.kt +++ /dev/null @@ -1,123 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2015 Shopify Inc. - * - * 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. - */ -package com.shopify.buy3 - -import android.os.Handler -import com.shopify.buy3.internal.RealCreditCardVaultCall -import okhttp3.Call -import okhttp3.HttpUrl -import okhttp3.OkHttpClient -import java.util.concurrent.TimeUnit - -private val DEFAULT_HTTP_CONNECTION_TIME_OUT_MS = TimeUnit.SECONDS.toMillis(10) -private val DEFAULT_HTTP_READ_WRITE_TIME_OUT_MS = TimeUnit.SECONDS.toMillis(20) - -/** - * [CardVaultResult] card vault result handler. - */ -typealias CardVaultResultCallback = (result: CardVaultResult) -> Unit - - -/** - * Factory for network calls to the card server - * - * Should be shared and reused for all calls to the card server. - */ -class CardClient(internal val httpCallFactory: Call.Factory = defaultOkHttpClient()) { - - /** - * Creates a call to vault credit card on the server - * - * Credit cards cannot be sent to the checkout API directly. They must be sent to the card vault which in response will return an token. - * This token should be used for completion checkout with credit card. - * - * @param creditCard [CreditCard] credit card info - * @param vaultServerUrl endpoint of card vault returned in [Storefront.PaymentSettings.getCardVaultUrl] - * @return [CreditCardVaultCall] - */ - fun vault(creditCard: CreditCard, vaultServerUrl: String): CreditCardVaultCall { - return RealCreditCardVaultCall(creditCard, HttpUrl.parse(vaultServerUrl), httpCallFactory) - } -} - -private fun defaultOkHttpClient(): OkHttpClient { - return OkHttpClient.Builder() - .connectTimeout(DEFAULT_HTTP_CONNECTION_TIME_OUT_MS, TimeUnit.MILLISECONDS) - .readTimeout(DEFAULT_HTTP_READ_WRITE_TIME_OUT_MS, TimeUnit.MILLISECONDS) - .writeTimeout(DEFAULT_HTTP_READ_WRITE_TIME_OUT_MS, TimeUnit.MILLISECONDS) - .build() -} - -/** - * Abstraction for call to the vaulting card server. - * - * Credit cards cannot be sent to the checkout API directly. They must be sent to the card vault which in response will return an token. - * - * This token should be used for completion checkout with credit card. - */ -interface CreditCardVaultCall { - - /** - * Checks if this call has been canceled. - */ - val isCanceled: Boolean - - /** - * Cancels this call if possible. - */ - fun cancel() - - /** - * Creates a new, identical call to this one, which can be enqueued even if this call has already been executed or canceled. - * - * @return [CreditCardVaultCall] cloned call - */ - fun clone(): CreditCardVaultCall - - /** - * Schedules the call to be executed at some point in the future. - * - * @param callback [CardVaultResultCallback] to handle the response or a failure - * @param callbackHandler optional handler provided callback will be running on the thread to which it is attached to - * @return [CreditCardVaultCall] scheduled for execution - * @throws IllegalStateException when the call has already been executed - */ - fun enqueue(callbackHandler: Handler? = null, callback: CardVaultResultCallback): CreditCardVaultCall -} - -/** - * Represents result of the [CreditCardVaultCall] execution - */ -sealed class CardVaultResult { - - /** - * Success result with a returned credit card token. - */ - class Success(val token: String) : CardVaultResult() - - /** - * Failure result with exception caused an error. - */ - class Failure(val exception: Exception) : CardVaultResult() -} \ No newline at end of file diff --git a/MobileBuy/buy3/src/main/java/com/shopify/buy3/CreditCard.kt b/MobileBuy/buy3/src/main/java/com/shopify/buy3/CreditCard.kt deleted file mode 100644 index 3e7f5df9b..000000000 --- a/MobileBuy/buy3/src/main/java/com/shopify/buy3/CreditCard.kt +++ /dev/null @@ -1,51 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2015 Shopify Inc. - * - * 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. - */ -package com.shopify.buy3 - -/** - * Credit Card information. - */ -class CreditCard constructor( - val number: String, - val firstName: String, - val lastName: String, - val expireMonth: String, - val expireYear: String, - val verificationCode: String -) { - init { - number.checkNotBlank("number can't be empty") - firstName.checkNotBlank("firstName can't be empty") - lastName.checkNotBlank("lastName can't be empty") - expireMonth.checkNotBlank("expireMonth can't be empty") - expireYear.checkNotBlank("expireYear can't be empty") - verificationCode.checkNotBlank("expireYear can't be empty") - } - - companion object -} - -private fun String.checkNotBlank(message: String) { - if (isBlank()) throw IllegalArgumentException(message) -} \ No newline at end of file diff --git a/MobileBuy/buy3/src/main/java/com/shopify/buy3/Storefront.java b/MobileBuy/buy3/src/main/java/com/shopify/buy3/Storefront.java index c9c551373..d4360559c 100644 --- a/MobileBuy/buy3/src/main/java/com/shopify/buy3/Storefront.java +++ b/MobileBuy/buy3/src/main/java/com/shopify/buy3/Storefront.java @@ -25,7 +25,7 @@ import java.util.*; public class Storefront { - public static final String API_VERSION = "2024-04"; + public static final String API_VERSION = "2024-07"; public static QueryRootQuery query(QueryRootQueryDefinition queryDef) { return query(Collections.emptyList(), queryDef); @@ -2683,131 +2683,6 @@ public boolean unwrapsToObject(String key) { } } - public interface AvailableShippingRatesQueryDefinition { - void define(AvailableShippingRatesQuery _queryBuilder); - } - - /** - * A collection of available shipping rates for a checkout. - */ - public static class AvailableShippingRatesQuery extends Query { - AvailableShippingRatesQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * 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`. - */ - public AvailableShippingRatesQuery ready() { - startField("ready"); - - return this; - } - - /** - * The fetched shipping rates. `null` until the `ready` field is `true`. - */ - public AvailableShippingRatesQuery shippingRates(ShippingRateQueryDefinition queryDef) { - startField("shippingRates"); - - _queryBuilder.append('{'); - queryDef.define(new ShippingRateQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * A collection of available shipping rates for a checkout. - */ - public static class AvailableShippingRates extends AbstractResponse { - public AvailableShippingRates() { - } - - public AvailableShippingRates(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "ready": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "shippingRates": { - List optional1 = null; - if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ShippingRate(jsonAsObject(element1, key))); - } - - optional1 = list1; - } - - responseData.put(key, optional1); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "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`. - */ - - public Boolean getReady() { - return (Boolean) get("ready"); - } - - public AvailableShippingRates setReady(Boolean arg) { - optimisticData.put(getKey("ready"), arg); - return this; - } - - /** - * The fetched shipping rates. `null` until the `ready` field is `true`. - */ - - public List getShippingRates() { - return (List) get("shippingRates"); - } - - public AvailableShippingRates setShippingRates(List arg) { - optimisticData.put(getKey("shippingRates"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "ready": return false; - - case "shippingRates": return true; - - default: return false; - } - } - } - public interface BaseCartLineQueryDefinition { void define(BaseCartLineQuery _queryBuilder); } @@ -5123,6 +4998,19 @@ public static class CartQuery extends Query { startField("id"); } + /** + * The gift cards that have been applied to the cart. + */ + public CartQuery appliedGiftCards(AppliedGiftCardQueryDefinition queryDef) { + startField("appliedGiftCards"); + + _queryBuilder.append('{'); + queryDef.define(new AppliedGiftCardQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + /** * An attribute associated with the cart. */ @@ -5260,6 +5148,24 @@ public DeliveryGroupsArguments reverse(Boolean value) { } return this; } + + /** + * Whether to include [carrier-calculated delivery + * rates](https://help.shopify.com/en/manual/shipping/setting-up-and-managing-your-shipping/enabling-sh + * ipping-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#fetch + * ing-carrier-calculated-rates-for-the-cart-using-defer). + */ + public DeliveryGroupsArguments withCarrierRates(Boolean value) { + if (value != null) { + startArgument("withCarrierRates"); + _queryBuilder.append(value); + } + return this; + } } public interface DeliveryGroupsArgumentsDefinition { @@ -5546,6 +5452,17 @@ public Cart(JsonObject fields) throws SchemaViolationError { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { + case "appliedGiftCards": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new AppliedGiftCard(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + case "attribute": { Attribute optional1 = null; if (!field.getValue().isJsonNull()) { @@ -5708,6 +5625,19 @@ public String getGraphQlTypeName() { return "Cart"; } + /** + * The gift cards that have been applied to the cart. + */ + + public List getAppliedGiftCards() { + return (List) get("appliedGiftCards"); + } + + public Cart setAppliedGiftCards(List arg) { + optimisticData.put(getKey("appliedGiftCards"), arg); + return this; + } + /** * An attribute associated with the cart. */ @@ -5936,6 +5866,8 @@ public Cart setUpdatedAt(DateTime arg) { public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { + case "appliedGiftCards": return true; + case "attribute": return true; case "attributes": return true; @@ -6125,6 +6057,15 @@ public CartAutomaticDiscountAllocationQuery discountedAmount(MoneyV2QueryDefinit return this; } + /** + * The type of line that the discount is applicable towards. + */ + public CartAutomaticDiscountAllocationQuery targetType() { + startField("targetType"); + + return this; + } + /** * The title of the allocated discount. */ @@ -6153,6 +6094,12 @@ public CartAutomaticDiscountAllocation(JsonObject fields) throws SchemaViolation break; } + case "targetType": { + responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + case "title": { responseData.put(key, jsonAsString(field.getValue(), key)); @@ -6187,6 +6134,19 @@ public CartAutomaticDiscountAllocation setDiscountedAmount(MoneyV2 arg) { return this; } + /** + * The type of line that the discount is applicable towards. + */ + + public DiscountApplicationTargetType getTargetType() { + return (DiscountApplicationTargetType) get("targetType"); + } + + public CartAutomaticDiscountAllocation setTargetType(DiscountApplicationTargetType arg) { + optimisticData.put(getKey("targetType"), arg); + return this; + } + /** * The title of the allocated discount. */ @@ -6204,6 +6164,8 @@ public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "discountedAmount": return true; + case "targetType": return false; + case "title": return false; default: return false; @@ -6211,6 +6173,131 @@ public boolean unwrapsToObject(String key) { } } + public interface CartBillingAddressUpdatePayloadQueryDefinition { + void define(CartBillingAddressUpdatePayloadQuery _queryBuilder); + } + + /** + * Return type for `cartBillingAddressUpdate` mutation. + */ + public static class CartBillingAddressUpdatePayloadQuery extends Query { + CartBillingAddressUpdatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The updated cart. + */ + public CartBillingAddressUpdatePayloadQuery cart(CartQueryDefinition queryDef) { + startField("cart"); + + _queryBuilder.append('{'); + queryDef.define(new CartQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The list of errors that occurred from executing the mutation. + */ + public CartBillingAddressUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { + startField("userErrors"); + + _queryBuilder.append('{'); + queryDef.define(new CartUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * Return type for `cartBillingAddressUpdate` mutation. + */ + public static class CartBillingAddressUpdatePayload extends AbstractResponse { + public CartBillingAddressUpdatePayload() { + } + + public CartBillingAddressUpdatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cart": { + Cart optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Cart(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartUserError(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "CartBillingAddressUpdatePayload"; + } + + /** + * The updated cart. + */ + + public Cart getCart() { + return (Cart) get("cart"); + } + + public CartBillingAddressUpdatePayload setCart(Cart arg) { + optimisticData.put(getKey("cart"), arg); + return this; + } + + /** + * The list of errors that occurred from executing the mutation. + */ + + public List getUserErrors() { + return (List) get("userErrors"); + } + + public CartBillingAddressUpdatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cart": return true; + + case "userErrors": return true; + + default: return false; + } + } + } + public interface CartBuyerIdentityQueryDefinition { void define(CartBuyerIdentityQuery _queryBuilder); } @@ -6279,24 +6366,29 @@ public CartBuyerIdentityQuery phone() { } /** - * 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. */ - public CartBuyerIdentityQuery purchasingCompany(PurchasingCompanyQueryDefinition queryDef) { - startField("purchasingCompany"); + public CartBuyerIdentityQuery preferences(CartPreferencesQueryDefinition queryDef) { + startField("preferences"); _queryBuilder.append('{'); - queryDef.define(new PurchasingCompanyQuery(_queryBuilder)); + queryDef.define(new CartPreferencesQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * 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. */ - public CartBuyerIdentityQuery walletPreferences() { - startField("walletPreferences"); + public CartBuyerIdentityQuery purchasingCompany(PurchasingCompanyQueryDefinition queryDef) { + startField("purchasingCompany"); + + _queryBuilder.append('{'); + queryDef.define(new PurchasingCompanyQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } @@ -6369,10 +6461,10 @@ public CartBuyerIdentity(JsonObject fields) throws SchemaViolationError { break; } - case "purchasingCompany": { - PurchasingCompany optional1 = null; + case "preferences": { + CartPreferences optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new PurchasingCompany(jsonAsObject(field.getValue(), key)); + optional1 = new CartPreferences(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -6380,13 +6472,13 @@ public CartBuyerIdentity(JsonObject fields) throws SchemaViolationError { break; } - case "walletPreferences": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); + case "purchasingCompany": { + PurchasingCompany optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new PurchasingCompany(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } @@ -6474,29 +6566,30 @@ public CartBuyerIdentity setPhone(String arg) { } /** - * 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. */ - public PurchasingCompany getPurchasingCompany() { - return (PurchasingCompany) get("purchasingCompany"); + public CartPreferences getPreferences() { + return (CartPreferences) get("preferences"); } - public CartBuyerIdentity setPurchasingCompany(PurchasingCompany arg) { - optimisticData.put(getKey("purchasingCompany"), arg); + public CartBuyerIdentity setPreferences(CartPreferences arg) { + optimisticData.put(getKey("preferences"), arg); return this; } /** - * 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. */ - public List getWalletPreferences() { - return (List) get("walletPreferences"); + public PurchasingCompany getPurchasingCompany() { + return (PurchasingCompany) get("purchasingCompany"); } - public CartBuyerIdentity setWalletPreferences(List arg) { - optimisticData.put(getKey("walletPreferences"), arg); + public CartBuyerIdentity setPurchasingCompany(PurchasingCompany arg) { + optimisticData.put(getKey("purchasingCompany"), arg); return this; } @@ -6512,9 +6605,9 @@ public boolean unwrapsToObject(String key) { case "phone": return false; - case "purchasingCompany": return true; + case "preferences": return true; - case "walletPreferences": return false; + case "purchasingCompany": return true; default: return false; } @@ -6534,7 +6627,7 @@ public static class CartBuyerIdentityInput implements Serializable { private Input> deliveryAddressPreferences = Input.undefined(); - private Input> walletPreferences = Input.undefined(); + private Input preferences = Input.undefined(); public String getEmail() { return email.getValue(); @@ -6662,24 +6755,24 @@ public CartBuyerIdentityInput setDeliveryAddressPreferencesInput(Input getWalletPreferences() { - return walletPreferences.getValue(); + public CartPreferencesInput getPreferences() { + return preferences.getValue(); } - public Input> getWalletPreferencesInput() { - return walletPreferences; + public Input getPreferencesInput() { + return preferences; } - public CartBuyerIdentityInput setWalletPreferences(List walletPreferences) { - this.walletPreferences = Input.optional(walletPreferences); + public CartBuyerIdentityInput setPreferences(CartPreferencesInput preferences) { + this.preferences = Input.optional(preferences); return this; } - public CartBuyerIdentityInput setWalletPreferencesInput(Input> walletPreferences) { - if (walletPreferences == null) { + public CartBuyerIdentityInput setPreferencesInput(Input preferences) { + if (preferences == null) { throw new IllegalArgumentException("Input can not be null"); } - this.walletPreferences = walletPreferences; + this.preferences = preferences; return this; } @@ -6762,21 +6855,12 @@ public void appendTo(StringBuilder _queryBuilder) { } } - if (this.walletPreferences.isDefined()) { + if (this.preferences.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("walletPreferences:"); - if (walletPreferences.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (String item1 : walletPreferences.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - Query.appendQuotedString(_queryBuilder, item1.toString()); - } - } - _queryBuilder.append(']'); + _queryBuilder.append("preferences:"); + if (preferences.getValue() != null) { + preferences.getValue().appendTo(_queryBuilder); } else { _queryBuilder.append("null"); } @@ -6984,6 +7068,15 @@ public CartCodeDiscountAllocationQuery discountedAmount(MoneyV2QueryDefinition q return this; } + + /** + * The type of line that the discount is applicable towards. + */ + public CartCodeDiscountAllocationQuery targetType() { + startField("targetType"); + + return this; + } } /** @@ -7010,6 +7103,12 @@ public CartCodeDiscountAllocation(JsonObject fields) throws SchemaViolationError break; } + case "targetType": { + responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -7051,12 +7150,27 @@ public CartCodeDiscountAllocation setDiscountedAmount(MoneyV2 arg) { return this; } + /** + * The type of line that the discount is applicable towards. + */ + + public DiscountApplicationTargetType getTargetType() { + return (DiscountApplicationTargetType) get("targetType"); + } + + public CartCodeDiscountAllocation setTargetType(DiscountApplicationTargetType arg) { + optimisticData.put(getKey("targetType"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "code": return false; case "discountedAmount": return true; + case "targetType": return false; + default: return false; } } @@ -8263,6 +8377,15 @@ public CartCustomDiscountAllocationQuery discountedAmount(MoneyV2QueryDefinition return this; } + /** + * The type of line that the discount is applicable towards. + */ + public CartCustomDiscountAllocationQuery targetType() { + startField("targetType"); + + return this; + } + /** * The title of the allocated discount. */ @@ -8291,6 +8414,12 @@ public CartCustomDiscountAllocation(JsonObject fields) throws SchemaViolationErr break; } + case "targetType": { + responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + case "title": { responseData.put(key, jsonAsString(field.getValue(), key)); @@ -8325,6 +8454,19 @@ public CartCustomDiscountAllocation setDiscountedAmount(MoneyV2 arg) { return this; } + /** + * The type of line that the discount is applicable towards. + */ + + public DiscountApplicationTargetType getTargetType() { + return (DiscountApplicationTargetType) get("targetType"); + } + + public CartCustomDiscountAllocation setTargetType(DiscountApplicationTargetType arg) { + optimisticData.put(getKey("targetType"), arg); + return this; + } + /** * The title of the allocated discount. */ @@ -8342,6 +8484,8 @@ public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "discountedAmount": return true; + case "targetType": return false; + case "title": return false; default: return false; @@ -8349,6 +8493,214 @@ public boolean unwrapsToObject(String key) { } } + public interface CartDeliveryCoordinatesPreferenceQueryDefinition { + void define(CartDeliveryCoordinatesPreferenceQuery _queryBuilder); + } + + /** + * Preferred location used to find the closest pick up point based on coordinates. + */ + public static class CartDeliveryCoordinatesPreferenceQuery extends Query { + CartDeliveryCoordinatesPreferenceQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The two-letter code for the country of the preferred location. + * For example, US. + */ + public CartDeliveryCoordinatesPreferenceQuery countryCode() { + startField("countryCode"); + + return this; + } + + /** + * The geographic latitude for a given location. Coordinates are required in order to set pickUpHandle + * for pickup points. + */ + public CartDeliveryCoordinatesPreferenceQuery latitude() { + startField("latitude"); + + return this; + } + + /** + * The geographic longitude for a given location. Coordinates are required in order to set pickUpHandle + * for pickup points. + */ + public CartDeliveryCoordinatesPreferenceQuery longitude() { + startField("longitude"); + + return this; + } + } + + /** + * Preferred location used to find the closest pick up point based on coordinates. + */ + public static class CartDeliveryCoordinatesPreference extends AbstractResponse { + public CartDeliveryCoordinatesPreference() { + } + + public CartDeliveryCoordinatesPreference(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "countryCode": { + responseData.put(key, CountryCode.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "latitude": { + responseData.put(key, jsonAsDouble(field.getValue(), key)); + + break; + } + + case "longitude": { + responseData.put(key, jsonAsDouble(field.getValue(), key)); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "CartDeliveryCoordinatesPreference"; + } + + /** + * The two-letter code for the country of the preferred location. + * For example, US. + */ + + public CountryCode getCountryCode() { + return (CountryCode) get("countryCode"); + } + + public CartDeliveryCoordinatesPreference setCountryCode(CountryCode arg) { + optimisticData.put(getKey("countryCode"), arg); + return this; + } + + /** + * The geographic latitude for a given location. Coordinates are required in order to set pickUpHandle + * for pickup points. + */ + + public Double getLatitude() { + return (Double) get("latitude"); + } + + public CartDeliveryCoordinatesPreference setLatitude(Double arg) { + optimisticData.put(getKey("latitude"), arg); + return this; + } + + /** + * The geographic longitude for a given location. Coordinates are required in order to set pickUpHandle + * for pickup points. + */ + + public Double getLongitude() { + return (Double) get("longitude"); + } + + public CartDeliveryCoordinatesPreference setLongitude(Double arg) { + optimisticData.put(getKey("longitude"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "countryCode": return false; + + case "latitude": return false; + + case "longitude": return false; + + default: return false; + } + } + } + + public static class CartDeliveryCoordinatesPreferenceInput implements Serializable { + private double latitude; + + private double longitude; + + private CountryCode countryCode; + + public CartDeliveryCoordinatesPreferenceInput(double latitude, double longitude, CountryCode countryCode) { + this.latitude = latitude; + + this.longitude = longitude; + + this.countryCode = countryCode; + } + + public double getLatitude() { + return latitude; + } + + public CartDeliveryCoordinatesPreferenceInput setLatitude(double latitude) { + this.latitude = latitude; + return this; + } + + public double getLongitude() { + return longitude; + } + + public CartDeliveryCoordinatesPreferenceInput setLongitude(double longitude) { + this.longitude = longitude; + return this; + } + + public CountryCode getCountryCode() { + return countryCode; + } + + public CartDeliveryCoordinatesPreferenceInput setCountryCode(CountryCode countryCode) { + this.countryCode = countryCode; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("latitude:"); + _queryBuilder.append(latitude); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("longitude:"); + _queryBuilder.append(longitude); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("countryCode:"); + _queryBuilder.append(countryCode.toString()); + + _queryBuilder.append('}'); + } + } + public interface CartDeliveryGroupQueryDefinition { void define(CartDeliveryGroupQuery _queryBuilder); } @@ -9250,6 +9602,308 @@ public boolean unwrapsToObject(String key) { } } + public interface CartDeliveryPreferenceQueryDefinition { + void define(CartDeliveryPreferenceQuery _queryBuilder); + } + + /** + * 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 class CartDeliveryPreferenceQuery extends Query { + CartDeliveryPreferenceQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * Preferred location used to find the closest pick up point based on coordinates. + */ + public CartDeliveryPreferenceQuery coordinates(CartDeliveryCoordinatesPreferenceQueryDefinition queryDef) { + startField("coordinates"); + + _queryBuilder.append('{'); + queryDef.define(new CartDeliveryCoordinatesPreferenceQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The preferred delivery methods such as shipping, local pickup or through pickup points. + */ + public CartDeliveryPreferenceQuery deliveryMethod() { + startField("deliveryMethod"); + + return this; + } + + /** + * 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. + */ + public CartDeliveryPreferenceQuery pickupHandle() { + startField("pickupHandle"); + + return this; + } + } + + /** + * 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 class CartDeliveryPreference extends AbstractResponse { + public CartDeliveryPreference() { + } + + public CartDeliveryPreference(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "coordinates": { + CartDeliveryCoordinatesPreference optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartDeliveryCoordinatesPreference(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "deliveryMethod": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(PreferenceDeliveryMethodType.fromGraphQl(jsonAsString(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "pickupHandle": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + responseData.put(key, list1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "CartDeliveryPreference"; + } + + /** + * Preferred location used to find the closest pick up point based on coordinates. + */ + + public CartDeliveryCoordinatesPreference getCoordinates() { + return (CartDeliveryCoordinatesPreference) get("coordinates"); + } + + public CartDeliveryPreference setCoordinates(CartDeliveryCoordinatesPreference arg) { + optimisticData.put(getKey("coordinates"), arg); + return this; + } + + /** + * The preferred delivery methods such as shipping, local pickup or through pickup points. + */ + + public List getDeliveryMethod() { + return (List) get("deliveryMethod"); + } + + public CartDeliveryPreference setDeliveryMethod(List arg) { + optimisticData.put(getKey("deliveryMethod"), arg); + return this; + } + + /** + * 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. + */ + + public List getPickupHandle() { + return (List) get("pickupHandle"); + } + + public CartDeliveryPreference setPickupHandle(List arg) { + optimisticData.put(getKey("pickupHandle"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "coordinates": return true; + + case "deliveryMethod": return false; + + case "pickupHandle": return false; + + default: return false; + } + } + } + + public static class CartDeliveryPreferenceInput implements Serializable { + private Input> deliveryMethod = Input.undefined(); + + private Input> pickupHandle = Input.undefined(); + + private Input> coordinates = Input.undefined(); + + public List getDeliveryMethod() { + return deliveryMethod.getValue(); + } + + public Input> getDeliveryMethodInput() { + return deliveryMethod; + } + + public CartDeliveryPreferenceInput setDeliveryMethod(List deliveryMethod) { + this.deliveryMethod = Input.optional(deliveryMethod); + return this; + } + + public CartDeliveryPreferenceInput setDeliveryMethodInput(Input> deliveryMethod) { + if (deliveryMethod == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.deliveryMethod = deliveryMethod; + return this; + } + + public List getPickupHandle() { + return pickupHandle.getValue(); + } + + public Input> getPickupHandleInput() { + return pickupHandle; + } + + public CartDeliveryPreferenceInput setPickupHandle(List pickupHandle) { + this.pickupHandle = Input.optional(pickupHandle); + return this; + } + + public CartDeliveryPreferenceInput setPickupHandleInput(Input> pickupHandle) { + if (pickupHandle == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.pickupHandle = pickupHandle; + return this; + } + + public List getCoordinates() { + return coordinates.getValue(); + } + + public Input> getCoordinatesInput() { + return coordinates; + } + + public CartDeliveryPreferenceInput setCoordinates(List coordinates) { + this.coordinates = Input.optional(coordinates); + return this; + } + + public CartDeliveryPreferenceInput setCoordinatesInput(Input> coordinates) { + if (coordinates == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.coordinates = coordinates; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + if (this.deliveryMethod.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("deliveryMethod:"); + if (deliveryMethod.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (PreferenceDeliveryMethodType item1 : deliveryMethod.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + _queryBuilder.append(item1.toString()); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } + + if (this.pickupHandle.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("pickupHandle:"); + if (pickupHandle.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (String item1 : pickupHandle.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + Query.appendQuotedString(_queryBuilder, item1.toString()); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } + + if (this.coordinates.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("coordinates:"); + if (coordinates.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (CartDeliveryCoordinatesPreferenceInput item1 : coordinates.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } + + _queryBuilder.append('}'); + } + } + public static class CartDirectPaymentMethodInput implements Serializable { private MailingAddressInput billingAddress; @@ -9358,6 +10012,15 @@ public CartDiscountAllocationQuery discountedAmount(MoneyV2QueryDefinition query return this; } + /** + * The type of line that the discount is applicable towards. + */ + public CartDiscountAllocationQuery targetType() { + startField("targetType"); + + return this; + } + public CartDiscountAllocationQuery onCartAutomaticDiscountAllocation(CartAutomaticDiscountAllocationQueryDefinition queryDef) { startInlineFragment("CartAutomaticDiscountAllocation"); queryDef.define(new CartAutomaticDiscountAllocationQuery(_queryBuilder)); @@ -9384,6 +10047,8 @@ public interface CartDiscountAllocation { String getGraphQlTypeName(); MoneyV2 getDiscountedAmount(); + + DiscountApplicationTargetType getTargetType(); } /** @@ -9404,6 +10069,12 @@ public UnknownCartDiscountAllocation(JsonObject fields) throws SchemaViolationEr break; } + case "targetType": { + responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -9453,10 +10124,25 @@ public UnknownCartDiscountAllocation setDiscountedAmount(MoneyV2 arg) { return this; } + /** + * The type of line that the discount is applicable towards. + */ + + public DiscountApplicationTargetType getTargetType() { + return (DiscountApplicationTargetType) get("targetType"); + } + + public UnknownCartDiscountAllocation setTargetType(DiscountApplicationTargetType arg) { + optimisticData.put(getKey("targetType"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "discountedAmount": return true; + case "targetType": return false; + default: return false; } } @@ -9813,6 +10499,11 @@ public enum CartErrorCode { */ MISSING_NOTE, + /** + * The note length must be below the specified maximum. + */ + NOTE_TOO_LONG, + /** * The payment method is not supported. */ @@ -9938,6 +10629,10 @@ public static CartErrorCode fromGraphQl(String value) { return MISSING_NOTE; } + case "NOTE_TOO_LONG": { + return NOTE_TOO_LONG; + } + case "PAYMENT_METHOD_NOT_SUPPORTED": { return PAYMENT_METHOD_NOT_SUPPORTED; } @@ -10057,6 +10752,10 @@ public String toString() { return "MISSING_NOTE"; } + case NOTE_TOO_LONG: { + return "NOTE_TOO_LONG"; + } + case PAYMENT_METHOD_NOT_SUPPORTED: { return "PAYMENT_METHOD_NOT_SUPPORTED"; } @@ -10350,6 +11049,131 @@ public void appendTo(StringBuilder _queryBuilder) { } } + public interface CartGiftCardCodesUpdatePayloadQueryDefinition { + void define(CartGiftCardCodesUpdatePayloadQuery _queryBuilder); + } + + /** + * Return type for `cartGiftCardCodesUpdate` mutation. + */ + public static class CartGiftCardCodesUpdatePayloadQuery extends Query { + CartGiftCardCodesUpdatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The updated cart. + */ + public CartGiftCardCodesUpdatePayloadQuery cart(CartQueryDefinition queryDef) { + startField("cart"); + + _queryBuilder.append('{'); + queryDef.define(new CartQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The list of errors that occurred from executing the mutation. + */ + public CartGiftCardCodesUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { + startField("userErrors"); + + _queryBuilder.append('{'); + queryDef.define(new CartUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * Return type for `cartGiftCardCodesUpdate` mutation. + */ + public static class CartGiftCardCodesUpdatePayload extends AbstractResponse { + public CartGiftCardCodesUpdatePayload() { + } + + public CartGiftCardCodesUpdatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cart": { + Cart optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Cart(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartUserError(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "CartGiftCardCodesUpdatePayload"; + } + + /** + * The updated cart. + */ + + public Cart getCart() { + return (Cart) get("cart"); + } + + public CartGiftCardCodesUpdatePayload setCart(Cart arg) { + optimisticData.put(getKey("cart"), arg); + return this; + } + + /** + * The list of errors that occurred from executing the mutation. + */ + + public List getUserErrors() { + return (List) get("userErrors"); + } + + public CartGiftCardCodesUpdatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cart": return true; + + case "userErrors": return true; + + default: return false; + } + } + } + public static class CartInput implements Serializable { private Input> attributes = Input.undefined(); @@ -10357,6 +11181,8 @@ public static class CartInput implements Serializable { private Input> discountCodes = Input.undefined(); + private Input> giftCardCodes = Input.undefined(); + private Input note = Input.undefined(); private Input buyerIdentity = Input.undefined(); @@ -10426,6 +11252,27 @@ public CartInput setDiscountCodesInput(Input> discountCodes) { return this; } + public List getGiftCardCodes() { + return giftCardCodes.getValue(); + } + + public Input> getGiftCardCodesInput() { + return giftCardCodes; + } + + public CartInput setGiftCardCodes(List giftCardCodes) { + this.giftCardCodes = Input.optional(giftCardCodes); + return this; + } + + public CartInput setGiftCardCodesInput(Input> giftCardCodes) { + if (giftCardCodes == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.giftCardCodes = giftCardCodes; + return this; + } + public String getNote() { return note.getValue(); } @@ -10553,6 +11400,26 @@ public void appendTo(StringBuilder _queryBuilder) { } } + if (this.giftCardCodes.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("giftCardCodes:"); + if (giftCardCodes.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (String item1 : giftCardCodes.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + Query.appendQuotedString(_queryBuilder, item1.toString()); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } + if (this.note.isDefined()) { _queryBuilder.append(separator); separator = ","; @@ -12899,108 +13766,62 @@ public boolean unwrapsToObject(String key) { } } - public static class CartSelectedDeliveryOptionInput implements Serializable { - private ID deliveryGroupId; - - private String deliveryOptionHandle; - - public CartSelectedDeliveryOptionInput(ID deliveryGroupId, String deliveryOptionHandle) { - this.deliveryGroupId = deliveryGroupId; - - this.deliveryOptionHandle = deliveryOptionHandle; - } - - public ID getDeliveryGroupId() { - return deliveryGroupId; - } - - public CartSelectedDeliveryOptionInput setDeliveryGroupId(ID deliveryGroupId) { - this.deliveryGroupId = deliveryGroupId; - return this; - } - - public String getDeliveryOptionHandle() { - return deliveryOptionHandle; - } - - public CartSelectedDeliveryOptionInput setDeliveryOptionHandle(String deliveryOptionHandle) { - this.deliveryOptionHandle = deliveryOptionHandle; - return this; - } - - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("deliveryGroupId:"); - Query.appendQuotedString(_queryBuilder, deliveryGroupId.toString()); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("deliveryOptionHandle:"); - Query.appendQuotedString(_queryBuilder, deliveryOptionHandle.toString()); - - _queryBuilder.append('}'); - } - } - - public interface CartSelectedDeliveryOptionsUpdatePayloadQueryDefinition { - void define(CartSelectedDeliveryOptionsUpdatePayloadQuery _queryBuilder); + public interface CartPreferencesQueryDefinition { + void define(CartPreferencesQuery _queryBuilder); } /** - * Return type for `cartSelectedDeliveryOptionsUpdate` mutation. + * 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 class CartSelectedDeliveryOptionsUpdatePayloadQuery extends Query { - CartSelectedDeliveryOptionsUpdatePayloadQuery(StringBuilder _queryBuilder) { + public static class CartPreferencesQuery extends Query { + CartPreferencesQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The updated cart. + * Delivery preferences can be used to prefill the delivery section in at checkout. */ - public CartSelectedDeliveryOptionsUpdatePayloadQuery cart(CartQueryDefinition queryDef) { - startField("cart"); + public CartPreferencesQuery delivery(CartDeliveryPreferenceQueryDefinition queryDef) { + startField("delivery"); _queryBuilder.append('{'); - queryDef.define(new CartQuery(_queryBuilder)); + queryDef.define(new CartDeliveryPreferenceQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. + * Wallet preferences are used to populate relevant payment fields in the checkout flow. + * Accepted value: `["shop_pay"]`. */ - public CartSelectedDeliveryOptionsUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CartUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CartPreferencesQuery wallet() { + startField("wallet"); return this; } } /** - * Return type for `cartSelectedDeliveryOptionsUpdate` mutation. + * 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 class CartSelectedDeliveryOptionsUpdatePayload extends AbstractResponse { - public CartSelectedDeliveryOptionsUpdatePayload() { + public static class CartPreferences extends AbstractResponse { + public CartPreferences() { } - public CartSelectedDeliveryOptionsUpdatePayload(JsonObject fields) throws SchemaViolationError { + public CartPreferences(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cart": { - Cart optional1 = null; + case "delivery": { + CartDeliveryPreference optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Cart(jsonAsObject(field.getValue(), key)); + optional1 = new CartDeliveryPreference(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -13008,13 +13829,18 @@ public CartSelectedDeliveryOptionsUpdatePayload(JsonObject fields) throws Schema break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CartUserError(jsonAsObject(element1, key))); + case "wallet": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + optional1 = list1; } - responseData.put(key, list1); + responseData.put(key, optional1); break; } @@ -13031,66 +13857,209 @@ public CartSelectedDeliveryOptionsUpdatePayload(JsonObject fields) throws Schema } public String getGraphQlTypeName() { - return "CartSelectedDeliveryOptionsUpdatePayload"; + return "CartPreferences"; } /** - * The updated cart. + * Delivery preferences can be used to prefill the delivery section in at checkout. */ - public Cart getCart() { - return (Cart) get("cart"); + public CartDeliveryPreference getDelivery() { + return (CartDeliveryPreference) get("delivery"); } - public CartSelectedDeliveryOptionsUpdatePayload setCart(Cart arg) { - optimisticData.put(getKey("cart"), arg); + public CartPreferences setDelivery(CartDeliveryPreference arg) { + optimisticData.put(getKey("delivery"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * Wallet preferences are used to populate relevant payment fields in the checkout flow. + * Accepted value: `["shop_pay"]`. */ - public List getUserErrors() { - return (List) get("userErrors"); + public List getWallet() { + return (List) get("wallet"); } - public CartSelectedDeliveryOptionsUpdatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public CartPreferences setWallet(List arg) { + optimisticData.put(getKey("wallet"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cart": return true; + case "delivery": return true; - case "userErrors": return true; + case "wallet": return false; default: return false; } } } - public interface CartSubmitForCompletionPayloadQueryDefinition { - void define(CartSubmitForCompletionPayloadQuery _queryBuilder); + public static class CartPreferencesInput implements Serializable { + private Input> delivery = Input.undefined(); + + private Input> wallet = Input.undefined(); + + public List getDelivery() { + return delivery.getValue(); + } + + public Input> getDeliveryInput() { + return delivery; + } + + public CartPreferencesInput setDelivery(List delivery) { + this.delivery = Input.optional(delivery); + return this; + } + + public CartPreferencesInput setDeliveryInput(Input> delivery) { + if (delivery == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.delivery = delivery; + return this; + } + + public List getWallet() { + return wallet.getValue(); + } + + public Input> getWalletInput() { + return wallet; + } + + public CartPreferencesInput setWallet(List wallet) { + this.wallet = Input.optional(wallet); + return this; + } + + public CartPreferencesInput setWalletInput(Input> wallet) { + if (wallet == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.wallet = wallet; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + if (this.delivery.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("delivery:"); + if (delivery.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (CartDeliveryPreferenceInput item1 : delivery.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } + + if (this.wallet.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("wallet:"); + if (wallet.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (String item1 : wallet.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + Query.appendQuotedString(_queryBuilder, item1.toString()); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } + + _queryBuilder.append('}'); + } + } + + public static class CartSelectedDeliveryOptionInput implements Serializable { + private ID deliveryGroupId; + + private String deliveryOptionHandle; + + public CartSelectedDeliveryOptionInput(ID deliveryGroupId, String deliveryOptionHandle) { + this.deliveryGroupId = deliveryGroupId; + + this.deliveryOptionHandle = deliveryOptionHandle; + } + + public ID getDeliveryGroupId() { + return deliveryGroupId; + } + + public CartSelectedDeliveryOptionInput setDeliveryGroupId(ID deliveryGroupId) { + this.deliveryGroupId = deliveryGroupId; + return this; + } + + public String getDeliveryOptionHandle() { + return deliveryOptionHandle; + } + + public CartSelectedDeliveryOptionInput setDeliveryOptionHandle(String deliveryOptionHandle) { + this.deliveryOptionHandle = deliveryOptionHandle; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("deliveryGroupId:"); + Query.appendQuotedString(_queryBuilder, deliveryGroupId.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("deliveryOptionHandle:"); + Query.appendQuotedString(_queryBuilder, deliveryOptionHandle.toString()); + + _queryBuilder.append('}'); + } + } + + public interface CartSelectedDeliveryOptionsUpdatePayloadQueryDefinition { + void define(CartSelectedDeliveryOptionsUpdatePayloadQuery _queryBuilder); } /** - * Return type for `cartSubmitForCompletion` mutation. + * Return type for `cartSelectedDeliveryOptionsUpdate` mutation. */ - public static class CartSubmitForCompletionPayloadQuery extends Query { - CartSubmitForCompletionPayloadQuery(StringBuilder _queryBuilder) { + public static class CartSelectedDeliveryOptionsUpdatePayloadQuery extends Query { + CartSelectedDeliveryOptionsUpdatePayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The result of cart submission for completion. + * The updated cart. */ - public CartSubmitForCompletionPayloadQuery result(CartSubmitForCompletionResultQueryDefinition queryDef) { - startField("result"); + public CartSelectedDeliveryOptionsUpdatePayloadQuery cart(CartQueryDefinition queryDef) { + startField("cart"); _queryBuilder.append('{'); - queryDef.define(new CartSubmitForCompletionResultQuery(_queryBuilder)); + queryDef.define(new CartQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -13099,7 +14068,7 @@ public CartSubmitForCompletionPayloadQuery result(CartSubmitForCompletionResultQ /** * The list of errors that occurred from executing the mutation. */ - public CartSubmitForCompletionPayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { + public CartSelectedDeliveryOptionsUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { startField("userErrors"); _queryBuilder.append('{'); @@ -13111,21 +14080,146 @@ public CartSubmitForCompletionPayloadQuery userErrors(CartUserErrorQueryDefiniti } /** - * Return type for `cartSubmitForCompletion` mutation. + * Return type for `cartSelectedDeliveryOptionsUpdate` mutation. */ - public static class CartSubmitForCompletionPayload extends AbstractResponse { - public CartSubmitForCompletionPayload() { + public static class CartSelectedDeliveryOptionsUpdatePayload extends AbstractResponse { + public CartSelectedDeliveryOptionsUpdatePayload() { } - public CartSubmitForCompletionPayload(JsonObject fields) throws SchemaViolationError { + public CartSelectedDeliveryOptionsUpdatePayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "result": { - CartSubmitForCompletionResult optional1 = null; + case "cart": { + Cart optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = UnknownCartSubmitForCompletionResult.create(jsonAsObject(field.getValue(), key)); + optional1 = new Cart(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartUserError(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "CartSelectedDeliveryOptionsUpdatePayload"; + } + + /** + * The updated cart. + */ + + public Cart getCart() { + return (Cart) get("cart"); + } + + public CartSelectedDeliveryOptionsUpdatePayload setCart(Cart arg) { + optimisticData.put(getKey("cart"), arg); + return this; + } + + /** + * The list of errors that occurred from executing the mutation. + */ + + public List getUserErrors() { + return (List) get("userErrors"); + } + + public CartSelectedDeliveryOptionsUpdatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cart": return true; + + case "userErrors": return true; + + default: return false; + } + } + } + + public interface CartSubmitForCompletionPayloadQueryDefinition { + void define(CartSubmitForCompletionPayloadQuery _queryBuilder); + } + + /** + * Return type for `cartSubmitForCompletion` mutation. + */ + public static class CartSubmitForCompletionPayloadQuery extends Query { + CartSubmitForCompletionPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The result of cart submission for completion. + */ + public CartSubmitForCompletionPayloadQuery result(CartSubmitForCompletionResultQueryDefinition queryDef) { + startField("result"); + + _queryBuilder.append('{'); + queryDef.define(new CartSubmitForCompletionResultQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The list of errors that occurred from executing the mutation. + */ + public CartSubmitForCompletionPayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { + startField("userErrors"); + + _queryBuilder.append('{'); + queryDef.define(new CartUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * Return type for `cartSubmitForCompletion` mutation. + */ + public static class CartSubmitForCompletionPayload extends AbstractResponse { + public CartSubmitForCompletionPayload() { + } + + public CartSubmitForCompletionPayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "result": { + CartSubmitForCompletionResult optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = UnknownCartSubmitForCompletionResult.create(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -13531,210 +14625,188 @@ public void appendTo(StringBuilder _queryBuilder) { } } - public interface CheckoutQueryDefinition { - void define(CheckoutQuery _queryBuilder); + public interface CollectionQueryDefinition { + void define(CollectionQuery _queryBuilder); } /** - * 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. + * A collection represents a grouping of products that a shop owner can create to + * organize them or make their shops easier to browse. */ - public static class CheckoutQuery extends Query { - CheckoutQuery(StringBuilder _queryBuilder) { + public static class CollectionQuery extends Query { + CollectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); startField("id"); } - /** - * The gift cards used on the checkout. - */ - public CheckoutQuery appliedGiftCards(AppliedGiftCardQueryDefinition queryDef) { - startField("appliedGiftCards"); - - _queryBuilder.append('{'); - queryDef.define(new AppliedGiftCardQuery(_queryBuilder)); - _queryBuilder.append('}'); + public class DescriptionArguments extends Arguments { + DescriptionArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - return this; + /** + * Truncates string after the given length. + */ + public DescriptionArguments truncateAt(Integer value) { + if (value != null) { + startArgument("truncateAt"); + _queryBuilder.append(value); + } + return this; + } } - /** - * The available shipping rates for this Checkout. - * Should only be used when checkout `requiresShipping` is `true` and - * the shipping address is valid. - */ - public CheckoutQuery availableShippingRates(AvailableShippingRatesQueryDefinition queryDef) { - startField("availableShippingRates"); - - _queryBuilder.append('{'); - queryDef.define(new AvailableShippingRatesQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + public interface DescriptionArgumentsDefinition { + void define(DescriptionArguments args); } /** - * The identity of the customer associated with the checkout. + * Stripped description of the collection, single line with HTML tags removed. */ - public CheckoutQuery buyerIdentity(CheckoutBuyerIdentityQueryDefinition queryDef) { - startField("buyerIdentity"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutBuyerIdentityQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + public CollectionQuery description() { + return description(args -> {}); } /** - * The date and time when the checkout was completed. + * Stripped description of the collection, single line with HTML tags removed. */ - public CheckoutQuery completedAt() { - startField("completedAt"); + public CollectionQuery description(DescriptionArgumentsDefinition argsDef) { + startField("description"); + + DescriptionArguments args = new DescriptionArguments(_queryBuilder); + argsDef.define(args); + DescriptionArguments.end(args); return this; } /** - * The date and time when the checkout was created. + * The description of the collection, complete with HTML formatting. */ - public CheckoutQuery createdAt() { - startField("createdAt"); + public CollectionQuery descriptionHtml() { + startField("descriptionHtml"); return this; } /** - * The currency code for the checkout. + * A human-friendly unique string for the collection automatically generated from its title. + * Limit of 255 characters. */ - public CheckoutQuery currencyCode() { - startField("currencyCode"); + public CollectionQuery handle() { + startField("handle"); return this; } /** - * A list of extra information that's added to the checkout. + * Image associated with the collection. */ - public CheckoutQuery customAttributes(AttributeQueryDefinition queryDef) { - startField("customAttributes"); + public CollectionQuery image(ImageQueryDefinition queryDef) { + startField("image"); _queryBuilder.append('{'); - queryDef.define(new AttributeQuery(_queryBuilder)); + queryDef.define(new ImageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - public class DiscountApplicationsArguments extends Arguments { - DiscountApplicationsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public DiscountApplicationsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public DiscountApplicationsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the last `n` elements from the list. - */ - public DiscountApplicationsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; + public class MetafieldArguments extends Arguments { + MetafieldArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); } /** - * Returns the elements that come before the specified cursor. + * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. */ - public DiscountApplicationsArguments before(String value) { + public MetafieldArguments namespace(String value) { if (value != null) { - startArgument("before"); + startArgument("namespace"); Query.appendQuotedString(_queryBuilder, value.toString()); } return this; } + } - /** - * Reverse the order of the underlying list. - */ - public DiscountApplicationsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + public interface MetafieldArgumentsDefinition { + void define(MetafieldArguments args); } - public interface DiscountApplicationsArgumentsDefinition { - void define(DiscountApplicationsArguments args); + /** + * Returns a metafield found by namespace and key. + */ + public CollectionQuery metafield(String key, MetafieldQueryDefinition queryDef) { + return metafield(key, args -> {}, queryDef); } /** - * Discounts that have been applied on the checkout. + * Returns a metafield found by namespace and key. */ - public CheckoutQuery discountApplications(DiscountApplicationConnectionQueryDefinition queryDef) { - return discountApplications(args -> {}, queryDef); + public CollectionQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { + startField("metafield"); + + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + argsDef.define(new MetafieldArguments(_queryBuilder)); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * Discounts that have been applied on the checkout. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public CheckoutQuery discountApplications(DiscountApplicationsArgumentsDefinition argsDef, DiscountApplicationConnectionQueryDefinition queryDef) { - startField("discountApplications"); + public CollectionQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); - DiscountApplicationsArguments args = new DiscountApplicationsArguments(_queryBuilder); - argsDef.define(args); - DiscountApplicationsArguments.end(args); + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new DiscountApplicationConnectionQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The email attached to this checkout. + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. */ - public CheckoutQuery email() { - startField("email"); + public CollectionQuery onlineStoreUrl() { + startField("onlineStoreUrl"); return this; } - public class LineItemsArguments extends Arguments { - LineItemsArguments(StringBuilder _queryBuilder) { + public class ProductsArguments extends Arguments { + ProductsArguments(StringBuilder _queryBuilder) { super(_queryBuilder, true); } /** * Returns up to the first `n` elements from the list. */ - public LineItemsArguments first(Integer value) { + public ProductsArguments first(Integer value) { if (value != null) { startArgument("first"); _queryBuilder.append(value); @@ -13745,7 +14817,7 @@ public LineItemsArguments first(Integer value) { /** * Returns the elements that come after the specified cursor. */ - public LineItemsArguments after(String value) { + public ProductsArguments after(String value) { if (value != null) { startArgument("after"); Query.appendQuotedString(_queryBuilder, value.toString()); @@ -13756,7 +14828,7 @@ public LineItemsArguments after(String value) { /** * Returns up to the last `n` elements from the list. */ - public LineItemsArguments last(Integer value) { + public ProductsArguments last(Integer value) { if (value != null) { startArgument("last"); _queryBuilder.append(value); @@ -13767,7 +14839,7 @@ public LineItemsArguments last(Integer value) { /** * Returns the elements that come before the specified cursor. */ - public LineItemsArguments before(String value) { + public ProductsArguments before(String value) { if (value != null) { startArgument("before"); Query.appendQuotedString(_queryBuilder, value.toString()); @@ -13778,450 +14850,222 @@ public LineItemsArguments before(String value) { /** * Reverse the order of the underlying list. */ - public LineItemsArguments reverse(Boolean value) { + public ProductsArguments reverse(Boolean value) { if (value != null) { startArgument("reverse"); _queryBuilder.append(value); } return this; } + + /** + * Sort the underlying list by the given key. + */ + public ProductsArguments sortKey(ProductCollectionSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; + } + + /** + * Returns a subset of products matching all product filters. + * The input must not contain more than `250` values. + */ + public ProductsArguments filters(List value) { + if (value != null) { + startArgument("filters"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ProductFilter item1 : value) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } + return this; + } } - public interface LineItemsArgumentsDefinition { - void define(LineItemsArguments args); + public interface ProductsArgumentsDefinition { + void define(ProductsArguments args); } /** - * A list of line item objects, each one containing information about an item in the checkout. + * List of products in the collection. */ - public CheckoutQuery lineItems(CheckoutLineItemConnectionQueryDefinition queryDef) { - return lineItems(args -> {}, queryDef); + public CollectionQuery products(ProductConnectionQueryDefinition queryDef) { + return products(args -> {}, queryDef); } /** - * A list of line item objects, each one containing information about an item in the checkout. + * List of products in the collection. */ - public CheckoutQuery lineItems(LineItemsArgumentsDefinition argsDef, CheckoutLineItemConnectionQueryDefinition queryDef) { - startField("lineItems"); + public CollectionQuery products(ProductsArgumentsDefinition argsDef, ProductConnectionQueryDefinition queryDef) { + startField("products"); - LineItemsArguments args = new LineItemsArguments(_queryBuilder); + ProductsArguments args = new ProductsArguments(_queryBuilder); argsDef.define(args); - LineItemsArguments.end(args); + ProductsArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new CheckoutLineItemConnectionQuery(_queryBuilder)); + queryDef.define(new ProductConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The sum of all the prices of all the items in the checkout. Duties, taxes, shipping and discounts - * excluded. + * The collection's SEO information. */ - public CheckoutQuery lineItemsSubtotalPrice(MoneyV2QueryDefinition queryDef) { - startField("lineItemsSubtotalPrice"); + public CollectionQuery seo(SEOQueryDefinition queryDef) { + startField("seo"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new SEOQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The note associated with the checkout. + * The collection’s name. Limit of 255 characters. */ - public CheckoutQuery note() { - startField("note"); + public CollectionQuery title() { + startField("title"); return this; } /** - * The resulting order from a paid checkout. + * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for + * tracking the origin of the traffic. */ - public CheckoutQuery order(OrderQueryDefinition queryDef) { - startField("order"); - - _queryBuilder.append('{'); - queryDef.define(new OrderQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CollectionQuery trackingParameters() { + startField("trackingParameters"); return this; } /** - * The Order status page for this Checkout, null when checkout isn't completed. + * The date and time when the collection was last modified. */ - public CheckoutQuery orderStatusUrl() { - startField("orderStatusUrl"); + public CollectionQuery updatedAt() { + startField("updatedAt"); return this; } + } - /** - * The amount left to be paid. This is equal to the cost of the line items, taxes, and shipping, minus - * discounts and gift cards. - */ - public CheckoutQuery paymentDue(MoneyV2QueryDefinition queryDef) { - startField("paymentDue"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + /** + * A collection represents a grouping of products that a shop owner can create to + * organize them or make their shops easier to browse. + */ + public static class Collection extends AbstractResponse implements HasMetafields, MenuItemResource, MetafieldParentResource, MetafieldReference, Node, OnlineStorePublishable, Trackable { + public Collection() { } - /** - * 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. - * - * @deprecated Use `paymentDue` instead. - */ - @Deprecated - public CheckoutQuery paymentDueV2(MoneyV2QueryDefinition queryDef) { - startField("paymentDueV2"); + public Collection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "description": { + responseData.put(key, jsonAsString(field.getValue(), key)); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; - } + case "descriptionHtml": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * 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. - */ - public CheckoutQuery ready() { - startField("ready"); + break; + } - return this; - } + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * States whether or not the fulfillment requires shipping. - */ - public CheckoutQuery requiresShipping() { - startField("requiresShipping"); + break; + } - return this; - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - /** - * The shipping address to where the line items will be shipped. - */ - public CheckoutQuery shippingAddress(MailingAddressQueryDefinition queryDef) { - startField("shippingAddress"); + break; + } - _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "image": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); + } - return this; - } + responseData.put(key, optional1); - /** - * The discounts that have been allocated onto the shipping line by discount applications. - */ - public CheckoutQuery shippingDiscountAllocations(DiscountAllocationQueryDefinition queryDef) { - startField("shippingDiscountAllocations"); + break; + } - _queryBuilder.append('{'); - queryDef.define(new DiscountAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } - return this; - } + responseData.put(key, optional1); - /** - * Once a shipping rate is selected by the customer it's transitioned to a `shipping_line` object. - */ - public CheckoutQuery shippingLine(ShippingRateQueryDefinition queryDef) { - startField("shippingLine"); + break; + } - _queryBuilder.append('{'); - queryDef.define(new ShippingRateQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } - return this; - } + list1.add(optional2); + } - /** - * The price at checkout before shipping and taxes. - */ - public CheckoutQuery subtotalPrice(MoneyV2QueryDefinition queryDef) { - startField("subtotalPrice"); + responseData.put(key, list1); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; - } + case "onlineStoreUrl": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - /** - * The price at checkout before duties, shipping, and taxes. - * - * @deprecated Use `subtotalPrice` instead. - */ - @Deprecated - public CheckoutQuery subtotalPriceV2(MoneyV2QueryDefinition queryDef) { - startField("subtotalPriceV2"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * Whether the checkout is tax exempt. - */ - public CheckoutQuery taxExempt() { - startField("taxExempt"); - - return this; - } - - /** - * Whether taxes are included in the line item and shipping line prices. - */ - public CheckoutQuery taxesIncluded() { - startField("taxesIncluded"); - - return this; - } - - /** - * The sum of all the duties applied to the line items in the checkout. - */ - public CheckoutQuery totalDuties(MoneyV2QueryDefinition queryDef) { - startField("totalDuties"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The sum of all the prices of all the items in the checkout, including taxes and duties. - */ - public CheckoutQuery totalPrice(MoneyV2QueryDefinition queryDef) { - startField("totalPrice"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The sum of all the prices of all the items in the checkout, including taxes and duties. - * - * @deprecated Use `totalPrice` instead. - */ - @Deprecated - public CheckoutQuery totalPriceV2(MoneyV2QueryDefinition queryDef) { - startField("totalPriceV2"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The sum of all the taxes applied to the line items and shipping lines in the checkout. - */ - public CheckoutQuery totalTax(MoneyV2QueryDefinition queryDef) { - startField("totalTax"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The sum of all the taxes applied to the line items and shipping lines in the checkout. - * - * @deprecated Use `totalTax` instead. - */ - @Deprecated - public CheckoutQuery totalTaxV2(MoneyV2QueryDefinition queryDef) { - startField("totalTaxV2"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The date and time when the checkout was last updated. - */ - public CheckoutQuery updatedAt() { - startField("updatedAt"); - - return this; - } - - /** - * The url pointing to the checkout accessible from the web. - */ - public CheckoutQuery webUrl() { - startField("webUrl"); - - return this; - } - } - - /** - * 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. - */ - public static class Checkout extends AbstractResponse implements Node { - public Checkout() { - } - - public Checkout(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "appliedGiftCards": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new AppliedGiftCard(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "availableShippingRates": { - AvailableShippingRates optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new AvailableShippingRates(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "buyerIdentity": { - responseData.put(key, new CheckoutBuyerIdentity(jsonAsObject(field.getValue(), key))); - - break; - } - - case "completedAt": { - DateTime optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = Utils.parseDateTime(jsonAsString(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "createdAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - - break; - } - - case "currencyCode": { - responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "customAttributes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Attribute(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "discountApplications": { - responseData.put(key, new DiscountApplicationConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "email": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - - break; - } - - case "lineItems": { - responseData.put(key, new CheckoutLineItemConnection(jsonAsObject(field.getValue(), key))); + responseData.put(key, optional1); break; } - case "lineItemsSubtotalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "products": { + responseData.put(key, new ProductConnection(jsonAsObject(field.getValue(), key))); break; } - case "note": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "seo": { + responseData.put(key, new SEO(jsonAsObject(field.getValue(), key))); break; } - case "order": { - Order optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Order(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "orderStatusUrl": { + case "trackingParameters": { String optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = jsonAsString(field.getValue(), key); @@ -14232,134 +15076,12 @@ public Checkout(JsonObject fields) throws SchemaViolationError { break; } - case "paymentDue": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "paymentDueV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "ready": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "requiresShipping": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "shippingAddress": { - MailingAddress optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "shippingDiscountAllocations": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new DiscountAllocation(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "shippingLine": { - ShippingRate optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ShippingRate(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "subtotalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "subtotalPriceV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "taxExempt": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "taxesIncluded": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "totalDuties": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "totalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "totalPriceV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "totalTax": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "totalTaxV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - case "updatedAt": { responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); break; } - case "webUrl": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -14371,744 +15093,704 @@ public Checkout(JsonObject fields) throws SchemaViolationError { } } - public Checkout(ID id) { + public Collection(ID id) { this(); optimisticData.put("id", id); } public String getGraphQlTypeName() { - return "Checkout"; + return "Collection"; } /** - * The gift cards used on the checkout. + * Stripped description of the collection, single line with HTML tags removed. */ - public List getAppliedGiftCards() { - return (List) get("appliedGiftCards"); + public String getDescription() { + return (String) get("description"); } - public Checkout setAppliedGiftCards(List arg) { - optimisticData.put(getKey("appliedGiftCards"), arg); + public Collection setDescription(String arg) { + optimisticData.put(getKey("description"), arg); return this; } /** - * The available shipping rates for this Checkout. - * Should only be used when checkout `requiresShipping` is `true` and - * the shipping address is valid. + * The description of the collection, complete with HTML formatting. */ - public AvailableShippingRates getAvailableShippingRates() { - return (AvailableShippingRates) get("availableShippingRates"); + public String getDescriptionHtml() { + return (String) get("descriptionHtml"); } - public Checkout setAvailableShippingRates(AvailableShippingRates arg) { - optimisticData.put(getKey("availableShippingRates"), arg); + public Collection setDescriptionHtml(String arg) { + optimisticData.put(getKey("descriptionHtml"), arg); return this; } /** - * The identity of the customer associated with the checkout. + * A human-friendly unique string for the collection automatically generated from its title. + * Limit of 255 characters. */ - public CheckoutBuyerIdentity getBuyerIdentity() { - return (CheckoutBuyerIdentity) get("buyerIdentity"); + public String getHandle() { + return (String) get("handle"); } - public Checkout setBuyerIdentity(CheckoutBuyerIdentity arg) { - optimisticData.put(getKey("buyerIdentity"), arg); + public Collection setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); return this; } /** - * The date and time when the checkout was completed. + * A globally-unique ID. */ - public DateTime getCompletedAt() { - return (DateTime) get("completedAt"); - } - - public Checkout setCompletedAt(DateTime arg) { - optimisticData.put(getKey("completedAt"), arg); - return this; + public ID getId() { + return (ID) get("id"); } /** - * The date and time when the checkout was created. + * Image associated with the collection. */ - public DateTime getCreatedAt() { - return (DateTime) get("createdAt"); + public Image getImage() { + return (Image) get("image"); } - public Checkout setCreatedAt(DateTime arg) { - optimisticData.put(getKey("createdAt"), arg); + public Collection setImage(Image arg) { + optimisticData.put(getKey("image"), arg); return this; } /** - * The currency code for the checkout. + * Returns a metafield found by namespace and key. */ - public CurrencyCode getCurrencyCode() { - return (CurrencyCode) get("currencyCode"); + public Metafield getMetafield() { + return (Metafield) get("metafield"); } - public Checkout setCurrencyCode(CurrencyCode arg) { - optimisticData.put(getKey("currencyCode"), arg); + public Collection setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); return this; } /** - * A list of extra information that's added to the checkout. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public List getCustomAttributes() { - return (List) get("customAttributes"); + public List getMetafields() { + return (List) get("metafields"); } - public Checkout setCustomAttributes(List arg) { - optimisticData.put(getKey("customAttributes"), arg); + public Collection setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); return this; } /** - * Discounts that have been applied on the checkout. + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. */ - public DiscountApplicationConnection getDiscountApplications() { - return (DiscountApplicationConnection) get("discountApplications"); + public String getOnlineStoreUrl() { + return (String) get("onlineStoreUrl"); } - public Checkout setDiscountApplications(DiscountApplicationConnection arg) { - optimisticData.put(getKey("discountApplications"), arg); + public Collection setOnlineStoreUrl(String arg) { + optimisticData.put(getKey("onlineStoreUrl"), arg); return this; } /** - * The email attached to this checkout. + * List of products in the collection. */ - public String getEmail() { - return (String) get("email"); + public ProductConnection getProducts() { + return (ProductConnection) get("products"); } - public Checkout setEmail(String arg) { - optimisticData.put(getKey("email"), arg); + public Collection setProducts(ProductConnection arg) { + optimisticData.put(getKey("products"), arg); return this; } /** - * A globally-unique ID. - */ - - public ID getId() { - return (ID) get("id"); - } - - /** - * A list of line item objects, each one containing information about an item in the checkout. + * The collection's SEO information. */ - public CheckoutLineItemConnection getLineItems() { - return (CheckoutLineItemConnection) get("lineItems"); + public SEO getSeo() { + return (SEO) get("seo"); } - public Checkout setLineItems(CheckoutLineItemConnection arg) { - optimisticData.put(getKey("lineItems"), arg); + public Collection setSeo(SEO arg) { + optimisticData.put(getKey("seo"), arg); return this; } /** - * The sum of all the prices of all the items in the checkout. Duties, taxes, shipping and discounts - * excluded. + * The collection’s name. Limit of 255 characters. */ - public MoneyV2 getLineItemsSubtotalPrice() { - return (MoneyV2) get("lineItemsSubtotalPrice"); + public String getTitle() { + return (String) get("title"); } - public Checkout setLineItemsSubtotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("lineItemsSubtotalPrice"), arg); + public Collection setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } /** - * The note associated with the checkout. + * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for + * tracking the origin of the traffic. */ - public String getNote() { - return (String) get("note"); + public String getTrackingParameters() { + return (String) get("trackingParameters"); } - public Checkout setNote(String arg) { - optimisticData.put(getKey("note"), arg); + public Collection setTrackingParameters(String arg) { + optimisticData.put(getKey("trackingParameters"), arg); return this; } /** - * The resulting order from a paid checkout. + * The date and time when the collection was last modified. */ - public Order getOrder() { - return (Order) get("order"); + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); } - public Checkout setOrder(Order arg) { - optimisticData.put(getKey("order"), arg); + public Collection setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); return this; } - /** - * The Order status page for this Checkout, null when checkout isn't completed. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "description": return false; - public String getOrderStatusUrl() { - return (String) get("orderStatusUrl"); - } + case "descriptionHtml": return false; - public Checkout setOrderStatusUrl(String arg) { - optimisticData.put(getKey("orderStatusUrl"), arg); - return this; - } + case "handle": return false; - /** - * The amount left to be paid. This is equal to the cost of the line items, taxes, and shipping, minus - * discounts and gift cards. - */ + case "id": return false; - public MoneyV2 getPaymentDue() { - return (MoneyV2) get("paymentDue"); - } + case "image": return true; - public Checkout setPaymentDue(MoneyV2 arg) { - optimisticData.put(getKey("paymentDue"), arg); - return this; - } + case "metafield": return true; - /** - * 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. - * - * @deprecated Use `paymentDue` instead. - */ + case "metafields": return true; - public MoneyV2 getPaymentDueV2() { - return (MoneyV2) get("paymentDueV2"); - } + case "onlineStoreUrl": return false; - public Checkout setPaymentDueV2(MoneyV2 arg) { - optimisticData.put(getKey("paymentDueV2"), arg); - return this; - } + case "products": return true; - /** - * 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. - */ + case "seo": return true; - public Boolean getReady() { - return (Boolean) get("ready"); - } + case "title": return false; - public Checkout setReady(Boolean arg) { - optimisticData.put(getKey("ready"), arg); - return this; - } + case "trackingParameters": return false; - /** - * States whether or not the fulfillment requires shipping. - */ + case "updatedAt": return false; - public Boolean getRequiresShipping() { - return (Boolean) get("requiresShipping"); + default: return false; + } } + } - public Checkout setRequiresShipping(Boolean arg) { - optimisticData.put(getKey("requiresShipping"), arg); - return this; + public interface CollectionConnectionQueryDefinition { + void define(CollectionConnectionQuery _queryBuilder); + } + + /** + * An auto-generated type for paginating through multiple Collections. + */ + public static class CollectionConnectionQuery extends Query { + CollectionConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The shipping address to where the line items will be shipped. + * A list of edges. */ + public CollectionConnectionQuery edges(CollectionEdgeQueryDefinition queryDef) { + startField("edges"); - public MailingAddress getShippingAddress() { - return (MailingAddress) get("shippingAddress"); - } + _queryBuilder.append('{'); + queryDef.define(new CollectionEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Checkout setShippingAddress(MailingAddress arg) { - optimisticData.put(getKey("shippingAddress"), arg); return this; } /** - * The discounts that have been allocated onto the shipping line by discount applications. + * A list of the nodes contained in CollectionEdge. */ + public CollectionConnectionQuery nodes(CollectionQueryDefinition queryDef) { + startField("nodes"); - public List getShippingDiscountAllocations() { - return (List) get("shippingDiscountAllocations"); - } + _queryBuilder.append('{'); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Checkout setShippingDiscountAllocations(List arg) { - optimisticData.put(getKey("shippingDiscountAllocations"), arg); return this; } /** - * Once a shipping rate is selected by the customer it's transitioned to a `shipping_line` object. + * Information to aid in pagination. */ + public CollectionConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - public ShippingRate getShippingLine() { - return (ShippingRate) get("shippingLine"); - } + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Checkout setShippingLine(ShippingRate arg) { - optimisticData.put(getKey("shippingLine"), arg); return this; } /** - * The price at checkout before shipping and taxes. + * The total count of Collections. */ + public CollectionConnectionQuery totalCount() { + startField("totalCount"); - public MoneyV2 getSubtotalPrice() { - return (MoneyV2) get("subtotalPrice"); - } - - public Checkout setSubtotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("subtotalPrice"), arg); return this; } + } - /** - * The price at checkout before duties, shipping, and taxes. - * - * @deprecated Use `subtotalPrice` instead. - */ - - public MoneyV2 getSubtotalPriceV2() { - return (MoneyV2) get("subtotalPriceV2"); - } - - public Checkout setSubtotalPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("subtotalPriceV2"), arg); - return this; - } - - /** - * Whether the checkout is tax exempt. - */ - - public Boolean getTaxExempt() { - return (Boolean) get("taxExempt"); - } - - public Checkout setTaxExempt(Boolean arg) { - optimisticData.put(getKey("taxExempt"), arg); - return this; + /** + * An auto-generated type for paginating through multiple Collections. + */ + public static class CollectionConnection extends AbstractResponse { + public CollectionConnection() { } - /** - * Whether taxes are included in the line item and shipping line prices. - */ + public CollectionConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CollectionEdge(jsonAsObject(element1, key))); + } - public Boolean getTaxesIncluded() { - return (Boolean) get("taxesIncluded"); - } + responseData.put(key, list1); - public Checkout setTaxesIncluded(Boolean arg) { - optimisticData.put(getKey("taxesIncluded"), arg); - return this; - } + break; + } - /** - * The sum of all the duties applied to the line items in the checkout. - */ + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Collection(jsonAsObject(element1, key))); + } - public MoneyV2 getTotalDuties() { - return (MoneyV2) get("totalDuties"); - } + responseData.put(key, list1); - public Checkout setTotalDuties(MoneyV2 arg) { - optimisticData.put(getKey("totalDuties"), arg); - return this; - } + break; + } - /** - * The sum of all the prices of all the items in the checkout, including taxes and duties. - */ + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - public MoneyV2 getTotalPrice() { - return (MoneyV2) get("totalPrice"); - } + break; + } - public Checkout setTotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("totalPrice"), arg); - return this; - } + case "totalCount": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * The sum of all the prices of all the items in the checkout, including taxes and duties. - * - * @deprecated Use `totalPrice` instead. - */ + break; + } - public MoneyV2 getTotalPriceV2() { - return (MoneyV2) get("totalPriceV2"); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public Checkout setTotalPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("totalPriceV2"), arg); - return this; + public String getGraphQlTypeName() { + return "CollectionConnection"; } /** - * The sum of all the taxes applied to the line items and shipping lines in the checkout. + * A list of edges. */ - public MoneyV2 getTotalTax() { - return (MoneyV2) get("totalTax"); + public List getEdges() { + return (List) get("edges"); } - public Checkout setTotalTax(MoneyV2 arg) { - optimisticData.put(getKey("totalTax"), arg); + public CollectionConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * The sum of all the taxes applied to the line items and shipping lines in the checkout. - * - * @deprecated Use `totalTax` instead. + * A list of the nodes contained in CollectionEdge. */ - public MoneyV2 getTotalTaxV2() { - return (MoneyV2) get("totalTaxV2"); + public List getNodes() { + return (List) get("nodes"); } - public Checkout setTotalTaxV2(MoneyV2 arg) { - optimisticData.put(getKey("totalTaxV2"), arg); + public CollectionConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * The date and time when the checkout was last updated. + * Information to aid in pagination. */ - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public Checkout setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); + public CollectionConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } /** - * The url pointing to the checkout accessible from the web. + * The total count of Collections. */ - public String getWebUrl() { - return (String) get("webUrl"); + public String getTotalCount() { + return (String) get("totalCount"); } - public Checkout setWebUrl(String arg) { - optimisticData.put(getKey("webUrl"), arg); + public CollectionConnection setTotalCount(String arg) { + optimisticData.put(getKey("totalCount"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "appliedGiftCards": return true; - - case "availableShippingRates": return true; - - case "buyerIdentity": return true; - - case "completedAt": return false; - - case "createdAt": return false; - - case "currencyCode": return false; - - case "customAttributes": return true; + case "edges": return true; - case "discountApplications": return true; + case "nodes": return true; - case "email": return false; + case "pageInfo": return true; - case "id": return false; + case "totalCount": return false; - case "lineItems": return true; + default: return false; + } + } + } - case "lineItemsSubtotalPrice": return true; + public interface CollectionEdgeQueryDefinition { + void define(CollectionEdgeQuery _queryBuilder); + } - case "note": return false; + /** + * An auto-generated type which holds one Collection and a cursor during pagination. + */ + public static class CollectionEdgeQuery extends Query { + CollectionEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "order": return true; + /** + * A cursor for use in pagination. + */ + public CollectionEdgeQuery cursor() { + startField("cursor"); - case "orderStatusUrl": return false; + return this; + } - case "paymentDue": return true; + /** + * The item at the end of CollectionEdge. + */ + public CollectionEdgeQuery node(CollectionQueryDefinition queryDef) { + startField("node"); - case "paymentDueV2": return true; + _queryBuilder.append('{'); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "ready": return false; + return this; + } + } - case "requiresShipping": return false; + /** + * An auto-generated type which holds one Collection and a cursor during pagination. + */ + public static class CollectionEdge extends AbstractResponse { + public CollectionEdge() { + } - case "shippingAddress": return true; + public CollectionEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case "shippingDiscountAllocations": return true; + break; + } - case "shippingLine": return true; + case "node": { + responseData.put(key, new Collection(jsonAsObject(field.getValue(), key))); - case "subtotalPrice": return true; + break; + } - case "subtotalPriceV2": return true; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - case "taxExempt": return false; + public String getGraphQlTypeName() { + return "CollectionEdge"; + } - case "taxesIncluded": return false; + /** + * A cursor for use in pagination. + */ - case "totalDuties": return true; + public String getCursor() { + return (String) get("cursor"); + } - case "totalPrice": return true; + public CollectionEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); + return this; + } - case "totalPriceV2": return true; + /** + * The item at the end of CollectionEdge. + */ - case "totalTax": return true; + public Collection getNode() { + return (Collection) get("node"); + } - case "totalTaxV2": return true; + public CollectionEdge setNode(Collection arg) { + optimisticData.put(getKey("node"), arg); + return this; + } - case "updatedAt": return false; + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - case "webUrl": return false; + case "node": return true; default: return false; } } } - public static class CheckoutAttributesUpdateV2Input implements Serializable { - private Input note = Input.undefined(); - - private Input> customAttributes = Input.undefined(); + /** + * The set of valid sort keys for the Collection query. + */ + public enum CollectionSortKeys { + /** + * Sort by the `id` value. + */ + ID, - private Input allowPartialAddresses = Input.undefined(); + /** + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. + */ + RELEVANCE, - public String getNote() { - return note.getValue(); - } + /** + * Sort by the `title` value. + */ + TITLE, - public Input getNoteInput() { - return note; - } + /** + * Sort by the `updated_at` value. + */ + UPDATED_AT, - public CheckoutAttributesUpdateV2Input setNote(String note) { - this.note = Input.optional(note); - return this; - } + UNKNOWN_VALUE; - public CheckoutAttributesUpdateV2Input setNoteInput(Input note) { - if (note == null) { - throw new IllegalArgumentException("Input can not be null"); + public static CollectionSortKeys fromGraphQl(String value) { + if (value == null) { + return null; } - this.note = note; - return this; - } - public List getCustomAttributes() { - return customAttributes.getValue(); - } - - public Input> getCustomAttributesInput() { - return customAttributes; - } - - public CheckoutAttributesUpdateV2Input setCustomAttributes(List customAttributes) { - this.customAttributes = Input.optional(customAttributes); - return this; - } - - public CheckoutAttributesUpdateV2Input setCustomAttributesInput(Input> customAttributes) { - if (customAttributes == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.customAttributes = customAttributes; - return this; - } + switch (value) { + case "ID": { + return ID; + } - public Boolean getAllowPartialAddresses() { - return allowPartialAddresses.getValue(); - } + case "RELEVANCE": { + return RELEVANCE; + } - public Input getAllowPartialAddressesInput() { - return allowPartialAddresses; - } + case "TITLE": { + return TITLE; + } - public CheckoutAttributesUpdateV2Input setAllowPartialAddresses(Boolean allowPartialAddresses) { - this.allowPartialAddresses = Input.optional(allowPartialAddresses); - return this; - } + case "UPDATED_AT": { + return UPDATED_AT; + } - public CheckoutAttributesUpdateV2Input setAllowPartialAddressesInput(Input allowPartialAddresses) { - if (allowPartialAddresses == null) { - throw new IllegalArgumentException("Input can not be null"); + default: { + return UNKNOWN_VALUE; + } } - this.allowPartialAddresses = allowPartialAddresses; - return this; } + public String toString() { + switch (this) { + case ID: { + return "ID"; + } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + case RELEVANCE: { + return "RELEVANCE"; + } - if (this.note.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("note:"); - if (note.getValue() != null) { - Query.appendQuotedString(_queryBuilder, note.getValue().toString()); - } else { - _queryBuilder.append("null"); + case TITLE: { + return "TITLE"; } - } - if (this.customAttributes.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("customAttributes:"); - if (customAttributes.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (AttributeInput item1 : customAttributes.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - } else { - _queryBuilder.append("null"); + case UPDATED_AT: { + return "UPDATED_AT"; } - } - if (this.allowPartialAddresses.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("allowPartialAddresses:"); - if (allowPartialAddresses.getValue() != null) { - _queryBuilder.append(allowPartialAddresses.getValue()); - } else { - _queryBuilder.append("null"); + default: { + return ""; } } - - _queryBuilder.append('}'); } } - public interface CheckoutAttributesUpdateV2PayloadQueryDefinition { - void define(CheckoutAttributesUpdateV2PayloadQuery _queryBuilder); + public interface CommentQueryDefinition { + void define(CommentQuery _queryBuilder); } /** - * Return type for `checkoutAttributesUpdateV2` mutation. + * A comment on an article. */ - public static class CheckoutAttributesUpdateV2PayloadQuery extends Query { - CheckoutAttributesUpdateV2PayloadQuery(StringBuilder _queryBuilder) { + public static class CommentQuery extends Query { + CommentQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * The updated checkout object. + * The comment’s author. */ - public CheckoutAttributesUpdateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + public CommentQuery author(CommentAuthorQueryDefinition queryDef) { + startField("author"); _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); + queryDef.define(new CommentAuthorQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + public class ContentArguments extends Arguments { + ContentArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * Truncates string after the given length. + */ + public ContentArguments truncateAt(Integer value) { + if (value != null) { + startArgument("truncateAt"); + _queryBuilder.append(value); + } + return this; + } + } + + public interface ContentArgumentsDefinition { + void define(ContentArguments args); + } + /** - * The list of errors that occurred from executing the mutation. + * Stripped content of the comment, single line with HTML tags removed. */ - public CheckoutAttributesUpdateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + public CommentQuery content() { + return content(args -> {}); + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Stripped content of the comment, single line with HTML tags removed. + */ + public CommentQuery content(ContentArgumentsDefinition argsDef) { + startField("content"); + + ContentArguments args = new ContentArguments(_queryBuilder); + argsDef.define(args); + ContentArguments.end(args); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The content of the comment, complete with HTML formatting. */ - @Deprecated - public CheckoutAttributesUpdateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CommentQuery contentHtml() { + startField("contentHtml"); return this; } } /** - * Return type for `checkoutAttributesUpdateV2` mutation. + * A comment on an article. */ - public static class CheckoutAttributesUpdateV2Payload extends AbstractResponse { - public CheckoutAttributesUpdateV2Payload() { + public static class Comment extends AbstractResponse implements Node { + public Comment() { } - public CheckoutAttributesUpdateV2Payload(JsonObject fields) throws SchemaViolationError { + public Comment(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "author": { + responseData.put(key, new CommentAuthor(jsonAsObject(field.getValue(), key))); break; } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "content": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + case "contentHtml": { + responseData.put(key, jsonAsString(field.getValue(), key)); - responseData.put(key, list1); + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); break; } @@ -15124,105 +15806,128 @@ public CheckoutAttributesUpdateV2Payload(JsonObject fields) throws SchemaViolati } } + public Comment(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "CheckoutAttributesUpdateV2Payload"; + return "Comment"; } /** - * The updated checkout object. + * The comment’s author. */ - public Checkout getCheckout() { - return (Checkout) get("checkout"); + public CommentAuthor getAuthor() { + return (CommentAuthor) get("author"); } - public CheckoutAttributesUpdateV2Payload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); + public Comment setAuthor(CommentAuthor arg) { + optimisticData.put(getKey("author"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * Stripped content of the comment, single line with HTML tags removed. */ - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); + public String getContent() { + return (String) get("content"); } - public CheckoutAttributesUpdateV2Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); + public Comment setContent(String arg) { + optimisticData.put(getKey("content"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The content of the comment, complete with HTML formatting. */ - public List getUserErrors() { - return (List) get("userErrors"); + public String getContentHtml() { + return (String) get("contentHtml"); } - public CheckoutAttributesUpdateV2Payload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public Comment setContentHtml(String arg) { + optimisticData.put(getKey("contentHtml"), arg); return this; } + /** + * A globally-unique ID. + */ + + public ID getId() { + return (ID) get("id"); + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "checkout": return true; + case "author": return true; + + case "content": return false; - case "checkoutUserErrors": return true; + case "contentHtml": return false; - case "userErrors": return true; + case "id": return false; default: return false; } } } - public interface CheckoutBuyerIdentityQueryDefinition { - void define(CheckoutBuyerIdentityQuery _queryBuilder); + public interface CommentAuthorQueryDefinition { + void define(CommentAuthorQuery _queryBuilder); } /** - * The identity of the customer associated with the checkout. + * The author of a comment. */ - public static class CheckoutBuyerIdentityQuery extends Query { - CheckoutBuyerIdentityQuery(StringBuilder _queryBuilder) { + public static class CommentAuthorQuery extends Query { + CommentAuthorQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The country code for the checkout. For example, `CA`. + * The author's email. */ - public CheckoutBuyerIdentityQuery countryCode() { - startField("countryCode"); + public CommentAuthorQuery email() { + startField("email"); + + return this; + } + + /** + * The author’s name. + */ + public CommentAuthorQuery name() { + startField("name"); return this; } } /** - * The identity of the customer associated with the checkout. + * The author of a comment. */ - public static class CheckoutBuyerIdentity extends AbstractResponse { - public CheckoutBuyerIdentity() { + public static class CommentAuthor extends AbstractResponse { + public CommentAuthor() { } - public CheckoutBuyerIdentity(JsonObject fields) throws SchemaViolationError { + public CommentAuthor(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "countryCode": { - CountryCode optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = CountryCode.fromGraphQl(jsonAsString(field.getValue(), key)); - } + case "email": { + responseData.put(key, jsonAsString(field.getValue(), key)); - responseData.put(key, optional1); + break; + } + + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -15239,109 +15944,92 @@ public CheckoutBuyerIdentity(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CheckoutBuyerIdentity"; + return "CommentAuthor"; } /** - * The country code for the checkout. For example, `CA`. + * The author's email. */ - public CountryCode getCountryCode() { - return (CountryCode) get("countryCode"); + public String getEmail() { + return (String) get("email"); } - public CheckoutBuyerIdentity setCountryCode(CountryCode arg) { - optimisticData.put(getKey("countryCode"), arg); + public CommentAuthor setEmail(String arg) { + optimisticData.put(getKey("email"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "countryCode": return false; - - default: return false; - } - } - } - - public static class CheckoutBuyerIdentityInput implements Serializable { - private CountryCode countryCode; - - public CheckoutBuyerIdentityInput(CountryCode countryCode) { - this.countryCode = countryCode; - } + /** + * The author’s name. + */ - public CountryCode getCountryCode() { - return countryCode; + public String getName() { + return (String) get("name"); } - public CheckoutBuyerIdentityInput setCountryCode(CountryCode countryCode) { - this.countryCode = countryCode; + public CommentAuthor setName(String arg) { + optimisticData.put(getKey("name"), arg); return this; } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "email": return false; - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("countryCode:"); - _queryBuilder.append(countryCode.toString()); + case "name": return false; - _queryBuilder.append('}'); + default: return false; + } } } - public interface CheckoutCompleteFreePayloadQueryDefinition { - void define(CheckoutCompleteFreePayloadQuery _queryBuilder); + public interface CommentConnectionQueryDefinition { + void define(CommentConnectionQuery _queryBuilder); } /** - * Return type for `checkoutCompleteFree` mutation. + * An auto-generated type for paginating through multiple Comments. */ - public static class CheckoutCompleteFreePayloadQuery extends Query { - CheckoutCompleteFreePayloadQuery(StringBuilder _queryBuilder) { + public static class CommentConnectionQuery extends Query { + CommentConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The updated checkout object. + * A list of edges. */ - public CheckoutCompleteFreePayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + public CommentConnectionQuery edges(CommentEdgeQueryDefinition queryDef) { + startField("edges"); _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); + queryDef.define(new CommentEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. + * A list of the nodes contained in CommentEdge. */ - public CheckoutCompleteFreePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + public CommentConnectionQuery nodes(CommentQueryDefinition queryDef) { + startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + queryDef.define(new CommentQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * Information to aid in pagination. */ - @Deprecated - public CheckoutCompleteFreePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public CommentConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new PageInfoQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -15349,32 +16037,32 @@ public CheckoutCompleteFreePayloadQuery userErrors(UserErrorQueryDefinition quer } /** - * Return type for `checkoutCompleteFree` mutation. + * An auto-generated type for paginating through multiple Comments. */ - public static class CheckoutCompleteFreePayload extends AbstractResponse { - public CheckoutCompleteFreePayload() { + public static class CommentConnection extends AbstractResponse { + public CommentConnection() { } - public CheckoutCompleteFreePayload(JsonObject fields) throws SchemaViolationError { + public CommentConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CommentEdge(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); + case "nodes": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); + list1.add(new Comment(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -15382,13 +16070,8 @@ public CheckoutCompleteFreePayload(JsonObject fields) throws SchemaViolationErro break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } @@ -15405,125 +16088,90 @@ public CheckoutCompleteFreePayload(JsonObject fields) throws SchemaViolationErro } public String getGraphQlTypeName() { - return "CheckoutCompleteFreePayload"; + return "CommentConnection"; } /** - * The updated checkout object. + * A list of edges. */ - public Checkout getCheckout() { - return (Checkout) get("checkout"); + public List getEdges() { + return (List) get("edges"); } - public CheckoutCompleteFreePayload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); + public CommentConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * A list of the nodes contained in CommentEdge. */ - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); + public List getNodes() { + return (List) get("nodes"); } - public CheckoutCompleteFreePayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); + public CommentConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * Information to aid in pagination. */ - public List getUserErrors() { - return (List) get("userErrors"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public CheckoutCompleteFreePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public CommentConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "checkout": return true; + case "edges": return true; - case "checkoutUserErrors": return true; + case "nodes": return true; - case "userErrors": return true; + case "pageInfo": return true; default: return false; } } } - public interface CheckoutCompleteWithCreditCardV2PayloadQueryDefinition { - void define(CheckoutCompleteWithCreditCardV2PayloadQuery _queryBuilder); + public interface CommentEdgeQueryDefinition { + void define(CommentEdgeQuery _queryBuilder); } /** - * Return type for `checkoutCompleteWithCreditCardV2` mutation. + * An auto-generated type which holds one Comment and a cursor during pagination. */ - public static class CheckoutCompleteWithCreditCardV2PayloadQuery extends Query { - CheckoutCompleteWithCreditCardV2PayloadQuery(StringBuilder _queryBuilder) { + public static class CommentEdgeQuery extends Query { + CommentEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The checkout on which the payment was applied. - */ - public CheckoutCompleteWithCreditCardV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - */ - public CheckoutCompleteWithCreditCardV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * A representation of the attempted payment. + * A cursor for use in pagination. */ - public CheckoutCompleteWithCreditCardV2PayloadQuery payment(PaymentQueryDefinition queryDef) { - startField("payment"); - - _queryBuilder.append('{'); - queryDef.define(new PaymentQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CommentEdgeQuery cursor() { + startField("cursor"); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The item at the end of CommentEdge. */ - @Deprecated - public CheckoutCompleteWithCreditCardV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public CommentEdgeQuery node(CommentQueryDefinition queryDef) { + startField("node"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new CommentQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -15531,57 +16179,25 @@ public CheckoutCompleteWithCreditCardV2PayloadQuery userErrors(UserErrorQueryDef } /** - * Return type for `checkoutCompleteWithCreditCardV2` mutation. + * An auto-generated type which holds one Comment and a cursor during pagination. */ - public static class CheckoutCompleteWithCreditCardV2Payload extends AbstractResponse { - public CheckoutCompleteWithCreditCardV2Payload() { + public static class CommentEdge extends AbstractResponse { + public CommentEdge() { } - public CheckoutCompleteWithCreditCardV2Payload(JsonObject fields) throws SchemaViolationError { + public CommentEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "payment": { - Payment optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Payment(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "node": { + responseData.put(key, new Comment(jsonAsObject(field.getValue(), key))); break; } @@ -15598,162 +16214,196 @@ public CheckoutCompleteWithCreditCardV2Payload(JsonObject fields) throws SchemaV } public String getGraphQlTypeName() { - return "CheckoutCompleteWithCreditCardV2Payload"; + return "CommentEdge"; } /** - * The checkout on which the payment was applied. + * A cursor for use in pagination. */ - public Checkout getCheckout() { - return (Checkout) get("checkout"); + public String getCursor() { + return (String) get("cursor"); } - public CheckoutCompleteWithCreditCardV2Payload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); + public CommentEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The item at the end of CommentEdge. */ - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); + public Comment getNode() { + return (Comment) get("node"); } - public CheckoutCompleteWithCreditCardV2Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); + public CommentEdge setNode(Comment arg) { + optimisticData.put(getKey("node"), arg); return this; } - /** - * A representation of the attempted payment. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; + + case "node": return true; - public Payment getPayment() { - return (Payment) get("payment"); + default: return false; + } } + } - public CheckoutCompleteWithCreditCardV2Payload setPayment(Payment arg) { - optimisticData.put(getKey("payment"), arg); - return this; + public interface CompanyQueryDefinition { + void define(CompanyQuery _queryBuilder); + } + + /** + * Represents information about a company which is also a customer of the shop. + */ + public static class CompanyQuery extends Query { + CompanyQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * was created in Shopify. */ + public CompanyQuery createdAt() { + startField("createdAt"); - public List getUserErrors() { - return (List) get("userErrors"); - } - - public CheckoutCompleteWithCreditCardV2Payload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; - - case "checkoutUserErrors": return true; + /** + * A unique externally-supplied ID for the company. + */ + public CompanyQuery externalId() { + startField("externalId"); - case "payment": return true; + return this; + } - case "userErrors": return true; + public class MetafieldArguments extends Arguments { + MetafieldArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } - default: return false; + /** + * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. + */ + public MetafieldArguments namespace(String value) { + if (value != null) { + startArgument("namespace"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; } } - } - public interface CheckoutCompleteWithTokenizedPaymentV3PayloadQueryDefinition { - void define(CheckoutCompleteWithTokenizedPaymentV3PayloadQuery _queryBuilder); - } + public interface MetafieldArgumentsDefinition { + void define(MetafieldArguments args); + } - /** - * Return type for `checkoutCompleteWithTokenizedPaymentV3` mutation. - */ - public static class CheckoutCompleteWithTokenizedPaymentV3PayloadQuery extends Query { - CheckoutCompleteWithTokenizedPaymentV3PayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + /** + * Returns a metafield found by namespace and key. + */ + public CompanyQuery metafield(String key, MetafieldQueryDefinition queryDef) { + return metafield(key, args -> {}, queryDef); } /** - * The checkout on which the payment was applied. + * Returns a metafield found by namespace and key. */ - public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + public CompanyQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { + startField("metafield"); + + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + argsDef.define(new MetafieldArguments(_queryBuilder)); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + public CompanyQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); + + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A representation of the attempted payment. + * The name of the company. */ - public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery payment(PaymentQueryDefinition queryDef) { - startField("payment"); - - _queryBuilder.append('{'); - queryDef.define(new PaymentQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CompanyQuery name() { + startField("name"); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * was last modified. */ - @Deprecated - public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CompanyQuery updatedAt() { + startField("updatedAt"); return this; } } /** - * Return type for `checkoutCompleteWithTokenizedPaymentV3` mutation. + * Represents information about a company which is also a customer of the shop. */ - public static class CheckoutCompleteWithTokenizedPaymentV3Payload extends AbstractResponse { - public CheckoutCompleteWithTokenizedPaymentV3Payload() { + public static class Company extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { + public Company() { } - public CheckoutCompleteWithTokenizedPaymentV3Payload(JsonObject fields) throws SchemaViolationError { + public Company(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "checkout": { - Checkout optional1 = null; + case "createdAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + + case "externalId": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -15761,21 +16411,16 @@ public CheckoutCompleteWithTokenizedPaymentV3Payload(JsonObject fields) throws S break; } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); break; } - case "payment": { - Payment optional1 = null; + case "metafield": { + Metafield optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Payment(jsonAsObject(field.getValue(), key)); + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -15783,10 +16428,15 @@ public CheckoutCompleteWithTokenizedPaymentV3Payload(JsonObject fields) throws S break; } - case "userErrors": { - List list1 = new ArrayList<>(); + case "metafields": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } + + list1.add(optional2); } responseData.put(key, list1); @@ -15794,6 +16444,18 @@ public CheckoutCompleteWithTokenizedPaymentV3Payload(JsonObject fields) throws S break; } + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -15805,477 +16467,213 @@ public CheckoutCompleteWithTokenizedPaymentV3Payload(JsonObject fields) throws S } } + public Company(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "CheckoutCompleteWithTokenizedPaymentV3Payload"; + return "Company"; } /** - * The checkout on which the payment was applied. + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * was created in Shopify. */ - public Checkout getCheckout() { - return (Checkout) get("checkout"); + public DateTime getCreatedAt() { + return (DateTime) get("createdAt"); } - public CheckoutCompleteWithTokenizedPaymentV3Payload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); + public Company setCreatedAt(DateTime arg) { + optimisticData.put(getKey("createdAt"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * A unique externally-supplied ID for the company. */ - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); + public String getExternalId() { + return (String) get("externalId"); } - public CheckoutCompleteWithTokenizedPaymentV3Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); + public Company setExternalId(String arg) { + optimisticData.put(getKey("externalId"), arg); return this; } /** - * A representation of the attempted payment. + * A globally-unique ID. + */ + + public ID getId() { + return (ID) get("id"); + } + + /** + * Returns a metafield found by namespace and key. */ - public Payment getPayment() { - return (Payment) get("payment"); + public Metafield getMetafield() { + return (Metafield) get("metafield"); } - public CheckoutCompleteWithTokenizedPaymentV3Payload setPayment(Payment arg) { - optimisticData.put(getKey("payment"), arg); + public Company setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public List getUserErrors() { - return (List) get("userErrors"); + public List getMetafields() { + return (List) get("metafields"); } - public CheckoutCompleteWithTokenizedPaymentV3Payload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public Company setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + /** + * The name of the company. + */ - case "checkoutUserErrors": return true; + public String getName() { + return (String) get("name"); + } - case "payment": return true; + public Company setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } - case "userErrors": return true; + /** + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * was last modified. + */ - default: return false; - } + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); } - } - public static class CheckoutCreateInput implements Serializable { - private Input email = Input.undefined(); + public Company setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); + return this; + } - private Input> lineItems = Input.undefined(); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "createdAt": return false; - private Input shippingAddress = Input.undefined(); + case "externalId": return false; - private Input note = Input.undefined(); + case "id": return false; - private Input> customAttributes = Input.undefined(); + case "metafield": return true; - private Input allowPartialAddresses = Input.undefined(); + case "metafields": return true; - private Input presentmentCurrencyCode = Input.undefined(); + case "name": return false; - private Input buyerIdentity = Input.undefined(); + case "updatedAt": return false; - public String getEmail() { - return email.getValue(); + default: return false; + } } + } - public Input getEmailInput() { - return email; - } + public interface CompanyContactQueryDefinition { + void define(CompanyContactQuery _queryBuilder); + } - public CheckoutCreateInput setEmail(String email) { - this.email = Input.optional(email); - return this; + /** + * A company's main point of contact. + */ + public static class CompanyContactQuery extends Query { + CompanyContactQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); } - public CheckoutCreateInput setEmailInput(Input email) { - if (email == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.email = email; + /** + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * contact was created in Shopify. + */ + public CompanyContactQuery createdAt() { + startField("createdAt"); + return this; } - public List getLineItems() { - return lineItems.getValue(); - } + /** + * The company contact's locale (language). + */ + public CompanyContactQuery locale() { + startField("locale"); - public Input> getLineItemsInput() { - return lineItems; + return this; } - public CheckoutCreateInput setLineItems(List lineItems) { - this.lineItems = Input.optional(lineItems); - return this; - } - - public CheckoutCreateInput setLineItemsInput(Input> lineItems) { - if (lineItems == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.lineItems = lineItems; - return this; - } - - public MailingAddressInput getShippingAddress() { - return shippingAddress.getValue(); - } - - public Input getShippingAddressInput() { - return shippingAddress; - } - - public CheckoutCreateInput setShippingAddress(MailingAddressInput shippingAddress) { - this.shippingAddress = Input.optional(shippingAddress); - return this; - } - - public CheckoutCreateInput setShippingAddressInput(Input shippingAddress) { - if (shippingAddress == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.shippingAddress = shippingAddress; - return this; - } - - public String getNote() { - return note.getValue(); - } - - public Input getNoteInput() { - return note; - } - - public CheckoutCreateInput setNote(String note) { - this.note = Input.optional(note); - return this; - } - - public CheckoutCreateInput setNoteInput(Input note) { - if (note == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.note = note; - return this; - } - - public List getCustomAttributes() { - return customAttributes.getValue(); - } - - public Input> getCustomAttributesInput() { - return customAttributes; - } - - public CheckoutCreateInput setCustomAttributes(List customAttributes) { - this.customAttributes = Input.optional(customAttributes); - return this; - } - - public CheckoutCreateInput setCustomAttributesInput(Input> customAttributes) { - if (customAttributes == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.customAttributes = customAttributes; - return this; - } - - public Boolean getAllowPartialAddresses() { - return allowPartialAddresses.getValue(); - } - - public Input getAllowPartialAddressesInput() { - return allowPartialAddresses; - } - - public CheckoutCreateInput setAllowPartialAddresses(Boolean allowPartialAddresses) { - this.allowPartialAddresses = Input.optional(allowPartialAddresses); - return this; - } - - public CheckoutCreateInput setAllowPartialAddressesInput(Input allowPartialAddresses) { - if (allowPartialAddresses == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.allowPartialAddresses = allowPartialAddresses; - return this; - } - - public CurrencyCode getPresentmentCurrencyCode() { - return presentmentCurrencyCode.getValue(); - } - - public Input getPresentmentCurrencyCodeInput() { - return presentmentCurrencyCode; - } - - public CheckoutCreateInput setPresentmentCurrencyCode(CurrencyCode presentmentCurrencyCode) { - this.presentmentCurrencyCode = Input.optional(presentmentCurrencyCode); - return this; - } - - public CheckoutCreateInput setPresentmentCurrencyCodeInput(Input presentmentCurrencyCode) { - if (presentmentCurrencyCode == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.presentmentCurrencyCode = presentmentCurrencyCode; - return this; - } - - public CheckoutBuyerIdentityInput getBuyerIdentity() { - return buyerIdentity.getValue(); - } - - public Input getBuyerIdentityInput() { - return buyerIdentity; - } - - public CheckoutCreateInput setBuyerIdentity(CheckoutBuyerIdentityInput buyerIdentity) { - this.buyerIdentity = Input.optional(buyerIdentity); - return this; - } - - public CheckoutCreateInput setBuyerIdentityInput(Input buyerIdentity) { - if (buyerIdentity == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.buyerIdentity = buyerIdentity; - return this; - } - - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - if (this.email.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("email:"); - if (email.getValue() != null) { - Query.appendQuotedString(_queryBuilder, email.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.lineItems.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("lineItems:"); - if (lineItems.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (CheckoutLineItemInput item1 : lineItems.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - } else { - _queryBuilder.append("null"); - } - } - - if (this.shippingAddress.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("shippingAddress:"); - if (shippingAddress.getValue() != null) { - shippingAddress.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); - } - } - - if (this.note.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("note:"); - if (note.getValue() != null) { - Query.appendQuotedString(_queryBuilder, note.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.customAttributes.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("customAttributes:"); - if (customAttributes.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (AttributeInput item1 : customAttributes.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - } else { - _queryBuilder.append("null"); - } - } - - if (this.allowPartialAddresses.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("allowPartialAddresses:"); - if (allowPartialAddresses.getValue() != null) { - _queryBuilder.append(allowPartialAddresses.getValue()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.presentmentCurrencyCode.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("presentmentCurrencyCode:"); - if (presentmentCurrencyCode.getValue() != null) { - _queryBuilder.append(presentmentCurrencyCode.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.buyerIdentity.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("buyerIdentity:"); - if (buyerIdentity.getValue() != null) { - buyerIdentity.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); - } - } - - _queryBuilder.append('}'); - } - } - - public interface CheckoutCreatePayloadQueryDefinition { - void define(CheckoutCreatePayloadQuery _queryBuilder); - } - - /** - * Return type for `checkoutCreate` mutation. - */ - public static class CheckoutCreatePayloadQuery extends Query { - CheckoutCreatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The new checkout object. - */ - public CheckoutCreatePayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - */ - public CheckoutCreatePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The checkout queue token. Available only to selected stores. - */ - public CheckoutCreatePayloadQuery queueToken() { - startField("queueToken"); - + /** + * The company contact's job title. + */ + public CompanyContactQuery title() { + startField("title"); + return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * contact was last modified. */ - @Deprecated - public CheckoutCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CompanyContactQuery updatedAt() { + startField("updatedAt"); return this; } } /** - * Return type for `checkoutCreate` mutation. + * A company's main point of contact. */ - public static class CheckoutCreatePayload extends AbstractResponse { - public CheckoutCreatePayload() { + public static class CompanyContact extends AbstractResponse implements Node { + public CompanyContact() { } - public CheckoutCreatePayload(JsonObject fields) throws SchemaViolationError { + public CompanyContact(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } + case "createdAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - responseData.put(key, optional1); + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); break; } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); + case "locale": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "queueToken": { + case "title": { String optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = jsonAsString(field.getValue(), key); @@ -16286,13 +16684,8 @@ public CheckoutCreatePayload(JsonObject fields) throws SchemaViolationError { break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); break; } @@ -16308,163 +16701,253 @@ public CheckoutCreatePayload(JsonObject fields) throws SchemaViolationError { } } + public CompanyContact(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "CheckoutCreatePayload"; + return "CompanyContact"; } /** - * The new checkout object. + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * contact was created in Shopify. */ - public Checkout getCheckout() { - return (Checkout) get("checkout"); + public DateTime getCreatedAt() { + return (DateTime) get("createdAt"); } - public CheckoutCreatePayload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); + public CompanyContact setCreatedAt(DateTime arg) { + optimisticData.put(getKey("createdAt"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * A globally-unique ID. + */ + + public ID getId() { + return (ID) get("id"); + } + + /** + * The company contact's locale (language). */ - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); + public String getLocale() { + return (String) get("locale"); } - public CheckoutCreatePayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); + public CompanyContact setLocale(String arg) { + optimisticData.put(getKey("locale"), arg); return this; } /** - * The checkout queue token. Available only to selected stores. + * The company contact's job title. */ - public String getQueueToken() { - return (String) get("queueToken"); + public String getTitle() { + return (String) get("title"); } - public CheckoutCreatePayload setQueueToken(String arg) { - optimisticData.put(getKey("queueToken"), arg); + public CompanyContact setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * contact was last modified. */ - public List getUserErrors() { - return (List) get("userErrors"); + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); } - public CheckoutCreatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public CompanyContact setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "checkout": return true; + case "createdAt": return false; - case "checkoutUserErrors": return true; + case "id": return false; - case "queueToken": return false; + case "locale": return false; - case "userErrors": return true; + case "title": return false; + + case "updatedAt": return false; default: return false; } } } - public interface CheckoutCustomerAssociateV2PayloadQueryDefinition { - void define(CheckoutCustomerAssociateV2PayloadQuery _queryBuilder); + public interface CompanyLocationQueryDefinition { + void define(CompanyLocationQuery _queryBuilder); } /** - * Return type for `checkoutCustomerAssociateV2` mutation. + * A company's location. */ - public static class CheckoutCustomerAssociateV2PayloadQuery extends Query { - CheckoutCustomerAssociateV2PayloadQuery(StringBuilder _queryBuilder) { + public static class CompanyLocationQuery extends Query { + CompanyLocationQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); + } + + /** + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * location was created in Shopify. + */ + public CompanyLocationQuery createdAt() { + startField("createdAt"); + + return this; } /** - * The updated checkout object. + * A unique externally-supplied ID for the company. */ - public CheckoutCustomerAssociateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + public CompanyLocationQuery externalId() { + startField("externalId"); - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * The preferred locale of the company location. + */ + public CompanyLocationQuery locale() { + startField("locale"); return this; } + public class MetafieldArguments extends Arguments { + MetafieldArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } + + /** + * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. + */ + public MetafieldArguments namespace(String value) { + if (value != null) { + startArgument("namespace"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + } + + public interface MetafieldArgumentsDefinition { + void define(MetafieldArguments args); + } + /** - * The list of errors that occurred from executing the mutation. + * Returns a metafield found by namespace and key. + */ + public CompanyLocationQuery metafield(String key, MetafieldQueryDefinition queryDef) { + return metafield(key, args -> {}, queryDef); + } + + /** + * Returns a metafield found by namespace and key. */ - public CheckoutCustomerAssociateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + public CompanyLocationQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { + startField("metafield"); + + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + argsDef.define(new MetafieldArguments(_queryBuilder)); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The associated customer object. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public CheckoutCustomerAssociateV2PayloadQuery customer(CustomerQueryDefinition queryDef) { - startField("customer"); + public CompanyLocationQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); + + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The name of the company location. */ - @Deprecated - public CheckoutCustomerAssociateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public CompanyLocationQuery name() { + startField("name"); - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * location was last modified. + */ + public CompanyLocationQuery updatedAt() { + startField("updatedAt"); return this; } } /** - * Return type for `checkoutCustomerAssociateV2` mutation. + * A company's location. */ - public static class CheckoutCustomerAssociateV2Payload extends AbstractResponse { - public CheckoutCustomerAssociateV2Payload() { + public static class CompanyLocation extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { + public CompanyLocation() { } - public CheckoutCustomerAssociateV2Payload(JsonObject fields) throws SchemaViolationError { + public CompanyLocation(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "checkout": { - Checkout optional1 = null; + case "createdAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + + case "externalId": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -16472,21 +16955,27 @@ public CheckoutCustomerAssociateV2Payload(JsonObject fields) throws SchemaViolat break; } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "locale": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "customer": { - Customer optional1 = null; + case "metafield": { + Metafield optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -16494,10 +16983,15 @@ public CheckoutCustomerAssociateV2Payload(JsonObject fields) throws SchemaViolat break; } - case "userErrors": { - List list1 = new ArrayList<>(); + case "metafields": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } + + list1.add(optional2); } responseData.put(key, list1); @@ -16505,6 +16999,18 @@ public CheckoutCustomerAssociateV2Payload(JsonObject fields) throws SchemaViolat break; } + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -16516,150 +17022,177 @@ public CheckoutCustomerAssociateV2Payload(JsonObject fields) throws SchemaViolat } } + public CompanyLocation(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "CheckoutCustomerAssociateV2Payload"; + return "CompanyLocation"; } /** - * The updated checkout object. + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * location was created in Shopify. */ - public Checkout getCheckout() { - return (Checkout) get("checkout"); + public DateTime getCreatedAt() { + return (DateTime) get("createdAt"); } - public CheckoutCustomerAssociateV2Payload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); + public CompanyLocation setCreatedAt(DateTime arg) { + optimisticData.put(getKey("createdAt"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * A unique externally-supplied ID for the company. */ - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); + public String getExternalId() { + return (String) get("externalId"); } - public CheckoutCustomerAssociateV2Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); + public CompanyLocation setExternalId(String arg) { + optimisticData.put(getKey("externalId"), arg); return this; } /** - * The associated customer object. + * A globally-unique ID. */ - public Customer getCustomer() { - return (Customer) get("customer"); - } - - public CheckoutCustomerAssociateV2Payload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); - return this; + public ID getId() { + return (ID) get("id"); } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The preferred locale of the company location. */ - public List getUserErrors() { - return (List) get("userErrors"); + public String getLocale() { + return (String) get("locale"); } - public CheckoutCustomerAssociateV2Payload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public CompanyLocation setLocale(String arg) { + optimisticData.put(getKey("locale"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + /** + * Returns a metafield found by namespace and key. + */ - case "checkoutUserErrors": return true; + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } - case "customer": return true; + public CompanyLocation setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); + return this; + } - case "userErrors": return true; + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ - default: return false; - } + public List getMetafields() { + return (List) get("metafields"); } - } - - public interface CheckoutCustomerDisassociateV2PayloadQueryDefinition { - void define(CheckoutCustomerDisassociateV2PayloadQuery _queryBuilder); - } - /** - * Return type for `checkoutCustomerDisassociateV2` mutation. - */ - public static class CheckoutCustomerDisassociateV2PayloadQuery extends Query { - CheckoutCustomerDisassociateV2PayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public CompanyLocation setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); + return this; } /** - * The updated checkout object. + * The name of the company location. */ - public CheckoutCustomerDisassociateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getName() { + return (String) get("name"); + } + public CompanyLocation setName(String arg) { + optimisticData.put(getKey("name"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * location was last modified. */ - public CheckoutCustomerDisassociateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); + } + public CompanyLocation setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "createdAt": return false; + + case "externalId": return false; + + case "id": return false; + + case "locale": return false; + + case "metafield": return true; + + case "metafields": return true; + + case "name": return false; + + case "updatedAt": return false; + + default: return false; + } + } + } + + public interface CompletePaymentChallengeQueryDefinition { + void define(CompletePaymentChallengeQuery _queryBuilder); + } + + /** + * The action for the 3DS payment redirect. + */ + public static class CompletePaymentChallengeQuery extends Query { + CompletePaymentChallengeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The URL for the 3DS payment redirect. */ - @Deprecated - public CheckoutCustomerDisassociateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CompletePaymentChallengeQuery redirectUrl() { + startField("redirectUrl"); return this; } } /** - * Return type for `checkoutCustomerDisassociateV2` mutation. + * The action for the 3DS payment redirect. */ - public static class CheckoutCustomerDisassociateV2Payload extends AbstractResponse { - public CheckoutCustomerDisassociateV2Payload() { + public static class CompletePaymentChallenge extends AbstractResponse implements CartCompletionAction { + public CompletePaymentChallenge() { } - public CheckoutCustomerDisassociateV2Payload(JsonObject fields) throws SchemaViolationError { + public CompletePaymentChallenge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "checkout": { - Checkout optional1 = null; + case "redirectUrl": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -16667,28 +17200,6 @@ public CheckoutCustomerDisassociateV2Payload(JsonObject fields) throws SchemaVio break; } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -16701,159 +17212,87 @@ public CheckoutCustomerDisassociateV2Payload(JsonObject fields) throws SchemaVio } public String getGraphQlTypeName() { - return "CheckoutCustomerDisassociateV2Payload"; - } - - /** - * The updated checkout object. - */ - - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } - - public CheckoutCustomerDisassociateV2Payload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - */ - - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); - } - - public CheckoutCustomerDisassociateV2Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; + return "CompletePaymentChallenge"; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The URL for the 3DS payment redirect. */ - public List getUserErrors() { - return (List) get("userErrors"); + public String getRedirectUrl() { + return (String) get("redirectUrl"); } - public CheckoutCustomerDisassociateV2Payload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public CompletePaymentChallenge setRedirectUrl(String arg) { + optimisticData.put(getKey("redirectUrl"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "checkout": return true; - - case "checkoutUserErrors": return true; - - case "userErrors": return true; + case "redirectUrl": return false; default: return false; } } } - public interface CheckoutDiscountCodeApplyV2PayloadQueryDefinition { - void define(CheckoutDiscountCodeApplyV2PayloadQuery _queryBuilder); + public interface CompletionErrorQueryDefinition { + void define(CompletionErrorQuery _queryBuilder); } /** - * Return type for `checkoutDiscountCodeApplyV2` mutation. + * An error that occurred during a cart completion attempt. */ - public static class CheckoutDiscountCodeApplyV2PayloadQuery extends Query { - CheckoutDiscountCodeApplyV2PayloadQuery(StringBuilder _queryBuilder) { + public static class CompletionErrorQuery extends Query { + CompletionErrorQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The updated checkout object. - */ - public CheckoutDiscountCodeApplyV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The list of errors that occurred from executing the mutation. + * The error code. */ - public CheckoutDiscountCodeApplyV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CompletionErrorQuery code() { + startField("code"); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The error message. */ - @Deprecated - public CheckoutDiscountCodeApplyV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CompletionErrorQuery message() { + startField("message"); return this; } } /** - * Return type for `checkoutDiscountCodeApplyV2` mutation. + * An error that occurred during a cart completion attempt. */ - public static class CheckoutDiscountCodeApplyV2Payload extends AbstractResponse { - public CheckoutDiscountCodeApplyV2Payload() { + public static class CompletionError extends AbstractResponse { + public CompletionError() { } - public CheckoutDiscountCodeApplyV2Payload(JsonObject fields) throws SchemaViolationError { + public CompletionError(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "code": { + responseData.put(key, CompletionErrorCode.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); + case "message": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } @@ -16870,325 +17309,408 @@ public CheckoutDiscountCodeApplyV2Payload(JsonObject fields) throws SchemaViolat } public String getGraphQlTypeName() { - return "CheckoutDiscountCodeApplyV2Payload"; - } - - /** - * The updated checkout object. - */ - - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } - - public CheckoutDiscountCodeApplyV2Payload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; + return "CompletionError"; } /** - * The list of errors that occurred from executing the mutation. + * The error code. */ - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); + public CompletionErrorCode getCode() { + return (CompletionErrorCode) get("code"); } - public CheckoutDiscountCodeApplyV2Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); + public CompletionError setCode(CompletionErrorCode arg) { + optimisticData.put(getKey("code"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The error message. */ - public List getUserErrors() { - return (List) get("userErrors"); + public String getMessage() { + return (String) get("message"); } - public CheckoutDiscountCodeApplyV2Payload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public CompletionError setMessage(String arg) { + optimisticData.put(getKey("message"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "checkout": return true; - - case "checkoutUserErrors": return true; + case "code": return false; - case "userErrors": return true; + case "message": return false; default: return false; } } } - public interface CheckoutDiscountCodeRemovePayloadQueryDefinition { - void define(CheckoutDiscountCodeRemovePayloadQuery _queryBuilder); - } - /** - * Return type for `checkoutDiscountCodeRemove` mutation. + * The code of the error that occurred during a cart completion attempt. */ - public static class CheckoutDiscountCodeRemovePayloadQuery extends Query { - CheckoutDiscountCodeRemovePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + public enum CompletionErrorCode { + ERROR, - /** - * The updated checkout object. - */ - public CheckoutDiscountCodeRemovePayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + INVENTORY_RESERVATION_ERROR, - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + PAYMENT_AMOUNT_TOO_SMALL, - return this; - } + PAYMENT_CALL_ISSUER, - /** - * The list of errors that occurred from executing the mutation. - */ - public CheckoutDiscountCodeRemovePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + PAYMENT_CARD_DECLINED, - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + PAYMENT_ERROR, - return this; - } + PAYMENT_GATEWAY_NOT_ENABLED_ERROR, - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ - @Deprecated - public CheckoutDiscountCodeRemovePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + PAYMENT_INSUFFICIENT_FUNDS, - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + PAYMENT_INVALID_BILLING_ADDRESS, - return this; - } - } + PAYMENT_INVALID_CREDIT_CARD, - /** - * Return type for `checkoutDiscountCodeRemove` mutation. - */ - public static class CheckoutDiscountCodeRemovePayload extends AbstractResponse { - public CheckoutDiscountCodeRemovePayload() { - } + PAYMENT_INVALID_CURRENCY, - public CheckoutDiscountCodeRemovePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } + PAYMENT_INVALID_PAYMENT_METHOD, - responseData.put(key, optional1); + PAYMENT_TRANSIENT_ERROR, - break; - } + UNKNOWN_VALUE; - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } + public static CompletionErrorCode fromGraphQl(String value) { + if (value == null) { + return null; + } - responseData.put(key, list1); + switch (value) { + case "ERROR": { + return ERROR; + } - break; - } + case "INVENTORY_RESERVATION_ERROR": { + return INVENTORY_RESERVATION_ERROR; + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + case "PAYMENT_AMOUNT_TOO_SMALL": { + return PAYMENT_AMOUNT_TOO_SMALL; + } - responseData.put(key, list1); + case "PAYMENT_CALL_ISSUER": { + return PAYMENT_CALL_ISSUER; + } - break; - } + case "PAYMENT_CARD_DECLINED": { + return PAYMENT_CARD_DECLINED; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "PAYMENT_ERROR": { + return PAYMENT_ERROR; } - } - } - public String getGraphQlTypeName() { - return "CheckoutDiscountCodeRemovePayload"; - } + case "PAYMENT_GATEWAY_NOT_ENABLED_ERROR": { + return PAYMENT_GATEWAY_NOT_ENABLED_ERROR; + } - /** - * The updated checkout object. - */ + case "PAYMENT_INSUFFICIENT_FUNDS": { + return PAYMENT_INSUFFICIENT_FUNDS; + } - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } + case "PAYMENT_INVALID_BILLING_ADDRESS": { + return PAYMENT_INVALID_BILLING_ADDRESS; + } - public CheckoutDiscountCodeRemovePayload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; - } + case "PAYMENT_INVALID_CREDIT_CARD": { + return PAYMENT_INVALID_CREDIT_CARD; + } - /** - * The list of errors that occurred from executing the mutation. - */ + case "PAYMENT_INVALID_CURRENCY": { + return PAYMENT_INVALID_CURRENCY; + } - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); - } + case "PAYMENT_INVALID_PAYMENT_METHOD": { + return PAYMENT_INVALID_PAYMENT_METHOD; + } - public CheckoutDiscountCodeRemovePayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; + case "PAYMENT_TRANSIENT_ERROR": { + return PAYMENT_TRANSIENT_ERROR; + } + + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case ERROR: { + return "ERROR"; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ + case INVENTORY_RESERVATION_ERROR: { + return "INVENTORY_RESERVATION_ERROR"; + } - public List getUserErrors() { - return (List) get("userErrors"); - } + case PAYMENT_AMOUNT_TOO_SMALL: { + return "PAYMENT_AMOUNT_TOO_SMALL"; + } - public CheckoutDiscountCodeRemovePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } + case PAYMENT_CALL_ISSUER: { + return "PAYMENT_CALL_ISSUER"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + case PAYMENT_CARD_DECLINED: { + return "PAYMENT_CARD_DECLINED"; + } - case "checkoutUserErrors": return true; + case PAYMENT_ERROR: { + return "PAYMENT_ERROR"; + } - case "userErrors": return true; + case PAYMENT_GATEWAY_NOT_ENABLED_ERROR: { + return "PAYMENT_GATEWAY_NOT_ENABLED_ERROR"; + } - default: return false; + case PAYMENT_INSUFFICIENT_FUNDS: { + return "PAYMENT_INSUFFICIENT_FUNDS"; + } + + case PAYMENT_INVALID_BILLING_ADDRESS: { + return "PAYMENT_INVALID_BILLING_ADDRESS"; + } + + case PAYMENT_INVALID_CREDIT_CARD: { + return "PAYMENT_INVALID_CREDIT_CARD"; + } + + case PAYMENT_INVALID_CURRENCY: { + return "PAYMENT_INVALID_CURRENCY"; + } + + case PAYMENT_INVALID_PAYMENT_METHOD: { + return "PAYMENT_INVALID_PAYMENT_METHOD"; + } + + case PAYMENT_TRANSIENT_ERROR: { + return "PAYMENT_TRANSIENT_ERROR"; + } + + default: { + return ""; + } } } } - public interface CheckoutEmailUpdateV2PayloadQueryDefinition { - void define(CheckoutEmailUpdateV2PayloadQuery _queryBuilder); + public interface ComponentizableCartLineQueryDefinition { + void define(ComponentizableCartLineQuery _queryBuilder); } /** - * Return type for `checkoutEmailUpdateV2` mutation. + * Represents information about the grouped merchandise in the cart. */ - public static class CheckoutEmailUpdateV2PayloadQuery extends Query { - CheckoutEmailUpdateV2PayloadQuery(StringBuilder _queryBuilder) { + public static class ComponentizableCartLineQuery extends Query { + ComponentizableCartLineQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * The checkout object with the updated email. + * An attribute associated with the cart line. */ - public CheckoutEmailUpdateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + public ComponentizableCartLineQuery attribute(String key, AttributeQueryDefinition queryDef) { + startField("attribute"); + + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); + queryDef.define(new AttributeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. + * The attributes associated with the cart line. Attributes are represented as key-value pairs. */ - public CheckoutEmailUpdateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + public ComponentizableCartLineQuery attributes(AttributeQueryDefinition queryDef) { + startField("attributes"); _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + queryDef.define(new AttributeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The cost of the merchandise that the buyer will pay for at checkout. The costs are subject to change + * and changes will be reflected at checkout. */ - @Deprecated - public CheckoutEmailUpdateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public ComponentizableCartLineQuery cost(CartLineCostQueryDefinition queryDef) { + startField("cost"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new CartLineCostQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - } - /** - * Return type for `checkoutEmailUpdateV2` mutation. - */ - public static class CheckoutEmailUpdateV2Payload extends AbstractResponse { - public CheckoutEmailUpdateV2Payload() { - } + /** + * The discounts that have been applied to the cart line. + */ + public ComponentizableCartLineQuery discountAllocations(CartDiscountAllocationQueryDefinition queryDef) { + startField("discountAllocations"); - public CheckoutEmailUpdateV2Payload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } + _queryBuilder.append('{'); + queryDef.define(new CartDiscountAllocationQuery(_queryBuilder)); + _queryBuilder.append('}'); - responseData.put(key, optional1); + return this; + } - break; - } + /** + * The estimated cost of the merchandise that the buyer will pay for at checkout. The estimated costs + * are subject to change and changes will be reflected at checkout. + * + * @deprecated Use `cost` instead. + */ + @Deprecated + public ComponentizableCartLineQuery estimatedCost(CartLineEstimatedCostQueryDefinition queryDef) { + startField("estimatedCost"); - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } + _queryBuilder.append('{'); + queryDef.define(new CartLineEstimatedCostQuery(_queryBuilder)); + _queryBuilder.append('}'); - responseData.put(key, list1); + return this; + } + + /** + * The components of the line item. + */ + public ComponentizableCartLineQuery lineComponents(CartLineQueryDefinition queryDef) { + startField("lineComponents"); + + _queryBuilder.append('{'); + queryDef.define(new CartLineQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The merchandise that the buyer intends to purchase. + */ + public ComponentizableCartLineQuery merchandise(MerchandiseQueryDefinition queryDef) { + startField("merchandise"); + + _queryBuilder.append('{'); + queryDef.define(new MerchandiseQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The quantity of the merchandise that the customer intends to purchase. + */ + public ComponentizableCartLineQuery quantity() { + startField("quantity"); + + return this; + } + + /** + * The selling plan associated with the cart line and the effect that each selling plan has on variants + * when they're purchased. + */ + public ComponentizableCartLineQuery sellingPlanAllocation(SellingPlanAllocationQueryDefinition queryDef) { + startField("sellingPlanAllocation"); + + _queryBuilder.append('{'); + queryDef.define(new SellingPlanAllocationQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * Represents information about the grouped merchandise in the cart. + */ + public static class ComponentizableCartLine extends AbstractResponse implements BaseCartLine, Node { + public ComponentizableCartLine() { + } + + public ComponentizableCartLine(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "attribute": { + Attribute optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Attribute(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "userErrors": { - List list1 = new ArrayList<>(); + case "attributes": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); + list1.add(new Attribute(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "cost": { + responseData.put(key, new CartLineCost(jsonAsObject(field.getValue(), key))); + + break; + } + + case "discountAllocations": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(UnknownCartDiscountAllocation.create(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "estimatedCost": { + responseData.put(key, new CartLineEstimatedCost(jsonAsObject(field.getValue(), key))); + + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "lineComponents": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartLine(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -17196,6 +17718,29 @@ public CheckoutEmailUpdateV2Payload(JsonObject fields) throws SchemaViolationErr break; } + case "merchandise": { + responseData.put(key, UnknownMerchandise.create(jsonAsObject(field.getValue(), key))); + + break; + } + + case "quantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); + + break; + } + + case "sellingPlanAllocation": { + SellingPlanAllocation optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new SellingPlanAllocation(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -17207,3972 +17752,3693 @@ public CheckoutEmailUpdateV2Payload(JsonObject fields) throws SchemaViolationErr } } + public ComponentizableCartLine(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "CheckoutEmailUpdateV2Payload"; + return "ComponentizableCartLine"; } /** - * The checkout object with the updated email. + * An attribute associated with the cart line. */ - public Checkout getCheckout() { - return (Checkout) get("checkout"); + public Attribute getAttribute() { + return (Attribute) get("attribute"); } - public CheckoutEmailUpdateV2Payload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); + public ComponentizableCartLine setAttribute(Attribute arg) { + optimisticData.put(getKey("attribute"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The attributes associated with the cart line. Attributes are represented as key-value pairs. */ - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); + public List getAttributes() { + return (List) get("attributes"); } - public CheckoutEmailUpdateV2Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); + public ComponentizableCartLine setAttributes(List arg) { + optimisticData.put(getKey("attributes"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The cost of the merchandise that the buyer will pay for at checkout. The costs are subject to change + * and changes will be reflected at checkout. */ - public List getUserErrors() { - return (List) get("userErrors"); + public CartLineCost getCost() { + return (CartLineCost) get("cost"); } - public CheckoutEmailUpdateV2Payload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public ComponentizableCartLine setCost(CartLineCost arg) { + optimisticData.put(getKey("cost"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; - - case "checkoutUserErrors": return true; - - case "userErrors": return true; + /** + * The discounts that have been applied to the cart line. + */ - default: return false; - } + public List getDiscountAllocations() { + return (List) get("discountAllocations"); } - } - /** - * Possible error codes that can be returned by `CheckoutUserError`. - */ - public enum CheckoutErrorCode { - /** - * Checkout is already completed. - */ - ALREADY_COMPLETED, + public ComponentizableCartLine setDiscountAllocations(List arg) { + optimisticData.put(getKey("discountAllocations"), arg); + return this; + } /** - * Input email contains an invalid domain name. + * The estimated cost of the merchandise that the buyer will pay for at checkout. The estimated costs + * are subject to change and changes will be reflected at checkout. + * + * @deprecated Use `cost` instead. */ - BAD_DOMAIN, - /** - * The input value is blank. - */ - BLANK, + public CartLineEstimatedCost getEstimatedCost() { + return (CartLineEstimatedCost) get("estimatedCost"); + } - /** - * Cart does not meet discount requirements notice. - */ - CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE, + public ComponentizableCartLine setEstimatedCost(CartLineEstimatedCost arg) { + optimisticData.put(getKey("estimatedCost"), arg); + return this; + } /** - * Customer already used once per customer discount notice. + * A globally-unique ID. */ - CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE, - /** - * Discount already applied. - */ - DISCOUNT_ALREADY_APPLIED, + public ID getId() { + return (ID) get("id"); + } /** - * Discount code isn't working right now. Please contact us for help. + * The components of the line item. */ - DISCOUNT_CODE_APPLICATION_FAILED, - /** - * Discount disabled. - */ - DISCOUNT_DISABLED, + public List getLineComponents() { + return (List) get("lineComponents"); + } - /** - * Discount expired. - */ - DISCOUNT_EXPIRED, + public ComponentizableCartLine setLineComponents(List arg) { + optimisticData.put(getKey("lineComponents"), arg); + return this; + } /** - * Discount limit reached. + * The merchandise that the buyer intends to purchase. */ - DISCOUNT_LIMIT_REACHED, - /** - * Discount not found. - */ - DISCOUNT_NOT_FOUND, + public Merchandise getMerchandise() { + return (Merchandise) get("merchandise"); + } - /** - * Checkout is already completed. - */ - EMPTY, + public ComponentizableCartLine setMerchandise(Merchandise arg) { + optimisticData.put(getKey("merchandise"), arg); + return this; + } /** - * Queue token has expired. + * The quantity of the merchandise that the customer intends to purchase. */ - EXPIRED_QUEUE_TOKEN, - /** - * Gift card has already been applied. - */ - GIFT_CARD_ALREADY_APPLIED, + public Integer getQuantity() { + return (Integer) get("quantity"); + } - /** - * Gift card code is invalid. - */ - GIFT_CARD_CODE_INVALID, + public ComponentizableCartLine setQuantity(Integer arg) { + optimisticData.put(getKey("quantity"), arg); + return this; + } /** - * Gift card currency does not match checkout currency. + * The selling plan associated with the cart line and the effect that each selling plan has on variants + * when they're purchased. */ - GIFT_CARD_CURRENCY_MISMATCH, - /** - * Gift card has no funds left. - */ - GIFT_CARD_DEPLETED, + public SellingPlanAllocation getSellingPlanAllocation() { + return (SellingPlanAllocation) get("sellingPlanAllocation"); + } - /** - * Gift card is disabled. - */ - GIFT_CARD_DISABLED, + public ComponentizableCartLine setSellingPlanAllocation(SellingPlanAllocation arg) { + optimisticData.put(getKey("sellingPlanAllocation"), arg); + return this; + } - /** - * Gift card is expired. - */ - GIFT_CARD_EXPIRED, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "attribute": return true; - /** - * Gift card was not found. - */ - GIFT_CARD_NOT_FOUND, + case "attributes": return true; - /** - * Gift card cannot be applied to a checkout that contains a gift card. - */ - GIFT_CARD_UNUSABLE, + case "cost": return true; - /** - * The input value should be greater than or equal to the minimum value allowed. - */ - GREATER_THAN_OR_EQUAL_TO, + case "discountAllocations": return false; - /** - * Higher value discount applied. - */ - HIGHER_VALUE_DISCOUNT_APPLIED, + case "estimatedCost": return true; - /** - * The input value is invalid. - */ - INVALID, + case "id": return false; - /** - * Cannot specify country and presentment currency code. - */ - INVALID_COUNTRY_AND_CURRENCY, + case "lineComponents": return true; - /** - * Input Zip is invalid for country provided. - */ - INVALID_FOR_COUNTRY, + case "merchandise": return false; - /** - * Input Zip is invalid for country and province provided. - */ - INVALID_FOR_COUNTRY_AND_PROVINCE, + case "quantity": return false; - /** - * Invalid province in country. - */ - INVALID_PROVINCE_IN_COUNTRY, + case "sellingPlanAllocation": return true; - /** - * Queue token is invalid. - */ - INVALID_QUEUE_TOKEN, + default: return false; + } + } + } - /** - * Invalid region in country. - */ - INVALID_REGION_IN_COUNTRY, + public interface CountryQueryDefinition { + void define(CountryQuery _queryBuilder); + } - /** - * Invalid state in country. - */ - INVALID_STATE_IN_COUNTRY, + /** + * A country. + */ + public static class CountryQuery extends Query { + CountryQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * The input value should be less than the maximum value allowed. + * The languages available for the country. */ - LESS_THAN, + public CountryQuery availableLanguages(LanguageQueryDefinition queryDef) { + startField("availableLanguages"); - /** - * The input value should be less than or equal to the maximum value allowed. - */ - LESS_THAN_OR_EQUAL_TO, + _queryBuilder.append('{'); + queryDef.define(new LanguageQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Line item was not found in checkout. - */ - LINE_ITEM_NOT_FOUND, + return this; + } /** - * Checkout is locked. + * The currency of the country. */ - LOCKED, + public CountryQuery currency(CurrencyQueryDefinition queryDef) { + startField("currency"); - /** - * Maximum number of discount codes limit reached. - */ - MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED, + _queryBuilder.append('{'); + queryDef.define(new CurrencyQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Missing payment input. - */ - MISSING_PAYMENT_INPUT, + return this; + } /** - * Not enough in stock. + * The ISO code of the country. */ - NOT_ENOUGH_IN_STOCK, + public CountryQuery isoCode() { + startField("isoCode"); - /** - * Input value is not supported. - */ - NOT_SUPPORTED, + return this; + } /** - * The input value needs to be blank. + * The market that includes this country. */ - PRESENT, + public CountryQuery market(MarketQueryDefinition queryDef) { + startField("market"); - /** - * Product is not published for this customer. - */ - PRODUCT_NOT_AVAILABLE, + _queryBuilder.append('{'); + queryDef.define(new MarketQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Shipping rate expired. - */ - SHIPPING_RATE_EXPIRED, + return this; + } /** - * Throttled during checkout. + * The name of the country. */ - THROTTLED_DURING_CHECKOUT, + public CountryQuery name() { + startField("name"); - /** - * The input value is too long. - */ - TOO_LONG, + return this; + } /** - * The amount of the payment does not match the value to be paid. + * The unit system used in the country. */ - TOTAL_PRICE_MISMATCH, + public CountryQuery unitSystem() { + startField("unitSystem"); - /** - * Unable to apply discount. - */ - UNABLE_TO_APPLY, + return this; + } + } - UNKNOWN_VALUE; + /** + * A country. + */ + public static class Country extends AbstractResponse { + public Country() { + } - public static CheckoutErrorCode fromGraphQl(String value) { - if (value == null) { - return null; - } + public Country(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "availableLanguages": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Language(jsonAsObject(element1, key))); + } - switch (value) { - case "ALREADY_COMPLETED": { - return ALREADY_COMPLETED; - } + responseData.put(key, list1); - case "BAD_DOMAIN": { - return BAD_DOMAIN; - } + break; + } - case "BLANK": { - return BLANK; - } + case "currency": { + responseData.put(key, new Currency(jsonAsObject(field.getValue(), key))); - case "CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE": { - return CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE; - } + break; + } - case "CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE": { - return CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE; - } + case "isoCode": { + responseData.put(key, CountryCode.fromGraphQl(jsonAsString(field.getValue(), key))); - case "DISCOUNT_ALREADY_APPLIED": { - return DISCOUNT_ALREADY_APPLIED; - } + break; + } - case "DISCOUNT_CODE_APPLICATION_FAILED": { - return DISCOUNT_CODE_APPLICATION_FAILED; - } + case "market": { + Market optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Market(jsonAsObject(field.getValue(), key)); + } - case "DISCOUNT_DISABLED": { - return DISCOUNT_DISABLED; - } + responseData.put(key, optional1); - case "DISCOUNT_EXPIRED": { - return DISCOUNT_EXPIRED; - } + break; + } - case "DISCOUNT_LIMIT_REACHED": { - return DISCOUNT_LIMIT_REACHED; - } + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case "DISCOUNT_NOT_FOUND": { - return DISCOUNT_NOT_FOUND; - } + break; + } - case "EMPTY": { - return EMPTY; - } + case "unitSystem": { + responseData.put(key, UnitSystem.fromGraphQl(jsonAsString(field.getValue(), key))); - case "EXPIRED_QUEUE_TOKEN": { - return EXPIRED_QUEUE_TOKEN; - } + break; + } - case "GIFT_CARD_ALREADY_APPLIED": { - return GIFT_CARD_ALREADY_APPLIED; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "GIFT_CARD_CODE_INVALID": { - return GIFT_CARD_CODE_INVALID; - } + public String getGraphQlTypeName() { + return "Country"; + } - case "GIFT_CARD_CURRENCY_MISMATCH": { - return GIFT_CARD_CURRENCY_MISMATCH; - } + /** + * The languages available for the country. + */ - case "GIFT_CARD_DEPLETED": { - return GIFT_CARD_DEPLETED; - } + public List getAvailableLanguages() { + return (List) get("availableLanguages"); + } - case "GIFT_CARD_DISABLED": { - return GIFT_CARD_DISABLED; - } + public Country setAvailableLanguages(List arg) { + optimisticData.put(getKey("availableLanguages"), arg); + return this; + } - case "GIFT_CARD_EXPIRED": { - return GIFT_CARD_EXPIRED; - } + /** + * The currency of the country. + */ - case "GIFT_CARD_NOT_FOUND": { - return GIFT_CARD_NOT_FOUND; - } + public Currency getCurrency() { + return (Currency) get("currency"); + } - case "GIFT_CARD_UNUSABLE": { - return GIFT_CARD_UNUSABLE; - } + public Country setCurrency(Currency arg) { + optimisticData.put(getKey("currency"), arg); + return this; + } - case "GREATER_THAN_OR_EQUAL_TO": { - return GREATER_THAN_OR_EQUAL_TO; - } + /** + * The ISO code of the country. + */ - case "HIGHER_VALUE_DISCOUNT_APPLIED": { - return HIGHER_VALUE_DISCOUNT_APPLIED; - } + public CountryCode getIsoCode() { + return (CountryCode) get("isoCode"); + } - case "INVALID": { - return INVALID; - } + public Country setIsoCode(CountryCode arg) { + optimisticData.put(getKey("isoCode"), arg); + return this; + } - case "INVALID_COUNTRY_AND_CURRENCY": { - return INVALID_COUNTRY_AND_CURRENCY; - } + /** + * The market that includes this country. + */ - case "INVALID_FOR_COUNTRY": { - return INVALID_FOR_COUNTRY; - } + public Market getMarket() { + return (Market) get("market"); + } - case "INVALID_FOR_COUNTRY_AND_PROVINCE": { - return INVALID_FOR_COUNTRY_AND_PROVINCE; - } - - case "INVALID_PROVINCE_IN_COUNTRY": { - return INVALID_PROVINCE_IN_COUNTRY; - } - - case "INVALID_QUEUE_TOKEN": { - return INVALID_QUEUE_TOKEN; - } - - case "INVALID_REGION_IN_COUNTRY": { - return INVALID_REGION_IN_COUNTRY; - } - - case "INVALID_STATE_IN_COUNTRY": { - return INVALID_STATE_IN_COUNTRY; - } - - case "LESS_THAN": { - return LESS_THAN; - } - - case "LESS_THAN_OR_EQUAL_TO": { - return LESS_THAN_OR_EQUAL_TO; - } - - case "LINE_ITEM_NOT_FOUND": { - return LINE_ITEM_NOT_FOUND; - } + public Country setMarket(Market arg) { + optimisticData.put(getKey("market"), arg); + return this; + } - case "LOCKED": { - return LOCKED; - } + /** + * The name of the country. + */ - case "MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED": { - return MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED; - } + public String getName() { + return (String) get("name"); + } - case "MISSING_PAYMENT_INPUT": { - return MISSING_PAYMENT_INPUT; - } + public Country setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } - case "NOT_ENOUGH_IN_STOCK": { - return NOT_ENOUGH_IN_STOCK; - } + /** + * The unit system used in the country. + */ - case "NOT_SUPPORTED": { - return NOT_SUPPORTED; - } + public UnitSystem getUnitSystem() { + return (UnitSystem) get("unitSystem"); + } - case "PRESENT": { - return PRESENT; - } + public Country setUnitSystem(UnitSystem arg) { + optimisticData.put(getKey("unitSystem"), arg); + return this; + } - case "PRODUCT_NOT_AVAILABLE": { - return PRODUCT_NOT_AVAILABLE; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "availableLanguages": return true; - case "SHIPPING_RATE_EXPIRED": { - return SHIPPING_RATE_EXPIRED; - } + case "currency": return true; - case "THROTTLED_DURING_CHECKOUT": { - return THROTTLED_DURING_CHECKOUT; - } + case "isoCode": return false; - case "TOO_LONG": { - return TOO_LONG; - } + case "market": return true; - case "TOTAL_PRICE_MISMATCH": { - return TOTAL_PRICE_MISMATCH; - } + case "name": return false; - case "UNABLE_TO_APPLY": { - return UNABLE_TO_APPLY; - } + case "unitSystem": return false; - default: { - return UNKNOWN_VALUE; - } + default: return false; } } - public String toString() { - switch (this) { - case ALREADY_COMPLETED: { - return "ALREADY_COMPLETED"; - } + } - case BAD_DOMAIN: { - return "BAD_DOMAIN"; - } + /** + * The code designating a country/region, which generally follows ISO 3166-1 alpha-2 guidelines. + * If a territory doesn't have a country code value in the `CountryCode` enum, then it might be + * considered a subdivision + * of another country. For example, the territories associated with Spain are represented by the + * country code `ES`, + * and the territories associated with the United States of America are represented by the country code + * `US`. + */ + public enum CountryCode { + /** + * Ascension Island. + */ + AC, - case BLANK: { - return "BLANK"; - } + /** + * Andorra. + */ + AD, - case CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE: { - return "CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE"; - } + /** + * United Arab Emirates. + */ + AE, - case CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE: { - return "CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE"; - } + /** + * Afghanistan. + */ + AF, - case DISCOUNT_ALREADY_APPLIED: { - return "DISCOUNT_ALREADY_APPLIED"; - } + /** + * Antigua & Barbuda. + */ + AG, - case DISCOUNT_CODE_APPLICATION_FAILED: { - return "DISCOUNT_CODE_APPLICATION_FAILED"; - } + /** + * Anguilla. + */ + AI, - case DISCOUNT_DISABLED: { - return "DISCOUNT_DISABLED"; - } + /** + * Albania. + */ + AL, - case DISCOUNT_EXPIRED: { - return "DISCOUNT_EXPIRED"; - } + /** + * Armenia. + */ + AM, - case DISCOUNT_LIMIT_REACHED: { - return "DISCOUNT_LIMIT_REACHED"; - } + /** + * Netherlands Antilles. + */ + AN, - case DISCOUNT_NOT_FOUND: { - return "DISCOUNT_NOT_FOUND"; - } + /** + * Angola. + */ + AO, - case EMPTY: { - return "EMPTY"; - } + /** + * Argentina. + */ + AR, - case EXPIRED_QUEUE_TOKEN: { - return "EXPIRED_QUEUE_TOKEN"; - } + /** + * Austria. + */ + AT, - case GIFT_CARD_ALREADY_APPLIED: { - return "GIFT_CARD_ALREADY_APPLIED"; - } + /** + * Australia. + */ + AU, - case GIFT_CARD_CODE_INVALID: { - return "GIFT_CARD_CODE_INVALID"; - } + /** + * Aruba. + */ + AW, - case GIFT_CARD_CURRENCY_MISMATCH: { - return "GIFT_CARD_CURRENCY_MISMATCH"; - } + /** + * Åland Islands. + */ + AX, - case GIFT_CARD_DEPLETED: { - return "GIFT_CARD_DEPLETED"; - } + /** + * Azerbaijan. + */ + AZ, - case GIFT_CARD_DISABLED: { - return "GIFT_CARD_DISABLED"; - } + /** + * Bosnia & Herzegovina. + */ + BA, - case GIFT_CARD_EXPIRED: { - return "GIFT_CARD_EXPIRED"; - } + /** + * Barbados. + */ + BB, - case GIFT_CARD_NOT_FOUND: { - return "GIFT_CARD_NOT_FOUND"; - } + /** + * Bangladesh. + */ + BD, - case GIFT_CARD_UNUSABLE: { - return "GIFT_CARD_UNUSABLE"; - } + /** + * Belgium. + */ + BE, - case GREATER_THAN_OR_EQUAL_TO: { - return "GREATER_THAN_OR_EQUAL_TO"; - } + /** + * Burkina Faso. + */ + BF, - case HIGHER_VALUE_DISCOUNT_APPLIED: { - return "HIGHER_VALUE_DISCOUNT_APPLIED"; - } + /** + * Bulgaria. + */ + BG, - case INVALID: { - return "INVALID"; - } + /** + * Bahrain. + */ + BH, - case INVALID_COUNTRY_AND_CURRENCY: { - return "INVALID_COUNTRY_AND_CURRENCY"; - } + /** + * Burundi. + */ + BI, - case INVALID_FOR_COUNTRY: { - return "INVALID_FOR_COUNTRY"; - } + /** + * Benin. + */ + BJ, - case INVALID_FOR_COUNTRY_AND_PROVINCE: { - return "INVALID_FOR_COUNTRY_AND_PROVINCE"; - } + /** + * St. Barthélemy. + */ + BL, - case INVALID_PROVINCE_IN_COUNTRY: { - return "INVALID_PROVINCE_IN_COUNTRY"; - } + /** + * Bermuda. + */ + BM, - case INVALID_QUEUE_TOKEN: { - return "INVALID_QUEUE_TOKEN"; - } + /** + * Brunei. + */ + BN, - case INVALID_REGION_IN_COUNTRY: { - return "INVALID_REGION_IN_COUNTRY"; - } + /** + * Bolivia. + */ + BO, - case INVALID_STATE_IN_COUNTRY: { - return "INVALID_STATE_IN_COUNTRY"; - } + /** + * Caribbean Netherlands. + */ + BQ, - case LESS_THAN: { - return "LESS_THAN"; - } + /** + * Brazil. + */ + BR, - case LESS_THAN_OR_EQUAL_TO: { - return "LESS_THAN_OR_EQUAL_TO"; - } + /** + * Bahamas. + */ + BS, - case LINE_ITEM_NOT_FOUND: { - return "LINE_ITEM_NOT_FOUND"; - } + /** + * Bhutan. + */ + BT, - case LOCKED: { - return "LOCKED"; - } + /** + * Bouvet Island. + */ + BV, - case MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED: { - return "MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED"; - } + /** + * Botswana. + */ + BW, - case MISSING_PAYMENT_INPUT: { - return "MISSING_PAYMENT_INPUT"; - } + /** + * Belarus. + */ + BY, - case NOT_ENOUGH_IN_STOCK: { - return "NOT_ENOUGH_IN_STOCK"; - } + /** + * Belize. + */ + BZ, - case NOT_SUPPORTED: { - return "NOT_SUPPORTED"; - } + /** + * Canada. + */ + CA, - case PRESENT: { - return "PRESENT"; - } + /** + * Cocos (Keeling) Islands. + */ + CC, - case PRODUCT_NOT_AVAILABLE: { - return "PRODUCT_NOT_AVAILABLE"; - } + /** + * Congo - Kinshasa. + */ + CD, - case SHIPPING_RATE_EXPIRED: { - return "SHIPPING_RATE_EXPIRED"; - } + /** + * Central African Republic. + */ + CF, - case THROTTLED_DURING_CHECKOUT: { - return "THROTTLED_DURING_CHECKOUT"; - } + /** + * Congo - Brazzaville. + */ + CG, - case TOO_LONG: { - return "TOO_LONG"; - } + /** + * Switzerland. + */ + CH, - case TOTAL_PRICE_MISMATCH: { - return "TOTAL_PRICE_MISMATCH"; - } + /** + * Côte d’Ivoire. + */ + CI, - case UNABLE_TO_APPLY: { - return "UNABLE_TO_APPLY"; - } + /** + * Cook Islands. + */ + CK, - default: { - return ""; - } - } - } - } + /** + * Chile. + */ + CL, - public interface CheckoutGiftCardRemoveV2PayloadQueryDefinition { - void define(CheckoutGiftCardRemoveV2PayloadQuery _queryBuilder); - } + /** + * Cameroon. + */ + CM, - /** - * Return type for `checkoutGiftCardRemoveV2` mutation. - */ - public static class CheckoutGiftCardRemoveV2PayloadQuery extends Query { - CheckoutGiftCardRemoveV2PayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + /** + * China. + */ + CN, /** - * The updated checkout object. + * Colombia. */ - public CheckoutGiftCardRemoveV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + CO, - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Costa Rica. + */ + CR, - return this; - } + /** + * Cuba. + */ + CU, /** - * The list of errors that occurred from executing the mutation. + * Cape Verde. */ - public CheckoutGiftCardRemoveV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + CV, - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Curaçao. + */ + CW, - return this; - } + /** + * Christmas Island. + */ + CX, /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * Cyprus. */ - @Deprecated - public CheckoutGiftCardRemoveV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + CY, - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Czechia. + */ + CZ, - return this; - } - } + /** + * Germany. + */ + DE, - /** - * Return type for `checkoutGiftCardRemoveV2` mutation. - */ - public static class CheckoutGiftCardRemoveV2Payload extends AbstractResponse { - public CheckoutGiftCardRemoveV2Payload() { - } + /** + * Djibouti. + */ + DJ, - public CheckoutGiftCardRemoveV2Payload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } + /** + * Denmark. + */ + DK, - responseData.put(key, optional1); + /** + * Dominica. + */ + DM, - break; - } + /** + * Dominican Republic. + */ + DO, - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } + /** + * Algeria. + */ + DZ, - responseData.put(key, list1); + /** + * Ecuador. + */ + EC, - break; - } + /** + * Estonia. + */ + EE, - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + /** + * Egypt. + */ + EG, - responseData.put(key, list1); + /** + * Western Sahara. + */ + EH, - break; - } + /** + * Eritrea. + */ + ER, - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + /** + * Spain. + */ + ES, - public String getGraphQlTypeName() { - return "CheckoutGiftCardRemoveV2Payload"; - } + /** + * Ethiopia. + */ + ET, /** - * The updated checkout object. + * Finland. */ + FI, - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } + /** + * Fiji. + */ + FJ, - public CheckoutGiftCardRemoveV2Payload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; - } + /** + * Falkland Islands. + */ + FK, /** - * The list of errors that occurred from executing the mutation. + * Faroe Islands. */ + FO, - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); - } + /** + * France. + */ + FR, - public CheckoutGiftCardRemoveV2Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } + /** + * Gabon. + */ + GA, /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * United Kingdom. */ - - public List getUserErrors() { - return (List) get("userErrors"); - } - - public CheckoutGiftCardRemoveV2Payload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; - - case "checkoutUserErrors": return true; - - case "userErrors": return true; - - default: return false; - } - } - } - - public interface CheckoutGiftCardsAppendPayloadQueryDefinition { - void define(CheckoutGiftCardsAppendPayloadQuery _queryBuilder); - } - - /** - * Return type for `checkoutGiftCardsAppend` mutation. - */ - public static class CheckoutGiftCardsAppendPayloadQuery extends Query { - CheckoutGiftCardsAppendPayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + GB, /** - * The updated checkout object. + * Grenada. */ - public CheckoutGiftCardsAppendPayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } + GD, /** - * The list of errors that occurred from executing the mutation. + * Georgia. */ - public CheckoutGiftCardsAppendPayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } + GE, /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * French Guiana. */ - @Deprecated - public CheckoutGiftCardsAppendPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * Return type for `checkoutGiftCardsAppend` mutation. - */ - public static class CheckoutGiftCardsAppendPayload extends AbstractResponse { - public CheckoutGiftCardsAppendPayload() { - } - - public CheckoutGiftCardsAppendPayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } + GF, - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + /** + * Guernsey. + */ + GG, - public String getGraphQlTypeName() { - return "CheckoutGiftCardsAppendPayload"; - } + /** + * Ghana. + */ + GH, /** - * The updated checkout object. + * Gibraltar. */ + GI, - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } + /** + * Greenland. + */ + GL, - public CheckoutGiftCardsAppendPayload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; - } + /** + * Gambia. + */ + GM, /** - * The list of errors that occurred from executing the mutation. + * Guinea. */ + GN, - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); - } + /** + * Guadeloupe. + */ + GP, - public CheckoutGiftCardsAppendPayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } + /** + * Equatorial Guinea. + */ + GQ, /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * Greece. */ + GR, - public List getUserErrors() { - return (List) get("userErrors"); - } + /** + * South Georgia & South Sandwich Islands. + */ + GS, - public CheckoutGiftCardsAppendPayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } + /** + * Guatemala. + */ + GT, - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + /** + * Guinea-Bissau. + */ + GW, - case "checkoutUserErrors": return true; + /** + * Guyana. + */ + GY, - case "userErrors": return true; + /** + * Hong Kong SAR. + */ + HK, - default: return false; - } - } - } + /** + * Heard & McDonald Islands. + */ + HM, - public interface CheckoutLineItemQueryDefinition { - void define(CheckoutLineItemQuery _queryBuilder); - } + /** + * Honduras. + */ + HN, - /** - * A single line item in the checkout, grouped by variant and attributes. - */ - public static class CheckoutLineItemQuery extends Query { - CheckoutLineItemQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + /** + * Croatia. + */ + HR, - startField("id"); - } + /** + * Haiti. + */ + HT, /** - * Extra information in the form of an array of Key-Value pairs about the line item. + * Hungary. */ - public CheckoutLineItemQuery customAttributes(AttributeQueryDefinition queryDef) { - startField("customAttributes"); + HU, - _queryBuilder.append('{'); - queryDef.define(new AttributeQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Indonesia. + */ + ID, - return this; - } + /** + * Ireland. + */ + IE, /** - * The discounts that have been allocated onto the checkout line item by discount applications. + * Israel. */ - public CheckoutLineItemQuery discountAllocations(DiscountAllocationQueryDefinition queryDef) { - startField("discountAllocations"); + IL, - _queryBuilder.append('{'); - queryDef.define(new DiscountAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Isle of Man. + */ + IM, - return this; - } + /** + * India. + */ + IN, /** - * The quantity of the line item. + * British Indian Ocean Territory. */ - public CheckoutLineItemQuery quantity() { - startField("quantity"); + IO, - return this; - } + /** + * Iraq. + */ + IQ, /** - * Title of the line item. Defaults to the product's title. + * Iran. */ - public CheckoutLineItemQuery title() { - startField("title"); + IR, - return this; - } + /** + * Iceland. + */ + IS, /** - * Unit price of the line item. + * Italy. */ - public CheckoutLineItemQuery unitPrice(MoneyV2QueryDefinition queryDef) { - startField("unitPrice"); + IT, - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Jersey. + */ + JE, - return this; - } + /** + * Jamaica. + */ + JM, /** - * Product variant of the line item. + * Jordan. */ - public CheckoutLineItemQuery variant(ProductVariantQueryDefinition queryDef) { - startField("variant"); + JO, - _queryBuilder.append('{'); - queryDef.define(new ProductVariantQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Japan. + */ + JP, - return this; - } - } + /** + * Kenya. + */ + KE, - /** - * A single line item in the checkout, grouped by variant and attributes. - */ - public static class CheckoutLineItem extends AbstractResponse implements Node { - public CheckoutLineItem() { - } + /** + * Kyrgyzstan. + */ + KG, - public CheckoutLineItem(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "customAttributes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Attribute(jsonAsObject(element1, key))); - } + /** + * Cambodia. + */ + KH, - responseData.put(key, list1); + /** + * Kiribati. + */ + KI, - break; - } + /** + * Comoros. + */ + KM, - case "discountAllocations": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new DiscountAllocation(jsonAsObject(element1, key))); - } + /** + * St. Kitts & Nevis. + */ + KN, - responseData.put(key, list1); + /** + * North Korea. + */ + KP, - break; - } + /** + * South Korea. + */ + KR, - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + /** + * Kuwait. + */ + KW, - break; - } + /** + * Cayman Islands. + */ + KY, - case "quantity": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + /** + * Kazakhstan. + */ + KZ, - break; - } + /** + * Laos. + */ + LA, - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Lebanon. + */ + LB, - break; - } + /** + * St. Lucia. + */ + LC, - case "unitPrice": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } + /** + * Liechtenstein. + */ + LI, - responseData.put(key, optional1); + /** + * Sri Lanka. + */ + LK, - break; - } + /** + * Liberia. + */ + LR, - case "variant": { - ProductVariant optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ProductVariant(jsonAsObject(field.getValue(), key)); - } + /** + * Lesotho. + */ + LS, - responseData.put(key, optional1); + /** + * Lithuania. + */ + LT, - break; - } + /** + * Luxembourg. + */ + LU, - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + /** + * Latvia. + */ + LV, - public CheckoutLineItem(ID id) { - this(); - optimisticData.put("id", id); - } + /** + * Libya. + */ + LY, - public String getGraphQlTypeName() { - return "CheckoutLineItem"; - } + /** + * Morocco. + */ + MA, /** - * Extra information in the form of an array of Key-Value pairs about the line item. + * Monaco. */ + MC, - public List getCustomAttributes() { - return (List) get("customAttributes"); - } + /** + * Moldova. + */ + MD, - public CheckoutLineItem setCustomAttributes(List arg) { - optimisticData.put(getKey("customAttributes"), arg); - return this; - } + /** + * Montenegro. + */ + ME, /** - * The discounts that have been allocated onto the checkout line item by discount applications. + * St. Martin. */ + MF, - public List getDiscountAllocations() { - return (List) get("discountAllocations"); - } + /** + * Madagascar. + */ + MG, - public CheckoutLineItem setDiscountAllocations(List arg) { - optimisticData.put(getKey("discountAllocations"), arg); - return this; - } + /** + * North Macedonia. + */ + MK, /** - * A globally-unique ID. + * Mali. */ + ML, - public ID getId() { - return (ID) get("id"); - } + /** + * Myanmar (Burma). + */ + MM, /** - * The quantity of the line item. + * Mongolia. */ + MN, - public Integer getQuantity() { - return (Integer) get("quantity"); - } + /** + * Macao SAR. + */ + MO, - public CheckoutLineItem setQuantity(Integer arg) { - optimisticData.put(getKey("quantity"), arg); - return this; - } + /** + * Martinique. + */ + MQ, /** - * Title of the line item. Defaults to the product's title. + * Mauritania. */ + MR, - public String getTitle() { - return (String) get("title"); - } + /** + * Montserrat. + */ + MS, - public CheckoutLineItem setTitle(String arg) { - optimisticData.put(getKey("title"), arg); - return this; - } + /** + * Malta. + */ + MT, /** - * Unit price of the line item. + * Mauritius. */ + MU, - public MoneyV2 getUnitPrice() { - return (MoneyV2) get("unitPrice"); - } + /** + * Maldives. + */ + MV, - public CheckoutLineItem setUnitPrice(MoneyV2 arg) { - optimisticData.put(getKey("unitPrice"), arg); - return this; - } + /** + * Malawi. + */ + MW, /** - * Product variant of the line item. + * Mexico. */ + MX, - public ProductVariant getVariant() { - return (ProductVariant) get("variant"); - } + /** + * Malaysia. + */ + MY, - public CheckoutLineItem setVariant(ProductVariant arg) { - optimisticData.put(getKey("variant"), arg); - return this; - } + /** + * Mozambique. + */ + MZ, - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "customAttributes": return true; + /** + * Namibia. + */ + NA, - case "discountAllocations": return true; + /** + * New Caledonia. + */ + NC, - case "id": return false; + /** + * Niger. + */ + NE, - case "quantity": return false; + /** + * Norfolk Island. + */ + NF, - case "title": return false; + /** + * Nigeria. + */ + NG, - case "unitPrice": return true; + /** + * Nicaragua. + */ + NI, - case "variant": return true; + /** + * Netherlands. + */ + NL, - default: return false; - } - } - } + /** + * Norway. + */ + NO, - public interface CheckoutLineItemConnectionQueryDefinition { - void define(CheckoutLineItemConnectionQuery _queryBuilder); - } + /** + * Nepal. + */ + NP, - /** - * An auto-generated type for paginating through multiple CheckoutLineItems. - */ - public static class CheckoutLineItemConnectionQuery extends Query { - CheckoutLineItemConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + /** + * Nauru. + */ + NR, /** - * A list of edges. + * Niue. */ - public CheckoutLineItemConnectionQuery edges(CheckoutLineItemEdgeQueryDefinition queryDef) { - startField("edges"); + NU, - _queryBuilder.append('{'); - queryDef.define(new CheckoutLineItemEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * New Zealand. + */ + NZ, - return this; - } + /** + * Oman. + */ + OM, /** - * A list of the nodes contained in CheckoutLineItemEdge. + * Panama. */ - public CheckoutLineItemConnectionQuery nodes(CheckoutLineItemQueryDefinition queryDef) { - startField("nodes"); + PA, - _queryBuilder.append('{'); - queryDef.define(new CheckoutLineItemQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Peru. + */ + PE, - return this; - } + /** + * French Polynesia. + */ + PF, /** - * Information to aid in pagination. + * Papua New Guinea. */ - public CheckoutLineItemConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + PG, - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Philippines. + */ + PH, - return this; - } - } + /** + * Pakistan. + */ + PK, - /** - * An auto-generated type for paginating through multiple CheckoutLineItems. - */ - public static class CheckoutLineItemConnection extends AbstractResponse { - public CheckoutLineItemConnection() { - } + /** + * Poland. + */ + PL, - public CheckoutLineItemConnection(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutLineItemEdge(jsonAsObject(element1, key))); - } + /** + * St. Pierre & Miquelon. + */ + PM, - responseData.put(key, list1); + /** + * Pitcairn Islands. + */ + PN, - break; - } + /** + * Palestinian Territories. + */ + PS, - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutLineItem(jsonAsObject(element1, key))); - } + /** + * Portugal. + */ + PT, - responseData.put(key, list1); + /** + * Paraguay. + */ + PY, - break; - } + /** + * Qatar. + */ + QA, - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + /** + * Réunion. + */ + RE, - break; - } + /** + * Romania. + */ + RO, - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + /** + * Serbia. + */ + RS, - public String getGraphQlTypeName() { - return "CheckoutLineItemConnection"; - } + /** + * Russia. + */ + RU, /** - * A list of edges. + * Rwanda. */ + RW, - public List getEdges() { - return (List) get("edges"); - } + /** + * Saudi Arabia. + */ + SA, - public CheckoutLineItemConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; - } + /** + * Solomon Islands. + */ + SB, /** - * A list of the nodes contained in CheckoutLineItemEdge. + * Seychelles. */ + SC, - public List getNodes() { - return (List) get("nodes"); - } + /** + * Sudan. + */ + SD, - public CheckoutLineItemConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; - } + /** + * Sweden. + */ + SE, /** - * Information to aid in pagination. + * Singapore. */ + SG, - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } + /** + * St. Helena. + */ + SH, - public CheckoutLineItemConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); - return this; - } + /** + * Slovenia. + */ + SI, - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; + /** + * Svalbard & Jan Mayen. + */ + SJ, - case "nodes": return true; + /** + * Slovakia. + */ + SK, - case "pageInfo": return true; + /** + * Sierra Leone. + */ + SL, - default: return false; - } - } - } + /** + * San Marino. + */ + SM, - public interface CheckoutLineItemEdgeQueryDefinition { - void define(CheckoutLineItemEdgeQuery _queryBuilder); - } + /** + * Senegal. + */ + SN, - /** - * An auto-generated type which holds one CheckoutLineItem and a cursor during pagination. - */ - public static class CheckoutLineItemEdgeQuery extends Query { - CheckoutLineItemEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + /** + * Somalia. + */ + SO, /** - * A cursor for use in pagination. + * Suriname. */ - public CheckoutLineItemEdgeQuery cursor() { - startField("cursor"); + SR, - return this; - } + /** + * South Sudan. + */ + SS, /** - * The item at the end of CheckoutLineItemEdge. + * São Tomé & Príncipe. */ - public CheckoutLineItemEdgeQuery node(CheckoutLineItemQueryDefinition queryDef) { - startField("node"); + ST, - _queryBuilder.append('{'); - queryDef.define(new CheckoutLineItemQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * El Salvador. + */ + SV, - return this; - } - } + /** + * Sint Maarten. + */ + SX, - /** - * An auto-generated type which holds one CheckoutLineItem and a cursor during pagination. - */ - public static class CheckoutLineItemEdge extends AbstractResponse { - public CheckoutLineItemEdge() { - } + /** + * Syria. + */ + SY, - public CheckoutLineItemEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Eswatini. + */ + SZ, - break; - } + /** + * Tristan da Cunha. + */ + TA, - case "node": { - responseData.put(key, new CheckoutLineItem(jsonAsObject(field.getValue(), key))); + /** + * Turks & Caicos Islands. + */ + TC, - break; - } + /** + * Chad. + */ + TD, - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + /** + * French Southern Territories. + */ + TF, - public String getGraphQlTypeName() { - return "CheckoutLineItemEdge"; - } + /** + * Togo. + */ + TG, /** - * A cursor for use in pagination. + * Thailand. */ + TH, - public String getCursor() { - return (String) get("cursor"); - } + /** + * Tajikistan. + */ + TJ, - public CheckoutLineItemEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; - } + /** + * Tokelau. + */ + TK, /** - * The item at the end of CheckoutLineItemEdge. + * Timor-Leste. */ + TL, - public CheckoutLineItem getNode() { - return (CheckoutLineItem) get("node"); - } + /** + * Turkmenistan. + */ + TM, - public CheckoutLineItemEdge setNode(CheckoutLineItem arg) { - optimisticData.put(getKey("node"), arg); - return this; - } + /** + * Tunisia. + */ + TN, - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; + /** + * Tonga. + */ + TO, - case "node": return true; + /** + * Türkiye. + */ + TR, - default: return false; - } - } - } + /** + * Trinidad & Tobago. + */ + TT, - public static class CheckoutLineItemInput implements Serializable { - private int quantity; + /** + * Tuvalu. + */ + TV, - private ID variantId; + /** + * Taiwan. + */ + TW, - private Input> customAttributes = Input.undefined(); + /** + * Tanzania. + */ + TZ, - public CheckoutLineItemInput(int quantity, ID variantId) { - this.quantity = quantity; + /** + * Ukraine. + */ + UA, - this.variantId = variantId; - } + /** + * Uganda. + */ + UG, - public int getQuantity() { - return quantity; - } + /** + * U.S. Outlying Islands. + */ + UM, - public CheckoutLineItemInput setQuantity(int quantity) { - this.quantity = quantity; - return this; - } + /** + * United States. + */ + US, - public ID getVariantId() { - return variantId; - } + /** + * Uruguay. + */ + UY, - public CheckoutLineItemInput setVariantId(ID variantId) { - this.variantId = variantId; - return this; - } + /** + * Uzbekistan. + */ + UZ, - public List getCustomAttributes() { - return customAttributes.getValue(); - } + /** + * Vatican City. + */ + VA, - public Input> getCustomAttributesInput() { - return customAttributes; - } + /** + * St. Vincent & Grenadines. + */ + VC, - public CheckoutLineItemInput setCustomAttributes(List customAttributes) { - this.customAttributes = Input.optional(customAttributes); - return this; - } + /** + * Venezuela. + */ + VE, - public CheckoutLineItemInput setCustomAttributesInput(Input> customAttributes) { - if (customAttributes == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.customAttributes = customAttributes; - return this; - } + /** + * British Virgin Islands. + */ + VG, - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + /** + * Vietnam. + */ + VN, - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("quantity:"); - _queryBuilder.append(quantity); + /** + * Vanuatu. + */ + VU, - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("variantId:"); - Query.appendQuotedString(_queryBuilder, variantId.toString()); + /** + * Wallis & Futuna. + */ + WF, - if (this.customAttributes.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("customAttributes:"); - if (customAttributes.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (AttributeInput item1 : customAttributes.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - } else { - _queryBuilder.append("null"); - } - } + /** + * Samoa. + */ + WS, - _queryBuilder.append('}'); - } - } + /** + * Kosovo. + */ + XK, - public static class CheckoutLineItemUpdateInput implements Serializable { - private Input id = Input.undefined(); + /** + * Yemen. + */ + YE, - private Input variantId = Input.undefined(); + /** + * Mayotte. + */ + YT, - private Input quantity = Input.undefined(); + /** + * South Africa. + */ + ZA, - private Input> customAttributes = Input.undefined(); + /** + * Zambia. + */ + ZM, - public ID getId() { - return id.getValue(); - } + /** + * Zimbabwe. + */ + ZW, - public Input getIdInput() { - return id; - } + /** + * Unknown Region. + */ + ZZ, - public CheckoutLineItemUpdateInput setId(ID id) { - this.id = Input.optional(id); - return this; - } + UNKNOWN_VALUE; - public CheckoutLineItemUpdateInput setIdInput(Input id) { - if (id == null) { - throw new IllegalArgumentException("Input can not be null"); + public static CountryCode fromGraphQl(String value) { + if (value == null) { + return null; } - this.id = id; - return this; - } - public ID getVariantId() { - return variantId.getValue(); - } + switch (value) { + case "AC": { + return AC; + } - public Input getVariantIdInput() { - return variantId; - } + case "AD": { + return AD; + } - public CheckoutLineItemUpdateInput setVariantId(ID variantId) { - this.variantId = Input.optional(variantId); - return this; - } + case "AE": { + return AE; + } - public CheckoutLineItemUpdateInput setVariantIdInput(Input variantId) { - if (variantId == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.variantId = variantId; - return this; - } + case "AF": { + return AF; + } - public Integer getQuantity() { - return quantity.getValue(); - } + case "AG": { + return AG; + } - public Input getQuantityInput() { - return quantity; - } + case "AI": { + return AI; + } - public CheckoutLineItemUpdateInput setQuantity(Integer quantity) { - this.quantity = Input.optional(quantity); - return this; - } + case "AL": { + return AL; + } - public CheckoutLineItemUpdateInput setQuantityInput(Input quantity) { - if (quantity == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.quantity = quantity; - return this; - } + case "AM": { + return AM; + } - public List getCustomAttributes() { - return customAttributes.getValue(); - } + case "AN": { + return AN; + } - public Input> getCustomAttributesInput() { - return customAttributes; - } + case "AO": { + return AO; + } - public CheckoutLineItemUpdateInput setCustomAttributes(List customAttributes) { - this.customAttributes = Input.optional(customAttributes); - return this; - } + case "AR": { + return AR; + } - public CheckoutLineItemUpdateInput setCustomAttributesInput(Input> customAttributes) { - if (customAttributes == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.customAttributes = customAttributes; - return this; - } + case "AT": { + return AT; + } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + case "AU": { + return AU; + } - if (this.id.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("id:"); - if (id.getValue() != null) { - Query.appendQuotedString(_queryBuilder, id.getValue().toString()); - } else { - _queryBuilder.append("null"); + case "AW": { + return AW; } - } - if (this.variantId.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("variantId:"); - if (variantId.getValue() != null) { - Query.appendQuotedString(_queryBuilder, variantId.getValue().toString()); - } else { - _queryBuilder.append("null"); + case "AX": { + return AX; } - } - if (this.quantity.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("quantity:"); - if (quantity.getValue() != null) { - _queryBuilder.append(quantity.getValue()); - } else { - _queryBuilder.append("null"); + case "AZ": { + return AZ; } - } - if (this.customAttributes.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("customAttributes:"); - if (customAttributes.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (AttributeInput item1 : customAttributes.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - } else { - _queryBuilder.append("null"); + case "BA": { + return BA; } - } - _queryBuilder.append('}'); - } - } + case "BB": { + return BB; + } - public interface CheckoutLineItemsAddPayloadQueryDefinition { - void define(CheckoutLineItemsAddPayloadQuery _queryBuilder); - } + case "BD": { + return BD; + } - /** - * Return type for `checkoutLineItemsAdd` mutation. - */ - public static class CheckoutLineItemsAddPayloadQuery extends Query { - CheckoutLineItemsAddPayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "BE": { + return BE; + } - /** - * The updated checkout object. - */ - public CheckoutLineItemsAddPayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + case "BF": { + return BF; + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "BG": { + return BG; + } - return this; - } + case "BH": { + return BH; + } - /** - * The list of errors that occurred from executing the mutation. - */ - public CheckoutLineItemsAddPayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + case "BI": { + return BI; + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "BJ": { + return BJ; + } - return this; - } + case "BL": { + return BL; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ - @Deprecated - public CheckoutLineItemsAddPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + case "BM": { + return BM; + } - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "BN": { + return BN; + } - return this; - } - } + case "BO": { + return BO; + } - /** - * Return type for `checkoutLineItemsAdd` mutation. - */ - public static class CheckoutLineItemsAddPayload extends AbstractResponse { - public CheckoutLineItemsAddPayload() { - } + case "BQ": { + return BQ; + } - public CheckoutLineItemsAddPayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } + case "BR": { + return BR; + } - responseData.put(key, optional1); + case "BS": { + return BS; + } - break; - } + case "BT": { + return BT; + } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } + case "BV": { + return BV; + } - responseData.put(key, list1); + case "BW": { + return BW; + } - break; - } + case "BY": { + return BY; + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + case "BZ": { + return BZ; + } - responseData.put(key, list1); + case "CA": { + return CA; + } - break; - } + case "CC": { + return CC; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "CD": { + return CD; } - } - } - public String getGraphQlTypeName() { - return "CheckoutLineItemsAddPayload"; - } + case "CF": { + return CF; + } - /** - * The updated checkout object. - */ + case "CG": { + return CG; + } - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } + case "CH": { + return CH; + } - public CheckoutLineItemsAddPayload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; - } + case "CI": { + return CI; + } - /** - * The list of errors that occurred from executing the mutation. - */ + case "CK": { + return CK; + } - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); - } + case "CL": { + return CL; + } - public CheckoutLineItemsAddPayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } + case "CM": { + return CM; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ + case "CN": { + return CN; + } - public List getUserErrors() { - return (List) get("userErrors"); - } + case "CO": { + return CO; + } - public CheckoutLineItemsAddPayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } + case "CR": { + return CR; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + case "CU": { + return CU; + } - case "checkoutUserErrors": return true; + case "CV": { + return CV; + } - case "userErrors": return true; + case "CW": { + return CW; + } - default: return false; - } - } - } + case "CX": { + return CX; + } - public interface CheckoutLineItemsRemovePayloadQueryDefinition { - void define(CheckoutLineItemsRemovePayloadQuery _queryBuilder); - } + case "CY": { + return CY; + } - /** - * Return type for `checkoutLineItemsRemove` mutation. - */ - public static class CheckoutLineItemsRemovePayloadQuery extends Query { - CheckoutLineItemsRemovePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "CZ": { + return CZ; + } - /** - * The updated checkout object. - */ - public CheckoutLineItemsRemovePayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + case "DE": { + return DE; + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "DJ": { + return DJ; + } - return this; - } + case "DK": { + return DK; + } - /** - * The list of errors that occurred from executing the mutation. - */ - public CheckoutLineItemsRemovePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + case "DM": { + return DM; + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "DO": { + return DO; + } - return this; - } + case "DZ": { + return DZ; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ - @Deprecated - public CheckoutLineItemsRemovePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + case "EC": { + return EC; + } - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "EE": { + return EE; + } - return this; - } - } + case "EG": { + return EG; + } - /** - * Return type for `checkoutLineItemsRemove` mutation. - */ - public static class CheckoutLineItemsRemovePayload extends AbstractResponse { - public CheckoutLineItemsRemovePayload() { - } + case "EH": { + return EH; + } - public CheckoutLineItemsRemovePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } + case "ER": { + return ER; + } - responseData.put(key, optional1); + case "ES": { + return ES; + } - break; - } + case "ET": { + return ET; + } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } + case "FI": { + return FI; + } - responseData.put(key, list1); + case "FJ": { + return FJ; + } - break; - } + case "FK": { + return FK; + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + case "FO": { + return FO; + } - responseData.put(key, list1); + case "FR": { + return FR; + } - break; - } + case "GA": { + return GA; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "GB": { + return GB; } - } - } - public String getGraphQlTypeName() { - return "CheckoutLineItemsRemovePayload"; - } + case "GD": { + return GD; + } - /** - * The updated checkout object. - */ + case "GE": { + return GE; + } - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } + case "GF": { + return GF; + } - public CheckoutLineItemsRemovePayload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; - } + case "GG": { + return GG; + } - /** - * The list of errors that occurred from executing the mutation. - */ + case "GH": { + return GH; + } - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); - } + case "GI": { + return GI; + } - public CheckoutLineItemsRemovePayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } + case "GL": { + return GL; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ + case "GM": { + return GM; + } - public List getUserErrors() { - return (List) get("userErrors"); - } + case "GN": { + return GN; + } - public CheckoutLineItemsRemovePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } + case "GP": { + return GP; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + case "GQ": { + return GQ; + } - case "checkoutUserErrors": return true; + case "GR": { + return GR; + } - case "userErrors": return true; + case "GS": { + return GS; + } - default: return false; - } - } - } + case "GT": { + return GT; + } - public interface CheckoutLineItemsReplacePayloadQueryDefinition { - void define(CheckoutLineItemsReplacePayloadQuery _queryBuilder); - } + case "GW": { + return GW; + } - /** - * Return type for `checkoutLineItemsReplace` mutation. - */ - public static class CheckoutLineItemsReplacePayloadQuery extends Query { - CheckoutLineItemsReplacePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "GY": { + return GY; + } - /** - * The updated checkout object. - */ - public CheckoutLineItemsReplacePayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + case "HK": { + return HK; + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "HM": { + return HM; + } - return this; - } + case "HN": { + return HN; + } - /** - * The list of errors that occurred from executing the mutation. - */ - public CheckoutLineItemsReplacePayloadQuery userErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("userErrors"); + case "HR": { + return HR; + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "HT": { + return HT; + } - return this; - } - } + case "HU": { + return HU; + } - /** - * Return type for `checkoutLineItemsReplace` mutation. - */ - public static class CheckoutLineItemsReplacePayload extends AbstractResponse { - public CheckoutLineItemsReplacePayload() { - } + case "ID": { + return ID; + } - public CheckoutLineItemsReplacePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } + case "IE": { + return IE; + } - responseData.put(key, optional1); + case "IL": { + return IL; + } - break; - } + case "IM": { + return IM; + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } + case "IN": { + return IN; + } - responseData.put(key, list1); + case "IO": { + return IO; + } - break; - } + case "IQ": { + return IQ; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "IR": { + return IR; } - } - } - public String getGraphQlTypeName() { - return "CheckoutLineItemsReplacePayload"; - } + case "IS": { + return IS; + } - /** - * The updated checkout object. - */ + case "IT": { + return IT; + } - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } + case "JE": { + return JE; + } - public CheckoutLineItemsReplacePayload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; - } + case "JM": { + return JM; + } - /** - * The list of errors that occurred from executing the mutation. - */ + case "JO": { + return JO; + } - public List getUserErrors() { - return (List) get("userErrors"); - } + case "JP": { + return JP; + } - public CheckoutLineItemsReplacePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } + case "KE": { + return KE; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + case "KG": { + return KG; + } - case "userErrors": return true; + case "KH": { + return KH; + } - default: return false; - } - } - } + case "KI": { + return KI; + } - public interface CheckoutLineItemsUpdatePayloadQueryDefinition { - void define(CheckoutLineItemsUpdatePayloadQuery _queryBuilder); - } + case "KM": { + return KM; + } - /** - * Return type for `checkoutLineItemsUpdate` mutation. - */ - public static class CheckoutLineItemsUpdatePayloadQuery extends Query { - CheckoutLineItemsUpdatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "KN": { + return KN; + } - /** - * The updated checkout object. - */ - public CheckoutLineItemsUpdatePayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + case "KP": { + return KP; + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "KR": { + return KR; + } - return this; - } + case "KW": { + return KW; + } - /** - * The list of errors that occurred from executing the mutation. - */ - public CheckoutLineItemsUpdatePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + case "KY": { + return KY; + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "KZ": { + return KZ; + } - return this; - } + case "LA": { + return LA; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ - @Deprecated - public CheckoutLineItemsUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + case "LB": { + return LB; + } - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "LC": { + return LC; + } - return this; - } - } + case "LI": { + return LI; + } - /** - * Return type for `checkoutLineItemsUpdate` mutation. - */ - public static class CheckoutLineItemsUpdatePayload extends AbstractResponse { - public CheckoutLineItemsUpdatePayload() { - } + case "LK": { + return LK; + } - public CheckoutLineItemsUpdatePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } + case "LR": { + return LR; + } - responseData.put(key, optional1); + case "LS": { + return LS; + } - break; - } + case "LT": { + return LT; + } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } + case "LU": { + return LU; + } - responseData.put(key, list1); + case "LV": { + return LV; + } - break; - } + case "LY": { + return LY; + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + case "MA": { + return MA; + } - responseData.put(key, list1); + case "MC": { + return MC; + } - break; - } + case "MD": { + return MD; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "ME": { + return ME; } - } - } - public String getGraphQlTypeName() { - return "CheckoutLineItemsUpdatePayload"; - } + case "MF": { + return MF; + } - /** - * The updated checkout object. - */ + case "MG": { + return MG; + } - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } + case "MK": { + return MK; + } - public CheckoutLineItemsUpdatePayload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; - } + case "ML": { + return ML; + } - /** - * The list of errors that occurred from executing the mutation. - */ + case "MM": { + return MM; + } - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); - } + case "MN": { + return MN; + } - public CheckoutLineItemsUpdatePayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } + case "MO": { + return MO; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ + case "MQ": { + return MQ; + } - public List getUserErrors() { - return (List) get("userErrors"); - } + case "MR": { + return MR; + } - public CheckoutLineItemsUpdatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } + case "MS": { + return MS; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + case "MT": { + return MT; + } - case "checkoutUserErrors": return true; + case "MU": { + return MU; + } - case "userErrors": return true; + case "MV": { + return MV; + } - default: return false; - } - } - } + case "MW": { + return MW; + } - public interface CheckoutShippingAddressUpdateV2PayloadQueryDefinition { - void define(CheckoutShippingAddressUpdateV2PayloadQuery _queryBuilder); - } + case "MX": { + return MX; + } - /** - * Return type for `checkoutShippingAddressUpdateV2` mutation. - */ - public static class CheckoutShippingAddressUpdateV2PayloadQuery extends Query { - CheckoutShippingAddressUpdateV2PayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "MY": { + return MY; + } - /** - * The updated checkout object. - */ - public CheckoutShippingAddressUpdateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + case "MZ": { + return MZ; + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "NA": { + return NA; + } - return this; - } + case "NC": { + return NC; + } - /** - * The list of errors that occurred from executing the mutation. - */ - public CheckoutShippingAddressUpdateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + case "NE": { + return NE; + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "NF": { + return NF; + } - return this; - } + case "NG": { + return NG; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ - @Deprecated - public CheckoutShippingAddressUpdateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + case "NI": { + return NI; + } - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "NL": { + return NL; + } - return this; - } - } + case "NO": { + return NO; + } - /** - * Return type for `checkoutShippingAddressUpdateV2` mutation. - */ - public static class CheckoutShippingAddressUpdateV2Payload extends AbstractResponse { - public CheckoutShippingAddressUpdateV2Payload() { - } + case "NP": { + return NP; + } - public CheckoutShippingAddressUpdateV2Payload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } + case "NR": { + return NR; + } - responseData.put(key, optional1); - - break; - } + case "NU": { + return NU; + } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } + case "NZ": { + return NZ; + } - responseData.put(key, list1); + case "OM": { + return OM; + } - break; - } + case "PA": { + return PA; + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + case "PE": { + return PE; + } - responseData.put(key, list1); + case "PF": { + return PF; + } - break; - } + case "PG": { + return PG; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "PH": { + return PH; } - } - } - public String getGraphQlTypeName() { - return "CheckoutShippingAddressUpdateV2Payload"; - } + case "PK": { + return PK; + } - /** - * The updated checkout object. - */ + case "PL": { + return PL; + } - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } + case "PM": { + return PM; + } - public CheckoutShippingAddressUpdateV2Payload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; - } + case "PN": { + return PN; + } - /** - * The list of errors that occurred from executing the mutation. - */ + case "PS": { + return PS; + } - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); - } + case "PT": { + return PT; + } - public CheckoutShippingAddressUpdateV2Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } + case "PY": { + return PY; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ + case "QA": { + return QA; + } - public List getUserErrors() { - return (List) get("userErrors"); - } + case "RE": { + return RE; + } - public CheckoutShippingAddressUpdateV2Payload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } + case "RO": { + return RO; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + case "RS": { + return RS; + } - case "checkoutUserErrors": return true; + case "RU": { + return RU; + } - case "userErrors": return true; + case "RW": { + return RW; + } - default: return false; - } - } - } + case "SA": { + return SA; + } - public interface CheckoutShippingLineUpdatePayloadQueryDefinition { - void define(CheckoutShippingLineUpdatePayloadQuery _queryBuilder); - } + case "SB": { + return SB; + } - /** - * Return type for `checkoutShippingLineUpdate` mutation. - */ - public static class CheckoutShippingLineUpdatePayloadQuery extends Query { - CheckoutShippingLineUpdatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "SC": { + return SC; + } - /** - * The updated checkout object. - */ - public CheckoutShippingLineUpdatePayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + case "SD": { + return SD; + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "SE": { + return SE; + } - return this; - } + case "SG": { + return SG; + } - /** - * The list of errors that occurred from executing the mutation. - */ - public CheckoutShippingLineUpdatePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + case "SH": { + return SH; + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "SI": { + return SI; + } - return this; - } + case "SJ": { + return SJ; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ - @Deprecated - public CheckoutShippingLineUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + case "SK": { + return SK; + } - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "SL": { + return SL; + } - return this; - } - } + case "SM": { + return SM; + } - /** - * Return type for `checkoutShippingLineUpdate` mutation. - */ - public static class CheckoutShippingLineUpdatePayload extends AbstractResponse { - public CheckoutShippingLineUpdatePayload() { - } + case "SN": { + return SN; + } - public CheckoutShippingLineUpdatePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } + case "SO": { + return SO; + } - responseData.put(key, optional1); + case "SR": { + return SR; + } - break; - } + case "SS": { + return SS; + } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } + case "ST": { + return ST; + } - responseData.put(key, list1); + case "SV": { + return SV; + } - break; - } + case "SX": { + return SX; + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + case "SY": { + return SY; + } - responseData.put(key, list1); + case "SZ": { + return SZ; + } - break; - } + case "TA": { + return TA; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "TC": { + return TC; } - } - } - public String getGraphQlTypeName() { - return "CheckoutShippingLineUpdatePayload"; - } + case "TD": { + return TD; + } - /** - * The updated checkout object. - */ + case "TF": { + return TF; + } - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } + case "TG": { + return TG; + } - public CheckoutShippingLineUpdatePayload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; - } + case "TH": { + return TH; + } - /** - * The list of errors that occurred from executing the mutation. - */ + case "TJ": { + return TJ; + } - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); - } + case "TK": { + return TK; + } - public CheckoutShippingLineUpdatePayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } + case "TL": { + return TL; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ + case "TM": { + return TM; + } - public List getUserErrors() { - return (List) get("userErrors"); - } + case "TN": { + return TN; + } - public CheckoutShippingLineUpdatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } + case "TO": { + return TO; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + case "TR": { + return TR; + } - case "checkoutUserErrors": return true; + case "TT": { + return TT; + } - case "userErrors": return true; + case "TV": { + return TV; + } - default: return false; - } - } - } + case "TW": { + return TW; + } - public interface CheckoutUserErrorQueryDefinition { - void define(CheckoutUserErrorQuery _queryBuilder); - } + case "TZ": { + return TZ; + } - /** - * Represents an error that happens during execution of a checkout mutation. - */ - public static class CheckoutUserErrorQuery extends Query { - CheckoutUserErrorQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "UA": { + return UA; + } - /** - * The error code. - */ - public CheckoutUserErrorQuery code() { - startField("code"); + case "UG": { + return UG; + } - return this; - } + case "UM": { + return UM; + } - /** - * The path to the input field that caused the error. - */ - public CheckoutUserErrorQuery field() { - startField("field"); + case "US": { + return US; + } - return this; - } + case "UY": { + return UY; + } - /** - * The error message. - */ - public CheckoutUserErrorQuery message() { - startField("message"); + case "UZ": { + return UZ; + } - return this; - } - } + case "VA": { + return VA; + } - /** - * Represents an error that happens during execution of a checkout mutation. - */ - public static class CheckoutUserError extends AbstractResponse implements DisplayableError { - public CheckoutUserError() { - } + case "VC": { + return VC; + } - public CheckoutUserError(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "code": { - CheckoutErrorCode optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = CheckoutErrorCode.fromGraphQl(jsonAsString(field.getValue(), key)); - } + case "VE": { + return VE; + } - responseData.put(key, optional1); + case "VG": { + return VG; + } - break; - } + case "VN": { + return VN; + } - case "field": { - List optional1 = null; - if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } + case "VU": { + return VU; + } - optional1 = list1; - } + case "WF": { + return WF; + } - responseData.put(key, optional1); + case "WS": { + return WS; + } - break; - } + case "XK": { + return XK; + } - case "message": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "YE": { + return YE; + } - break; - } + case "YT": { + return YT; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "ZA": { + return ZA; } - } - } - public String getGraphQlTypeName() { - return "CheckoutUserError"; - } + case "ZM": { + return ZM; + } - /** - * The error code. - */ + case "ZW": { + return ZW; + } - public CheckoutErrorCode getCode() { - return (CheckoutErrorCode) get("code"); - } + case "ZZ": { + return ZZ; + } - public CheckoutUserError setCode(CheckoutErrorCode arg) { - optimisticData.put(getKey("code"), arg); - return this; + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case AC: { + return "AC"; + } - /** - * The path to the input field that caused the error. - */ + case AD: { + return "AD"; + } - public List getField() { - return (List) get("field"); - } + case AE: { + return "AE"; + } - public CheckoutUserError setField(List arg) { - optimisticData.put(getKey("field"), arg); - return this; - } + case AF: { + return "AF"; + } - /** - * The error message. - */ + case AG: { + return "AG"; + } - public String getMessage() { - return (String) get("message"); - } + case AI: { + return "AI"; + } - public CheckoutUserError setMessage(String arg) { - optimisticData.put(getKey("message"), arg); - return this; - } + case AL: { + return "AL"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "code": return false; + case AM: { + return "AM"; + } - case "field": return false; + case AN: { + return "AN"; + } - case "message": return false; - - default: return false; - } - } - } + case AO: { + return "AO"; + } - public interface CollectionQueryDefinition { - void define(CollectionQuery _queryBuilder); - } + case AR: { + return "AR"; + } - /** - * A collection represents a grouping of products that a shop owner can create to - * organize them or make their shops easier to browse. - */ - public static class CollectionQuery extends Query { - CollectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + case AT: { + return "AT"; + } - startField("id"); - } + case AU: { + return "AU"; + } - public class DescriptionArguments extends Arguments { - DescriptionArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + case AW: { + return "AW"; + } - /** - * Truncates string after the given length. - */ - public DescriptionArguments truncateAt(Integer value) { - if (value != null) { - startArgument("truncateAt"); - _queryBuilder.append(value); + case AX: { + return "AX"; } - return this; - } - } - public interface DescriptionArgumentsDefinition { - void define(DescriptionArguments args); - } + case AZ: { + return "AZ"; + } - /** - * Stripped description of the collection, single line with HTML tags removed. - */ - public CollectionQuery description() { - return description(args -> {}); - } + case BA: { + return "BA"; + } - /** - * Stripped description of the collection, single line with HTML tags removed. - */ - public CollectionQuery description(DescriptionArgumentsDefinition argsDef) { - startField("description"); + case BB: { + return "BB"; + } - DescriptionArguments args = new DescriptionArguments(_queryBuilder); - argsDef.define(args); - DescriptionArguments.end(args); + case BD: { + return "BD"; + } - return this; - } + case BE: { + return "BE"; + } - /** - * The description of the collection, complete with HTML formatting. - */ - public CollectionQuery descriptionHtml() { - startField("descriptionHtml"); + case BF: { + return "BF"; + } - return this; - } + case BG: { + return "BG"; + } - /** - * A human-friendly unique string for the collection automatically generated from its title. - * Limit of 255 characters. - */ - public CollectionQuery handle() { - startField("handle"); + case BH: { + return "BH"; + } - return this; - } + case BI: { + return "BI"; + } - /** - * Image associated with the collection. - */ - public CollectionQuery image(ImageQueryDefinition queryDef) { - startField("image"); + case BJ: { + return "BJ"; + } - _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); - _queryBuilder.append('}'); + case BL: { + return "BL"; + } - return this; - } + case BM: { + return "BM"; + } - public class MetafieldArguments extends Arguments { - MetafieldArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } + case BN: { + return "BN"; + } - /** - * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. - */ - public MetafieldArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case BO: { + return "BO"; } - return this; - } - } - public interface MetafieldArgumentsDefinition { - void define(MetafieldArguments args); - } + case BQ: { + return "BQ"; + } - /** - * Returns a metafield found by namespace and key. - */ - public CollectionQuery metafield(String key, MetafieldQueryDefinition queryDef) { - return metafield(key, args -> {}, queryDef); - } + case BR: { + return "BR"; + } - /** - * Returns a metafield found by namespace and key. - */ - public CollectionQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { - startField("metafield"); + case BS: { + return "BS"; + } - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + case BT: { + return "BT"; + } - argsDef.define(new MetafieldArguments(_queryBuilder)); + case BV: { + return "BV"; + } - _queryBuilder.append(')'); + case BW: { + return "BW"; + } - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + case BY: { + return "BY"; + } - return this; - } + case BZ: { + return "BZ"; + } - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ - public CollectionQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); + case CA: { + return "CA"; + } - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); + case CC: { + return "CC"; } - } - _queryBuilder.append(']'); - _queryBuilder.append(')'); + case CD: { + return "CD"; + } - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + case CF: { + return "CF"; + } - return this; - } + case CG: { + return "CG"; + } - /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. - */ - public CollectionQuery onlineStoreUrl() { - startField("onlineStoreUrl"); + case CH: { + return "CH"; + } - return this; - } + case CI: { + return "CI"; + } - public class ProductsArguments extends Arguments { - ProductsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + case CK: { + return "CK"; + } - /** - * Returns up to the first `n` elements from the list. - */ - public ProductsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); + case CL: { + return "CL"; } - return this; - } - /** - * Returns the elements that come after the specified cursor. - */ - public ProductsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case CM: { + return "CM"; } - return this; - } - /** - * Returns up to the last `n` elements from the list. - */ - public ProductsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); + case CN: { + return "CN"; } - return this; - } - /** - * Returns the elements that come before the specified cursor. - */ - public ProductsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case CO: { + return "CO"; } - return this; - } - /** - * Reverse the order of the underlying list. - */ - public ProductsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); + case CR: { + return "CR"; } - return this; - } - /** - * Sort the underlying list by the given key. - */ - public ProductsArguments sortKey(ProductCollectionSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); + case CU: { + return "CU"; } - return this; - } - /** - * Returns a subset of products matching all product filters. - * The input must not contain more than `250` values. - */ - public ProductsArguments filters(List value) { - if (value != null) { - startArgument("filters"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (ProductFilter item1 : value) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); + case CV: { + return "CV"; } - return this; - } - } - public interface ProductsArgumentsDefinition { - void define(ProductsArguments args); - } + case CW: { + return "CW"; + } - /** - * List of products in the collection. - */ - public CollectionQuery products(ProductConnectionQueryDefinition queryDef) { - return products(args -> {}, queryDef); - } + case CX: { + return "CX"; + } - /** - * List of products in the collection. - */ - public CollectionQuery products(ProductsArgumentsDefinition argsDef, ProductConnectionQueryDefinition queryDef) { - startField("products"); + case CY: { + return "CY"; + } - ProductsArguments args = new ProductsArguments(_queryBuilder); - argsDef.define(args); - ProductsArguments.end(args); + case CZ: { + return "CZ"; + } - _queryBuilder.append('{'); - queryDef.define(new ProductConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + case DE: { + return "DE"; + } - return this; - } + case DJ: { + return "DJ"; + } - /** - * The collection's SEO information. - */ - public CollectionQuery seo(SEOQueryDefinition queryDef) { - startField("seo"); + case DK: { + return "DK"; + } - _queryBuilder.append('{'); - queryDef.define(new SEOQuery(_queryBuilder)); - _queryBuilder.append('}'); + case DM: { + return "DM"; + } - return this; - } + case DO: { + return "DO"; + } - /** - * The collection’s name. Limit of 255 characters. - */ - public CollectionQuery title() { - startField("title"); + case DZ: { + return "DZ"; + } - return this; - } + case EC: { + return "EC"; + } - /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. - */ - public CollectionQuery trackingParameters() { - startField("trackingParameters"); + case EE: { + return "EE"; + } - return this; - } + case EG: { + return "EG"; + } - /** - * The date and time when the collection was last modified. - */ - public CollectionQuery updatedAt() { - startField("updatedAt"); + case EH: { + return "EH"; + } - return this; - } - } + case ER: { + return "ER"; + } - /** - * A collection represents a grouping of products that a shop owner can create to - * organize them or make their shops easier to browse. - */ - public static class Collection extends AbstractResponse implements HasMetafields, MenuItemResource, MetafieldParentResource, MetafieldReference, Node, OnlineStorePublishable, Trackable { - public Collection() { - } + case ES: { + return "ES"; + } - public Collection(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "description": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case ET: { + return "ET"; + } - break; - } + case FI: { + return "FI"; + } - case "descriptionHtml": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case FJ: { + return "FJ"; + } - break; - } + case FK: { + return "FK"; + } - case "handle": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case FO: { + return "FO"; + } - break; - } + case FR: { + return "FR"; + } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case GA: { + return "GA"; + } - break; - } + case GB: { + return "GB"; + } - case "image": { - Image optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); - } + case GD: { + return "GD"; + } - responseData.put(key, optional1); + case GE: { + return "GE"; + } - break; - } + case GF: { + return "GF"; + } - case "metafield": { - Metafield optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); - } + case GG: { + return "GG"; + } - responseData.put(key, optional1); + case GH: { + return "GH"; + } - break; - } + case GI: { + return "GI"; + } - case "metafields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } + case GL: { + return "GL"; + } - list1.add(optional2); - } + case GM: { + return "GM"; + } - responseData.put(key, list1); + case GN: { + return "GN"; + } - break; - } + case GP: { + return "GP"; + } - case "onlineStoreUrl": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case GQ: { + return "GQ"; + } - responseData.put(key, optional1); + case GR: { + return "GR"; + } - break; - } + case GS: { + return "GS"; + } - case "products": { - responseData.put(key, new ProductConnection(jsonAsObject(field.getValue(), key))); + case GT: { + return "GT"; + } - break; - } + case GW: { + return "GW"; + } - case "seo": { - responseData.put(key, new SEO(jsonAsObject(field.getValue(), key))); + case GY: { + return "GY"; + } - break; - } + case HK: { + return "HK"; + } - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case HM: { + return "HM"; + } - break; - } + case HN: { + return "HN"; + } - case "trackingParameters": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case HR: { + return "HR"; + } - responseData.put(key, optional1); + case HT: { + return "HT"; + } - break; - } + case HU: { + return "HU"; + } - case "updatedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + case ID: { + return "ID"; + } - break; - } + case IE: { + return "IE"; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case IL: { + return "IL"; } - } - } - public Collection(ID id) { - this(); - optimisticData.put("id", id); - } + case IM: { + return "IM"; + } - public String getGraphQlTypeName() { - return "Collection"; - } + case IN: { + return "IN"; + } - /** - * Stripped description of the collection, single line with HTML tags removed. - */ + case IO: { + return "IO"; + } - public String getDescription() { - return (String) get("description"); - } + case IQ: { + return "IQ"; + } - public Collection setDescription(String arg) { - optimisticData.put(getKey("description"), arg); - return this; - } + case IR: { + return "IR"; + } - /** - * The description of the collection, complete with HTML formatting. - */ + case IS: { + return "IS"; + } - public String getDescriptionHtml() { - return (String) get("descriptionHtml"); - } + case IT: { + return "IT"; + } - public Collection setDescriptionHtml(String arg) { - optimisticData.put(getKey("descriptionHtml"), arg); - return this; - } + case JE: { + return "JE"; + } - /** - * A human-friendly unique string for the collection automatically generated from its title. - * Limit of 255 characters. - */ + case JM: { + return "JM"; + } - public String getHandle() { - return (String) get("handle"); - } + case JO: { + return "JO"; + } - public Collection setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); - return this; - } + case JP: { + return "JP"; + } - /** - * A globally-unique ID. - */ + case KE: { + return "KE"; + } - public ID getId() { - return (ID) get("id"); - } + case KG: { + return "KG"; + } - /** - * Image associated with the collection. - */ + case KH: { + return "KH"; + } - public Image getImage() { - return (Image) get("image"); - } + case KI: { + return "KI"; + } - public Collection setImage(Image arg) { - optimisticData.put(getKey("image"), arg); - return this; - } + case KM: { + return "KM"; + } - /** - * Returns a metafield found by namespace and key. - */ + case KN: { + return "KN"; + } - public Metafield getMetafield() { - return (Metafield) get("metafield"); - } + case KP: { + return "KP"; + } - public Collection setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); - return this; - } + case KR: { + return "KR"; + } - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ + case KW: { + return "KW"; + } - public List getMetafields() { - return (List) get("metafields"); - } + case KY: { + return "KY"; + } - public Collection setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); - return this; - } + case KZ: { + return "KZ"; + } - /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. - */ + case LA: { + return "LA"; + } - public String getOnlineStoreUrl() { - return (String) get("onlineStoreUrl"); - } + case LB: { + return "LB"; + } - public Collection setOnlineStoreUrl(String arg) { - optimisticData.put(getKey("onlineStoreUrl"), arg); - return this; - } + case LC: { + return "LC"; + } - /** - * List of products in the collection. - */ + case LI: { + return "LI"; + } - public ProductConnection getProducts() { - return (ProductConnection) get("products"); - } + case LK: { + return "LK"; + } - public Collection setProducts(ProductConnection arg) { - optimisticData.put(getKey("products"), arg); - return this; - } + case LR: { + return "LR"; + } - /** - * The collection's SEO information. - */ + case LS: { + return "LS"; + } - public SEO getSeo() { - return (SEO) get("seo"); - } + case LT: { + return "LT"; + } - public Collection setSeo(SEO arg) { - optimisticData.put(getKey("seo"), arg); - return this; - } + case LU: { + return "LU"; + } - /** - * The collection’s name. Limit of 255 characters. - */ + case LV: { + return "LV"; + } - public String getTitle() { - return (String) get("title"); - } + case LY: { + return "LY"; + } - public Collection setTitle(String arg) { - optimisticData.put(getKey("title"), arg); - return this; - } + case MA: { + return "MA"; + } - /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. - */ + case MC: { + return "MC"; + } - public String getTrackingParameters() { - return (String) get("trackingParameters"); - } + case MD: { + return "MD"; + } - public Collection setTrackingParameters(String arg) { - optimisticData.put(getKey("trackingParameters"), arg); - return this; - } + case ME: { + return "ME"; + } - /** - * The date and time when the collection was last modified. - */ + case MF: { + return "MF"; + } - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); - } + case MG: { + return "MG"; + } - public Collection setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); - return this; - } + case MK: { + return "MK"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "description": return false; + case ML: { + return "ML"; + } - case "descriptionHtml": return false; + case MM: { + return "MM"; + } - case "handle": return false; + case MN: { + return "MN"; + } - case "id": return false; + case MO: { + return "MO"; + } - case "image": return true; + case MQ: { + return "MQ"; + } - case "metafield": return true; + case MR: { + return "MR"; + } - case "metafields": return true; + case MS: { + return "MS"; + } - case "onlineStoreUrl": return false; + case MT: { + return "MT"; + } - case "products": return true; + case MU: { + return "MU"; + } - case "seo": return true; + case MV: { + return "MV"; + } - case "title": return false; + case MW: { + return "MW"; + } - case "trackingParameters": return false; + case MX: { + return "MX"; + } - case "updatedAt": return false; + case MY: { + return "MY"; + } - default: return false; - } - } - } + case MZ: { + return "MZ"; + } - public interface CollectionConnectionQueryDefinition { - void define(CollectionConnectionQuery _queryBuilder); - } + case NA: { + return "NA"; + } - /** - * An auto-generated type for paginating through multiple Collections. - */ - public static class CollectionConnectionQuery extends Query { - CollectionConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case NC: { + return "NC"; + } - /** - * A list of edges. - */ - public CollectionConnectionQuery edges(CollectionEdgeQueryDefinition queryDef) { - startField("edges"); + case NE: { + return "NE"; + } - _queryBuilder.append('{'); - queryDef.define(new CollectionEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); + case NF: { + return "NF"; + } - return this; - } + case NG: { + return "NG"; + } - /** - * A list of the nodes contained in CollectionEdge. - */ - public CollectionConnectionQuery nodes(CollectionQueryDefinition queryDef) { - startField("nodes"); + case NI: { + return "NI"; + } - _queryBuilder.append('{'); - queryDef.define(new CollectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + case NL: { + return "NL"; + } - return this; - } + case NO: { + return "NO"; + } - /** - * Information to aid in pagination. - */ - public CollectionConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + case NP: { + return "NP"; + } - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + case NR: { + return "NR"; + } - return this; - } + case NU: { + return "NU"; + } - /** - * The total count of Collections. - */ - public CollectionConnectionQuery totalCount() { - startField("totalCount"); + case NZ: { + return "NZ"; + } - return this; - } - } + case OM: { + return "OM"; + } - /** - * An auto-generated type for paginating through multiple Collections. - */ - public static class CollectionConnection extends AbstractResponse { - public CollectionConnection() { - } + case PA: { + return "PA"; + } - public CollectionConnection(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CollectionEdge(jsonAsObject(element1, key))); - } + case PE: { + return "PE"; + } - responseData.put(key, list1); + case PF: { + return "PF"; + } - break; - } + case PG: { + return "PG"; + } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Collection(jsonAsObject(element1, key))); - } + case PH: { + return "PH"; + } - responseData.put(key, list1); + case PK: { + return "PK"; + } - break; - } + case PL: { + return "PL"; + } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case PM: { + return "PM"; + } - break; - } + case PN: { + return "PN"; + } - case "totalCount": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case PS: { + return "PS"; + } - break; - } + case PT: { + return "PT"; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case PY: { + return "PY"; } - } - } - public String getGraphQlTypeName() { - return "CollectionConnection"; - } + case QA: { + return "QA"; + } - /** - * A list of edges. - */ + case RE: { + return "RE"; + } - public List getEdges() { - return (List) get("edges"); - } + case RO: { + return "RO"; + } - public CollectionConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; - } + case RS: { + return "RS"; + } - /** - * A list of the nodes contained in CollectionEdge. - */ + case RU: { + return "RU"; + } - public List getNodes() { - return (List) get("nodes"); - } + case RW: { + return "RW"; + } - public CollectionConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; - } + case SA: { + return "SA"; + } - /** - * Information to aid in pagination. - */ + case SB: { + return "SB"; + } - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } + case SC: { + return "SC"; + } - public CollectionConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); - return this; - } + case SD: { + return "SD"; + } - /** - * The total count of Collections. - */ + case SE: { + return "SE"; + } - public String getTotalCount() { - return (String) get("totalCount"); - } + case SG: { + return "SG"; + } - public CollectionConnection setTotalCount(String arg) { - optimisticData.put(getKey("totalCount"), arg); - return this; - } + case SH: { + return "SH"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; + case SI: { + return "SI"; + } - case "nodes": return true; + case SJ: { + return "SJ"; + } - case "pageInfo": return true; + case SK: { + return "SK"; + } - case "totalCount": return false; + case SL: { + return "SL"; + } - default: return false; - } - } - } + case SM: { + return "SM"; + } - public interface CollectionEdgeQueryDefinition { - void define(CollectionEdgeQuery _queryBuilder); - } + case SN: { + return "SN"; + } - /** - * An auto-generated type which holds one Collection and a cursor during pagination. - */ - public static class CollectionEdgeQuery extends Query { - CollectionEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case SO: { + return "SO"; + } - /** - * A cursor for use in pagination. - */ - public CollectionEdgeQuery cursor() { - startField("cursor"); + case SR: { + return "SR"; + } - return this; - } + case SS: { + return "SS"; + } - /** - * The item at the end of CollectionEdge. - */ - public CollectionEdgeQuery node(CollectionQueryDefinition queryDef) { - startField("node"); + case ST: { + return "ST"; + } - _queryBuilder.append('{'); - queryDef.define(new CollectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + case SV: { + return "SV"; + } - return this; - } - } + case SX: { + return "SX"; + } - /** - * An auto-generated type which holds one Collection and a cursor during pagination. - */ - public static class CollectionEdge extends AbstractResponse { - public CollectionEdge() { - } + case SY: { + return "SY"; + } - public CollectionEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case SZ: { + return "SZ"; + } - break; - } + case TA: { + return "TA"; + } - case "node": { - responseData.put(key, new Collection(jsonAsObject(field.getValue(), key))); + case TC: { + return "TC"; + } - break; - } + case TD: { + return "TD"; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case TF: { + return "TF"; } - } - } - public String getGraphQlTypeName() { - return "CollectionEdge"; - } + case TG: { + return "TG"; + } - /** - * A cursor for use in pagination. - */ + case TH: { + return "TH"; + } - public String getCursor() { - return (String) get("cursor"); - } + case TJ: { + return "TJ"; + } - public CollectionEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; - } + case TK: { + return "TK"; + } - /** - * The item at the end of CollectionEdge. - */ + case TL: { + return "TL"; + } - public Collection getNode() { - return (Collection) get("node"); - } + case TM: { + return "TM"; + } - public CollectionEdge setNode(Collection arg) { - optimisticData.put(getKey("node"), arg); - return this; - } + case TN: { + return "TN"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; + case TO: { + return "TO"; + } - case "node": return true; + case TR: { + return "TR"; + } - default: return false; + case TT: { + return "TT"; + } + + case TV: { + return "TV"; + } + + case TW: { + return "TW"; + } + + case TZ: { + return "TZ"; + } + + case UA: { + return "UA"; + } + + case UG: { + return "UG"; + } + + case UM: { + return "UM"; + } + + case US: { + return "US"; + } + + case UY: { + return "UY"; + } + + case UZ: { + return "UZ"; + } + + case VA: { + return "VA"; + } + + case VC: { + return "VC"; + } + + case VE: { + return "VE"; + } + + case VG: { + return "VG"; + } + + case VN: { + return "VN"; + } + + case VU: { + return "VU"; + } + + case WF: { + return "WF"; + } + + case WS: { + return "WS"; + } + + case XK: { + return "XK"; + } + + case YE: { + return "YE"; + } + + case YT: { + return "YT"; + } + + case ZA: { + return "ZA"; + } + + case ZM: { + return "ZM"; + } + + case ZW: { + return "ZW"; + } + + case ZZ: { + return "ZZ"; + } + + default: { + return ""; + } } } } /** - * The set of valid sort keys for the Collection query. + * The part of the image that should remain after cropping. */ - public enum CollectionSortKeys { + public enum CropRegion { /** - * Sort by the `id` value. + * Keep the bottom of the image. */ - ID, + BOTTOM, /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. + * Keep the center of the image. */ - RELEVANCE, + CENTER, /** - * Sort by the `title` value. + * Keep the left of the image. */ - TITLE, + LEFT, /** - * Sort by the `updated_at` value. + * Keep the right of the image. */ - UPDATED_AT, + RIGHT, + + /** + * Keep the top of the image. + */ + TOP, UNKNOWN_VALUE; - public static CollectionSortKeys fromGraphQl(String value) { + public static CropRegion fromGraphQl(String value) { if (value == null) { return null; } switch (value) { - case "ID": { - return ID; + case "BOTTOM": { + return BOTTOM; } - case "RELEVANCE": { - return RELEVANCE; + case "CENTER": { + return CENTER; } - case "TITLE": { - return TITLE; + case "LEFT": { + return LEFT; } - case "UPDATED_AT": { - return UPDATED_AT; + case "RIGHT": { + return RIGHT; + } + + case "TOP": { + return TOP; } default: { @@ -21182,20 +21448,24 @@ public static CollectionSortKeys fromGraphQl(String value) { } public String toString() { switch (this) { - case ID: { - return "ID"; + case BOTTOM: { + return "BOTTOM"; } - case RELEVANCE: { - return "RELEVANCE"; + case CENTER: { + return "CENTER"; } - case TITLE: { - return "TITLE"; + case LEFT: { + return "LEFT"; } - case UPDATED_AT: { - return "UPDATED_AT"; + case RIGHT: { + return "RIGHT"; + } + + case TOP: { + return "TOP"; } default: { @@ -21205,120 +21475,76 @@ public String toString() { } } - public interface CommentQueryDefinition { - void define(CommentQuery _queryBuilder); + public interface CurrencyQueryDefinition { + void define(CurrencyQuery _queryBuilder); } /** - * A comment on an article. + * A currency. */ - public static class CommentQuery extends Query { - CommentQuery(StringBuilder _queryBuilder) { + public static class CurrencyQuery extends Query { + CurrencyQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("id"); } /** - * The comment’s author. + * The ISO code of the currency. */ - public CommentQuery author(CommentAuthorQueryDefinition queryDef) { - startField("author"); - - _queryBuilder.append('{'); - queryDef.define(new CommentAuthorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CurrencyQuery isoCode() { + startField("isoCode"); return this; } - public class ContentArguments extends Arguments { - ContentArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Truncates string after the given length. - */ - public ContentArguments truncateAt(Integer value) { - if (value != null) { - startArgument("truncateAt"); - _queryBuilder.append(value); - } - return this; - } - } - - public interface ContentArgumentsDefinition { - void define(ContentArguments args); - } - - /** - * Stripped content of the comment, single line with HTML tags removed. - */ - public CommentQuery content() { - return content(args -> {}); - } - /** - * Stripped content of the comment, single line with HTML tags removed. + * The name of the currency. */ - public CommentQuery content(ContentArgumentsDefinition argsDef) { - startField("content"); - - ContentArguments args = new ContentArguments(_queryBuilder); - argsDef.define(args); - ContentArguments.end(args); + public CurrencyQuery name() { + startField("name"); return this; } /** - * The content of the comment, complete with HTML formatting. + * The symbol of the currency. */ - public CommentQuery contentHtml() { - startField("contentHtml"); + public CurrencyQuery symbol() { + startField("symbol"); return this; } } /** - * A comment on an article. + * A currency. */ - public static class Comment extends AbstractResponse implements Node { - public Comment() { + public static class Currency extends AbstractResponse { + public Currency() { } - public Comment(JsonObject fields) throws SchemaViolationError { + public Currency(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "author": { - responseData.put(key, new CommentAuthor(jsonAsObject(field.getValue(), key))); + case "isoCode": { + responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "content": { + case "name": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "contentHtml": { + case "symbol": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - - break; - } - case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -21330,5729 +21556,5856 @@ public Comment(JsonObject fields) throws SchemaViolationError { } } - public Comment(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "Comment"; + return "Currency"; } /** - * The comment’s author. + * The ISO code of the currency. */ - public CommentAuthor getAuthor() { - return (CommentAuthor) get("author"); + public CurrencyCode getIsoCode() { + return (CurrencyCode) get("isoCode"); } - public Comment setAuthor(CommentAuthor arg) { - optimisticData.put(getKey("author"), arg); + public Currency setIsoCode(CurrencyCode arg) { + optimisticData.put(getKey("isoCode"), arg); return this; } /** - * Stripped content of the comment, single line with HTML tags removed. + * The name of the currency. */ - public String getContent() { - return (String) get("content"); + public String getName() { + return (String) get("name"); } - public Comment setContent(String arg) { - optimisticData.put(getKey("content"), arg); + public Currency setName(String arg) { + optimisticData.put(getKey("name"), arg); return this; } /** - * The content of the comment, complete with HTML formatting. + * The symbol of the currency. */ - public String getContentHtml() { - return (String) get("contentHtml"); + public String getSymbol() { + return (String) get("symbol"); } - public Comment setContentHtml(String arg) { - optimisticData.put(getKey("contentHtml"), arg); + public Currency setSymbol(String arg) { + optimisticData.put(getKey("symbol"), arg); return this; } - /** - * A globally-unique ID. - */ - - public ID getId() { - return (ID) get("id"); - } - public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "author": return true; - - case "content": return false; + case "isoCode": return false; - case "contentHtml": return false; + case "name": return false; - case "id": return false; + case "symbol": return false; default: return false; } } } - public interface CommentAuthorQueryDefinition { - void define(CommentAuthorQuery _queryBuilder); - } - /** - * The author of a comment. + * The three-letter currency codes that represent the world currencies used in + * stores. These include standard ISO 4217 codes, legacy codes, + * and non-standard codes. */ - public static class CommentAuthorQuery extends Query { - CommentAuthorQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + public enum CurrencyCode { + /** + * United Arab Emirates Dirham (AED). + */ + AED, /** - * The author's email. + * Afghan Afghani (AFN). */ - public CommentAuthorQuery email() { - startField("email"); + AFN, - return this; - } + /** + * Albanian Lek (ALL). + */ + ALL, /** - * The author’s name. + * Armenian Dram (AMD). */ - public CommentAuthorQuery name() { - startField("name"); + AMD, - return this; - } - } + /** + * Netherlands Antillean Guilder. + */ + ANG, - /** - * The author of a comment. - */ - public static class CommentAuthor extends AbstractResponse { - public CommentAuthor() { - } + /** + * Angolan Kwanza (AOA). + */ + AOA, - public CommentAuthor(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "email": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Argentine Pesos (ARS). + */ + ARS, - break; - } + /** + * Australian Dollars (AUD). + */ + AUD, - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Aruban Florin (AWG). + */ + AWG, - break; - } + /** + * Azerbaijani Manat (AZN). + */ + AZN, - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + /** + * Bosnia and Herzegovina Convertible Mark (BAM). + */ + BAM, - public String getGraphQlTypeName() { - return "CommentAuthor"; - } + /** + * Barbadian Dollar (BBD). + */ + BBD, /** - * The author's email. + * Bangladesh Taka (BDT). */ + BDT, - public String getEmail() { - return (String) get("email"); - } + /** + * Bulgarian Lev (BGN). + */ + BGN, - public CommentAuthor setEmail(String arg) { - optimisticData.put(getKey("email"), arg); - return this; - } + /** + * Bahraini Dinar (BHD). + */ + BHD, /** - * The author’s name. + * Burundian Franc (BIF). */ + BIF, - public String getName() { - return (String) get("name"); - } + /** + * Bermudian Dollar (BMD). + */ + BMD, - public CommentAuthor setName(String arg) { - optimisticData.put(getKey("name"), arg); - return this; - } + /** + * Brunei Dollar (BND). + */ + BND, - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "email": return false; + /** + * Bolivian Boliviano (BOB). + */ + BOB, - case "name": return false; + /** + * Brazilian Real (BRL). + */ + BRL, - default: return false; - } - } - } + /** + * Bahamian Dollar (BSD). + */ + BSD, - public interface CommentConnectionQueryDefinition { - void define(CommentConnectionQuery _queryBuilder); - } + /** + * Bhutanese Ngultrum (BTN). + */ + BTN, - /** - * An auto-generated type for paginating through multiple Comments. - */ - public static class CommentConnectionQuery extends Query { - CommentConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + /** + * Botswana Pula (BWP). + */ + BWP, /** - * A list of edges. + * Belarusian Ruble (BYN). */ - public CommentConnectionQuery edges(CommentEdgeQueryDefinition queryDef) { - startField("edges"); + BYN, - _queryBuilder.append('{'); - queryDef.define(new CommentEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Belarusian Ruble (BYR). + * + * @deprecated `BYR` is deprecated. Use `BYN` available from version `2021-01` onwards instead. + */ + @Deprecated + BYR, - return this; - } + /** + * Belize Dollar (BZD). + */ + BZD, /** - * A list of the nodes contained in CommentEdge. + * Canadian Dollars (CAD). */ - public CommentConnectionQuery nodes(CommentQueryDefinition queryDef) { - startField("nodes"); + CAD, - _queryBuilder.append('{'); - queryDef.define(new CommentQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Congolese franc (CDF). + */ + CDF, - return this; - } + /** + * Swiss Francs (CHF). + */ + CHF, /** - * Information to aid in pagination. + * Chilean Peso (CLP). */ - public CommentConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + CLP, - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Chinese Yuan Renminbi (CNY). + */ + CNY, - return this; - } - } + /** + * Colombian Peso (COP). + */ + COP, - /** - * An auto-generated type for paginating through multiple Comments. - */ - public static class CommentConnection extends AbstractResponse { - public CommentConnection() { - } + /** + * Costa Rican Colones (CRC). + */ + CRC, - public CommentConnection(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CommentEdge(jsonAsObject(element1, key))); - } + /** + * Cape Verdean escudo (CVE). + */ + CVE, - responseData.put(key, list1); + /** + * Czech Koruny (CZK). + */ + CZK, - break; - } + /** + * Djiboutian Franc (DJF). + */ + DJF, - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Comment(jsonAsObject(element1, key))); - } + /** + * Danish Kroner (DKK). + */ + DKK, - responseData.put(key, list1); + /** + * Dominican Peso (DOP). + */ + DOP, - break; - } + /** + * Algerian Dinar (DZD). + */ + DZD, - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + /** + * Egyptian Pound (EGP). + */ + EGP, - break; - } + /** + * Eritrean Nakfa (ERN). + */ + ERN, - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + /** + * Ethiopian Birr (ETB). + */ + ETB, - public String getGraphQlTypeName() { - return "CommentConnection"; - } + /** + * Euro (EUR). + */ + EUR, /** - * A list of edges. + * Fijian Dollars (FJD). */ + FJD, - public List getEdges() { - return (List) get("edges"); - } + /** + * Falkland Islands Pounds (FKP). + */ + FKP, - public CommentConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; - } + /** + * United Kingdom Pounds (GBP). + */ + GBP, /** - * A list of the nodes contained in CommentEdge. + * Georgian Lari (GEL). */ + GEL, - public List getNodes() { - return (List) get("nodes"); - } + /** + * Ghanaian Cedi (GHS). + */ + GHS, - public CommentConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; - } + /** + * Gibraltar Pounds (GIP). + */ + GIP, /** - * Information to aid in pagination. + * Gambian Dalasi (GMD). */ + GMD, - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } + /** + * Guinean Franc (GNF). + */ + GNF, - public CommentConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); - return this; - } + /** + * Guatemalan Quetzal (GTQ). + */ + GTQ, - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; + /** + * Guyanese Dollar (GYD). + */ + GYD, - case "nodes": return true; + /** + * Hong Kong Dollars (HKD). + */ + HKD, - case "pageInfo": return true; + /** + * Honduran Lempira (HNL). + */ + HNL, - default: return false; - } - } - } + /** + * Croatian Kuna (HRK). + */ + HRK, - public interface CommentEdgeQueryDefinition { - void define(CommentEdgeQuery _queryBuilder); - } + /** + * Haitian Gourde (HTG). + */ + HTG, - /** - * An auto-generated type which holds one Comment and a cursor during pagination. - */ - public static class CommentEdgeQuery extends Query { - CommentEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + /** + * Hungarian Forint (HUF). + */ + HUF, /** - * A cursor for use in pagination. + * Indonesian Rupiah (IDR). */ - public CommentEdgeQuery cursor() { - startField("cursor"); + IDR, - return this; - } + /** + * Israeli New Shekel (NIS). + */ + ILS, /** - * The item at the end of CommentEdge. + * Indian Rupees (INR). */ - public CommentEdgeQuery node(CommentQueryDefinition queryDef) { - startField("node"); + INR, - _queryBuilder.append('{'); - queryDef.define(new CommentQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Iraqi Dinar (IQD). + */ + IQD, - return this; - } - } + /** + * Iranian Rial (IRR). + */ + IRR, - /** - * An auto-generated type which holds one Comment and a cursor during pagination. - */ - public static class CommentEdge extends AbstractResponse { - public CommentEdge() { - } + /** + * Icelandic Kronur (ISK). + */ + ISK, - public CommentEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Jersey Pound. + */ + JEP, - break; - } + /** + * Jamaican Dollars (JMD). + */ + JMD, - case "node": { - responseData.put(key, new Comment(jsonAsObject(field.getValue(), key))); + /** + * Jordanian Dinar (JOD). + */ + JOD, - break; - } + /** + * Japanese Yen (JPY). + */ + JPY, - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + /** + * Kenyan Shilling (KES). + */ + KES, - public String getGraphQlTypeName() { - return "CommentEdge"; - } + /** + * Kyrgyzstani Som (KGS). + */ + KGS, /** - * A cursor for use in pagination. + * Cambodian Riel. */ + KHR, - public String getCursor() { - return (String) get("cursor"); - } + /** + * Kiribati Dollar (KID). + */ + KID, - public CommentEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; - } + /** + * Comorian Franc (KMF). + */ + KMF, /** - * The item at the end of CommentEdge. + * South Korean Won (KRW). */ + KRW, - public Comment getNode() { - return (Comment) get("node"); - } + /** + * Kuwaiti Dinar (KWD). + */ + KWD, - public CommentEdge setNode(Comment arg) { - optimisticData.put(getKey("node"), arg); - return this; - } + /** + * Cayman Dollars (KYD). + */ + KYD, - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; + /** + * Kazakhstani Tenge (KZT). + */ + KZT, - case "node": return true; + /** + * Laotian Kip (LAK). + */ + LAK, - default: return false; - } - } - } + /** + * Lebanese Pounds (LBP). + */ + LBP, - public interface CompanyQueryDefinition { - void define(CompanyQuery _queryBuilder); - } + /** + * Sri Lankan Rupees (LKR). + */ + LKR, - /** - * Represents information about a company which is also a customer of the shop. - */ - public static class CompanyQuery extends Query { - CompanyQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + /** + * Liberian Dollar (LRD). + */ + LRD, - startField("id"); - } + /** + * Lesotho Loti (LSL). + */ + LSL, /** - * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company - * was created in Shopify. + * Lithuanian Litai (LTL). */ - public CompanyQuery createdAt() { - startField("createdAt"); + LTL, - return this; - } + /** + * Latvian Lati (LVL). + */ + LVL, /** - * A unique externally-supplied ID for the company. + * Libyan Dinar (LYD). */ - public CompanyQuery externalId() { - startField("externalId"); + LYD, - return this; - } + /** + * Moroccan Dirham. + */ + MAD, - public class MetafieldArguments extends Arguments { - MetafieldArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } + /** + * Moldovan Leu (MDL). + */ + MDL, - /** - * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. - */ - public MetafieldArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - } + /** + * Malagasy Ariary (MGA). + */ + MGA, - public interface MetafieldArgumentsDefinition { - void define(MetafieldArguments args); - } + /** + * Macedonia Denar (MKD). + */ + MKD, /** - * Returns a metafield found by namespace and key. + * Burmese Kyat (MMK). */ - public CompanyQuery metafield(String key, MetafieldQueryDefinition queryDef) { - return metafield(key, args -> {}, queryDef); - } + MMK, /** - * Returns a metafield found by namespace and key. + * Mongolian Tugrik. */ - public CompanyQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { - startField("metafield"); + MNT, - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + /** + * Macanese Pataca (MOP). + */ + MOP, - argsDef.define(new MetafieldArguments(_queryBuilder)); + /** + * Mauritanian Ouguiya (MRU). + */ + MRU, - _queryBuilder.append(')'); + /** + * Mauritian Rupee (MUR). + */ + MUR, - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Maldivian Rufiyaa (MVR). + */ + MVR, - return this; - } + /** + * Malawian Kwacha (MWK). + */ + MWK, /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * Mexican Pesos (MXN). */ - public CompanyQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); + MXN, - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); + /** + * Malaysian Ringgits (MYR). + */ + MYR, - _queryBuilder.append(')'); + /** + * Mozambican Metical. + */ + MZN, - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Namibian Dollar. + */ + NAD, - return this; - } + /** + * Nigerian Naira (NGN). + */ + NGN, /** - * The name of the company. + * Nicaraguan Córdoba (NIO). */ - public CompanyQuery name() { - startField("name"); + NIO, - return this; - } + /** + * Norwegian Kroner (NOK). + */ + NOK, /** - * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company - * was last modified. + * Nepalese Rupee (NPR). */ - public CompanyQuery updatedAt() { - startField("updatedAt"); + NPR, - return this; - } - } + /** + * New Zealand Dollars (NZD). + */ + NZD, - /** - * Represents information about a company which is also a customer of the shop. - */ - public static class Company extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { - public Company() { - } + /** + * Omani Rial (OMR). + */ + OMR, - public Company(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "createdAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + /** + * Panamian Balboa (PAB). + */ + PAB, - break; - } + /** + * Peruvian Nuevo Sol (PEN). + */ + PEN, - case "externalId": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + /** + * Papua New Guinean Kina (PGK). + */ + PGK, - responseData.put(key, optional1); + /** + * Philippine Peso (PHP). + */ + PHP, - break; - } + /** + * Pakistani Rupee (PKR). + */ + PKR, - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + /** + * Polish Zlotych (PLN). + */ + PLN, - break; - } + /** + * Paraguayan Guarani (PYG). + */ + PYG, - case "metafield": { - Metafield optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); - } + /** + * Qatari Rial (QAR). + */ + QAR, - responseData.put(key, optional1); + /** + * Romanian Lei (RON). + */ + RON, - break; - } + /** + * Serbian dinar (RSD). + */ + RSD, - case "metafields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } + /** + * Russian Rubles (RUB). + */ + RUB, - list1.add(optional2); - } + /** + * Rwandan Franc (RWF). + */ + RWF, - responseData.put(key, list1); + /** + * Saudi Riyal (SAR). + */ + SAR, - break; - } + /** + * Solomon Islands Dollar (SBD). + */ + SBD, - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Seychellois Rupee (SCR). + */ + SCR, - break; - } + /** + * Sudanese Pound (SDG). + */ + SDG, - case "updatedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + /** + * Swedish Kronor (SEK). + */ + SEK, - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public Company(ID id) { - this(); - optimisticData.put("id", id); - } - - public String getGraphQlTypeName() { - return "Company"; - } + /** + * Singapore Dollars (SGD). + */ + SGD, /** - * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company - * was created in Shopify. + * Saint Helena Pounds (SHP). */ + SHP, - public DateTime getCreatedAt() { - return (DateTime) get("createdAt"); - } - - public Company setCreatedAt(DateTime arg) { - optimisticData.put(getKey("createdAt"), arg); - return this; - } + /** + * Sierra Leonean Leone (SLL). + */ + SLL, /** - * A unique externally-supplied ID for the company. + * Somali Shilling (SOS). */ + SOS, - public String getExternalId() { - return (String) get("externalId"); - } + /** + * Surinamese Dollar (SRD). + */ + SRD, - public Company setExternalId(String arg) { - optimisticData.put(getKey("externalId"), arg); - return this; - } + /** + * South Sudanese Pound (SSP). + */ + SSP, /** - * A globally-unique ID. + * Sao Tome And Principe Dobra (STD). + * + * @deprecated `STD` is deprecated. Use `STN` available from version `2022-07` onwards instead. */ + @Deprecated + STD, - public ID getId() { - return (ID) get("id"); - } + /** + * Sao Tome And Principe Dobra (STN). + */ + STN, /** - * Returns a metafield found by namespace and key. + * Syrian Pound (SYP). */ + SYP, - public Metafield getMetafield() { - return (Metafield) get("metafield"); - } + /** + * Swazi Lilangeni (SZL). + */ + SZL, - public Company setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); - return this; - } + /** + * Thai baht (THB). + */ + THB, /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * Tajikistani Somoni (TJS). */ + TJS, - public List getMetafields() { - return (List) get("metafields"); - } + /** + * Turkmenistani Manat (TMT). + */ + TMT, - public Company setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); - return this; - } + /** + * Tunisian Dinar (TND). + */ + TND, /** - * The name of the company. + * Tongan Pa'anga (TOP). */ + TOP, - public String getName() { - return (String) get("name"); - } + /** + * Turkish Lira (TRY). + */ + TRY, - public Company setName(String arg) { - optimisticData.put(getKey("name"), arg); - return this; - } + /** + * Trinidad and Tobago Dollars (TTD). + */ + TTD, /** - * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company - * was last modified. + * Taiwan Dollars (TWD). */ + TWD, - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); - } + /** + * Tanzanian Shilling (TZS). + */ + TZS, - public Company setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); - return this; - } + /** + * Ukrainian Hryvnia (UAH). + */ + UAH, - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "createdAt": return false; + /** + * Ugandan Shilling (UGX). + */ + UGX, - case "externalId": return false; + /** + * United States Dollars (USD). + */ + USD, - case "id": return false; + /** + * Uruguayan Pesos (UYU). + */ + UYU, - case "metafield": return true; + /** + * Uzbekistan som (UZS). + */ + UZS, - case "metafields": return true; + /** + * Venezuelan Bolivares (VED). + */ + VED, - case "name": return false; + /** + * Venezuelan Bolivares (VEF). + * + * @deprecated `VEF` is deprecated. Use `VES` available from version `2020-10` onwards instead. + */ + @Deprecated + VEF, - case "updatedAt": return false; + /** + * Venezuelan Bolivares Soberanos (VES). + */ + VES, - default: return false; - } - } - } + /** + * Vietnamese đồng (VND). + */ + VND, - public interface CompanyContactQueryDefinition { - void define(CompanyContactQuery _queryBuilder); - } + /** + * Vanuatu Vatu (VUV). + */ + VUV, - /** - * A company's main point of contact. - */ - public static class CompanyContactQuery extends Query { - CompanyContactQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + /** + * Samoan Tala (WST). + */ + WST, - startField("id"); - } + /** + * Central African CFA Franc (XAF). + */ + XAF, /** - * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company - * contact was created in Shopify. + * East Caribbean Dollar (XCD). */ - public CompanyContactQuery createdAt() { - startField("createdAt"); + XCD, - return this; - } + /** + * West African CFA franc (XOF). + */ + XOF, /** - * The company contact's locale (language). + * CFP Franc (XPF). */ - public CompanyContactQuery locale() { - startField("locale"); + XPF, - return this; - } + /** + * Unrecognized currency. + */ + XXX, /** - * The company contact's job title. + * Yemeni Rial (YER). */ - public CompanyContactQuery title() { - startField("title"); + YER, - return this; - } + /** + * South African Rand (ZAR). + */ + ZAR, /** - * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company - * contact was last modified. + * Zambian Kwacha (ZMW). */ - public CompanyContactQuery updatedAt() { - startField("updatedAt"); + ZMW, - return this; - } - } + UNKNOWN_VALUE; - /** - * A company's main point of contact. - */ - public static class CompanyContact extends AbstractResponse implements Node { - public CompanyContact() { - } + public static CurrencyCode fromGraphQl(String value) { + if (value == null) { + return null; + } - public CompanyContact(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "createdAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + switch (value) { + case "AED": { + return AED; + } - break; - } + case "AFN": { + return AFN; + } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case "ALL": { + return ALL; + } - break; - } + case "AMD": { + return AMD; + } - case "locale": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case "ANG": { + return ANG; + } - responseData.put(key, optional1); + case "AOA": { + return AOA; + } - break; - } + case "ARS": { + return ARS; + } - case "title": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case "AUD": { + return AUD; + } - responseData.put(key, optional1); + case "AWG": { + return AWG; + } - break; - } + case "AZN": { + return AZN; + } - case "updatedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + case "BAM": { + return BAM; + } - break; - } + case "BBD": { + return BBD; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "BDT": { + return BDT; } - } - } - public CompanyContact(ID id) { - this(); - optimisticData.put("id", id); - } + case "BGN": { + return BGN; + } - public String getGraphQlTypeName() { - return "CompanyContact"; - } + case "BHD": { + return BHD; + } - /** - * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company - * contact was created in Shopify. - */ + case "BIF": { + return BIF; + } - public DateTime getCreatedAt() { - return (DateTime) get("createdAt"); - } + case "BMD": { + return BMD; + } - public CompanyContact setCreatedAt(DateTime arg) { - optimisticData.put(getKey("createdAt"), arg); - return this; - } + case "BND": { + return BND; + } - /** - * A globally-unique ID. - */ + case "BOB": { + return BOB; + } - public ID getId() { - return (ID) get("id"); - } + case "BRL": { + return BRL; + } - /** - * The company contact's locale (language). - */ + case "BSD": { + return BSD; + } - public String getLocale() { - return (String) get("locale"); - } + case "BTN": { + return BTN; + } - public CompanyContact setLocale(String arg) { - optimisticData.put(getKey("locale"), arg); - return this; - } + case "BWP": { + return BWP; + } - /** - * The company contact's job title. - */ + case "BYN": { + return BYN; + } - public String getTitle() { - return (String) get("title"); - } + case "BZD": { + return BZD; + } - public CompanyContact setTitle(String arg) { - optimisticData.put(getKey("title"), arg); - return this; - } + case "CAD": { + return CAD; + } - /** - * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company - * contact was last modified. - */ + case "CDF": { + return CDF; + } - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); - } + case "CHF": { + return CHF; + } - public CompanyContact setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); - return this; - } + case "CLP": { + return CLP; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "createdAt": return false; + case "CNY": { + return CNY; + } - case "id": return false; + case "COP": { + return COP; + } - case "locale": return false; + case "CRC": { + return CRC; + } - case "title": return false; + case "CVE": { + return CVE; + } - case "updatedAt": return false; + case "CZK": { + return CZK; + } - default: return false; - } - } - } + case "DJF": { + return DJF; + } - public interface CompanyLocationQueryDefinition { - void define(CompanyLocationQuery _queryBuilder); - } + case "DKK": { + return DKK; + } - /** - * A company's location. - */ - public static class CompanyLocationQuery extends Query { - CompanyLocationQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + case "DOP": { + return DOP; + } - startField("id"); - } + case "DZD": { + return DZD; + } - /** - * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company - * location was created in Shopify. - */ - public CompanyLocationQuery createdAt() { - startField("createdAt"); + case "EGP": { + return EGP; + } - return this; - } + case "ERN": { + return ERN; + } - /** - * A unique externally-supplied ID for the company. - */ - public CompanyLocationQuery externalId() { - startField("externalId"); + case "ETB": { + return ETB; + } - return this; - } + case "EUR": { + return EUR; + } - /** - * The preferred locale of the company location. - */ - public CompanyLocationQuery locale() { - startField("locale"); + case "FJD": { + return FJD; + } - return this; - } + case "FKP": { + return FKP; + } - public class MetafieldArguments extends Arguments { - MetafieldArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } + case "GBP": { + return GBP; + } - /** - * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. - */ - public MetafieldArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "GEL": { + return GEL; } - return this; - } - } - public interface MetafieldArgumentsDefinition { - void define(MetafieldArguments args); - } + case "GHS": { + return GHS; + } - /** - * Returns a metafield found by namespace and key. - */ - public CompanyLocationQuery metafield(String key, MetafieldQueryDefinition queryDef) { - return metafield(key, args -> {}, queryDef); - } + case "GIP": { + return GIP; + } - /** - * Returns a metafield found by namespace and key. - */ - public CompanyLocationQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { - startField("metafield"); + case "GMD": { + return GMD; + } - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + case "GNF": { + return GNF; + } - argsDef.define(new MetafieldArguments(_queryBuilder)); + case "GTQ": { + return GTQ; + } - _queryBuilder.append(')'); + case "GYD": { + return GYD; + } - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "HKD": { + return HKD; + } - return this; - } + case "HNL": { + return HNL; + } - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ - public CompanyLocationQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); + case "HRK": { + return HRK; + } - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); + case "HTG": { + return HTG; } - } - _queryBuilder.append(']'); - _queryBuilder.append(')'); + case "HUF": { + return HUF; + } - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "IDR": { + return IDR; + } - return this; - } + case "ILS": { + return ILS; + } - /** - * The name of the company location. - */ - public CompanyLocationQuery name() { - startField("name"); + case "INR": { + return INR; + } - return this; - } + case "IQD": { + return IQD; + } - /** - * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company - * location was last modified. - */ - public CompanyLocationQuery updatedAt() { - startField("updatedAt"); + case "IRR": { + return IRR; + } - return this; - } - } + case "ISK": { + return ISK; + } - /** - * A company's location. - */ - public static class CompanyLocation extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { - public CompanyLocation() { - } + case "JEP": { + return JEP; + } - public CompanyLocation(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "createdAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + case "JMD": { + return JMD; + } - break; - } + case "JOD": { + return JOD; + } - case "externalId": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case "JPY": { + return JPY; + } - responseData.put(key, optional1); + case "KES": { + return KES; + } - break; - } + case "KGS": { + return KGS; + } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case "KHR": { + return KHR; + } - break; - } + case "KID": { + return KID; + } - case "locale": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case "KMF": { + return KMF; + } - responseData.put(key, optional1); + case "KRW": { + return KRW; + } - break; - } + case "KWD": { + return KWD; + } - case "metafield": { - Metafield optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); - } + case "KYD": { + return KYD; + } - responseData.put(key, optional1); + case "KZT": { + return KZT; + } - break; - } + case "LAK": { + return LAK; + } - case "metafields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } + case "LBP": { + return LBP; + } - list1.add(optional2); - } + case "LKR": { + return LKR; + } - responseData.put(key, list1); + case "LRD": { + return LRD; + } - break; - } + case "LSL": { + return LSL; + } - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "LTL": { + return LTL; + } - break; - } + case "LVL": { + return LVL; + } - case "updatedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + case "LYD": { + return LYD; + } - break; - } + case "MAD": { + return MAD; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "MDL": { + return MDL; } - } - } - public CompanyLocation(ID id) { - this(); - optimisticData.put("id", id); - } + case "MGA": { + return MGA; + } - public String getGraphQlTypeName() { - return "CompanyLocation"; - } + case "MKD": { + return MKD; + } - /** - * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company - * location was created in Shopify. - */ + case "MMK": { + return MMK; + } - public DateTime getCreatedAt() { - return (DateTime) get("createdAt"); - } + case "MNT": { + return MNT; + } - public CompanyLocation setCreatedAt(DateTime arg) { - optimisticData.put(getKey("createdAt"), arg); - return this; - } + case "MOP": { + return MOP; + } - /** - * A unique externally-supplied ID for the company. - */ + case "MRU": { + return MRU; + } - public String getExternalId() { - return (String) get("externalId"); - } + case "MUR": { + return MUR; + } - public CompanyLocation setExternalId(String arg) { - optimisticData.put(getKey("externalId"), arg); - return this; - } + case "MVR": { + return MVR; + } - /** - * A globally-unique ID. - */ + case "MWK": { + return MWK; + } - public ID getId() { - return (ID) get("id"); - } + case "MXN": { + return MXN; + } - /** - * The preferred locale of the company location. - */ + case "MYR": { + return MYR; + } - public String getLocale() { - return (String) get("locale"); - } + case "MZN": { + return MZN; + } - public CompanyLocation setLocale(String arg) { - optimisticData.put(getKey("locale"), arg); - return this; - } + case "NAD": { + return NAD; + } - /** - * Returns a metafield found by namespace and key. - */ + case "NGN": { + return NGN; + } - public Metafield getMetafield() { - return (Metafield) get("metafield"); - } + case "NIO": { + return NIO; + } - public CompanyLocation setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); - return this; - } + case "NOK": { + return NOK; + } - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ + case "NPR": { + return NPR; + } - public List getMetafields() { - return (List) get("metafields"); - } + case "NZD": { + return NZD; + } - public CompanyLocation setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); - return this; - } + case "OMR": { + return OMR; + } - /** - * The name of the company location. - */ + case "PAB": { + return PAB; + } - public String getName() { - return (String) get("name"); - } + case "PEN": { + return PEN; + } - public CompanyLocation setName(String arg) { - optimisticData.put(getKey("name"), arg); - return this; - } + case "PGK": { + return PGK; + } - /** - * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company - * location was last modified. - */ + case "PHP": { + return PHP; + } - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); - } + case "PKR": { + return PKR; + } - public CompanyLocation setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); - return this; - } + case "PLN": { + return PLN; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "createdAt": return false; + case "PYG": { + return PYG; + } - case "externalId": return false; + case "QAR": { + return QAR; + } - case "id": return false; + case "RON": { + return RON; + } - case "locale": return false; + case "RSD": { + return RSD; + } - case "metafield": return true; + case "RUB": { + return RUB; + } - case "metafields": return true; + case "RWF": { + return RWF; + } - case "name": return false; + case "SAR": { + return SAR; + } - case "updatedAt": return false; + case "SBD": { + return SBD; + } - default: return false; - } - } - } + case "SCR": { + return SCR; + } - public interface CompletePaymentChallengeQueryDefinition { - void define(CompletePaymentChallengeQuery _queryBuilder); - } + case "SDG": { + return SDG; + } - /** - * The action for the 3DS payment redirect. - */ - public static class CompletePaymentChallengeQuery extends Query { - CompletePaymentChallengeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "SEK": { + return SEK; + } - /** - * The URL for the 3DS payment redirect. - */ - public CompletePaymentChallengeQuery redirectUrl() { - startField("redirectUrl"); + case "SGD": { + return SGD; + } - return this; - } - } + case "SHP": { + return SHP; + } - /** - * The action for the 3DS payment redirect. - */ - public static class CompletePaymentChallenge extends AbstractResponse implements CartCompletionAction { - public CompletePaymentChallenge() { - } + case "SLL": { + return SLL; + } - public CompletePaymentChallenge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "redirectUrl": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case "SOS": { + return SOS; + } - responseData.put(key, optional1); + case "SRD": { + return SRD; + } - break; - } + case "SSP": { + return SSP; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "STN": { + return STN; } - } - } - public String getGraphQlTypeName() { - return "CompletePaymentChallenge"; - } + case "SYP": { + return SYP; + } - /** - * The URL for the 3DS payment redirect. - */ + case "SZL": { + return SZL; + } - public String getRedirectUrl() { - return (String) get("redirectUrl"); - } + case "THB": { + return THB; + } - public CompletePaymentChallenge setRedirectUrl(String arg) { - optimisticData.put(getKey("redirectUrl"), arg); - return this; - } + case "TJS": { + return TJS; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "redirectUrl": return false; + case "TMT": { + return TMT; + } - default: return false; - } - } - } + case "TND": { + return TND; + } - public interface CompletionErrorQueryDefinition { - void define(CompletionErrorQuery _queryBuilder); - } + case "TOP": { + return TOP; + } - /** - * An error that occurred during a cart completion attempt. - */ - public static class CompletionErrorQuery extends Query { - CompletionErrorQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "TRY": { + return TRY; + } - /** - * The error code. - */ - public CompletionErrorQuery code() { - startField("code"); + case "TTD": { + return TTD; + } - return this; - } + case "TWD": { + return TWD; + } - /** - * The error message. - */ - public CompletionErrorQuery message() { - startField("message"); + case "TZS": { + return TZS; + } - return this; - } - } + case "UAH": { + return UAH; + } - /** - * An error that occurred during a cart completion attempt. - */ - public static class CompletionError extends AbstractResponse { - public CompletionError() { - } + case "UGX": { + return UGX; + } - public CompletionError(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "code": { - responseData.put(key, CompletionErrorCode.fromGraphQl(jsonAsString(field.getValue(), key))); + case "USD": { + return USD; + } - break; - } + case "UYU": { + return UYU; + } - case "message": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case "UZS": { + return UZS; + } - responseData.put(key, optional1); + case "VED": { + return VED; + } - break; - } + case "VES": { + return VES; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "VND": { + return VND; } - } - } - public String getGraphQlTypeName() { - return "CompletionError"; - } + case "VUV": { + return VUV; + } - /** - * The error code. - */ + case "WST": { + return WST; + } - public CompletionErrorCode getCode() { - return (CompletionErrorCode) get("code"); - } + case "XAF": { + return XAF; + } - public CompletionError setCode(CompletionErrorCode arg) { - optimisticData.put(getKey("code"), arg); - return this; - } + case "XCD": { + return XCD; + } - /** - * The error message. - */ + case "XOF": { + return XOF; + } - public String getMessage() { - return (String) get("message"); - } + case "XPF": { + return XPF; + } - public CompletionError setMessage(String arg) { - optimisticData.put(getKey("message"), arg); - return this; - } + case "XXX": { + return XXX; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "code": return false; + case "YER": { + return YER; + } - case "message": return false; + case "ZAR": { + return ZAR; + } - default: return false; + case "ZMW": { + return ZMW; + } + + default: { + return UNKNOWN_VALUE; + } } } - } + public String toString() { + switch (this) { + case AED: { + return "AED"; + } - /** - * The code of the error that occurred during a cart completion attempt. - */ - public enum CompletionErrorCode { - ERROR, + case AFN: { + return "AFN"; + } - INVENTORY_RESERVATION_ERROR, + case ALL: { + return "ALL"; + } - PAYMENT_AMOUNT_TOO_SMALL, + case AMD: { + return "AMD"; + } - PAYMENT_CALL_ISSUER, + case ANG: { + return "ANG"; + } - PAYMENT_CARD_DECLINED, + case AOA: { + return "AOA"; + } - PAYMENT_ERROR, + case ARS: { + return "ARS"; + } - PAYMENT_GATEWAY_NOT_ENABLED_ERROR, + case AUD: { + return "AUD"; + } - PAYMENT_INSUFFICIENT_FUNDS, + case AWG: { + return "AWG"; + } - PAYMENT_INVALID_BILLING_ADDRESS, + case AZN: { + return "AZN"; + } - PAYMENT_INVALID_CREDIT_CARD, + case BAM: { + return "BAM"; + } - PAYMENT_INVALID_CURRENCY, + case BBD: { + return "BBD"; + } - PAYMENT_INVALID_PAYMENT_METHOD, + case BDT: { + return "BDT"; + } - PAYMENT_TRANSIENT_ERROR, + case BGN: { + return "BGN"; + } - UNKNOWN_VALUE; + case BHD: { + return "BHD"; + } - public static CompletionErrorCode fromGraphQl(String value) { - if (value == null) { - return null; - } + case BIF: { + return "BIF"; + } - switch (value) { - case "ERROR": { - return ERROR; + case BMD: { + return "BMD"; } - case "INVENTORY_RESERVATION_ERROR": { - return INVENTORY_RESERVATION_ERROR; + case BND: { + return "BND"; } - case "PAYMENT_AMOUNT_TOO_SMALL": { - return PAYMENT_AMOUNT_TOO_SMALL; + case BOB: { + return "BOB"; } - case "PAYMENT_CALL_ISSUER": { - return PAYMENT_CALL_ISSUER; + case BRL: { + return "BRL"; } - case "PAYMENT_CARD_DECLINED": { - return PAYMENT_CARD_DECLINED; + case BSD: { + return "BSD"; } - case "PAYMENT_ERROR": { - return PAYMENT_ERROR; + case BTN: { + return "BTN"; } - case "PAYMENT_GATEWAY_NOT_ENABLED_ERROR": { - return PAYMENT_GATEWAY_NOT_ENABLED_ERROR; + case BWP: { + return "BWP"; } - case "PAYMENT_INSUFFICIENT_FUNDS": { - return PAYMENT_INSUFFICIENT_FUNDS; + case BYN: { + return "BYN"; } - case "PAYMENT_INVALID_BILLING_ADDRESS": { - return PAYMENT_INVALID_BILLING_ADDRESS; + case BZD: { + return "BZD"; } - case "PAYMENT_INVALID_CREDIT_CARD": { - return PAYMENT_INVALID_CREDIT_CARD; + case CAD: { + return "CAD"; } - case "PAYMENT_INVALID_CURRENCY": { - return PAYMENT_INVALID_CURRENCY; + case CDF: { + return "CDF"; } - case "PAYMENT_INVALID_PAYMENT_METHOD": { - return PAYMENT_INVALID_PAYMENT_METHOD; + case CHF: { + return "CHF"; } - case "PAYMENT_TRANSIENT_ERROR": { - return PAYMENT_TRANSIENT_ERROR; + case CLP: { + return "CLP"; } - default: { - return UNKNOWN_VALUE; + case CNY: { + return "CNY"; } - } - } - public String toString() { - switch (this) { - case ERROR: { - return "ERROR"; + + case COP: { + return "COP"; } - case INVENTORY_RESERVATION_ERROR: { - return "INVENTORY_RESERVATION_ERROR"; + case CRC: { + return "CRC"; } - case PAYMENT_AMOUNT_TOO_SMALL: { - return "PAYMENT_AMOUNT_TOO_SMALL"; + case CVE: { + return "CVE"; } - case PAYMENT_CALL_ISSUER: { - return "PAYMENT_CALL_ISSUER"; + case CZK: { + return "CZK"; } - case PAYMENT_CARD_DECLINED: { - return "PAYMENT_CARD_DECLINED"; + case DJF: { + return "DJF"; } - case PAYMENT_ERROR: { - return "PAYMENT_ERROR"; + case DKK: { + return "DKK"; } - case PAYMENT_GATEWAY_NOT_ENABLED_ERROR: { - return "PAYMENT_GATEWAY_NOT_ENABLED_ERROR"; + case DOP: { + return "DOP"; } - case PAYMENT_INSUFFICIENT_FUNDS: { - return "PAYMENT_INSUFFICIENT_FUNDS"; + case DZD: { + return "DZD"; } - case PAYMENT_INVALID_BILLING_ADDRESS: { - return "PAYMENT_INVALID_BILLING_ADDRESS"; + case EGP: { + return "EGP"; } - case PAYMENT_INVALID_CREDIT_CARD: { - return "PAYMENT_INVALID_CREDIT_CARD"; + case ERN: { + return "ERN"; } - case PAYMENT_INVALID_CURRENCY: { - return "PAYMENT_INVALID_CURRENCY"; + case ETB: { + return "ETB"; } - case PAYMENT_INVALID_PAYMENT_METHOD: { - return "PAYMENT_INVALID_PAYMENT_METHOD"; + case EUR: { + return "EUR"; } - case PAYMENT_TRANSIENT_ERROR: { - return "PAYMENT_TRANSIENT_ERROR"; + case FJD: { + return "FJD"; } - default: { - return ""; + case FKP: { + return "FKP"; } - } - } - } - public interface ComponentizableCartLineQueryDefinition { - void define(ComponentizableCartLineQuery _queryBuilder); - } + case GBP: { + return "GBP"; + } - /** - * Represents information about the grouped merchandise in the cart. - */ - public static class ComponentizableCartLineQuery extends Query { - ComponentizableCartLineQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + case GEL: { + return "GEL"; + } - startField("id"); - } + case GHS: { + return "GHS"; + } - /** - * An attribute associated with the cart line. - */ - public ComponentizableCartLineQuery attribute(String key, AttributeQueryDefinition queryDef) { - startField("attribute"); + case GIP: { + return "GIP"; + } - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + case GMD: { + return "GMD"; + } - _queryBuilder.append(')'); + case GNF: { + return "GNF"; + } - _queryBuilder.append('{'); - queryDef.define(new AttributeQuery(_queryBuilder)); - _queryBuilder.append('}'); + case GTQ: { + return "GTQ"; + } - return this; - } + case GYD: { + return "GYD"; + } - /** - * The attributes associated with the cart line. Attributes are represented as key-value pairs. - */ - public ComponentizableCartLineQuery attributes(AttributeQueryDefinition queryDef) { - startField("attributes"); + case HKD: { + return "HKD"; + } - _queryBuilder.append('{'); - queryDef.define(new AttributeQuery(_queryBuilder)); - _queryBuilder.append('}'); + case HNL: { + return "HNL"; + } - return this; - } + case HRK: { + return "HRK"; + } - /** - * The cost of the merchandise that the buyer will pay for at checkout. The costs are subject to change - * and changes will be reflected at checkout. - */ - public ComponentizableCartLineQuery cost(CartLineCostQueryDefinition queryDef) { - startField("cost"); - - _queryBuilder.append('{'); - queryDef.define(new CartLineCostQuery(_queryBuilder)); - _queryBuilder.append('}'); + case HTG: { + return "HTG"; + } - return this; - } + case HUF: { + return "HUF"; + } - /** - * The discounts that have been applied to the cart line. - */ - public ComponentizableCartLineQuery discountAllocations(CartDiscountAllocationQueryDefinition queryDef) { - startField("discountAllocations"); + case IDR: { + return "IDR"; + } - _queryBuilder.append('{'); - queryDef.define(new CartDiscountAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + case ILS: { + return "ILS"; + } - return this; - } + case INR: { + return "INR"; + } - /** - * The estimated cost of the merchandise that the buyer will pay for at checkout. The estimated costs - * are subject to change and changes will be reflected at checkout. - * - * @deprecated Use `cost` instead. - */ - @Deprecated - public ComponentizableCartLineQuery estimatedCost(CartLineEstimatedCostQueryDefinition queryDef) { - startField("estimatedCost"); + case IQD: { + return "IQD"; + } - _queryBuilder.append('{'); - queryDef.define(new CartLineEstimatedCostQuery(_queryBuilder)); - _queryBuilder.append('}'); + case IRR: { + return "IRR"; + } - return this; - } + case ISK: { + return "ISK"; + } - /** - * The components of the line item. - */ - public ComponentizableCartLineQuery lineComponents(CartLineQueryDefinition queryDef) { - startField("lineComponents"); + case JEP: { + return "JEP"; + } - _queryBuilder.append('{'); - queryDef.define(new CartLineQuery(_queryBuilder)); - _queryBuilder.append('}'); + case JMD: { + return "JMD"; + } - return this; - } + case JOD: { + return "JOD"; + } - /** - * The merchandise that the buyer intends to purchase. - */ - public ComponentizableCartLineQuery merchandise(MerchandiseQueryDefinition queryDef) { - startField("merchandise"); + case JPY: { + return "JPY"; + } - _queryBuilder.append('{'); - queryDef.define(new MerchandiseQuery(_queryBuilder)); - _queryBuilder.append('}'); + case KES: { + return "KES"; + } - return this; - } + case KGS: { + return "KGS"; + } - /** - * The quantity of the merchandise that the customer intends to purchase. - */ - public ComponentizableCartLineQuery quantity() { - startField("quantity"); + case KHR: { + return "KHR"; + } - return this; - } + case KID: { + return "KID"; + } - /** - * The selling plan associated with the cart line and the effect that each selling plan has on variants - * when they're purchased. - */ - public ComponentizableCartLineQuery sellingPlanAllocation(SellingPlanAllocationQueryDefinition queryDef) { - startField("sellingPlanAllocation"); + case KMF: { + return "KMF"; + } - _queryBuilder.append('{'); - queryDef.define(new SellingPlanAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + case KRW: { + return "KRW"; + } - return this; - } - } + case KWD: { + return "KWD"; + } - /** - * Represents information about the grouped merchandise in the cart. - */ - public static class ComponentizableCartLine extends AbstractResponse implements BaseCartLine, Node { - public ComponentizableCartLine() { - } + case KYD: { + return "KYD"; + } - public ComponentizableCartLine(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "attribute": { - Attribute optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Attribute(jsonAsObject(field.getValue(), key)); - } + case KZT: { + return "KZT"; + } - responseData.put(key, optional1); + case LAK: { + return "LAK"; + } - break; - } + case LBP: { + return "LBP"; + } - case "attributes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Attribute(jsonAsObject(element1, key))); - } + case LKR: { + return "LKR"; + } - responseData.put(key, list1); + case LRD: { + return "LRD"; + } - break; - } + case LSL: { + return "LSL"; + } - case "cost": { - responseData.put(key, new CartLineCost(jsonAsObject(field.getValue(), key))); + case LTL: { + return "LTL"; + } - break; - } + case LVL: { + return "LVL"; + } - case "discountAllocations": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(UnknownCartDiscountAllocation.create(jsonAsObject(element1, key))); - } + case LYD: { + return "LYD"; + } - responseData.put(key, list1); + case MAD: { + return "MAD"; + } - break; - } + case MDL: { + return "MDL"; + } - case "estimatedCost": { - responseData.put(key, new CartLineEstimatedCost(jsonAsObject(field.getValue(), key))); + case MGA: { + return "MGA"; + } - break; - } + case MKD: { + return "MKD"; + } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case MMK: { + return "MMK"; + } - break; - } + case MNT: { + return "MNT"; + } - case "lineComponents": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CartLine(jsonAsObject(element1, key))); - } + case MOP: { + return "MOP"; + } - responseData.put(key, list1); + case MRU: { + return "MRU"; + } - break; - } + case MUR: { + return "MUR"; + } - case "merchandise": { - responseData.put(key, UnknownMerchandise.create(jsonAsObject(field.getValue(), key))); + case MVR: { + return "MVR"; + } - break; - } + case MWK: { + return "MWK"; + } - case "quantity": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + case MXN: { + return "MXN"; + } - break; - } + case MYR: { + return "MYR"; + } - case "sellingPlanAllocation": { - SellingPlanAllocation optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new SellingPlanAllocation(jsonAsObject(field.getValue(), key)); - } + case MZN: { + return "MZN"; + } - responseData.put(key, optional1); + case NAD: { + return "NAD"; + } - break; - } + case NGN: { + return "NGN"; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case NIO: { + return "NIO"; } - } - } - public ComponentizableCartLine(ID id) { - this(); - optimisticData.put("id", id); - } + case NOK: { + return "NOK"; + } - public String getGraphQlTypeName() { - return "ComponentizableCartLine"; - } + case NPR: { + return "NPR"; + } - /** - * An attribute associated with the cart line. - */ + case NZD: { + return "NZD"; + } - public Attribute getAttribute() { - return (Attribute) get("attribute"); - } + case OMR: { + return "OMR"; + } - public ComponentizableCartLine setAttribute(Attribute arg) { - optimisticData.put(getKey("attribute"), arg); - return this; - } + case PAB: { + return "PAB"; + } - /** - * The attributes associated with the cart line. Attributes are represented as key-value pairs. - */ + case PEN: { + return "PEN"; + } - public List getAttributes() { - return (List) get("attributes"); - } + case PGK: { + return "PGK"; + } - public ComponentizableCartLine setAttributes(List arg) { - optimisticData.put(getKey("attributes"), arg); - return this; - } + case PHP: { + return "PHP"; + } - /** - * The cost of the merchandise that the buyer will pay for at checkout. The costs are subject to change - * and changes will be reflected at checkout. - */ + case PKR: { + return "PKR"; + } - public CartLineCost getCost() { - return (CartLineCost) get("cost"); - } + case PLN: { + return "PLN"; + } - public ComponentizableCartLine setCost(CartLineCost arg) { - optimisticData.put(getKey("cost"), arg); - return this; - } + case PYG: { + return "PYG"; + } - /** - * The discounts that have been applied to the cart line. - */ + case QAR: { + return "QAR"; + } - public List getDiscountAllocations() { - return (List) get("discountAllocations"); - } + case RON: { + return "RON"; + } - public ComponentizableCartLine setDiscountAllocations(List arg) { - optimisticData.put(getKey("discountAllocations"), arg); - return this; - } + case RSD: { + return "RSD"; + } - /** - * The estimated cost of the merchandise that the buyer will pay for at checkout. The estimated costs - * are subject to change and changes will be reflected at checkout. - * - * @deprecated Use `cost` instead. - */ + case RUB: { + return "RUB"; + } - public CartLineEstimatedCost getEstimatedCost() { - return (CartLineEstimatedCost) get("estimatedCost"); - } + case RWF: { + return "RWF"; + } - public ComponentizableCartLine setEstimatedCost(CartLineEstimatedCost arg) { - optimisticData.put(getKey("estimatedCost"), arg); - return this; - } + case SAR: { + return "SAR"; + } - /** - * A globally-unique ID. - */ + case SBD: { + return "SBD"; + } - public ID getId() { - return (ID) get("id"); - } + case SCR: { + return "SCR"; + } - /** - * The components of the line item. - */ + case SDG: { + return "SDG"; + } - public List getLineComponents() { - return (List) get("lineComponents"); - } + case SEK: { + return "SEK"; + } - public ComponentizableCartLine setLineComponents(List arg) { - optimisticData.put(getKey("lineComponents"), arg); - return this; - } + case SGD: { + return "SGD"; + } - /** - * The merchandise that the buyer intends to purchase. - */ + case SHP: { + return "SHP"; + } - public Merchandise getMerchandise() { - return (Merchandise) get("merchandise"); - } + case SLL: { + return "SLL"; + } - public ComponentizableCartLine setMerchandise(Merchandise arg) { - optimisticData.put(getKey("merchandise"), arg); - return this; - } + case SOS: { + return "SOS"; + } - /** - * The quantity of the merchandise that the customer intends to purchase. - */ + case SRD: { + return "SRD"; + } - public Integer getQuantity() { - return (Integer) get("quantity"); - } + case SSP: { + return "SSP"; + } - public ComponentizableCartLine setQuantity(Integer arg) { - optimisticData.put(getKey("quantity"), arg); - return this; - } + case STN: { + return "STN"; + } - /** - * The selling plan associated with the cart line and the effect that each selling plan has on variants - * when they're purchased. - */ + case SYP: { + return "SYP"; + } - public SellingPlanAllocation getSellingPlanAllocation() { - return (SellingPlanAllocation) get("sellingPlanAllocation"); - } + case SZL: { + return "SZL"; + } - public ComponentizableCartLine setSellingPlanAllocation(SellingPlanAllocation arg) { - optimisticData.put(getKey("sellingPlanAllocation"), arg); - return this; - } + case THB: { + return "THB"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "attribute": return true; + case TJS: { + return "TJS"; + } - case "attributes": return true; + case TMT: { + return "TMT"; + } - case "cost": return true; + case TND: { + return "TND"; + } - case "discountAllocations": return false; + case TOP: { + return "TOP"; + } - case "estimatedCost": return true; + case TRY: { + return "TRY"; + } - case "id": return false; + case TTD: { + return "TTD"; + } - case "lineComponents": return true; + case TWD: { + return "TWD"; + } - case "merchandise": return false; + case TZS: { + return "TZS"; + } - case "quantity": return false; + case UAH: { + return "UAH"; + } - case "sellingPlanAllocation": return true; + case UGX: { + return "UGX"; + } - default: return false; + case USD: { + return "USD"; + } + + case UYU: { + return "UYU"; + } + + case UZS: { + return "UZS"; + } + + case VED: { + return "VED"; + } + + case VES: { + return "VES"; + } + + case VND: { + return "VND"; + } + + case VUV: { + return "VUV"; + } + + case WST: { + return "WST"; + } + + case XAF: { + return "XAF"; + } + + case XCD: { + return "XCD"; + } + + case XOF: { + return "XOF"; + } + + case XPF: { + return "XPF"; + } + + case XXX: { + return "XXX"; + } + + case YER: { + return "YER"; + } + + case ZAR: { + return "ZAR"; + } + + case ZMW: { + return "ZMW"; + } + + default: { + return ""; + } } } } - public interface CountryQueryDefinition { - void define(CountryQuery _queryBuilder); + public interface CustomerQueryDefinition { + void define(CustomerQuery _queryBuilder); } /** - * A country. + * A customer represents a customer account with the shop. Customer accounts store contact information + * for the customer, saving logged-in customers the trouble of having to provide it at every checkout. */ - public static class CountryQuery extends Query { - CountryQuery(StringBuilder _queryBuilder) { + public static class CustomerQuery extends Query { + CustomerQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The languages available for the country. + * Indicates whether the customer has consented to be sent marketing material via email. */ - public CountryQuery availableLanguages(LanguageQueryDefinition queryDef) { - startField("availableLanguages"); - - _queryBuilder.append('{'); - queryDef.define(new LanguageQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CustomerQuery acceptsMarketing() { + startField("acceptsMarketing"); return this; } + public class AddressesArguments extends Arguments { + AddressesArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * Returns up to the first `n` elements from the list. + */ + public AddressesArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come after the specified cursor. + */ + public AddressesArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Returns up to the last `n` elements from the list. + */ + public AddressesArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come before the specified cursor. + */ + public AddressesArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Reverse the order of the underlying list. + */ + public AddressesArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } + } + + public interface AddressesArgumentsDefinition { + void define(AddressesArguments args); + } + /** - * The currency of the country. + * A list of addresses for the customer. */ - public CountryQuery currency(CurrencyQueryDefinition queryDef) { - startField("currency"); + public CustomerQuery addresses(MailingAddressConnectionQueryDefinition queryDef) { + return addresses(args -> {}, queryDef); + } + + /** + * A list of addresses for the customer. + */ + public CustomerQuery addresses(AddressesArgumentsDefinition argsDef, MailingAddressConnectionQueryDefinition queryDef) { + startField("addresses"); + + AddressesArguments args = new AddressesArguments(_queryBuilder); + argsDef.define(args); + AddressesArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new CurrencyQuery(_queryBuilder)); + queryDef.define(new MailingAddressConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The ISO code of the country. + * The date and time when the customer was created. */ - public CountryQuery isoCode() { - startField("isoCode"); + public CustomerQuery createdAt() { + startField("createdAt"); return this; } /** - * The market that includes this country. + * The customer’s default address. */ - public CountryQuery market(MarketQueryDefinition queryDef) { - startField("market"); + public CustomerQuery defaultAddress(MailingAddressQueryDefinition queryDef) { + startField("defaultAddress"); _queryBuilder.append('{'); - queryDef.define(new MarketQuery(_queryBuilder)); + queryDef.define(new MailingAddressQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The name of the country. + * The customer’s name, email or phone number. */ - public CountryQuery name() { - startField("name"); + public CustomerQuery displayName() { + startField("displayName"); return this; } /** - * The unit system used in the country. + * The customer’s email address. */ - public CountryQuery unitSystem() { - startField("unitSystem"); + public CustomerQuery email() { + startField("email"); return this; } - } - - /** - * A country. - */ - public static class Country extends AbstractResponse { - public Country() { - } - - public Country(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "availableLanguages": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Language(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "currency": { - responseData.put(key, new Currency(jsonAsObject(field.getValue(), key))); - - break; - } - - case "isoCode": { - responseData.put(key, CountryCode.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - case "market": { - Market optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Market(jsonAsObject(field.getValue(), key)); - } + /** + * The customer’s first name. + */ + public CustomerQuery firstName() { + startField("firstName"); - responseData.put(key, optional1); + return this; + } - break; - } + /** + * A unique ID for the customer. + */ + public CustomerQuery id() { + startField("id"); - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + return this; + } - break; - } + /** + * The customer’s last name. + */ + public CustomerQuery lastName() { + startField("lastName"); - case "unitSystem": { - responseData.put(key, UnitSystem.fromGraphQl(jsonAsString(field.getValue(), key))); + return this; + } - break; - } + public class MetafieldArguments extends Arguments { + MetafieldArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + /** + * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. + */ + public MetafieldArguments namespace(String value) { + if (value != null) { + startArgument("namespace"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } } - public String getGraphQlTypeName() { - return "Country"; + public interface MetafieldArgumentsDefinition { + void define(MetafieldArguments args); } /** - * The languages available for the country. + * Returns a metafield found by namespace and key. */ - - public List getAvailableLanguages() { - return (List) get("availableLanguages"); - } - - public Country setAvailableLanguages(List arg) { - optimisticData.put(getKey("availableLanguages"), arg); - return this; + public CustomerQuery metafield(String key, MetafieldQueryDefinition queryDef) { + return metafield(key, args -> {}, queryDef); } /** - * The currency of the country. + * Returns a metafield found by namespace and key. */ + public CustomerQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { + startField("metafield"); - public Currency getCurrency() { - return (Currency) get("currency"); - } + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); - public Country setCurrency(Currency arg) { - optimisticData.put(getKey("currency"), arg); - return this; - } + argsDef.define(new MetafieldArguments(_queryBuilder)); - /** - * The ISO code of the country. - */ + _queryBuilder.append(')'); - public CountryCode getIsoCode() { - return (CountryCode) get("isoCode"); - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Country setIsoCode(CountryCode arg) { - optimisticData.put(getKey("isoCode"), arg); return this; } /** - * The market that includes this country. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ + public CustomerQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); - public Market getMarket() { - return (Market) get("market"); - } - - public Country setMarket(Market arg) { - optimisticData.put(getKey("market"), arg); - return this; - } + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); - /** - * The name of the country. - */ + _queryBuilder.append(')'); - public String getName() { - return (String) get("name"); - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Country setName(String arg) { - optimisticData.put(getKey("name"), arg); return this; } /** - * The unit system used in the country. + * The number of orders that the customer has made at the store in their lifetime. */ + public CustomerQuery numberOfOrders() { + startField("numberOfOrders"); - public UnitSystem getUnitSystem() { - return (UnitSystem) get("unitSystem"); - } - - public Country setUnitSystem(UnitSystem arg) { - optimisticData.put(getKey("unitSystem"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "availableLanguages": return true; + public class OrdersArguments extends Arguments { + OrdersArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "currency": return true; + /** + * Returns up to the first `n` elements from the list. + */ + public OrdersArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - case "isoCode": return false; + /** + * Returns the elements that come after the specified cursor. + */ + public OrdersArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "market": return true; + /** + * Returns up to the last `n` elements from the list. + */ + public OrdersArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - case "name": return false; + /** + * Returns the elements that come before the specified cursor. + */ + public OrdersArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "unitSystem": return false; + /** + * Reverse the order of the underlying list. + */ + public OrdersArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } - default: return false; + /** + * Sort the underlying list by the given key. + */ + public OrdersArguments sortKey(OrderSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; + } + + /** + * Apply one or multiple filters to the query. + * | name | description | acceptable_values | default_value | example_use | + * | ---- | ---- | ---- | ---- | ---- | + * | processed_at | + * Refer to the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) for more + * information about using filters. + */ + public OrdersArguments query(String value) { + if (value != null) { + startArgument("query"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; } } - } - /** - * The code designating a country/region, which generally follows ISO 3166-1 alpha-2 guidelines. - * If a territory doesn't have a country code value in the `CountryCode` enum, then it might be - * considered a subdivision - * of another country. For example, the territories associated with Spain are represented by the - * country code `ES`, - * and the territories associated with the United States of America are represented by the country code - * `US`. - */ - public enum CountryCode { + public interface OrdersArgumentsDefinition { + void define(OrdersArguments args); + } + /** - * Ascension Island. + * The orders associated with the customer. */ - AC, + public CustomerQuery orders(OrderConnectionQueryDefinition queryDef) { + return orders(args -> {}, queryDef); + } /** - * Andorra. + * The orders associated with the customer. */ - AD, + public CustomerQuery orders(OrdersArgumentsDefinition argsDef, OrderConnectionQueryDefinition queryDef) { + startField("orders"); - /** - * United Arab Emirates. - */ - AE, + OrdersArguments args = new OrdersArguments(_queryBuilder); + argsDef.define(args); + OrdersArguments.end(args); - /** - * Afghanistan. - */ - AF, + _queryBuilder.append('{'); + queryDef.define(new OrderConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Antigua & Barbuda. - */ - AG, + return this; + } /** - * Anguilla. + * The customer’s phone number. */ - AI, + public CustomerQuery phone() { + startField("phone"); - /** - * Albania. - */ - AL, + return this; + } /** - * Armenia. + * A comma separated list of tags that have been added to the customer. + * Additional access scope required: unauthenticated_read_customer_tags. */ - AM, + public CustomerQuery tags() { + startField("tags"); - /** - * Netherlands Antilles. - */ - AN, + return this; + } /** - * Angola. + * The date and time when the customer information was updated. */ - AO, + public CustomerQuery updatedAt() { + startField("updatedAt"); - /** - * Argentina. - */ - AR, + return this; + } + } - /** - * Austria. - */ - AT, + /** + * A customer represents a customer account with the shop. Customer accounts store contact information + * for the customer, saving logged-in customers the trouble of having to provide it at every checkout. + */ + public static class Customer extends AbstractResponse implements HasMetafields, MetafieldParentResource { + public Customer() { + } - /** - * Australia. - */ - AU, + public Customer(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "acceptsMarketing": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - /** - * Aruba. - */ - AW, + break; + } - /** - * Åland Islands. - */ - AX, + case "addresses": { + responseData.put(key, new MailingAddressConnection(jsonAsObject(field.getValue(), key))); - /** - * Azerbaijan. - */ - AZ, + break; + } - /** - * Bosnia & Herzegovina. - */ - BA, + case "createdAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - /** - * Barbados. - */ - BB, + break; + } - /** - * Bangladesh. - */ - BD, + case "defaultAddress": { + MailingAddress optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); + } - /** - * Belgium. - */ - BE, + responseData.put(key, optional1); - /** - * Burkina Faso. - */ - BF, + break; + } - /** - * Bulgaria. - */ - BG, + case "displayName": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * Bahrain. - */ - BH, + break; + } - /** - * Burundi. - */ - BI, + case "email": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - /** - * Benin. - */ - BJ, + responseData.put(key, optional1); - /** - * St. Barthélemy. - */ - BL, + break; + } - /** - * Bermuda. - */ - BM, + case "firstName": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - /** - * Brunei. - */ - BN, + responseData.put(key, optional1); - /** - * Bolivia. - */ - BO, + break; + } - /** - * Caribbean Netherlands. - */ - BQ, + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - /** - * Brazil. - */ - BR, + break; + } - /** - * Bahamas. - */ - BS, + case "lastName": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - /** - * Bhutan. - */ - BT, + responseData.put(key, optional1); - /** - * Bouvet Island. - */ - BV, + break; + } - /** - * Botswana. - */ - BW, + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } - /** - * Belarus. - */ - BY, + responseData.put(key, optional1); - /** - * Belize. - */ - BZ, + break; + } - /** - * Canada. - */ - CA, + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } - /** - * Cocos (Keeling) Islands. - */ - CC, + list1.add(optional2); + } - /** - * Congo - Kinshasa. - */ - CD, + responseData.put(key, list1); - /** - * Central African Republic. - */ - CF, + break; + } - /** - * Congo - Brazzaville. - */ - CG, + case "numberOfOrders": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * Switzerland. - */ - CH, + break; + } - /** - * Côte d’Ivoire. - */ - CI, + case "orders": { + responseData.put(key, new OrderConnection(jsonAsObject(field.getValue(), key))); - /** - * Cook Islands. - */ - CK, + break; + } - /** - * Chile. - */ - CL, + case "phone": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - /** - * Cameroon. - */ - CM, + responseData.put(key, optional1); - /** - * China. - */ - CN, + break; + } - /** - * Colombia. - */ - CO, + case "tags": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } - /** - * Costa Rica. - */ - CR, + responseData.put(key, list1); - /** - * Cuba. - */ - CU, + break; + } - /** - * Cape Verde. - */ - CV, + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - /** - * Curaçao. - */ - CW, + break; + } - /** - * Christmas Island. - */ - CX, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * Cyprus. - */ - CY, + public String getGraphQlTypeName() { + return "Customer"; + } /** - * Czechia. + * Indicates whether the customer has consented to be sent marketing material via email. */ - CZ, - /** - * Germany. - */ - DE, + public Boolean getAcceptsMarketing() { + return (Boolean) get("acceptsMarketing"); + } - /** - * Djibouti. - */ - DJ, + public Customer setAcceptsMarketing(Boolean arg) { + optimisticData.put(getKey("acceptsMarketing"), arg); + return this; + } /** - * Denmark. + * A list of addresses for the customer. */ - DK, - /** - * Dominica. - */ - DM, + public MailingAddressConnection getAddresses() { + return (MailingAddressConnection) get("addresses"); + } - /** - * Dominican Republic. - */ - DO, + public Customer setAddresses(MailingAddressConnection arg) { + optimisticData.put(getKey("addresses"), arg); + return this; + } /** - * Algeria. + * The date and time when the customer was created. */ - DZ, - /** - * Ecuador. - */ - EC, + public DateTime getCreatedAt() { + return (DateTime) get("createdAt"); + } - /** - * Estonia. - */ - EE, + public Customer setCreatedAt(DateTime arg) { + optimisticData.put(getKey("createdAt"), arg); + return this; + } /** - * Egypt. + * The customer’s default address. */ - EG, - /** - * Western Sahara. - */ - EH, + public MailingAddress getDefaultAddress() { + return (MailingAddress) get("defaultAddress"); + } - /** - * Eritrea. - */ - ER, + public Customer setDefaultAddress(MailingAddress arg) { + optimisticData.put(getKey("defaultAddress"), arg); + return this; + } /** - * Spain. + * The customer’s name, email or phone number. */ - ES, - /** - * Ethiopia. - */ - ET, + public String getDisplayName() { + return (String) get("displayName"); + } - /** - * Finland. - */ - FI, + public Customer setDisplayName(String arg) { + optimisticData.put(getKey("displayName"), arg); + return this; + } /** - * Fiji. + * The customer’s email address. */ - FJ, - /** - * Falkland Islands. - */ - FK, + public String getEmail() { + return (String) get("email"); + } - /** - * Faroe Islands. - */ - FO, + public Customer setEmail(String arg) { + optimisticData.put(getKey("email"), arg); + return this; + } /** - * France. + * The customer’s first name. */ - FR, - /** - * Gabon. - */ - GA, + public String getFirstName() { + return (String) get("firstName"); + } - /** - * United Kingdom. - */ - GB, + public Customer setFirstName(String arg) { + optimisticData.put(getKey("firstName"), arg); + return this; + } /** - * Grenada. + * A unique ID for the customer. */ - GD, + + public ID getId() { + return (ID) get("id"); + } + + public Customer setId(ID arg) { + optimisticData.put(getKey("id"), arg); + return this; + } /** - * Georgia. + * The customer’s last name. */ - GE, + + public String getLastName() { + return (String) get("lastName"); + } + + public Customer setLastName(String arg) { + optimisticData.put(getKey("lastName"), arg); + return this; + } /** - * French Guiana. + * Returns a metafield found by namespace and key. */ - GF, - /** - * Guernsey. - */ - GG, + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } - /** - * Ghana. - */ - GH, + public Customer setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); + return this; + } /** - * Gibraltar. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - GI, - /** - * Greenland. - */ - GL, + public List getMetafields() { + return (List) get("metafields"); + } - /** - * Gambia. - */ - GM, + public Customer setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); + return this; + } /** - * Guinea. + * The number of orders that the customer has made at the store in their lifetime. */ - GN, - /** - * Guadeloupe. - */ - GP, + public String getNumberOfOrders() { + return (String) get("numberOfOrders"); + } - /** - * Equatorial Guinea. - */ - GQ, + public Customer setNumberOfOrders(String arg) { + optimisticData.put(getKey("numberOfOrders"), arg); + return this; + } /** - * Greece. + * The orders associated with the customer. */ - GR, - /** - * South Georgia & South Sandwich Islands. - */ - GS, + public OrderConnection getOrders() { + return (OrderConnection) get("orders"); + } - /** - * Guatemala. - */ - GT, + public Customer setOrders(OrderConnection arg) { + optimisticData.put(getKey("orders"), arg); + return this; + } /** - * Guinea-Bissau. + * The customer’s phone number. */ - GW, - /** - * Guyana. - */ - GY, + public String getPhone() { + return (String) get("phone"); + } - /** - * Hong Kong SAR. - */ - HK, + public Customer setPhone(String arg) { + optimisticData.put(getKey("phone"), arg); + return this; + } /** - * Heard & McDonald Islands. + * A comma separated list of tags that have been added to the customer. + * Additional access scope required: unauthenticated_read_customer_tags. */ - HM, - /** - * Honduras. - */ - HN, + public List getTags() { + return (List) get("tags"); + } - /** - * Croatia. - */ - HR, + public Customer setTags(List arg) { + optimisticData.put(getKey("tags"), arg); + return this; + } /** - * Haiti. + * The date and time when the customer information was updated. */ - HT, - /** - * Hungary. - */ - HU, + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); + } - /** - * Indonesia. - */ - ID, + public Customer setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); + return this; + } - /** - * Ireland. - */ - IE, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "acceptsMarketing": return false; - /** - * Israel. - */ - IL, + case "addresses": return true; - /** - * Isle of Man. - */ - IM, + case "createdAt": return false; - /** - * India. - */ - IN, + case "defaultAddress": return true; - /** - * British Indian Ocean Territory. - */ - IO, + case "displayName": return false; - /** - * Iraq. - */ - IQ, + case "email": return false; - /** - * Iran. - */ - IR, + case "firstName": return false; - /** - * Iceland. - */ - IS, + case "id": return false; - /** - * Italy. - */ - IT, + case "lastName": return false; - /** - * Jersey. - */ - JE, + case "metafield": return true; - /** - * Jamaica. - */ - JM, + case "metafields": return true; - /** - * Jordan. - */ - JO, + case "numberOfOrders": return false; - /** - * Japan. - */ - JP, + case "orders": return true; - /** - * Kenya. - */ - KE, + case "phone": return false; - /** - * Kyrgyzstan. - */ - KG, + case "tags": return false; - /** - * Cambodia. - */ - KH, + case "updatedAt": return false; - /** - * Kiribati. - */ - KI, + default: return false; + } + } + } - /** - * Comoros. - */ - KM, + public interface CustomerAccessTokenQueryDefinition { + void define(CustomerAccessTokenQuery _queryBuilder); + } - /** - * St. Kitts & Nevis. - */ - KN, + /** + * A CustomerAccessToken represents the unique token required to make modifications to the customer + * object. + */ + public static class CustomerAccessTokenQuery extends Query { + CustomerAccessTokenQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * North Korea. + * The customer’s access token. */ - KP, + public CustomerAccessTokenQuery accessToken() { + startField("accessToken"); - /** - * South Korea. - */ - KR, + return this; + } /** - * Kuwait. + * The date and time when the customer access token expires. */ - KW, + public CustomerAccessTokenQuery expiresAt() { + startField("expiresAt"); - /** - * Cayman Islands. - */ - KY, + return this; + } + } - /** - * Kazakhstan. - */ - KZ, + /** + * A CustomerAccessToken represents the unique token required to make modifications to the customer + * object. + */ + public static class CustomerAccessToken extends AbstractResponse { + public CustomerAccessToken() { + } - /** - * Laos. - */ - LA, + public CustomerAccessToken(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "accessToken": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * Lebanon. - */ - LB, + break; + } - /** - * St. Lucia. - */ - LC, + case "expiresAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - /** - * Liechtenstein. - */ - LI, + break; + } - /** - * Sri Lanka. - */ - LK, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * Liberia. - */ - LR, + public String getGraphQlTypeName() { + return "CustomerAccessToken"; + } /** - * Lesotho. + * The customer’s access token. */ - LS, - /** - * Lithuania. - */ - LT, + public String getAccessToken() { + return (String) get("accessToken"); + } - /** - * Luxembourg. - */ - LU, + public CustomerAccessToken setAccessToken(String arg) { + optimisticData.put(getKey("accessToken"), arg); + return this; + } /** - * Latvia. + * The date and time when the customer access token expires. */ - LV, - /** - * Libya. - */ - LY, + public DateTime getExpiresAt() { + return (DateTime) get("expiresAt"); + } - /** - * Morocco. - */ - MA, + public CustomerAccessToken setExpiresAt(DateTime arg) { + optimisticData.put(getKey("expiresAt"), arg); + return this; + } - /** - * Monaco. - */ - MC, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "accessToken": return false; - /** - * Moldova. - */ - MD, + case "expiresAt": return false; - /** - * Montenegro. - */ - ME, + default: return false; + } + } + } - /** - * St. Martin. - */ - MF, + public static class CustomerAccessTokenCreateInput implements Serializable { + private String email; - /** - * Madagascar. - */ - MG, + private String password; - /** - * North Macedonia. - */ - MK, + public CustomerAccessTokenCreateInput(String email, String password) { + this.email = email; - /** - * Mali. - */ - ML, + this.password = password; + } - /** - * Myanmar (Burma). - */ - MM, + public String getEmail() { + return email; + } - /** - * Mongolia. - */ - MN, + public CustomerAccessTokenCreateInput setEmail(String email) { + this.email = email; + return this; + } - /** - * Macao SAR. - */ - MO, + public String getPassword() { + return password; + } - /** - * Martinique. - */ - MQ, + public CustomerAccessTokenCreateInput setPassword(String password) { + this.password = password; + return this; + } - /** - * Mauritania. - */ - MR, + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - /** - * Montserrat. - */ - MS, + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("email:"); + Query.appendQuotedString(_queryBuilder, email.toString()); - /** - * Malta. - */ - MT, + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("password:"); + Query.appendQuotedString(_queryBuilder, password.toString()); - /** - * Mauritius. - */ - MU, + _queryBuilder.append('}'); + } + } - /** - * Maldives. - */ - MV, + public interface CustomerAccessTokenCreatePayloadQueryDefinition { + void define(CustomerAccessTokenCreatePayloadQuery _queryBuilder); + } - /** - * Malawi. - */ - MW, + /** + * Return type for `customerAccessTokenCreate` mutation. + */ + public static class CustomerAccessTokenCreatePayloadQuery extends Query { + CustomerAccessTokenCreatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Mexico. + * The newly created customer access token object. */ - MX, + public CustomerAccessTokenCreatePayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { + startField("customerAccessToken"); - /** - * Malaysia. - */ - MY, + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Mozambique. - */ - MZ, + return this; + } /** - * Namibia. + * The list of errors that occurred from executing the mutation. */ - NA, + public CustomerAccessTokenCreatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - /** - * New Caledonia. - */ - NC, + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Niger. - */ - NE, + return this; + } /** - * Norfolk Island. - */ - NF, - - /** - * Nigeria. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. */ - NG, + @Deprecated + public CustomerAccessTokenCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - /** - * Nicaragua. - */ - NI, + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Netherlands. - */ - NL, + return this; + } + } - /** - * Norway. - */ - NO, + /** + * Return type for `customerAccessTokenCreate` mutation. + */ + public static class CustomerAccessTokenCreatePayload extends AbstractResponse { + public CustomerAccessTokenCreatePayload() { + } - /** - * Nepal. - */ - NP, + public CustomerAccessTokenCreatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customerAccessToken": { + CustomerAccessToken optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + } - /** - * Nauru. - */ - NR, + responseData.put(key, optional1); - /** - * Niue. - */ - NU, + break; + } - /** - * New Zealand. - */ - NZ, + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - /** - * Oman. - */ - OM, + responseData.put(key, list1); - /** - * Panama. - */ - PA, + break; + } - /** - * Peru. - */ - PE, + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - /** - * French Polynesia. - */ - PF, + responseData.put(key, list1); - /** - * Papua New Guinea. - */ - PG, + break; + } - /** - * Philippines. - */ - PH, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * Pakistan. - */ - PK, + public String getGraphQlTypeName() { + return "CustomerAccessTokenCreatePayload"; + } /** - * Poland. + * The newly created customer access token object. */ - PL, - /** - * St. Pierre & Miquelon. - */ - PM, + public CustomerAccessToken getCustomerAccessToken() { + return (CustomerAccessToken) get("customerAccessToken"); + } - /** - * Pitcairn Islands. - */ - PN, + public CustomerAccessTokenCreatePayload setCustomerAccessToken(CustomerAccessToken arg) { + optimisticData.put(getKey("customerAccessToken"), arg); + return this; + } /** - * Palestinian Territories. + * The list of errors that occurred from executing the mutation. */ - PS, - /** - * Portugal. - */ - PT, + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - /** - * Paraguay. - */ - PY, + public CustomerAccessTokenCreatePayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } /** - * Qatar. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. */ - QA, - /** - * Réunion. - */ - RE, + public List getUserErrors() { + return (List) get("userErrors"); + } - /** - * Romania. - */ - RO, + public CustomerAccessTokenCreatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - /** - * Serbia. - */ - RS, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customerAccessToken": return true; - /** - * Russia. - */ - RU, + case "customerUserErrors": return true; - /** - * Rwanda. - */ - RW, + case "userErrors": return true; - /** - * Saudi Arabia. - */ - SA, + default: return false; + } + } + } - /** - * Solomon Islands. - */ - SB, + public interface CustomerAccessTokenCreateWithMultipassPayloadQueryDefinition { + void define(CustomerAccessTokenCreateWithMultipassPayloadQuery _queryBuilder); + } - /** - * Seychelles. - */ - SC, + /** + * Return type for `customerAccessTokenCreateWithMultipass` mutation. + */ + public static class CustomerAccessTokenCreateWithMultipassPayloadQuery extends Query { + CustomerAccessTokenCreateWithMultipassPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Sudan. + * An access token object associated with the customer. */ - SD, + public CustomerAccessTokenCreateWithMultipassPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { + startField("customerAccessToken"); - /** - * Sweden. - */ - SE, + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Singapore. - */ - SG, + return this; + } /** - * St. Helena. + * The list of errors that occurred from executing the mutation. */ - SH, + public CustomerAccessTokenCreateWithMultipassPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - /** - * Slovenia. - */ - SI, + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Svalbard & Jan Mayen. - */ - SJ, + return this; + } + } - /** - * Slovakia. - */ - SK, + /** + * Return type for `customerAccessTokenCreateWithMultipass` mutation. + */ + public static class CustomerAccessTokenCreateWithMultipassPayload extends AbstractResponse { + public CustomerAccessTokenCreateWithMultipassPayload() { + } - /** - * Sierra Leone. - */ - SL, + public CustomerAccessTokenCreateWithMultipassPayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customerAccessToken": { + CustomerAccessToken optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + } - /** - * San Marino. - */ - SM, + responseData.put(key, optional1); - /** - * Senegal. - */ - SN, + break; + } - /** - * Somalia. - */ - SO, + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - /** - * Suriname. - */ - SR, + responseData.put(key, list1); - /** - * South Sudan. - */ - SS, + break; + } - /** - * São Tomé & Príncipe. - */ - ST, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * El Salvador. - */ - SV, + public String getGraphQlTypeName() { + return "CustomerAccessTokenCreateWithMultipassPayload"; + } /** - * Sint Maarten. + * An access token object associated with the customer. */ - SX, - /** - * Syria. - */ - SY, + public CustomerAccessToken getCustomerAccessToken() { + return (CustomerAccessToken) get("customerAccessToken"); + } - /** - * Eswatini. - */ - SZ, + public CustomerAccessTokenCreateWithMultipassPayload setCustomerAccessToken(CustomerAccessToken arg) { + optimisticData.put(getKey("customerAccessToken"), arg); + return this; + } /** - * Tristan da Cunha. + * The list of errors that occurred from executing the mutation. */ - TA, - /** - * Turks & Caicos Islands. - */ - TC, + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - /** - * Chad. - */ - TD, + public CustomerAccessTokenCreateWithMultipassPayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - /** - * French Southern Territories. - */ - TF, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customerAccessToken": return true; - /** - * Togo. - */ - TG, + case "customerUserErrors": return true; - /** - * Thailand. - */ - TH, + default: return false; + } + } + } - /** - * Tajikistan. - */ - TJ, + public interface CustomerAccessTokenDeletePayloadQueryDefinition { + void define(CustomerAccessTokenDeletePayloadQuery _queryBuilder); + } - /** - * Tokelau. - */ - TK, + /** + * Return type for `customerAccessTokenDelete` mutation. + */ + public static class CustomerAccessTokenDeletePayloadQuery extends Query { + CustomerAccessTokenDeletePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Timor-Leste. + * The destroyed access token. */ - TL, + public CustomerAccessTokenDeletePayloadQuery deletedAccessToken() { + startField("deletedAccessToken"); - /** - * Turkmenistan. - */ - TM, + return this; + } /** - * Tunisia. + * ID of the destroyed customer access token. */ - TN, + public CustomerAccessTokenDeletePayloadQuery deletedCustomerAccessTokenId() { + startField("deletedCustomerAccessTokenId"); - /** - * Tonga. - */ - TO, + return this; + } /** - * Türkiye. + * The list of errors that occurred from executing the mutation. */ - TR, + public CustomerAccessTokenDeletePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - /** - * Trinidad & Tobago. - */ - TT, + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Tuvalu. - */ - TV, + return this; + } + } - /** - * Taiwan. - */ - TW, + /** + * Return type for `customerAccessTokenDelete` mutation. + */ + public static class CustomerAccessTokenDeletePayload extends AbstractResponse { + public CustomerAccessTokenDeletePayload() { + } - /** - * Tanzania. - */ - TZ, + public CustomerAccessTokenDeletePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "deletedAccessToken": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - /** - * Ukraine. - */ - UA, + responseData.put(key, optional1); - /** - * Uganda. - */ - UG, + break; + } - /** - * U.S. Outlying Islands. - */ - UM, + case "deletedCustomerAccessTokenId": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - /** - * United States. - */ - US, + responseData.put(key, optional1); - /** - * Uruguay. - */ - UY, + break; + } - /** - * Uzbekistan. - */ - UZ, + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - /** - * Vatican City. - */ - VA, + responseData.put(key, list1); - /** - * St. Vincent & Grenadines. - */ - VC, + break; + } - /** - * Venezuela. - */ - VE, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * British Virgin Islands. - */ - VG, + public String getGraphQlTypeName() { + return "CustomerAccessTokenDeletePayload"; + } /** - * Vietnam. + * The destroyed access token. */ - VN, - /** - * Vanuatu. - */ - VU, + public String getDeletedAccessToken() { + return (String) get("deletedAccessToken"); + } - /** - * Wallis & Futuna. - */ - WF, + public CustomerAccessTokenDeletePayload setDeletedAccessToken(String arg) { + optimisticData.put(getKey("deletedAccessToken"), arg); + return this; + } /** - * Samoa. + * ID of the destroyed customer access token. */ - WS, - /** - * Kosovo. - */ - XK, + public String getDeletedCustomerAccessTokenId() { + return (String) get("deletedCustomerAccessTokenId"); + } - /** - * Yemen. - */ - YE, + public CustomerAccessTokenDeletePayload setDeletedCustomerAccessTokenId(String arg) { + optimisticData.put(getKey("deletedCustomerAccessTokenId"), arg); + return this; + } /** - * Mayotte. + * The list of errors that occurred from executing the mutation. */ - YT, - /** - * South Africa. - */ - ZA, + public List getUserErrors() { + return (List) get("userErrors"); + } - /** - * Zambia. - */ - ZM, + public CustomerAccessTokenDeletePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - /** - * Zimbabwe. - */ - ZW, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "deletedAccessToken": return false; - /** - * Unknown Region. - */ - ZZ, + case "deletedCustomerAccessTokenId": return false; - UNKNOWN_VALUE; + case "userErrors": return true; - public static CountryCode fromGraphQl(String value) { - if (value == null) { - return null; + default: return false; } + } + } - switch (value) { - case "AC": { - return AC; - } + public interface CustomerAccessTokenRenewPayloadQueryDefinition { + void define(CustomerAccessTokenRenewPayloadQuery _queryBuilder); + } - case "AD": { - return AD; - } + /** + * Return type for `customerAccessTokenRenew` mutation. + */ + public static class CustomerAccessTokenRenewPayloadQuery extends Query { + CustomerAccessTokenRenewPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "AE": { - return AE; - } + /** + * The renewed customer access token object. + */ + public CustomerAccessTokenRenewPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { + startField("customerAccessToken"); - case "AF": { - return AF; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "AG": { - return AG; - } + return this; + } - case "AI": { - return AI; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerAccessTokenRenewPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case "AL": { - return AL; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "AM": { - return AM; - } + return this; + } + } - case "AN": { - return AN; - } + /** + * Return type for `customerAccessTokenRenew` mutation. + */ + public static class CustomerAccessTokenRenewPayload extends AbstractResponse { + public CustomerAccessTokenRenewPayload() { + } - case "AO": { - return AO; - } + public CustomerAccessTokenRenewPayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customerAccessToken": { + CustomerAccessToken optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + } - case "AR": { - return AR; - } + responseData.put(key, optional1); - case "AT": { - return AT; - } + break; + } - case "AU": { - return AU; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case "AW": { - return AW; - } + responseData.put(key, list1); - case "AX": { - return AX; - } + break; + } - case "AZ": { - return AZ; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "BA": { - return BA; - } + public String getGraphQlTypeName() { + return "CustomerAccessTokenRenewPayload"; + } - case "BB": { - return BB; - } + /** + * The renewed customer access token object. + */ - case "BD": { - return BD; - } + public CustomerAccessToken getCustomerAccessToken() { + return (CustomerAccessToken) get("customerAccessToken"); + } - case "BE": { - return BE; - } + public CustomerAccessTokenRenewPayload setCustomerAccessToken(CustomerAccessToken arg) { + optimisticData.put(getKey("customerAccessToken"), arg); + return this; + } - case "BF": { - return BF; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case "BG": { - return BG; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case "BH": { - return BH; - } + public CustomerAccessTokenRenewPayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case "BI": { - return BI; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customerAccessToken": return true; - case "BJ": { - return BJ; - } + case "userErrors": return true; - case "BL": { - return BL; - } + default: return false; + } + } + } - case "BM": { - return BM; - } + public interface CustomerActivateByUrlPayloadQueryDefinition { + void define(CustomerActivateByUrlPayloadQuery _queryBuilder); + } - case "BN": { - return BN; - } + /** + * Return type for `customerActivateByUrl` mutation. + */ + public static class CustomerActivateByUrlPayloadQuery extends Query { + CustomerActivateByUrlPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "BO": { - return BO; - } + /** + * The customer that was activated. + */ + public CustomerActivateByUrlPayloadQuery customer(CustomerQueryDefinition queryDef) { + startField("customer"); - case "BQ": { - return BQ; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "BR": { - return BR; - } + return this; + } - case "BS": { - return BS; - } + /** + * A new customer access token for the customer. + */ + public CustomerActivateByUrlPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { + startField("customerAccessToken"); - case "BT": { - return BT; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "BV": { - return BV; - } + return this; + } - case "BW": { - return BW; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerActivateByUrlPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - case "BY": { - return BY; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "BZ": { - return BZ; - } + return this; + } + } - case "CA": { - return CA; - } + /** + * Return type for `customerActivateByUrl` mutation. + */ + public static class CustomerActivateByUrlPayload extends AbstractResponse { + public CustomerActivateByUrlPayload() { + } - case "CC": { - return CC; - } + public CustomerActivateByUrlPayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customer": { + Customer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Customer(jsonAsObject(field.getValue(), key)); + } - case "CD": { - return CD; - } + responseData.put(key, optional1); - case "CF": { - return CF; - } + break; + } - case "CG": { - return CG; - } + case "customerAccessToken": { + CustomerAccessToken optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + } - case "CH": { - return CH; - } + responseData.put(key, optional1); - case "CI": { - return CI; - } + break; + } - case "CK": { - return CK; - } + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - case "CL": { - return CL; - } + responseData.put(key, list1); - case "CM": { - return CM; - } + break; + } - case "CN": { - return CN; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "CO": { - return CO; - } + public String getGraphQlTypeName() { + return "CustomerActivateByUrlPayload"; + } - case "CR": { - return CR; - } + /** + * The customer that was activated. + */ - case "CU": { - return CU; - } + public Customer getCustomer() { + return (Customer) get("customer"); + } - case "CV": { - return CV; - } + public CustomerActivateByUrlPayload setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); + return this; + } - case "CW": { - return CW; - } + /** + * A new customer access token for the customer. + */ - case "CX": { - return CX; - } + public CustomerAccessToken getCustomerAccessToken() { + return (CustomerAccessToken) get("customerAccessToken"); + } - case "CY": { - return CY; - } + public CustomerActivateByUrlPayload setCustomerAccessToken(CustomerAccessToken arg) { + optimisticData.put(getKey("customerAccessToken"), arg); + return this; + } - case "CZ": { - return CZ; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case "DE": { - return DE; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - case "DJ": { - return DJ; - } + public CustomerActivateByUrlPayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - case "DK": { - return DK; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customer": return true; - case "DM": { - return DM; - } + case "customerAccessToken": return true; - case "DO": { - return DO; - } + case "customerUserErrors": return true; - case "DZ": { - return DZ; - } + default: return false; + } + } + } - case "EC": { - return EC; - } + public static class CustomerActivateInput implements Serializable { + private String activationToken; - case "EE": { - return EE; - } + private String password; - case "EG": { - return EG; - } + public CustomerActivateInput(String activationToken, String password) { + this.activationToken = activationToken; - case "EH": { - return EH; - } + this.password = password; + } - case "ER": { - return ER; - } + public String getActivationToken() { + return activationToken; + } - case "ES": { - return ES; - } + public CustomerActivateInput setActivationToken(String activationToken) { + this.activationToken = activationToken; + return this; + } - case "ET": { - return ET; - } + public String getPassword() { + return password; + } - case "FI": { - return FI; - } + public CustomerActivateInput setPassword(String password) { + this.password = password; + return this; + } - case "FJ": { - return FJ; - } + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - case "FK": { - return FK; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("activationToken:"); + Query.appendQuotedString(_queryBuilder, activationToken.toString()); - case "FO": { - return FO; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("password:"); + Query.appendQuotedString(_queryBuilder, password.toString()); - case "FR": { - return FR; - } + _queryBuilder.append('}'); + } + } - case "GA": { - return GA; - } + public interface CustomerActivatePayloadQueryDefinition { + void define(CustomerActivatePayloadQuery _queryBuilder); + } - case "GB": { - return GB; - } + /** + * Return type for `customerActivate` mutation. + */ + public static class CustomerActivatePayloadQuery extends Query { + CustomerActivatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "GD": { - return GD; - } + /** + * The customer object. + */ + public CustomerActivatePayloadQuery customer(CustomerQueryDefinition queryDef) { + startField("customer"); - case "GE": { - return GE; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "GF": { - return GF; - } + return this; + } - case "GG": { - return GG; - } + /** + * A newly created customer access token object for the customer. + */ + public CustomerActivatePayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { + startField("customerAccessToken"); - case "GH": { - return GH; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "GI": { - return GI; - } + return this; + } - case "GL": { - return GL; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerActivatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - case "GM": { - return GM; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "GN": { - return GN; - } + return this; + } - case "GP": { - return GP; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ + @Deprecated + public CustomerActivatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case "GQ": { - return GQ; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "GR": { - return GR; - } + return this; + } + } - case "GS": { - return GS; - } + /** + * Return type for `customerActivate` mutation. + */ + public static class CustomerActivatePayload extends AbstractResponse { + public CustomerActivatePayload() { + } - case "GT": { - return GT; - } + public CustomerActivatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customer": { + Customer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Customer(jsonAsObject(field.getValue(), key)); + } - case "GW": { - return GW; - } + responseData.put(key, optional1); - case "GY": { - return GY; - } + break; + } - case "HK": { - return HK; - } + case "customerAccessToken": { + CustomerAccessToken optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + } - case "HM": { - return HM; - } + responseData.put(key, optional1); - case "HN": { - return HN; - } + break; + } - case "HR": { - return HR; - } + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - case "HT": { - return HT; - } + responseData.put(key, list1); - case "HU": { - return HU; - } + break; + } - case "ID": { - return ID; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case "IE": { - return IE; - } + responseData.put(key, list1); - case "IL": { - return IL; - } + break; + } - case "IM": { - return IM; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "IN": { - return IN; - } + public String getGraphQlTypeName() { + return "CustomerActivatePayload"; + } - case "IO": { - return IO; - } + /** + * The customer object. + */ - case "IQ": { - return IQ; - } + public Customer getCustomer() { + return (Customer) get("customer"); + } - case "IR": { - return IR; - } + public CustomerActivatePayload setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); + return this; + } - case "IS": { - return IS; - } + /** + * A newly created customer access token object for the customer. + */ - case "IT": { - return IT; - } + public CustomerAccessToken getCustomerAccessToken() { + return (CustomerAccessToken) get("customerAccessToken"); + } - case "JE": { - return JE; - } + public CustomerActivatePayload setCustomerAccessToken(CustomerAccessToken arg) { + optimisticData.put(getKey("customerAccessToken"), arg); + return this; + } - case "JM": { - return JM; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case "JO": { - return JO; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - case "JP": { - return JP; - } + public CustomerActivatePayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - case "KE": { - return KE; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ - case "KG": { - return KG; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case "KH": { - return KH; - } + public CustomerActivatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case "KI": { - return KI; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customer": return true; - case "KM": { - return KM; - } + case "customerAccessToken": return true; - case "KN": { - return KN; - } + case "customerUserErrors": return true; - case "KP": { - return KP; - } + case "userErrors": return true; - case "KR": { - return KR; - } + default: return false; + } + } + } - case "KW": { - return KW; - } + public interface CustomerAddressCreatePayloadQueryDefinition { + void define(CustomerAddressCreatePayloadQuery _queryBuilder); + } - case "KY": { - return KY; - } + /** + * Return type for `customerAddressCreate` mutation. + */ + public static class CustomerAddressCreatePayloadQuery extends Query { + CustomerAddressCreatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "KZ": { - return KZ; - } + /** + * The new customer address object. + */ + public CustomerAddressCreatePayloadQuery customerAddress(MailingAddressQueryDefinition queryDef) { + startField("customerAddress"); - case "LA": { - return LA; - } + _queryBuilder.append('{'); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "LB": { - return LB; - } + return this; + } - case "LC": { - return LC; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerAddressCreatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - case "LI": { - return LI; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "LK": { - return LK; - } + return this; + } - case "LR": { - return LR; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ + @Deprecated + public CustomerAddressCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case "LS": { - return LS; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "LT": { - return LT; - } + return this; + } + } - case "LU": { - return LU; - } + /** + * Return type for `customerAddressCreate` mutation. + */ + public static class CustomerAddressCreatePayload extends AbstractResponse { + public CustomerAddressCreatePayload() { + } - case "LV": { - return LV; - } + public CustomerAddressCreatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customerAddress": { + MailingAddress optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); + } - case "LY": { - return LY; - } + responseData.put(key, optional1); - case "MA": { - return MA; - } + break; + } - case "MC": { - return MC; - } + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - case "MD": { - return MD; - } + responseData.put(key, list1); - case "ME": { - return ME; - } + break; + } - case "MF": { - return MF; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case "MG": { - return MG; - } + responseData.put(key, list1); - case "MK": { - return MK; - } + break; + } - case "ML": { - return ML; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "MM": { - return MM; - } + public String getGraphQlTypeName() { + return "CustomerAddressCreatePayload"; + } - case "MN": { - return MN; - } + /** + * The new customer address object. + */ - case "MO": { - return MO; - } + public MailingAddress getCustomerAddress() { + return (MailingAddress) get("customerAddress"); + } - case "MQ": { - return MQ; - } + public CustomerAddressCreatePayload setCustomerAddress(MailingAddress arg) { + optimisticData.put(getKey("customerAddress"), arg); + return this; + } - case "MR": { - return MR; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case "MS": { - return MS; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - case "MT": { - return MT; - } + public CustomerAddressCreatePayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - case "MU": { - return MU; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ - case "MV": { - return MV; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case "MW": { - return MW; - } + public CustomerAddressCreatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case "MX": { - return MX; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customerAddress": return true; - case "MY": { - return MY; - } + case "customerUserErrors": return true; - case "MZ": { - return MZ; - } + case "userErrors": return true; - case "NA": { - return NA; - } + default: return false; + } + } + } - case "NC": { - return NC; - } + public interface CustomerAddressDeletePayloadQueryDefinition { + void define(CustomerAddressDeletePayloadQuery _queryBuilder); + } - case "NE": { - return NE; - } + /** + * Return type for `customerAddressDelete` mutation. + */ + public static class CustomerAddressDeletePayloadQuery extends Query { + CustomerAddressDeletePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "NF": { - return NF; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerAddressDeletePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - case "NG": { - return NG; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "NI": { - return NI; - } + return this; + } - case "NL": { - return NL; - } + /** + * ID of the deleted customer address. + */ + public CustomerAddressDeletePayloadQuery deletedCustomerAddressId() { + startField("deletedCustomerAddressId"); - case "NO": { - return NO; - } + return this; + } - case "NP": { - return NP; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ + @Deprecated + public CustomerAddressDeletePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case "NR": { - return NR; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "NU": { - return NU; - } + return this; + } + } - case "NZ": { - return NZ; - } + /** + * Return type for `customerAddressDelete` mutation. + */ + public static class CustomerAddressDeletePayload extends AbstractResponse { + public CustomerAddressDeletePayload() { + } - case "OM": { - return OM; - } + public CustomerAddressDeletePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - case "PA": { - return PA; - } + responseData.put(key, list1); - case "PE": { - return PE; - } + break; + } - case "PF": { - return PF; - } + case "deletedCustomerAddressId": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "PG": { - return PG; - } + responseData.put(key, optional1); - case "PH": { - return PH; - } + break; + } - case "PK": { - return PK; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case "PL": { - return PL; - } + responseData.put(key, list1); - case "PM": { - return PM; - } + break; + } - case "PN": { - return PN; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "PS": { - return PS; - } + public String getGraphQlTypeName() { + return "CustomerAddressDeletePayload"; + } - case "PT": { - return PT; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case "PY": { - return PY; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - case "QA": { - return QA; - } + public CustomerAddressDeletePayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - case "RE": { - return RE; - } + /** + * ID of the deleted customer address. + */ - case "RO": { - return RO; - } + public String getDeletedCustomerAddressId() { + return (String) get("deletedCustomerAddressId"); + } - case "RS": { - return RS; - } + public CustomerAddressDeletePayload setDeletedCustomerAddressId(String arg) { + optimisticData.put(getKey("deletedCustomerAddressId"), arg); + return this; + } - case "RU": { - return RU; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ - case "RW": { - return RW; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case "SA": { - return SA; - } + public CustomerAddressDeletePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case "SB": { - return SB; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customerUserErrors": return true; - case "SC": { - return SC; - } + case "deletedCustomerAddressId": return false; - case "SD": { - return SD; - } + case "userErrors": return true; - case "SE": { - return SE; - } + default: return false; + } + } + } - case "SG": { - return SG; - } + public interface CustomerAddressUpdatePayloadQueryDefinition { + void define(CustomerAddressUpdatePayloadQuery _queryBuilder); + } - case "SH": { - return SH; - } + /** + * Return type for `customerAddressUpdate` mutation. + */ + public static class CustomerAddressUpdatePayloadQuery extends Query { + CustomerAddressUpdatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "SI": { - return SI; - } + /** + * The customer’s updated mailing address. + */ + public CustomerAddressUpdatePayloadQuery customerAddress(MailingAddressQueryDefinition queryDef) { + startField("customerAddress"); - case "SJ": { - return SJ; - } + _queryBuilder.append('{'); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "SK": { - return SK; - } + return this; + } - case "SL": { - return SL; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerAddressUpdatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - case "SM": { - return SM; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "SN": { - return SN; - } + return this; + } - case "SO": { - return SO; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ + @Deprecated + public CustomerAddressUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case "SR": { - return SR; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "SS": { - return SS; - } + return this; + } + } - case "ST": { - return ST; - } + /** + * Return type for `customerAddressUpdate` mutation. + */ + public static class CustomerAddressUpdatePayload extends AbstractResponse { + public CustomerAddressUpdatePayload() { + } - case "SV": { - return SV; - } + public CustomerAddressUpdatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customerAddress": { + MailingAddress optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); + } - case "SX": { - return SX; - } + responseData.put(key, optional1); - case "SY": { - return SY; - } + break; + } - case "SZ": { - return SZ; - } + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - case "TA": { - return TA; - } + responseData.put(key, list1); - case "TC": { - return TC; - } + break; + } - case "TD": { - return TD; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case "TF": { - return TF; - } + responseData.put(key, list1); - case "TG": { - return TG; - } + break; + } - case "TH": { - return TH; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "TJ": { - return TJ; - } + public String getGraphQlTypeName() { + return "CustomerAddressUpdatePayload"; + } - case "TK": { - return TK; - } + /** + * The customer’s updated mailing address. + */ - case "TL": { - return TL; - } + public MailingAddress getCustomerAddress() { + return (MailingAddress) get("customerAddress"); + } - case "TM": { - return TM; - } + public CustomerAddressUpdatePayload setCustomerAddress(MailingAddress arg) { + optimisticData.put(getKey("customerAddress"), arg); + return this; + } - case "TN": { - return TN; - } - - case "TO": { - return TO; - } - - case "TR": { - return TR; - } - - case "TT": { - return TT; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case "TV": { - return TV; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - case "TW": { - return TW; - } + public CustomerAddressUpdatePayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - case "TZ": { - return TZ; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ - case "UA": { - return UA; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case "UG": { - return UG; - } + public CustomerAddressUpdatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case "UM": { - return UM; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customerAddress": return true; - case "US": { - return US; - } + case "customerUserErrors": return true; - case "UY": { - return UY; - } + case "userErrors": return true; - case "UZ": { - return UZ; - } + default: return false; + } + } + } - case "VA": { - return VA; - } + public static class CustomerCreateInput implements Serializable { + private String email; - case "VC": { - return VC; - } + private String password; - case "VE": { - return VE; - } + private Input firstName = Input.undefined(); - case "VG": { - return VG; - } + private Input lastName = Input.undefined(); - case "VN": { - return VN; - } + private Input phone = Input.undefined(); - case "VU": { - return VU; - } + private Input acceptsMarketing = Input.undefined(); - case "WF": { - return WF; - } + public CustomerCreateInput(String email, String password) { + this.email = email; - case "WS": { - return WS; - } + this.password = password; + } - case "XK": { - return XK; - } + public String getEmail() { + return email; + } - case "YE": { - return YE; - } + public CustomerCreateInput setEmail(String email) { + this.email = email; + return this; + } - case "YT": { - return YT; - } + public String getPassword() { + return password; + } - case "ZA": { - return ZA; - } + public CustomerCreateInput setPassword(String password) { + this.password = password; + return this; + } - case "ZM": { - return ZM; - } + public String getFirstName() { + return firstName.getValue(); + } - case "ZW": { - return ZW; - } + public Input getFirstNameInput() { + return firstName; + } - case "ZZ": { - return ZZ; - } + public CustomerCreateInput setFirstName(String firstName) { + this.firstName = Input.optional(firstName); + return this; + } - default: { - return UNKNOWN_VALUE; - } + public CustomerCreateInput setFirstNameInput(Input firstName) { + if (firstName == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.firstName = firstName; + return this; } - public String toString() { - switch (this) { - case AC: { - return "AC"; - } - case AD: { - return "AD"; - } + public String getLastName() { + return lastName.getValue(); + } - case AE: { - return "AE"; - } + public Input getLastNameInput() { + return lastName; + } - case AF: { - return "AF"; - } + public CustomerCreateInput setLastName(String lastName) { + this.lastName = Input.optional(lastName); + return this; + } - case AG: { - return "AG"; - } + public CustomerCreateInput setLastNameInput(Input lastName) { + if (lastName == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.lastName = lastName; + return this; + } - case AI: { - return "AI"; - } + public String getPhone() { + return phone.getValue(); + } - case AL: { - return "AL"; - } + public Input getPhoneInput() { + return phone; + } - case AM: { - return "AM"; - } + public CustomerCreateInput setPhone(String phone) { + this.phone = Input.optional(phone); + return this; + } - case AN: { - return "AN"; - } + public CustomerCreateInput setPhoneInput(Input phone) { + if (phone == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.phone = phone; + return this; + } - case AO: { - return "AO"; - } + public Boolean getAcceptsMarketing() { + return acceptsMarketing.getValue(); + } - case AR: { - return "AR"; - } + public Input getAcceptsMarketingInput() { + return acceptsMarketing; + } - case AT: { - return "AT"; - } + public CustomerCreateInput setAcceptsMarketing(Boolean acceptsMarketing) { + this.acceptsMarketing = Input.optional(acceptsMarketing); + return this; + } - case AU: { - return "AU"; - } + public CustomerCreateInput setAcceptsMarketingInput(Input acceptsMarketing) { + if (acceptsMarketing == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.acceptsMarketing = acceptsMarketing; + return this; + } - case AW: { - return "AW"; - } + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - case AX: { - return "AX"; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("email:"); + Query.appendQuotedString(_queryBuilder, email.toString()); - case AZ: { - return "AZ"; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("password:"); + Query.appendQuotedString(_queryBuilder, password.toString()); - case BA: { - return "BA"; + if (this.firstName.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("firstName:"); + if (firstName.getValue() != null) { + Query.appendQuotedString(_queryBuilder, firstName.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - case BB: { - return "BB"; + if (this.lastName.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("lastName:"); + if (lastName.getValue() != null) { + Query.appendQuotedString(_queryBuilder, lastName.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - case BD: { - return "BD"; + if (this.phone.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("phone:"); + if (phone.getValue() != null) { + Query.appendQuotedString(_queryBuilder, phone.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - case BE: { - return "BE"; + if (this.acceptsMarketing.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("acceptsMarketing:"); + if (acceptsMarketing.getValue() != null) { + _queryBuilder.append(acceptsMarketing.getValue()); + } else { + _queryBuilder.append("null"); } + } - case BF: { - return "BF"; - } + _queryBuilder.append('}'); + } + } - case BG: { - return "BG"; - } + public interface CustomerCreatePayloadQueryDefinition { + void define(CustomerCreatePayloadQuery _queryBuilder); + } - case BH: { - return "BH"; - } + /** + * Return type for `customerCreate` mutation. + */ + public static class CustomerCreatePayloadQuery extends Query { + CustomerCreatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case BI: { - return "BI"; - } + /** + * The created customer object. + */ + public CustomerCreatePayloadQuery customer(CustomerQueryDefinition queryDef) { + startField("customer"); - case BJ: { - return "BJ"; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); - case BL: { - return "BL"; - } + return this; + } - case BM: { - return "BM"; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerCreatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - case BN: { - return "BN"; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case BO: { - return "BO"; - } + return this; + } - case BQ: { - return "BQ"; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ + @Deprecated + public CustomerCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case BR: { - return "BR"; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case BS: { - return "BS"; - } + return this; + } + } - case BT: { - return "BT"; - } + /** + * Return type for `customerCreate` mutation. + */ + public static class CustomerCreatePayload extends AbstractResponse { + public CustomerCreatePayload() { + } - case BV: { - return "BV"; - } + public CustomerCreatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customer": { + Customer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Customer(jsonAsObject(field.getValue(), key)); + } - case BW: { - return "BW"; - } + responseData.put(key, optional1); - case BY: { - return "BY"; - } + break; + } - case BZ: { - return "BZ"; - } + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - case CA: { - return "CA"; - } + responseData.put(key, list1); - case CC: { - return "CC"; - } + break; + } - case CD: { - return "CD"; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case CF: { - return "CF"; - } + responseData.put(key, list1); - case CG: { - return "CG"; - } + break; + } - case CH: { - return "CH"; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case CI: { - return "CI"; - } + public String getGraphQlTypeName() { + return "CustomerCreatePayload"; + } - case CK: { - return "CK"; - } + /** + * The created customer object. + */ - case CL: { - return "CL"; - } + public Customer getCustomer() { + return (Customer) get("customer"); + } - case CM: { - return "CM"; - } + public CustomerCreatePayload setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); + return this; + } - case CN: { - return "CN"; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case CO: { - return "CO"; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - case CR: { - return "CR"; - } + public CustomerCreatePayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - case CU: { - return "CU"; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ - case CV: { - return "CV"; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case CW: { - return "CW"; - } + public CustomerCreatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case CX: { - return "CX"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customer": return true; - case CY: { - return "CY"; - } + case "customerUserErrors": return true; - case CZ: { - return "CZ"; - } + case "userErrors": return true; - case DE: { - return "DE"; - } + default: return false; + } + } + } - case DJ: { - return "DJ"; - } + public interface CustomerDefaultAddressUpdatePayloadQueryDefinition { + void define(CustomerDefaultAddressUpdatePayloadQuery _queryBuilder); + } - case DK: { - return "DK"; - } + /** + * Return type for `customerDefaultAddressUpdate` mutation. + */ + public static class CustomerDefaultAddressUpdatePayloadQuery extends Query { + CustomerDefaultAddressUpdatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case DM: { - return "DM"; - } + /** + * The updated customer object. + */ + public CustomerDefaultAddressUpdatePayloadQuery customer(CustomerQueryDefinition queryDef) { + startField("customer"); - case DO: { - return "DO"; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); - case DZ: { - return "DZ"; - } + return this; + } - case EC: { - return "EC"; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerDefaultAddressUpdatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - case EE: { - return "EE"; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case EG: { - return "EG"; - } + return this; + } - case EH: { - return "EH"; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ + @Deprecated + public CustomerDefaultAddressUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case ER: { - return "ER"; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case ES: { - return "ES"; - } + return this; + } + } - case ET: { - return "ET"; - } + /** + * Return type for `customerDefaultAddressUpdate` mutation. + */ + public static class CustomerDefaultAddressUpdatePayload extends AbstractResponse { + public CustomerDefaultAddressUpdatePayload() { + } - case FI: { - return "FI"; - } + public CustomerDefaultAddressUpdatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customer": { + Customer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Customer(jsonAsObject(field.getValue(), key)); + } - case FJ: { - return "FJ"; - } + responseData.put(key, optional1); - case FK: { - return "FK"; - } + break; + } - case FO: { - return "FO"; - } + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - case FR: { - return "FR"; - } + responseData.put(key, list1); - case GA: { - return "GA"; - } + break; + } - case GB: { - return "GB"; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case GD: { - return "GD"; - } + responseData.put(key, list1); - case GE: { - return "GE"; - } + break; + } - case GF: { - return "GF"; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case GG: { - return "GG"; - } + public String getGraphQlTypeName() { + return "CustomerDefaultAddressUpdatePayload"; + } - case GH: { - return "GH"; - } + /** + * The updated customer object. + */ - case GI: { - return "GI"; - } + public Customer getCustomer() { + return (Customer) get("customer"); + } - case GL: { - return "GL"; - } + public CustomerDefaultAddressUpdatePayload setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); + return this; + } - case GM: { - return "GM"; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case GN: { - return "GN"; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - case GP: { - return "GP"; - } + public CustomerDefaultAddressUpdatePayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - case GQ: { - return "GQ"; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ - case GR: { - return "GR"; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case GS: { - return "GS"; - } + public CustomerDefaultAddressUpdatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case GT: { - return "GT"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customer": return true; - case GW: { - return "GW"; - } + case "customerUserErrors": return true; - case GY: { - return "GY"; - } + case "userErrors": return true; - case HK: { - return "HK"; - } + default: return false; + } + } + } - case HM: { - return "HM"; - } + /** + * Possible error codes that can be returned by `CustomerUserError`. + */ + public enum CustomerErrorCode { + /** + * Customer already enabled. + */ + ALREADY_ENABLED, - case HN: { - return "HN"; - } + /** + * Input email contains an invalid domain name. + */ + BAD_DOMAIN, - case HR: { - return "HR"; - } + /** + * The input value is blank. + */ + BLANK, - case HT: { - return "HT"; - } + /** + * Input contains HTML tags. + */ + CONTAINS_HTML_TAGS, - case HU: { - return "HU"; - } + /** + * Input contains URL. + */ + CONTAINS_URL, - case ID: { - return "ID"; - } + /** + * Customer is disabled. + */ + CUSTOMER_DISABLED, - case IE: { - return "IE"; - } + /** + * The input value is invalid. + */ + INVALID, - case IL: { - return "IL"; - } + /** + * Multipass token is not valid. + */ + INVALID_MULTIPASS_REQUEST, - case IM: { - return "IM"; - } + /** + * Address does not exist. + */ + NOT_FOUND, - case IN: { - return "IN"; - } + /** + * Input password starts or ends with whitespace. + */ + PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE, - case IO: { - return "IO"; - } + /** + * The input value is already taken. + */ + TAKEN, - case IQ: { - return "IQ"; - } + /** + * Invalid activation token. + */ + TOKEN_INVALID, - case IR: { - return "IR"; - } + /** + * The input value is too long. + */ + TOO_LONG, - case IS: { - return "IS"; - } + /** + * The input value is too short. + */ + TOO_SHORT, - case IT: { - return "IT"; - } + /** + * Unidentified customer. + */ + UNIDENTIFIED_CUSTOMER, - case JE: { - return "JE"; - } + UNKNOWN_VALUE; - case JM: { - return "JM"; - } + public static CustomerErrorCode fromGraphQl(String value) { + if (value == null) { + return null; + } - case JO: { - return "JO"; + switch (value) { + case "ALREADY_ENABLED": { + return ALREADY_ENABLED; } - case JP: { - return "JP"; + case "BAD_DOMAIN": { + return BAD_DOMAIN; } - case KE: { - return "KE"; + case "BLANK": { + return BLANK; } - case KG: { - return "KG"; + case "CONTAINS_HTML_TAGS": { + return CONTAINS_HTML_TAGS; } - case KH: { - return "KH"; + case "CONTAINS_URL": { + return CONTAINS_URL; } - case KI: { - return "KI"; + case "CUSTOMER_DISABLED": { + return CUSTOMER_DISABLED; } - case KM: { - return "KM"; + case "INVALID": { + return INVALID; } - case KN: { - return "KN"; + case "INVALID_MULTIPASS_REQUEST": { + return INVALID_MULTIPASS_REQUEST; } - case KP: { - return "KP"; + case "NOT_FOUND": { + return NOT_FOUND; } - case KR: { - return "KR"; + case "PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE": { + return PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE; } - case KW: { - return "KW"; + case "TAKEN": { + return TAKEN; } - case KY: { - return "KY"; + case "TOKEN_INVALID": { + return TOKEN_INVALID; } - case KZ: { - return "KZ"; + case "TOO_LONG": { + return TOO_LONG; } - case LA: { - return "LA"; + case "TOO_SHORT": { + return TOO_SHORT; } - case LB: { - return "LB"; + case "UNIDENTIFIED_CUSTOMER": { + return UNIDENTIFIED_CUSTOMER; } - case LC: { - return "LC"; + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case ALREADY_ENABLED: { + return "ALREADY_ENABLED"; } - case LI: { - return "LI"; + case BAD_DOMAIN: { + return "BAD_DOMAIN"; } - case LK: { - return "LK"; + case BLANK: { + return "BLANK"; } - case LR: { - return "LR"; + case CONTAINS_HTML_TAGS: { + return "CONTAINS_HTML_TAGS"; } - case LS: { - return "LS"; + case CONTAINS_URL: { + return "CONTAINS_URL"; } - case LT: { - return "LT"; + case CUSTOMER_DISABLED: { + return "CUSTOMER_DISABLED"; } - case LU: { - return "LU"; + case INVALID: { + return "INVALID"; } - case LV: { - return "LV"; + case INVALID_MULTIPASS_REQUEST: { + return "INVALID_MULTIPASS_REQUEST"; } - case LY: { - return "LY"; + case NOT_FOUND: { + return "NOT_FOUND"; } - case MA: { - return "MA"; + case PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE: { + return "PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE"; } - case MC: { - return "MC"; + case TAKEN: { + return "TAKEN"; } - case MD: { - return "MD"; + case TOKEN_INVALID: { + return "TOKEN_INVALID"; } - case ME: { - return "ME"; + case TOO_LONG: { + return "TOO_LONG"; } - case MF: { - return "MF"; + case TOO_SHORT: { + return "TOO_SHORT"; } - case MG: { - return "MG"; + case UNIDENTIFIED_CUSTOMER: { + return "UNIDENTIFIED_CUSTOMER"; } - case MK: { - return "MK"; + default: { + return ""; } + } + } + } - case ML: { - return "ML"; - } + public interface CustomerRecoverPayloadQueryDefinition { + void define(CustomerRecoverPayloadQuery _queryBuilder); + } - case MM: { - return "MM"; - } + /** + * Return type for `customerRecover` mutation. + */ + public static class CustomerRecoverPayloadQuery extends Query { + CustomerRecoverPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case MN: { - return "MN"; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerRecoverPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - case MO: { - return "MO"; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case MQ: { - return "MQ"; - } + return this; + } - case MR: { - return "MR"; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ + @Deprecated + public CustomerRecoverPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case MS: { - return "MS"; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case MT: { - return "MT"; - } + return this; + } + } - case MU: { - return "MU"; - } + /** + * Return type for `customerRecover` mutation. + */ + public static class CustomerRecoverPayload extends AbstractResponse { + public CustomerRecoverPayload() { + } - case MV: { - return "MV"; - } + public CustomerRecoverPayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - case MW: { - return "MW"; - } + responseData.put(key, list1); - case MX: { - return "MX"; - } + break; + } - case MY: { - return "MY"; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case MZ: { - return "MZ"; - } + responseData.put(key, list1); - case NA: { - return "NA"; - } + break; + } - case NC: { - return "NC"; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case NE: { - return "NE"; - } + public String getGraphQlTypeName() { + return "CustomerRecoverPayload"; + } - case NF: { - return "NF"; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case NG: { - return "NG"; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - case NI: { - return "NI"; - } + public CustomerRecoverPayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - case NL: { - return "NL"; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ - case NO: { - return "NO"; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case NP: { - return "NP"; - } + public CustomerRecoverPayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case NR: { - return "NR"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customerUserErrors": return true; - case NU: { - return "NU"; - } + case "userErrors": return true; - case NZ: { - return "NZ"; - } + default: return false; + } + } + } - case OM: { - return "OM"; - } + public interface CustomerResetByUrlPayloadQueryDefinition { + void define(CustomerResetByUrlPayloadQuery _queryBuilder); + } - case PA: { - return "PA"; - } + /** + * Return type for `customerResetByUrl` mutation. + */ + public static class CustomerResetByUrlPayloadQuery extends Query { + CustomerResetByUrlPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case PE: { - return "PE"; - } + /** + * The customer object which was reset. + */ + public CustomerResetByUrlPayloadQuery customer(CustomerQueryDefinition queryDef) { + startField("customer"); - case PF: { - return "PF"; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); - case PG: { - return "PG"; - } + return this; + } - case PH: { - return "PH"; - } + /** + * A newly created customer access token object for the customer. + */ + public CustomerResetByUrlPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { + startField("customerAccessToken"); - case PK: { - return "PK"; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + _queryBuilder.append('}'); - case PL: { - return "PL"; - } + return this; + } - case PM: { - return "PM"; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerResetByUrlPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - case PN: { - return "PN"; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case PS: { - return "PS"; - } + return this; + } - case PT: { - return "PT"; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ + @Deprecated + public CustomerResetByUrlPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case PY: { - return "PY"; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case QA: { - return "QA"; - } + return this; + } + } - case RE: { - return "RE"; - } + /** + * Return type for `customerResetByUrl` mutation. + */ + public static class CustomerResetByUrlPayload extends AbstractResponse { + public CustomerResetByUrlPayload() { + } - case RO: { - return "RO"; - } + public CustomerResetByUrlPayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customer": { + Customer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Customer(jsonAsObject(field.getValue(), key)); + } - case RS: { - return "RS"; - } + responseData.put(key, optional1); - case RU: { - return "RU"; - } + break; + } - case RW: { - return "RW"; - } + case "customerAccessToken": { + CustomerAccessToken optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + } - case SA: { - return "SA"; - } + responseData.put(key, optional1); - case SB: { - return "SB"; - } + break; + } - case SC: { - return "SC"; - } + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - case SD: { - return "SD"; - } + responseData.put(key, list1); - case SE: { - return "SE"; - } + break; + } - case SG: { - return "SG"; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case SH: { - return "SH"; - } + responseData.put(key, list1); - case SI: { - return "SI"; - } + break; + } - case SJ: { - return "SJ"; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case SK: { - return "SK"; - } + public String getGraphQlTypeName() { + return "CustomerResetByUrlPayload"; + } - case SL: { - return "SL"; - } + /** + * The customer object which was reset. + */ - case SM: { - return "SM"; - } + public Customer getCustomer() { + return (Customer) get("customer"); + } - case SN: { - return "SN"; - } + public CustomerResetByUrlPayload setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); + return this; + } - case SO: { - return "SO"; - } + /** + * A newly created customer access token object for the customer. + */ - case SR: { - return "SR"; - } + public CustomerAccessToken getCustomerAccessToken() { + return (CustomerAccessToken) get("customerAccessToken"); + } - case SS: { - return "SS"; - } + public CustomerResetByUrlPayload setCustomerAccessToken(CustomerAccessToken arg) { + optimisticData.put(getKey("customerAccessToken"), arg); + return this; + } - case ST: { - return "ST"; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case SV: { - return "SV"; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - case SX: { - return "SX"; - } + public CustomerResetByUrlPayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - case SY: { - return "SY"; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ - case SZ: { - return "SZ"; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case TA: { - return "TA"; - } + public CustomerResetByUrlPayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case TC: { - return "TC"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customer": return true; - case TD: { - return "TD"; - } + case "customerAccessToken": return true; - case TF: { - return "TF"; - } + case "customerUserErrors": return true; - case TG: { - return "TG"; - } + case "userErrors": return true; - case TH: { - return "TH"; - } + default: return false; + } + } + } - case TJ: { - return "TJ"; - } - - case TK: { - return "TK"; - } - - case TL: { - return "TL"; - } - - case TM: { - return "TM"; - } - - case TN: { - return "TN"; - } - - case TO: { - return "TO"; - } - - case TR: { - return "TR"; - } - - case TT: { - return "TT"; - } - - case TV: { - return "TV"; - } - - case TW: { - return "TW"; - } - - case TZ: { - return "TZ"; - } - - case UA: { - return "UA"; - } - - case UG: { - return "UG"; - } - - case UM: { - return "UM"; - } - - case US: { - return "US"; - } - - case UY: { - return "UY"; - } - - case UZ: { - return "UZ"; - } - - case VA: { - return "VA"; - } - - case VC: { - return "VC"; - } - - case VE: { - return "VE"; - } - - case VG: { - return "VG"; - } - - case VN: { - return "VN"; - } + public static class CustomerResetInput implements Serializable { + private String resetToken; - case VU: { - return "VU"; - } + private String password; - case WF: { - return "WF"; - } + public CustomerResetInput(String resetToken, String password) { + this.resetToken = resetToken; - case WS: { - return "WS"; - } + this.password = password; + } - case XK: { - return "XK"; - } + public String getResetToken() { + return resetToken; + } - case YE: { - return "YE"; - } + public CustomerResetInput setResetToken(String resetToken) { + this.resetToken = resetToken; + return this; + } - case YT: { - return "YT"; - } + public String getPassword() { + return password; + } - case ZA: { - return "ZA"; - } + public CustomerResetInput setPassword(String password) { + this.password = password; + return this; + } - case ZM: { - return "ZM"; - } + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - case ZW: { - return "ZW"; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("resetToken:"); + Query.appendQuotedString(_queryBuilder, resetToken.toString()); - case ZZ: { - return "ZZ"; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("password:"); + Query.appendQuotedString(_queryBuilder, password.toString()); - default: { - return ""; - } - } + _queryBuilder.append('}'); } } - public interface CreditCardQueryDefinition { - void define(CreditCardQuery _queryBuilder); + public interface CustomerResetPayloadQueryDefinition { + void define(CustomerResetPayloadQuery _queryBuilder); } /** - * Credit card information used for a payment. + * Return type for `customerReset` mutation. */ - public static class CreditCardQuery extends Query { - CreditCardQuery(StringBuilder _queryBuilder) { + public static class CustomerResetPayloadQuery extends Query { + CustomerResetPayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The brand of the credit card. + * The customer object which was reset. */ - public CreditCardQuery brand() { - startField("brand"); - - return this; - } + public CustomerResetPayloadQuery customer(CustomerQueryDefinition queryDef) { + startField("customer"); - /** - * The expiry month of the credit card. - */ - public CreditCardQuery expiryMonth() { - startField("expiryMonth"); + _queryBuilder.append('{'); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The expiry year of the credit card. + * A newly created customer access token object for the customer. */ - public CreditCardQuery expiryYear() { - startField("expiryYear"); - - return this; - } + public CustomerResetPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { + startField("customerAccessToken"); - /** - * The credit card's BIN number. - */ - public CreditCardQuery firstDigits() { - startField("firstDigits"); + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The first name of the card holder. + * The list of errors that occurred from executing the mutation. */ - public CreditCardQuery firstName() { - startField("firstName"); - - return this; - } + public CustomerResetPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - /** - * The last 4 digits of the credit card. - */ - public CreditCardQuery lastDigits() { - startField("lastDigits"); + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The last name of the card holder. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. */ - public CreditCardQuery lastName() { - startField("lastName"); - - return this; - } + @Deprecated + public CustomerResetPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - /** - * The masked credit card number with only the last 4 digits displayed. - */ - public CreditCardQuery maskedNumber() { - startField("maskedNumber"); + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * Credit card information used for a payment. + * Return type for `customerReset` mutation. */ - public static class CreditCard extends AbstractResponse { - public CreditCard() { + public static class CustomerResetPayload extends AbstractResponse { + public CustomerResetPayload() { } - public CreditCard(JsonObject fields) throws SchemaViolationError { + public CustomerResetPayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "brand": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "expiryMonth": { - Integer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "expiryYear": { - Integer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "firstDigits": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "firstName": { - String optional1 = null; + case "customer": { + Customer optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new Customer(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -27060,10 +27413,10 @@ public CreditCard(JsonObject fields) throws SchemaViolationError { break; } - case "lastDigits": { - String optional1 = null; + case "customerAccessToken": { + CustomerAccessToken optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -27071,24 +27424,24 @@ public CreditCard(JsonObject fields) throws SchemaViolationError { break; } - case "lastName": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "maskedNumber": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } @@ -27105,211 +27458,214 @@ public CreditCard(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CreditCard"; + return "CustomerResetPayload"; } /** - * The brand of the credit card. + * The customer object which was reset. */ - public String getBrand() { - return (String) get("brand"); + public Customer getCustomer() { + return (Customer) get("customer"); } - public CreditCard setBrand(String arg) { - optimisticData.put(getKey("brand"), arg); + public CustomerResetPayload setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); return this; } /** - * The expiry month of the credit card. + * A newly created customer access token object for the customer. */ - public Integer getExpiryMonth() { - return (Integer) get("expiryMonth"); + public CustomerAccessToken getCustomerAccessToken() { + return (CustomerAccessToken) get("customerAccessToken"); } - public CreditCard setExpiryMonth(Integer arg) { - optimisticData.put(getKey("expiryMonth"), arg); + public CustomerResetPayload setCustomerAccessToken(CustomerAccessToken arg) { + optimisticData.put(getKey("customerAccessToken"), arg); return this; } /** - * The expiry year of the credit card. + * The list of errors that occurred from executing the mutation. */ - public Integer getExpiryYear() { - return (Integer) get("expiryYear"); + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); } - public CreditCard setExpiryYear(Integer arg) { - optimisticData.put(getKey("expiryYear"), arg); + public CustomerResetPayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); return this; } /** - * The credit card's BIN number. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. */ - public String getFirstDigits() { - return (String) get("firstDigits"); + public List getUserErrors() { + return (List) get("userErrors"); } - public CreditCard setFirstDigits(String arg) { - optimisticData.put(getKey("firstDigits"), arg); + public CustomerResetPayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } - /** - * The first name of the card holder. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customer": return true; - public String getFirstName() { - return (String) get("firstName"); - } + case "customerAccessToken": return true; - public CreditCard setFirstName(String arg) { - optimisticData.put(getKey("firstName"), arg); - return this; - } + case "customerUserErrors": return true; - /** - * The last 4 digits of the credit card. - */ + case "userErrors": return true; - public String getLastDigits() { - return (String) get("lastDigits"); + default: return false; + } } + } - public CreditCard setLastDigits(String arg) { - optimisticData.put(getKey("lastDigits"), arg); - return this; - } + public static class CustomerUpdateInput implements Serializable { + private Input firstName = Input.undefined(); - /** - * The last name of the card holder. - */ + private Input lastName = Input.undefined(); - public String getLastName() { - return (String) get("lastName"); - } + private Input email = Input.undefined(); - public CreditCard setLastName(String arg) { - optimisticData.put(getKey("lastName"), arg); - return this; - } + private Input phone = Input.undefined(); - /** - * The masked credit card number with only the last 4 digits displayed. - */ + private Input password = Input.undefined(); - public String getMaskedNumber() { - return (String) get("maskedNumber"); - } + private Input acceptsMarketing = Input.undefined(); - public CreditCard setMaskedNumber(String arg) { - optimisticData.put(getKey("maskedNumber"), arg); - return this; + public String getFirstName() { + return firstName.getValue(); } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "brand": return false; - - case "expiryMonth": return false; - - case "expiryYear": return false; - - case "firstDigits": return false; - - case "firstName": return false; - - case "lastDigits": return false; - - case "lastName": return false; + public Input getFirstNameInput() { + return firstName; + } - case "maskedNumber": return false; + public CustomerUpdateInput setFirstName(String firstName) { + this.firstName = Input.optional(firstName); + return this; + } - default: return false; + public CustomerUpdateInput setFirstNameInput(Input firstName) { + if (firstName == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.firstName = firstName; + return this; } - } - public static class CreditCardPaymentInputV2 implements Serializable { - private MoneyInput paymentAmount; - - private String idempotencyKey; + public String getLastName() { + return lastName.getValue(); + } - private MailingAddressInput billingAddress; + public Input getLastNameInput() { + return lastName; + } - private String vaultId; + public CustomerUpdateInput setLastName(String lastName) { + this.lastName = Input.optional(lastName); + return this; + } - private Input test = Input.undefined(); + public CustomerUpdateInput setLastNameInput(Input lastName) { + if (lastName == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.lastName = lastName; + return this; + } - public CreditCardPaymentInputV2(MoneyInput paymentAmount, String idempotencyKey, MailingAddressInput billingAddress, String vaultId) { - this.paymentAmount = paymentAmount; + public String getEmail() { + return email.getValue(); + } - this.idempotencyKey = idempotencyKey; + public Input getEmailInput() { + return email; + } - this.billingAddress = billingAddress; + public CustomerUpdateInput setEmail(String email) { + this.email = Input.optional(email); + return this; + } - this.vaultId = vaultId; + public CustomerUpdateInput setEmailInput(Input email) { + if (email == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.email = email; + return this; } - public MoneyInput getPaymentAmount() { - return paymentAmount; + public String getPhone() { + return phone.getValue(); } - public CreditCardPaymentInputV2 setPaymentAmount(MoneyInput paymentAmount) { - this.paymentAmount = paymentAmount; - return this; + public Input getPhoneInput() { + return phone; } - public String getIdempotencyKey() { - return idempotencyKey; + public CustomerUpdateInput setPhone(String phone) { + this.phone = Input.optional(phone); + return this; } - public CreditCardPaymentInputV2 setIdempotencyKey(String idempotencyKey) { - this.idempotencyKey = idempotencyKey; + public CustomerUpdateInput setPhoneInput(Input phone) { + if (phone == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.phone = phone; return this; } - public MailingAddressInput getBillingAddress() { - return billingAddress; + public String getPassword() { + return password.getValue(); } - public CreditCardPaymentInputV2 setBillingAddress(MailingAddressInput billingAddress) { - this.billingAddress = billingAddress; - return this; + public Input getPasswordInput() { + return password; } - public String getVaultId() { - return vaultId; + public CustomerUpdateInput setPassword(String password) { + this.password = Input.optional(password); + return this; } - public CreditCardPaymentInputV2 setVaultId(String vaultId) { - this.vaultId = vaultId; + public CustomerUpdateInput setPasswordInput(Input password) { + if (password == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.password = password; return this; } - public Boolean getTest() { - return test.getValue(); + public Boolean getAcceptsMarketing() { + return acceptsMarketing.getValue(); } - public Input getTestInput() { - return test; + public Input getAcceptsMarketingInput() { + return acceptsMarketing; } - public CreditCardPaymentInputV2 setTest(Boolean test) { - this.test = Input.optional(test); + public CustomerUpdateInput setAcceptsMarketing(Boolean acceptsMarketing) { + this.acceptsMarketing = Input.optional(acceptsMarketing); return this; } - public CreditCardPaymentInputV2 setTestInput(Input test) { - if (test == null) { + public CustomerUpdateInput setAcceptsMarketingInput(Input acceptsMarketing) { + if (acceptsMarketing == null) { throw new IllegalArgumentException("Input can not be null"); } - this.test = test; + this.acceptsMarketing = acceptsMarketing; return this; } @@ -27317,32 +27673,67 @@ public void appendTo(StringBuilder _queryBuilder) { String separator = ""; _queryBuilder.append('{'); - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("paymentAmount:"); - paymentAmount.appendTo(_queryBuilder); + if (this.firstName.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("firstName:"); + if (firstName.getValue() != null) { + Query.appendQuotedString(_queryBuilder, firstName.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("idempotencyKey:"); - Query.appendQuotedString(_queryBuilder, idempotencyKey.toString()); + if (this.lastName.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("lastName:"); + if (lastName.getValue() != null) { + Query.appendQuotedString(_queryBuilder, lastName.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("billingAddress:"); - billingAddress.appendTo(_queryBuilder); + if (this.email.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("email:"); + if (email.getValue() != null) { + Query.appendQuotedString(_queryBuilder, email.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("vaultId:"); - Query.appendQuotedString(_queryBuilder, vaultId.toString()); + if (this.phone.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("phone:"); + if (phone.getValue() != null) { + Query.appendQuotedString(_queryBuilder, phone.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.password.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("password:"); + if (password.getValue() != null) { + Query.appendQuotedString(_queryBuilder, password.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - if (this.test.isDefined()) { + if (this.acceptsMarketing.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("test:"); - if (test.getValue() != null) { - _queryBuilder.append(test.getValue()); + _queryBuilder.append("acceptsMarketing:"); + if (acceptsMarketing.getValue() != null) { + _queryBuilder.append(acceptsMarketing.getValue()); } else { _queryBuilder.append("null"); } @@ -27352,162 +27743,298 @@ public void appendTo(StringBuilder _queryBuilder) { } } + public interface CustomerUpdatePayloadQueryDefinition { + void define(CustomerUpdatePayloadQuery _queryBuilder); + } + /** - * The part of the image that should remain after cropping. + * Return type for `customerUpdate` mutation. */ - public enum CropRegion { - /** - * Keep the bottom of the image. - */ - BOTTOM, + public static class CustomerUpdatePayloadQuery extends Query { + CustomerUpdatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Keep the center of the image. + * The updated customer object. */ - CENTER, + public CustomerUpdatePayloadQuery customer(CustomerQueryDefinition queryDef) { + startField("customer"); + + _queryBuilder.append('{'); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } /** - * Keep the left of the image. + * The newly created customer access token. If the customer's password is updated, all previous access + * tokens + * (including the one used to perform this mutation) become invalid, and a new token is generated. */ - LEFT, + public CustomerUpdatePayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { + startField("customerAccessToken"); + + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } /** - * Keep the right of the image. + * The list of errors that occurred from executing the mutation. */ - RIGHT, + public CustomerUpdatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); + + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } /** - * Keep the top of the image. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. */ - TOP, + @Deprecated + public CustomerUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - UNKNOWN_VALUE; + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - public static CropRegion fromGraphQl(String value) { - if (value == null) { - return null; - } + return this; + } + } - switch (value) { - case "BOTTOM": { - return BOTTOM; - } + /** + * Return type for `customerUpdate` mutation. + */ + public static class CustomerUpdatePayload extends AbstractResponse { + public CustomerUpdatePayload() { + } - case "CENTER": { - return CENTER; - } + public CustomerUpdatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customer": { + Customer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Customer(jsonAsObject(field.getValue(), key)); + } - case "LEFT": { - return LEFT; - } + responseData.put(key, optional1); - case "RIGHT": { - return RIGHT; - } + break; + } - case "TOP": { - return TOP; - } + case "customerAccessToken": { + CustomerAccessToken optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + } - default: { - return UNKNOWN_VALUE; + responseData.put(key, optional1); + + break; + } + + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } } } - public String toString() { - switch (this) { - case BOTTOM: { - return "BOTTOM"; - } - case CENTER: { - return "CENTER"; - } + public String getGraphQlTypeName() { + return "CustomerUpdatePayload"; + } - case LEFT: { - return "LEFT"; - } + /** + * The updated customer object. + */ - case RIGHT: { - return "RIGHT"; - } + public Customer getCustomer() { + return (Customer) get("customer"); + } - case TOP: { - return "TOP"; - } + public CustomerUpdatePayload setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); + return this; + } - default: { - return ""; - } + /** + * The newly created customer access token. If the customer's password is updated, all previous access + * tokens + * (including the one used to perform this mutation) become invalid, and a new token is generated. + */ + + public CustomerAccessToken getCustomerAccessToken() { + return (CustomerAccessToken) get("customerAccessToken"); + } + + public CustomerUpdatePayload setCustomerAccessToken(CustomerAccessToken arg) { + optimisticData.put(getKey("customerAccessToken"), arg); + return this; + } + + /** + * The list of errors that occurred from executing the mutation. + */ + + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } + + public CustomerUpdatePayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } + + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ + + public List getUserErrors() { + return (List) get("userErrors"); + } + + public CustomerUpdatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customer": return true; + + case "customerAccessToken": return true; + + case "customerUserErrors": return true; + + case "userErrors": return true; + + default: return false; } } } - public interface CurrencyQueryDefinition { - void define(CurrencyQuery _queryBuilder); + public interface CustomerUserErrorQueryDefinition { + void define(CustomerUserErrorQuery _queryBuilder); } /** - * A currency. + * Represents an error that happens during execution of a customer mutation. */ - public static class CurrencyQuery extends Query { - CurrencyQuery(StringBuilder _queryBuilder) { + public static class CustomerUserErrorQuery extends Query { + CustomerUserErrorQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The ISO code of the currency. + * The error code. */ - public CurrencyQuery isoCode() { - startField("isoCode"); + public CustomerUserErrorQuery code() { + startField("code"); return this; } /** - * The name of the currency. + * The path to the input field that caused the error. */ - public CurrencyQuery name() { - startField("name"); + public CustomerUserErrorQuery field() { + startField("field"); return this; } /** - * The symbol of the currency. + * The error message. */ - public CurrencyQuery symbol() { - startField("symbol"); + public CustomerUserErrorQuery message() { + startField("message"); return this; } } /** - * A currency. + * Represents an error that happens during execution of a customer mutation. */ - public static class Currency extends AbstractResponse { - public Currency() { + public static class CustomerUserError extends AbstractResponse implements DisplayableError { + public CustomerUserError() { } - public Currency(JsonObject fields) throws SchemaViolationError { + public CustomerUserError(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "isoCode": { - responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); + case "code": { + CustomerErrorCode optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = CustomerErrorCode.fromGraphQl(jsonAsString(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "field": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + optional1 = list1; + } + + responseData.put(key, optional1); break; } - case "symbol": { + case "message": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -27525,2625 +28052,2684 @@ public Currency(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "Currency"; + return "CustomerUserError"; } /** - * The ISO code of the currency. + * The error code. */ - public CurrencyCode getIsoCode() { - return (CurrencyCode) get("isoCode"); + public CustomerErrorCode getCode() { + return (CustomerErrorCode) get("code"); } - public Currency setIsoCode(CurrencyCode arg) { - optimisticData.put(getKey("isoCode"), arg); + public CustomerUserError setCode(CustomerErrorCode arg) { + optimisticData.put(getKey("code"), arg); return this; } /** - * The name of the currency. + * The path to the input field that caused the error. */ - public String getName() { - return (String) get("name"); + public List getField() { + return (List) get("field"); } - public Currency setName(String arg) { - optimisticData.put(getKey("name"), arg); + public CustomerUserError setField(List arg) { + optimisticData.put(getKey("field"), arg); return this; } /** - * The symbol of the currency. + * The error message. */ - public String getSymbol() { - return (String) get("symbol"); + public String getMessage() { + return (String) get("message"); } - public Currency setSymbol(String arg) { - optimisticData.put(getKey("symbol"), arg); + public CustomerUserError setMessage(String arg) { + optimisticData.put(getKey("message"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "isoCode": return false; + case "code": return false; - case "name": return false; + case "field": return false; - case "symbol": return false; + case "message": return false; default: return false; } } } + public interface DeliveryAddressQueryDefinition { + void define(DeliveryAddressQuery _queryBuilder); + } + /** - * The three-letter currency codes that represent the world currencies used in - * stores. These include standard ISO 4217 codes, legacy codes, - * and non-standard codes. + * A delivery address of the buyer that is interacting with the cart. */ - public enum CurrencyCode { - /** - * United Arab Emirates Dirham (AED). - */ - AED, + public static class DeliveryAddressQuery extends Query { + DeliveryAddressQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - /** - * Afghan Afghani (AFN). - */ - AFN, + startField("__typename"); + } - /** - * Albanian Lek (ALL). - */ - ALL, + public DeliveryAddressQuery onMailingAddress(MailingAddressQueryDefinition queryDef) { + startInlineFragment("MailingAddress"); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + } - /** - * Armenian Dram (AMD). - */ - AMD, + public interface DeliveryAddress { + String getGraphQlTypeName(); + } - /** - * Netherlands Antillean Guilder. - */ - ANG, + /** + * A delivery address of the buyer that is interacting with the cart. + */ + public static class UnknownDeliveryAddress extends AbstractResponse implements DeliveryAddress { + public UnknownDeliveryAddress() { + } - /** - * Angolan Kwanza (AOA). - */ - AOA, + public UnknownDeliveryAddress(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * Argentine Pesos (ARS). - */ - ARS, + public static DeliveryAddress create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "MailingAddress": { + return new MailingAddress(fields); + } - /** - * Australian Dollars (AUD). - */ - AUD, + default: { + return new UnknownDeliveryAddress(fields); + } + } + } - /** - * Aruban Florin (AWG). - */ - AWG, + public String getGraphQlTypeName() { + return (String) get("__typename"); + } - /** - * Azerbaijani Manat (AZN). - */ - AZN, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + default: return false; + } + } + } - /** - * Bosnia and Herzegovina Convertible Mark (BAM). - */ - BAM, + public static class DeliveryAddressInput implements Serializable { + private Input deliveryAddress = Input.undefined(); - /** - * Barbadian Dollar (BBD). - */ - BBD, + private Input oneTimeUse = Input.undefined(); - /** - * Bangladesh Taka (BDT). - */ - BDT, + private Input deliveryAddressValidationStrategy = Input.undefined(); - /** - * Bulgarian Lev (BGN). - */ - BGN, + private Input customerAddressId = Input.undefined(); - /** - * Bahraini Dinar (BHD). - */ - BHD, + public MailingAddressInput getDeliveryAddress() { + return deliveryAddress.getValue(); + } - /** - * Burundian Franc (BIF). - */ - BIF, + public Input getDeliveryAddressInput() { + return deliveryAddress; + } - /** - * Bermudian Dollar (BMD). - */ - BMD, + public DeliveryAddressInput setDeliveryAddress(MailingAddressInput deliveryAddress) { + this.deliveryAddress = Input.optional(deliveryAddress); + return this; + } - /** - * Brunei Dollar (BND). - */ - BND, + public DeliveryAddressInput setDeliveryAddressInput(Input deliveryAddress) { + if (deliveryAddress == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.deliveryAddress = deliveryAddress; + return this; + } - /** - * Bolivian Boliviano (BOB). - */ - BOB, + public Boolean getOneTimeUse() { + return oneTimeUse.getValue(); + } - /** - * Brazilian Real (BRL). - */ - BRL, + public Input getOneTimeUseInput() { + return oneTimeUse; + } - /** - * Bahamian Dollar (BSD). - */ - BSD, + public DeliveryAddressInput setOneTimeUse(Boolean oneTimeUse) { + this.oneTimeUse = Input.optional(oneTimeUse); + return this; + } - /** - * Bhutanese Ngultrum (BTN). - */ - BTN, + public DeliveryAddressInput setOneTimeUseInput(Input oneTimeUse) { + if (oneTimeUse == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.oneTimeUse = oneTimeUse; + return this; + } - /** - * Botswana Pula (BWP). - */ - BWP, + public DeliveryAddressValidationStrategy getDeliveryAddressValidationStrategy() { + return deliveryAddressValidationStrategy.getValue(); + } - /** - * Belarusian Ruble (BYN). - */ - BYN, + public Input getDeliveryAddressValidationStrategyInput() { + return deliveryAddressValidationStrategy; + } - /** - * Belarusian Ruble (BYR). - * - * @deprecated `BYR` is deprecated. Use `BYN` available from version `2021-01` onwards instead. - */ - @Deprecated - BYR, + public DeliveryAddressInput setDeliveryAddressValidationStrategy(DeliveryAddressValidationStrategy deliveryAddressValidationStrategy) { + this.deliveryAddressValidationStrategy = Input.optional(deliveryAddressValidationStrategy); + return this; + } - /** - * Belize Dollar (BZD). - */ - BZD, + public DeliveryAddressInput setDeliveryAddressValidationStrategyInput(Input deliveryAddressValidationStrategy) { + if (deliveryAddressValidationStrategy == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.deliveryAddressValidationStrategy = deliveryAddressValidationStrategy; + return this; + } - /** - * Canadian Dollars (CAD). - */ - CAD, + public ID getCustomerAddressId() { + return customerAddressId.getValue(); + } - /** - * Congolese franc (CDF). - */ - CDF, + public Input getCustomerAddressIdInput() { + return customerAddressId; + } - /** - * Swiss Francs (CHF). - */ - CHF, + public DeliveryAddressInput setCustomerAddressId(ID customerAddressId) { + this.customerAddressId = Input.optional(customerAddressId); + return this; + } - /** - * Chilean Peso (CLP). - */ - CLP, + public DeliveryAddressInput setCustomerAddressIdInput(Input customerAddressId) { + if (customerAddressId == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.customerAddressId = customerAddressId; + return this; + } - /** - * Chinese Yuan Renminbi (CNY). - */ - CNY, + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - /** - * Colombian Peso (COP). - */ - COP, + if (this.deliveryAddress.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("deliveryAddress:"); + if (deliveryAddress.getValue() != null) { + deliveryAddress.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } - /** - * Costa Rican Colones (CRC). - */ - CRC, + if (this.oneTimeUse.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("oneTimeUse:"); + if (oneTimeUse.getValue() != null) { + _queryBuilder.append(oneTimeUse.getValue()); + } else { + _queryBuilder.append("null"); + } + } - /** - * Cape Verdean escudo (CVE). - */ - CVE, + if (this.deliveryAddressValidationStrategy.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("deliveryAddressValidationStrategy:"); + if (deliveryAddressValidationStrategy.getValue() != null) { + _queryBuilder.append(deliveryAddressValidationStrategy.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - /** - * Czech Koruny (CZK). - */ - CZK, + if (this.customerAddressId.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("customerAddressId:"); + if (customerAddressId.getValue() != null) { + Query.appendQuotedString(_queryBuilder, customerAddressId.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - /** - * Djiboutian Franc (DJF). - */ - DJF, + _queryBuilder.append('}'); + } + } + /** + * Defines the types of available validation strategies for delivery addresses. + */ + public enum DeliveryAddressValidationStrategy { /** - * Danish Kroner (DKK). + * Only the country code is validated. */ - DKK, + COUNTRY_CODE_ONLY, /** - * Dominican Peso (DOP). + * Strict validation is performed, i.e. all fields in the address are validated + * according to Shopify's checkout rules. If the address fails validation, the cart will not be + * updated. */ - DOP, + STRICT, - /** - * Algerian Dinar (DZD). - */ - DZD, + UNKNOWN_VALUE; - /** - * Egyptian Pound (EGP). - */ - EGP, + public static DeliveryAddressValidationStrategy fromGraphQl(String value) { + if (value == null) { + return null; + } - /** - * Eritrean Nakfa (ERN). - */ - ERN, + switch (value) { + case "COUNTRY_CODE_ONLY": { + return COUNTRY_CODE_ONLY; + } - /** - * Ethiopian Birr (ETB). - */ - ETB, + case "STRICT": { + return STRICT; + } - /** - * Euro (EUR). - */ - EUR, + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case COUNTRY_CODE_ONLY: { + return "COUNTRY_CODE_ONLY"; + } - /** - * Fijian Dollars (FJD). - */ - FJD, + case STRICT: { + return "STRICT"; + } - /** - * Falkland Islands Pounds (FKP). - */ - FKP, + default: { + return ""; + } + } + } + } + /** + * List of different delivery method types. + */ + public enum DeliveryMethodType { /** - * United Kingdom Pounds (GBP). + * Local Delivery. */ - GBP, + LOCAL, /** - * Georgian Lari (GEL). + * None. */ - GEL, + NONE, /** - * Ghanaian Cedi (GHS). + * Shipping to a Pickup Point. */ - GHS, + PICKUP_POINT, /** - * Gibraltar Pounds (GIP). + * Local Pickup. */ - GIP, + PICK_UP, /** - * Gambian Dalasi (GMD). + * Retail. */ - GMD, + RETAIL, /** - * Guinean Franc (GNF). + * Shipping. */ - GNF, + SHIPPING, - /** - * Guatemalan Quetzal (GTQ). - */ - GTQ, + UNKNOWN_VALUE; - /** - * Guyanese Dollar (GYD). - */ - GYD, + public static DeliveryMethodType fromGraphQl(String value) { + if (value == null) { + return null; + } - /** - * Hong Kong Dollars (HKD). - */ - HKD, + switch (value) { + case "LOCAL": { + return LOCAL; + } - /** - * Honduran Lempira (HNL). - */ - HNL, + case "NONE": { + return NONE; + } - /** - * Croatian Kuna (HRK). - */ - HRK, + case "PICKUP_POINT": { + return PICKUP_POINT; + } - /** - * Haitian Gourde (HTG). - */ - HTG, + case "PICK_UP": { + return PICK_UP; + } - /** - * Hungarian Forint (HUF). - */ - HUF, + case "RETAIL": { + return RETAIL; + } - /** - * Indonesian Rupiah (IDR). - */ - IDR, + case "SHIPPING": { + return SHIPPING; + } - /** - * Israeli New Shekel (NIS). - */ - ILS, + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case LOCAL: { + return "LOCAL"; + } - /** - * Indian Rupees (INR). - */ - INR, + case NONE: { + return "NONE"; + } - /** - * Iraqi Dinar (IQD). - */ - IQD, + case PICKUP_POINT: { + return "PICKUP_POINT"; + } - /** - * Iranian Rial (IRR). - */ - IRR, + case PICK_UP: { + return "PICK_UP"; + } - /** - * Icelandic Kronur (ISK). - */ - ISK, + case RETAIL: { + return "RETAIL"; + } - /** - * Jersey Pound. - */ - JEP, + case SHIPPING: { + return "SHIPPING"; + } - /** - * Jamaican Dollars (JMD). - */ - JMD, + default: { + return ""; + } + } + } + } + /** + * Digital wallet, such as Apple Pay, which can be used for accelerated checkouts. + */ + public enum DigitalWallet { /** - * Jordanian Dinar (JOD). + * Android Pay. */ - JOD, + ANDROID_PAY, /** - * Japanese Yen (JPY). + * Apple Pay. */ - JPY, + APPLE_PAY, /** - * Kenyan Shilling (KES). + * Google Pay. */ - KES, + GOOGLE_PAY, /** - * Kyrgyzstani Som (KGS). + * Shopify Pay. */ - KGS, + SHOPIFY_PAY, - /** - * Cambodian Riel. - */ - KHR, + UNKNOWN_VALUE; - /** - * Kiribati Dollar (KID). - */ - KID, + public static DigitalWallet fromGraphQl(String value) { + if (value == null) { + return null; + } - /** - * Comorian Franc (KMF). - */ - KMF, + switch (value) { + case "ANDROID_PAY": { + return ANDROID_PAY; + } - /** - * South Korean Won (KRW). - */ - KRW, + case "APPLE_PAY": { + return APPLE_PAY; + } - /** - * Kuwaiti Dinar (KWD). - */ - KWD, + case "GOOGLE_PAY": { + return GOOGLE_PAY; + } - /** - * Cayman Dollars (KYD). - */ - KYD, + case "SHOPIFY_PAY": { + return SHOPIFY_PAY; + } - /** - * Kazakhstani Tenge (KZT). - */ - KZT, + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case ANDROID_PAY: { + return "ANDROID_PAY"; + } - /** - * Laotian Kip (LAK). - */ - LAK, + case APPLE_PAY: { + return "APPLE_PAY"; + } - /** - * Lebanese Pounds (LBP). - */ - LBP, + case GOOGLE_PAY: { + return "GOOGLE_PAY"; + } - /** - * Sri Lankan Rupees (LKR). - */ - LKR, + case SHOPIFY_PAY: { + return "SHOPIFY_PAY"; + } - /** - * Liberian Dollar (LRD). - */ - LRD, + default: { + return ""; + } + } + } + } - /** - * Lesotho Loti (LSL). - */ - LSL, + public interface DiscountAllocationQueryDefinition { + void define(DiscountAllocationQuery _queryBuilder); + } - /** - * Lithuanian Litai (LTL). - */ - LTL, + /** + * An amount discounting the line that has been allocated by a discount. + */ + public static class DiscountAllocationQuery extends Query { + DiscountAllocationQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Latvian Lati (LVL). + * Amount of discount allocated. */ - LVL, + public DiscountAllocationQuery allocatedAmount(MoneyV2QueryDefinition queryDef) { + startField("allocatedAmount"); - /** - * Libyan Dinar (LYD). - */ - LYD, + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Moroccan Dirham. - */ - MAD, + return this; + } /** - * Moldovan Leu (MDL). + * The discount this allocated amount originated from. */ - MDL, + public DiscountAllocationQuery discountApplication(DiscountApplicationQueryDefinition queryDef) { + startField("discountApplication"); - /** - * Malagasy Ariary (MGA). - */ - MGA, + _queryBuilder.append('{'); + queryDef.define(new DiscountApplicationQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Macedonia Denar (MKD). - */ - MKD, + return this; + } + } - /** - * Burmese Kyat (MMK). - */ - MMK, + /** + * An amount discounting the line that has been allocated by a discount. + */ + public static class DiscountAllocation extends AbstractResponse { + public DiscountAllocation() { + } - /** - * Mongolian Tugrik. - */ - MNT, + public DiscountAllocation(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "allocatedAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - /** - * Macanese Pataca (MOP). - */ - MOP, + break; + } - /** - * Mauritanian Ouguiya (MRU). - */ - MRU, + case "discountApplication": { + responseData.put(key, UnknownDiscountApplication.create(jsonAsObject(field.getValue(), key))); - /** - * Mauritian Rupee (MUR). - */ - MUR, + break; + } - /** - * Maldivian Rufiyaa (MVR). - */ - MVR, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * Malawian Kwacha (MWK). - */ - MWK, + public String getGraphQlTypeName() { + return "DiscountAllocation"; + } /** - * Mexican Pesos (MXN). + * Amount of discount allocated. */ - MXN, - /** - * Malaysian Ringgits (MYR). - */ - MYR, + public MoneyV2 getAllocatedAmount() { + return (MoneyV2) get("allocatedAmount"); + } - /** - * Mozambican Metical. - */ - MZN, + public DiscountAllocation setAllocatedAmount(MoneyV2 arg) { + optimisticData.put(getKey("allocatedAmount"), arg); + return this; + } /** - * Namibian Dollar. + * The discount this allocated amount originated from. */ - NAD, - /** - * Nigerian Naira (NGN). - */ - NGN, + public DiscountApplication getDiscountApplication() { + return (DiscountApplication) get("discountApplication"); + } - /** - * Nicaraguan Córdoba (NIO). - */ - NIO, + public DiscountAllocation setDiscountApplication(DiscountApplication arg) { + optimisticData.put(getKey("discountApplication"), arg); + return this; + } - /** - * Norwegian Kroner (NOK). - */ - NOK, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "allocatedAmount": return true; - /** - * Nepalese Rupee (NPR). - */ - NPR, + case "discountApplication": return false; - /** - * New Zealand Dollars (NZD). - */ - NZD, + default: return false; + } + } + } - /** - * Omani Rial (OMR). - */ - OMR, + public interface DiscountApplicationQueryDefinition { + void define(DiscountApplicationQuery _queryBuilder); + } - /** - * Panamian Balboa (PAB). - */ - PAB, + /** + * Discount applications capture the intentions of a discount source at + * the time of application. + */ + public static class DiscountApplicationQuery extends Query { + DiscountApplicationQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - /** - * Peruvian Nuevo Sol (PEN). - */ - PEN, + startField("__typename"); + } /** - * Papua New Guinean Kina (PGK). + * The method by which the discount's value is allocated to its entitled items. */ - PGK, + public DiscountApplicationQuery allocationMethod() { + startField("allocationMethod"); - /** - * Philippine Peso (PHP). - */ - PHP, + return this; + } /** - * Pakistani Rupee (PKR). + * Which lines of targetType that the discount is allocated over. */ - PKR, + public DiscountApplicationQuery targetSelection() { + startField("targetSelection"); - /** - * Polish Zlotych (PLN). - */ - PLN, + return this; + } /** - * Paraguayan Guarani (PYG). + * The type of line that the discount is applicable towards. */ - PYG, + public DiscountApplicationQuery targetType() { + startField("targetType"); - /** - * Qatari Rial (QAR). - */ - QAR, + return this; + } /** - * Romanian Lei (RON). + * The value of the discount application. */ - RON, + public DiscountApplicationQuery value(PricingValueQueryDefinition queryDef) { + startField("value"); - /** - * Serbian dinar (RSD). - */ - RSD, + _queryBuilder.append('{'); + queryDef.define(new PricingValueQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Russian Rubles (RUB). - */ - RUB, + return this; + } - /** - * Rwandan Franc (RWF). - */ - RWF, + public DiscountApplicationQuery onAutomaticDiscountApplication(AutomaticDiscountApplicationQueryDefinition queryDef) { + startInlineFragment("AutomaticDiscountApplication"); + queryDef.define(new AutomaticDiscountApplicationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - /** - * Saudi Riyal (SAR). - */ - SAR, + public DiscountApplicationQuery onDiscountCodeApplication(DiscountCodeApplicationQueryDefinition queryDef) { + startInlineFragment("DiscountCodeApplication"); + queryDef.define(new DiscountCodeApplicationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - /** - * Solomon Islands Dollar (SBD). - */ - SBD, + public DiscountApplicationQuery onManualDiscountApplication(ManualDiscountApplicationQueryDefinition queryDef) { + startInlineFragment("ManualDiscountApplication"); + queryDef.define(new ManualDiscountApplicationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - /** - * Seychellois Rupee (SCR). - */ - SCR, + public DiscountApplicationQuery onScriptDiscountApplication(ScriptDiscountApplicationQueryDefinition queryDef) { + startInlineFragment("ScriptDiscountApplication"); + queryDef.define(new ScriptDiscountApplicationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + } - /** - * Sudanese Pound (SDG). - */ - SDG, + public interface DiscountApplication { + String getGraphQlTypeName(); - /** - * Swedish Kronor (SEK). - */ - SEK, + DiscountApplicationAllocationMethod getAllocationMethod(); - /** - * Singapore Dollars (SGD). - */ - SGD, + DiscountApplicationTargetSelection getTargetSelection(); - /** - * Saint Helena Pounds (SHP). - */ - SHP, + DiscountApplicationTargetType getTargetType(); - /** - * Sierra Leonean Leone (SLL). - */ - SLL, + PricingValue getValue(); + } - /** - * Somali Shilling (SOS). - */ - SOS, + /** + * Discount applications capture the intentions of a discount source at + * the time of application. + */ + public static class UnknownDiscountApplication extends AbstractResponse implements DiscountApplication { + public UnknownDiscountApplication() { + } - /** - * Surinamese Dollar (SRD). - */ - SRD, + public UnknownDiscountApplication(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "allocationMethod": { + responseData.put(key, DiscountApplicationAllocationMethod.fromGraphQl(jsonAsString(field.getValue(), key))); - /** - * South Sudanese Pound (SSP). - */ - SSP, + break; + } - /** - * Sao Tome And Principe Dobra (STD). - * - * @deprecated `STD` is deprecated. Use `STN` available from version `2022-07` onwards instead. - */ - @Deprecated - STD, + case "targetSelection": { + responseData.put(key, DiscountApplicationTargetSelection.fromGraphQl(jsonAsString(field.getValue(), key))); - /** - * Sao Tome And Principe Dobra (STN). - */ - STN, + break; + } - /** - * Syrian Pound (SYP). - */ - SYP, + case "targetType": { + responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); - /** - * Swazi Lilangeni (SZL). - */ - SZL, + break; + } - /** - * Thai baht (THB). - */ - THB, + case "value": { + responseData.put(key, UnknownPricingValue.create(jsonAsObject(field.getValue(), key))); - /** - * Tajikistani Somoni (TJS). - */ - TJS, + break; + } - /** - * Turkmenistani Manat (TMT). - */ - TMT, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * Tunisian Dinar (TND). - */ - TND, + public static DiscountApplication create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "AutomaticDiscountApplication": { + return new AutomaticDiscountApplication(fields); + } - /** - * Tongan Pa'anga (TOP). - */ - TOP, + case "DiscountCodeApplication": { + return new DiscountCodeApplication(fields); + } - /** - * Turkish Lira (TRY). - */ - TRY, + case "ManualDiscountApplication": { + return new ManualDiscountApplication(fields); + } - /** - * Trinidad and Tobago Dollars (TTD). - */ - TTD, + case "ScriptDiscountApplication": { + return new ScriptDiscountApplication(fields); + } - /** - * Taiwan Dollars (TWD). - */ - TWD, + default: { + return new UnknownDiscountApplication(fields); + } + } + } - /** - * Tanzanian Shilling (TZS). - */ - TZS, + public String getGraphQlTypeName() { + return (String) get("__typename"); + } /** - * Ukrainian Hryvnia (UAH). + * The method by which the discount's value is allocated to its entitled items. */ - UAH, - /** - * Ugandan Shilling (UGX). - */ - UGX, + public DiscountApplicationAllocationMethod getAllocationMethod() { + return (DiscountApplicationAllocationMethod) get("allocationMethod"); + } - /** - * United States Dollars (USD). - */ - USD, + public UnknownDiscountApplication setAllocationMethod(DiscountApplicationAllocationMethod arg) { + optimisticData.put(getKey("allocationMethod"), arg); + return this; + } /** - * Uruguayan Pesos (UYU). + * Which lines of targetType that the discount is allocated over. */ - UYU, - /** - * Uzbekistan som (UZS). - */ - UZS, + public DiscountApplicationTargetSelection getTargetSelection() { + return (DiscountApplicationTargetSelection) get("targetSelection"); + } - /** - * Venezuelan Bolivares (VED). - */ - VED, + public UnknownDiscountApplication setTargetSelection(DiscountApplicationTargetSelection arg) { + optimisticData.put(getKey("targetSelection"), arg); + return this; + } /** - * Venezuelan Bolivares (VEF). - * - * @deprecated `VEF` is deprecated. Use `VES` available from version `2020-10` onwards instead. + * The type of line that the discount is applicable towards. */ - @Deprecated - VEF, - /** - * Venezuelan Bolivares Soberanos (VES). - */ - VES, + public DiscountApplicationTargetType getTargetType() { + return (DiscountApplicationTargetType) get("targetType"); + } - /** - * Vietnamese đồng (VND). - */ - VND, + public UnknownDiscountApplication setTargetType(DiscountApplicationTargetType arg) { + optimisticData.put(getKey("targetType"), arg); + return this; + } /** - * Vanuatu Vatu (VUV). + * The value of the discount application. */ - VUV, - /** - * Samoan Tala (WST). - */ - WST, + public PricingValue getValue() { + return (PricingValue) get("value"); + } - /** - * Central African CFA Franc (XAF). - */ - XAF, + public UnknownDiscountApplication setValue(PricingValue arg) { + optimisticData.put(getKey("value"), arg); + return this; + } - /** - * East Caribbean Dollar (XCD). - */ - XCD, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "allocationMethod": return false; - /** - * West African CFA franc (XOF). - */ - XOF, + case "targetSelection": return false; - /** - * CFP Franc (XPF). - */ - XPF, + case "targetType": return false; - /** - * Unrecognized currency. - */ - XXX, + case "value": return false; + + default: return false; + } + } + } + /** + * The method by which the discount's value is allocated onto its entitled lines. + */ + public enum DiscountApplicationAllocationMethod { /** - * Yemeni Rial (YER). + * The value is spread across all entitled lines. */ - YER, + ACROSS, /** - * South African Rand (ZAR). + * The value is applied onto every entitled line. */ - ZAR, + EACH, /** - * Zambian Kwacha (ZMW). + * The value is specifically applied onto a particular line. + * + * @deprecated Use ACROSS instead. */ - ZMW, - + @Deprecated + ONE, + UNKNOWN_VALUE; - public static CurrencyCode fromGraphQl(String value) { + public static DiscountApplicationAllocationMethod fromGraphQl(String value) { if (value == null) { return null; } switch (value) { - case "AED": { - return AED; - } - - case "AFN": { - return AFN; - } - - case "ALL": { - return ALL; + case "ACROSS": { + return ACROSS; } - case "AMD": { - return AMD; + case "EACH": { + return EACH; } - case "ANG": { - return ANG; + default: { + return UNKNOWN_VALUE; } - - case "AOA": { - return AOA; + } + } + public String toString() { + switch (this) { + case ACROSS: { + return "ACROSS"; } - case "ARS": { - return ARS; + case EACH: { + return "EACH"; } - case "AUD": { - return AUD; + default: { + return ""; } + } + } + } - case "AWG": { - return AWG; - } + public interface DiscountApplicationConnectionQueryDefinition { + void define(DiscountApplicationConnectionQuery _queryBuilder); + } - case "AZN": { - return AZN; - } + /** + * An auto-generated type for paginating through multiple DiscountApplications. + */ + public static class DiscountApplicationConnectionQuery extends Query { + DiscountApplicationConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "BAM": { - return BAM; - } + /** + * A list of edges. + */ + public DiscountApplicationConnectionQuery edges(DiscountApplicationEdgeQueryDefinition queryDef) { + startField("edges"); - case "BBD": { - return BBD; - } + _queryBuilder.append('{'); + queryDef.define(new DiscountApplicationEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "BDT": { - return BDT; - } + return this; + } - case "BGN": { - return BGN; - } + /** + * A list of the nodes contained in DiscountApplicationEdge. + */ + public DiscountApplicationConnectionQuery nodes(DiscountApplicationQueryDefinition queryDef) { + startField("nodes"); - case "BHD": { - return BHD; - } + _queryBuilder.append('{'); + queryDef.define(new DiscountApplicationQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "BIF": { - return BIF; - } + return this; + } - case "BMD": { - return BMD; - } + /** + * Information to aid in pagination. + */ + public DiscountApplicationConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - case "BND": { - return BND; - } + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "BOB": { - return BOB; - } + return this; + } + } - case "BRL": { - return BRL; - } + /** + * An auto-generated type for paginating through multiple DiscountApplications. + */ + public static class DiscountApplicationConnection extends AbstractResponse { + public DiscountApplicationConnection() { + } - case "BSD": { - return BSD; - } + public DiscountApplicationConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new DiscountApplicationEdge(jsonAsObject(element1, key))); + } - case "BTN": { - return BTN; - } + responseData.put(key, list1); - case "BWP": { - return BWP; - } + break; + } - case "BYN": { - return BYN; - } + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(UnknownDiscountApplication.create(jsonAsObject(element1, key))); + } - case "BZD": { - return BZD; - } + responseData.put(key, list1); - case "CAD": { - return CAD; - } + break; + } - case "CDF": { - return CDF; - } + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - case "CHF": { - return CHF; - } + break; + } - case "CLP": { - return CLP; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "CNY": { - return CNY; - } + public String getGraphQlTypeName() { + return "DiscountApplicationConnection"; + } - case "COP": { - return COP; - } + /** + * A list of edges. + */ - case "CRC": { - return CRC; - } + public List getEdges() { + return (List) get("edges"); + } - case "CVE": { - return CVE; - } + public DiscountApplicationConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; + } - case "CZK": { - return CZK; - } + /** + * A list of the nodes contained in DiscountApplicationEdge. + */ - case "DJF": { - return DJF; - } + public List getNodes() { + return (List) get("nodes"); + } - case "DKK": { - return DKK; - } + public DiscountApplicationConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; + } - case "DOP": { - return DOP; - } + /** + * Information to aid in pagination. + */ - case "DZD": { - return DZD; - } + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } - case "EGP": { - return EGP; - } + public DiscountApplicationConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); + return this; + } - case "ERN": { - return ERN; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - case "ETB": { - return ETB; - } + case "nodes": return false; - case "EUR": { - return EUR; - } + case "pageInfo": return true; - case "FJD": { - return FJD; - } + default: return false; + } + } + } - case "FKP": { - return FKP; - } + public interface DiscountApplicationEdgeQueryDefinition { + void define(DiscountApplicationEdgeQuery _queryBuilder); + } - case "GBP": { - return GBP; - } + /** + * An auto-generated type which holds one DiscountApplication and a cursor during pagination. + */ + public static class DiscountApplicationEdgeQuery extends Query { + DiscountApplicationEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "GEL": { - return GEL; - } + /** + * A cursor for use in pagination. + */ + public DiscountApplicationEdgeQuery cursor() { + startField("cursor"); - case "GHS": { - return GHS; - } + return this; + } - case "GIP": { - return GIP; - } + /** + * The item at the end of DiscountApplicationEdge. + */ + public DiscountApplicationEdgeQuery node(DiscountApplicationQueryDefinition queryDef) { + startField("node"); - case "GMD": { - return GMD; - } + _queryBuilder.append('{'); + queryDef.define(new DiscountApplicationQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "GNF": { - return GNF; - } + return this; + } + } - case "GTQ": { - return GTQ; - } + /** + * An auto-generated type which holds one DiscountApplication and a cursor during pagination. + */ + public static class DiscountApplicationEdge extends AbstractResponse { + public DiscountApplicationEdge() { + } - case "GYD": { - return GYD; - } + public DiscountApplicationEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case "HKD": { - return HKD; - } + break; + } - case "HNL": { - return HNL; - } + case "node": { + responseData.put(key, UnknownDiscountApplication.create(jsonAsObject(field.getValue(), key))); - case "HRK": { - return HRK; - } + break; + } - case "HTG": { - return HTG; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "HUF": { - return HUF; - } + public String getGraphQlTypeName() { + return "DiscountApplicationEdge"; + } - case "IDR": { - return IDR; - } + /** + * A cursor for use in pagination. + */ - case "ILS": { - return ILS; - } + public String getCursor() { + return (String) get("cursor"); + } - case "INR": { - return INR; - } + public DiscountApplicationEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); + return this; + } - case "IQD": { - return IQD; - } + /** + * The item at the end of DiscountApplicationEdge. + */ - case "IRR": { - return IRR; - } + public DiscountApplication getNode() { + return (DiscountApplication) get("node"); + } - case "ISK": { - return ISK; - } + public DiscountApplicationEdge setNode(DiscountApplication arg) { + optimisticData.put(getKey("node"), arg); + return this; + } - case "JEP": { - return JEP; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - case "JMD": { - return JMD; - } + case "node": return false; - case "JOD": { - return JOD; - } + default: return false; + } + } + } - case "JPY": { - return JPY; - } + /** + * The lines on the order to which the discount is applied, of the type defined by + * the discount application's `targetType`. For example, the value `ENTITLED`, combined with a + * `targetType` of + * `LINE_ITEM`, applies the discount on all line items that are entitled to the discount. + * The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all + * shipping lines. + */ + public enum DiscountApplicationTargetSelection { + /** + * The discount is allocated onto all the lines. + */ + ALL, - case "KES": { - return KES; - } + /** + * The discount is allocated onto only the lines that it's entitled for. + */ + ENTITLED, - case "KGS": { - return KGS; - } + /** + * The discount is allocated onto explicitly chosen lines. + */ + EXPLICIT, - case "KHR": { - return KHR; - } + UNKNOWN_VALUE; - case "KID": { - return KID; - } + public static DiscountApplicationTargetSelection fromGraphQl(String value) { + if (value == null) { + return null; + } - case "KMF": { - return KMF; + switch (value) { + case "ALL": { + return ALL; } - case "KRW": { - return KRW; + case "ENTITLED": { + return ENTITLED; } - case "KWD": { - return KWD; + case "EXPLICIT": { + return EXPLICIT; } - case "KYD": { - return KYD; + default: { + return UNKNOWN_VALUE; } - - case "KZT": { - return KZT; + } + } + public String toString() { + switch (this) { + case ALL: { + return "ALL"; } - case "LAK": { - return LAK; + case ENTITLED: { + return "ENTITLED"; } - case "LBP": { - return LBP; + case EXPLICIT: { + return "EXPLICIT"; } - case "LKR": { - return LKR; + default: { + return ""; } + } + } + } - case "LRD": { - return LRD; - } - - case "LSL": { - return LSL; - } - - case "LTL": { - return LTL; - } + /** + * The type of line (i.e. line item or shipping line) on an order that the discount is applicable + * towards. + */ + public enum DiscountApplicationTargetType { + /** + * The discount applies onto line items. + */ + LINE_ITEM, - case "LVL": { - return LVL; - } + /** + * The discount applies onto shipping lines. + */ + SHIPPING_LINE, - case "LYD": { - return LYD; - } + UNKNOWN_VALUE; - case "MAD": { - return MAD; - } + public static DiscountApplicationTargetType fromGraphQl(String value) { + if (value == null) { + return null; + } - case "MDL": { - return MDL; + switch (value) { + case "LINE_ITEM": { + return LINE_ITEM; } - case "MGA": { - return MGA; + case "SHIPPING_LINE": { + return SHIPPING_LINE; } - case "MKD": { - return MKD; + default: { + return UNKNOWN_VALUE; } - - case "MMK": { - return MMK; + } + } + public String toString() { + switch (this) { + case LINE_ITEM: { + return "LINE_ITEM"; } - case "MNT": { - return MNT; + case SHIPPING_LINE: { + return "SHIPPING_LINE"; } - case "MOP": { - return MOP; + default: { + return ""; } + } + } + } - case "MRU": { - return MRU; - } + public interface DiscountCodeApplicationQueryDefinition { + void define(DiscountCodeApplicationQuery _queryBuilder); + } - case "MUR": { - return MUR; - } + /** + * Discount code applications capture the intentions of a discount code at + * the time that it is applied. + */ + public static class DiscountCodeApplicationQuery extends Query { + DiscountCodeApplicationQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "MVR": { - return MVR; - } + /** + * The method by which the discount's value is allocated to its entitled items. + */ + public DiscountCodeApplicationQuery allocationMethod() { + startField("allocationMethod"); - case "MWK": { - return MWK; - } + return this; + } - case "MXN": { - return MXN; - } + /** + * Specifies whether the discount code was applied successfully. + */ + public DiscountCodeApplicationQuery applicable() { + startField("applicable"); - case "MYR": { - return MYR; - } + return this; + } - case "MZN": { - return MZN; - } + /** + * The string identifying the discount code that was used at the time of application. + */ + public DiscountCodeApplicationQuery code() { + startField("code"); - case "NAD": { - return NAD; - } + return this; + } - case "NGN": { - return NGN; - } + /** + * Which lines of targetType that the discount is allocated over. + */ + public DiscountCodeApplicationQuery targetSelection() { + startField("targetSelection"); - case "NIO": { - return NIO; - } + return this; + } - case "NOK": { - return NOK; - } + /** + * The type of line that the discount is applicable towards. + */ + public DiscountCodeApplicationQuery targetType() { + startField("targetType"); - case "NPR": { - return NPR; - } + return this; + } - case "NZD": { - return NZD; - } + /** + * The value of the discount application. + */ + public DiscountCodeApplicationQuery value(PricingValueQueryDefinition queryDef) { + startField("value"); - case "OMR": { - return OMR; - } + _queryBuilder.append('{'); + queryDef.define(new PricingValueQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "PAB": { - return PAB; - } + return this; + } + } - case "PEN": { - return PEN; - } + /** + * Discount code applications capture the intentions of a discount code at + * the time that it is applied. + */ + public static class DiscountCodeApplication extends AbstractResponse implements DiscountApplication { + public DiscountCodeApplication() { + } - case "PGK": { - return PGK; - } + public DiscountCodeApplication(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "allocationMethod": { + responseData.put(key, DiscountApplicationAllocationMethod.fromGraphQl(jsonAsString(field.getValue(), key))); - case "PHP": { - return PHP; - } + break; + } - case "PKR": { - return PKR; - } + case "applicable": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - case "PLN": { - return PLN; - } + break; + } - case "PYG": { - return PYG; - } + case "code": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case "QAR": { - return QAR; - } + break; + } - case "RON": { - return RON; - } + case "targetSelection": { + responseData.put(key, DiscountApplicationTargetSelection.fromGraphQl(jsonAsString(field.getValue(), key))); - case "RSD": { - return RSD; - } + break; + } - case "RUB": { - return RUB; - } + case "targetType": { + responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); - case "RWF": { - return RWF; - } + break; + } - case "SAR": { - return SAR; - } + case "value": { + responseData.put(key, UnknownPricingValue.create(jsonAsObject(field.getValue(), key))); - case "SBD": { - return SBD; - } + break; + } - case "SCR": { - return SCR; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "SDG": { - return SDG; - } + public String getGraphQlTypeName() { + return "DiscountCodeApplication"; + } - case "SEK": { - return SEK; - } + /** + * The method by which the discount's value is allocated to its entitled items. + */ - case "SGD": { - return SGD; - } + public DiscountApplicationAllocationMethod getAllocationMethod() { + return (DiscountApplicationAllocationMethod) get("allocationMethod"); + } - case "SHP": { - return SHP; - } + public DiscountCodeApplication setAllocationMethod(DiscountApplicationAllocationMethod arg) { + optimisticData.put(getKey("allocationMethod"), arg); + return this; + } - case "SLL": { - return SLL; - } + /** + * Specifies whether the discount code was applied successfully. + */ - case "SOS": { - return SOS; - } + public Boolean getApplicable() { + return (Boolean) get("applicable"); + } - case "SRD": { - return SRD; - } + public DiscountCodeApplication setApplicable(Boolean arg) { + optimisticData.put(getKey("applicable"), arg); + return this; + } - case "SSP": { - return SSP; - } + /** + * The string identifying the discount code that was used at the time of application. + */ - case "STN": { - return STN; - } + public String getCode() { + return (String) get("code"); + } - case "SYP": { - return SYP; - } + public DiscountCodeApplication setCode(String arg) { + optimisticData.put(getKey("code"), arg); + return this; + } - case "SZL": { - return SZL; - } + /** + * Which lines of targetType that the discount is allocated over. + */ - case "THB": { - return THB; - } + public DiscountApplicationTargetSelection getTargetSelection() { + return (DiscountApplicationTargetSelection) get("targetSelection"); + } - case "TJS": { - return TJS; - } + public DiscountCodeApplication setTargetSelection(DiscountApplicationTargetSelection arg) { + optimisticData.put(getKey("targetSelection"), arg); + return this; + } - case "TMT": { - return TMT; - } + /** + * The type of line that the discount is applicable towards. + */ - case "TND": { - return TND; - } + public DiscountApplicationTargetType getTargetType() { + return (DiscountApplicationTargetType) get("targetType"); + } - case "TOP": { - return TOP; - } + public DiscountCodeApplication setTargetType(DiscountApplicationTargetType arg) { + optimisticData.put(getKey("targetType"), arg); + return this; + } - case "TRY": { - return TRY; - } + /** + * The value of the discount application. + */ - case "TTD": { - return TTD; - } + public PricingValue getValue() { + return (PricingValue) get("value"); + } - case "TWD": { - return TWD; - } + public DiscountCodeApplication setValue(PricingValue arg) { + optimisticData.put(getKey("value"), arg); + return this; + } - case "TZS": { - return TZS; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "allocationMethod": return false; - case "UAH": { - return UAH; - } + case "applicable": return false; - case "UGX": { - return UGX; - } + case "code": return false; - case "USD": { - return USD; - } + case "targetSelection": return false; - case "UYU": { - return UYU; - } + case "targetType": return false; - case "UZS": { - return UZS; - } + case "value": return false; - case "VED": { - return VED; - } + default: return false; + } + } + } - case "VES": { - return VES; - } + public interface DisplayableErrorQueryDefinition { + void define(DisplayableErrorQuery _queryBuilder); + } - case "VND": { - return VND; - } + /** + * Represents an error in the input of a mutation. + */ + public static class DisplayableErrorQuery extends Query { + DisplayableErrorQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - case "VUV": { - return VUV; - } + startField("__typename"); + } - case "WST": { - return WST; - } + /** + * The path to the input field that caused the error. + */ + public DisplayableErrorQuery field() { + startField("field"); - case "XAF": { - return XAF; - } + return this; + } - case "XCD": { - return XCD; - } + /** + * The error message. + */ + public DisplayableErrorQuery message() { + startField("message"); - case "XOF": { - return XOF; - } + return this; + } - case "XPF": { - return XPF; - } + public DisplayableErrorQuery onCartUserError(CartUserErrorQueryDefinition queryDef) { + startInlineFragment("CartUserError"); + queryDef.define(new CartUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case "XXX": { - return XXX; - } + public DisplayableErrorQuery onCustomerUserError(CustomerUserErrorQueryDefinition queryDef) { + startInlineFragment("CustomerUserError"); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case "YER": { - return YER; - } + public DisplayableErrorQuery onMetafieldDeleteUserError(MetafieldDeleteUserErrorQueryDefinition queryDef) { + startInlineFragment("MetafieldDeleteUserError"); + queryDef.define(new MetafieldDeleteUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case "ZAR": { - return ZAR; - } + public DisplayableErrorQuery onMetafieldsSetUserError(MetafieldsSetUserErrorQueryDefinition queryDef) { + startInlineFragment("MetafieldsSetUserError"); + queryDef.define(new MetafieldsSetUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case "ZMW": { - return ZMW; - } + public DisplayableErrorQuery onUserError(UserErrorQueryDefinition queryDef) { + startInlineFragment("UserError"); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - default: { - return UNKNOWN_VALUE; - } - } + public DisplayableErrorQuery onUserErrorsShopPayPaymentRequestSessionUserErrors(UserErrorsShopPayPaymentRequestSessionUserErrorsQueryDefinition queryDef) { + startInlineFragment("UserErrorsShopPayPaymentRequestSessionUserErrors"); + queryDef.define(new UserErrorsShopPayPaymentRequestSessionUserErrorsQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public String toString() { - switch (this) { - case AED: { - return "AED"; - } + } - case AFN: { - return "AFN"; - } + public interface DisplayableError { + String getGraphQlTypeName(); - case ALL: { - return "ALL"; - } + List getField(); - case AMD: { - return "AMD"; - } + String getMessage(); + } - case ANG: { - return "ANG"; - } + /** + * Represents an error in the input of a mutation. + */ + public static class UnknownDisplayableError extends AbstractResponse implements DisplayableError { + public UnknownDisplayableError() { + } - case AOA: { - return "AOA"; - } + public UnknownDisplayableError(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "field": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } - case ARS: { - return "ARS"; - } + optional1 = list1; + } - case AUD: { - return "AUD"; - } + responseData.put(key, optional1); - case AWG: { - return "AWG"; - } + break; + } - case AZN: { - return "AZN"; - } + case "message": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case BAM: { - return "BAM"; - } + break; + } - case BBD: { - return "BBD"; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case BDT: { - return "BDT"; + public static DisplayableError create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "CartUserError": { + return new CartUserError(fields); } - case BGN: { - return "BGN"; + case "CustomerUserError": { + return new CustomerUserError(fields); } - case BHD: { - return "BHD"; + case "MetafieldDeleteUserError": { + return new MetafieldDeleteUserError(fields); } - case BIF: { - return "BIF"; + case "MetafieldsSetUserError": { + return new MetafieldsSetUserError(fields); } - case BMD: { - return "BMD"; + case "UserError": { + return new UserError(fields); } - case BND: { - return "BND"; + case "UserErrorsShopPayPaymentRequestSessionUserErrors": { + return new UserErrorsShopPayPaymentRequestSessionUserErrors(fields); } - case BOB: { - return "BOB"; + default: { + return new UnknownDisplayableError(fields); } + } + } - case BRL: { - return "BRL"; - } + public String getGraphQlTypeName() { + return (String) get("__typename"); + } - case BSD: { - return "BSD"; - } + /** + * The path to the input field that caused the error. + */ - case BTN: { - return "BTN"; - } + public List getField() { + return (List) get("field"); + } - case BWP: { - return "BWP"; - } + public UnknownDisplayableError setField(List arg) { + optimisticData.put(getKey("field"), arg); + return this; + } - case BYN: { - return "BYN"; - } + /** + * The error message. + */ - case BZD: { - return "BZD"; - } + public String getMessage() { + return (String) get("message"); + } - case CAD: { - return "CAD"; - } + public UnknownDisplayableError setMessage(String arg) { + optimisticData.put(getKey("message"), arg); + return this; + } - case CDF: { - return "CDF"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "field": return false; - case CHF: { - return "CHF"; - } + case "message": return false; - case CLP: { - return "CLP"; - } + default: return false; + } + } + } - case CNY: { - return "CNY"; - } + public interface DomainQueryDefinition { + void define(DomainQuery _queryBuilder); + } - case COP: { - return "COP"; - } + /** + * Represents a web address. + */ + public static class DomainQuery extends Query { + DomainQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case CRC: { - return "CRC"; - } + /** + * The host name of the domain (eg: `example.com`). + */ + public DomainQuery host() { + startField("host"); - case CVE: { - return "CVE"; - } + return this; + } - case CZK: { - return "CZK"; - } + /** + * Whether SSL is enabled or not. + */ + public DomainQuery sslEnabled() { + startField("sslEnabled"); - case DJF: { - return "DJF"; - } + return this; + } - case DKK: { - return "DKK"; - } + /** + * The URL of the domain (eg: `https://example.com`). + */ + public DomainQuery url() { + startField("url"); - case DOP: { - return "DOP"; - } + return this; + } + } - case DZD: { - return "DZD"; - } + /** + * Represents a web address. + */ + public static class Domain extends AbstractResponse { + public Domain() { + } - case EGP: { - return "EGP"; - } + public Domain(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "host": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case ERN: { - return "ERN"; - } + break; + } - case ETB: { - return "ETB"; - } + case "sslEnabled": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - case EUR: { - return "EUR"; - } + break; + } - case FJD: { - return "FJD"; - } + case "url": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case FKP: { - return "FKP"; - } + break; + } - case GBP: { - return "GBP"; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case GEL: { - return "GEL"; - } + public String getGraphQlTypeName() { + return "Domain"; + } - case GHS: { - return "GHS"; - } + /** + * The host name of the domain (eg: `example.com`). + */ - case GIP: { - return "GIP"; - } + public String getHost() { + return (String) get("host"); + } - case GMD: { - return "GMD"; - } + public Domain setHost(String arg) { + optimisticData.put(getKey("host"), arg); + return this; + } - case GNF: { - return "GNF"; - } + /** + * Whether SSL is enabled or not. + */ - case GTQ: { - return "GTQ"; - } + public Boolean getSslEnabled() { + return (Boolean) get("sslEnabled"); + } - case GYD: { - return "GYD"; - } + public Domain setSslEnabled(Boolean arg) { + optimisticData.put(getKey("sslEnabled"), arg); + return this; + } - case HKD: { - return "HKD"; - } + /** + * The URL of the domain (eg: `https://example.com`). + */ - case HNL: { - return "HNL"; - } + public String getUrl() { + return (String) get("url"); + } - case HRK: { - return "HRK"; - } + public Domain setUrl(String arg) { + optimisticData.put(getKey("url"), arg); + return this; + } - case HTG: { - return "HTG"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "host": return false; - case HUF: { - return "HUF"; - } + case "sslEnabled": return false; - case IDR: { - return "IDR"; - } + case "url": return false; - case ILS: { - return "ILS"; - } + default: return false; + } + } + } - case INR: { - return "INR"; - } + public interface ExternalVideoQueryDefinition { + void define(ExternalVideoQuery _queryBuilder); + } - case IQD: { - return "IQD"; - } + /** + * Represents a video hosted outside of Shopify. + */ + public static class ExternalVideoQuery extends Query { + ExternalVideoQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - case IRR: { - return "IRR"; - } + startField("id"); + } - case ISK: { - return "ISK"; - } + /** + * A word or phrase to share the nature or contents of a media. + */ + public ExternalVideoQuery alt() { + startField("alt"); - case JEP: { - return "JEP"; - } + return this; + } - case JMD: { - return "JMD"; - } + /** + * The embed URL of the video for the respective host. + */ + public ExternalVideoQuery embedUrl() { + startField("embedUrl"); - case JOD: { - return "JOD"; - } + return this; + } - case JPY: { - return "JPY"; - } + /** + * The URL. + * + * @deprecated Use `originUrl` instead. + */ + @Deprecated + public ExternalVideoQuery embeddedUrl() { + startField("embeddedUrl"); - case KES: { - return "KES"; - } + return this; + } - case KGS: { - return "KGS"; - } + /** + * The host of the external video. + */ + public ExternalVideoQuery host() { + startField("host"); - case KHR: { - return "KHR"; - } + return this; + } - case KID: { - return "KID"; - } + /** + * The media content type. + */ + public ExternalVideoQuery mediaContentType() { + startField("mediaContentType"); - case KMF: { - return "KMF"; - } + return this; + } - case KRW: { - return "KRW"; - } + /** + * The origin URL of the video on the respective host. + */ + public ExternalVideoQuery originUrl() { + startField("originUrl"); - case KWD: { - return "KWD"; - } + return this; + } - case KYD: { - return "KYD"; - } + /** + * The presentation for a media. + */ + public ExternalVideoQuery presentation(MediaPresentationQueryDefinition queryDef) { + startField("presentation"); - case KZT: { - return "KZT"; - } + _queryBuilder.append('{'); + queryDef.define(new MediaPresentationQuery(_queryBuilder)); + _queryBuilder.append('}'); - case LAK: { - return "LAK"; - } + return this; + } - case LBP: { - return "LBP"; - } + /** + * The preview image for the media. + */ + public ExternalVideoQuery previewImage(ImageQueryDefinition queryDef) { + startField("previewImage"); - case LKR: { - return "LKR"; - } + _queryBuilder.append('{'); + queryDef.define(new ImageQuery(_queryBuilder)); + _queryBuilder.append('}'); - case LRD: { - return "LRD"; - } + return this; + } + } - case LSL: { - return "LSL"; - } + /** + * Represents a video hosted outside of Shopify. + */ + public static class ExternalVideo extends AbstractResponse implements Media, Node { + public ExternalVideo() { + } - case LTL: { - return "LTL"; - } - - case LVL: { - return "LVL"; - } - - case LYD: { - return "LYD"; - } - - case MAD: { - return "MAD"; - } - - case MDL: { - return "MDL"; - } - - case MGA: { - return "MGA"; - } - - case MKD: { - return "MKD"; - } - - case MMK: { - return "MMK"; - } - - case MNT: { - return "MNT"; - } - - case MOP: { - return "MOP"; - } - - case MRU: { - return "MRU"; - } - - case MUR: { - return "MUR"; - } - - case MVR: { - return "MVR"; - } - - case MWK: { - return "MWK"; - } - - case MXN: { - return "MXN"; - } - - case MYR: { - return "MYR"; - } - - case MZN: { - return "MZN"; - } - - case NAD: { - return "NAD"; - } - - case NGN: { - return "NGN"; - } + public ExternalVideo(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "alt": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case NIO: { - return "NIO"; - } + responseData.put(key, optional1); - case NOK: { - return "NOK"; - } + break; + } - case NPR: { - return "NPR"; - } + case "embedUrl": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case NZD: { - return "NZD"; - } + break; + } - case OMR: { - return "OMR"; - } + case "embeddedUrl": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case PAB: { - return "PAB"; - } + break; + } - case PEN: { - return "PEN"; - } + case "host": { + responseData.put(key, MediaHost.fromGraphQl(jsonAsString(field.getValue(), key))); - case PGK: { - return "PGK"; - } + break; + } - case PHP: { - return "PHP"; - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - case PKR: { - return "PKR"; - } + break; + } - case PLN: { - return "PLN"; - } + case "mediaContentType": { + responseData.put(key, MediaContentType.fromGraphQl(jsonAsString(field.getValue(), key))); - case PYG: { - return "PYG"; - } + break; + } - case QAR: { - return "QAR"; - } + case "originUrl": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case RON: { - return "RON"; - } + break; + } - case RSD: { - return "RSD"; - } + case "presentation": { + MediaPresentation optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MediaPresentation(jsonAsObject(field.getValue(), key)); + } - case RUB: { - return "RUB"; - } + responseData.put(key, optional1); - case RWF: { - return "RWF"; - } + break; + } - case SAR: { - return "SAR"; - } + case "previewImage": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); + } - case SBD: { - return "SBD"; - } + responseData.put(key, optional1); - case SCR: { - return "SCR"; - } + break; + } - case SDG: { - return "SDG"; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case SEK: { - return "SEK"; - } + public ExternalVideo(ID id) { + this(); + optimisticData.put("id", id); + } - case SGD: { - return "SGD"; - } + public String getGraphQlTypeName() { + return "ExternalVideo"; + } - case SHP: { - return "SHP"; - } + /** + * A word or phrase to share the nature or contents of a media. + */ - case SLL: { - return "SLL"; - } + public String getAlt() { + return (String) get("alt"); + } - case SOS: { - return "SOS"; - } + public ExternalVideo setAlt(String arg) { + optimisticData.put(getKey("alt"), arg); + return this; + } - case SRD: { - return "SRD"; - } + /** + * The embed URL of the video for the respective host. + */ - case SSP: { - return "SSP"; - } + public String getEmbedUrl() { + return (String) get("embedUrl"); + } - case STN: { - return "STN"; - } + public ExternalVideo setEmbedUrl(String arg) { + optimisticData.put(getKey("embedUrl"), arg); + return this; + } - case SYP: { - return "SYP"; - } + /** + * The URL. + * + * @deprecated Use `originUrl` instead. + */ - case SZL: { - return "SZL"; - } + public String getEmbeddedUrl() { + return (String) get("embeddedUrl"); + } - case THB: { - return "THB"; - } + public ExternalVideo setEmbeddedUrl(String arg) { + optimisticData.put(getKey("embeddedUrl"), arg); + return this; + } - case TJS: { - return "TJS"; - } + /** + * The host of the external video. + */ - case TMT: { - return "TMT"; - } + public MediaHost getHost() { + return (MediaHost) get("host"); + } - case TND: { - return "TND"; - } + public ExternalVideo setHost(MediaHost arg) { + optimisticData.put(getKey("host"), arg); + return this; + } - case TOP: { - return "TOP"; - } + /** + * A globally-unique ID. + */ - case TRY: { - return "TRY"; - } + public ID getId() { + return (ID) get("id"); + } - case TTD: { - return "TTD"; - } + /** + * The media content type. + */ - case TWD: { - return "TWD"; - } + public MediaContentType getMediaContentType() { + return (MediaContentType) get("mediaContentType"); + } - case TZS: { - return "TZS"; - } + public ExternalVideo setMediaContentType(MediaContentType arg) { + optimisticData.put(getKey("mediaContentType"), arg); + return this; + } - case UAH: { - return "UAH"; - } + /** + * The origin URL of the video on the respective host. + */ - case UGX: { - return "UGX"; - } + public String getOriginUrl() { + return (String) get("originUrl"); + } - case USD: { - return "USD"; - } + public ExternalVideo setOriginUrl(String arg) { + optimisticData.put(getKey("originUrl"), arg); + return this; + } - case UYU: { - return "UYU"; - } + /** + * The presentation for a media. + */ - case UZS: { - return "UZS"; - } + public MediaPresentation getPresentation() { + return (MediaPresentation) get("presentation"); + } - case VED: { - return "VED"; - } + public ExternalVideo setPresentation(MediaPresentation arg) { + optimisticData.put(getKey("presentation"), arg); + return this; + } - case VES: { - return "VES"; - } + /** + * The preview image for the media. + */ - case VND: { - return "VND"; - } + public Image getPreviewImage() { + return (Image) get("previewImage"); + } - case VUV: { - return "VUV"; - } + public ExternalVideo setPreviewImage(Image arg) { + optimisticData.put(getKey("previewImage"), arg); + return this; + } - case WST: { - return "WST"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "alt": return false; - case XAF: { - return "XAF"; - } + case "embedUrl": return false; - case XCD: { - return "XCD"; - } + case "embeddedUrl": return false; - case XOF: { - return "XOF"; - } + case "host": return false; - case XPF: { - return "XPF"; - } + case "id": return false; - case XXX: { - return "XXX"; - } + case "mediaContentType": return false; - case YER: { - return "YER"; - } + case "originUrl": return false; - case ZAR: { - return "ZAR"; - } + case "presentation": return true; - case ZMW: { - return "ZMW"; - } + case "previewImage": return true; - default: { - return ""; - } + default: return false; } } } - public interface CustomerQueryDefinition { - void define(CustomerQuery _queryBuilder); + public interface FilterQueryDefinition { + void define(FilterQuery _queryBuilder); } /** - * A customer represents a customer account with the shop. Customer accounts store contact information - * for the customer, saving logged-in customers the trouble of having to provide it at every checkout. + * A filter that is supported on the parent field. */ - public static class CustomerQuery extends Query { - CustomerQuery(StringBuilder _queryBuilder) { + public static class FilterQuery extends Query { + FilterQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * Indicates whether the customer has consented to be sent marketing material via email. + * A unique identifier. */ - public CustomerQuery acceptsMarketing() { - startField("acceptsMarketing"); + public FilterQuery id() { + startField("id"); return this; } - public class AddressesArguments extends Arguments { - AddressesArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public AddressesArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public AddressesArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the last `n` elements from the list. - */ - public AddressesArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public AddressesArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Reverse the order of the underlying list. - */ - public AddressesArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - } + /** + * A human-friendly string for this filter. + */ + public FilterQuery label() { + startField("label"); - public interface AddressesArgumentsDefinition { - void define(AddressesArguments args); + return this; } /** - * A list of addresses for the customer. + * Describes how to present the filter values. + * Returns a value only for filters of type `LIST`. Returns null for other types. */ - public CustomerQuery addresses(MailingAddressConnectionQueryDefinition queryDef) { - return addresses(args -> {}, queryDef); + public FilterQuery presentation() { + startField("presentation"); + + return this; } /** - * A list of addresses for the customer. - */ - public CustomerQuery addresses(AddressesArgumentsDefinition argsDef, MailingAddressConnectionQueryDefinition queryDef) { - startField("addresses"); - - AddressesArguments args = new AddressesArguments(_queryBuilder); - argsDef.define(args); - AddressesArguments.end(args); - - _queryBuilder.append('{'); - queryDef.define(new MailingAddressConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The date and time when the customer was created. + * An enumeration that denotes the type of data this filter represents. */ - public CustomerQuery createdAt() { - startField("createdAt"); + public FilterQuery type() { + startField("type"); return this; } /** - * The customer’s default address. + * The list of values for this filter. */ - public CustomerQuery defaultAddress(MailingAddressQueryDefinition queryDef) { - startField("defaultAddress"); + public FilterQuery values(FilterValueQueryDefinition queryDef) { + startField("values"); _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); + queryDef.define(new FilterValueQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - /** - * The customer’s name, email or phone number. - */ - public CustomerQuery displayName() { - startField("displayName"); + /** + * A filter that is supported on the parent field. + */ + public static class Filter extends AbstractResponse { + public Filter() { + } - return this; + public Filter(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "id": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "label": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "presentation": { + FilterPresentation optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = FilterPresentation.fromGraphQl(jsonAsString(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "type": { + responseData.put(key, FilterType.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "values": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new FilterValue(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "Filter"; } /** - * The customer’s email address. + * A unique identifier. */ - public CustomerQuery email() { - startField("email"); + public String getId() { + return (String) get("id"); + } + + public Filter setId(String arg) { + optimisticData.put(getKey("id"), arg); return this; } /** - * The customer’s first name. + * A human-friendly string for this filter. */ - public CustomerQuery firstName() { - startField("firstName"); + public String getLabel() { + return (String) get("label"); + } + + public Filter setLabel(String arg) { + optimisticData.put(getKey("label"), arg); return this; } /** - * A unique ID for the customer. + * Describes how to present the filter values. + * Returns a value only for filters of type `LIST`. Returns null for other types. */ - public CustomerQuery id() { - startField("id"); + public FilterPresentation getPresentation() { + return (FilterPresentation) get("presentation"); + } + + public Filter setPresentation(FilterPresentation arg) { + optimisticData.put(getKey("presentation"), arg); return this; } /** - * The customer's most recently updated, incomplete checkout. - * - * @deprecated 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. + * An enumeration that denotes the type of data this filter represents. */ - @Deprecated - public CustomerQuery lastIncompleteCheckout(CheckoutQueryDefinition queryDef) { - startField("lastIncompleteCheckout"); - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + public FilterType getType() { + return (FilterType) get("type"); + } + public Filter setType(FilterType arg) { + optimisticData.put(getKey("type"), arg); return this; } /** - * The customer’s last name. + * The list of values for this filter. */ - public CustomerQuery lastName() { - startField("lastName"); + public List getValues() { + return (List) get("values"); + } + + public Filter setValues(List arg) { + optimisticData.put(getKey("values"), arg); return this; } - public class MetafieldArguments extends Arguments { - MetafieldArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "id": return false; - /** - * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. - */ - public MetafieldArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - } + case "label": return false; - public interface MetafieldArgumentsDefinition { - void define(MetafieldArguments args); + case "presentation": return false; + + case "type": return false; + + case "values": return true; + + default: return false; + } } + } + /** + * Defines how to present the filter values, specifies the presentation of the filter. + */ + public enum FilterPresentation { /** - * Returns a metafield found by namespace and key. + * Image presentation, filter values display an image. */ - public CustomerQuery metafield(String key, MetafieldQueryDefinition queryDef) { - return metafield(key, args -> {}, queryDef); - } + IMAGE, /** - * Returns a metafield found by namespace and key. + * Swatch presentation, filter values display color or image patterns. */ - public CustomerQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { - startField("metafield"); + SWATCH, - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + /** + * Text presentation, no additional visual display for filter values. + */ + TEXT, - argsDef.define(new MetafieldArguments(_queryBuilder)); + UNKNOWN_VALUE; - _queryBuilder.append(')'); + public static FilterPresentation fromGraphQl(String value) { + if (value == null) { + return null; + } - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + switch (value) { + case "IMAGE": { + return IMAGE; + } - return this; - } + case "SWATCH": { + return SWATCH; + } - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ - public CustomerQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); + case "TEXT": { + return TEXT; + } - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); + default: { + return UNKNOWN_VALUE; } } - _queryBuilder.append(']'); + } + public String toString() { + switch (this) { + case IMAGE: { + return "IMAGE"; + } - _queryBuilder.append(')'); + case SWATCH: { + return "SWATCH"; + } - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + case TEXT: { + return "TEXT"; + } - return this; + default: { + return ""; + } + } } + } + /** + * The type of data that the filter group represents. + * For more information, refer to [Filter products in a collection with the Storefront API] + * (https://shopify.dev/custom-storefronts/products-collections/filter-products). + */ + public enum FilterType { /** - * The number of orders that the customer has made at the store in their lifetime. + * A boolean value. */ - public CustomerQuery numberOfOrders() { - startField("numberOfOrders"); + BOOLEAN, - return this; - } + /** + * A list of selectable values. + */ + LIST, - public class OrdersArguments extends Arguments { - OrdersArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); + /** + * A range of prices. + */ + PRICE_RANGE, + + UNKNOWN_VALUE; + + public static FilterType fromGraphQl(String value) { + if (value == null) { + return null; } - /** - * Returns up to the first `n` elements from the list. - */ - public OrdersArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); + switch (value) { + case "BOOLEAN": { + return BOOLEAN; } - return this; - } - /** - * Returns the elements that come after the specified cursor. - */ - public OrdersArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "LIST": { + return LIST; } - return this; - } - /** - * Returns up to the last `n` elements from the list. - */ - public OrdersArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); + case "PRICE_RANGE": { + return PRICE_RANGE; } - return this; - } - /** - * Returns the elements that come before the specified cursor. - */ - public OrdersArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); + default: { + return UNKNOWN_VALUE; } - return this; } + } + public String toString() { + switch (this) { + case BOOLEAN: { + return "BOOLEAN"; + } - /** - * Reverse the order of the underlying list. - */ - public OrdersArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); + case LIST: { + return "LIST"; } - return this; - } - /** - * Sort the underlying list by the given key. - */ - public OrdersArguments sortKey(OrderSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); + case PRICE_RANGE: { + return "PRICE_RANGE"; } - return this; - } - /** - * Apply one or multiple filters to the query. - * | name | description | acceptable_values | default_value | example_use | - * | ---- | ---- | ---- | ---- | ---- | - * | processed_at | - * Refer to the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) for more - * information about using filters. - */ - public OrdersArguments query(String value) { - if (value != null) { - startArgument("query"); - Query.appendQuotedString(_queryBuilder, value.toString()); + default: { + return ""; } - return this; } } + } - public interface OrdersArgumentsDefinition { - void define(OrdersArguments args); + public interface FilterValueQueryDefinition { + void define(FilterValueQuery _queryBuilder); + } + + /** + * A selectable value within a filter. + */ + public static class FilterValueQuery extends Query { + FilterValueQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The orders associated with the customer. + * The number of results that match this filter value. */ - public CustomerQuery orders(OrderConnectionQueryDefinition queryDef) { - return orders(args -> {}, queryDef); + public FilterValueQuery count() { + startField("count"); + + return this; } /** - * The orders associated with the customer. + * A unique identifier. */ - public CustomerQuery orders(OrdersArgumentsDefinition argsDef, OrderConnectionQueryDefinition queryDef) { - startField("orders"); + public FilterValueQuery id() { + startField("id"); - OrdersArguments args = new OrdersArguments(_queryBuilder); - argsDef.define(args); - OrdersArguments.end(args); + return this; + } + + /** + * The visual representation when the filter's presentation is `IMAGE`. + */ + public FilterValueQuery image(MediaImageQueryDefinition queryDef) { + startField("image"); _queryBuilder.append('{'); - queryDef.define(new OrderConnectionQuery(_queryBuilder)); + queryDef.define(new MediaImageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The customer’s phone number. + * An input object that can be used to filter by this value on the parent field. + * The value is provided as a helper for building dynamic filtering UI. For + * example, if you have a list of selected `FilterValue` objects, you can combine + * their respective `input` values to use in a subsequent query. */ - public CustomerQuery phone() { - startField("phone"); + public FilterValueQuery input() { + startField("input"); return this; } /** - * A comma separated list of tags that have been added to the customer. - * Additional access scope required: unauthenticated_read_customer_tags. + * A human-friendly string for this filter value. */ - public CustomerQuery tags() { - startField("tags"); + public FilterValueQuery label() { + startField("label"); return this; } /** - * The date and time when the customer information was updated. + * The visual representation when the filter's presentation is `SWATCH`. */ - public CustomerQuery updatedAt() { - startField("updatedAt"); + public FilterValueQuery swatch(SwatchQueryDefinition queryDef) { + startField("swatch"); + + _queryBuilder.append('{'); + queryDef.define(new SwatchQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * A customer represents a customer account with the shop. Customer accounts store contact information - * for the customer, saving logged-in customers the trouble of having to provide it at every checkout. + * A selectable value within a filter. */ - public static class Customer extends AbstractResponse implements HasMetafields, MetafieldParentResource { - public Customer() { + public static class FilterValue extends AbstractResponse { + public FilterValue() { } - public Customer(JsonObject fields) throws SchemaViolationError { + public FilterValue(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "acceptsMarketing": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "addresses": { - responseData.put(key, new MailingAddressConnection(jsonAsObject(field.getValue(), key))); + case "count": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); break; } - case "createdAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + case "id": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "defaultAddress": { - MailingAddress optional1 = null; + case "image": { + MediaImage optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); + optional1 = new MediaImage(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -30151,27 +30737,22 @@ public Customer(JsonObject fields) throws SchemaViolationError { break; } - case "displayName": { + case "input": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "email": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "label": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "firstName": { - String optional1 = null; + case "swatch": { + Swatch optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new Swatch(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -30179,434 +30760,444 @@ public Customer(JsonObject fields) throws SchemaViolationError { break; } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - case "lastIncompleteCheckout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } + public String getGraphQlTypeName() { + return "FilterValue"; + } - responseData.put(key, optional1); + /** + * The number of results that match this filter value. + */ - break; - } - - case "lastName": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "metafield": { - Metafield optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "metafields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } - - list1.add(optional2); - } - - responseData.put(key, list1); - - break; - } - - case "numberOfOrders": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "orders": { - responseData.put(key, new OrderConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "phone": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "tags": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } - - responseData.put(key, list1); - - break; - } - - case "updatedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public Integer getCount() { + return (Integer) get("count"); } - public String getGraphQlTypeName() { - return "Customer"; + public FilterValue setCount(Integer arg) { + optimisticData.put(getKey("count"), arg); + return this; } /** - * Indicates whether the customer has consented to be sent marketing material via email. + * A unique identifier. */ - public Boolean getAcceptsMarketing() { - return (Boolean) get("acceptsMarketing"); + public String getId() { + return (String) get("id"); } - public Customer setAcceptsMarketing(Boolean arg) { - optimisticData.put(getKey("acceptsMarketing"), arg); + public FilterValue setId(String arg) { + optimisticData.put(getKey("id"), arg); return this; } /** - * A list of addresses for the customer. + * The visual representation when the filter's presentation is `IMAGE`. */ - public MailingAddressConnection getAddresses() { - return (MailingAddressConnection) get("addresses"); + public MediaImage getImage() { + return (MediaImage) get("image"); } - public Customer setAddresses(MailingAddressConnection arg) { - optimisticData.put(getKey("addresses"), arg); + public FilterValue setImage(MediaImage arg) { + optimisticData.put(getKey("image"), arg); return this; } /** - * The date and time when the customer was created. + * An input object that can be used to filter by this value on the parent field. + * The value is provided as a helper for building dynamic filtering UI. For + * example, if you have a list of selected `FilterValue` objects, you can combine + * their respective `input` values to use in a subsequent query. */ - public DateTime getCreatedAt() { - return (DateTime) get("createdAt"); + public String getInput() { + return (String) get("input"); } - public Customer setCreatedAt(DateTime arg) { - optimisticData.put(getKey("createdAt"), arg); + public FilterValue setInput(String arg) { + optimisticData.put(getKey("input"), arg); return this; } /** - * The customer’s default address. + * A human-friendly string for this filter value. */ - public MailingAddress getDefaultAddress() { - return (MailingAddress) get("defaultAddress"); + public String getLabel() { + return (String) get("label"); } - public Customer setDefaultAddress(MailingAddress arg) { - optimisticData.put(getKey("defaultAddress"), arg); + public FilterValue setLabel(String arg) { + optimisticData.put(getKey("label"), arg); return this; } /** - * The customer’s name, email or phone number. + * The visual representation when the filter's presentation is `SWATCH`. */ - public String getDisplayName() { - return (String) get("displayName"); + public Swatch getSwatch() { + return (Swatch) get("swatch"); } - public Customer setDisplayName(String arg) { - optimisticData.put(getKey("displayName"), arg); + public FilterValue setSwatch(Swatch arg) { + optimisticData.put(getKey("swatch"), arg); return this; } - /** - * The customer’s email address. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "count": return false; - public String getEmail() { - return (String) get("email"); + case "id": return false; + + case "image": return true; + + case "input": return false; + + case "label": return false; + + case "swatch": return true; + + default: return false; + } } + } - public Customer setEmail(String arg) { - optimisticData.put(getKey("email"), arg); - return this; + public interface FulfillmentQueryDefinition { + void define(FulfillmentQuery _queryBuilder); + } + + /** + * Represents a single fulfillment in an order. + */ + public static class FulfillmentQuery extends Query { + FulfillmentQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } - /** - * The customer’s first name. - */ + public class FulfillmentLineItemsArguments extends Arguments { + FulfillmentLineItemsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - public String getFirstName() { - return (String) get("firstName"); + /** + * Returns up to the first `n` elements from the list. + */ + public FulfillmentLineItemsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come after the specified cursor. + */ + public FulfillmentLineItemsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Returns up to the last `n` elements from the list. + */ + public FulfillmentLineItemsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come before the specified cursor. + */ + public FulfillmentLineItemsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Reverse the order of the underlying list. + */ + public FulfillmentLineItemsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } } - public Customer setFirstName(String arg) { - optimisticData.put(getKey("firstName"), arg); - return this; + public interface FulfillmentLineItemsArgumentsDefinition { + void define(FulfillmentLineItemsArguments args); } /** - * A unique ID for the customer. + * List of the fulfillment's line items. */ - - public ID getId() { - return (ID) get("id"); - } - - public Customer setId(ID arg) { - optimisticData.put(getKey("id"), arg); - return this; + public FulfillmentQuery fulfillmentLineItems(FulfillmentLineItemConnectionQueryDefinition queryDef) { + return fulfillmentLineItems(args -> {}, queryDef); } /** - * The customer's most recently updated, incomplete checkout. - * - * @deprecated 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. + * List of the fulfillment's line items. */ + public FulfillmentQuery fulfillmentLineItems(FulfillmentLineItemsArgumentsDefinition argsDef, FulfillmentLineItemConnectionQueryDefinition queryDef) { + startField("fulfillmentLineItems"); - public Checkout getLastIncompleteCheckout() { - return (Checkout) get("lastIncompleteCheckout"); - } + FulfillmentLineItemsArguments args = new FulfillmentLineItemsArguments(_queryBuilder); + argsDef.define(args); + FulfillmentLineItemsArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new FulfillmentLineItemConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Customer setLastIncompleteCheckout(Checkout arg) { - optimisticData.put(getKey("lastIncompleteCheckout"), arg); return this; } /** - * The customer’s last name. + * The name of the tracking company. */ + public FulfillmentQuery trackingCompany() { + startField("trackingCompany"); - public String getLastName() { - return (String) get("lastName"); - } - - public Customer setLastName(String arg) { - optimisticData.put(getKey("lastName"), arg); return this; } - /** - * Returns a metafield found by namespace and key. - */ + public class TrackingInfoArguments extends Arguments { + TrackingInfoArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - public Metafield getMetafield() { - return (Metafield) get("metafield"); + /** + * Truncate the array result to this size. + */ + public TrackingInfoArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } } - public Customer setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); - return this; + public interface TrackingInfoArgumentsDefinition { + void define(TrackingInfoArguments args); } /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * Tracking information associated with the fulfillment, + * such as the tracking number and tracking URL. */ - - public List getMetafields() { - return (List) get("metafields"); - } - - public Customer setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); - return this; + public FulfillmentQuery trackingInfo(FulfillmentTrackingInfoQueryDefinition queryDef) { + return trackingInfo(args -> {}, queryDef); } /** - * The number of orders that the customer has made at the store in their lifetime. + * Tracking information associated with the fulfillment, + * such as the tracking number and tracking URL. */ + public FulfillmentQuery trackingInfo(TrackingInfoArgumentsDefinition argsDef, FulfillmentTrackingInfoQueryDefinition queryDef) { + startField("trackingInfo"); - public String getNumberOfOrders() { - return (String) get("numberOfOrders"); - } + TrackingInfoArguments args = new TrackingInfoArguments(_queryBuilder); + argsDef.define(args); + TrackingInfoArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new FulfillmentTrackingInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Customer setNumberOfOrders(String arg) { - optimisticData.put(getKey("numberOfOrders"), arg); return this; } + } - /** - * The orders associated with the customer. - */ + /** + * Represents a single fulfillment in an order. + */ + public static class Fulfillment extends AbstractResponse { + public Fulfillment() { + } - public OrderConnection getOrders() { - return (OrderConnection) get("orders"); + public Fulfillment(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "fulfillmentLineItems": { + responseData.put(key, new FulfillmentLineItemConnection(jsonAsObject(field.getValue(), key))); + + break; + } + + case "trackingCompany": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "trackingInfo": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new FulfillmentTrackingInfo(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public Customer setOrders(OrderConnection arg) { - optimisticData.put(getKey("orders"), arg); - return this; + public String getGraphQlTypeName() { + return "Fulfillment"; } /** - * The customer’s phone number. + * List of the fulfillment's line items. */ - public String getPhone() { - return (String) get("phone"); + public FulfillmentLineItemConnection getFulfillmentLineItems() { + return (FulfillmentLineItemConnection) get("fulfillmentLineItems"); } - public Customer setPhone(String arg) { - optimisticData.put(getKey("phone"), arg); + public Fulfillment setFulfillmentLineItems(FulfillmentLineItemConnection arg) { + optimisticData.put(getKey("fulfillmentLineItems"), arg); return this; } /** - * A comma separated list of tags that have been added to the customer. - * Additional access scope required: unauthenticated_read_customer_tags. + * The name of the tracking company. */ - public List getTags() { - return (List) get("tags"); + public String getTrackingCompany() { + return (String) get("trackingCompany"); } - public Customer setTags(List arg) { - optimisticData.put(getKey("tags"), arg); + public Fulfillment setTrackingCompany(String arg) { + optimisticData.put(getKey("trackingCompany"), arg); return this; } /** - * The date and time when the customer information was updated. + * Tracking information associated with the fulfillment, + * such as the tracking number and tracking URL. */ - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); + public List getTrackingInfo() { + return (List) get("trackingInfo"); } - public Customer setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); + public Fulfillment setTrackingInfo(List arg) { + optimisticData.put(getKey("trackingInfo"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "acceptsMarketing": return false; - - case "addresses": return true; - - case "createdAt": return false; - - case "defaultAddress": return true; - - case "displayName": return false; - - case "email": return false; - - case "firstName": return false; - - case "id": return false; - - case "lastIncompleteCheckout": return true; - - case "lastName": return false; - - case "metafield": return true; - - case "metafields": return true; - - case "numberOfOrders": return false; - - case "orders": return true; - - case "phone": return false; + case "fulfillmentLineItems": return true; - case "tags": return false; + case "trackingCompany": return false; - case "updatedAt": return false; + case "trackingInfo": return true; default: return false; } } } - public interface CustomerAccessTokenQueryDefinition { - void define(CustomerAccessTokenQuery _queryBuilder); + public interface FulfillmentLineItemQueryDefinition { + void define(FulfillmentLineItemQuery _queryBuilder); } /** - * A CustomerAccessToken represents the unique token required to make modifications to the customer - * object. + * Represents a single line item in a fulfillment. There is at most one fulfillment line item for each + * order line item. */ - public static class CustomerAccessTokenQuery extends Query { - CustomerAccessTokenQuery(StringBuilder _queryBuilder) { + public static class FulfillmentLineItemQuery extends Query { + FulfillmentLineItemQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The customer’s access token. + * The associated order's line item. */ - public CustomerAccessTokenQuery accessToken() { - startField("accessToken"); + public FulfillmentLineItemQuery lineItem(OrderLineItemQueryDefinition queryDef) { + startField("lineItem"); + + _queryBuilder.append('{'); + queryDef.define(new OrderLineItemQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The date and time when the customer access token expires. + * The amount fulfilled in this fulfillment. */ - public CustomerAccessTokenQuery expiresAt() { - startField("expiresAt"); + public FulfillmentLineItemQuery quantity() { + startField("quantity"); return this; } } /** - * A CustomerAccessToken represents the unique token required to make modifications to the customer - * object. + * Represents a single line item in a fulfillment. There is at most one fulfillment line item for each + * order line item. */ - public static class CustomerAccessToken extends AbstractResponse { - public CustomerAccessToken() { + public static class FulfillmentLineItem extends AbstractResponse { + public FulfillmentLineItem() { } - public CustomerAccessToken(JsonObject fields) throws SchemaViolationError { + public FulfillmentLineItem(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "accessToken": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "lineItem": { + responseData.put(key, new OrderLineItem(jsonAsObject(field.getValue(), key))); break; } - case "expiresAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + case "quantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); break; } @@ -30623,142 +31214,92 @@ public CustomerAccessToken(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CustomerAccessToken"; + return "FulfillmentLineItem"; } /** - * The customer’s access token. + * The associated order's line item. */ - public String getAccessToken() { - return (String) get("accessToken"); + public OrderLineItem getLineItem() { + return (OrderLineItem) get("lineItem"); } - public CustomerAccessToken setAccessToken(String arg) { - optimisticData.put(getKey("accessToken"), arg); + public FulfillmentLineItem setLineItem(OrderLineItem arg) { + optimisticData.put(getKey("lineItem"), arg); return this; } /** - * The date and time when the customer access token expires. + * The amount fulfilled in this fulfillment. */ - public DateTime getExpiresAt() { - return (DateTime) get("expiresAt"); + public Integer getQuantity() { + return (Integer) get("quantity"); } - public CustomerAccessToken setExpiresAt(DateTime arg) { - optimisticData.put(getKey("expiresAt"), arg); + public FulfillmentLineItem setQuantity(Integer arg) { + optimisticData.put(getKey("quantity"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "accessToken": return false; + case "lineItem": return true; - case "expiresAt": return false; + case "quantity": return false; default: return false; } } } - public static class CustomerAccessTokenCreateInput implements Serializable { - private String email; - - private String password; - - public CustomerAccessTokenCreateInput(String email, String password) { - this.email = email; - - this.password = password; - } - - public String getEmail() { - return email; - } - - public CustomerAccessTokenCreateInput setEmail(String email) { - this.email = email; - return this; - } - - public String getPassword() { - return password; - } - - public CustomerAccessTokenCreateInput setPassword(String password) { - this.password = password; - return this; - } - - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("email:"); - Query.appendQuotedString(_queryBuilder, email.toString()); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("password:"); - Query.appendQuotedString(_queryBuilder, password.toString()); - - _queryBuilder.append('}'); - } - } - - public interface CustomerAccessTokenCreatePayloadQueryDefinition { - void define(CustomerAccessTokenCreatePayloadQuery _queryBuilder); + public interface FulfillmentLineItemConnectionQueryDefinition { + void define(FulfillmentLineItemConnectionQuery _queryBuilder); } /** - * Return type for `customerAccessTokenCreate` mutation. + * An auto-generated type for paginating through multiple FulfillmentLineItems. */ - public static class CustomerAccessTokenCreatePayloadQuery extends Query { - CustomerAccessTokenCreatePayloadQuery(StringBuilder _queryBuilder) { + public static class FulfillmentLineItemConnectionQuery extends Query { + FulfillmentLineItemConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The newly created customer access token object. + * A list of edges. */ - public CustomerAccessTokenCreatePayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { - startField("customerAccessToken"); + public FulfillmentLineItemConnectionQuery edges(FulfillmentLineItemEdgeQueryDefinition queryDef) { + startField("edges"); _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + queryDef.define(new FulfillmentLineItemEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. + * A list of the nodes contained in FulfillmentLineItemEdge. */ - public CustomerAccessTokenCreatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); + public FulfillmentLineItemConnectionQuery nodes(FulfillmentLineItemQueryDefinition queryDef) { + startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + queryDef.define(new FulfillmentLineItemQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * Information to aid in pagination. */ - @Deprecated - public CustomerAccessTokenCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public FulfillmentLineItemConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new PageInfoQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -30766,32 +31307,32 @@ public CustomerAccessTokenCreatePayloadQuery userErrors(UserErrorQueryDefinition } /** - * Return type for `customerAccessTokenCreate` mutation. + * An auto-generated type for paginating through multiple FulfillmentLineItems. */ - public static class CustomerAccessTokenCreatePayload extends AbstractResponse { - public CustomerAccessTokenCreatePayload() { + public static class FulfillmentLineItemConnection extends AbstractResponse { + public FulfillmentLineItemConnection() { } - public CustomerAccessTokenCreatePayload(JsonObject fields) throws SchemaViolationError { + public FulfillmentLineItemConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customerAccessToken": { - CustomerAccessToken optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new FulfillmentLineItemEdge(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "customerUserErrors": { - List list1 = new ArrayList<>(); + case "nodes": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); + list1.add(new FulfillmentLineItem(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -30799,13 +31340,8 @@ public CustomerAccessTokenCreatePayload(JsonObject fields) throws SchemaViolatio break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } @@ -30822,96 +31358,90 @@ public CustomerAccessTokenCreatePayload(JsonObject fields) throws SchemaViolatio } public String getGraphQlTypeName() { - return "CustomerAccessTokenCreatePayload"; + return "FulfillmentLineItemConnection"; } /** - * The newly created customer access token object. + * A list of edges. */ - public CustomerAccessToken getCustomerAccessToken() { - return (CustomerAccessToken) get("customerAccessToken"); + public List getEdges() { + return (List) get("edges"); } - public CustomerAccessTokenCreatePayload setCustomerAccessToken(CustomerAccessToken arg) { - optimisticData.put(getKey("customerAccessToken"), arg); + public FulfillmentLineItemConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * A list of the nodes contained in FulfillmentLineItemEdge. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public List getNodes() { + return (List) get("nodes"); } - public CustomerAccessTokenCreatePayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public FulfillmentLineItemConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * Information to aid in pagination. */ - public List getUserErrors() { - return (List) get("userErrors"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public CustomerAccessTokenCreatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public FulfillmentLineItemConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "customerAccessToken": return true; + case "edges": return true; - case "customerUserErrors": return true; + case "nodes": return true; - case "userErrors": return true; + case "pageInfo": return true; default: return false; } } } - public interface CustomerAccessTokenCreateWithMultipassPayloadQueryDefinition { - void define(CustomerAccessTokenCreateWithMultipassPayloadQuery _queryBuilder); + public interface FulfillmentLineItemEdgeQueryDefinition { + void define(FulfillmentLineItemEdgeQuery _queryBuilder); } /** - * Return type for `customerAccessTokenCreateWithMultipass` mutation. + * An auto-generated type which holds one FulfillmentLineItem and a cursor during pagination. */ - public static class CustomerAccessTokenCreateWithMultipassPayloadQuery extends Query { - CustomerAccessTokenCreateWithMultipassPayloadQuery(StringBuilder _queryBuilder) { + public static class FulfillmentLineItemEdgeQuery extends Query { + FulfillmentLineItemEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * An access token object associated with the customer. + * A cursor for use in pagination. */ - public CustomerAccessTokenCreateWithMultipassPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { - startField("customerAccessToken"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); - _queryBuilder.append('}'); + public FulfillmentLineItemEdgeQuery cursor() { + startField("cursor"); return this; } /** - * The list of errors that occurred from executing the mutation. + * The item at the end of FulfillmentLineItemEdge. */ - public CustomerAccessTokenCreateWithMultipassPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); + public FulfillmentLineItemEdgeQuery node(FulfillmentLineItemQueryDefinition queryDef) { + startField("node"); _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + queryDef.define(new FulfillmentLineItemQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -30919,35 +31449,25 @@ public CustomerAccessTokenCreateWithMultipassPayloadQuery customerUserErrors(Cus } /** - * Return type for `customerAccessTokenCreateWithMultipass` mutation. + * An auto-generated type which holds one FulfillmentLineItem and a cursor during pagination. */ - public static class CustomerAccessTokenCreateWithMultipassPayload extends AbstractResponse { - public CustomerAccessTokenCreateWithMultipassPayload() { + public static class FulfillmentLineItemEdge extends AbstractResponse { + public FulfillmentLineItemEdge() { } - public CustomerAccessTokenCreateWithMultipassPayload(JsonObject fields) throws SchemaViolationError { + public FulfillmentLineItemEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customerAccessToken": { - CustomerAccessToken optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "node": { + responseData.put(key, new FulfillmentLineItem(jsonAsObject(field.getValue(), key))); break; } @@ -30964,103 +31484,90 @@ public CustomerAccessTokenCreateWithMultipassPayload(JsonObject fields) throws S } public String getGraphQlTypeName() { - return "CustomerAccessTokenCreateWithMultipassPayload"; + return "FulfillmentLineItemEdge"; } /** - * An access token object associated with the customer. + * A cursor for use in pagination. */ - public CustomerAccessToken getCustomerAccessToken() { - return (CustomerAccessToken) get("customerAccessToken"); + public String getCursor() { + return (String) get("cursor"); } - public CustomerAccessTokenCreateWithMultipassPayload setCustomerAccessToken(CustomerAccessToken arg) { - optimisticData.put(getKey("customerAccessToken"), arg); + public FulfillmentLineItemEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The item at the end of FulfillmentLineItemEdge. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public FulfillmentLineItem getNode() { + return (FulfillmentLineItem) get("node"); } - public CustomerAccessTokenCreateWithMultipassPayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public FulfillmentLineItemEdge setNode(FulfillmentLineItem arg) { + optimisticData.put(getKey("node"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "customerAccessToken": return true; + case "cursor": return false; - case "customerUserErrors": return true; + case "node": return true; default: return false; } } } - public interface CustomerAccessTokenDeletePayloadQueryDefinition { - void define(CustomerAccessTokenDeletePayloadQuery _queryBuilder); + public interface FulfillmentTrackingInfoQueryDefinition { + void define(FulfillmentTrackingInfoQuery _queryBuilder); } /** - * Return type for `customerAccessTokenDelete` mutation. + * Tracking information associated with the fulfillment. */ - public static class CustomerAccessTokenDeletePayloadQuery extends Query { - CustomerAccessTokenDeletePayloadQuery(StringBuilder _queryBuilder) { + public static class FulfillmentTrackingInfoQuery extends Query { + FulfillmentTrackingInfoQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The destroyed access token. - */ - public CustomerAccessTokenDeletePayloadQuery deletedAccessToken() { - startField("deletedAccessToken"); - - return this; - } - - /** - * ID of the destroyed customer access token. + * The tracking number of the fulfillment. */ - public CustomerAccessTokenDeletePayloadQuery deletedCustomerAccessTokenId() { - startField("deletedCustomerAccessTokenId"); + public FulfillmentTrackingInfoQuery number() { + startField("number"); return this; } /** - * The list of errors that occurred from executing the mutation. + * The URL to track the fulfillment. */ - public CustomerAccessTokenDeletePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public FulfillmentTrackingInfoQuery url() { + startField("url"); return this; } } /** - * Return type for `customerAccessTokenDelete` mutation. + * Tracking information associated with the fulfillment. */ - public static class CustomerAccessTokenDeletePayload extends AbstractResponse { - public CustomerAccessTokenDeletePayload() { + public static class FulfillmentTrackingInfo extends AbstractResponse { + public FulfillmentTrackingInfo() { } - public CustomerAccessTokenDeletePayload(JsonObject fields) throws SchemaViolationError { + public FulfillmentTrackingInfo(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "deletedAccessToken": { + case "number": { String optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = jsonAsString(field.getValue(), key); @@ -31071,7 +31578,7 @@ public CustomerAccessTokenDeletePayload(JsonObject fields) throws SchemaViolatio break; } - case "deletedCustomerAccessTokenId": { + case "url": { String optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = jsonAsString(field.getValue(), key); @@ -31082,17 +31589,6 @@ public CustomerAccessTokenDeletePayload(JsonObject fields) throws SchemaViolatio break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -31105,116 +31601,128 @@ public CustomerAccessTokenDeletePayload(JsonObject fields) throws SchemaViolatio } public String getGraphQlTypeName() { - return "CustomerAccessTokenDeletePayload"; - } - - /** - * The destroyed access token. - */ - - public String getDeletedAccessToken() { - return (String) get("deletedAccessToken"); - } - - public CustomerAccessTokenDeletePayload setDeletedAccessToken(String arg) { - optimisticData.put(getKey("deletedAccessToken"), arg); - return this; + return "FulfillmentTrackingInfo"; } /** - * ID of the destroyed customer access token. + * The tracking number of the fulfillment. */ - public String getDeletedCustomerAccessTokenId() { - return (String) get("deletedCustomerAccessTokenId"); + public String getNumber() { + return (String) get("number"); } - public CustomerAccessTokenDeletePayload setDeletedCustomerAccessTokenId(String arg) { - optimisticData.put(getKey("deletedCustomerAccessTokenId"), arg); + public FulfillmentTrackingInfo setNumber(String arg) { + optimisticData.put(getKey("number"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The URL to track the fulfillment. */ - public List getUserErrors() { - return (List) get("userErrors"); + public String getUrl() { + return (String) get("url"); } - public CustomerAccessTokenDeletePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public FulfillmentTrackingInfo setUrl(String arg) { + optimisticData.put(getKey("url"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "deletedAccessToken": return false; - - case "deletedCustomerAccessTokenId": return false; + case "number": return false; - case "userErrors": return true; + case "url": return false; default: return false; } } } - public interface CustomerAccessTokenRenewPayloadQueryDefinition { - void define(CustomerAccessTokenRenewPayloadQuery _queryBuilder); + public interface GenericFileQueryDefinition { + void define(GenericFileQuery _queryBuilder); } /** - * Return type for `customerAccessTokenRenew` mutation. + * The generic file resource lets you manage files in a merchant’s store. Generic files include any + * file that doesn’t fit into a designated type such as image or video. Example: PDF, JSON. */ - public static class CustomerAccessTokenRenewPayloadQuery extends Query { - CustomerAccessTokenRenewPayloadQuery(StringBuilder _queryBuilder) { + public static class GenericFileQuery extends Query { + GenericFileQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * The renewed customer access token object. + * A word or phrase to indicate the contents of a file. */ - public CustomerAccessTokenRenewPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { - startField("customerAccessToken"); + public GenericFileQuery alt() { + startField("alt"); - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * The MIME type of the file. + */ + public GenericFileQuery mimeType() { + startField("mimeType"); return this; } /** - * The list of errors that occurred from executing the mutation. + * The size of the original file in bytes. */ - public CustomerAccessTokenRenewPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public GenericFileQuery originalFileSize() { + startField("originalFileSize"); + + return this; + } + + /** + * The preview image for the file. + */ + public GenericFileQuery previewImage(ImageQueryDefinition queryDef) { + startField("previewImage"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new ImageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + + /** + * The URL of the file. + */ + public GenericFileQuery url() { + startField("url"); + + return this; + } } /** - * Return type for `customerAccessTokenRenew` mutation. + * The generic file resource lets you manage files in a merchant’s store. Generic files include any + * file that doesn’t fit into a designated type such as image or video. Example: PDF, JSON. */ - public static class CustomerAccessTokenRenewPayload extends AbstractResponse { - public CustomerAccessTokenRenewPayload() { + public static class GenericFile extends AbstractResponse implements MetafieldReference, Node { + public GenericFile() { } - public CustomerAccessTokenRenewPayload(JsonObject fields) throws SchemaViolationError { + public GenericFile(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customerAccessToken": { - CustomerAccessToken optional1 = null; + case "alt": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -31222,13 +31730,52 @@ public CustomerAccessTokenRenewPayload(JsonObject fields) throws SchemaViolation break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "mimeType": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); + + break; + } + + case "originalFileSize": { + Integer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsInteger(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "previewImage": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "url": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } @@ -31244,237 +31791,133 @@ public CustomerAccessTokenRenewPayload(JsonObject fields) throws SchemaViolation } } + public GenericFile(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "CustomerAccessTokenRenewPayload"; + return "GenericFile"; } /** - * The renewed customer access token object. + * A word or phrase to indicate the contents of a file. */ - public CustomerAccessToken getCustomerAccessToken() { - return (CustomerAccessToken) get("customerAccessToken"); + public String getAlt() { + return (String) get("alt"); } - public CustomerAccessTokenRenewPayload setCustomerAccessToken(CustomerAccessToken arg) { - optimisticData.put(getKey("customerAccessToken"), arg); + public GenericFile setAlt(String arg) { + optimisticData.put(getKey("alt"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * A globally-unique ID. */ - public List getUserErrors() { - return (List) get("userErrors"); + public ID getId() { + return (ID) get("id"); } - public CustomerAccessTokenRenewPayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; + /** + * The MIME type of the file. + */ + + public String getMimeType() { + return (String) get("mimeType"); } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "customerAccessToken": return true; - - case "userErrors": return true; - - default: return false; - } - } - } - - public interface CustomerActivateByUrlPayloadQueryDefinition { - void define(CustomerActivateByUrlPayloadQuery _queryBuilder); - } - - /** - * Return type for `customerActivateByUrl` mutation. - */ - public static class CustomerActivateByUrlPayloadQuery extends Query { - CustomerActivateByUrlPayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The customer that was activated. - */ - public CustomerActivateByUrlPayloadQuery customer(CustomerQueryDefinition queryDef) { - startField("customer"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); - + public GenericFile setMimeType(String arg) { + optimisticData.put(getKey("mimeType"), arg); return this; } /** - * A new customer access token for the customer. + * The size of the original file in bytes. */ - public CustomerActivateByUrlPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { - startField("customerAccessToken"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public Integer getOriginalFileSize() { + return (Integer) get("originalFileSize"); } - /** - * The list of errors that occurred from executing the mutation. - */ - public CustomerActivateByUrlPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - + public GenericFile setOriginalFileSize(Integer arg) { + optimisticData.put(getKey("originalFileSize"), arg); return this; } - } - - /** - * Return type for `customerActivateByUrl` mutation. - */ - public static class CustomerActivateByUrlPayload extends AbstractResponse { - public CustomerActivateByUrlPayload() { - } - - public CustomerActivateByUrlPayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "customer": { - Customer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "customerAccessToken": { - CustomerAccessToken optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "CustomerActivateByUrlPayload"; - } /** - * The customer that was activated. + * The preview image for the file. */ - public Customer getCustomer() { - return (Customer) get("customer"); + public Image getPreviewImage() { + return (Image) get("previewImage"); } - public CustomerActivateByUrlPayload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); + public GenericFile setPreviewImage(Image arg) { + optimisticData.put(getKey("previewImage"), arg); return this; } /** - * A new customer access token for the customer. + * The URL of the file. */ - public CustomerAccessToken getCustomerAccessToken() { - return (CustomerAccessToken) get("customerAccessToken"); + public String getUrl() { + return (String) get("url"); } - public CustomerActivateByUrlPayload setCustomerAccessToken(CustomerAccessToken arg) { - optimisticData.put(getKey("customerAccessToken"), arg); + public GenericFile setUrl(String arg) { + optimisticData.put(getKey("url"), arg); return this; } - /** - * The list of errors that occurred from executing the mutation. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "alt": return false; - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); - } + case "id": return false; - public CustomerActivateByUrlPayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); - return this; - } + case "mimeType": return false; - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "customer": return true; + case "originalFileSize": return false; - case "customerAccessToken": return true; + case "previewImage": return true; - case "customerUserErrors": return true; + case "url": return false; default: return false; } } } - public static class CustomerActivateInput implements Serializable { - private String activationToken; + public static class GeoCoordinateInput implements Serializable { + private double latitude; - private String password; + private double longitude; - public CustomerActivateInput(String activationToken, String password) { - this.activationToken = activationToken; + public GeoCoordinateInput(double latitude, double longitude) { + this.latitude = latitude; - this.password = password; + this.longitude = longitude; } - public String getActivationToken() { - return activationToken; + public double getLatitude() { + return latitude; } - public CustomerActivateInput setActivationToken(String activationToken) { - this.activationToken = activationToken; + public GeoCoordinateInput setLatitude(double latitude) { + this.latitude = latitude; return this; } - public String getPassword() { - return password; + public double getLongitude() { + return longitude; } - public CustomerActivateInput setPassword(String password) { - this.password = password; + public GeoCoordinateInput setLongitude(double longitude) { + this.longitude = longitude; return this; } @@ -31484,113 +31927,237 @@ public void appendTo(StringBuilder _queryBuilder) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("activationToken:"); - Query.appendQuotedString(_queryBuilder, activationToken.toString()); + _queryBuilder.append("latitude:"); + _queryBuilder.append(latitude); _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("password:"); - Query.appendQuotedString(_queryBuilder, password.toString()); + _queryBuilder.append("longitude:"); + _queryBuilder.append(longitude); _queryBuilder.append('}'); } } - public interface CustomerActivatePayloadQueryDefinition { - void define(CustomerActivatePayloadQuery _queryBuilder); + public interface HasMetafieldsQueryDefinition { + void define(HasMetafieldsQuery _queryBuilder); } /** - * Return type for `customerActivate` mutation. + * Represents information about the metafields associated to the specified resource. */ - public static class CustomerActivatePayloadQuery extends Query { - CustomerActivatePayloadQuery(StringBuilder _queryBuilder) { + public static class HasMetafieldsQuery extends Query { + HasMetafieldsQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("__typename"); + } + + public class MetafieldArguments extends Arguments { + MetafieldArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } + + /** + * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. + */ + public MetafieldArguments namespace(String value) { + if (value != null) { + startArgument("namespace"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + } + + public interface MetafieldArgumentsDefinition { + void define(MetafieldArguments args); } /** - * The customer object. + * Returns a metafield found by namespace and key. */ - public CustomerActivatePayloadQuery customer(CustomerQueryDefinition queryDef) { - startField("customer"); + public HasMetafieldsQuery metafield(String key, MetafieldQueryDefinition queryDef) { + return metafield(key, args -> {}, queryDef); + } + + /** + * Returns a metafield found by namespace and key. + */ + public HasMetafieldsQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { + startField("metafield"); + + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + argsDef.define(new MetafieldArguments(_queryBuilder)); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A newly created customer access token object for the customer. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public CustomerActivatePayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { - startField("customerAccessToken"); + public HasMetafieldsQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); + + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - /** - * The list of errors that occurred from executing the mutation. - */ - public CustomerActivatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); + public HasMetafieldsQuery onArticle(ArticleQueryDefinition queryDef) { + startInlineFragment("Article"); + queryDef.define(new ArticleQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + public HasMetafieldsQuery onBlog(BlogQueryDefinition queryDef) { + startInlineFragment("Blog"); + queryDef.define(new BlogQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; + } + public HasMetafieldsQuery onCart(CartQueryDefinition queryDef) { + startInlineFragment("Cart"); + queryDef.define(new CartQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. - */ - @Deprecated - public CustomerActivatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public HasMetafieldsQuery onCollection(CollectionQueryDefinition queryDef) { + startInlineFragment("Collection"); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + public HasMetafieldsQuery onCompany(CompanyQueryDefinition queryDef) { + startInlineFragment("Company"); + queryDef.define(new CompanyQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public HasMetafieldsQuery onCompanyLocation(CompanyLocationQueryDefinition queryDef) { + startInlineFragment("CompanyLocation"); + queryDef.define(new CompanyLocationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public HasMetafieldsQuery onCustomer(CustomerQueryDefinition queryDef) { + startInlineFragment("Customer"); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public HasMetafieldsQuery onLocation(LocationQueryDefinition queryDef) { + startInlineFragment("Location"); + queryDef.define(new LocationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public HasMetafieldsQuery onMarket(MarketQueryDefinition queryDef) { + startInlineFragment("Market"); + queryDef.define(new MarketQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public HasMetafieldsQuery onOrder(OrderQueryDefinition queryDef) { + startInlineFragment("Order"); + queryDef.define(new OrderQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public HasMetafieldsQuery onPage(PageQueryDefinition queryDef) { + startInlineFragment("Page"); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public HasMetafieldsQuery onProduct(ProductQueryDefinition queryDef) { + startInlineFragment("Product"); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public HasMetafieldsQuery onProductVariant(ProductVariantQueryDefinition queryDef) { + startInlineFragment("ProductVariant"); + queryDef.define(new ProductVariantQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public HasMetafieldsQuery onSellingPlan(SellingPlanQueryDefinition queryDef) { + startInlineFragment("SellingPlan"); + queryDef.define(new SellingPlanQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; + } + public HasMetafieldsQuery onShop(ShopQueryDefinition queryDef) { + startInlineFragment("Shop"); + queryDef.define(new ShopQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } + public interface HasMetafields { + String getGraphQlTypeName(); + + Metafield getMetafield(); + + List getMetafields(); + } + /** - * Return type for `customerActivate` mutation. + * Represents information about the metafields associated to the specified resource. */ - public static class CustomerActivatePayload extends AbstractResponse { - public CustomerActivatePayload() { + public static class UnknownHasMetafields extends AbstractResponse implements HasMetafields { + public UnknownHasMetafields() { } - public CustomerActivatePayload(JsonObject fields) throws SchemaViolationError { + public UnknownHasMetafields(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customer": { - Customer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "customerAccessToken": { - CustomerAccessToken optional1 = null; + case "metafield": { + Metafield optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -31598,21 +32165,15 @@ public CustomerActivatePayload(JsonObject fields) throws SchemaViolationError { break; } - case "customerUserErrors": { - List list1 = new ArrayList<>(); + case "metafields": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); + list1.add(optional2); } responseData.put(key, list1); @@ -31631,326 +32192,431 @@ public CustomerActivatePayload(JsonObject fields) throws SchemaViolationError { } } - public String getGraphQlTypeName() { - return "CustomerActivatePayload"; - } + public static HasMetafields create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "Article": { + return new Article(fields); + } - /** - * The customer object. - */ + case "Blog": { + return new Blog(fields); + } - public Customer getCustomer() { - return (Customer) get("customer"); - } + case "Cart": { + return new Cart(fields); + } - public CustomerActivatePayload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); - return this; - } + case "Collection": { + return new Collection(fields); + } - /** - * A newly created customer access token object for the customer. - */ + case "Company": { + return new Company(fields); + } - public CustomerAccessToken getCustomerAccessToken() { - return (CustomerAccessToken) get("customerAccessToken"); - } + case "CompanyLocation": { + return new CompanyLocation(fields); + } - public CustomerActivatePayload setCustomerAccessToken(CustomerAccessToken arg) { - optimisticData.put(getKey("customerAccessToken"), arg); - return this; - } + case "Customer": { + return new Customer(fields); + } - /** - * The list of errors that occurred from executing the mutation. - */ + case "Location": { + return new Location(fields); + } - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); - } + case "Market": { + return new Market(fields); + } - public CustomerActivatePayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); - return this; - } + case "Order": { + return new Order(fields); + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. - */ + case "Page": { + return new Page(fields); + } - public List getUserErrors() { - return (List) get("userErrors"); - } - - public CustomerActivatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "customer": return true; + case "Product": { + return new Product(fields); + } - case "customerAccessToken": return true; + case "ProductVariant": { + return new ProductVariant(fields); + } - case "customerUserErrors": return true; + case "SellingPlan": { + return new SellingPlan(fields); + } - case "userErrors": return true; + case "Shop": { + return new Shop(fields); + } - default: return false; + default: { + return new UnknownHasMetafields(fields); + } } } - } - - public interface CustomerAddressCreatePayloadQueryDefinition { - void define(CustomerAddressCreatePayloadQuery _queryBuilder); - } - /** - * Return type for `customerAddressCreate` mutation. - */ - public static class CustomerAddressCreatePayloadQuery extends Query { - CustomerAddressCreatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public String getGraphQlTypeName() { + return (String) get("__typename"); } /** - * The new customer address object. + * Returns a metafield found by namespace and key. */ - public CustomerAddressCreatePayloadQuery customerAddress(MailingAddressQueryDefinition queryDef) { - startField("customerAddress"); - _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } + public UnknownHasMetafields setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public CustomerAddressCreatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public List getMetafields() { + return (List) get("metafields"); + } + public UnknownHasMetafields setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); return this; } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. - */ - @Deprecated - public CustomerAddressCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "metafield": return true; - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "metafields": return true; - return this; + default: return false; + } } } - /** - * Return type for `customerAddressCreate` mutation. - */ - public static class CustomerAddressCreatePayload extends AbstractResponse { - public CustomerAddressCreatePayload() { - } + public static class HasMetafieldsIdentifier implements Serializable { + private String key; - public CustomerAddressCreatePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "customerAddress": { - MailingAddress optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); - } + private Input namespace = Input.undefined(); - responseData.put(key, optional1); + public HasMetafieldsIdentifier(String key) { + this.key = key; + } - break; - } + public String getKey() { + return key; + } - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } + public HasMetafieldsIdentifier setKey(String key) { + this.key = key; + return this; + } - responseData.put(key, list1); + public String getNamespace() { + return namespace.getValue(); + } - break; - } + public Input getNamespaceInput() { + return namespace; + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + public HasMetafieldsIdentifier setNamespace(String namespace) { + this.namespace = Input.optional(namespace); + return this; + } - responseData.put(key, list1); + public HasMetafieldsIdentifier setNamespaceInput(Input namespace) { + if (namespace == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.namespace = namespace; + return this; + } - break; - } + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + if (this.namespace.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("namespace:"); + if (namespace.getValue() != null) { + Query.appendQuotedString(_queryBuilder, namespace.getValue().toString()); + } else { + _queryBuilder.append("null"); } } + + _queryBuilder.append('}'); } + } - public String getGraphQlTypeName() { - return "CustomerAddressCreatePayload"; + public interface ImageQueryDefinition { + void define(ImageQuery _queryBuilder); + } + + /** + * Represents an image resource. + */ + public static class ImageQuery extends Query { + ImageQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The new customer address object. + * A word or phrase to share the nature or contents of an image. */ + public ImageQuery altText() { + startField("altText"); - public MailingAddress getCustomerAddress() { - return (MailingAddress) get("customerAddress"); - } - - public CustomerAddressCreatePayload setCustomerAddress(MailingAddress arg) { - optimisticData.put(getKey("customerAddress"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The original height of the image in pixels. Returns `null` if the image isn't hosted by Shopify. */ + public ImageQuery height() { + startField("height"); - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + return this; } - public CustomerAddressCreatePayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + /** + * A unique ID for the image. + */ + public ImageQuery id() { + startField("id"); + return this; } /** - * The list of errors that occurred from executing the mutation. + * The location of the original image as a URL. + * If there are any existing transformations in the original source URL, they will remain and not be + * stripped. * - * @deprecated Use `customerUserErrors` instead. + * @deprecated Use `url` instead. */ + @Deprecated + public ImageQuery originalSrc() { + startField("originalSrc"); - public List getUserErrors() { - return (List) get("userErrors"); + return this; } - public CustomerAddressCreatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + /** + * The location of the image as a URL. + * + * @deprecated Use `url` instead. + */ + @Deprecated + public ImageQuery src() { + startField("src"); + return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "customerAddress": return true; + public class TransformedSrcArguments extends Arguments { + TransformedSrcArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "customerUserErrors": return true; + /** + * Image width in pixels between 1 and 5760. + */ + public TransformedSrcArguments maxWidth(Integer value) { + if (value != null) { + startArgument("maxWidth"); + _queryBuilder.append(value); + } + return this; + } - case "userErrors": return true; + /** + * Image height in pixels between 1 and 5760. + */ + public TransformedSrcArguments maxHeight(Integer value) { + if (value != null) { + startArgument("maxHeight"); + _queryBuilder.append(value); + } + return this; + } - default: return false; + /** + * Crops the image according to the specified region. + */ + public TransformedSrcArguments crop(CropRegion value) { + if (value != null) { + startArgument("crop"); + _queryBuilder.append(value.toString()); + } + return this; + } + + /** + * Image size multiplier for high-resolution retina displays. Must be between 1 and 3. + */ + public TransformedSrcArguments scale(Integer value) { + if (value != null) { + startArgument("scale"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Best effort conversion of image into content type (SVG -> PNG, Anything -> JPG, Anything -> WEBP are + * supported). + */ + public TransformedSrcArguments preferredContentType(ImageContentType value) { + if (value != null) { + startArgument("preferredContentType"); + _queryBuilder.append(value.toString()); + } + return this; } } - } - public interface CustomerAddressDeletePayloadQueryDefinition { - void define(CustomerAddressDeletePayloadQuery _queryBuilder); - } + public interface TransformedSrcArgumentsDefinition { + void define(TransformedSrcArguments args); + } - /** - * Return type for `customerAddressDelete` mutation. - */ - public static class CustomerAddressDeletePayloadQuery extends Query { - CustomerAddressDeletePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + /** + * The location of the transformed image as a URL. + * All transformation arguments are considered "best-effort". If they can be applied to an image, they + * will be. + * Otherwise any transformations which an image type doesn't support will be ignored. + * + * @deprecated Use `url(transform:)` instead + */ + public ImageQuery transformedSrc() { + return transformedSrc(args -> {}); } /** - * The list of errors that occurred from executing the mutation. + * The location of the transformed image as a URL. + * All transformation arguments are considered "best-effort". If they can be applied to an image, they + * will be. + * Otherwise any transformations which an image type doesn't support will be ignored. + * + * @deprecated Use `url(transform:)` instead */ - public CustomerAddressDeletePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); + @Deprecated + public ImageQuery transformedSrc(TransformedSrcArgumentsDefinition argsDef) { + startField("transformedSrc"); - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + TransformedSrcArguments args = new TransformedSrcArguments(_queryBuilder); + argsDef.define(args); + TransformedSrcArguments.end(args); return this; } + public class UrlArguments extends Arguments { + UrlArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * A set of options to transform the original image. + */ + public UrlArguments transform(ImageTransformInput value) { + if (value != null) { + startArgument("transform"); + value.appendTo(_queryBuilder); + } + return this; + } + } + + public interface UrlArgumentsDefinition { + void define(UrlArguments args); + } + /** - * ID of the deleted customer address. + * The location of the image as a URL. + * If no transform options are specified, then the original image will be preserved including any + * pre-applied transforms. + * All transformation options are considered "best-effort". Any transformation that the original image + * type doesn't support will be ignored. + * If you need multiple variations of the same image, then you can use [GraphQL + * aliases](https://graphql.org/learn/queries/#aliases). */ - public CustomerAddressDeletePayloadQuery deletedCustomerAddressId() { - startField("deletedCustomerAddressId"); + public ImageQuery url() { + return url(args -> {}); + } + + /** + * The location of the image as a URL. + * If no transform options are specified, then the original image will be preserved including any + * pre-applied transforms. + * All transformation options are considered "best-effort". Any transformation that the original image + * type doesn't support will be ignored. + * If you need multiple variations of the same image, then you can use [GraphQL + * aliases](https://graphql.org/learn/queries/#aliases). + */ + public ImageQuery url(UrlArgumentsDefinition argsDef) { + startField("url"); + + UrlArguments args = new UrlArguments(_queryBuilder); + argsDef.define(args); + UrlArguments.end(args); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * The original width of the image in pixels. Returns `null` if the image isn't hosted by Shopify. */ - @Deprecated - public CustomerAddressDeletePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ImageQuery width() { + startField("width"); return this; } } /** - * Return type for `customerAddressDelete` mutation. + * Represents an image resource. */ - public static class CustomerAddressDeletePayload extends AbstractResponse { - public CustomerAddressDeletePayload() { + public static class Image extends AbstractResponse { + public Image() { } - public CustomerAddressDeletePayload(JsonObject fields) throws SchemaViolationError { + public Image(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); + case "altText": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "deletedCustomerAddressId": { - String optional1 = null; + case "height": { + Integer optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = jsonAsInteger(field.getValue(), key); } responseData.put(key, optional1); @@ -31958,13 +32624,48 @@ public CustomerAddressDeletePayload(JsonObject fields) throws SchemaViolationErr break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); + case "id": { + ID optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ID(jsonAsString(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); + + break; + } + + case "originalSrc": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "src": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "transformedSrc": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "url": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "width": { + Integer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsInteger(field.getValue(), key); + } + + responseData.put(key, optional1); break; } @@ -31981,112 +32682,199 @@ public CustomerAddressDeletePayload(JsonObject fields) throws SchemaViolationErr } public String getGraphQlTypeName() { - return "CustomerAddressDeletePayload"; + return "Image"; } /** - * The list of errors that occurred from executing the mutation. + * A word or phrase to share the nature or contents of an image. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public String getAltText() { + return (String) get("altText"); } - public CustomerAddressDeletePayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public Image setAltText(String arg) { + optimisticData.put(getKey("altText"), arg); return this; } /** - * ID of the deleted customer address. + * The original height of the image in pixels. Returns `null` if the image isn't hosted by Shopify. */ - public String getDeletedCustomerAddressId() { - return (String) get("deletedCustomerAddressId"); + public Integer getHeight() { + return (Integer) get("height"); } - public CustomerAddressDeletePayload setDeletedCustomerAddressId(String arg) { - optimisticData.put(getKey("deletedCustomerAddressId"), arg); + public Image setHeight(Integer arg) { + optimisticData.put(getKey("height"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * A unique ID for the image. */ - public List getUserErrors() { - return (List) get("userErrors"); + public ID getId() { + return (ID) get("id"); } - public CustomerAddressDeletePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public Image setId(ID arg) { + optimisticData.put(getKey("id"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "customerUserErrors": return true; + /** + * The location of the original image as a URL. + * If there are any existing transformations in the original source URL, they will remain and not be + * stripped. + * + * @deprecated Use `url` instead. + */ - case "deletedCustomerAddressId": return false; + public String getOriginalSrc() { + return (String) get("originalSrc"); + } - case "userErrors": return true; + public Image setOriginalSrc(String arg) { + optimisticData.put(getKey("originalSrc"), arg); + return this; + } + + /** + * The location of the image as a URL. + * + * @deprecated Use `url` instead. + */ + + public String getSrc() { + return (String) get("src"); + } + + public Image setSrc(String arg) { + optimisticData.put(getKey("src"), arg); + return this; + } + + /** + * The location of the transformed image as a URL. + * All transformation arguments are considered "best-effort". If they can be applied to an image, they + * will be. + * Otherwise any transformations which an image type doesn't support will be ignored. + * + * @deprecated Use `url(transform:)` instead + */ + + public String getTransformedSrc() { + return (String) get("transformedSrc"); + } + + public Image setTransformedSrc(String arg) { + optimisticData.put(getKey("transformedSrc"), arg); + return this; + } + + /** + * The location of the image as a URL. + * If no transform options are specified, then the original image will be preserved including any + * pre-applied transforms. + * All transformation options are considered "best-effort". Any transformation that the original image + * type doesn't support will be ignored. + * If you need multiple variations of the same image, then you can use [GraphQL + * aliases](https://graphql.org/learn/queries/#aliases). + */ + + public String getUrl() { + return (String) get("url"); + } + + public Image setUrl(String arg) { + optimisticData.put(getKey("url"), arg); + return this; + } + + /** + * The original width of the image in pixels. Returns `null` if the image isn't hosted by Shopify. + */ + + public Integer getWidth() { + return (Integer) get("width"); + } + + public Image setWidth(Integer arg) { + optimisticData.put(getKey("width"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "altText": return false; + + case "height": return false; + + case "id": return false; + + case "originalSrc": return false; + + case "src": return false; + + case "transformedSrc": return false; + + case "url": return false; + + case "width": return false; default: return false; } } } - public interface CustomerAddressUpdatePayloadQueryDefinition { - void define(CustomerAddressUpdatePayloadQuery _queryBuilder); + public interface ImageConnectionQueryDefinition { + void define(ImageConnectionQuery _queryBuilder); } /** - * Return type for `customerAddressUpdate` mutation. + * An auto-generated type for paginating through multiple Images. */ - public static class CustomerAddressUpdatePayloadQuery extends Query { - CustomerAddressUpdatePayloadQuery(StringBuilder _queryBuilder) { + public static class ImageConnectionQuery extends Query { + ImageConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The customer’s updated mailing address. + * A list of edges. */ - public CustomerAddressUpdatePayloadQuery customerAddress(MailingAddressQueryDefinition queryDef) { - startField("customerAddress"); + public ImageConnectionQuery edges(ImageEdgeQueryDefinition queryDef) { + startField("edges"); _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); + queryDef.define(new ImageEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. + * A list of the nodes contained in ImageEdge. */ - public CustomerAddressUpdatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); + public ImageConnectionQuery nodes(ImageQueryDefinition queryDef) { + startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + queryDef.define(new ImageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * Information to aid in pagination. */ - @Deprecated - public CustomerAddressUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public ImageConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new PageInfoQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -32094,32 +32882,32 @@ public CustomerAddressUpdatePayloadQuery userErrors(UserErrorQueryDefinition que } /** - * Return type for `customerAddressUpdate` mutation. + * An auto-generated type for paginating through multiple Images. */ - public static class CustomerAddressUpdatePayload extends AbstractResponse { - public CustomerAddressUpdatePayload() { + public static class ImageConnection extends AbstractResponse { + public ImageConnection() { } - public CustomerAddressUpdatePayload(JsonObject fields) throws SchemaViolationError { + public ImageConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customerAddress": { - MailingAddress optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ImageEdge(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "customerUserErrors": { - List list1 = new ArrayList<>(); + case "nodes": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); + list1.add(new Image(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -32127,13 +32915,8 @@ public CustomerAddressUpdatePayload(JsonObject fields) throws SchemaViolationErr break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } @@ -32150,295 +32933,155 @@ public CustomerAddressUpdatePayload(JsonObject fields) throws SchemaViolationErr } public String getGraphQlTypeName() { - return "CustomerAddressUpdatePayload"; + return "ImageConnection"; } /** - * The customer’s updated mailing address. + * A list of edges. */ - public MailingAddress getCustomerAddress() { - return (MailingAddress) get("customerAddress"); + public List getEdges() { + return (List) get("edges"); } - public CustomerAddressUpdatePayload setCustomerAddress(MailingAddress arg) { - optimisticData.put(getKey("customerAddress"), arg); + public ImageConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * A list of the nodes contained in ImageEdge. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public List getNodes() { + return (List) get("nodes"); } - public CustomerAddressUpdatePayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public ImageConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * Information to aid in pagination. */ - public List getUserErrors() { - return (List) get("userErrors"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public CustomerAddressUpdatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public ImageConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "customerAddress": return true; + case "edges": return true; - case "customerUserErrors": return true; + case "nodes": return true; - case "userErrors": return true; + case "pageInfo": return true; default: return false; } } } - public static class CustomerCreateInput implements Serializable { - private String email; - - private String password; - - private Input firstName = Input.undefined(); - - private Input lastName = Input.undefined(); - - private Input phone = Input.undefined(); - - private Input acceptsMarketing = Input.undefined(); - - public CustomerCreateInput(String email, String password) { - this.email = email; - - this.password = password; - } - - public String getEmail() { - return email; - } - - public CustomerCreateInput setEmail(String email) { - this.email = email; - return this; - } - - public String getPassword() { - return password; - } - - public CustomerCreateInput setPassword(String password) { - this.password = password; - return this; - } - - public String getFirstName() { - return firstName.getValue(); - } - - public Input getFirstNameInput() { - return firstName; - } - - public CustomerCreateInput setFirstName(String firstName) { - this.firstName = Input.optional(firstName); - return this; - } - - public CustomerCreateInput setFirstNameInput(Input firstName) { - if (firstName == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.firstName = firstName; - return this; - } - - public String getLastName() { - return lastName.getValue(); - } - - public Input getLastNameInput() { - return lastName; - } - - public CustomerCreateInput setLastName(String lastName) { - this.lastName = Input.optional(lastName); - return this; - } - - public CustomerCreateInput setLastNameInput(Input lastName) { - if (lastName == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.lastName = lastName; - return this; - } + /** + * List of supported image content types. + */ + public enum ImageContentType { + /** + * A JPG image. + */ + JPG, - public String getPhone() { - return phone.getValue(); - } + /** + * A PNG image. + */ + PNG, - public Input getPhoneInput() { - return phone; - } + /** + * A WEBP image. + */ + WEBP, - public CustomerCreateInput setPhone(String phone) { - this.phone = Input.optional(phone); - return this; - } + UNKNOWN_VALUE; - public CustomerCreateInput setPhoneInput(Input phone) { - if (phone == null) { - throw new IllegalArgumentException("Input can not be null"); + public static ImageContentType fromGraphQl(String value) { + if (value == null) { + return null; } - this.phone = phone; - return this; - } - public Boolean getAcceptsMarketing() { - return acceptsMarketing.getValue(); - } + switch (value) { + case "JPG": { + return JPG; + } - public Input getAcceptsMarketingInput() { - return acceptsMarketing; - } + case "PNG": { + return PNG; + } - public CustomerCreateInput setAcceptsMarketing(Boolean acceptsMarketing) { - this.acceptsMarketing = Input.optional(acceptsMarketing); - return this; - } + case "WEBP": { + return WEBP; + } - public CustomerCreateInput setAcceptsMarketingInput(Input acceptsMarketing) { - if (acceptsMarketing == null) { - throw new IllegalArgumentException("Input can not be null"); + default: { + return UNKNOWN_VALUE; + } } - this.acceptsMarketing = acceptsMarketing; - return this; } - - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("email:"); - Query.appendQuotedString(_queryBuilder, email.toString()); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("password:"); - Query.appendQuotedString(_queryBuilder, password.toString()); - - if (this.firstName.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("firstName:"); - if (firstName.getValue() != null) { - Query.appendQuotedString(_queryBuilder, firstName.getValue().toString()); - } else { - _queryBuilder.append("null"); + public String toString() { + switch (this) { + case JPG: { + return "JPG"; } - } - if (this.lastName.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("lastName:"); - if (lastName.getValue() != null) { - Query.appendQuotedString(_queryBuilder, lastName.getValue().toString()); - } else { - _queryBuilder.append("null"); + case PNG: { + return "PNG"; } - } - if (this.phone.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("phone:"); - if (phone.getValue() != null) { - Query.appendQuotedString(_queryBuilder, phone.getValue().toString()); - } else { - _queryBuilder.append("null"); + case WEBP: { + return "WEBP"; } - } - if (this.acceptsMarketing.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("acceptsMarketing:"); - if (acceptsMarketing.getValue() != null) { - _queryBuilder.append(acceptsMarketing.getValue()); - } else { - _queryBuilder.append("null"); + default: { + return ""; } } - - _queryBuilder.append('}'); } } - public interface CustomerCreatePayloadQueryDefinition { - void define(CustomerCreatePayloadQuery _queryBuilder); + public interface ImageEdgeQueryDefinition { + void define(ImageEdgeQuery _queryBuilder); } /** - * Return type for `customerCreate` mutation. + * An auto-generated type which holds one Image and a cursor during pagination. */ - public static class CustomerCreatePayloadQuery extends Query { - CustomerCreatePayloadQuery(StringBuilder _queryBuilder) { + public static class ImageEdgeQuery extends Query { + ImageEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The created customer object. - */ - public CustomerCreatePayloadQuery customer(CustomerQueryDefinition queryDef) { - startField("customer"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The list of errors that occurred from executing the mutation. + * A cursor for use in pagination. */ - public CustomerCreatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ImageEdgeQuery cursor() { + startField("cursor"); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * The item at the end of ImageEdge. */ - @Deprecated - public CustomerCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public ImageEdgeQuery node(ImageQueryDefinition queryDef) { + startField("node"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new ImageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -32446,46 +33089,25 @@ public CustomerCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) } /** - * Return type for `customerCreate` mutation. + * An auto-generated type which holds one Image and a cursor during pagination. */ - public static class CustomerCreatePayload extends AbstractResponse { - public CustomerCreatePayload() { + public static class ImageEdge extends AbstractResponse { + public ImageEdge() { } - public CustomerCreatePayload(JsonObject fields) throws SchemaViolationError { + public ImageEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customer": { - Customer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "node": { + responseData.put(key, new Image(jsonAsObject(field.getValue(), key))); break; } @@ -32502,159 +33124,292 @@ public CustomerCreatePayload(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CustomerCreatePayload"; + return "ImageEdge"; } /** - * The created customer object. + * A cursor for use in pagination. */ - public Customer getCustomer() { - return (Customer) get("customer"); + public String getCursor() { + return (String) get("cursor"); } - public CustomerCreatePayload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); + public ImageEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The item at the end of ImageEdge. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public Image getNode() { + return (Image) get("node"); } - public CustomerCreatePayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public ImageEdge setNode(Image arg) { + optimisticData.put(getKey("node"), arg); return this; } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - public List getUserErrors() { - return (List) get("userErrors"); + case "node": return true; + + default: return false; + } } + } - public CustomerCreatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public static class ImageTransformInput implements Serializable { + private Input crop = Input.undefined(); + + private Input maxWidth = Input.undefined(); + + private Input maxHeight = Input.undefined(); + + private Input scale = Input.undefined(); + + private Input preferredContentType = Input.undefined(); + + public CropRegion getCrop() { + return crop.getValue(); + } + + public Input getCropInput() { + return crop; + } + + public ImageTransformInput setCrop(CropRegion crop) { + this.crop = Input.optional(crop); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "customer": return true; + public ImageTransformInput setCropInput(Input crop) { + if (crop == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.crop = crop; + return this; + } - case "customerUserErrors": return true; + public Integer getMaxWidth() { + return maxWidth.getValue(); + } - case "userErrors": return true; + public Input getMaxWidthInput() { + return maxWidth; + } - default: return false; + public ImageTransformInput setMaxWidth(Integer maxWidth) { + this.maxWidth = Input.optional(maxWidth); + return this; + } + + public ImageTransformInput setMaxWidthInput(Input maxWidth) { + if (maxWidth == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.maxWidth = maxWidth; + return this; + } + + public Integer getMaxHeight() { + return maxHeight.getValue(); + } + + public Input getMaxHeightInput() { + return maxHeight; + } + + public ImageTransformInput setMaxHeight(Integer maxHeight) { + this.maxHeight = Input.optional(maxHeight); + return this; + } + + public ImageTransformInput setMaxHeightInput(Input maxHeight) { + if (maxHeight == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.maxHeight = maxHeight; + return this; + } + + public Integer getScale() { + return scale.getValue(); + } + + public Input getScaleInput() { + return scale; + } + + public ImageTransformInput setScale(Integer scale) { + this.scale = Input.optional(scale); + return this; + } + + public ImageTransformInput setScaleInput(Input scale) { + if (scale == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.scale = scale; + return this; + } + + public ImageContentType getPreferredContentType() { + return preferredContentType.getValue(); + } + + public Input getPreferredContentTypeInput() { + return preferredContentType; + } + + public ImageTransformInput setPreferredContentType(ImageContentType preferredContentType) { + this.preferredContentType = Input.optional(preferredContentType); + return this; + } + + public ImageTransformInput setPreferredContentTypeInput(Input preferredContentType) { + if (preferredContentType == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.preferredContentType = preferredContentType; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + if (this.crop.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("crop:"); + if (crop.getValue() != null) { + _queryBuilder.append(crop.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.maxWidth.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("maxWidth:"); + if (maxWidth.getValue() != null) { + _queryBuilder.append(maxWidth.getValue()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.maxHeight.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("maxHeight:"); + if (maxHeight.getValue() != null) { + _queryBuilder.append(maxHeight.getValue()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.scale.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("scale:"); + if (scale.getValue() != null) { + _queryBuilder.append(scale.getValue()); + } else { + _queryBuilder.append("null"); + } } + + if (this.preferredContentType.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("preferredContentType:"); + if (preferredContentType.getValue() != null) { + _queryBuilder.append(preferredContentType.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + _queryBuilder.append('}'); } } - public interface CustomerDefaultAddressUpdatePayloadQueryDefinition { - void define(CustomerDefaultAddressUpdatePayloadQuery _queryBuilder); + public interface LanguageQueryDefinition { + void define(LanguageQuery _queryBuilder); } /** - * Return type for `customerDefaultAddressUpdate` mutation. + * A language. */ - public static class CustomerDefaultAddressUpdatePayloadQuery extends Query { - CustomerDefaultAddressUpdatePayloadQuery(StringBuilder _queryBuilder) { + public static class LanguageQuery extends Query { + LanguageQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The updated customer object. + * The name of the language in the language itself. If the language uses capitalization, it is + * capitalized for a mid-sentence position. */ - public CustomerDefaultAddressUpdatePayloadQuery customer(CustomerQueryDefinition queryDef) { - startField("customer"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); + public LanguageQuery endonymName() { + startField("endonymName"); return this; } /** - * The list of errors that occurred from executing the mutation. + * The ISO code. */ - public CustomerDefaultAddressUpdatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public LanguageQuery isoCode() { + startField("isoCode"); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * The name of the language in the current language. */ - @Deprecated - public CustomerDefaultAddressUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public LanguageQuery name() { + startField("name"); return this; } } /** - * Return type for `customerDefaultAddressUpdate` mutation. + * A language. */ - public static class CustomerDefaultAddressUpdatePayload extends AbstractResponse { - public CustomerDefaultAddressUpdatePayload() { + public static class Language extends AbstractResponse { + public Language() { } - public CustomerDefaultAddressUpdatePayload(JsonObject fields) throws SchemaViolationError { + public Language(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customer": { - Customer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "endonymName": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "isoCode": { + responseData.put(key, LanguageCode.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -32671,57 +33426,56 @@ public CustomerDefaultAddressUpdatePayload(JsonObject fields) throws SchemaViola } public String getGraphQlTypeName() { - return "CustomerDefaultAddressUpdatePayload"; + return "Language"; } /** - * The updated customer object. + * The name of the language in the language itself. If the language uses capitalization, it is + * capitalized for a mid-sentence position. */ - public Customer getCustomer() { - return (Customer) get("customer"); + public String getEndonymName() { + return (String) get("endonymName"); } - public CustomerDefaultAddressUpdatePayload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); + public Language setEndonymName(String arg) { + optimisticData.put(getKey("endonymName"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The ISO code. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public LanguageCode getIsoCode() { + return (LanguageCode) get("isoCode"); } - public CustomerDefaultAddressUpdatePayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public Language setIsoCode(LanguageCode arg) { + optimisticData.put(getKey("isoCode"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * The name of the language in the current language. */ - public List getUserErrors() { - return (List) get("userErrors"); + public String getName() { + return (String) get("name"); } - public CustomerDefaultAddressUpdatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public Language setName(String arg) { + optimisticData.put(getKey("name"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "customer": return true; + case "endonymName": return false; - case "customerUserErrors": return true; + case "isoCode": return false; - case "userErrors": return true; + case "name": return false; default: return false; } @@ -32729,8615 +33483,3206 @@ public boolean unwrapsToObject(String key) { } /** - * Possible error codes that can be returned by `CustomerUserError`. + * ISO 639-1 language codes supported by Shopify. */ - public enum CustomerErrorCode { + public enum LanguageCode { /** - * Customer already enabled. + * Afrikaans. */ - ALREADY_ENABLED, + AF, /** - * Input email contains an invalid domain name. + * Akan. */ - BAD_DOMAIN, + AK, /** - * The input value is blank. + * Amharic. */ - BLANK, + AM, /** - * Input contains HTML tags. + * Arabic. */ - CONTAINS_HTML_TAGS, + AR, /** - * Input contains URL. + * Assamese. */ - CONTAINS_URL, + AS, /** - * Customer is disabled. + * Azerbaijani. */ - CUSTOMER_DISABLED, + AZ, /** - * The input value is invalid. + * Belarusian. */ - INVALID, + BE, /** - * Multipass token is not valid. + * Bulgarian. */ - INVALID_MULTIPASS_REQUEST, + BG, /** - * Address does not exist. + * Bambara. */ - NOT_FOUND, + BM, /** - * Input password starts or ends with whitespace. + * Bangla. */ - PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE, + BN, /** - * The input value is already taken. + * Tibetan. */ - TAKEN, + BO, /** - * Invalid activation token. + * Breton. */ - TOKEN_INVALID, + BR, /** - * The input value is too long. + * Bosnian. */ - TOO_LONG, + BS, /** - * The input value is too short. + * Catalan. */ - TOO_SHORT, + CA, /** - * Unidentified customer. + * Chechen. */ - UNIDENTIFIED_CUSTOMER, - - UNKNOWN_VALUE; + CE, - public static CustomerErrorCode fromGraphQl(String value) { - if (value == null) { - return null; - } + /** + * Central Kurdish. + */ + CKB, - switch (value) { - case "ALREADY_ENABLED": { - return ALREADY_ENABLED; - } + /** + * Czech. + */ + CS, - case "BAD_DOMAIN": { - return BAD_DOMAIN; - } + /** + * Church Slavic. + */ + CU, - case "BLANK": { - return BLANK; - } + /** + * Welsh. + */ + CY, - case "CONTAINS_HTML_TAGS": { - return CONTAINS_HTML_TAGS; - } + /** + * Danish. + */ + DA, - case "CONTAINS_URL": { - return CONTAINS_URL; - } + /** + * German. + */ + DE, - case "CUSTOMER_DISABLED": { - return CUSTOMER_DISABLED; - } + /** + * Dzongkha. + */ + DZ, - case "INVALID": { - return INVALID; - } + /** + * Ewe. + */ + EE, - case "INVALID_MULTIPASS_REQUEST": { - return INVALID_MULTIPASS_REQUEST; - } + /** + * Greek. + */ + EL, - case "NOT_FOUND": { - return NOT_FOUND; - } + /** + * English. + */ + EN, - case "PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE": { - return PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE; - } + /** + * Esperanto. + */ + EO, - case "TAKEN": { - return TAKEN; - } + /** + * Spanish. + */ + ES, - case "TOKEN_INVALID": { - return TOKEN_INVALID; - } + /** + * Estonian. + */ + ET, - case "TOO_LONG": { - return TOO_LONG; - } + /** + * Basque. + */ + EU, - case "TOO_SHORT": { - return TOO_SHORT; - } + /** + * Persian. + */ + FA, - case "UNIDENTIFIED_CUSTOMER": { - return UNIDENTIFIED_CUSTOMER; - } + /** + * Fulah. + */ + FF, - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case ALREADY_ENABLED: { - return "ALREADY_ENABLED"; - } + /** + * Finnish. + */ + FI, - case BAD_DOMAIN: { - return "BAD_DOMAIN"; - } + /** + * Filipino. + */ + FIL, - case BLANK: { - return "BLANK"; - } - - case CONTAINS_HTML_TAGS: { - return "CONTAINS_HTML_TAGS"; - } - - case CONTAINS_URL: { - return "CONTAINS_URL"; - } - - case CUSTOMER_DISABLED: { - return "CUSTOMER_DISABLED"; - } - - case INVALID: { - return "INVALID"; - } + /** + * Faroese. + */ + FO, - case INVALID_MULTIPASS_REQUEST: { - return "INVALID_MULTIPASS_REQUEST"; - } + /** + * French. + */ + FR, - case NOT_FOUND: { - return "NOT_FOUND"; - } + /** + * Western Frisian. + */ + FY, - case PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE: { - return "PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE"; - } + /** + * Irish. + */ + GA, - case TAKEN: { - return "TAKEN"; - } + /** + * Scottish Gaelic. + */ + GD, - case TOKEN_INVALID: { - return "TOKEN_INVALID"; - } + /** + * Galician. + */ + GL, - case TOO_LONG: { - return "TOO_LONG"; - } + /** + * Gujarati. + */ + GU, - case TOO_SHORT: { - return "TOO_SHORT"; - } + /** + * Manx. + */ + GV, - case UNIDENTIFIED_CUSTOMER: { - return "UNIDENTIFIED_CUSTOMER"; - } + /** + * Hausa. + */ + HA, - default: { - return ""; - } - } - } - } + /** + * Hebrew. + */ + HE, - public interface CustomerRecoverPayloadQueryDefinition { - void define(CustomerRecoverPayloadQuery _queryBuilder); - } + /** + * Hindi. + */ + HI, - /** - * Return type for `customerRecover` mutation. - */ - public static class CustomerRecoverPayloadQuery extends Query { - CustomerRecoverPayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + /** + * Croatian. + */ + HR, /** - * The list of errors that occurred from executing the mutation. + * Hungarian. */ - public CustomerRecoverPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); + HU, - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Armenian. + */ + HY, - return this; - } + /** + * Interlingua. + */ + IA, /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * Indonesian. */ - @Deprecated - public CustomerRecoverPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + ID, - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Igbo. + */ + IG, - return this; - } - } + /** + * Sichuan Yi. + */ + II, - /** - * Return type for `customerRecover` mutation. - */ - public static class CustomerRecoverPayload extends AbstractResponse { - public CustomerRecoverPayload() { - } + /** + * Icelandic. + */ + IS, - public CustomerRecoverPayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } + /** + * Italian. + */ + IT, - responseData.put(key, list1); + /** + * Japanese. + */ + JA, - break; - } + /** + * Javanese. + */ + JV, - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + /** + * Georgian. + */ + KA, - responseData.put(key, list1); + /** + * Kikuyu. + */ + KI, - break; - } + /** + * Kazakh. + */ + KK, - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + /** + * Kalaallisut. + */ + KL, - public String getGraphQlTypeName() { - return "CustomerRecoverPayload"; - } + /** + * Khmer. + */ + KM, /** - * The list of errors that occurred from executing the mutation. + * Kannada. */ + KN, - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); - } + /** + * Korean. + */ + KO, - public CustomerRecoverPayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); - return this; - } + /** + * Kashmiri. + */ + KS, /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * Kurdish. */ + KU, - public List getUserErrors() { - return (List) get("userErrors"); - } + /** + * Cornish. + */ + KW, - public CustomerRecoverPayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } + /** + * Kyrgyz. + */ + KY, - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "customerUserErrors": return true; + /** + * Latin. + */ + LA, - case "userErrors": return true; + /** + * Luxembourgish. + */ + LB, - default: return false; - } - } - } + /** + * Ganda. + */ + LG, - public interface CustomerResetByUrlPayloadQueryDefinition { - void define(CustomerResetByUrlPayloadQuery _queryBuilder); - } + /** + * Lingala. + */ + LN, - /** - * Return type for `customerResetByUrl` mutation. - */ - public static class CustomerResetByUrlPayloadQuery extends Query { - CustomerResetByUrlPayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + /** + * Lao. + */ + LO, /** - * The customer object which was reset. + * Lithuanian. */ - public CustomerResetByUrlPayloadQuery customer(CustomerQueryDefinition queryDef) { - startField("customer"); + LT, - _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Luba-Katanga. + */ + LU, - return this; - } + /** + * Latvian. + */ + LV, /** - * A newly created customer access token object for the customer. + * Malagasy. */ - public CustomerResetByUrlPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { - startField("customerAccessToken"); + MG, - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Māori. + */ + MI, - return this; - } + /** + * Macedonian. + */ + MK, /** - * The list of errors that occurred from executing the mutation. + * Malayalam. */ - public CustomerResetByUrlPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); + ML, - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Mongolian. + */ + MN, - return this; - } + /** + * Moldavian. + */ + MO, /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * Marathi. */ - @Deprecated - public CustomerResetByUrlPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + MR, - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Malay. + */ + MS, - return this; - } - } + /** + * Maltese. + */ + MT, - /** - * Return type for `customerResetByUrl` mutation. - */ - public static class CustomerResetByUrlPayload extends AbstractResponse { - public CustomerResetByUrlPayload() { - } + /** + * Burmese. + */ + MY, - public CustomerResetByUrlPayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "customer": { - Customer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); - } + /** + * Norwegian (Bokmål). + */ + NB, - responseData.put(key, optional1); + /** + * North Ndebele. + */ + ND, - break; - } + /** + * Nepali. + */ + NE, - case "customerAccessToken": { - CustomerAccessToken optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); - } + /** + * Dutch. + */ + NL, - responseData.put(key, optional1); + /** + * Norwegian Nynorsk. + */ + NN, - break; - } + /** + * Norwegian. + */ + NO, - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } + /** + * Oromo. + */ + OM, - responseData.put(key, list1); + /** + * Odia. + */ + OR, - break; - } + /** + * Ossetic. + */ + OS, - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + /** + * Punjabi. + */ + PA, - responseData.put(key, list1); + /** + * Polish. + */ + PL, - break; - } + /** + * Pashto. + */ + PS, - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + /** + * Portuguese. + */ + PT, - public String getGraphQlTypeName() { - return "CustomerResetByUrlPayload"; - } + /** + * Portuguese (Brazil). + */ + PT_BR, /** - * The customer object which was reset. + * Portuguese (Portugal). */ + PT_PT, - public Customer getCustomer() { - return (Customer) get("customer"); - } + /** + * Quechua. + */ + QU, - public CustomerResetByUrlPayload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); - return this; - } + /** + * Romansh. + */ + RM, /** - * A newly created customer access token object for the customer. + * Rundi. */ + RN, - public CustomerAccessToken getCustomerAccessToken() { - return (CustomerAccessToken) get("customerAccessToken"); - } + /** + * Romanian. + */ + RO, - public CustomerResetByUrlPayload setCustomerAccessToken(CustomerAccessToken arg) { - optimisticData.put(getKey("customerAccessToken"), arg); - return this; - } + /** + * Russian. + */ + RU, /** - * The list of errors that occurred from executing the mutation. + * Kinyarwanda. */ + RW, - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); - } + /** + * Sanskrit. + */ + SA, - public CustomerResetByUrlPayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); - return this; - } + /** + * Sardinian. + */ + SC, /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * Sindhi. */ + SD, - public List getUserErrors() { - return (List) get("userErrors"); - } + /** + * Northern Sami. + */ + SE, - public CustomerResetByUrlPayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } + /** + * Sango. + */ + SG, - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "customer": return true; + /** + * Serbo-Croatian. + */ + SH, - case "customerAccessToken": return true; + /** + * Sinhala. + */ + SI, - case "customerUserErrors": return true; + /** + * Slovak. + */ + SK, - case "userErrors": return true; + /** + * Slovenian. + */ + SL, - default: return false; - } - } - } + /** + * Shona. + */ + SN, - public static class CustomerResetInput implements Serializable { - private String resetToken; + /** + * Somali. + */ + SO, - private String password; + /** + * Albanian. + */ + SQ, - public CustomerResetInput(String resetToken, String password) { - this.resetToken = resetToken; + /** + * Serbian. + */ + SR, - this.password = password; - } + /** + * Sundanese. + */ + SU, - public String getResetToken() { - return resetToken; - } + /** + * Swedish. + */ + SV, - public CustomerResetInput setResetToken(String resetToken) { - this.resetToken = resetToken; - return this; - } + /** + * Swahili. + */ + SW, - public String getPassword() { - return password; - } + /** + * Tamil. + */ + TA, - public CustomerResetInput setPassword(String password) { - this.password = password; - return this; - } + /** + * Telugu. + */ + TE, - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + /** + * Tajik. + */ + TG, - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("resetToken:"); - Query.appendQuotedString(_queryBuilder, resetToken.toString()); + /** + * Thai. + */ + TH, - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("password:"); - Query.appendQuotedString(_queryBuilder, password.toString()); + /** + * Tigrinya. + */ + TI, - _queryBuilder.append('}'); - } - } + /** + * Turkmen. + */ + TK, - public interface CustomerResetPayloadQueryDefinition { - void define(CustomerResetPayloadQuery _queryBuilder); - } + /** + * Tongan. + */ + TO, - /** - * Return type for `customerReset` mutation. - */ - public static class CustomerResetPayloadQuery extends Query { - CustomerResetPayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + /** + * Turkish. + */ + TR, /** - * The customer object which was reset. + * Tatar. */ - public CustomerResetPayloadQuery customer(CustomerQueryDefinition queryDef) { - startField("customer"); + TT, - _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Uyghur. + */ + UG, - return this; - } + /** + * Ukrainian. + */ + UK, /** - * A newly created customer access token object for the customer. + * Urdu. */ - public CustomerResetPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { - startField("customerAccessToken"); + UR, - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Uzbek. + */ + UZ, - return this; - } + /** + * Vietnamese. + */ + VI, /** - * The list of errors that occurred from executing the mutation. + * Volapük. */ - public CustomerResetPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); + VO, - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Wolof. + */ + WO, - return this; - } + /** + * Xhosa. + */ + XH, /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * Yiddish. */ - @Deprecated - public CustomerResetPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + YI, - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Yoruba. + */ + YO, - return this; - } - } + /** + * Chinese. + */ + ZH, - /** - * Return type for `customerReset` mutation. - */ - public static class CustomerResetPayload extends AbstractResponse { - public CustomerResetPayload() { - } + /** + * Chinese (Simplified). + */ + ZH_CN, - public CustomerResetPayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "customer": { - Customer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); - } + /** + * Chinese (Traditional). + */ + ZH_TW, - responseData.put(key, optional1); + /** + * Zulu. + */ + ZU, - break; - } + UNKNOWN_VALUE; - case "customerAccessToken": { - CustomerAccessToken optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); - } + public static LanguageCode fromGraphQl(String value) { + if (value == null) { + return null; + } - responseData.put(key, optional1); + switch (value) { + case "AF": { + return AF; + } - break; - } + case "AK": { + return AK; + } - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } + case "AM": { + return AM; + } - responseData.put(key, list1); + case "AR": { + return AR; + } - break; - } + case "AS": { + return AS; + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + case "AZ": { + return AZ; + } - responseData.put(key, list1); + case "BE": { + return BE; + } - break; - } + case "BG": { + return BG; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "BM": { + return BM; } - } - } - public String getGraphQlTypeName() { - return "CustomerResetPayload"; - } + case "BN": { + return BN; + } - /** - * The customer object which was reset. - */ + case "BO": { + return BO; + } - public Customer getCustomer() { - return (Customer) get("customer"); - } + case "BR": { + return BR; + } - public CustomerResetPayload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); - return this; - } + case "BS": { + return BS; + } - /** - * A newly created customer access token object for the customer. - */ + case "CA": { + return CA; + } - public CustomerAccessToken getCustomerAccessToken() { - return (CustomerAccessToken) get("customerAccessToken"); - } + case "CE": { + return CE; + } - public CustomerResetPayload setCustomerAccessToken(CustomerAccessToken arg) { - optimisticData.put(getKey("customerAccessToken"), arg); - return this; - } + case "CKB": { + return CKB; + } - /** - * The list of errors that occurred from executing the mutation. - */ + case "CS": { + return CS; + } - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); - } + case "CU": { + return CU; + } - public CustomerResetPayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); - return this; - } + case "CY": { + return CY; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. - */ + case "DA": { + return DA; + } - public List getUserErrors() { - return (List) get("userErrors"); - } + case "DE": { + return DE; + } - public CustomerResetPayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } + case "DZ": { + return DZ; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "customer": return true; + case "EE": { + return EE; + } - case "customerAccessToken": return true; + case "EL": { + return EL; + } - case "customerUserErrors": return true; + case "EN": { + return EN; + } - case "userErrors": return true; + case "EO": { + return EO; + } - default: return false; - } - } - } + case "ES": { + return ES; + } - public static class CustomerUpdateInput implements Serializable { - private Input firstName = Input.undefined(); + case "ET": { + return ET; + } - private Input lastName = Input.undefined(); + case "EU": { + return EU; + } - private Input email = Input.undefined(); + case "FA": { + return FA; + } - private Input phone = Input.undefined(); + case "FF": { + return FF; + } - private Input password = Input.undefined(); + case "FI": { + return FI; + } - private Input acceptsMarketing = Input.undefined(); + case "FIL": { + return FIL; + } - public String getFirstName() { - return firstName.getValue(); - } + case "FO": { + return FO; + } - public Input getFirstNameInput() { - return firstName; - } + case "FR": { + return FR; + } - public CustomerUpdateInput setFirstName(String firstName) { - this.firstName = Input.optional(firstName); - return this; - } + case "FY": { + return FY; + } - public CustomerUpdateInput setFirstNameInput(Input firstName) { - if (firstName == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.firstName = firstName; - return this; - } + case "GA": { + return GA; + } - public String getLastName() { - return lastName.getValue(); - } + case "GD": { + return GD; + } - public Input getLastNameInput() { - return lastName; - } + case "GL": { + return GL; + } - public CustomerUpdateInput setLastName(String lastName) { - this.lastName = Input.optional(lastName); - return this; - } + case "GU": { + return GU; + } - public CustomerUpdateInput setLastNameInput(Input lastName) { - if (lastName == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.lastName = lastName; - return this; - } + case "GV": { + return GV; + } - public String getEmail() { - return email.getValue(); - } + case "HA": { + return HA; + } - public Input getEmailInput() { - return email; - } + case "HE": { + return HE; + } - public CustomerUpdateInput setEmail(String email) { - this.email = Input.optional(email); - return this; - } + case "HI": { + return HI; + } - public CustomerUpdateInput setEmailInput(Input email) { - if (email == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.email = email; - return this; - } + case "HR": { + return HR; + } - public String getPhone() { - return phone.getValue(); - } + case "HU": { + return HU; + } - public Input getPhoneInput() { - return phone; - } + case "HY": { + return HY; + } - public CustomerUpdateInput setPhone(String phone) { - this.phone = Input.optional(phone); - return this; - } + case "IA": { + return IA; + } - public CustomerUpdateInput setPhoneInput(Input phone) { - if (phone == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.phone = phone; - return this; - } + case "ID": { + return ID; + } - public String getPassword() { - return password.getValue(); - } + case "IG": { + return IG; + } - public Input getPasswordInput() { - return password; - } + case "II": { + return II; + } - public CustomerUpdateInput setPassword(String password) { - this.password = Input.optional(password); - return this; - } + case "IS": { + return IS; + } - public CustomerUpdateInput setPasswordInput(Input password) { - if (password == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.password = password; - return this; - } + case "IT": { + return IT; + } - public Boolean getAcceptsMarketing() { - return acceptsMarketing.getValue(); - } + case "JA": { + return JA; + } - public Input getAcceptsMarketingInput() { - return acceptsMarketing; - } + case "JV": { + return JV; + } - public CustomerUpdateInput setAcceptsMarketing(Boolean acceptsMarketing) { - this.acceptsMarketing = Input.optional(acceptsMarketing); - return this; - } + case "KA": { + return KA; + } - public CustomerUpdateInput setAcceptsMarketingInput(Input acceptsMarketing) { - if (acceptsMarketing == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.acceptsMarketing = acceptsMarketing; - return this; - } + case "KI": { + return KI; + } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + case "KK": { + return KK; + } - if (this.firstName.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("firstName:"); - if (firstName.getValue() != null) { - Query.appendQuotedString(_queryBuilder, firstName.getValue().toString()); - } else { - _queryBuilder.append("null"); + case "KL": { + return KL; } - } - if (this.lastName.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("lastName:"); - if (lastName.getValue() != null) { - Query.appendQuotedString(_queryBuilder, lastName.getValue().toString()); - } else { - _queryBuilder.append("null"); + case "KM": { + return KM; } - } - if (this.email.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("email:"); - if (email.getValue() != null) { - Query.appendQuotedString(_queryBuilder, email.getValue().toString()); - } else { - _queryBuilder.append("null"); + case "KN": { + return KN; } - } - if (this.phone.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("phone:"); - if (phone.getValue() != null) { - Query.appendQuotedString(_queryBuilder, phone.getValue().toString()); - } else { - _queryBuilder.append("null"); + case "KO": { + return KO; } - } - if (this.password.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("password:"); - if (password.getValue() != null) { - Query.appendQuotedString(_queryBuilder, password.getValue().toString()); - } else { - _queryBuilder.append("null"); + case "KS": { + return KS; } - } - if (this.acceptsMarketing.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("acceptsMarketing:"); - if (acceptsMarketing.getValue() != null) { - _queryBuilder.append(acceptsMarketing.getValue()); - } else { - _queryBuilder.append("null"); + case "KU": { + return KU; } - } - _queryBuilder.append('}'); - } - } + case "KW": { + return KW; + } - public interface CustomerUpdatePayloadQueryDefinition { - void define(CustomerUpdatePayloadQuery _queryBuilder); - } + case "KY": { + return KY; + } - /** - * Return type for `customerUpdate` mutation. - */ - public static class CustomerUpdatePayloadQuery extends Query { - CustomerUpdatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "LA": { + return LA; + } - /** - * The updated customer object. - */ - public CustomerUpdatePayloadQuery customer(CustomerQueryDefinition queryDef) { - startField("customer"); + case "LB": { + return LB; + } - _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "LG": { + return LG; + } - return this; - } + case "LN": { + return LN; + } - /** - * The newly created customer access token. If the customer's password is updated, all previous access - * tokens - * (including the one used to perform this mutation) become invalid, and a new token is generated. - */ - public CustomerUpdatePayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { - startField("customerAccessToken"); + case "LO": { + return LO; + } - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "LT": { + return LT; + } - return this; - } + case "LU": { + return LU; + } - /** - * The list of errors that occurred from executing the mutation. - */ - public CustomerUpdatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); + case "LV": { + return LV; + } - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "MG": { + return MG; + } - return this; - } + case "MI": { + return MI; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. - */ - @Deprecated - public CustomerUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + case "MK": { + return MK; + } - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "ML": { + return ML; + } - return this; - } - } + case "MN": { + return MN; + } - /** - * Return type for `customerUpdate` mutation. - */ - public static class CustomerUpdatePayload extends AbstractResponse { - public CustomerUpdatePayload() { - } + case "MO": { + return MO; + } - public CustomerUpdatePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "customer": { - Customer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); - } + case "MR": { + return MR; + } - responseData.put(key, optional1); + case "MS": { + return MS; + } - break; - } + case "MT": { + return MT; + } - case "customerAccessToken": { - CustomerAccessToken optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); - } + case "MY": { + return MY; + } - responseData.put(key, optional1); + case "NB": { + return NB; + } - break; - } + case "ND": { + return ND; + } - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } + case "NE": { + return NE; + } - responseData.put(key, list1); + case "NL": { + return NL; + } - break; - } + case "NN": { + return NN; + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + case "NO": { + return NO; + } - responseData.put(key, list1); + case "OM": { + return OM; + } - break; - } + case "OR": { + return OR; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "OS": { + return OS; } - } - } - public String getGraphQlTypeName() { - return "CustomerUpdatePayload"; - } + case "PA": { + return PA; + } - /** - * The updated customer object. - */ + case "PL": { + return PL; + } - public Customer getCustomer() { - return (Customer) get("customer"); - } + case "PS": { + return PS; + } - public CustomerUpdatePayload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); - return this; - } + case "PT": { + return PT; + } - /** - * The newly created customer access token. If the customer's password is updated, all previous access - * tokens - * (including the one used to perform this mutation) become invalid, and a new token is generated. - */ + case "PT_BR": { + return PT_BR; + } - public CustomerAccessToken getCustomerAccessToken() { - return (CustomerAccessToken) get("customerAccessToken"); - } + case "PT_PT": { + return PT_PT; + } - public CustomerUpdatePayload setCustomerAccessToken(CustomerAccessToken arg) { - optimisticData.put(getKey("customerAccessToken"), arg); - return this; - } + case "QU": { + return QU; + } - /** - * The list of errors that occurred from executing the mutation. - */ + case "RM": { + return RM; + } - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); - } + case "RN": { + return RN; + } - public CustomerUpdatePayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); - return this; - } + case "RO": { + return RO; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. - */ + case "RU": { + return RU; + } - public List getUserErrors() { - return (List) get("userErrors"); - } + case "RW": { + return RW; + } - public CustomerUpdatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } + case "SA": { + return SA; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "customer": return true; + case "SC": { + return SC; + } - case "customerAccessToken": return true; - - case "customerUserErrors": return true; - - case "userErrors": return true; - - default: return false; - } - } - } - - public interface CustomerUserErrorQueryDefinition { - void define(CustomerUserErrorQuery _queryBuilder); - } - - /** - * Represents an error that happens during execution of a customer mutation. - */ - public static class CustomerUserErrorQuery extends Query { - CustomerUserErrorQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The error code. - */ - public CustomerUserErrorQuery code() { - startField("code"); - - return this; - } - - /** - * The path to the input field that caused the error. - */ - public CustomerUserErrorQuery field() { - startField("field"); + case "SD": { + return SD; + } - return this; - } + case "SE": { + return SE; + } - /** - * The error message. - */ - public CustomerUserErrorQuery message() { - startField("message"); + case "SG": { + return SG; + } - return this; - } - } + case "SH": { + return SH; + } - /** - * Represents an error that happens during execution of a customer mutation. - */ - public static class CustomerUserError extends AbstractResponse implements DisplayableError { - public CustomerUserError() { - } + case "SI": { + return SI; + } - public CustomerUserError(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "code": { - CustomerErrorCode optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = CustomerErrorCode.fromGraphQl(jsonAsString(field.getValue(), key)); - } + case "SK": { + return SK; + } - responseData.put(key, optional1); + case "SL": { + return SL; + } - break; - } + case "SN": { + return SN; + } - case "field": { - List optional1 = null; - if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } + case "SO": { + return SO; + } - optional1 = list1; - } + case "SQ": { + return SQ; + } - responseData.put(key, optional1); + case "SR": { + return SR; + } - break; - } + case "SU": { + return SU; + } - case "message": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "SV": { + return SV; + } - break; - } + case "SW": { + return SW; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "TA": { + return TA; } - } - } - public String getGraphQlTypeName() { - return "CustomerUserError"; - } + case "TE": { + return TE; + } - /** - * The error code. - */ + case "TG": { + return TG; + } - public CustomerErrorCode getCode() { - return (CustomerErrorCode) get("code"); - } + case "TH": { + return TH; + } - public CustomerUserError setCode(CustomerErrorCode arg) { - optimisticData.put(getKey("code"), arg); - return this; - } + case "TI": { + return TI; + } - /** - * The path to the input field that caused the error. - */ + case "TK": { + return TK; + } - public List getField() { - return (List) get("field"); - } + case "TO": { + return TO; + } - public CustomerUserError setField(List arg) { - optimisticData.put(getKey("field"), arg); - return this; - } + case "TR": { + return TR; + } - /** - * The error message. - */ + case "TT": { + return TT; + } - public String getMessage() { - return (String) get("message"); - } + case "UG": { + return UG; + } - public CustomerUserError setMessage(String arg) { - optimisticData.put(getKey("message"), arg); - return this; - } + case "UK": { + return UK; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "code": return false; + case "UR": { + return UR; + } - case "field": return false; + case "UZ": { + return UZ; + } - case "message": return false; + case "VI": { + return VI; + } - default: return false; - } - } - } + case "VO": { + return VO; + } - public interface DeliveryAddressQueryDefinition { - void define(DeliveryAddressQuery _queryBuilder); - } + case "WO": { + return WO; + } - /** - * A delivery address of the buyer that is interacting with the cart. - */ - public static class DeliveryAddressQuery extends Query { - DeliveryAddressQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + case "XH": { + return XH; + } - startField("__typename"); - } + case "YI": { + return YI; + } - public DeliveryAddressQuery onMailingAddress(MailingAddressQueryDefinition queryDef) { - startInlineFragment("MailingAddress"); - queryDef.define(new MailingAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - } + case "YO": { + return YO; + } - public interface DeliveryAddress { - String getGraphQlTypeName(); - } + case "ZH": { + return ZH; + } - /** - * A delivery address of the buyer that is interacting with the cart. - */ - public static class UnknownDeliveryAddress extends AbstractResponse implements DeliveryAddress { - public UnknownDeliveryAddress() { - } + case "ZH_CN": { + return ZH_CN; + } - public UnknownDeliveryAddress(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "ZH_TW": { + return ZH_TW; } - } - } - public static DeliveryAddress create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "MailingAddress": { - return new MailingAddress(fields); + case "ZU": { + return ZU; } default: { - return new UnknownDeliveryAddress(fields); + return UNKNOWN_VALUE; } } } + public String toString() { + switch (this) { + case AF: { + return "AF"; + } - public String getGraphQlTypeName() { - return (String) get("__typename"); - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - default: return false; - } - } - } + case AK: { + return "AK"; + } - public static class DeliveryAddressInput implements Serializable { - private Input deliveryAddress = Input.undefined(); + case AM: { + return "AM"; + } - private Input deliveryAddressValidationStrategy = Input.undefined(); + case AR: { + return "AR"; + } - private Input customerAddressId = Input.undefined(); + case AS: { + return "AS"; + } - public MailingAddressInput getDeliveryAddress() { - return deliveryAddress.getValue(); - } + case AZ: { + return "AZ"; + } - public Input getDeliveryAddressInput() { - return deliveryAddress; - } + case BE: { + return "BE"; + } - public DeliveryAddressInput setDeliveryAddress(MailingAddressInput deliveryAddress) { - this.deliveryAddress = Input.optional(deliveryAddress); - return this; - } + case BG: { + return "BG"; + } - public DeliveryAddressInput setDeliveryAddressInput(Input deliveryAddress) { - if (deliveryAddress == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.deliveryAddress = deliveryAddress; - return this; - } + case BM: { + return "BM"; + } - public DeliveryAddressValidationStrategy getDeliveryAddressValidationStrategy() { - return deliveryAddressValidationStrategy.getValue(); - } + case BN: { + return "BN"; + } - public Input getDeliveryAddressValidationStrategyInput() { - return deliveryAddressValidationStrategy; - } + case BO: { + return "BO"; + } - public DeliveryAddressInput setDeliveryAddressValidationStrategy(DeliveryAddressValidationStrategy deliveryAddressValidationStrategy) { - this.deliveryAddressValidationStrategy = Input.optional(deliveryAddressValidationStrategy); - return this; - } + case BR: { + return "BR"; + } - public DeliveryAddressInput setDeliveryAddressValidationStrategyInput(Input deliveryAddressValidationStrategy) { - if (deliveryAddressValidationStrategy == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.deliveryAddressValidationStrategy = deliveryAddressValidationStrategy; - return this; - } + case BS: { + return "BS"; + } - public ID getCustomerAddressId() { - return customerAddressId.getValue(); - } + case CA: { + return "CA"; + } - public Input getCustomerAddressIdInput() { - return customerAddressId; - } + case CE: { + return "CE"; + } - public DeliveryAddressInput setCustomerAddressId(ID customerAddressId) { - this.customerAddressId = Input.optional(customerAddressId); - return this; - } + case CKB: { + return "CKB"; + } - public DeliveryAddressInput setCustomerAddressIdInput(Input customerAddressId) { - if (customerAddressId == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.customerAddressId = customerAddressId; - return this; - } + case CS: { + return "CS"; + } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + case CU: { + return "CU"; + } - if (this.deliveryAddress.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("deliveryAddress:"); - if (deliveryAddress.getValue() != null) { - deliveryAddress.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); + case CY: { + return "CY"; } - } - if (this.deliveryAddressValidationStrategy.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("deliveryAddressValidationStrategy:"); - if (deliveryAddressValidationStrategy.getValue() != null) { - _queryBuilder.append(deliveryAddressValidationStrategy.getValue().toString()); - } else { - _queryBuilder.append("null"); + case DA: { + return "DA"; } - } - if (this.customerAddressId.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("customerAddressId:"); - if (customerAddressId.getValue() != null) { - Query.appendQuotedString(_queryBuilder, customerAddressId.getValue().toString()); - } else { - _queryBuilder.append("null"); + case DE: { + return "DE"; } - } - _queryBuilder.append('}'); - } - } + case DZ: { + return "DZ"; + } - /** - * Defines the types of available validation strategies for delivery addresses. - */ - public enum DeliveryAddressValidationStrategy { - /** - * Only the country code is validated. - */ - COUNTRY_CODE_ONLY, + case EE: { + return "EE"; + } - /** - * Strict validation is performed, i.e. all fields in the address are validated - * according to Shopify's checkout rules. If the address fails validation, the cart will not be - * updated. - */ - STRICT, + case EL: { + return "EL"; + } - UNKNOWN_VALUE; + case EN: { + return "EN"; + } - public static DeliveryAddressValidationStrategy fromGraphQl(String value) { - if (value == null) { - return null; - } + case EO: { + return "EO"; + } - switch (value) { - case "COUNTRY_CODE_ONLY": { - return COUNTRY_CODE_ONLY; + case ES: { + return "ES"; } - case "STRICT": { - return STRICT; + case ET: { + return "ET"; } - default: { - return UNKNOWN_VALUE; + case EU: { + return "EU"; } - } - } - public String toString() { - switch (this) { - case COUNTRY_CODE_ONLY: { - return "COUNTRY_CODE_ONLY"; + + case FA: { + return "FA"; } - case STRICT: { - return "STRICT"; + case FF: { + return "FF"; } - default: { - return ""; + case FI: { + return "FI"; } - } - } - } - - /** - * List of different delivery method types. - */ - public enum DeliveryMethodType { - /** - * Local Delivery. - */ - LOCAL, - - /** - * None. - */ - NONE, - - /** - * Shipping to a Pickup Point. - */ - PICKUP_POINT, - - /** - * Local Pickup. - */ - PICK_UP, - - /** - * Retail. - */ - RETAIL, - /** - * Shipping. - */ - SHIPPING, - - UNKNOWN_VALUE; - - public static DeliveryMethodType fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "LOCAL": { - return LOCAL; + case FIL: { + return "FIL"; } - case "NONE": { - return NONE; + case FO: { + return "FO"; } - case "PICKUP_POINT": { - return PICKUP_POINT; + case FR: { + return "FR"; } - case "PICK_UP": { - return PICK_UP; + case FY: { + return "FY"; } - case "RETAIL": { - return RETAIL; + case GA: { + return "GA"; } - case "SHIPPING": { - return SHIPPING; + case GD: { + return "GD"; } - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case LOCAL: { - return "LOCAL"; + case GL: { + return "GL"; } - case NONE: { - return "NONE"; + case GU: { + return "GU"; } - case PICKUP_POINT: { - return "PICKUP_POINT"; + case GV: { + return "GV"; } - case PICK_UP: { - return "PICK_UP"; + case HA: { + return "HA"; } - case RETAIL: { - return "RETAIL"; + case HE: { + return "HE"; } - case SHIPPING: { - return "SHIPPING"; + case HI: { + return "HI"; } - default: { - return ""; + case HR: { + return "HR"; } - } - } - } - - /** - * Digital wallet, such as Apple Pay, which can be used for accelerated checkouts. - */ - public enum DigitalWallet { - /** - * Android Pay. - */ - ANDROID_PAY, - - /** - * Apple Pay. - */ - APPLE_PAY, - - /** - * Google Pay. - */ - GOOGLE_PAY, - - /** - * Shopify Pay. - */ - SHOPIFY_PAY, - - UNKNOWN_VALUE; - - public static DigitalWallet fromGraphQl(String value) { - if (value == null) { - return null; - } - switch (value) { - case "ANDROID_PAY": { - return ANDROID_PAY; + case HU: { + return "HU"; } - case "APPLE_PAY": { - return APPLE_PAY; + case HY: { + return "HY"; } - case "GOOGLE_PAY": { - return GOOGLE_PAY; + case IA: { + return "IA"; } - case "SHOPIFY_PAY": { - return SHOPIFY_PAY; + case ID: { + return "ID"; } - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case ANDROID_PAY: { - return "ANDROID_PAY"; + case IG: { + return "IG"; } - case APPLE_PAY: { - return "APPLE_PAY"; + case II: { + return "II"; } - case GOOGLE_PAY: { - return "GOOGLE_PAY"; + case IS: { + return "IS"; } - case SHOPIFY_PAY: { - return "SHOPIFY_PAY"; + case IT: { + return "IT"; } - default: { - return ""; + case JA: { + return "JA"; } - } - } - } - - public interface DiscountAllocationQueryDefinition { - void define(DiscountAllocationQuery _queryBuilder); - } - - /** - * An amount discounting the line that has been allocated by a discount. - */ - public static class DiscountAllocationQuery extends Query { - DiscountAllocationQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * Amount of discount allocated. - */ - public DiscountAllocationQuery allocatedAmount(MoneyV2QueryDefinition queryDef) { - startField("allocatedAmount"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The discount this allocated amount originated from. - */ - public DiscountAllocationQuery discountApplication(DiscountApplicationQueryDefinition queryDef) { - startField("discountApplication"); - - _queryBuilder.append('{'); - queryDef.define(new DiscountApplicationQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - /** - * An amount discounting the line that has been allocated by a discount. - */ - public static class DiscountAllocation extends AbstractResponse { - public DiscountAllocation() { - } - - public DiscountAllocation(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "allocatedAmount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "discountApplication": { - responseData.put(key, UnknownDiscountApplication.create(jsonAsObject(field.getValue(), key))); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case JV: { + return "JV"; } - } - } - - public String getGraphQlTypeName() { - return "DiscountAllocation"; - } - - /** - * Amount of discount allocated. - */ - - public MoneyV2 getAllocatedAmount() { - return (MoneyV2) get("allocatedAmount"); - } - - public DiscountAllocation setAllocatedAmount(MoneyV2 arg) { - optimisticData.put(getKey("allocatedAmount"), arg); - return this; - } - - /** - * The discount this allocated amount originated from. - */ - - public DiscountApplication getDiscountApplication() { - return (DiscountApplication) get("discountApplication"); - } - - public DiscountAllocation setDiscountApplication(DiscountApplication arg) { - optimisticData.put(getKey("discountApplication"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "allocatedAmount": return true; - - case "discountApplication": return false; - - default: return false; - } - } - } - - public interface DiscountApplicationQueryDefinition { - void define(DiscountApplicationQuery _queryBuilder); - } - - /** - * Discount applications capture the intentions of a discount source at - * the time of application. - */ - public static class DiscountApplicationQuery extends Query { - DiscountApplicationQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - - startField("__typename"); - } - - /** - * The method by which the discount's value is allocated to its entitled items. - */ - public DiscountApplicationQuery allocationMethod() { - startField("allocationMethod"); - - return this; - } - - /** - * Which lines of targetType that the discount is allocated over. - */ - public DiscountApplicationQuery targetSelection() { - startField("targetSelection"); - return this; - } + case KA: { + return "KA"; + } - /** - * The type of line that the discount is applicable towards. - */ - public DiscountApplicationQuery targetType() { - startField("targetType"); + case KI: { + return "KI"; + } - return this; - } + case KK: { + return "KK"; + } - /** - * The value of the discount application. - */ - public DiscountApplicationQuery value(PricingValueQueryDefinition queryDef) { - startField("value"); + case KL: { + return "KL"; + } - _queryBuilder.append('{'); - queryDef.define(new PricingValueQuery(_queryBuilder)); - _queryBuilder.append('}'); + case KM: { + return "KM"; + } - return this; - } + case KN: { + return "KN"; + } - public DiscountApplicationQuery onAutomaticDiscountApplication(AutomaticDiscountApplicationQueryDefinition queryDef) { - startInlineFragment("AutomaticDiscountApplication"); - queryDef.define(new AutomaticDiscountApplicationQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + case KO: { + return "KO"; + } - public DiscountApplicationQuery onDiscountCodeApplication(DiscountCodeApplicationQueryDefinition queryDef) { - startInlineFragment("DiscountCodeApplication"); - queryDef.define(new DiscountCodeApplicationQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + case KS: { + return "KS"; + } - public DiscountApplicationQuery onManualDiscountApplication(ManualDiscountApplicationQueryDefinition queryDef) { - startInlineFragment("ManualDiscountApplication"); - queryDef.define(new ManualDiscountApplicationQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + case KU: { + return "KU"; + } - public DiscountApplicationQuery onScriptDiscountApplication(ScriptDiscountApplicationQueryDefinition queryDef) { - startInlineFragment("ScriptDiscountApplication"); - queryDef.define(new ScriptDiscountApplicationQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - } + case KW: { + return "KW"; + } - public interface DiscountApplication { - String getGraphQlTypeName(); + case KY: { + return "KY"; + } - DiscountApplicationAllocationMethod getAllocationMethod(); + case LA: { + return "LA"; + } - DiscountApplicationTargetSelection getTargetSelection(); + case LB: { + return "LB"; + } - DiscountApplicationTargetType getTargetType(); + case LG: { + return "LG"; + } - PricingValue getValue(); - } + case LN: { + return "LN"; + } - /** - * Discount applications capture the intentions of a discount source at - * the time of application. - */ - public static class UnknownDiscountApplication extends AbstractResponse implements DiscountApplication { - public UnknownDiscountApplication() { - } + case LO: { + return "LO"; + } - public UnknownDiscountApplication(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "allocationMethod": { - responseData.put(key, DiscountApplicationAllocationMethod.fromGraphQl(jsonAsString(field.getValue(), key))); + case LT: { + return "LT"; + } - break; - } + case LU: { + return "LU"; + } - case "targetSelection": { - responseData.put(key, DiscountApplicationTargetSelection.fromGraphQl(jsonAsString(field.getValue(), key))); + case LV: { + return "LV"; + } - break; - } + case MG: { + return "MG"; + } - case "targetType": { - responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); + case MI: { + return "MI"; + } - break; - } + case MK: { + return "MK"; + } - case "value": { - responseData.put(key, UnknownPricingValue.create(jsonAsObject(field.getValue(), key))); + case ML: { + return "ML"; + } - break; - } + case MN: { + return "MN"; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case MO: { + return "MO"; } - } - } - public static DiscountApplication create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "AutomaticDiscountApplication": { - return new AutomaticDiscountApplication(fields); + case MR: { + return "MR"; } - case "DiscountCodeApplication": { - return new DiscountCodeApplication(fields); + case MS: { + return "MS"; } - case "ManualDiscountApplication": { - return new ManualDiscountApplication(fields); + case MT: { + return "MT"; } - case "ScriptDiscountApplication": { - return new ScriptDiscountApplication(fields); + case MY: { + return "MY"; } - default: { - return new UnknownDiscountApplication(fields); - } - } - } - - public String getGraphQlTypeName() { - return (String) get("__typename"); - } - - /** - * The method by which the discount's value is allocated to its entitled items. - */ - - public DiscountApplicationAllocationMethod getAllocationMethod() { - return (DiscountApplicationAllocationMethod) get("allocationMethod"); - } - - public UnknownDiscountApplication setAllocationMethod(DiscountApplicationAllocationMethod arg) { - optimisticData.put(getKey("allocationMethod"), arg); - return this; - } - - /** - * Which lines of targetType that the discount is allocated over. - */ - - public DiscountApplicationTargetSelection getTargetSelection() { - return (DiscountApplicationTargetSelection) get("targetSelection"); - } - - public UnknownDiscountApplication setTargetSelection(DiscountApplicationTargetSelection arg) { - optimisticData.put(getKey("targetSelection"), arg); - return this; - } - - /** - * The type of line that the discount is applicable towards. - */ - - public DiscountApplicationTargetType getTargetType() { - return (DiscountApplicationTargetType) get("targetType"); - } - - public UnknownDiscountApplication setTargetType(DiscountApplicationTargetType arg) { - optimisticData.put(getKey("targetType"), arg); - return this; - } - - /** - * The value of the discount application. - */ - - public PricingValue getValue() { - return (PricingValue) get("value"); - } - - public UnknownDiscountApplication setValue(PricingValue arg) { - optimisticData.put(getKey("value"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "allocationMethod": return false; - - case "targetSelection": return false; - - case "targetType": return false; - - case "value": return false; - - default: return false; - } - } - } - - /** - * The method by which the discount's value is allocated onto its entitled lines. - */ - public enum DiscountApplicationAllocationMethod { - /** - * The value is spread across all entitled lines. - */ - ACROSS, - - /** - * The value is applied onto every entitled line. - */ - EACH, - - /** - * The value is specifically applied onto a particular line. - * - * @deprecated Use ACROSS instead. - */ - @Deprecated - ONE, - - UNKNOWN_VALUE; - - public static DiscountApplicationAllocationMethod fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "ACROSS": { - return ACROSS; - } - - case "EACH": { - return EACH; - } - - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case ACROSS: { - return "ACROSS"; - } - - case EACH: { - return "EACH"; - } - - default: { - return ""; - } - } - } - } - - public interface DiscountApplicationConnectionQueryDefinition { - void define(DiscountApplicationConnectionQuery _queryBuilder); - } - - /** - * An auto-generated type for paginating through multiple DiscountApplications. - */ - public static class DiscountApplicationConnectionQuery extends Query { - DiscountApplicationConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * A list of edges. - */ - public DiscountApplicationConnectionQuery edges(DiscountApplicationEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new DiscountApplicationEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * A list of the nodes contained in DiscountApplicationEdge. - */ - public DiscountApplicationConnectionQuery nodes(DiscountApplicationQueryDefinition queryDef) { - startField("nodes"); - - _queryBuilder.append('{'); - queryDef.define(new DiscountApplicationQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * Information to aid in pagination. - */ - public DiscountApplicationConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * An auto-generated type for paginating through multiple DiscountApplications. - */ - public static class DiscountApplicationConnection extends AbstractResponse { - public DiscountApplicationConnection() { - } - - public DiscountApplicationConnection(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new DiscountApplicationEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(UnknownDiscountApplication.create(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "DiscountApplicationConnection"; - } - - /** - * A list of edges. - */ - - public List getEdges() { - return (List) get("edges"); - } - - public DiscountApplicationConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; - } - - /** - * A list of the nodes contained in DiscountApplicationEdge. - */ - - public List getNodes() { - return (List) get("nodes"); - } - - public DiscountApplicationConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; - } - - /** - * Information to aid in pagination. - */ - - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } - - public DiscountApplicationConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return false; - - case "pageInfo": return true; - - default: return false; - } - } - } - - public interface DiscountApplicationEdgeQueryDefinition { - void define(DiscountApplicationEdgeQuery _queryBuilder); - } - - /** - * An auto-generated type which holds one DiscountApplication and a cursor during pagination. - */ - public static class DiscountApplicationEdgeQuery extends Query { - DiscountApplicationEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * A cursor for use in pagination. - */ - public DiscountApplicationEdgeQuery cursor() { - startField("cursor"); - - return this; - } - - /** - * The item at the end of DiscountApplicationEdge. - */ - public DiscountApplicationEdgeQuery node(DiscountApplicationQueryDefinition queryDef) { - startField("node"); - - _queryBuilder.append('{'); - queryDef.define(new DiscountApplicationQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * An auto-generated type which holds one DiscountApplication and a cursor during pagination. - */ - public static class DiscountApplicationEdge extends AbstractResponse { - public DiscountApplicationEdge() { - } - - public DiscountApplicationEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "node": { - responseData.put(key, UnknownDiscountApplication.create(jsonAsObject(field.getValue(), key))); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "DiscountApplicationEdge"; - } - - /** - * A cursor for use in pagination. - */ - - public String getCursor() { - return (String) get("cursor"); - } - - public DiscountApplicationEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; - } - - /** - * The item at the end of DiscountApplicationEdge. - */ - - public DiscountApplication getNode() { - return (DiscountApplication) get("node"); - } - - public DiscountApplicationEdge setNode(DiscountApplication arg) { - optimisticData.put(getKey("node"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; - - case "node": return false; - - default: return false; - } - } - } - - /** - * The lines on the order to which the discount is applied, of the type defined by - * the discount application's `targetType`. For example, the value `ENTITLED`, combined with a - * `targetType` of - * `LINE_ITEM`, applies the discount on all line items that are entitled to the discount. - * The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all - * shipping lines. - */ - public enum DiscountApplicationTargetSelection { - /** - * The discount is allocated onto all the lines. - */ - ALL, - - /** - * The discount is allocated onto only the lines that it's entitled for. - */ - ENTITLED, - - /** - * The discount is allocated onto explicitly chosen lines. - */ - EXPLICIT, - - UNKNOWN_VALUE; - - public static DiscountApplicationTargetSelection fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "ALL": { - return ALL; - } - - case "ENTITLED": { - return ENTITLED; - } - - case "EXPLICIT": { - return EXPLICIT; - } - - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case ALL: { - return "ALL"; - } - - case ENTITLED: { - return "ENTITLED"; - } - - case EXPLICIT: { - return "EXPLICIT"; - } - - default: { - return ""; - } - } - } - } - - /** - * The type of line (i.e. line item or shipping line) on an order that the discount is applicable - * towards. - */ - public enum DiscountApplicationTargetType { - /** - * The discount applies onto line items. - */ - LINE_ITEM, - - /** - * The discount applies onto shipping lines. - */ - SHIPPING_LINE, - - UNKNOWN_VALUE; - - public static DiscountApplicationTargetType fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "LINE_ITEM": { - return LINE_ITEM; + case NB: { + return "NB"; } - case "SHIPPING_LINE": { - return SHIPPING_LINE; + case ND: { + return "ND"; } - default: { - return UNKNOWN_VALUE; + case NE: { + return "NE"; } - } - } - public String toString() { - switch (this) { - case LINE_ITEM: { - return "LINE_ITEM"; - } - - case SHIPPING_LINE: { - return "SHIPPING_LINE"; - } - - default: { - return ""; - } - } - } - } - - public interface DiscountCodeApplicationQueryDefinition { - void define(DiscountCodeApplicationQuery _queryBuilder); - } - - /** - * Discount code applications capture the intentions of a discount code at - * the time that it is applied. - */ - public static class DiscountCodeApplicationQuery extends Query { - DiscountCodeApplicationQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The method by which the discount's value is allocated to its entitled items. - */ - public DiscountCodeApplicationQuery allocationMethod() { - startField("allocationMethod"); - - return this; - } - - /** - * Specifies whether the discount code was applied successfully. - */ - public DiscountCodeApplicationQuery applicable() { - startField("applicable"); - - return this; - } - - /** - * The string identifying the discount code that was used at the time of application. - */ - public DiscountCodeApplicationQuery code() { - startField("code"); - - return this; - } - - /** - * Which lines of targetType that the discount is allocated over. - */ - public DiscountCodeApplicationQuery targetSelection() { - startField("targetSelection"); - - return this; - } - - /** - * The type of line that the discount is applicable towards. - */ - public DiscountCodeApplicationQuery targetType() { - startField("targetType"); - - return this; - } - - /** - * The value of the discount application. - */ - public DiscountCodeApplicationQuery value(PricingValueQueryDefinition queryDef) { - startField("value"); - - _queryBuilder.append('{'); - queryDef.define(new PricingValueQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * Discount code applications capture the intentions of a discount code at - * the time that it is applied. - */ - public static class DiscountCodeApplication extends AbstractResponse implements DiscountApplication { - public DiscountCodeApplication() { - } - - public DiscountCodeApplication(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "allocationMethod": { - responseData.put(key, DiscountApplicationAllocationMethod.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "applicable": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "code": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "targetSelection": { - responseData.put(key, DiscountApplicationTargetSelection.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "targetType": { - responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "value": { - responseData.put(key, UnknownPricingValue.create(jsonAsObject(field.getValue(), key))); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "DiscountCodeApplication"; - } - - /** - * The method by which the discount's value is allocated to its entitled items. - */ - - public DiscountApplicationAllocationMethod getAllocationMethod() { - return (DiscountApplicationAllocationMethod) get("allocationMethod"); - } - - public DiscountCodeApplication setAllocationMethod(DiscountApplicationAllocationMethod arg) { - optimisticData.put(getKey("allocationMethod"), arg); - return this; - } - - /** - * Specifies whether the discount code was applied successfully. - */ - - public Boolean getApplicable() { - return (Boolean) get("applicable"); - } - - public DiscountCodeApplication setApplicable(Boolean arg) { - optimisticData.put(getKey("applicable"), arg); - return this; - } - - /** - * The string identifying the discount code that was used at the time of application. - */ - - public String getCode() { - return (String) get("code"); - } - - public DiscountCodeApplication setCode(String arg) { - optimisticData.put(getKey("code"), arg); - return this; - } - - /** - * Which lines of targetType that the discount is allocated over. - */ - - public DiscountApplicationTargetSelection getTargetSelection() { - return (DiscountApplicationTargetSelection) get("targetSelection"); - } - - public DiscountCodeApplication setTargetSelection(DiscountApplicationTargetSelection arg) { - optimisticData.put(getKey("targetSelection"), arg); - return this; - } - - /** - * The type of line that the discount is applicable towards. - */ - - public DiscountApplicationTargetType getTargetType() { - return (DiscountApplicationTargetType) get("targetType"); - } - - public DiscountCodeApplication setTargetType(DiscountApplicationTargetType arg) { - optimisticData.put(getKey("targetType"), arg); - return this; - } - - /** - * The value of the discount application. - */ - - public PricingValue getValue() { - return (PricingValue) get("value"); - } - - public DiscountCodeApplication setValue(PricingValue arg) { - optimisticData.put(getKey("value"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "allocationMethod": return false; - - case "applicable": return false; - - case "code": return false; - - case "targetSelection": return false; - - case "targetType": return false; - - case "value": return false; - - default: return false; - } - } - } - - public interface DisplayableErrorQueryDefinition { - void define(DisplayableErrorQuery _queryBuilder); - } - - /** - * Represents an error in the input of a mutation. - */ - public static class DisplayableErrorQuery extends Query { - DisplayableErrorQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - - startField("__typename"); - } - - /** - * The path to the input field that caused the error. - */ - public DisplayableErrorQuery field() { - startField("field"); - - return this; - } - - /** - * The error message. - */ - public DisplayableErrorQuery message() { - startField("message"); - - return this; - } - - public DisplayableErrorQuery onCartUserError(CartUserErrorQueryDefinition queryDef) { - startInlineFragment("CartUserError"); - queryDef.define(new CartUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public DisplayableErrorQuery onCheckoutUserError(CheckoutUserErrorQueryDefinition queryDef) { - startInlineFragment("CheckoutUserError"); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public DisplayableErrorQuery onCustomerUserError(CustomerUserErrorQueryDefinition queryDef) { - startInlineFragment("CustomerUserError"); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public DisplayableErrorQuery onMetafieldDeleteUserError(MetafieldDeleteUserErrorQueryDefinition queryDef) { - startInlineFragment("MetafieldDeleteUserError"); - queryDef.define(new MetafieldDeleteUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public DisplayableErrorQuery onMetafieldsSetUserError(MetafieldsSetUserErrorQueryDefinition queryDef) { - startInlineFragment("MetafieldsSetUserError"); - queryDef.define(new MetafieldsSetUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public DisplayableErrorQuery onUserError(UserErrorQueryDefinition queryDef) { - startInlineFragment("UserError"); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - } - - public interface DisplayableError { - String getGraphQlTypeName(); - - List getField(); - - String getMessage(); - } - - /** - * Represents an error in the input of a mutation. - */ - public static class UnknownDisplayableError extends AbstractResponse implements DisplayableError { - public UnknownDisplayableError() { - } - - public UnknownDisplayableError(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "field": { - List optional1 = null; - if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } - - optional1 = list1; - } - - responseData.put(key, optional1); - - break; - } - - case "message": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public static DisplayableError create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "CartUserError": { - return new CartUserError(fields); - } - - case "CheckoutUserError": { - return new CheckoutUserError(fields); - } - - case "CustomerUserError": { - return new CustomerUserError(fields); - } - - case "MetafieldDeleteUserError": { - return new MetafieldDeleteUserError(fields); - } - - case "MetafieldsSetUserError": { - return new MetafieldsSetUserError(fields); - } - - case "UserError": { - return new UserError(fields); - } - - default: { - return new UnknownDisplayableError(fields); - } - } - } - - public String getGraphQlTypeName() { - return (String) get("__typename"); - } - - /** - * The path to the input field that caused the error. - */ - - public List getField() { - return (List) get("field"); - } - - public UnknownDisplayableError setField(List arg) { - optimisticData.put(getKey("field"), arg); - return this; - } - - /** - * The error message. - */ - - public String getMessage() { - return (String) get("message"); - } - - public UnknownDisplayableError setMessage(String arg) { - optimisticData.put(getKey("message"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "field": return false; - - case "message": return false; - - default: return false; - } - } - } - - public interface DomainQueryDefinition { - void define(DomainQuery _queryBuilder); - } - - /** - * Represents a web address. - */ - public static class DomainQuery extends Query { - DomainQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The host name of the domain (eg: `example.com`). - */ - public DomainQuery host() { - startField("host"); - - return this; - } - - /** - * Whether SSL is enabled or not. - */ - public DomainQuery sslEnabled() { - startField("sslEnabled"); - - return this; - } - - /** - * The URL of the domain (eg: `https://example.com`). - */ - public DomainQuery url() { - startField("url"); - - return this; - } - } - - /** - * Represents a web address. - */ - public static class Domain extends AbstractResponse { - public Domain() { - } - - public Domain(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "host": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "sslEnabled": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "url": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "Domain"; - } - - /** - * The host name of the domain (eg: `example.com`). - */ - - public String getHost() { - return (String) get("host"); - } - - public Domain setHost(String arg) { - optimisticData.put(getKey("host"), arg); - return this; - } - - /** - * Whether SSL is enabled or not. - */ - - public Boolean getSslEnabled() { - return (Boolean) get("sslEnabled"); - } - - public Domain setSslEnabled(Boolean arg) { - optimisticData.put(getKey("sslEnabled"), arg); - return this; - } - - /** - * The URL of the domain (eg: `https://example.com`). - */ - - public String getUrl() { - return (String) get("url"); - } - - public Domain setUrl(String arg) { - optimisticData.put(getKey("url"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "host": return false; - - case "sslEnabled": return false; - - case "url": return false; - - default: return false; - } - } - } - - public interface ExternalVideoQueryDefinition { - void define(ExternalVideoQuery _queryBuilder); - } - - /** - * Represents a video hosted outside of Shopify. - */ - public static class ExternalVideoQuery extends Query { - ExternalVideoQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - - startField("id"); - } - - /** - * A word or phrase to share the nature or contents of a media. - */ - public ExternalVideoQuery alt() { - startField("alt"); - - return this; - } - - /** - * The embed URL of the video for the respective host. - */ - public ExternalVideoQuery embedUrl() { - startField("embedUrl"); - - return this; - } - - /** - * The URL. - * - * @deprecated Use `originUrl` instead. - */ - @Deprecated - public ExternalVideoQuery embeddedUrl() { - startField("embeddedUrl"); - - return this; - } - - /** - * The host of the external video. - */ - public ExternalVideoQuery host() { - startField("host"); - - return this; - } - - /** - * The media content type. - */ - public ExternalVideoQuery mediaContentType() { - startField("mediaContentType"); - - return this; - } - - /** - * The origin URL of the video on the respective host. - */ - public ExternalVideoQuery originUrl() { - startField("originUrl"); - - return this; - } - - /** - * The presentation for a media. - */ - public ExternalVideoQuery presentation(MediaPresentationQueryDefinition queryDef) { - startField("presentation"); - - _queryBuilder.append('{'); - queryDef.define(new MediaPresentationQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The preview image for the media. - */ - public ExternalVideoQuery previewImage(ImageQueryDefinition queryDef) { - startField("previewImage"); - - _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * Represents a video hosted outside of Shopify. - */ - public static class ExternalVideo extends AbstractResponse implements Media, Node { - public ExternalVideo() { - } - - public ExternalVideo(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "alt": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "embedUrl": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "embeddedUrl": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "host": { - responseData.put(key, MediaHost.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - - break; - } - - case "mediaContentType": { - responseData.put(key, MediaContentType.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "originUrl": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "presentation": { - MediaPresentation optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MediaPresentation(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "previewImage": { - Image optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public ExternalVideo(ID id) { - this(); - optimisticData.put("id", id); - } - - public String getGraphQlTypeName() { - return "ExternalVideo"; - } - - /** - * A word or phrase to share the nature or contents of a media. - */ - - public String getAlt() { - return (String) get("alt"); - } - - public ExternalVideo setAlt(String arg) { - optimisticData.put(getKey("alt"), arg); - return this; - } - - /** - * The embed URL of the video for the respective host. - */ - - public String getEmbedUrl() { - return (String) get("embedUrl"); - } - - public ExternalVideo setEmbedUrl(String arg) { - optimisticData.put(getKey("embedUrl"), arg); - return this; - } - - /** - * The URL. - * - * @deprecated Use `originUrl` instead. - */ - - public String getEmbeddedUrl() { - return (String) get("embeddedUrl"); - } - - public ExternalVideo setEmbeddedUrl(String arg) { - optimisticData.put(getKey("embeddedUrl"), arg); - return this; - } - - /** - * The host of the external video. - */ - - public MediaHost getHost() { - return (MediaHost) get("host"); - } - - public ExternalVideo setHost(MediaHost arg) { - optimisticData.put(getKey("host"), arg); - return this; - } - - /** - * A globally-unique ID. - */ - - public ID getId() { - return (ID) get("id"); - } - - /** - * The media content type. - */ - - public MediaContentType getMediaContentType() { - return (MediaContentType) get("mediaContentType"); - } - - public ExternalVideo setMediaContentType(MediaContentType arg) { - optimisticData.put(getKey("mediaContentType"), arg); - return this; - } - - /** - * The origin URL of the video on the respective host. - */ - - public String getOriginUrl() { - return (String) get("originUrl"); - } - - public ExternalVideo setOriginUrl(String arg) { - optimisticData.put(getKey("originUrl"), arg); - return this; - } - - /** - * The presentation for a media. - */ - - public MediaPresentation getPresentation() { - return (MediaPresentation) get("presentation"); - } - - public ExternalVideo setPresentation(MediaPresentation arg) { - optimisticData.put(getKey("presentation"), arg); - return this; - } - - /** - * The preview image for the media. - */ - - public Image getPreviewImage() { - return (Image) get("previewImage"); - } - - public ExternalVideo setPreviewImage(Image arg) { - optimisticData.put(getKey("previewImage"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "alt": return false; - - case "embedUrl": return false; - - case "embeddedUrl": return false; - - case "host": return false; - - case "id": return false; - - case "mediaContentType": return false; - - case "originUrl": return false; - - case "presentation": return true; - - case "previewImage": return true; - - default: return false; - } - } - } - - public interface FilterQueryDefinition { - void define(FilterQuery _queryBuilder); - } - - /** - * A filter that is supported on the parent field. - */ - public static class FilterQuery extends Query { - FilterQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * A unique identifier. - */ - public FilterQuery id() { - startField("id"); - - return this; - } - - /** - * A human-friendly string for this filter. - */ - public FilterQuery label() { - startField("label"); - - return this; - } - - /** - * Describes how to present the filter values. - * Returns a value only for filters of type `LIST`. Returns null for other types. - */ - public FilterQuery presentation() { - startField("presentation"); - - return this; - } - - /** - * An enumeration that denotes the type of data this filter represents. - */ - public FilterQuery type() { - startField("type"); - - return this; - } - - /** - * The list of values for this filter. - */ - public FilterQuery values(FilterValueQueryDefinition queryDef) { - startField("values"); - - _queryBuilder.append('{'); - queryDef.define(new FilterValueQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * A filter that is supported on the parent field. - */ - public static class Filter extends AbstractResponse { - public Filter() { - } - - public Filter(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "id": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "label": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "presentation": { - FilterPresentation optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = FilterPresentation.fromGraphQl(jsonAsString(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "type": { - responseData.put(key, FilterType.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "values": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new FilterValue(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "Filter"; - } - - /** - * A unique identifier. - */ - - public String getId() { - return (String) get("id"); - } - - public Filter setId(String arg) { - optimisticData.put(getKey("id"), arg); - return this; - } - - /** - * A human-friendly string for this filter. - */ - - public String getLabel() { - return (String) get("label"); - } - - public Filter setLabel(String arg) { - optimisticData.put(getKey("label"), arg); - return this; - } - - /** - * Describes how to present the filter values. - * Returns a value only for filters of type `LIST`. Returns null for other types. - */ - - public FilterPresentation getPresentation() { - return (FilterPresentation) get("presentation"); - } - - public Filter setPresentation(FilterPresentation arg) { - optimisticData.put(getKey("presentation"), arg); - return this; - } - - /** - * An enumeration that denotes the type of data this filter represents. - */ - - public FilterType getType() { - return (FilterType) get("type"); - } - - public Filter setType(FilterType arg) { - optimisticData.put(getKey("type"), arg); - return this; - } - - /** - * The list of values for this filter. - */ - - public List getValues() { - return (List) get("values"); - } - - public Filter setValues(List arg) { - optimisticData.put(getKey("values"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "id": return false; - - case "label": return false; - - case "presentation": return false; - - case "type": return false; - - case "values": return true; - - default: return false; - } - } - } - - /** - * Defines how to present the filter values, specifies the presentation of the filter. - */ - public enum FilterPresentation { - /** - * Image presentation, filter values display an image. - */ - IMAGE, - - /** - * Swatch presentation, filter values display color or image patterns. - */ - SWATCH, - - /** - * Text presentation, no additional visual display for filter values. - */ - TEXT, - - UNKNOWN_VALUE; - - public static FilterPresentation fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "IMAGE": { - return IMAGE; - } - - case "SWATCH": { - return SWATCH; - } - - case "TEXT": { - return TEXT; - } - - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case IMAGE: { - return "IMAGE"; - } - - case SWATCH: { - return "SWATCH"; - } - - case TEXT: { - return "TEXT"; - } - - default: { - return ""; - } - } - } - } - - /** - * The type of data that the filter group represents. - * For more information, refer to [Filter products in a collection with the Storefront API] - * (https://shopify.dev/custom-storefronts/products-collections/filter-products). - */ - public enum FilterType { - /** - * A boolean value. - */ - BOOLEAN, - - /** - * A list of selectable values. - */ - LIST, - - /** - * A range of prices. - */ - PRICE_RANGE, - - UNKNOWN_VALUE; - - public static FilterType fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "BOOLEAN": { - return BOOLEAN; - } - - case "LIST": { - return LIST; - } - - case "PRICE_RANGE": { - return PRICE_RANGE; - } - - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case BOOLEAN: { - return "BOOLEAN"; - } - - case LIST: { - return "LIST"; - } - - case PRICE_RANGE: { - return "PRICE_RANGE"; - } - - default: { - return ""; - } - } - } - } - - public interface FilterValueQueryDefinition { - void define(FilterValueQuery _queryBuilder); - } - - /** - * A selectable value within a filter. - */ - public static class FilterValueQuery extends Query { - FilterValueQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The number of results that match this filter value. - */ - public FilterValueQuery count() { - startField("count"); - - return this; - } - - /** - * A unique identifier. - */ - public FilterValueQuery id() { - startField("id"); - - return this; - } - - /** - * The visual representation when the filter's presentation is `IMAGE`. - */ - public FilterValueQuery image(MediaImageQueryDefinition queryDef) { - startField("image"); - - _queryBuilder.append('{'); - queryDef.define(new MediaImageQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * An input object that can be used to filter by this value on the parent field. - * The value is provided as a helper for building dynamic filtering UI. For - * example, if you have a list of selected `FilterValue` objects, you can combine - * their respective `input` values to use in a subsequent query. - */ - public FilterValueQuery input() { - startField("input"); - - return this; - } - - /** - * A human-friendly string for this filter value. - */ - public FilterValueQuery label() { - startField("label"); - - return this; - } - - /** - * The visual representation when the filter's presentation is `SWATCH`. - */ - public FilterValueQuery swatch(SwatchQueryDefinition queryDef) { - startField("swatch"); - - _queryBuilder.append('{'); - queryDef.define(new SwatchQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * A selectable value within a filter. - */ - public static class FilterValue extends AbstractResponse { - public FilterValue() { - } - - public FilterValue(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "count": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); - - break; - } - - case "id": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "image": { - MediaImage optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MediaImage(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "input": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "label": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "swatch": { - Swatch optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Swatch(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "FilterValue"; - } - - /** - * The number of results that match this filter value. - */ - - public Integer getCount() { - return (Integer) get("count"); - } - - public FilterValue setCount(Integer arg) { - optimisticData.put(getKey("count"), arg); - return this; - } - - /** - * A unique identifier. - */ - - public String getId() { - return (String) get("id"); - } - - public FilterValue setId(String arg) { - optimisticData.put(getKey("id"), arg); - return this; - } - - /** - * The visual representation when the filter's presentation is `IMAGE`. - */ - - public MediaImage getImage() { - return (MediaImage) get("image"); - } - - public FilterValue setImage(MediaImage arg) { - optimisticData.put(getKey("image"), arg); - return this; - } - - /** - * An input object that can be used to filter by this value on the parent field. - * The value is provided as a helper for building dynamic filtering UI. For - * example, if you have a list of selected `FilterValue` objects, you can combine - * their respective `input` values to use in a subsequent query. - */ - - public String getInput() { - return (String) get("input"); - } - - public FilterValue setInput(String arg) { - optimisticData.put(getKey("input"), arg); - return this; - } - - /** - * A human-friendly string for this filter value. - */ - - public String getLabel() { - return (String) get("label"); - } - - public FilterValue setLabel(String arg) { - optimisticData.put(getKey("label"), arg); - return this; - } - - /** - * The visual representation when the filter's presentation is `SWATCH`. - */ - - public Swatch getSwatch() { - return (Swatch) get("swatch"); - } - - public FilterValue setSwatch(Swatch arg) { - optimisticData.put(getKey("swatch"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "count": return false; - - case "id": return false; - - case "image": return true; - - case "input": return false; - - case "label": return false; - - case "swatch": return true; - - default: return false; - } - } - } - - public interface FulfillmentQueryDefinition { - void define(FulfillmentQuery _queryBuilder); - } - - /** - * Represents a single fulfillment in an order. - */ - public static class FulfillmentQuery extends Query { - FulfillmentQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - public class FulfillmentLineItemsArguments extends Arguments { - FulfillmentLineItemsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public FulfillmentLineItemsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public FulfillmentLineItemsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the last `n` elements from the list. - */ - public FulfillmentLineItemsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public FulfillmentLineItemsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Reverse the order of the underlying list. - */ - public FulfillmentLineItemsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - } - - public interface FulfillmentLineItemsArgumentsDefinition { - void define(FulfillmentLineItemsArguments args); - } - - /** - * List of the fulfillment's line items. - */ - public FulfillmentQuery fulfillmentLineItems(FulfillmentLineItemConnectionQueryDefinition queryDef) { - return fulfillmentLineItems(args -> {}, queryDef); - } - - /** - * List of the fulfillment's line items. - */ - public FulfillmentQuery fulfillmentLineItems(FulfillmentLineItemsArgumentsDefinition argsDef, FulfillmentLineItemConnectionQueryDefinition queryDef) { - startField("fulfillmentLineItems"); - - FulfillmentLineItemsArguments args = new FulfillmentLineItemsArguments(_queryBuilder); - argsDef.define(args); - FulfillmentLineItemsArguments.end(args); - - _queryBuilder.append('{'); - queryDef.define(new FulfillmentLineItemConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The name of the tracking company. - */ - public FulfillmentQuery trackingCompany() { - startField("trackingCompany"); - - return this; - } - - public class TrackingInfoArguments extends Arguments { - TrackingInfoArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Truncate the array result to this size. - */ - public TrackingInfoArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - } - - public interface TrackingInfoArgumentsDefinition { - void define(TrackingInfoArguments args); - } - - /** - * Tracking information associated with the fulfillment, - * such as the tracking number and tracking URL. - */ - public FulfillmentQuery trackingInfo(FulfillmentTrackingInfoQueryDefinition queryDef) { - return trackingInfo(args -> {}, queryDef); - } - - /** - * Tracking information associated with the fulfillment, - * such as the tracking number and tracking URL. - */ - public FulfillmentQuery trackingInfo(TrackingInfoArgumentsDefinition argsDef, FulfillmentTrackingInfoQueryDefinition queryDef) { - startField("trackingInfo"); - - TrackingInfoArguments args = new TrackingInfoArguments(_queryBuilder); - argsDef.define(args); - TrackingInfoArguments.end(args); - - _queryBuilder.append('{'); - queryDef.define(new FulfillmentTrackingInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * Represents a single fulfillment in an order. - */ - public static class Fulfillment extends AbstractResponse { - public Fulfillment() { - } - - public Fulfillment(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "fulfillmentLineItems": { - responseData.put(key, new FulfillmentLineItemConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "trackingCompany": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "trackingInfo": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new FulfillmentTrackingInfo(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "Fulfillment"; - } - - /** - * List of the fulfillment's line items. - */ - - public FulfillmentLineItemConnection getFulfillmentLineItems() { - return (FulfillmentLineItemConnection) get("fulfillmentLineItems"); - } - - public Fulfillment setFulfillmentLineItems(FulfillmentLineItemConnection arg) { - optimisticData.put(getKey("fulfillmentLineItems"), arg); - return this; - } - - /** - * The name of the tracking company. - */ - - public String getTrackingCompany() { - return (String) get("trackingCompany"); - } - - public Fulfillment setTrackingCompany(String arg) { - optimisticData.put(getKey("trackingCompany"), arg); - return this; - } - - /** - * Tracking information associated with the fulfillment, - * such as the tracking number and tracking URL. - */ - - public List getTrackingInfo() { - return (List) get("trackingInfo"); - } - - public Fulfillment setTrackingInfo(List arg) { - optimisticData.put(getKey("trackingInfo"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "fulfillmentLineItems": return true; - - case "trackingCompany": return false; - - case "trackingInfo": return true; - - default: return false; - } - } - } - - public interface FulfillmentLineItemQueryDefinition { - void define(FulfillmentLineItemQuery _queryBuilder); - } - - /** - * Represents a single line item in a fulfillment. There is at most one fulfillment line item for each - * order line item. - */ - public static class FulfillmentLineItemQuery extends Query { - FulfillmentLineItemQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The associated order's line item. - */ - public FulfillmentLineItemQuery lineItem(OrderLineItemQueryDefinition queryDef) { - startField("lineItem"); - - _queryBuilder.append('{'); - queryDef.define(new OrderLineItemQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The amount fulfilled in this fulfillment. - */ - public FulfillmentLineItemQuery quantity() { - startField("quantity"); - - return this; - } - } - - /** - * Represents a single line item in a fulfillment. There is at most one fulfillment line item for each - * order line item. - */ - public static class FulfillmentLineItem extends AbstractResponse { - public FulfillmentLineItem() { - } - - public FulfillmentLineItem(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "lineItem": { - responseData.put(key, new OrderLineItem(jsonAsObject(field.getValue(), key))); - - break; - } - - case "quantity": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "FulfillmentLineItem"; - } - - /** - * The associated order's line item. - */ - - public OrderLineItem getLineItem() { - return (OrderLineItem) get("lineItem"); - } - - public FulfillmentLineItem setLineItem(OrderLineItem arg) { - optimisticData.put(getKey("lineItem"), arg); - return this; - } - - /** - * The amount fulfilled in this fulfillment. - */ - - public Integer getQuantity() { - return (Integer) get("quantity"); - } - - public FulfillmentLineItem setQuantity(Integer arg) { - optimisticData.put(getKey("quantity"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "lineItem": return true; - - case "quantity": return false; - - default: return false; - } - } - } - - public interface FulfillmentLineItemConnectionQueryDefinition { - void define(FulfillmentLineItemConnectionQuery _queryBuilder); - } - - /** - * An auto-generated type for paginating through multiple FulfillmentLineItems. - */ - public static class FulfillmentLineItemConnectionQuery extends Query { - FulfillmentLineItemConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * A list of edges. - */ - public FulfillmentLineItemConnectionQuery edges(FulfillmentLineItemEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new FulfillmentLineItemEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * A list of the nodes contained in FulfillmentLineItemEdge. - */ - public FulfillmentLineItemConnectionQuery nodes(FulfillmentLineItemQueryDefinition queryDef) { - startField("nodes"); - - _queryBuilder.append('{'); - queryDef.define(new FulfillmentLineItemQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * Information to aid in pagination. - */ - public FulfillmentLineItemConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * An auto-generated type for paginating through multiple FulfillmentLineItems. - */ - public static class FulfillmentLineItemConnection extends AbstractResponse { - public FulfillmentLineItemConnection() { - } - - public FulfillmentLineItemConnection(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new FulfillmentLineItemEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new FulfillmentLineItem(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "FulfillmentLineItemConnection"; - } - - /** - * A list of edges. - */ - - public List getEdges() { - return (List) get("edges"); - } - - public FulfillmentLineItemConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; - } - - /** - * A list of the nodes contained in FulfillmentLineItemEdge. - */ - - public List getNodes() { - return (List) get("nodes"); - } - - public FulfillmentLineItemConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; - } - - /** - * Information to aid in pagination. - */ - - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } - - public FulfillmentLineItemConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return true; - - case "pageInfo": return true; - - default: return false; - } - } - } - - public interface FulfillmentLineItemEdgeQueryDefinition { - void define(FulfillmentLineItemEdgeQuery _queryBuilder); - } - - /** - * An auto-generated type which holds one FulfillmentLineItem and a cursor during pagination. - */ - public static class FulfillmentLineItemEdgeQuery extends Query { - FulfillmentLineItemEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * A cursor for use in pagination. - */ - public FulfillmentLineItemEdgeQuery cursor() { - startField("cursor"); - - return this; - } - - /** - * The item at the end of FulfillmentLineItemEdge. - */ - public FulfillmentLineItemEdgeQuery node(FulfillmentLineItemQueryDefinition queryDef) { - startField("node"); - - _queryBuilder.append('{'); - queryDef.define(new FulfillmentLineItemQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * An auto-generated type which holds one FulfillmentLineItem and a cursor during pagination. - */ - public static class FulfillmentLineItemEdge extends AbstractResponse { - public FulfillmentLineItemEdge() { - } - - public FulfillmentLineItemEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "node": { - responseData.put(key, new FulfillmentLineItem(jsonAsObject(field.getValue(), key))); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "FulfillmentLineItemEdge"; - } - - /** - * A cursor for use in pagination. - */ - - public String getCursor() { - return (String) get("cursor"); - } - - public FulfillmentLineItemEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; - } - - /** - * The item at the end of FulfillmentLineItemEdge. - */ - - public FulfillmentLineItem getNode() { - return (FulfillmentLineItem) get("node"); - } - - public FulfillmentLineItemEdge setNode(FulfillmentLineItem arg) { - optimisticData.put(getKey("node"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; - - case "node": return true; - - default: return false; - } - } - } - - public interface FulfillmentTrackingInfoQueryDefinition { - void define(FulfillmentTrackingInfoQuery _queryBuilder); - } - - /** - * Tracking information associated with the fulfillment. - */ - public static class FulfillmentTrackingInfoQuery extends Query { - FulfillmentTrackingInfoQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The tracking number of the fulfillment. - */ - public FulfillmentTrackingInfoQuery number() { - startField("number"); - - return this; - } - - /** - * The URL to track the fulfillment. - */ - public FulfillmentTrackingInfoQuery url() { - startField("url"); - - return this; - } - } - - /** - * Tracking information associated with the fulfillment. - */ - public static class FulfillmentTrackingInfo extends AbstractResponse { - public FulfillmentTrackingInfo() { - } - - public FulfillmentTrackingInfo(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "number": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "url": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "FulfillmentTrackingInfo"; - } - - /** - * The tracking number of the fulfillment. - */ - - public String getNumber() { - return (String) get("number"); - } - - public FulfillmentTrackingInfo setNumber(String arg) { - optimisticData.put(getKey("number"), arg); - return this; - } - - /** - * The URL to track the fulfillment. - */ - - public String getUrl() { - return (String) get("url"); - } - - public FulfillmentTrackingInfo setUrl(String arg) { - optimisticData.put(getKey("url"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "number": return false; - - case "url": return false; - - default: return false; - } - } - } - - public interface GenericFileQueryDefinition { - void define(GenericFileQuery _queryBuilder); - } - - /** - * The generic file resource lets you manage files in a merchant’s store. Generic files include any - * file that doesn’t fit into a designated type such as image or video. Example: PDF, JSON. - */ - public static class GenericFileQuery extends Query { - GenericFileQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - - startField("id"); - } - - /** - * A word or phrase to indicate the contents of a file. - */ - public GenericFileQuery alt() { - startField("alt"); - - return this; - } - - /** - * The MIME type of the file. - */ - public GenericFileQuery mimeType() { - startField("mimeType"); - - return this; - } - - /** - * The size of the original file in bytes. - */ - public GenericFileQuery originalFileSize() { - startField("originalFileSize"); - - return this; - } - - /** - * The preview image for the file. - */ - public GenericFileQuery previewImage(ImageQueryDefinition queryDef) { - startField("previewImage"); - - _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The URL of the file. - */ - public GenericFileQuery url() { - startField("url"); - - return this; - } - } - - /** - * The generic file resource lets you manage files in a merchant’s store. Generic files include any - * file that doesn’t fit into a designated type such as image or video. Example: PDF, JSON. - */ - public static class GenericFile extends AbstractResponse implements MetafieldReference, Node { - public GenericFile() { - } - - public GenericFile(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "alt": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - - break; - } - - case "mimeType": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "originalFileSize": { - Integer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "previewImage": { - Image optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "url": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public GenericFile(ID id) { - this(); - optimisticData.put("id", id); - } - - public String getGraphQlTypeName() { - return "GenericFile"; - } - - /** - * A word or phrase to indicate the contents of a file. - */ - - public String getAlt() { - return (String) get("alt"); - } - - public GenericFile setAlt(String arg) { - optimisticData.put(getKey("alt"), arg); - return this; - } - - /** - * A globally-unique ID. - */ - - public ID getId() { - return (ID) get("id"); - } - - /** - * The MIME type of the file. - */ - - public String getMimeType() { - return (String) get("mimeType"); - } - - public GenericFile setMimeType(String arg) { - optimisticData.put(getKey("mimeType"), arg); - return this; - } - - /** - * The size of the original file in bytes. - */ - - public Integer getOriginalFileSize() { - return (Integer) get("originalFileSize"); - } - - public GenericFile setOriginalFileSize(Integer arg) { - optimisticData.put(getKey("originalFileSize"), arg); - return this; - } - - /** - * The preview image for the file. - */ - - public Image getPreviewImage() { - return (Image) get("previewImage"); - } - - public GenericFile setPreviewImage(Image arg) { - optimisticData.put(getKey("previewImage"), arg); - return this; - } - - /** - * The URL of the file. - */ - - public String getUrl() { - return (String) get("url"); - } - - public GenericFile setUrl(String arg) { - optimisticData.put(getKey("url"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "alt": return false; - - case "id": return false; - - case "mimeType": return false; - - case "originalFileSize": return false; - - case "previewImage": return true; - - case "url": return false; - - default: return false; - } - } - } - - public static class GeoCoordinateInput implements Serializable { - private double latitude; - - private double longitude; - - public GeoCoordinateInput(double latitude, double longitude) { - this.latitude = latitude; - - this.longitude = longitude; - } - - public double getLatitude() { - return latitude; - } - - public GeoCoordinateInput setLatitude(double latitude) { - this.latitude = latitude; - return this; - } - - public double getLongitude() { - return longitude; - } - - public GeoCoordinateInput setLongitude(double longitude) { - this.longitude = longitude; - return this; - } - - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("latitude:"); - _queryBuilder.append(latitude); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("longitude:"); - _queryBuilder.append(longitude); - - _queryBuilder.append('}'); - } - } - - public interface HasMetafieldsQueryDefinition { - void define(HasMetafieldsQuery _queryBuilder); - } - - /** - * Represents information about the metafields associated to the specified resource. - */ - public static class HasMetafieldsQuery extends Query { - HasMetafieldsQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - - startField("__typename"); - } - - public class MetafieldArguments extends Arguments { - MetafieldArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } - - /** - * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. - */ - public MetafieldArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - } - - public interface MetafieldArgumentsDefinition { - void define(MetafieldArguments args); - } - - /** - * Returns a metafield found by namespace and key. - */ - public HasMetafieldsQuery metafield(String key, MetafieldQueryDefinition queryDef) { - return metafield(key, args -> {}, queryDef); - } - - /** - * Returns a metafield found by namespace and key. - */ - public HasMetafieldsQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { - startField("metafield"); - - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); - - argsDef.define(new MetafieldArguments(_queryBuilder)); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ - public HasMetafieldsQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); - - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - public HasMetafieldsQuery onArticle(ArticleQueryDefinition queryDef) { - startInlineFragment("Article"); - queryDef.define(new ArticleQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onBlog(BlogQueryDefinition queryDef) { - startInlineFragment("Blog"); - queryDef.define(new BlogQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onCart(CartQueryDefinition queryDef) { - startInlineFragment("Cart"); - queryDef.define(new CartQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onCollection(CollectionQueryDefinition queryDef) { - startInlineFragment("Collection"); - queryDef.define(new CollectionQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onCompany(CompanyQueryDefinition queryDef) { - startInlineFragment("Company"); - queryDef.define(new CompanyQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onCompanyLocation(CompanyLocationQueryDefinition queryDef) { - startInlineFragment("CompanyLocation"); - queryDef.define(new CompanyLocationQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onCustomer(CustomerQueryDefinition queryDef) { - startInlineFragment("Customer"); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onLocation(LocationQueryDefinition queryDef) { - startInlineFragment("Location"); - queryDef.define(new LocationQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onMarket(MarketQueryDefinition queryDef) { - startInlineFragment("Market"); - queryDef.define(new MarketQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onOrder(OrderQueryDefinition queryDef) { - startInlineFragment("Order"); - queryDef.define(new OrderQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onPage(PageQueryDefinition queryDef) { - startInlineFragment("Page"); - queryDef.define(new PageQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onProduct(ProductQueryDefinition queryDef) { - startInlineFragment("Product"); - queryDef.define(new ProductQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onProductVariant(ProductVariantQueryDefinition queryDef) { - startInlineFragment("ProductVariant"); - queryDef.define(new ProductVariantQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onShop(ShopQueryDefinition queryDef) { - startInlineFragment("Shop"); - queryDef.define(new ShopQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - } - - public interface HasMetafields { - String getGraphQlTypeName(); - - Metafield getMetafield(); - - List getMetafields(); - } - - /** - * Represents information about the metafields associated to the specified resource. - */ - public static class UnknownHasMetafields extends AbstractResponse implements HasMetafields { - public UnknownHasMetafields() { - } - - public UnknownHasMetafields(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "metafield": { - Metafield optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "metafields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } - - list1.add(optional2); - } - - responseData.put(key, list1); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public static HasMetafields create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "Article": { - return new Article(fields); - } - - case "Blog": { - return new Blog(fields); - } - - case "Cart": { - return new Cart(fields); - } - - case "Collection": { - return new Collection(fields); - } - - case "Company": { - return new Company(fields); - } - - case "CompanyLocation": { - return new CompanyLocation(fields); - } - - case "Customer": { - return new Customer(fields); - } - - case "Location": { - return new Location(fields); - } - - case "Market": { - return new Market(fields); - } - - case "Order": { - return new Order(fields); - } - - case "Page": { - return new Page(fields); - } - - case "Product": { - return new Product(fields); - } - - case "ProductVariant": { - return new ProductVariant(fields); - } - - case "Shop": { - return new Shop(fields); - } - - default: { - return new UnknownHasMetafields(fields); - } - } - } - - public String getGraphQlTypeName() { - return (String) get("__typename"); - } - - /** - * Returns a metafield found by namespace and key. - */ - - public Metafield getMetafield() { - return (Metafield) get("metafield"); - } - - public UnknownHasMetafields setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); - return this; - } - - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ - - public List getMetafields() { - return (List) get("metafields"); - } - - public UnknownHasMetafields setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "metafield": return true; - - case "metafields": return true; - - default: return false; - } - } - } - - public static class HasMetafieldsIdentifier implements Serializable { - private String key; - - private Input namespace = Input.undefined(); - - public HasMetafieldsIdentifier(String key) { - this.key = key; - } - - public String getKey() { - return key; - } - - public HasMetafieldsIdentifier setKey(String key) { - this.key = key; - return this; - } - - public String getNamespace() { - return namespace.getValue(); - } - - public Input getNamespaceInput() { - return namespace; - } - - public HasMetafieldsIdentifier setNamespace(String namespace) { - this.namespace = Input.optional(namespace); - return this; - } - - public HasMetafieldsIdentifier setNamespaceInput(Input namespace) { - if (namespace == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.namespace = namespace; - return this; - } - - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); - - if (this.namespace.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("namespace:"); - if (namespace.getValue() != null) { - Query.appendQuotedString(_queryBuilder, namespace.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - _queryBuilder.append('}'); - } - } - - public interface ImageQueryDefinition { - void define(ImageQuery _queryBuilder); - } - - /** - * Represents an image resource. - */ - public static class ImageQuery extends Query { - ImageQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * A word or phrase to share the nature or contents of an image. - */ - public ImageQuery altText() { - startField("altText"); - - return this; - } - - /** - * The original height of the image in pixels. Returns `null` if the image isn't hosted by Shopify. - */ - public ImageQuery height() { - startField("height"); - - return this; - } - - /** - * A unique ID for the image. - */ - public ImageQuery id() { - startField("id"); - - return this; - } - - /** - * The location of the original image as a URL. - * If there are any existing transformations in the original source URL, they will remain and not be - * stripped. - * - * @deprecated Use `url` instead. - */ - @Deprecated - public ImageQuery originalSrc() { - startField("originalSrc"); - - return this; - } - - /** - * The location of the image as a URL. - * - * @deprecated Use `url` instead. - */ - @Deprecated - public ImageQuery src() { - startField("src"); - - return this; - } - - public class TransformedSrcArguments extends Arguments { - TransformedSrcArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Image width in pixels between 1 and 5760. - */ - public TransformedSrcArguments maxWidth(Integer value) { - if (value != null) { - startArgument("maxWidth"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Image height in pixels between 1 and 5760. - */ - public TransformedSrcArguments maxHeight(Integer value) { - if (value != null) { - startArgument("maxHeight"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Crops the image according to the specified region. - */ - public TransformedSrcArguments crop(CropRegion value) { - if (value != null) { - startArgument("crop"); - _queryBuilder.append(value.toString()); - } - return this; - } - - /** - * Image size multiplier for high-resolution retina displays. Must be between 1 and 3. - */ - public TransformedSrcArguments scale(Integer value) { - if (value != null) { - startArgument("scale"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Best effort conversion of image into content type (SVG -> PNG, Anything -> JPG, Anything -> WEBP are - * supported). - */ - public TransformedSrcArguments preferredContentType(ImageContentType value) { - if (value != null) { - startArgument("preferredContentType"); - _queryBuilder.append(value.toString()); - } - return this; - } - } - - public interface TransformedSrcArgumentsDefinition { - void define(TransformedSrcArguments args); - } - - /** - * The location of the transformed image as a URL. - * All transformation arguments are considered "best-effort". If they can be applied to an image, they - * will be. - * Otherwise any transformations which an image type doesn't support will be ignored. - * - * @deprecated Use `url(transform:)` instead - */ - public ImageQuery transformedSrc() { - return transformedSrc(args -> {}); - } - - /** - * The location of the transformed image as a URL. - * All transformation arguments are considered "best-effort". If they can be applied to an image, they - * will be. - * Otherwise any transformations which an image type doesn't support will be ignored. - * - * @deprecated Use `url(transform:)` instead - */ - @Deprecated - public ImageQuery transformedSrc(TransformedSrcArgumentsDefinition argsDef) { - startField("transformedSrc"); - - TransformedSrcArguments args = new TransformedSrcArguments(_queryBuilder); - argsDef.define(args); - TransformedSrcArguments.end(args); - - return this; - } - - public class UrlArguments extends Arguments { - UrlArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * A set of options to transform the original image. - */ - public UrlArguments transform(ImageTransformInput value) { - if (value != null) { - startArgument("transform"); - value.appendTo(_queryBuilder); - } - return this; - } - } - - public interface UrlArgumentsDefinition { - void define(UrlArguments args); - } - - /** - * The location of the image as a URL. - * If no transform options are specified, then the original image will be preserved including any - * pre-applied transforms. - * All transformation options are considered "best-effort". Any transformation that the original image - * type doesn't support will be ignored. - * If you need multiple variations of the same image, then you can use [GraphQL - * aliases](https://graphql.org/learn/queries/#aliases). - */ - public ImageQuery url() { - return url(args -> {}); - } - - /** - * The location of the image as a URL. - * If no transform options are specified, then the original image will be preserved including any - * pre-applied transforms. - * All transformation options are considered "best-effort". Any transformation that the original image - * type doesn't support will be ignored. - * If you need multiple variations of the same image, then you can use [GraphQL - * aliases](https://graphql.org/learn/queries/#aliases). - */ - public ImageQuery url(UrlArgumentsDefinition argsDef) { - startField("url"); - - UrlArguments args = new UrlArguments(_queryBuilder); - argsDef.define(args); - UrlArguments.end(args); - - return this; - } - - /** - * The original width of the image in pixels. Returns `null` if the image isn't hosted by Shopify. - */ - public ImageQuery width() { - startField("width"); - - return this; - } - } - - /** - * Represents an image resource. - */ - public static class Image extends AbstractResponse { - public Image() { - } - - public Image(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "altText": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "height": { - Integer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "id": { - ID optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ID(jsonAsString(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "originalSrc": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "src": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "transformedSrc": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "url": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "width": { - Integer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "Image"; - } - - /** - * A word or phrase to share the nature or contents of an image. - */ - - public String getAltText() { - return (String) get("altText"); - } - - public Image setAltText(String arg) { - optimisticData.put(getKey("altText"), arg); - return this; - } - - /** - * The original height of the image in pixels. Returns `null` if the image isn't hosted by Shopify. - */ - - public Integer getHeight() { - return (Integer) get("height"); - } - - public Image setHeight(Integer arg) { - optimisticData.put(getKey("height"), arg); - return this; - } - - /** - * A unique ID for the image. - */ - - public ID getId() { - return (ID) get("id"); - } - - public Image setId(ID arg) { - optimisticData.put(getKey("id"), arg); - return this; - } - - /** - * The location of the original image as a URL. - * If there are any existing transformations in the original source URL, they will remain and not be - * stripped. - * - * @deprecated Use `url` instead. - */ - - public String getOriginalSrc() { - return (String) get("originalSrc"); - } - - public Image setOriginalSrc(String arg) { - optimisticData.put(getKey("originalSrc"), arg); - return this; - } - - /** - * The location of the image as a URL. - * - * @deprecated Use `url` instead. - */ - - public String getSrc() { - return (String) get("src"); - } - - public Image setSrc(String arg) { - optimisticData.put(getKey("src"), arg); - return this; - } - - /** - * The location of the transformed image as a URL. - * All transformation arguments are considered "best-effort". If they can be applied to an image, they - * will be. - * Otherwise any transformations which an image type doesn't support will be ignored. - * - * @deprecated Use `url(transform:)` instead - */ - - public String getTransformedSrc() { - return (String) get("transformedSrc"); - } - - public Image setTransformedSrc(String arg) { - optimisticData.put(getKey("transformedSrc"), arg); - return this; - } - - /** - * The location of the image as a URL. - * If no transform options are specified, then the original image will be preserved including any - * pre-applied transforms. - * All transformation options are considered "best-effort". Any transformation that the original image - * type doesn't support will be ignored. - * If you need multiple variations of the same image, then you can use [GraphQL - * aliases](https://graphql.org/learn/queries/#aliases). - */ - - public String getUrl() { - return (String) get("url"); - } - - public Image setUrl(String arg) { - optimisticData.put(getKey("url"), arg); - return this; - } - - /** - * The original width of the image in pixels. Returns `null` if the image isn't hosted by Shopify. - */ - - public Integer getWidth() { - return (Integer) get("width"); - } - - public Image setWidth(Integer arg) { - optimisticData.put(getKey("width"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "altText": return false; - - case "height": return false; - - case "id": return false; - - case "originalSrc": return false; - - case "src": return false; - - case "transformedSrc": return false; - - case "url": return false; - - case "width": return false; - - default: return false; - } - } - } - - public interface ImageConnectionQueryDefinition { - void define(ImageConnectionQuery _queryBuilder); - } - - /** - * An auto-generated type for paginating through multiple Images. - */ - public static class ImageConnectionQuery extends Query { - ImageConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * A list of edges. - */ - public ImageConnectionQuery edges(ImageEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new ImageEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * A list of the nodes contained in ImageEdge. - */ - public ImageConnectionQuery nodes(ImageQueryDefinition queryDef) { - startField("nodes"); - - _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * Information to aid in pagination. - */ - public ImageConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * An auto-generated type for paginating through multiple Images. - */ - public static class ImageConnection extends AbstractResponse { - public ImageConnection() { - } - - public ImageConnection(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ImageEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Image(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "ImageConnection"; - } - - /** - * A list of edges. - */ - - public List getEdges() { - return (List) get("edges"); - } - - public ImageConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; - } - - /** - * A list of the nodes contained in ImageEdge. - */ - - public List getNodes() { - return (List) get("nodes"); - } - - public ImageConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; - } - - /** - * Information to aid in pagination. - */ - - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } - - public ImageConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return true; - - case "pageInfo": return true; - - default: return false; - } - } - } - - /** - * List of supported image content types. - */ - public enum ImageContentType { - /** - * A JPG image. - */ - JPG, - - /** - * A PNG image. - */ - PNG, - - /** - * A WEBP image. - */ - WEBP, - - UNKNOWN_VALUE; - - public static ImageContentType fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "JPG": { - return JPG; - } - - case "PNG": { - return PNG; - } - - case "WEBP": { - return WEBP; - } - - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case JPG: { - return "JPG"; - } - - case PNG: { - return "PNG"; - } - - case WEBP: { - return "WEBP"; - } - - default: { - return ""; - } - } - } - } - - public interface ImageEdgeQueryDefinition { - void define(ImageEdgeQuery _queryBuilder); - } - - /** - * An auto-generated type which holds one Image and a cursor during pagination. - */ - public static class ImageEdgeQuery extends Query { - ImageEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * A cursor for use in pagination. - */ - public ImageEdgeQuery cursor() { - startField("cursor"); - - return this; - } - - /** - * The item at the end of ImageEdge. - */ - public ImageEdgeQuery node(ImageQueryDefinition queryDef) { - startField("node"); - - _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * An auto-generated type which holds one Image and a cursor during pagination. - */ - public static class ImageEdge extends AbstractResponse { - public ImageEdge() { - } - - public ImageEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "node": { - responseData.put(key, new Image(jsonAsObject(field.getValue(), key))); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "ImageEdge"; - } - - /** - * A cursor for use in pagination. - */ - - public String getCursor() { - return (String) get("cursor"); - } - - public ImageEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; - } - - /** - * The item at the end of ImageEdge. - */ - - public Image getNode() { - return (Image) get("node"); - } - - public ImageEdge setNode(Image arg) { - optimisticData.put(getKey("node"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; - - case "node": return true; - - default: return false; - } - } - } - - public static class ImageTransformInput implements Serializable { - private Input crop = Input.undefined(); - - private Input maxWidth = Input.undefined(); - - private Input maxHeight = Input.undefined(); - - private Input scale = Input.undefined(); - - private Input preferredContentType = Input.undefined(); - - public CropRegion getCrop() { - return crop.getValue(); - } - - public Input getCropInput() { - return crop; - } - - public ImageTransformInput setCrop(CropRegion crop) { - this.crop = Input.optional(crop); - return this; - } - - public ImageTransformInput setCropInput(Input crop) { - if (crop == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.crop = crop; - return this; - } - - public Integer getMaxWidth() { - return maxWidth.getValue(); - } - - public Input getMaxWidthInput() { - return maxWidth; - } - - public ImageTransformInput setMaxWidth(Integer maxWidth) { - this.maxWidth = Input.optional(maxWidth); - return this; - } - - public ImageTransformInput setMaxWidthInput(Input maxWidth) { - if (maxWidth == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.maxWidth = maxWidth; - return this; - } - - public Integer getMaxHeight() { - return maxHeight.getValue(); - } - - public Input getMaxHeightInput() { - return maxHeight; - } - - public ImageTransformInput setMaxHeight(Integer maxHeight) { - this.maxHeight = Input.optional(maxHeight); - return this; - } - - public ImageTransformInput setMaxHeightInput(Input maxHeight) { - if (maxHeight == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.maxHeight = maxHeight; - return this; - } - - public Integer getScale() { - return scale.getValue(); - } - - public Input getScaleInput() { - return scale; - } - - public ImageTransformInput setScale(Integer scale) { - this.scale = Input.optional(scale); - return this; - } - - public ImageTransformInput setScaleInput(Input scale) { - if (scale == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.scale = scale; - return this; - } - - public ImageContentType getPreferredContentType() { - return preferredContentType.getValue(); - } - - public Input getPreferredContentTypeInput() { - return preferredContentType; - } - - public ImageTransformInput setPreferredContentType(ImageContentType preferredContentType) { - this.preferredContentType = Input.optional(preferredContentType); - return this; - } - - public ImageTransformInput setPreferredContentTypeInput(Input preferredContentType) { - if (preferredContentType == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.preferredContentType = preferredContentType; - return this; - } - - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - if (this.crop.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("crop:"); - if (crop.getValue() != null) { - _queryBuilder.append(crop.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.maxWidth.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("maxWidth:"); - if (maxWidth.getValue() != null) { - _queryBuilder.append(maxWidth.getValue()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.maxHeight.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("maxHeight:"); - if (maxHeight.getValue() != null) { - _queryBuilder.append(maxHeight.getValue()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.scale.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("scale:"); - if (scale.getValue() != null) { - _queryBuilder.append(scale.getValue()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.preferredContentType.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("preferredContentType:"); - if (preferredContentType.getValue() != null) { - _queryBuilder.append(preferredContentType.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - _queryBuilder.append('}'); - } - } - - public interface LanguageQueryDefinition { - void define(LanguageQuery _queryBuilder); - } - - /** - * A language. - */ - public static class LanguageQuery extends Query { - LanguageQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The name of the language in the language itself. If the language uses capitalization, it is - * capitalized for a mid-sentence position. - */ - public LanguageQuery endonymName() { - startField("endonymName"); - - return this; - } - - /** - * The ISO code. - */ - public LanguageQuery isoCode() { - startField("isoCode"); - - return this; - } - - /** - * The name of the language in the current language. - */ - public LanguageQuery name() { - startField("name"); - - return this; - } - } - - /** - * A language. - */ - public static class Language extends AbstractResponse { - public Language() { - } - - public Language(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "endonymName": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "isoCode": { - responseData.put(key, LanguageCode.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "Language"; - } - - /** - * The name of the language in the language itself. If the language uses capitalization, it is - * capitalized for a mid-sentence position. - */ - - public String getEndonymName() { - return (String) get("endonymName"); - } - - public Language setEndonymName(String arg) { - optimisticData.put(getKey("endonymName"), arg); - return this; - } - - /** - * The ISO code. - */ - - public LanguageCode getIsoCode() { - return (LanguageCode) get("isoCode"); - } - - public Language setIsoCode(LanguageCode arg) { - optimisticData.put(getKey("isoCode"), arg); - return this; - } - - /** - * The name of the language in the current language. - */ - - public String getName() { - return (String) get("name"); - } - - public Language setName(String arg) { - optimisticData.put(getKey("name"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "endonymName": return false; - - case "isoCode": return false; - - case "name": return false; - - default: return false; - } - } - } - - /** - * ISO 639-1 language codes supported by Shopify. - */ - public enum LanguageCode { - /** - * Afrikaans. - */ - AF, - - /** - * Akan. - */ - AK, - - /** - * Amharic. - */ - AM, - - /** - * Arabic. - */ - AR, - - /** - * Assamese. - */ - AS, - - /** - * Azerbaijani. - */ - AZ, - - /** - * Belarusian. - */ - BE, - - /** - * Bulgarian. - */ - BG, - - /** - * Bambara. - */ - BM, - - /** - * Bangla. - */ - BN, - - /** - * Tibetan. - */ - BO, - - /** - * Breton. - */ - BR, - - /** - * Bosnian. - */ - BS, - - /** - * Catalan. - */ - CA, - - /** - * Chechen. - */ - CE, - - /** - * Central Kurdish. - */ - CKB, - - /** - * Czech. - */ - CS, - - /** - * Church Slavic. - */ - CU, - - /** - * Welsh. - */ - CY, - - /** - * Danish. - */ - DA, - - /** - * German. - */ - DE, - - /** - * Dzongkha. - */ - DZ, - - /** - * Ewe. - */ - EE, - - /** - * Greek. - */ - EL, - - /** - * English. - */ - EN, - - /** - * Esperanto. - */ - EO, - - /** - * Spanish. - */ - ES, - - /** - * Estonian. - */ - ET, - - /** - * Basque. - */ - EU, - - /** - * Persian. - */ - FA, - - /** - * Fulah. - */ - FF, - - /** - * Finnish. - */ - FI, - - /** - * Filipino. - */ - FIL, - - /** - * Faroese. - */ - FO, - - /** - * French. - */ - FR, - - /** - * Western Frisian. - */ - FY, - - /** - * Irish. - */ - GA, - - /** - * Scottish Gaelic. - */ - GD, - - /** - * Galician. - */ - GL, - - /** - * Gujarati. - */ - GU, - - /** - * Manx. - */ - GV, - - /** - * Hausa. - */ - HA, - - /** - * Hebrew. - */ - HE, - - /** - * Hindi. - */ - HI, - - /** - * Croatian. - */ - HR, - - /** - * Hungarian. - */ - HU, - - /** - * Armenian. - */ - HY, - - /** - * Interlingua. - */ - IA, - - /** - * Indonesian. - */ - ID, - - /** - * Igbo. - */ - IG, - - /** - * Sichuan Yi. - */ - II, - - /** - * Icelandic. - */ - IS, - - /** - * Italian. - */ - IT, - - /** - * Japanese. - */ - JA, - - /** - * Javanese. - */ - JV, - - /** - * Georgian. - */ - KA, - - /** - * Kikuyu. - */ - KI, - - /** - * Kazakh. - */ - KK, - - /** - * Kalaallisut. - */ - KL, - - /** - * Khmer. - */ - KM, - - /** - * Kannada. - */ - KN, - - /** - * Korean. - */ - KO, - - /** - * Kashmiri. - */ - KS, - - /** - * Kurdish. - */ - KU, - - /** - * Cornish. - */ - KW, - - /** - * Kyrgyz. - */ - KY, - - /** - * Latin. - */ - LA, - - /** - * Luxembourgish. - */ - LB, - - /** - * Ganda. - */ - LG, - - /** - * Lingala. - */ - LN, - - /** - * Lao. - */ - LO, - - /** - * Lithuanian. - */ - LT, - - /** - * Luba-Katanga. - */ - LU, - - /** - * Latvian. - */ - LV, - - /** - * Malagasy. - */ - MG, - - /** - * Māori. - */ - MI, - - /** - * Macedonian. - */ - MK, - - /** - * Malayalam. - */ - ML, - - /** - * Mongolian. - */ - MN, - - /** - * Moldavian. - */ - MO, - - /** - * Marathi. - */ - MR, - - /** - * Malay. - */ - MS, - - /** - * Maltese. - */ - MT, - - /** - * Burmese. - */ - MY, - - /** - * Norwegian (Bokmål). - */ - NB, - - /** - * North Ndebele. - */ - ND, - - /** - * Nepali. - */ - NE, - - /** - * Dutch. - */ - NL, - - /** - * Norwegian Nynorsk. - */ - NN, - - /** - * Norwegian. - */ - NO, - - /** - * Oromo. - */ - OM, - - /** - * Odia. - */ - OR, - - /** - * Ossetic. - */ - OS, - - /** - * Punjabi. - */ - PA, - - /** - * Polish. - */ - PL, - - /** - * Pashto. - */ - PS, - - /** - * Portuguese. - */ - PT, - - /** - * Portuguese (Brazil). - */ - PT_BR, - - /** - * Portuguese (Portugal). - */ - PT_PT, - - /** - * Quechua. - */ - QU, - - /** - * Romansh. - */ - RM, - - /** - * Rundi. - */ - RN, - - /** - * Romanian. - */ - RO, - - /** - * Russian. - */ - RU, - - /** - * Kinyarwanda. - */ - RW, - - /** - * Sanskrit. - */ - SA, - - /** - * Sardinian. - */ - SC, - - /** - * Sindhi. - */ - SD, - - /** - * Northern Sami. - */ - SE, - - /** - * Sango. - */ - SG, - - /** - * Serbo-Croatian. - */ - SH, - - /** - * Sinhala. - */ - SI, - - /** - * Slovak. - */ - SK, - - /** - * Slovenian. - */ - SL, - - /** - * Shona. - */ - SN, - - /** - * Somali. - */ - SO, - - /** - * Albanian. - */ - SQ, - - /** - * Serbian. - */ - SR, - - /** - * Sundanese. - */ - SU, - - /** - * Swedish. - */ - SV, - /** - * Swahili. - */ - SW, + case NL: { + return "NL"; + } - /** - * Tamil. - */ - TA, + case NN: { + return "NN"; + } - /** - * Telugu. - */ - TE, + case NO: { + return "NO"; + } - /** - * Tajik. - */ - TG, + case OM: { + return "OM"; + } - /** - * Thai. - */ - TH, + case OR: { + return "OR"; + } - /** - * Tigrinya. - */ - TI, + case OS: { + return "OS"; + } - /** - * Turkmen. - */ - TK, + case PA: { + return "PA"; + } - /** - * Tongan. - */ - TO, + case PL: { + return "PL"; + } - /** - * Turkish. - */ - TR, + case PS: { + return "PS"; + } - /** - * Tatar. - */ - TT, + case PT: { + return "PT"; + } - /** - * Uyghur. - */ - UG, + case PT_BR: { + return "PT_BR"; + } - /** - * Ukrainian. - */ - UK, + case PT_PT: { + return "PT_PT"; + } - /** - * Urdu. - */ - UR, + case QU: { + return "QU"; + } - /** - * Uzbek. - */ - UZ, + case RM: { + return "RM"; + } - /** - * Vietnamese. - */ - VI, + case RN: { + return "RN"; + } - /** - * Volapük. - */ - VO, + case RO: { + return "RO"; + } - /** - * Wolof. - */ - WO, + case RU: { + return "RU"; + } - /** - * Xhosa. - */ - XH, + case RW: { + return "RW"; + } - /** - * Yiddish. - */ - YI, + case SA: { + return "SA"; + } - /** - * Yoruba. - */ - YO, + case SC: { + return "SC"; + } - /** - * Chinese. - */ - ZH, + case SD: { + return "SD"; + } - /** - * Chinese (Simplified). - */ - ZH_CN, + case SE: { + return "SE"; + } - /** - * Chinese (Traditional). - */ - ZH_TW, + case SG: { + return "SG"; + } - /** - * Zulu. - */ - ZU, + case SH: { + return "SH"; + } - UNKNOWN_VALUE; + case SI: { + return "SI"; + } - public static LanguageCode fromGraphQl(String value) { - if (value == null) { - return null; - } + case SK: { + return "SK"; + } - switch (value) { - case "AF": { - return AF; + case SL: { + return "SL"; } - case "AK": { - return AK; + case SN: { + return "SN"; } - case "AM": { - return AM; + case SO: { + return "SO"; } - case "AR": { - return AR; + case SQ: { + return "SQ"; } - case "AS": { - return AS; + case SR: { + return "SR"; } - case "AZ": { - return AZ; + case SU: { + return "SU"; } - case "BE": { - return BE; + case SV: { + return "SV"; } - case "BG": { - return BG; + case SW: { + return "SW"; } - case "BM": { - return BM; + case TA: { + return "TA"; } - case "BN": { - return BN; + case TE: { + return "TE"; } - case "BO": { - return BO; + case TG: { + return "TG"; } - case "BR": { - return BR; + case TH: { + return "TH"; } - case "BS": { - return BS; + case TI: { + return "TI"; } - case "CA": { - return CA; + case TK: { + return "TK"; } - case "CE": { - return CE; + case TO: { + return "TO"; } - case "CKB": { - return CKB; + case TR: { + return "TR"; } - case "CS": { - return CS; + case TT: { + return "TT"; } - case "CU": { - return CU; + case UG: { + return "UG"; } - case "CY": { - return CY; + case UK: { + return "UK"; } - case "DA": { - return DA; + case UR: { + return "UR"; } - case "DE": { - return DE; + case UZ: { + return "UZ"; } - case "DZ": { - return DZ; + case VI: { + return "VI"; } - case "EE": { - return EE; + case VO: { + return "VO"; } - case "EL": { - return EL; + case WO: { + return "WO"; } - case "EN": { - return EN; + case XH: { + return "XH"; } - case "EO": { - return EO; + case YI: { + return "YI"; } - case "ES": { - return ES; + case YO: { + return "YO"; } - case "ET": { - return ET; + case ZH: { + return "ZH"; } - case "EU": { - return EU; + case ZH_CN: { + return "ZH_CN"; } - case "FA": { - return FA; + case ZH_TW: { + return "ZH_TW"; } - case "FF": { - return FF; + case ZU: { + return "ZU"; } - case "FI": { - return FI; + default: { + return ""; } + } + } + } - case "FIL": { - return FIL; + public interface LocalizationQueryDefinition { + void define(LocalizationQuery _queryBuilder); + } + + /** + * Information about the localized experiences configured for the shop. + */ + public static class LocalizationQuery extends Query { + LocalizationQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The list of countries with enabled localized experiences. + */ + public LocalizationQuery availableCountries(CountryQueryDefinition queryDef) { + startField("availableCountries"); + + _queryBuilder.append('{'); + queryDef.define(new CountryQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The list of languages available for the active country. + */ + public LocalizationQuery availableLanguages(LanguageQueryDefinition queryDef) { + startField("availableLanguages"); + + _queryBuilder.append('{'); + queryDef.define(new LanguageQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The country of the active localized experience. Use the `@inContext` directive to change this value. + */ + public LocalizationQuery country(CountryQueryDefinition queryDef) { + startField("country"); + + _queryBuilder.append('{'); + queryDef.define(new CountryQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The language of the active localized experience. Use the `@inContext` directive to change this + * value. + */ + public LocalizationQuery language(LanguageQueryDefinition queryDef) { + startField("language"); + + _queryBuilder.append('{'); + queryDef.define(new LanguageQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The market including the country of the active localized experience. Use the `@inContext` directive + * to change this value. + */ + public LocalizationQuery market(MarketQueryDefinition queryDef) { + startField("market"); + + _queryBuilder.append('{'); + queryDef.define(new MarketQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * Information about the localized experiences configured for the shop. + */ + public static class Localization extends AbstractResponse { + public Localization() { + } + + public Localization(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "availableCountries": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Country(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "availableLanguages": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Language(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "country": { + responseData.put(key, new Country(jsonAsObject(field.getValue(), key))); + + break; + } + + case "language": { + responseData.put(key, new Language(jsonAsObject(field.getValue(), key))); + + break; + } + + case "market": { + responseData.put(key, new Market(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } + + public String getGraphQlTypeName() { + return "Localization"; + } + + /** + * The list of countries with enabled localized experiences. + */ + + public List getAvailableCountries() { + return (List) get("availableCountries"); + } + + public Localization setAvailableCountries(List arg) { + optimisticData.put(getKey("availableCountries"), arg); + return this; + } + + /** + * The list of languages available for the active country. + */ + + public List getAvailableLanguages() { + return (List) get("availableLanguages"); + } + + public Localization setAvailableLanguages(List arg) { + optimisticData.put(getKey("availableLanguages"), arg); + return this; + } + + /** + * The country of the active localized experience. Use the `@inContext` directive to change this value. + */ + + public Country getCountry() { + return (Country) get("country"); + } + + public Localization setCountry(Country arg) { + optimisticData.put(getKey("country"), arg); + return this; + } + + /** + * The language of the active localized experience. Use the `@inContext` directive to change this + * value. + */ + + public Language getLanguage() { + return (Language) get("language"); + } + + public Localization setLanguage(Language arg) { + optimisticData.put(getKey("language"), arg); + return this; + } + + /** + * The market including the country of the active localized experience. Use the `@inContext` directive + * to change this value. + */ - case "FO": { - return FO; - } + public Market getMarket() { + return (Market) get("market"); + } - case "FR": { - return FR; - } + public Localization setMarket(Market arg) { + optimisticData.put(getKey("market"), arg); + return this; + } - case "FY": { - return FY; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "availableCountries": return true; - case "GA": { - return GA; - } + case "availableLanguages": return true; - case "GD": { - return GD; - } + case "country": return true; - case "GL": { - return GL; - } + case "language": return true; - case "GU": { - return GU; - } + case "market": return true; - case "GV": { - return GV; - } + default: return false; + } + } + } - case "HA": { - return HA; - } + public interface LocationQueryDefinition { + void define(LocationQuery _queryBuilder); + } - case "HE": { - return HE; - } + /** + * Represents a location where product inventory is held. + */ + public static class LocationQuery extends Query { + LocationQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - case "HI": { - return HI; - } + startField("id"); + } - case "HR": { - return HR; - } + /** + * The address of the location. + */ + public LocationQuery address(LocationAddressQueryDefinition queryDef) { + startField("address"); - case "HU": { - return HU; - } + _queryBuilder.append('{'); + queryDef.define(new LocationAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "HY": { - return HY; - } + return this; + } - case "IA": { - return IA; - } + public class MetafieldArguments extends Arguments { + MetafieldArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } - case "ID": { - return ID; + /** + * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. + */ + public MetafieldArguments namespace(String value) { + if (value != null) { + startArgument("namespace"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } + } - case "IG": { - return IG; - } + public interface MetafieldArgumentsDefinition { + void define(MetafieldArguments args); + } - case "II": { - return II; - } + /** + * Returns a metafield found by namespace and key. + */ + public LocationQuery metafield(String key, MetafieldQueryDefinition queryDef) { + return metafield(key, args -> {}, queryDef); + } - case "IS": { - return IS; - } + /** + * Returns a metafield found by namespace and key. + */ + public LocationQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { + startField("metafield"); - case "IT": { - return IT; - } + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); - case "JA": { - return JA; - } + argsDef.define(new MetafieldArguments(_queryBuilder)); - case "JV": { - return JV; - } + _queryBuilder.append(')'); - case "KA": { - return KA; - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "KI": { - return KI; - } + return this; + } - case "KK": { - return KK; - } + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ + public LocationQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); - case "KL": { - return KL; + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); } + } + _queryBuilder.append(']'); - case "KM": { - return KM; - } + _queryBuilder.append(')'); - case "KN": { - return KN; - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "KO": { - return KO; - } + return this; + } - case "KS": { - return KS; - } + /** + * The name of the location. + */ + public LocationQuery name() { + startField("name"); - case "KU": { - return KU; - } + return this; + } + } - case "KW": { - return KW; - } + /** + * Represents a location where product inventory is held. + */ + public static class Location extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { + public Location() { + } - case "KY": { - return KY; - } + public Location(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "address": { + responseData.put(key, new LocationAddress(jsonAsObject(field.getValue(), key))); - case "LA": { - return LA; - } + break; + } - case "LB": { - return LB; - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - case "LG": { - return LG; - } + break; + } - case "LN": { - return LN; - } + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } - case "LO": { - return LO; - } + responseData.put(key, optional1); - case "LT": { - return LT; - } + break; + } - case "LU": { - return LU; - } + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } - case "LV": { - return LV; - } + list1.add(optional2); + } - case "MG": { - return MG; - } + responseData.put(key, list1); - case "MI": { - return MI; - } + break; + } - case "MK": { - return MK; - } + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case "ML": { - return ML; - } + break; + } - case "MN": { - return MN; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "MO": { - return MO; - } + public Location(ID id) { + this(); + optimisticData.put("id", id); + } - case "MR": { - return MR; - } + public String getGraphQlTypeName() { + return "Location"; + } - case "MS": { - return MS; - } + /** + * The address of the location. + */ - case "MT": { - return MT; - } + public LocationAddress getAddress() { + return (LocationAddress) get("address"); + } - case "MY": { - return MY; - } + public Location setAddress(LocationAddress arg) { + optimisticData.put(getKey("address"), arg); + return this; + } - case "NB": { - return NB; - } + /** + * A globally-unique ID. + */ - case "ND": { - return ND; - } + public ID getId() { + return (ID) get("id"); + } - case "NE": { - return NE; - } + /** + * Returns a metafield found by namespace and key. + */ - case "NL": { - return NL; - } + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } - case "NN": { - return NN; - } + public Location setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); + return this; + } - case "NO": { - return NO; - } + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ - case "OM": { - return OM; - } + public List getMetafields() { + return (List) get("metafields"); + } - case "OR": { - return OR; - } + public Location setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); + return this; + } - case "OS": { - return OS; - } + /** + * The name of the location. + */ - case "PA": { - return PA; - } + public String getName() { + return (String) get("name"); + } - case "PL": { - return PL; - } + public Location setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } - case "PS": { - return PS; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "address": return true; - case "PT": { - return PT; - } + case "id": return false; - case "PT_BR": { - return PT_BR; - } + case "metafield": return true; - case "PT_PT": { - return PT_PT; - } + case "metafields": return true; - case "QU": { - return QU; - } + case "name": return false; - case "RM": { - return RM; - } + default: return false; + } + } + } - case "RN": { - return RN; - } + public interface LocationAddressQueryDefinition { + void define(LocationAddressQuery _queryBuilder); + } - case "RO": { - return RO; - } + /** + * Represents the address of a location. + */ + public static class LocationAddressQuery extends Query { + LocationAddressQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "RU": { - return RU; - } + /** + * The first line of the address for the location. + */ + public LocationAddressQuery address1() { + startField("address1"); - case "RW": { - return RW; - } + return this; + } - case "SA": { - return SA; - } + /** + * The second line of the address for the location. + */ + public LocationAddressQuery address2() { + startField("address2"); - case "SC": { - return SC; - } + return this; + } - case "SD": { - return SD; - } + /** + * The city of the location. + */ + public LocationAddressQuery city() { + startField("city"); - case "SE": { - return SE; - } + return this; + } - case "SG": { - return SG; - } + /** + * The country of the location. + */ + public LocationAddressQuery country() { + startField("country"); - case "SH": { - return SH; - } + return this; + } - case "SI": { - return SI; - } + /** + * The country code of the location. + */ + public LocationAddressQuery countryCode() { + startField("countryCode"); - case "SK": { - return SK; - } + return this; + } - case "SL": { - return SL; - } + /** + * A formatted version of the address for the location. + */ + public LocationAddressQuery formatted() { + startField("formatted"); - case "SN": { - return SN; - } + return this; + } - case "SO": { - return SO; - } + /** + * The latitude coordinates of the location. + */ + public LocationAddressQuery latitude() { + startField("latitude"); - case "SQ": { - return SQ; - } + return this; + } - case "SR": { - return SR; - } + /** + * The longitude coordinates of the location. + */ + public LocationAddressQuery longitude() { + startField("longitude"); - case "SU": { - return SU; - } + return this; + } - case "SV": { - return SV; - } + /** + * The phone number of the location. + */ + public LocationAddressQuery phone() { + startField("phone"); - case "SW": { - return SW; - } + return this; + } - case "TA": { - return TA; - } + /** + * The province of the location. + */ + public LocationAddressQuery province() { + startField("province"); - case "TE": { - return TE; - } + return this; + } - case "TG": { - return TG; - } + /** + * The code for the province, state, or district of the address of the location. + */ + public LocationAddressQuery provinceCode() { + startField("provinceCode"); - case "TH": { - return TH; - } + return this; + } - case "TI": { - return TI; - } + /** + * The ZIP code of the location. + */ + public LocationAddressQuery zip() { + startField("zip"); - case "TK": { - return TK; - } + return this; + } + } - case "TO": { - return TO; - } + /** + * Represents the address of a location. + */ + public static class LocationAddress extends AbstractResponse { + public LocationAddress() { + } - case "TR": { - return TR; - } + public LocationAddress(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "address1": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "TT": { - return TT; - } + responseData.put(key, optional1); - case "UG": { - return UG; - } + break; + } - case "UK": { - return UK; - } + case "address2": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "UR": { - return UR; - } + responseData.put(key, optional1); - case "UZ": { - return UZ; - } + break; + } - case "VI": { - return VI; - } + case "city": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "VO": { - return VO; - } + responseData.put(key, optional1); - case "WO": { - return WO; - } + break; + } - case "XH": { - return XH; - } + case "country": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "YI": { - return YI; - } + responseData.put(key, optional1); - case "YO": { - return YO; - } + break; + } - case "ZH": { - return ZH; - } + case "countryCode": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "ZH_CN": { - return ZH_CN; - } + responseData.put(key, optional1); - case "ZH_TW": { - return ZH_TW; - } + break; + } - case "ZU": { - return ZU; - } + case "formatted": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case AF: { - return "AF"; - } + responseData.put(key, list1); - case AK: { - return "AK"; - } + break; + } - case AM: { - return "AM"; - } + case "latitude": { + Double optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsDouble(field.getValue(), key); + } - case AR: { - return "AR"; - } + responseData.put(key, optional1); - case AS: { - return "AS"; - } + break; + } - case AZ: { - return "AZ"; - } + case "longitude": { + Double optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsDouble(field.getValue(), key); + } - case BE: { - return "BE"; - } + responseData.put(key, optional1); - case BG: { - return "BG"; - } + break; + } - case BM: { - return "BM"; - } + case "phone": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case BN: { - return "BN"; - } + responseData.put(key, optional1); - case BO: { - return "BO"; - } + break; + } - case BR: { - return "BR"; - } + case "province": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case BS: { - return "BS"; - } + responseData.put(key, optional1); - case CA: { - return "CA"; - } + break; + } - case CE: { - return "CE"; - } + case "provinceCode": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case CKB: { - return "CKB"; - } + responseData.put(key, optional1); - case CS: { - return "CS"; - } + break; + } - case CU: { - return "CU"; - } + case "zip": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case CY: { - return "CY"; - } + responseData.put(key, optional1); - case DA: { - return "DA"; - } + break; + } - case DE: { - return "DE"; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case DZ: { - return "DZ"; - } + public String getGraphQlTypeName() { + return "LocationAddress"; + } - case EE: { - return "EE"; - } + /** + * The first line of the address for the location. + */ - case EL: { - return "EL"; - } + public String getAddress1() { + return (String) get("address1"); + } - case EN: { - return "EN"; - } + public LocationAddress setAddress1(String arg) { + optimisticData.put(getKey("address1"), arg); + return this; + } - case EO: { - return "EO"; - } + /** + * The second line of the address for the location. + */ - case ES: { - return "ES"; - } + public String getAddress2() { + return (String) get("address2"); + } - case ET: { - return "ET"; - } + public LocationAddress setAddress2(String arg) { + optimisticData.put(getKey("address2"), arg); + return this; + } - case EU: { - return "EU"; - } + /** + * The city of the location. + */ - case FA: { - return "FA"; - } + public String getCity() { + return (String) get("city"); + } - case FF: { - return "FF"; - } + public LocationAddress setCity(String arg) { + optimisticData.put(getKey("city"), arg); + return this; + } - case FI: { - return "FI"; - } + /** + * The country of the location. + */ - case FIL: { - return "FIL"; - } + public String getCountry() { + return (String) get("country"); + } - case FO: { - return "FO"; - } + public LocationAddress setCountry(String arg) { + optimisticData.put(getKey("country"), arg); + return this; + } - case FR: { - return "FR"; - } + /** + * The country code of the location. + */ - case FY: { - return "FY"; - } + public String getCountryCode() { + return (String) get("countryCode"); + } - case GA: { - return "GA"; - } + public LocationAddress setCountryCode(String arg) { + optimisticData.put(getKey("countryCode"), arg); + return this; + } - case GD: { - return "GD"; - } + /** + * A formatted version of the address for the location. + */ - case GL: { - return "GL"; - } + public List getFormatted() { + return (List) get("formatted"); + } - case GU: { - return "GU"; - } + public LocationAddress setFormatted(List arg) { + optimisticData.put(getKey("formatted"), arg); + return this; + } - case GV: { - return "GV"; - } + /** + * The latitude coordinates of the location. + */ - case HA: { - return "HA"; - } + public Double getLatitude() { + return (Double) get("latitude"); + } - case HE: { - return "HE"; - } + public LocationAddress setLatitude(Double arg) { + optimisticData.put(getKey("latitude"), arg); + return this; + } - case HI: { - return "HI"; - } + /** + * The longitude coordinates of the location. + */ - case HR: { - return "HR"; - } + public Double getLongitude() { + return (Double) get("longitude"); + } - case HU: { - return "HU"; - } + public LocationAddress setLongitude(Double arg) { + optimisticData.put(getKey("longitude"), arg); + return this; + } - case HY: { - return "HY"; - } + /** + * The phone number of the location. + */ - case IA: { - return "IA"; - } + public String getPhone() { + return (String) get("phone"); + } - case ID: { - return "ID"; - } + public LocationAddress setPhone(String arg) { + optimisticData.put(getKey("phone"), arg); + return this; + } - case IG: { - return "IG"; - } + /** + * The province of the location. + */ - case II: { - return "II"; - } + public String getProvince() { + return (String) get("province"); + } - case IS: { - return "IS"; - } + public LocationAddress setProvince(String arg) { + optimisticData.put(getKey("province"), arg); + return this; + } - case IT: { - return "IT"; - } + /** + * The code for the province, state, or district of the address of the location. + */ - case JA: { - return "JA"; - } + public String getProvinceCode() { + return (String) get("provinceCode"); + } - case JV: { - return "JV"; - } + public LocationAddress setProvinceCode(String arg) { + optimisticData.put(getKey("provinceCode"), arg); + return this; + } - case KA: { - return "KA"; - } + /** + * The ZIP code of the location. + */ - case KI: { - return "KI"; - } + public String getZip() { + return (String) get("zip"); + } - case KK: { - return "KK"; - } + public LocationAddress setZip(String arg) { + optimisticData.put(getKey("zip"), arg); + return this; + } - case KL: { - return "KL"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "address1": return false; - case KM: { - return "KM"; - } + case "address2": return false; - case KN: { - return "KN"; - } + case "city": return false; - case KO: { - return "KO"; - } + case "country": return false; - case KS: { - return "KS"; - } + case "countryCode": return false; - case KU: { - return "KU"; - } + case "formatted": return false; - case KW: { - return "KW"; - } + case "latitude": return false; - case KY: { - return "KY"; - } + case "longitude": return false; - case LA: { - return "LA"; - } + case "phone": return false; - case LB: { - return "LB"; - } + case "province": return false; - case LG: { - return "LG"; - } + case "provinceCode": return false; - case LN: { - return "LN"; - } + case "zip": return false; - case LO: { - return "LO"; - } + default: return false; + } + } + } - case LT: { - return "LT"; - } + public interface LocationConnectionQueryDefinition { + void define(LocationConnectionQuery _queryBuilder); + } - case LU: { - return "LU"; - } + /** + * An auto-generated type for paginating through multiple Locations. + */ + public static class LocationConnectionQuery extends Query { + LocationConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case LV: { - return "LV"; - } + /** + * A list of edges. + */ + public LocationConnectionQuery edges(LocationEdgeQueryDefinition queryDef) { + startField("edges"); - case MG: { - return "MG"; - } + _queryBuilder.append('{'); + queryDef.define(new LocationEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); - case MI: { - return "MI"; - } + return this; + } - case MK: { - return "MK"; - } + /** + * A list of the nodes contained in LocationEdge. + */ + public LocationConnectionQuery nodes(LocationQueryDefinition queryDef) { + startField("nodes"); - case ML: { - return "ML"; - } + _queryBuilder.append('{'); + queryDef.define(new LocationQuery(_queryBuilder)); + _queryBuilder.append('}'); - case MN: { - return "MN"; - } + return this; + } - case MO: { - return "MO"; - } + /** + * Information to aid in pagination. + */ + public LocationConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - case MR: { - return "MR"; - } + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); - case MS: { - return "MS"; - } + return this; + } + } - case MT: { - return "MT"; - } + /** + * An auto-generated type for paginating through multiple Locations. + */ + public static class LocationConnection extends AbstractResponse { + public LocationConnection() { + } - case MY: { - return "MY"; - } + public LocationConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new LocationEdge(jsonAsObject(element1, key))); + } - case NB: { - return "NB"; - } + responseData.put(key, list1); - case ND: { - return "ND"; - } + break; + } - case NE: { - return "NE"; - } + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Location(jsonAsObject(element1, key))); + } - case NL: { - return "NL"; - } + responseData.put(key, list1); - case NN: { - return "NN"; - } + break; + } - case NO: { - return "NO"; - } + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - case OM: { - return "OM"; - } + break; + } - case OR: { - return "OR"; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case OS: { - return "OS"; - } + public String getGraphQlTypeName() { + return "LocationConnection"; + } - case PA: { - return "PA"; - } + /** + * A list of edges. + */ - case PL: { - return "PL"; - } + public List getEdges() { + return (List) get("edges"); + } - case PS: { - return "PS"; - } + public LocationConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; + } - case PT: { - return "PT"; - } + /** + * A list of the nodes contained in LocationEdge. + */ - case PT_BR: { - return "PT_BR"; - } + public List getNodes() { + return (List) get("nodes"); + } - case PT_PT: { - return "PT_PT"; - } + public LocationConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; + } - case QU: { - return "QU"; - } + /** + * Information to aid in pagination. + */ - case RM: { - return "RM"; - } + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } - case RN: { - return "RN"; - } + public LocationConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); + return this; + } - case RO: { - return "RO"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - case RU: { - return "RU"; - } + case "nodes": return true; - case RW: { - return "RW"; - } + case "pageInfo": return true; - case SA: { - return "SA"; - } + default: return false; + } + } + } - case SC: { - return "SC"; - } + public interface LocationEdgeQueryDefinition { + void define(LocationEdgeQuery _queryBuilder); + } - case SD: { - return "SD"; - } + /** + * An auto-generated type which holds one Location and a cursor during pagination. + */ + public static class LocationEdgeQuery extends Query { + LocationEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case SE: { - return "SE"; - } + /** + * A cursor for use in pagination. + */ + public LocationEdgeQuery cursor() { + startField("cursor"); - case SG: { - return "SG"; - } + return this; + } - case SH: { - return "SH"; - } + /** + * The item at the end of LocationEdge. + */ + public LocationEdgeQuery node(LocationQueryDefinition queryDef) { + startField("node"); - case SI: { - return "SI"; - } + _queryBuilder.append('{'); + queryDef.define(new LocationQuery(_queryBuilder)); + _queryBuilder.append('}'); - case SK: { - return "SK"; - } + return this; + } + } - case SL: { - return "SL"; - } + /** + * An auto-generated type which holds one Location and a cursor during pagination. + */ + public static class LocationEdge extends AbstractResponse { + public LocationEdge() { + } - case SN: { - return "SN"; - } + public LocationEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case SO: { - return "SO"; - } + break; + } - case SQ: { - return "SQ"; - } + case "node": { + responseData.put(key, new Location(jsonAsObject(field.getValue(), key))); - case SR: { - return "SR"; - } + break; + } - case SU: { - return "SU"; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case SV: { - return "SV"; - } + public String getGraphQlTypeName() { + return "LocationEdge"; + } - case SW: { - return "SW"; - } + /** + * A cursor for use in pagination. + */ - case TA: { - return "TA"; - } + public String getCursor() { + return (String) get("cursor"); + } - case TE: { - return "TE"; - } + public LocationEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); + return this; + } - case TG: { - return "TG"; - } + /** + * The item at the end of LocationEdge. + */ - case TH: { - return "TH"; - } + public Location getNode() { + return (Location) get("node"); + } - case TI: { - return "TI"; - } + public LocationEdge setNode(Location arg) { + optimisticData.put(getKey("node"), arg); + return this; + } - case TK: { - return "TK"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - case TO: { - return "TO"; - } + case "node": return true; - case TR: { - return "TR"; - } + default: return false; + } + } + } - case TT: { - return "TT"; - } + /** + * The set of valid sort keys for the Location query. + */ + public enum LocationSortKeys { + /** + * Sort by the `city` value. + */ + CITY, - case UG: { - return "UG"; - } + /** + * Sort by the `distance` value. + */ + DISTANCE, - case UK: { - return "UK"; - } + /** + * Sort by the `id` value. + */ + ID, - case UR: { - return "UR"; - } + /** + * Sort by the `name` value. + */ + NAME, - case UZ: { - return "UZ"; - } + UNKNOWN_VALUE; - case VI: { - return "VI"; - } + public static LocationSortKeys fromGraphQl(String value) { + if (value == null) { + return null; + } - case VO: { - return "VO"; + switch (value) { + case "CITY": { + return CITY; } - case WO: { - return "WO"; + case "DISTANCE": { + return DISTANCE; } - case XH: { - return "XH"; + case "ID": { + return ID; } - case YI: { - return "YI"; + case "NAME": { + return NAME; } - case YO: { - return "YO"; + default: { + return UNKNOWN_VALUE; } - - case ZH: { - return "ZH"; + } + } + public String toString() { + switch (this) { + case CITY: { + return "CITY"; } - case ZH_CN: { - return "ZH_CN"; + case DISTANCE: { + return "DISTANCE"; } - case ZH_TW: { - return "ZH_TW"; + case ID: { + return "ID"; } - case ZU: { - return "ZU"; + case NAME: { + return "NAME"; } default: { @@ -41347,377 +36692,409 @@ public String toString() { } } - public interface LocalizationQueryDefinition { - void define(LocalizationQuery _queryBuilder); + public interface MailingAddressQueryDefinition { + void define(MailingAddressQuery _queryBuilder); } /** - * Information about the localized experiences configured for the shop. + * Represents a mailing address for customers and shipping. */ - public static class LocalizationQuery extends Query { - LocalizationQuery(StringBuilder _queryBuilder) { + public static class MailingAddressQuery extends Query { + MailingAddressQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * The list of countries with enabled localized experiences. + * The first line of the address. Typically the street address or PO Box number. */ - public LocalizationQuery availableCountries(CountryQueryDefinition queryDef) { - startField("availableCountries"); - - _queryBuilder.append('{'); - queryDef.define(new CountryQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MailingAddressQuery address1() { + startField("address1"); return this; } /** - * The list of languages available for the active country. + * The second line of the address. Typically the number of the apartment, suite, or unit. */ - public LocalizationQuery availableLanguages(LanguageQueryDefinition queryDef) { - startField("availableLanguages"); - - _queryBuilder.append('{'); - queryDef.define(new LanguageQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MailingAddressQuery address2() { + startField("address2"); return this; } /** - * The country of the active localized experience. Use the `@inContext` directive to change this value. + * The name of the city, district, village, or town. */ - public LocalizationQuery country(CountryQueryDefinition queryDef) { - startField("country"); - - _queryBuilder.append('{'); - queryDef.define(new CountryQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MailingAddressQuery city() { + startField("city"); return this; } /** - * The language of the active localized experience. Use the `@inContext` directive to change this - * value. + * The name of the customer's company or organization. */ - public LocalizationQuery language(LanguageQueryDefinition queryDef) { - startField("language"); - - _queryBuilder.append('{'); - queryDef.define(new LanguageQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MailingAddressQuery company() { + startField("company"); return this; } /** - * The market including the country of the active localized experience. Use the `@inContext` directive - * to change this value. + * The name of the country. */ - public LocalizationQuery market(MarketQueryDefinition queryDef) { - startField("market"); - - _queryBuilder.append('{'); - queryDef.define(new MarketQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MailingAddressQuery country() { + startField("country"); return this; } - } - - /** - * Information about the localized experiences configured for the shop. - */ - public static class Localization extends AbstractResponse { - public Localization() { - } - - public Localization(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "availableCountries": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Country(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "availableLanguages": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Language(jsonAsObject(element1, key))); - } - responseData.put(key, list1); + /** + * The two-letter code for the country of the address. + * For example, US. + * + * @deprecated Use `countryCodeV2` instead. + */ + @Deprecated + public MailingAddressQuery countryCode() { + startField("countryCode"); - break; - } + return this; + } - case "country": { - responseData.put(key, new Country(jsonAsObject(field.getValue(), key))); + /** + * The two-letter code for the country of the address. + * For example, US. + */ + public MailingAddressQuery countryCodeV2() { + startField("countryCodeV2"); - break; - } + return this; + } - case "language": { - responseData.put(key, new Language(jsonAsObject(field.getValue(), key))); + /** + * The first name of the customer. + */ + public MailingAddressQuery firstName() { + startField("firstName"); - break; - } + return this; + } - case "market": { - responseData.put(key, new Market(jsonAsObject(field.getValue(), key))); + public class FormattedArguments extends Arguments { + FormattedArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - break; - } + /** + * Whether to include the customer's name in the formatted address. + */ + public FormattedArguments withName(Boolean value) { + if (value != null) { + startArgument("withName"); + _queryBuilder.append(value); + } + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + /** + * Whether to include the customer's company in the formatted address. + */ + public FormattedArguments withCompany(Boolean value) { + if (value != null) { + startArgument("withCompany"); + _queryBuilder.append(value); } + return this; } } - public String getGraphQlTypeName() { - return "Localization"; + public interface FormattedArgumentsDefinition { + void define(FormattedArguments args); } /** - * The list of countries with enabled localized experiences. + * A formatted version of the address, customized by the provided arguments. */ + public MailingAddressQuery formatted() { + return formatted(args -> {}); + } - public List getAvailableCountries() { - return (List) get("availableCountries"); + /** + * A formatted version of the address, customized by the provided arguments. + */ + public MailingAddressQuery formatted(FormattedArgumentsDefinition argsDef) { + startField("formatted"); + + FormattedArguments args = new FormattedArguments(_queryBuilder); + argsDef.define(args); + FormattedArguments.end(args); + + return this; } - public Localization setAvailableCountries(List arg) { - optimisticData.put(getKey("availableCountries"), arg); + /** + * A comma-separated list of the values for city, province, and country. + */ + public MailingAddressQuery formattedArea() { + startField("formattedArea"); + return this; } /** - * The list of languages available for the active country. + * The last name of the customer. */ + public MailingAddressQuery lastName() { + startField("lastName"); - public List getAvailableLanguages() { - return (List) get("availableLanguages"); + return this; } - public Localization setAvailableLanguages(List arg) { - optimisticData.put(getKey("availableLanguages"), arg); + /** + * The latitude coordinate of the customer address. + */ + public MailingAddressQuery latitude() { + startField("latitude"); + return this; } /** - * The country of the active localized experience. Use the `@inContext` directive to change this value. + * The longitude coordinate of the customer address. */ + public MailingAddressQuery longitude() { + startField("longitude"); - public Country getCountry() { - return (Country) get("country"); + return this; } - public Localization setCountry(Country arg) { - optimisticData.put(getKey("country"), arg); + /** + * The full name of the customer, based on firstName and lastName. + */ + public MailingAddressQuery name() { + startField("name"); + return this; } /** - * The language of the active localized experience. Use the `@inContext` directive to change this - * value. + * A unique phone number for the customer. + * Formatted using E.164 standard. For example, _+16135551111_. */ + public MailingAddressQuery phone() { + startField("phone"); - public Language getLanguage() { - return (Language) get("language"); + return this; } - public Localization setLanguage(Language arg) { - optimisticData.put(getKey("language"), arg); + /** + * The region of the address, such as the province, state, or district. + */ + public MailingAddressQuery province() { + startField("province"); + return this; } /** - * The market including the country of the active localized experience. Use the `@inContext` directive - * to change this value. + * The alphanumeric code for the region. + * For example, ON. */ + public MailingAddressQuery provinceCode() { + startField("provinceCode"); - public Market getMarket() { - return (Market) get("market"); + return this; } - public Localization setMarket(Market arg) { - optimisticData.put(getKey("market"), arg); + /** + * The zip or postal code of the address. + */ + public MailingAddressQuery zip() { + startField("zip"); + return this; } + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "availableCountries": return true; + /** + * Represents a mailing address for customers and shipping. + */ + public static class MailingAddress extends AbstractResponse implements DeliveryAddress, Node { + public MailingAddress() { + } - case "availableLanguages": return true; + public MailingAddress(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "address1": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "country": return true; + responseData.put(key, optional1); - case "language": return true; + break; + } - case "market": return true; + case "address2": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - default: return false; - } - } - } + responseData.put(key, optional1); - public interface LocationQueryDefinition { - void define(LocationQuery _queryBuilder); - } + break; + } - /** - * Represents a location where product inventory is held. - */ - public static class LocationQuery extends Query { - LocationQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + case "city": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - startField("id"); - } + responseData.put(key, optional1); - /** - * The address of the location. - */ - public LocationQuery address(LocationAddressQueryDefinition queryDef) { - startField("address"); + break; + } - _queryBuilder.append('{'); - queryDef.define(new LocationAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "company": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - return this; - } + responseData.put(key, optional1); - public class MetafieldArguments extends Arguments { - MetafieldArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } + break; + } - /** - * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. - */ - public MetafieldArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - } + case "country": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - public interface MetafieldArgumentsDefinition { - void define(MetafieldArguments args); - } + responseData.put(key, optional1); - /** - * Returns a metafield found by namespace and key. - */ - public LocationQuery metafield(String key, MetafieldQueryDefinition queryDef) { - return metafield(key, args -> {}, queryDef); - } + break; + } - /** - * Returns a metafield found by namespace and key. - */ - public LocationQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { - startField("metafield"); + case "countryCode": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + responseData.put(key, optional1); - argsDef.define(new MetafieldArguments(_queryBuilder)); + break; + } - _queryBuilder.append(')'); + case "countryCodeV2": { + CountryCode optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = CountryCode.fromGraphQl(jsonAsString(field.getValue(), key)); + } - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + responseData.put(key, optional1); - return this; - } + break; + } - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ - public LocationQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); + case "firstName": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); + responseData.put(key, optional1); - _queryBuilder.append(')'); + break; + } + + case "formatted": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + responseData.put(key, list1); + + break; + } + + case "formattedArea": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "lastName": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; - } + case "latitude": { + Double optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsDouble(field.getValue(), key); + } - /** - * The name of the location. - */ - public LocationQuery name() { - startField("name"); + responseData.put(key, optional1); - return this; - } - } + break; + } - /** - * Represents a location where product inventory is held. - */ - public static class Location extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { - public Location() { - } + case "longitude": { + Double optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsDouble(field.getValue(), key); + } - public Location(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "address": { - responseData.put(key, new LocationAddress(jsonAsObject(field.getValue(), key))); + responseData.put(key, optional1); break; } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case "name": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "metafield": { - Metafield optional1 = null; + case "phone": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -41725,24 +37102,35 @@ public Location(JsonObject fields) throws SchemaViolationError { break; } - case "metafields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } + case "province": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - list1.add(optional2); + responseData.put(key, optional1); + + break; + } + + case "provinceCode": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "zip": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } @@ -41758,353 +37146,522 @@ public Location(JsonObject fields) throws SchemaViolationError { } } - public Location(ID id) { + public MailingAddress(ID id) { this(); optimisticData.put("id", id); } public String getGraphQlTypeName() { - return "Location"; + return "MailingAddress"; } /** - * The address of the location. + * The first line of the address. Typically the street address or PO Box number. */ - public LocationAddress getAddress() { - return (LocationAddress) get("address"); + public String getAddress1() { + return (String) get("address1"); } - public Location setAddress(LocationAddress arg) { - optimisticData.put(getKey("address"), arg); + public MailingAddress setAddress1(String arg) { + optimisticData.put(getKey("address1"), arg); return this; } /** - * A globally-unique ID. + * The second line of the address. Typically the number of the apartment, suite, or unit. */ - public ID getId() { - return (ID) get("id"); + public String getAddress2() { + return (String) get("address2"); + } + + public MailingAddress setAddress2(String arg) { + optimisticData.put(getKey("address2"), arg); + return this; } /** - * Returns a metafield found by namespace and key. + * The name of the city, district, village, or town. */ - public Metafield getMetafield() { - return (Metafield) get("metafield"); + public String getCity() { + return (String) get("city"); } - public Location setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); + public MailingAddress setCity(String arg) { + optimisticData.put(getKey("city"), arg); return this; } /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * The name of the customer's company or organization. */ - public List getMetafields() { - return (List) get("metafields"); + public String getCompany() { + return (String) get("company"); } - public Location setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); + public MailingAddress setCompany(String arg) { + optimisticData.put(getKey("company"), arg); return this; } /** - * The name of the location. + * The name of the country. */ - public String getName() { - return (String) get("name"); + public String getCountry() { + return (String) get("country"); } - public Location setName(String arg) { - optimisticData.put(getKey("name"), arg); + public MailingAddress setCountry(String arg) { + optimisticData.put(getKey("country"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "address": return true; + /** + * The two-letter code for the country of the address. + * For example, US. + * + * @deprecated Use `countryCodeV2` instead. + */ - case "id": return false; + public String getCountryCode() { + return (String) get("countryCode"); + } - case "metafield": return true; + public MailingAddress setCountryCode(String arg) { + optimisticData.put(getKey("countryCode"), arg); + return this; + } - case "metafields": return true; + /** + * The two-letter code for the country of the address. + * For example, US. + */ - case "name": return false; + public CountryCode getCountryCodeV2() { + return (CountryCode) get("countryCodeV2"); + } - default: return false; - } + public MailingAddress setCountryCodeV2(CountryCode arg) { + optimisticData.put(getKey("countryCodeV2"), arg); + return this; } - } - public interface LocationAddressQueryDefinition { - void define(LocationAddressQuery _queryBuilder); - } + /** + * The first name of the customer. + */ - /** - * Represents the address of a location. - */ - public static class LocationAddressQuery extends Query { - LocationAddressQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public String getFirstName() { + return (String) get("firstName"); + } + + public MailingAddress setFirstName(String arg) { + optimisticData.put(getKey("firstName"), arg); + return this; } /** - * The first line of the address for the location. + * A formatted version of the address, customized by the provided arguments. */ - public LocationAddressQuery address1() { - startField("address1"); + public List getFormatted() { + return (List) get("formatted"); + } + + public MailingAddress setFormatted(List arg) { + optimisticData.put(getKey("formatted"), arg); return this; } /** - * The second line of the address for the location. + * A comma-separated list of the values for city, province, and country. */ - public LocationAddressQuery address2() { - startField("address2"); + public String getFormattedArea() { + return (String) get("formattedArea"); + } + + public MailingAddress setFormattedArea(String arg) { + optimisticData.put(getKey("formattedArea"), arg); return this; } /** - * The city of the location. + * A globally-unique ID. */ - public LocationAddressQuery city() { - startField("city"); + public ID getId() { + return (ID) get("id"); + } + + /** + * The last name of the customer. + */ + + public String getLastName() { + return (String) get("lastName"); + } + + public MailingAddress setLastName(String arg) { + optimisticData.put(getKey("lastName"), arg); return this; } /** - * The country of the location. + * The latitude coordinate of the customer address. */ - public LocationAddressQuery country() { - startField("country"); + public Double getLatitude() { + return (Double) get("latitude"); + } + + public MailingAddress setLatitude(Double arg) { + optimisticData.put(getKey("latitude"), arg); return this; } /** - * The country code of the location. + * The longitude coordinate of the customer address. */ - public LocationAddressQuery countryCode() { - startField("countryCode"); + public Double getLongitude() { + return (Double) get("longitude"); + } + + public MailingAddress setLongitude(Double arg) { + optimisticData.put(getKey("longitude"), arg); + return this; + } + + /** + * The full name of the customer, based on firstName and lastName. + */ + + public String getName() { + return (String) get("name"); + } + + public MailingAddress setName(String arg) { + optimisticData.put(getKey("name"), arg); return this; } /** - * A formatted version of the address for the location. + * A unique phone number for the customer. + * Formatted using E.164 standard. For example, _+16135551111_. */ - public LocationAddressQuery formatted() { - startField("formatted"); + public String getPhone() { + return (String) get("phone"); + } + + public MailingAddress setPhone(String arg) { + optimisticData.put(getKey("phone"), arg); return this; } /** - * The latitude coordinates of the location. + * The region of the address, such as the province, state, or district. */ - public LocationAddressQuery latitude() { - startField("latitude"); + public String getProvince() { + return (String) get("province"); + } + + public MailingAddress setProvince(String arg) { + optimisticData.put(getKey("province"), arg); return this; } /** - * The longitude coordinates of the location. + * The alphanumeric code for the region. + * For example, ON. */ - public LocationAddressQuery longitude() { - startField("longitude"); + public String getProvinceCode() { + return (String) get("provinceCode"); + } + + public MailingAddress setProvinceCode(String arg) { + optimisticData.put(getKey("provinceCode"), arg); return this; } /** - * The phone number of the location. + * The zip or postal code of the address. */ - public LocationAddressQuery phone() { - startField("phone"); + public String getZip() { + return (String) get("zip"); + } + + public MailingAddress setZip(String arg) { + optimisticData.put(getKey("zip"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "address1": return false; + + case "address2": return false; + + case "city": return false; + + case "company": return false; + + case "country": return false; + + case "countryCode": return false; + + case "countryCodeV2": return false; + + case "firstName": return false; + + case "formatted": return false; + + case "formattedArea": return false; + + case "id": return false; + + case "lastName": return false; + + case "latitude": return false; + + case "longitude": return false; + + case "name": return false; + + case "phone": return false; + + case "province": return false; + + case "provinceCode": return false; + + case "zip": return false; + + default: return false; + } + } + } + + public interface MailingAddressConnectionQueryDefinition { + void define(MailingAddressConnectionQuery _queryBuilder); + } + + /** + * An auto-generated type for paginating through multiple MailingAddresses. + */ + public static class MailingAddressConnectionQuery extends Query { + MailingAddressConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + /** - * The province of the location. + * A list of edges. */ - public LocationAddressQuery province() { - startField("province"); + public MailingAddressConnectionQuery edges(MailingAddressEdgeQueryDefinition queryDef) { + startField("edges"); + + _queryBuilder.append('{'); + queryDef.define(new MailingAddressEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The code for the province, state, or district of the address of the location. + * A list of the nodes contained in MailingAddressEdge. */ - public LocationAddressQuery provinceCode() { - startField("provinceCode"); + public MailingAddressConnectionQuery nodes(MailingAddressQueryDefinition queryDef) { + startField("nodes"); + + _queryBuilder.append('{'); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The ZIP code of the location. + * Information to aid in pagination. */ - public LocationAddressQuery zip() { - startField("zip"); + public MailingAddressConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); + + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * Represents the address of a location. + * An auto-generated type for paginating through multiple MailingAddresses. */ - public static class LocationAddress extends AbstractResponse { - public LocationAddress() { + public static class MailingAddressConnection extends AbstractResponse { + public MailingAddressConnection() { } - public LocationAddress(JsonObject fields) throws SchemaViolationError { + public MailingAddressConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "address1": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new MailingAddressEdge(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "address2": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new MailingAddress(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "city": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - responseData.put(key, optional1); + break; + } + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - case "country": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + public String getGraphQlTypeName() { + return "MailingAddressConnection"; + } - responseData.put(key, optional1); + /** + * A list of edges. + */ - break; - } + public List getEdges() { + return (List) get("edges"); + } - case "countryCode": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + public MailingAddressConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; + } - responseData.put(key, optional1); + /** + * A list of the nodes contained in MailingAddressEdge. + */ - break; - } + public List getNodes() { + return (List) get("nodes"); + } - case "formatted": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } + public MailingAddressConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; + } - responseData.put(key, list1); + /** + * Information to aid in pagination. + */ - break; - } + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } - case "latitude": { - Double optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsDouble(field.getValue(), key); - } + public MailingAddressConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); + return this; + } - responseData.put(key, optional1); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - break; - } + case "nodes": return true; - case "longitude": { - Double optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsDouble(field.getValue(), key); - } + case "pageInfo": return true; - responseData.put(key, optional1); + default: return false; + } + } + } - break; - } + public interface MailingAddressEdgeQueryDefinition { + void define(MailingAddressEdgeQuery _queryBuilder); + } - case "phone": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + /** + * An auto-generated type which holds one MailingAddress and a cursor during pagination. + */ + public static class MailingAddressEdgeQuery extends Query { + MailingAddressEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - responseData.put(key, optional1); + /** + * A cursor for use in pagination. + */ + public MailingAddressEdgeQuery cursor() { + startField("cursor"); - break; - } + return this; + } - case "province": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + /** + * The item at the end of MailingAddressEdge. + */ + public MailingAddressEdgeQuery node(MailingAddressQueryDefinition queryDef) { + startField("node"); - responseData.put(key, optional1); + _queryBuilder.append('{'); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); - break; - } + return this; + } + } - case "provinceCode": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + /** + * An auto-generated type which holds one MailingAddress and a cursor during pagination. + */ + public static class MailingAddressEdge extends AbstractResponse { + public MailingAddressEdge() { + } - responseData.put(key, optional1); + public MailingAddressEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "zip": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "node": { + responseData.put(key, new MailingAddress(jsonAsObject(field.getValue(), key))); break; } @@ -42121,242 +37678,460 @@ public LocationAddress(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "LocationAddress"; + return "MailingAddressEdge"; } /** - * The first line of the address for the location. + * A cursor for use in pagination. */ - public String getAddress1() { - return (String) get("address1"); + public String getCursor() { + return (String) get("cursor"); } - public LocationAddress setAddress1(String arg) { - optimisticData.put(getKey("address1"), arg); + public MailingAddressEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * The second line of the address for the location. + * The item at the end of MailingAddressEdge. */ - public String getAddress2() { - return (String) get("address2"); + public MailingAddress getNode() { + return (MailingAddress) get("node"); } - public LocationAddress setAddress2(String arg) { - optimisticData.put(getKey("address2"), arg); + public MailingAddressEdge setNode(MailingAddress arg) { + optimisticData.put(getKey("node"), arg); return this; } - /** - * The city of the location. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - public String getCity() { - return (String) get("city"); + case "node": return true; + + default: return false; + } } + } - public LocationAddress setCity(String arg) { - optimisticData.put(getKey("city"), arg); + public static class MailingAddressInput implements Serializable { + private Input address1 = Input.undefined(); + + private Input address2 = Input.undefined(); + + private Input city = Input.undefined(); + + private Input company = Input.undefined(); + + private Input country = Input.undefined(); + + private Input firstName = Input.undefined(); + + private Input lastName = Input.undefined(); + + private Input phone = Input.undefined(); + + private Input province = Input.undefined(); + + private Input zip = Input.undefined(); + + public String getAddress1() { + return address1.getValue(); + } + + public Input getAddress1Input() { + return address1; + } + + public MailingAddressInput setAddress1(String address1) { + this.address1 = Input.optional(address1); return this; } - /** - * The country of the location. - */ + public MailingAddressInput setAddress1Input(Input address1) { + if (address1 == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.address1 = address1; + return this; + } - public String getCountry() { - return (String) get("country"); + public String getAddress2() { + return address2.getValue(); } - public LocationAddress setCountry(String arg) { - optimisticData.put(getKey("country"), arg); + public Input getAddress2Input() { + return address2; + } + + public MailingAddressInput setAddress2(String address2) { + this.address2 = Input.optional(address2); return this; } - /** - * The country code of the location. - */ + public MailingAddressInput setAddress2Input(Input address2) { + if (address2 == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.address2 = address2; + return this; + } - public String getCountryCode() { - return (String) get("countryCode"); + public String getCity() { + return city.getValue(); } - public LocationAddress setCountryCode(String arg) { - optimisticData.put(getKey("countryCode"), arg); + public Input getCityInput() { + return city; + } + + public MailingAddressInput setCity(String city) { + this.city = Input.optional(city); return this; } - /** - * A formatted version of the address for the location. - */ + public MailingAddressInput setCityInput(Input city) { + if (city == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.city = city; + return this; + } - public List getFormatted() { - return (List) get("formatted"); + public String getCompany() { + return company.getValue(); } - public LocationAddress setFormatted(List arg) { - optimisticData.put(getKey("formatted"), arg); + public Input getCompanyInput() { + return company; + } + + public MailingAddressInput setCompany(String company) { + this.company = Input.optional(company); return this; } - /** - * The latitude coordinates of the location. - */ + public MailingAddressInput setCompanyInput(Input company) { + if (company == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.company = company; + return this; + } - public Double getLatitude() { - return (Double) get("latitude"); + public String getCountry() { + return country.getValue(); } - public LocationAddress setLatitude(Double arg) { - optimisticData.put(getKey("latitude"), arg); + public Input getCountryInput() { + return country; + } + + public MailingAddressInput setCountry(String country) { + this.country = Input.optional(country); return this; } - /** - * The longitude coordinates of the location. - */ + public MailingAddressInput setCountryInput(Input country) { + if (country == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.country = country; + return this; + } - public Double getLongitude() { - return (Double) get("longitude"); + public String getFirstName() { + return firstName.getValue(); } - public LocationAddress setLongitude(Double arg) { - optimisticData.put(getKey("longitude"), arg); + public Input getFirstNameInput() { + return firstName; + } + + public MailingAddressInput setFirstName(String firstName) { + this.firstName = Input.optional(firstName); return this; } - /** - * The phone number of the location. - */ + public MailingAddressInput setFirstNameInput(Input firstName) { + if (firstName == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.firstName = firstName; + return this; + } - public String getPhone() { - return (String) get("phone"); + public String getLastName() { + return lastName.getValue(); } - public LocationAddress setPhone(String arg) { - optimisticData.put(getKey("phone"), arg); + public Input getLastNameInput() { + return lastName; + } + + public MailingAddressInput setLastName(String lastName) { + this.lastName = Input.optional(lastName); return this; } - /** - * The province of the location. - */ + public MailingAddressInput setLastNameInput(Input lastName) { + if (lastName == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.lastName = lastName; + return this; + } - public String getProvince() { - return (String) get("province"); + public String getPhone() { + return phone.getValue(); } - public LocationAddress setProvince(String arg) { - optimisticData.put(getKey("province"), arg); + public Input getPhoneInput() { + return phone; + } + + public MailingAddressInput setPhone(String phone) { + this.phone = Input.optional(phone); return this; } - /** - * The code for the province, state, or district of the address of the location. - */ + public MailingAddressInput setPhoneInput(Input phone) { + if (phone == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.phone = phone; + return this; + } - public String getProvinceCode() { - return (String) get("provinceCode"); + public String getProvince() { + return province.getValue(); } - public LocationAddress setProvinceCode(String arg) { - optimisticData.put(getKey("provinceCode"), arg); + public Input getProvinceInput() { + return province; + } + + public MailingAddressInput setProvince(String province) { + this.province = Input.optional(province); return this; } - /** - * The ZIP code of the location. - */ + public MailingAddressInput setProvinceInput(Input province) { + if (province == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.province = province; + return this; + } public String getZip() { - return (String) get("zip"); + return zip.getValue(); } - public LocationAddress setZip(String arg) { - optimisticData.put(getKey("zip"), arg); - return this; + public Input getZipInput() { + return zip; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "address1": return false; + public MailingAddressInput setZip(String zip) { + this.zip = Input.optional(zip); + return this; + } - case "address2": return false; + public MailingAddressInput setZipInput(Input zip) { + if (zip == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.zip = zip; + return this; + } - case "city": return false; + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - case "country": return false; + if (this.address1.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("address1:"); + if (address1.getValue() != null) { + Query.appendQuotedString(_queryBuilder, address1.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - case "countryCode": return false; + if (this.address2.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("address2:"); + if (address2.getValue() != null) { + Query.appendQuotedString(_queryBuilder, address2.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - case "formatted": return false; + if (this.city.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("city:"); + if (city.getValue() != null) { + Query.appendQuotedString(_queryBuilder, city.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - case "latitude": return false; + if (this.company.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("company:"); + if (company.getValue() != null) { + Query.appendQuotedString(_queryBuilder, company.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - case "longitude": return false; + if (this.country.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("country:"); + if (country.getValue() != null) { + Query.appendQuotedString(_queryBuilder, country.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - case "phone": return false; + if (this.firstName.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("firstName:"); + if (firstName.getValue() != null) { + Query.appendQuotedString(_queryBuilder, firstName.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - case "province": return false; + if (this.lastName.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("lastName:"); + if (lastName.getValue() != null) { + Query.appendQuotedString(_queryBuilder, lastName.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - case "provinceCode": return false; + if (this.phone.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("phone:"); + if (phone.getValue() != null) { + Query.appendQuotedString(_queryBuilder, phone.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - case "zip": return false; + if (this.province.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("province:"); + if (province.getValue() != null) { + Query.appendQuotedString(_queryBuilder, province.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - default: return false; + if (this.zip.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("zip:"); + if (zip.getValue() != null) { + Query.appendQuotedString(_queryBuilder, zip.getValue().toString()); + } else { + _queryBuilder.append("null"); + } } + + _queryBuilder.append('}'); } } - public interface LocationConnectionQueryDefinition { - void define(LocationConnectionQuery _queryBuilder); + public interface ManualDiscountApplicationQueryDefinition { + void define(ManualDiscountApplicationQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple Locations. + * Manual discount applications capture the intentions of a discount that was manually created. */ - public static class LocationConnectionQuery extends Query { - LocationConnectionQuery(StringBuilder _queryBuilder) { + public static class ManualDiscountApplicationQuery extends Query { + ManualDiscountApplicationQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A list of edges. + * The method by which the discount's value is allocated to its entitled items. */ - public LocationConnectionQuery edges(LocationEdgeQueryDefinition queryDef) { - startField("edges"); + public ManualDiscountApplicationQuery allocationMethod() { + startField("allocationMethod"); - _queryBuilder.append('{'); - queryDef.define(new LocationEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * The description of the application. + */ + public ManualDiscountApplicationQuery description() { + startField("description"); + + return this; + } + + /** + * Which lines of targetType that the discount is allocated over. + */ + public ManualDiscountApplicationQuery targetSelection() { + startField("targetSelection"); return this; } /** - * A list of the nodes contained in LocationEdge. + * The type of line that the discount is applicable towards. */ - public LocationConnectionQuery nodes(LocationQueryDefinition queryDef) { - startField("nodes"); + public ManualDiscountApplicationQuery targetType() { + startField("targetType"); - _queryBuilder.append('{'); - queryDef.define(new LocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * The title of the application. + */ + public ManualDiscountApplicationQuery title() { + startField("title"); return this; } /** - * Information to aid in pagination. + * The value of the discount application. */ - public LocationConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + public ManualDiscountApplicationQuery value(PricingValueQueryDefinition queryDef) { + startField("value"); _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); + queryDef.define(new PricingValueQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -42364,41 +38139,54 @@ public LocationConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { } /** - * An auto-generated type for paginating through multiple Locations. + * Manual discount applications capture the intentions of a discount that was manually created. */ - public static class LocationConnection extends AbstractResponse { - public LocationConnection() { + public static class ManualDiscountApplication extends AbstractResponse implements DiscountApplication { + public ManualDiscountApplication() { } - public LocationConnection(JsonObject fields) throws SchemaViolationError { + public ManualDiscountApplication(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new LocationEdge(jsonAsObject(element1, key))); + case "allocationMethod": { + responseData.put(key, DiscountApplicationAllocationMethod.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "description": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Location(jsonAsObject(element1, key))); - } + case "targetSelection": { + responseData.put(key, DiscountApplicationTargetSelection.fromGraphQl(jsonAsString(field.getValue(), key))); - responseData.put(key, list1); + break; + } + + case "targetType": { + responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "value": { + responseData.put(key, UnknownPricingValue.create(jsonAsObject(field.getValue(), key))); break; } @@ -42415,589 +38203,463 @@ public LocationConnection(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "LocationConnection"; + return "ManualDiscountApplication"; } /** - * A list of edges. + * The method by which the discount's value is allocated to its entitled items. */ - public List getEdges() { - return (List) get("edges"); + public DiscountApplicationAllocationMethod getAllocationMethod() { + return (DiscountApplicationAllocationMethod) get("allocationMethod"); } - public LocationConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); + public ManualDiscountApplication setAllocationMethod(DiscountApplicationAllocationMethod arg) { + optimisticData.put(getKey("allocationMethod"), arg); return this; } /** - * A list of the nodes contained in LocationEdge. + * The description of the application. */ - public List getNodes() { - return (List) get("nodes"); + public String getDescription() { + return (String) get("description"); } - public LocationConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + public ManualDiscountApplication setDescription(String arg) { + optimisticData.put(getKey("description"), arg); return this; } /** - * Information to aid in pagination. + * Which lines of targetType that the discount is allocated over. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public DiscountApplicationTargetSelection getTargetSelection() { + return (DiscountApplicationTargetSelection) get("targetSelection"); } - public LocationConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public ManualDiscountApplication setTargetSelection(DiscountApplicationTargetSelection arg) { + optimisticData.put(getKey("targetSelection"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return true; - - case "pageInfo": return true; + /** + * The type of line that the discount is applicable towards. + */ - default: return false; - } + public DiscountApplicationTargetType getTargetType() { + return (DiscountApplicationTargetType) get("targetType"); } - } - - public interface LocationEdgeQueryDefinition { - void define(LocationEdgeQuery _queryBuilder); - } - /** - * An auto-generated type which holds one Location and a cursor during pagination. - */ - public static class LocationEdgeQuery extends Query { - LocationEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public ManualDiscountApplication setTargetType(DiscountApplicationTargetType arg) { + optimisticData.put(getKey("targetType"), arg); + return this; } /** - * A cursor for use in pagination. + * The title of the application. */ - public LocationEdgeQuery cursor() { - startField("cursor"); + public String getTitle() { + return (String) get("title"); + } + + public ManualDiscountApplication setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } /** - * The item at the end of LocationEdge. + * The value of the discount application. */ - public LocationEdgeQuery node(LocationQueryDefinition queryDef) { - startField("node"); - _queryBuilder.append('{'); - queryDef.define(new LocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + public PricingValue getValue() { + return (PricingValue) get("value"); + } + public ManualDiscountApplication setValue(PricingValue arg) { + optimisticData.put(getKey("value"), arg); return this; } - } - /** - * An auto-generated type which holds one Location and a cursor during pagination. - */ - public static class LocationEdge extends AbstractResponse { - public LocationEdge() { - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "allocationMethod": return false; - public LocationEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "description": return false; - break; - } + case "targetSelection": return false; - case "node": { - responseData.put(key, new Location(jsonAsObject(field.getValue(), key))); + case "targetType": return false; - break; - } + case "title": return false; - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + case "value": return false; - public String getGraphQlTypeName() { - return "LocationEdge"; + default: return false; + } } + } - /** - * A cursor for use in pagination. - */ + public interface MarketQueryDefinition { + void define(MarketQuery _queryBuilder); + } - public String getCursor() { - return (String) get("cursor"); - } + /** + * A group of one or more regions of the world that a merchant is targeting for sales. To learn more + * about markets, refer to [the Shopify Markets conceptual overview](/docs/apps/markets). + */ + public static class MarketQuery extends Query { + MarketQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - public LocationEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; + startField("id"); } /** - * The item at the end of LocationEdge. + * A human-readable unique string for the market automatically generated from its title. */ + public MarketQuery handle() { + startField("handle"); - public Location getNode() { - return (Location) get("node"); - } - - public LocationEdge setNode(Location arg) { - optimisticData.put(getKey("node"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; - - case "node": return true; + public class MetafieldArguments extends Arguments { + MetafieldArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } - default: return false; + /** + * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. + */ + public MetafieldArguments namespace(String value) { + if (value != null) { + startArgument("namespace"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; } } - } - - /** - * The set of valid sort keys for the Location query. - */ - public enum LocationSortKeys { - /** - * Sort by the `city` value. - */ - CITY, - /** - * Sort by the `distance` value. - */ - DISTANCE, + public interface MetafieldArgumentsDefinition { + void define(MetafieldArguments args); + } /** - * Sort by the `id` value. + * Returns a metafield found by namespace and key. */ - ID, + public MarketQuery metafield(String key, MetafieldQueryDefinition queryDef) { + return metafield(key, args -> {}, queryDef); + } /** - * Sort by the `name` value. + * Returns a metafield found by namespace and key. */ - NAME, + public MarketQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { + startField("metafield"); - UNKNOWN_VALUE; + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); - public static LocationSortKeys fromGraphQl(String value) { - if (value == null) { - return null; - } + argsDef.define(new MetafieldArguments(_queryBuilder)); - switch (value) { - case "CITY": { - return CITY; - } + _queryBuilder.append(')'); - case "DISTANCE": { - return DISTANCE; - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "ID": { - return ID; - } + return this; + } - case "NAME": { - return NAME; - } + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ + public MarketQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); - default: { - return UNKNOWN_VALUE; + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); } } - } - public String toString() { - switch (this) { - case CITY: { - return "CITY"; - } - - case DISTANCE: { - return "DISTANCE"; - } + _queryBuilder.append(']'); - case ID: { - return "ID"; - } + _queryBuilder.append(')'); - case NAME: { - return "NAME"; - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - default: { - return ""; - } - } + return this; } } - public interface MailingAddressQueryDefinition { - void define(MailingAddressQuery _queryBuilder); - } - /** - * Represents a mailing address for customers and shipping. + * A group of one or more regions of the world that a merchant is targeting for sales. To learn more + * about markets, refer to [the Shopify Markets conceptual overview](/docs/apps/markets). */ - public static class MailingAddressQuery extends Query { - MailingAddressQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - - startField("id"); + public static class Market extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { + public Market() { } - /** - * The first line of the address. Typically the street address or PO Box number. - */ - public MailingAddressQuery address1() { - startField("address1"); + public Market(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); - return this; - } + break; + } - /** - * The second line of the address. Typically the number of the apartment, suite, or unit. - */ - public MailingAddressQuery address2() { - startField("address2"); + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - return this; - } + break; + } - /** - * The name of the city, district, village, or town. - */ - public MailingAddressQuery city() { - startField("city"); + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } - return this; - } + responseData.put(key, optional1); - /** - * The name of the customer's company or organization. - */ - public MailingAddressQuery company() { - startField("company"); + break; + } - return this; - } + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } - /** - * The name of the country. - */ - public MailingAddressQuery country() { - startField("country"); + list1.add(optional2); + } - return this; - } + responseData.put(key, list1); - /** - * The two-letter code for the country of the address. - * For example, US. - * - * @deprecated Use `countryCodeV2` instead. - */ - @Deprecated - public MailingAddressQuery countryCode() { - startField("countryCode"); + break; + } - return this; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - /** - * The two-letter code for the country of the address. - * For example, US. - */ - public MailingAddressQuery countryCodeV2() { - startField("countryCodeV2"); + public Market(ID id) { + this(); + optimisticData.put("id", id); + } - return this; + public String getGraphQlTypeName() { + return "Market"; } /** - * The first name of the customer. + * A human-readable unique string for the market automatically generated from its title. */ - public MailingAddressQuery firstName() { - startField("firstName"); - - return this; - } - - public class FormattedArguments extends Arguments { - FormattedArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Whether to include the customer's name in the formatted address. - */ - public FormattedArguments withName(Boolean value) { - if (value != null) { - startArgument("withName"); - _queryBuilder.append(value); - } - return this; - } - /** - * Whether to include the customer's company in the formatted address. - */ - public FormattedArguments withCompany(Boolean value) { - if (value != null) { - startArgument("withCompany"); - _queryBuilder.append(value); - } - return this; - } + public String getHandle() { + return (String) get("handle"); } - public interface FormattedArgumentsDefinition { - void define(FormattedArguments args); + public Market setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); + return this; } /** - * A formatted version of the address, customized by the provided arguments. + * A globally-unique ID. */ - public MailingAddressQuery formatted() { - return formatted(args -> {}); + + public ID getId() { + return (ID) get("id"); } /** - * A formatted version of the address, customized by the provided arguments. + * Returns a metafield found by namespace and key. */ - public MailingAddressQuery formatted(FormattedArgumentsDefinition argsDef) { - startField("formatted"); - FormattedArguments args = new FormattedArguments(_queryBuilder); - argsDef.define(args); - FormattedArguments.end(args); + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } + public Market setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); return this; } /** - * A comma-separated list of the values for city, province, and country. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public MailingAddressQuery formattedArea() { - startField("formattedArea"); - return this; + public List getMetafields() { + return (List) get("metafields"); } - /** - * The last name of the customer. - */ - public MailingAddressQuery lastName() { - startField("lastName"); - + public Market setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); return this; } - /** - * The latitude coordinate of the customer address. - */ - public MailingAddressQuery latitude() { - startField("latitude"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "handle": return false; - return this; + case "id": return false; + + case "metafield": return true; + + case "metafields": return true; + + default: return false; + } } + } - /** - * The longitude coordinate of the customer address. - */ - public MailingAddressQuery longitude() { - startField("longitude"); + public interface MediaQueryDefinition { + void define(MediaQuery _queryBuilder); + } - return this; + /** + * Represents a media interface. + */ + public static class MediaQuery extends Query { + MediaQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("__typename"); } /** - * The full name of the customer, based on firstName and lastName. + * A word or phrase to share the nature or contents of a media. */ - public MailingAddressQuery name() { - startField("name"); + public MediaQuery alt() { + startField("alt"); return this; } /** - * A unique phone number for the customer. - * Formatted using E.164 standard. For example, _+16135551111_. + * A globally-unique ID. */ - public MailingAddressQuery phone() { - startField("phone"); + public MediaQuery id() { + startField("id"); return this; } /** - * The region of the address, such as the province, state, or district. + * The media content type. */ - public MailingAddressQuery province() { - startField("province"); + public MediaQuery mediaContentType() { + startField("mediaContentType"); return this; } /** - * The two-letter code for the region. - * For example, ON. + * The presentation for a media. */ - public MailingAddressQuery provinceCode() { - startField("provinceCode"); + public MediaQuery presentation(MediaPresentationQueryDefinition queryDef) { + startField("presentation"); + + _queryBuilder.append('{'); + queryDef.define(new MediaPresentationQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The zip or postal code of the address. + * The preview image for the media. */ - public MailingAddressQuery zip() { - startField("zip"); + public MediaQuery previewImage(ImageQueryDefinition queryDef) { + startField("previewImage"); + + _queryBuilder.append('{'); + queryDef.define(new ImageQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - } - /** - * Represents a mailing address for customers and shipping. - */ - public static class MailingAddress extends AbstractResponse implements DeliveryAddress, Node { - public MailingAddress() { + public MediaQuery onExternalVideo(ExternalVideoQueryDefinition queryDef) { + startInlineFragment("ExternalVideo"); + queryDef.define(new ExternalVideoQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public MailingAddress(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "address1": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "address2": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "city": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "company": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "country": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "countryCode": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } + public MediaQuery onMediaImage(MediaImageQueryDefinition queryDef) { + startInlineFragment("MediaImage"); + queryDef.define(new MediaImageQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case "countryCodeV2": { - CountryCode optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = CountryCode.fromGraphQl(jsonAsString(field.getValue(), key)); - } + public MediaQuery onModel3d(Model3dQueryDefinition queryDef) { + startInlineFragment("Model3d"); + queryDef.define(new Model3dQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - responseData.put(key, optional1); + public MediaQuery onVideo(VideoQueryDefinition queryDef) { + startInlineFragment("Video"); + queryDef.define(new VideoQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + } - break; - } + public interface Media { + String getGraphQlTypeName(); - case "firstName": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + String getAlt(); - responseData.put(key, optional1); + ID getId(); - break; - } + MediaContentType getMediaContentType(); - case "formatted": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } + MediaPresentation getPresentation(); - responseData.put(key, list1); + Image getPreviewImage(); + } - break; - } + /** + * Represents a media interface. + */ + public static class UnknownMedia extends AbstractResponse implements Media { + public UnknownMedia() { + } - case "formattedArea": { + public UnknownMedia(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "alt": { String optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = jsonAsString(field.getValue(), key); @@ -43014,76 +38676,16 @@ public MailingAddress(JsonObject fields) throws SchemaViolationError { break; } - case "lastName": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "latitude": { - Double optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsDouble(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "longitude": { - Double optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsDouble(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "name": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "phone": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "province": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "mediaContentType": { + responseData.put(key, MediaContentType.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "provinceCode": { - String optional1 = null; + case "presentation": { + MediaPresentation optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new MediaPresentation(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -43091,10 +38693,10 @@ public MailingAddress(JsonObject fields) throws SchemaViolationError { break; } - case "zip": { - String optional1 = null; + case "previewImage": { + Image optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new Image(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -43113,354 +38715,583 @@ public MailingAddress(JsonObject fields) throws SchemaViolationError { } } - public MailingAddress(ID id) { - this(); - optimisticData.put("id", id); + public static Media create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "ExternalVideo": { + return new ExternalVideo(fields); + } + + case "MediaImage": { + return new MediaImage(fields); + } + + case "Model3d": { + return new Model3d(fields); + } + + case "Video": { + return new Video(fields); + } + + default: { + return new UnknownMedia(fields); + } + } } public String getGraphQlTypeName() { - return "MailingAddress"; + return (String) get("__typename"); } /** - * The first line of the address. Typically the street address or PO Box number. + * A word or phrase to share the nature or contents of a media. */ - public String getAddress1() { - return (String) get("address1"); + public String getAlt() { + return (String) get("alt"); } - public MailingAddress setAddress1(String arg) { - optimisticData.put(getKey("address1"), arg); + public UnknownMedia setAlt(String arg) { + optimisticData.put(getKey("alt"), arg); return this; } /** - * The second line of the address. Typically the number of the apartment, suite, or unit. + * A globally-unique ID. */ - public String getAddress2() { - return (String) get("address2"); + public ID getId() { + return (ID) get("id"); } - public MailingAddress setAddress2(String arg) { - optimisticData.put(getKey("address2"), arg); + public UnknownMedia setId(ID arg) { + optimisticData.put(getKey("id"), arg); return this; } /** - * The name of the city, district, village, or town. + * The media content type. */ - public String getCity() { - return (String) get("city"); + public MediaContentType getMediaContentType() { + return (MediaContentType) get("mediaContentType"); } - public MailingAddress setCity(String arg) { - optimisticData.put(getKey("city"), arg); + public UnknownMedia setMediaContentType(MediaContentType arg) { + optimisticData.put(getKey("mediaContentType"), arg); return this; } /** - * The name of the customer's company or organization. + * The presentation for a media. */ - public String getCompany() { - return (String) get("company"); + public MediaPresentation getPresentation() { + return (MediaPresentation) get("presentation"); } - public MailingAddress setCompany(String arg) { - optimisticData.put(getKey("company"), arg); + public UnknownMedia setPresentation(MediaPresentation arg) { + optimisticData.put(getKey("presentation"), arg); return this; } /** - * The name of the country. + * The preview image for the media. */ - public String getCountry() { - return (String) get("country"); + public Image getPreviewImage() { + return (Image) get("previewImage"); } - public MailingAddress setCountry(String arg) { - optimisticData.put(getKey("country"), arg); + public UnknownMedia setPreviewImage(Image arg) { + optimisticData.put(getKey("previewImage"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "alt": return false; + + case "id": return false; + + case "mediaContentType": return false; + + case "presentation": return true; + + case "previewImage": return true; + + default: return false; + } + } + } + + public interface MediaConnectionQueryDefinition { + void define(MediaConnectionQuery _queryBuilder); + } + + /** + * An auto-generated type for paginating through multiple Media. + */ + public static class MediaConnectionQuery extends Query { + MediaConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + /** - * The two-letter code for the country of the address. - * For example, US. - * - * @deprecated Use `countryCodeV2` instead. + * A list of edges. */ + public MediaConnectionQuery edges(MediaEdgeQueryDefinition queryDef) { + startField("edges"); - public String getCountryCode() { - return (String) get("countryCode"); - } + _queryBuilder.append('{'); + queryDef.define(new MediaEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); - public MailingAddress setCountryCode(String arg) { - optimisticData.put(getKey("countryCode"), arg); return this; } /** - * The two-letter code for the country of the address. - * For example, US. + * A list of the nodes contained in MediaEdge. */ + public MediaConnectionQuery nodes(MediaQueryDefinition queryDef) { + startField("nodes"); - public CountryCode getCountryCodeV2() { - return (CountryCode) get("countryCodeV2"); + _queryBuilder.append('{'); + queryDef.define(new MediaQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } - public MailingAddress setCountryCodeV2(CountryCode arg) { - optimisticData.put(getKey("countryCodeV2"), arg); + /** + * Information to aid in pagination. + */ + public MediaConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); + + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } + } + + /** + * An auto-generated type for paginating through multiple Media. + */ + public static class MediaConnection extends AbstractResponse { + public MediaConnection() { + } + + public MediaConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new MediaEdge(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(UnknownMedia.create(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "MediaConnection"; + } /** - * The first name of the customer. + * A list of edges. */ - public String getFirstName() { - return (String) get("firstName"); + public List getEdges() { + return (List) get("edges"); } - public MailingAddress setFirstName(String arg) { - optimisticData.put(getKey("firstName"), arg); + public MediaConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * A formatted version of the address, customized by the provided arguments. + * A list of the nodes contained in MediaEdge. */ - public List getFormatted() { - return (List) get("formatted"); + public List getNodes() { + return (List) get("nodes"); } - public MailingAddress setFormatted(List arg) { - optimisticData.put(getKey("formatted"), arg); + public MediaConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * A comma-separated list of the values for city, province, and country. + * Information to aid in pagination. */ - public String getFormattedArea() { - return (String) get("formattedArea"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public MailingAddress setFormattedArea(String arg) { - optimisticData.put(getKey("formattedArea"), arg); + public MediaConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } - /** - * A globally-unique ID. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - public ID getId() { - return (ID) get("id"); + case "nodes": return false; + + case "pageInfo": return true; + + default: return false; + } } + } + /** + * The possible content types for a media object. + */ + public enum MediaContentType { /** - * The last name of the customer. + * An externally hosted video. */ + EXTERNAL_VIDEO, - public String getLastName() { - return (String) get("lastName"); - } + /** + * A Shopify hosted image. + */ + IMAGE, - public MailingAddress setLastName(String arg) { - optimisticData.put(getKey("lastName"), arg); - return this; - } + /** + * A 3d model. + */ + MODEL_3D, /** - * The latitude coordinate of the customer address. + * A Shopify hosted video. */ + VIDEO, - public Double getLatitude() { - return (Double) get("latitude"); - } + UNKNOWN_VALUE; - public MailingAddress setLatitude(Double arg) { - optimisticData.put(getKey("latitude"), arg); - return this; + public static MediaContentType fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "EXTERNAL_VIDEO": { + return EXTERNAL_VIDEO; + } + + case "IMAGE": { + return IMAGE; + } + + case "MODEL_3D": { + return MODEL_3D; + } + + case "VIDEO": { + return VIDEO; + } + + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case EXTERNAL_VIDEO: { + return "EXTERNAL_VIDEO"; + } - /** - * The longitude coordinate of the customer address. - */ + case IMAGE: { + return "IMAGE"; + } - public Double getLongitude() { - return (Double) get("longitude"); + case MODEL_3D: { + return "MODEL_3D"; + } + + case VIDEO: { + return "VIDEO"; + } + + default: { + return ""; + } + } } + } - public MailingAddress setLongitude(Double arg) { - optimisticData.put(getKey("longitude"), arg); - return this; + public interface MediaEdgeQueryDefinition { + void define(MediaEdgeQuery _queryBuilder); + } + + /** + * An auto-generated type which holds one Media and a cursor during pagination. + */ + public static class MediaEdgeQuery extends Query { + MediaEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The full name of the customer, based on firstName and lastName. + * A cursor for use in pagination. */ + public MediaEdgeQuery cursor() { + startField("cursor"); - public String getName() { - return (String) get("name"); - } - - public MailingAddress setName(String arg) { - optimisticData.put(getKey("name"), arg); return this; } /** - * A unique phone number for the customer. - * Formatted using E.164 standard. For example, _+16135551111_. + * The item at the end of MediaEdge. */ + public MediaEdgeQuery node(MediaQueryDefinition queryDef) { + startField("node"); - public String getPhone() { - return (String) get("phone"); - } + _queryBuilder.append('{'); + queryDef.define(new MediaQuery(_queryBuilder)); + _queryBuilder.append('}'); - public MailingAddress setPhone(String arg) { - optimisticData.put(getKey("phone"), arg); return this; } + } - /** - * The region of the address, such as the province, state, or district. - */ + /** + * An auto-generated type which holds one Media and a cursor during pagination. + */ + public static class MediaEdge extends AbstractResponse { + public MediaEdge() { + } - public String getProvince() { - return (String) get("province"); + public MediaEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "node": { + responseData.put(key, UnknownMedia.create(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public MailingAddress setProvince(String arg) { - optimisticData.put(getKey("province"), arg); - return this; + public String getGraphQlTypeName() { + return "MediaEdge"; } /** - * The two-letter code for the region. - * For example, ON. + * A cursor for use in pagination. */ - public String getProvinceCode() { - return (String) get("provinceCode"); + public String getCursor() { + return (String) get("cursor"); } - public MailingAddress setProvinceCode(String arg) { - optimisticData.put(getKey("provinceCode"), arg); + public MediaEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * The zip or postal code of the address. + * The item at the end of MediaEdge. */ - public String getZip() { - return (String) get("zip"); + public Media getNode() { + return (Media) get("node"); } - public MailingAddress setZip(String arg) { - optimisticData.put(getKey("zip"), arg); + public MediaEdge setNode(Media arg) { + optimisticData.put(getKey("node"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "address1": return false; - - case "address2": return false; - - case "city": return false; - - case "company": return false; - - case "country": return false; - - case "countryCode": return false; - - case "countryCodeV2": return false; - - case "firstName": return false; - - case "formatted": return false; + case "cursor": return false; - case "formattedArea": return false; + case "node": return false; - case "id": return false; + default: return false; + } + } + } - case "lastName": return false; + /** + * Host for a Media Resource. + */ + public enum MediaHost { + /** + * Host for Vimeo embedded videos. + */ + VIMEO, - case "latitude": return false; + /** + * Host for YouTube embedded videos. + */ + YOUTUBE, - case "longitude": return false; + UNKNOWN_VALUE; - case "name": return false; + public static MediaHost fromGraphQl(String value) { + if (value == null) { + return null; + } - case "phone": return false; + switch (value) { + case "VIMEO": { + return VIMEO; + } - case "province": return false; + case "YOUTUBE": { + return YOUTUBE; + } - case "provinceCode": return false; + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case VIMEO: { + return "VIMEO"; + } - case "zip": return false; + case YOUTUBE: { + return "YOUTUBE"; + } - default: return false; + default: { + return ""; + } } } } - public interface MailingAddressConnectionQueryDefinition { - void define(MailingAddressConnectionQuery _queryBuilder); + public interface MediaImageQueryDefinition { + void define(MediaImageQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple MailingAddresses. + * Represents a Shopify hosted image. */ - public static class MailingAddressConnectionQuery extends Query { - MailingAddressConnectionQuery(StringBuilder _queryBuilder) { + public static class MediaImageQuery extends Query { + MediaImageQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * A list of edges. + * A word or phrase to share the nature or contents of a media. */ - public MailingAddressConnectionQuery edges(MailingAddressEdgeQueryDefinition queryDef) { - startField("edges"); + public MediaImageQuery alt() { + startField("alt"); + + return this; + } + + /** + * The image for the media. + */ + public MediaImageQuery image(ImageQueryDefinition queryDef) { + startField("image"); _queryBuilder.append('{'); - queryDef.define(new MailingAddressEdgeQuery(_queryBuilder)); + queryDef.define(new ImageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in MailingAddressEdge. + * The media content type. */ - public MailingAddressConnectionQuery nodes(MailingAddressQueryDefinition queryDef) { - startField("nodes"); + public MediaImageQuery mediaContentType() { + startField("mediaContentType"); + + return this; + } + + /** + * The presentation for a media. + */ + public MediaImageQuery presentation(MediaPresentationQueryDefinition queryDef) { + startField("presentation"); _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); + queryDef.define(new MediaPresentationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Information to aid in pagination. + * The preview image for the media. */ - public MailingAddressConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + public MediaImageQuery previewImage(ImageQueryDefinition queryDef) { + startField("previewImage"); _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); + queryDef.define(new ImageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -43468,41 +39299,69 @@ public MailingAddressConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) } /** - * An auto-generated type for paginating through multiple MailingAddresses. + * Represents a Shopify hosted image. */ - public static class MailingAddressConnection extends AbstractResponse { - public MailingAddressConnection() { + public static class MediaImage extends AbstractResponse implements Media, MetafieldReference, Node { + public MediaImage() { } - public MailingAddressConnection(JsonObject fields) throws SchemaViolationError { + public MediaImage(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new MailingAddressEdge(jsonAsObject(element1, key))); + case "alt": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new MailingAddress(jsonAsObject(element1, key))); + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "image": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "mediaContentType": { + responseData.put(key, MediaContentType.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "presentation": { + MediaPresentation optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MediaPresentation(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "previewImage": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } @@ -43518,117 +39377,161 @@ public MailingAddressConnection(JsonObject fields) throws SchemaViolationError { } } + public MediaImage(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "MailingAddressConnection"; + return "MediaImage"; } /** - * A list of edges. + * A word or phrase to share the nature or contents of a media. */ - public List getEdges() { - return (List) get("edges"); + public String getAlt() { + return (String) get("alt"); } - public MailingAddressConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); + public MediaImage setAlt(String arg) { + optimisticData.put(getKey("alt"), arg); return this; } /** - * A list of the nodes contained in MailingAddressEdge. + * A globally-unique ID. */ - public List getNodes() { - return (List) get("nodes"); + public ID getId() { + return (ID) get("id"); } - public MailingAddressConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + /** + * The image for the media. + */ + + public Image getImage() { + return (Image) get("image"); + } + + public MediaImage setImage(Image arg) { + optimisticData.put(getKey("image"), arg); return this; } /** - * Information to aid in pagination. + * The media content type. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public MediaContentType getMediaContentType() { + return (MediaContentType) get("mediaContentType"); } - public MailingAddressConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public MediaImage setMediaContentType(MediaContentType arg) { + optimisticData.put(getKey("mediaContentType"), arg); + return this; + } + + /** + * The presentation for a media. + */ + + public MediaPresentation getPresentation() { + return (MediaPresentation) get("presentation"); + } + + public MediaImage setPresentation(MediaPresentation arg) { + optimisticData.put(getKey("presentation"), arg); + return this; + } + + /** + * The preview image for the media. + */ + + public Image getPreviewImage() { + return (Image) get("previewImage"); + } + + public MediaImage setPreviewImage(Image arg) { + optimisticData.put(getKey("previewImage"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "edges": return true; + case "alt": return false; - case "nodes": return true; + case "id": return false; - case "pageInfo": return true; + case "image": return true; + + case "mediaContentType": return false; + + case "presentation": return true; + + case "previewImage": return true; default: return false; } } } - public interface MailingAddressEdgeQueryDefinition { - void define(MailingAddressEdgeQuery _queryBuilder); + public interface MediaPresentationQueryDefinition { + void define(MediaPresentationQuery _queryBuilder); } /** - * An auto-generated type which holds one MailingAddress and a cursor during pagination. + * A media presentation. */ - public static class MailingAddressEdgeQuery extends Query { - MailingAddressEdgeQuery(StringBuilder _queryBuilder) { + public static class MediaPresentationQuery extends Query { + MediaPresentationQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - } - - /** - * A cursor for use in pagination. - */ - public MailingAddressEdgeQuery cursor() { - startField("cursor"); - return this; + startField("id"); } /** - * The item at the end of MailingAddressEdge. + * A JSON object representing a presentation view. */ - public MailingAddressEdgeQuery node(MailingAddressQueryDefinition queryDef) { - startField("node"); + public MediaPresentationQuery asJson(MediaPresentationFormat format) { + startField("asJson"); - _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); + _queryBuilder.append("(format:"); + _queryBuilder.append(format.toString()); + + _queryBuilder.append(')'); return this; } } /** - * An auto-generated type which holds one MailingAddress and a cursor during pagination. + * A media presentation. */ - public static class MailingAddressEdge extends AbstractResponse { - public MailingAddressEdge() { + public static class MediaPresentation extends AbstractResponse implements Node { + public MediaPresentation() { } - public MailingAddressEdge(JsonObject fields) throws SchemaViolationError { + public MediaPresentation(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "asJson": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "node": { - responseData.put(key, new MailingAddress(jsonAsObject(field.getValue(), key))); + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); break; } @@ -43644,489 +39547,421 @@ public MailingAddressEdge(JsonObject fields) throws SchemaViolationError { } } + public MediaPresentation(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "MailingAddressEdge"; + return "MediaPresentation"; } /** - * A cursor for use in pagination. + * A JSON object representing a presentation view. */ - public String getCursor() { - return (String) get("cursor"); + public String getAsJson() { + return (String) get("asJson"); } - public MailingAddressEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public MediaPresentation setAsJson(String arg) { + optimisticData.put(getKey("asJson"), arg); return this; } /** - * The item at the end of MailingAddressEdge. + * A globally-unique ID. */ - public MailingAddress getNode() { - return (MailingAddress) get("node"); - } - - public MailingAddressEdge setNode(MailingAddress arg) { - optimisticData.put(getKey("node"), arg); - return this; + public ID getId() { + return (ID) get("id"); } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cursor": return false; + case "asJson": return false; - case "node": return true; + case "id": return false; default: return false; } } } - public static class MailingAddressInput implements Serializable { - private Input address1 = Input.undefined(); + /** + * The possible formats for a media presentation. + */ + public enum MediaPresentationFormat { + /** + * A media image presentation. + */ + IMAGE, - private Input address2 = Input.undefined(); + /** + * A model viewer presentation. + */ + MODEL_VIEWER, - private Input city = Input.undefined(); + UNKNOWN_VALUE; - private Input company = Input.undefined(); + public static MediaPresentationFormat fromGraphQl(String value) { + if (value == null) { + return null; + } - private Input country = Input.undefined(); + switch (value) { + case "IMAGE": { + return IMAGE; + } - private Input firstName = Input.undefined(); + case "MODEL_VIEWER": { + return MODEL_VIEWER; + } - private Input lastName = Input.undefined(); + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case IMAGE: { + return "IMAGE"; + } - private Input phone = Input.undefined(); + case MODEL_VIEWER: { + return "MODEL_VIEWER"; + } - private Input province = Input.undefined(); + default: { + return ""; + } + } + } + } - private Input zip = Input.undefined(); + public interface MenuQueryDefinition { + void define(MenuQuery _queryBuilder); + } - public String getAddress1() { - return address1.getValue(); - } + /** + * A [navigation menu](https://help.shopify.com/manual/online-store/menus-and-links) representing a + * hierarchy + * of hyperlinks (items). + */ + public static class MenuQuery extends Query { + MenuQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - public Input getAddress1Input() { - return address1; + startField("id"); } - public MailingAddressInput setAddress1(String address1) { - this.address1 = Input.optional(address1); - return this; - } + /** + * The menu's handle. + */ + public MenuQuery handle() { + startField("handle"); - public MailingAddressInput setAddress1Input(Input address1) { - if (address1 == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.address1 = address1; return this; } - public String getAddress2() { - return address2.getValue(); - } + /** + * The menu's child items. + */ + public MenuQuery items(MenuItemQueryDefinition queryDef) { + startField("items"); - public Input getAddress2Input() { - return address2; - } + _queryBuilder.append('{'); + queryDef.define(new MenuItemQuery(_queryBuilder)); + _queryBuilder.append('}'); - public MailingAddressInput setAddress2(String address2) { - this.address2 = Input.optional(address2); return this; } - public MailingAddressInput setAddress2Input(Input address2) { - if (address2 == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.address2 = address2; - return this; - } + /** + * The count of items on the menu. + */ + public MenuQuery itemsCount() { + startField("itemsCount"); - public String getCity() { - return city.getValue(); + return this; } - public Input getCityInput() { - return city; - } + /** + * The menu's title. + */ + public MenuQuery title() { + startField("title"); - public MailingAddressInput setCity(String city) { - this.city = Input.optional(city); return this; } + } - public MailingAddressInput setCityInput(Input city) { - if (city == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.city = city; - return this; + /** + * A [navigation menu](https://help.shopify.com/manual/online-store/menus-and-links) representing a + * hierarchy + * of hyperlinks (items). + */ + public static class Menu extends AbstractResponse implements Node { + public Menu() { } - public String getCompany() { - return company.getValue(); - } + public Menu(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); - public Input getCompanyInput() { - return company; - } + break; + } - public MailingAddressInput setCompany(String company) { - this.company = Input.optional(company); - return this; - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - public MailingAddressInput setCompanyInput(Input company) { - if (company == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.company = company; - return this; - } + break; + } - public String getCountry() { - return country.getValue(); - } + case "items": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new MenuItem(jsonAsObject(element1, key))); + } - public Input getCountryInput() { - return country; - } + responseData.put(key, list1); - public MailingAddressInput setCountry(String country) { - this.country = Input.optional(country); - return this; - } + break; + } - public MailingAddressInput setCountryInput(Input country) { - if (country == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.country = country; - return this; - } + case "itemsCount": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); - public String getFirstName() { - return firstName.getValue(); - } + break; + } - public Input getFirstNameInput() { - return firstName; - } + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); - public MailingAddressInput setFirstName(String firstName) { - this.firstName = Input.optional(firstName); - return this; - } + break; + } - public MailingAddressInput setFirstNameInput(Input firstName) { - if (firstName == null) { - throw new IllegalArgumentException("Input can not be null"); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } } - this.firstName = firstName; - return this; } - public String getLastName() { - return lastName.getValue(); + public Menu(ID id) { + this(); + optimisticData.put("id", id); } - public Input getLastNameInput() { - return lastName; + public String getGraphQlTypeName() { + return "Menu"; } - public MailingAddressInput setLastName(String lastName) { - this.lastName = Input.optional(lastName); - return this; + /** + * The menu's handle. + */ + + public String getHandle() { + return (String) get("handle"); } - public MailingAddressInput setLastNameInput(Input lastName) { - if (lastName == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.lastName = lastName; + public Menu setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); return this; } - public String getPhone() { - return phone.getValue(); - } + /** + * A globally-unique ID. + */ - public Input getPhoneInput() { - return phone; + public ID getId() { + return (ID) get("id"); } - public MailingAddressInput setPhone(String phone) { - this.phone = Input.optional(phone); - return this; - } + /** + * The menu's child items. + */ - public MailingAddressInput setPhoneInput(Input phone) { - if (phone == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.phone = phone; - return this; + public List getItems() { + return (List) get("items"); } - public String getProvince() { - return province.getValue(); + public Menu setItems(List arg) { + optimisticData.put(getKey("items"), arg); + return this; } - public Input getProvinceInput() { - return province; - } + /** + * The count of items on the menu. + */ - public MailingAddressInput setProvince(String province) { - this.province = Input.optional(province); - return this; + public Integer getItemsCount() { + return (Integer) get("itemsCount"); } - public MailingAddressInput setProvinceInput(Input province) { - if (province == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.province = province; + public Menu setItemsCount(Integer arg) { + optimisticData.put(getKey("itemsCount"), arg); return this; } - public String getZip() { - return zip.getValue(); - } - - public Input getZipInput() { - return zip; - } + /** + * The menu's title. + */ - public MailingAddressInput setZip(String zip) { - this.zip = Input.optional(zip); - return this; + public String getTitle() { + return (String) get("title"); } - public MailingAddressInput setZipInput(Input zip) { - if (zip == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.zip = zip; + public Menu setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - if (this.address1.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("address1:"); - if (address1.getValue() != null) { - Query.appendQuotedString(_queryBuilder, address1.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.address2.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("address2:"); - if (address2.getValue() != null) { - Query.appendQuotedString(_queryBuilder, address2.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.city.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("city:"); - if (city.getValue() != null) { - Query.appendQuotedString(_queryBuilder, city.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.company.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("company:"); - if (company.getValue() != null) { - Query.appendQuotedString(_queryBuilder, company.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.country.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("country:"); - if (country.getValue() != null) { - Query.appendQuotedString(_queryBuilder, country.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.firstName.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("firstName:"); - if (firstName.getValue() != null) { - Query.appendQuotedString(_queryBuilder, firstName.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.lastName.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("lastName:"); - if (lastName.getValue() != null) { - Query.appendQuotedString(_queryBuilder, lastName.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.phone.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("phone:"); - if (phone.getValue() != null) { - Query.appendQuotedString(_queryBuilder, phone.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.province.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("province:"); - if (province.getValue() != null) { - Query.appendQuotedString(_queryBuilder, province.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "handle": return false; - if (this.zip.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("zip:"); - if (zip.getValue() != null) { - Query.appendQuotedString(_queryBuilder, zip.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + case "id": return false; - _queryBuilder.append('}'); + case "items": return true; + + case "itemsCount": return false; + + case "title": return false; + + default: return false; + } } } - public interface ManualDiscountApplicationQueryDefinition { - void define(ManualDiscountApplicationQuery _queryBuilder); + public interface MenuItemQueryDefinition { + void define(MenuItemQuery _queryBuilder); } /** - * Manual discount applications capture the intentions of a discount that was manually created. + * A menu item within a parent menu. */ - public static class ManualDiscountApplicationQuery extends Query { - ManualDiscountApplicationQuery(StringBuilder _queryBuilder) { + public static class MenuItemQuery extends Query { + MenuItemQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * The method by which the discount's value is allocated to its entitled items. + * The menu item's child items. */ - public ManualDiscountApplicationQuery allocationMethod() { - startField("allocationMethod"); + public MenuItemQuery items(MenuItemQueryDefinition queryDef) { + startField("items"); + + _queryBuilder.append('{'); + queryDef.define(new MenuItemQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The description of the application. + * The linked resource. */ - public ManualDiscountApplicationQuery description() { - startField("description"); + public MenuItemQuery resource(MenuItemResourceQueryDefinition queryDef) { + startField("resource"); + + _queryBuilder.append('{'); + queryDef.define(new MenuItemResourceQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * Which lines of targetType that the discount is allocated over. + * The ID of the linked resource. */ - public ManualDiscountApplicationQuery targetSelection() { - startField("targetSelection"); + public MenuItemQuery resourceId() { + startField("resourceId"); return this; } /** - * The type of line that the discount is applicable towards. + * The menu item's tags to filter a collection. */ - public ManualDiscountApplicationQuery targetType() { - startField("targetType"); + public MenuItemQuery tags() { + startField("tags"); return this; } /** - * The title of the application. + * The menu item's title. */ - public ManualDiscountApplicationQuery title() { + public MenuItemQuery title() { startField("title"); return this; } /** - * The value of the discount application. + * The menu item's type. */ - public ManualDiscountApplicationQuery value(PricingValueQueryDefinition queryDef) { - startField("value"); + public MenuItemQuery type() { + startField("type"); - _queryBuilder.append('{'); - queryDef.define(new PricingValueQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * The menu item's URL. + */ + public MenuItemQuery url() { + startField("url"); return this; } } /** - * Manual discount applications capture the intentions of a discount that was manually created. + * A menu item within a parent menu. */ - public static class ManualDiscountApplication extends AbstractResponse implements DiscountApplication { - public ManualDiscountApplication() { + public static class MenuItem extends AbstractResponse implements Node { + public MenuItem() { } - public ManualDiscountApplication(JsonObject fields) throws SchemaViolationError { + public MenuItem(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "allocationMethod": { - responseData.put(key, DiscountApplicationAllocationMethod.fromGraphQl(jsonAsString(field.getValue(), key))); + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); break; } - case "description": { - String optional1 = null; + case "items": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new MenuItem(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "resource": { + MenuItemResource optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = UnknownMenuItemResource.create(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -44134,14 +39969,24 @@ public ManualDiscountApplication(JsonObject fields) throws SchemaViolationError break; } - case "targetSelection": { - responseData.put(key, DiscountApplicationTargetSelection.fromGraphQl(jsonAsString(field.getValue(), key))); + case "resourceId": { + ID optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ID(jsonAsString(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "targetType": { - responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); + case "tags": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + responseData.put(key, list1); break; } @@ -44152,8 +39997,19 @@ public ManualDiscountApplication(JsonObject fields) throws SchemaViolationError break; } - case "value": { - responseData.put(key, UnknownPricingValue.create(jsonAsObject(field.getValue(), key))); + case "type": { + responseData.put(key, MenuItemType.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "url": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } @@ -44169,259 +40025,496 @@ public ManualDiscountApplication(JsonObject fields) throws SchemaViolationError } } + public MenuItem(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "ManualDiscountApplication"; + return "MenuItem"; } /** - * The method by which the discount's value is allocated to its entitled items. + * A globally-unique ID. */ - public DiscountApplicationAllocationMethod getAllocationMethod() { - return (DiscountApplicationAllocationMethod) get("allocationMethod"); + public ID getId() { + return (ID) get("id"); } - public ManualDiscountApplication setAllocationMethod(DiscountApplicationAllocationMethod arg) { - optimisticData.put(getKey("allocationMethod"), arg); + /** + * The menu item's child items. + */ + + public List getItems() { + return (List) get("items"); + } + + public MenuItem setItems(List arg) { + optimisticData.put(getKey("items"), arg); return this; } /** - * The description of the application. + * The linked resource. */ - public String getDescription() { - return (String) get("description"); + public MenuItemResource getResource() { + return (MenuItemResource) get("resource"); } - public ManualDiscountApplication setDescription(String arg) { - optimisticData.put(getKey("description"), arg); + public MenuItem setResource(MenuItemResource arg) { + optimisticData.put(getKey("resource"), arg); return this; } /** - * Which lines of targetType that the discount is allocated over. + * The ID of the linked resource. */ - public DiscountApplicationTargetSelection getTargetSelection() { - return (DiscountApplicationTargetSelection) get("targetSelection"); + public ID getResourceId() { + return (ID) get("resourceId"); } - public ManualDiscountApplication setTargetSelection(DiscountApplicationTargetSelection arg) { - optimisticData.put(getKey("targetSelection"), arg); + public MenuItem setResourceId(ID arg) { + optimisticData.put(getKey("resourceId"), arg); return this; } /** - * The type of line that the discount is applicable towards. + * The menu item's tags to filter a collection. */ - public DiscountApplicationTargetType getTargetType() { - return (DiscountApplicationTargetType) get("targetType"); + public List getTags() { + return (List) get("tags"); } - public ManualDiscountApplication setTargetType(DiscountApplicationTargetType arg) { - optimisticData.put(getKey("targetType"), arg); + public MenuItem setTags(List arg) { + optimisticData.put(getKey("tags"), arg); return this; } /** - * The title of the application. + * The menu item's title. */ public String getTitle() { return (String) get("title"); } - public ManualDiscountApplication setTitle(String arg) { + public MenuItem setTitle(String arg) { optimisticData.put(getKey("title"), arg); return this; } /** - * The value of the discount application. + * The menu item's type. */ - public PricingValue getValue() { - return (PricingValue) get("value"); + public MenuItemType getType() { + return (MenuItemType) get("type"); } - public ManualDiscountApplication setValue(PricingValue arg) { - optimisticData.put(getKey("value"), arg); + public MenuItem setType(MenuItemType arg) { + optimisticData.put(getKey("type"), arg); + return this; + } + + /** + * The menu item's URL. + */ + + public String getUrl() { + return (String) get("url"); + } + + public MenuItem setUrl(String arg) { + optimisticData.put(getKey("url"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "allocationMethod": return false; + case "id": return false; - case "description": return false; + case "items": return true; - case "targetSelection": return false; + case "resource": return false; - case "targetType": return false; + case "resourceId": return false; + + case "tags": return false; case "title": return false; - case "value": return false; + case "type": return false; + + case "url": return false; default: return false; } } } - public interface MarketQueryDefinition { - void define(MarketQuery _queryBuilder); + public interface MenuItemResourceQueryDefinition { + void define(MenuItemResourceQuery _queryBuilder); } /** - * A group of one or more regions of the world that a merchant is targeting for sales. To learn more - * about markets, refer to [the Shopify Markets conceptual overview](/docs/apps/markets). + * The list of possible resources a `MenuItem` can reference. */ - public static class MarketQuery extends Query { - MarketQuery(StringBuilder _queryBuilder) { + public static class MenuItemResourceQuery extends Query { + MenuItemResourceQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - startField("id"); + startField("__typename"); } - /** - * A human-readable unique string for the market automatically generated from its title. - */ - public MarketQuery handle() { - startField("handle"); + public MenuItemResourceQuery onArticle(ArticleQueryDefinition queryDef) { + startInlineFragment("Article"); + queryDef.define(new ArticleQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + public MenuItemResourceQuery onBlog(BlogQueryDefinition queryDef) { + startInlineFragment("Blog"); + queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - public class MetafieldArguments extends Arguments { - MetafieldArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); + public MenuItemResourceQuery onCollection(CollectionQueryDefinition queryDef) { + startInlineFragment("Collection"); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MenuItemResourceQuery onMetaobject(MetaobjectQueryDefinition queryDef) { + startInlineFragment("Metaobject"); + queryDef.define(new MetaobjectQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MenuItemResourceQuery onPage(PageQueryDefinition queryDef) { + startInlineFragment("Page"); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MenuItemResourceQuery onProduct(ProductQueryDefinition queryDef) { + startInlineFragment("Product"); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MenuItemResourceQuery onShopPolicy(ShopPolicyQueryDefinition queryDef) { + startInlineFragment("ShopPolicy"); + queryDef.define(new ShopPolicyQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + } + + public interface MenuItemResource { + String getGraphQlTypeName(); + } + + /** + * The list of possible resources a `MenuItem` can reference. + */ + public static class UnknownMenuItemResource extends AbstractResponse implements MenuItemResource { + public UnknownMenuItemResource() { + } + + public UnknownMenuItemResource(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } } + } - /** - * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. - */ - public MetafieldArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); + public static MenuItemResource create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "Article": { + return new Article(fields); + } + + case "Blog": { + return new Blog(fields); + } + + case "Collection": { + return new Collection(fields); + } + + case "Metaobject": { + return new Metaobject(fields); + } + + case "Page": { + return new Page(fields); + } + + case "Product": { + return new Product(fields); + } + + case "ShopPolicy": { + return new ShopPolicy(fields); + } + + default: { + return new UnknownMenuItemResource(fields); + } + } + } + + public String getGraphQlTypeName() { + return (String) get("__typename"); + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + default: return false; + } + } + } + + /** + * A menu item type. + */ + public enum MenuItemType { + /** + * An article link. + */ + ARTICLE, + + /** + * A blog link. + */ + BLOG, + + /** + * A catalog link. + */ + CATALOG, + + /** + * A collection link. + */ + COLLECTION, + + /** + * A collection link. + */ + COLLECTIONS, + + /** + * A frontpage link. + */ + FRONTPAGE, + + /** + * An http link. + */ + HTTP, + + /** + * A metaobject page link. + */ + METAOBJECT, + + /** + * A page link. + */ + PAGE, + + /** + * A product link. + */ + PRODUCT, + + /** + * A search link. + */ + SEARCH, + + /** + * A shop policy link. + */ + SHOP_POLICY, + + UNKNOWN_VALUE; + + public static MenuItemType fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "ARTICLE": { + return ARTICLE; + } + + case "BLOG": { + return BLOG; + } + + case "CATALOG": { + return CATALOG; + } + + case "COLLECTION": { + return COLLECTION; + } + + case "COLLECTIONS": { + return COLLECTIONS; + } + + case "FRONTPAGE": { + return FRONTPAGE; + } + + case "HTTP": { + return HTTP; + } + + case "METAOBJECT": { + return METAOBJECT; + } + + case "PAGE": { + return PAGE; + } + + case "PRODUCT": { + return PRODUCT; + } + + case "SEARCH": { + return SEARCH; + } + + case "SHOP_POLICY": { + return SHOP_POLICY; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case ARTICLE: { + return "ARTICLE"; + } + + case BLOG: { + return "BLOG"; } - return this; - } - } - public interface MetafieldArgumentsDefinition { - void define(MetafieldArguments args); - } + case CATALOG: { + return "CATALOG"; + } - /** - * Returns a metafield found by namespace and key. - */ - public MarketQuery metafield(String key, MetafieldQueryDefinition queryDef) { - return metafield(key, args -> {}, queryDef); - } + case COLLECTION: { + return "COLLECTION"; + } - /** - * Returns a metafield found by namespace and key. - */ - public MarketQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { - startField("metafield"); + case COLLECTIONS: { + return "COLLECTIONS"; + } - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + case FRONTPAGE: { + return "FRONTPAGE"; + } - argsDef.define(new MetafieldArguments(_queryBuilder)); + case HTTP: { + return "HTTP"; + } - _queryBuilder.append(')'); + case METAOBJECT: { + return "METAOBJECT"; + } - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + case PAGE: { + return "PAGE"; + } - return this; - } + case PRODUCT: { + return "PRODUCT"; + } - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ - public MarketQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); + case SEARCH: { + return "SEARCH"; + } - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); + case SHOP_POLICY: { + return "SHOP_POLICY"; + } + + default: { + return ""; } } - _queryBuilder.append(']'); + } + } - _queryBuilder.append(')'); + public interface MerchandiseQueryDefinition { + void define(MerchandiseQuery _queryBuilder); + } - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The merchandise to be purchased at checkout. + */ + public static class MerchandiseQuery extends Query { + MerchandiseQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + startField("__typename"); + } + + public MerchandiseQuery onProductVariant(ProductVariantQueryDefinition queryDef) { + startInlineFragment("ProductVariant"); + queryDef.define(new ProductVariantQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } + public interface Merchandise { + String getGraphQlTypeName(); + } + /** - * A group of one or more regions of the world that a merchant is targeting for sales. To learn more - * about markets, refer to [the Shopify Markets conceptual overview](/docs/apps/markets). + * The merchandise to be purchased at checkout. */ - public static class Market extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { - public Market() { + public static class UnknownMerchandise extends AbstractResponse implements Merchandise { + public UnknownMerchandise() { } - public Market(JsonObject fields) throws SchemaViolationError { + public UnknownMerchandise(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "handle": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - - break; - } - - case "metafield": { - Metafield optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "metafields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } - - list1.add(optional2); - } - - responseData.put(key, list1); - - break; - } - case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -44433,200 +40526,236 @@ public Market(JsonObject fields) throws SchemaViolationError { } } - public Market(ID id) { - this(); - optimisticData.put("id", id); - } - - public String getGraphQlTypeName() { - return "Market"; - } - - /** - * A human-readable unique string for the market automatically generated from its title. - */ - - public String getHandle() { - return (String) get("handle"); - } - - public Market setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); - return this; - } - - /** - * A globally-unique ID. - */ - - public ID getId() { - return (ID) get("id"); - } - - /** - * Returns a metafield found by namespace and key. - */ - - public Metafield getMetafield() { - return (Metafield) get("metafield"); - } - - public Market setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); - return this; - } - - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ + public static Merchandise create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "ProductVariant": { + return new ProductVariant(fields); + } - public List getMetafields() { - return (List) get("metafields"); + default: { + return new UnknownMerchandise(fields); + } + } } - public Market setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); - return this; + public String getGraphQlTypeName() { + return (String) get("__typename"); } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "handle": return false; - - case "id": return false; - - case "metafield": return true; - - case "metafields": return true; - default: return false; } } } - public interface MediaQueryDefinition { - void define(MediaQuery _queryBuilder); + public interface MetafieldQueryDefinition { + void define(MetafieldQuery _queryBuilder); } /** - * Represents a media interface. + * Metafields represent custom metadata attached to a resource. Metafields can be sorted into + * namespaces and are + * comprised of keys, values, and value types. */ - public static class MediaQuery extends Query { - MediaQuery(StringBuilder _queryBuilder) { + public static class MetafieldQuery extends Query { + MetafieldQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - startField("__typename"); + startField("id"); } /** - * A word or phrase to share the nature or contents of a media. + * The date and time when the storefront metafield was created. */ - public MediaQuery alt() { - startField("alt"); + public MetafieldQuery createdAt() { + startField("createdAt"); return this; } /** - * A globally-unique ID. + * The description of a metafield. */ - public MediaQuery id() { - startField("id"); + public MetafieldQuery description() { + startField("description"); return this; } /** - * The media content type. + * The unique identifier for the metafield within its namespace. */ - public MediaQuery mediaContentType() { - startField("mediaContentType"); + public MetafieldQuery key() { + startField("key"); return this; } /** - * The presentation for a media. + * The container for a group of metafields that the metafield is associated with. */ - public MediaQuery presentation(MediaPresentationQueryDefinition queryDef) { - startField("presentation"); + public MetafieldQuery namespace() { + startField("namespace"); + + return this; + } + + /** + * The type of resource that the metafield is attached to. + */ + public MetafieldQuery parentResource(MetafieldParentResourceQueryDefinition queryDef) { + startField("parentResource"); _queryBuilder.append('{'); - queryDef.define(new MediaPresentationQuery(_queryBuilder)); + queryDef.define(new MetafieldParentResourceQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The preview image for the media. + * Returns a reference object if the metafield's type is a resource reference. */ - public MediaQuery previewImage(ImageQueryDefinition queryDef) { - startField("previewImage"); + public MetafieldQuery reference(MetafieldReferenceQueryDefinition queryDef) { + startField("reference"); _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); + queryDef.define(new MetafieldReferenceQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - public MediaQuery onExternalVideo(ExternalVideoQueryDefinition queryDef) { - startInlineFragment("ExternalVideo"); - queryDef.define(new ExternalVideoQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public class ReferencesArguments extends Arguments { + ReferencesArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * Returns up to the first `n` elements from the list. + */ + public ReferencesArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come after the specified cursor. + */ + public ReferencesArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Returns up to the last `n` elements from the list. + */ + public ReferencesArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come before the specified cursor. + */ + public ReferencesArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } } - public MediaQuery onMediaImage(MediaImageQueryDefinition queryDef) { - startInlineFragment("MediaImage"); - queryDef.define(new MediaImageQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public interface ReferencesArgumentsDefinition { + void define(ReferencesArguments args); } - public MediaQuery onModel3d(Model3dQueryDefinition queryDef) { - startInlineFragment("Model3d"); - queryDef.define(new Model3dQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + /** + * A list of reference objects if the metafield's type is a resource reference list. + */ + public MetafieldQuery references(MetafieldReferenceConnectionQueryDefinition queryDef) { + return references(args -> {}, queryDef); } - public MediaQuery onVideo(VideoQueryDefinition queryDef) { - startInlineFragment("Video"); - queryDef.define(new VideoQuery(_queryBuilder)); + /** + * A list of reference objects if the metafield's type is a resource reference list. + */ + public MetafieldQuery references(ReferencesArgumentsDefinition argsDef, MetafieldReferenceConnectionQueryDefinition queryDef) { + startField("references"); + + ReferencesArguments args = new ReferencesArguments(_queryBuilder); + argsDef.define(args); + ReferencesArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldReferenceConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - } - public interface Media { - String getGraphQlTypeName(); + /** + * The type name of the metafield. + * Refer to the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). + */ + public MetafieldQuery type() { + startField("type"); - String getAlt(); + return this; + } - ID getId(); + /** + * The date and time when the metafield was last updated. + */ + public MetafieldQuery updatedAt() { + startField("updatedAt"); - MediaContentType getMediaContentType(); + return this; + } - MediaPresentation getPresentation(); + /** + * The data stored in the metafield. Always stored as a string, regardless of the metafield's type. + */ + public MetafieldQuery value() { + startField("value"); - Image getPreviewImage(); + return this; + } } /** - * Represents a media interface. + * Metafields represent custom metadata attached to a resource. Metafields can be sorted into + * namespaces and are + * comprised of keys, values, and value types. */ - public static class UnknownMedia extends AbstractResponse implements Media { - public UnknownMedia() { + public static class Metafield extends AbstractResponse implements Node { + public Metafield() { } - public UnknownMedia(JsonObject fields) throws SchemaViolationError { + public Metafield(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "alt": { + case "createdAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + + case "description": { String optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = jsonAsString(field.getValue(), key); @@ -44643,16 +40772,28 @@ public UnknownMedia(JsonObject fields) throws SchemaViolationError { break; } - case "mediaContentType": { - responseData.put(key, MediaContentType.fromGraphQl(jsonAsString(field.getValue(), key))); + case "key": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "presentation": { - MediaPresentation optional1 = null; + case "namespace": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "parentResource": { + responseData.put(key, UnknownMetafieldParentResource.create(jsonAsObject(field.getValue(), key))); + + break; + } + + case "reference": { + MetafieldReference optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MediaPresentation(jsonAsObject(field.getValue(), key)); + optional1 = UnknownMetafieldReference.create(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -44660,10 +40801,10 @@ public UnknownMedia(JsonObject fields) throws SchemaViolationError { break; } - case "previewImage": { - Image optional1 = null; + case "references": { + MetafieldReferenceConnection optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); + optional1 = new MetafieldReferenceConnection(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -44671,6 +40812,24 @@ public UnknownMedia(JsonObject fields) throws SchemaViolationError { break; } + case "type": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + + case "value": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -44682,205 +40841,316 @@ public UnknownMedia(JsonObject fields) throws SchemaViolationError { } } - public static Media create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "ExternalVideo": { - return new ExternalVideo(fields); - } + public Metafield(ID id) { + this(); + optimisticData.put("id", id); + } + + public String getGraphQlTypeName() { + return "Metafield"; + } + + /** + * The date and time when the storefront metafield was created. + */ + + public DateTime getCreatedAt() { + return (DateTime) get("createdAt"); + } + + public Metafield setCreatedAt(DateTime arg) { + optimisticData.put(getKey("createdAt"), arg); + return this; + } + + /** + * The description of a metafield. + */ + + public String getDescription() { + return (String) get("description"); + } + + public Metafield setDescription(String arg) { + optimisticData.put(getKey("description"), arg); + return this; + } + + /** + * A globally-unique ID. + */ + + public ID getId() { + return (ID) get("id"); + } + + /** + * The unique identifier for the metafield within its namespace. + */ + + public String getKey() { + return (String) get("key"); + } + + public Metafield setKey(String arg) { + optimisticData.put(getKey("key"), arg); + return this; + } - case "MediaImage": { - return new MediaImage(fields); - } + /** + * The container for a group of metafields that the metafield is associated with. + */ - case "Model3d": { - return new Model3d(fields); - } + public String getNamespace() { + return (String) get("namespace"); + } - case "Video": { - return new Video(fields); - } + public Metafield setNamespace(String arg) { + optimisticData.put(getKey("namespace"), arg); + return this; + } - default: { - return new UnknownMedia(fields); - } - } + /** + * The type of resource that the metafield is attached to. + */ + + public MetafieldParentResource getParentResource() { + return (MetafieldParentResource) get("parentResource"); } - public String getGraphQlTypeName() { - return (String) get("__typename"); + public Metafield setParentResource(MetafieldParentResource arg) { + optimisticData.put(getKey("parentResource"), arg); + return this; } /** - * A word or phrase to share the nature or contents of a media. + * Returns a reference object if the metafield's type is a resource reference. */ - public String getAlt() { - return (String) get("alt"); + public MetafieldReference getReference() { + return (MetafieldReference) get("reference"); } - public UnknownMedia setAlt(String arg) { - optimisticData.put(getKey("alt"), arg); + public Metafield setReference(MetafieldReference arg) { + optimisticData.put(getKey("reference"), arg); return this; } /** - * A globally-unique ID. + * A list of reference objects if the metafield's type is a resource reference list. */ - public ID getId() { - return (ID) get("id"); + public MetafieldReferenceConnection getReferences() { + return (MetafieldReferenceConnection) get("references"); } - public UnknownMedia setId(ID arg) { - optimisticData.put(getKey("id"), arg); + public Metafield setReferences(MetafieldReferenceConnection arg) { + optimisticData.put(getKey("references"), arg); return this; } /** - * The media content type. + * The type name of the metafield. + * Refer to the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). */ - public MediaContentType getMediaContentType() { - return (MediaContentType) get("mediaContentType"); + public String getType() { + return (String) get("type"); } - public UnknownMedia setMediaContentType(MediaContentType arg) { - optimisticData.put(getKey("mediaContentType"), arg); + public Metafield setType(String arg) { + optimisticData.put(getKey("type"), arg); return this; } /** - * The presentation for a media. + * The date and time when the metafield was last updated. */ - public MediaPresentation getPresentation() { - return (MediaPresentation) get("presentation"); + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); } - public UnknownMedia setPresentation(MediaPresentation arg) { - optimisticData.put(getKey("presentation"), arg); + public Metafield setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); return this; } /** - * The preview image for the media. + * The data stored in the metafield. Always stored as a string, regardless of the metafield's type. */ - public Image getPreviewImage() { - return (Image) get("previewImage"); + public String getValue() { + return (String) get("value"); } - public UnknownMedia setPreviewImage(Image arg) { - optimisticData.put(getKey("previewImage"), arg); + public Metafield setValue(String arg) { + optimisticData.put(getKey("value"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "alt": return false; + case "createdAt": return false; + + case "description": return false; case "id": return false; - case "mediaContentType": return false; + case "key": return false; - case "presentation": return true; + case "namespace": return false; - case "previewImage": return true; + case "parentResource": return false; + + case "reference": return false; + + case "references": return true; + + case "type": return false; + + case "updatedAt": return false; + + case "value": return false; default: return false; } } } - public interface MediaConnectionQueryDefinition { - void define(MediaConnectionQuery _queryBuilder); + /** + * Possible error codes that can be returned by `MetafieldDeleteUserError`. + */ + public enum MetafieldDeleteErrorCode { + /** + * The owner ID is invalid. + */ + INVALID_OWNER, + + /** + * Metafield not found. + */ + METAFIELD_DOES_NOT_EXIST, + + UNKNOWN_VALUE; + + public static MetafieldDeleteErrorCode fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "INVALID_OWNER": { + return INVALID_OWNER; + } + + case "METAFIELD_DOES_NOT_EXIST": { + return METAFIELD_DOES_NOT_EXIST; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case INVALID_OWNER: { + return "INVALID_OWNER"; + } + + case METAFIELD_DOES_NOT_EXIST: { + return "METAFIELD_DOES_NOT_EXIST"; + } + + default: { + return ""; + } + } + } + } + + public interface MetafieldDeleteUserErrorQueryDefinition { + void define(MetafieldDeleteUserErrorQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple Media. + * An error that occurs during the execution of cart metafield deletion. */ - public static class MediaConnectionQuery extends Query { - MediaConnectionQuery(StringBuilder _queryBuilder) { + public static class MetafieldDeleteUserErrorQuery extends Query { + MetafieldDeleteUserErrorQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A list of edges. + * The error code. */ - public MediaConnectionQuery edges(MediaEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new MediaEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MetafieldDeleteUserErrorQuery code() { + startField("code"); return this; } /** - * A list of the nodes contained in MediaEdge. + * The path to the input field that caused the error. */ - public MediaConnectionQuery nodes(MediaQueryDefinition queryDef) { - startField("nodes"); - - _queryBuilder.append('{'); - queryDef.define(new MediaQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MetafieldDeleteUserErrorQuery field() { + startField("field"); return this; } /** - * Information to aid in pagination. + * The error message. */ - public MediaConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MetafieldDeleteUserErrorQuery message() { + startField("message"); return this; } } /** - * An auto-generated type for paginating through multiple Media. + * An error that occurs during the execution of cart metafield deletion. */ - public static class MediaConnection extends AbstractResponse { - public MediaConnection() { + public static class MetafieldDeleteUserError extends AbstractResponse implements DisplayableError { + public MetafieldDeleteUserError() { } - public MediaConnection(JsonObject fields) throws SchemaViolationError { + public MetafieldDeleteUserError(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new MediaEdge(jsonAsObject(element1, key))); + case "code": { + MetafieldDeleteErrorCode optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = MetafieldDeleteErrorCode.fromGraphQl(jsonAsString(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(UnknownMedia.create(jsonAsObject(element1, key))); + case "field": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + optional1 = list1; } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "message": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -44897,198 +41167,447 @@ public MediaConnection(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "MediaConnection"; + return "MetafieldDeleteUserError"; } /** - * A list of edges. + * The error code. */ - public List getEdges() { - return (List) get("edges"); + public MetafieldDeleteErrorCode getCode() { + return (MetafieldDeleteErrorCode) get("code"); } - public MediaConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); + public MetafieldDeleteUserError setCode(MetafieldDeleteErrorCode arg) { + optimisticData.put(getKey("code"), arg); return this; } /** - * A list of the nodes contained in MediaEdge. + * The path to the input field that caused the error. */ - public List getNodes() { - return (List) get("nodes"); + public List getField() { + return (List) get("field"); } - public MediaConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + public MetafieldDeleteUserError setField(List arg) { + optimisticData.put(getKey("field"), arg); return this; } /** - * Information to aid in pagination. + * The error message. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public String getMessage() { + return (String) get("message"); } - public MediaConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public MetafieldDeleteUserError setMessage(String arg) { + optimisticData.put(getKey("message"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "edges": return true; + case "code": return false; - case "nodes": return false; + case "field": return false; - case "pageInfo": return true; + case "message": return false; default: return false; } } } + public static class MetafieldFilter implements Serializable { + private String namespace; + + private String key; + + private String value; + + public MetafieldFilter(String namespace, String key, String value) { + this.namespace = namespace; + + this.key = key; + + this.value = value; + } + + public String getNamespace() { + return namespace; + } + + public MetafieldFilter setNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + public String getKey() { + return key; + } + + public MetafieldFilter setKey(String key) { + this.key = key; + return this; + } + + public String getValue() { + return value; + } + + public MetafieldFilter setValue(String value) { + this.value = value; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("namespace:"); + Query.appendQuotedString(_queryBuilder, namespace.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("value:"); + Query.appendQuotedString(_queryBuilder, value.toString()); + + _queryBuilder.append('}'); + } + } + + public interface MetafieldParentResourceQueryDefinition { + void define(MetafieldParentResourceQuery _queryBuilder); + } + /** - * The possible content types for a media object. + * A resource that the metafield belongs to. */ - public enum MediaContentType { - /** - * An externally hosted video. - */ - EXTERNAL_VIDEO, + public static class MetafieldParentResourceQuery extends Query { + MetafieldParentResourceQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - /** - * A Shopify hosted image. - */ - IMAGE, + startField("__typename"); + } - /** - * A 3d model. - */ - MODEL_3D, + public MetafieldParentResourceQuery onArticle(ArticleQueryDefinition queryDef) { + startInlineFragment("Article"); + queryDef.define(new ArticleQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - /** - * A Shopify hosted video. - */ - VIDEO, + public MetafieldParentResourceQuery onBlog(BlogQueryDefinition queryDef) { + startInlineFragment("Blog"); + queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldParentResourceQuery onCart(CartQueryDefinition queryDef) { + startInlineFragment("Cart"); + queryDef.define(new CartQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldParentResourceQuery onCollection(CollectionQueryDefinition queryDef) { + startInlineFragment("Collection"); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldParentResourceQuery onCompany(CompanyQueryDefinition queryDef) { + startInlineFragment("Company"); + queryDef.define(new CompanyQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldParentResourceQuery onCompanyLocation(CompanyLocationQueryDefinition queryDef) { + startInlineFragment("CompanyLocation"); + queryDef.define(new CompanyLocationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldParentResourceQuery onCustomer(CustomerQueryDefinition queryDef) { + startInlineFragment("Customer"); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldParentResourceQuery onLocation(LocationQueryDefinition queryDef) { + startInlineFragment("Location"); + queryDef.define(new LocationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldParentResourceQuery onMarket(MarketQueryDefinition queryDef) { + startInlineFragment("Market"); + queryDef.define(new MarketQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldParentResourceQuery onOrder(OrderQueryDefinition queryDef) { + startInlineFragment("Order"); + queryDef.define(new OrderQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldParentResourceQuery onPage(PageQueryDefinition queryDef) { + startInlineFragment("Page"); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldParentResourceQuery onProduct(ProductQueryDefinition queryDef) { + startInlineFragment("Product"); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldParentResourceQuery onProductVariant(ProductVariantQueryDefinition queryDef) { + startInlineFragment("ProductVariant"); + queryDef.define(new ProductVariantQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldParentResourceQuery onSellingPlan(SellingPlanQueryDefinition queryDef) { + startInlineFragment("SellingPlan"); + queryDef.define(new SellingPlanQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldParentResourceQuery onShop(ShopQueryDefinition queryDef) { + startInlineFragment("Shop"); + queryDef.define(new ShopQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + } + + public interface MetafieldParentResource { + String getGraphQlTypeName(); + } + + /** + * A resource that the metafield belongs to. + */ + public static class UnknownMetafieldParentResource extends AbstractResponse implements MetafieldParentResource { + public UnknownMetafieldParentResource() { + } + + public UnknownMetafieldParentResource(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public static MetafieldParentResource create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "Article": { + return new Article(fields); + } + + case "Blog": { + return new Blog(fields); + } + + case "Cart": { + return new Cart(fields); + } - UNKNOWN_VALUE; + case "Collection": { + return new Collection(fields); + } - public static MediaContentType fromGraphQl(String value) { - if (value == null) { - return null; - } + case "Company": { + return new Company(fields); + } - switch (value) { - case "EXTERNAL_VIDEO": { - return EXTERNAL_VIDEO; + case "CompanyLocation": { + return new CompanyLocation(fields); } - case "IMAGE": { - return IMAGE; + case "Customer": { + return new Customer(fields); } - case "MODEL_3D": { - return MODEL_3D; + case "Location": { + return new Location(fields); } - case "VIDEO": { - return VIDEO; + case "Market": { + return new Market(fields); } - default: { - return UNKNOWN_VALUE; + case "Order": { + return new Order(fields); } - } - } - public String toString() { - switch (this) { - case EXTERNAL_VIDEO: { - return "EXTERNAL_VIDEO"; + + case "Page": { + return new Page(fields); } - case IMAGE: { - return "IMAGE"; + case "Product": { + return new Product(fields); } - case MODEL_3D: { - return "MODEL_3D"; + case "ProductVariant": { + return new ProductVariant(fields); } - case VIDEO: { - return "VIDEO"; + case "SellingPlan": { + return new SellingPlan(fields); + } + + case "Shop": { + return new Shop(fields); } default: { - return ""; + return new UnknownMetafieldParentResource(fields); } } } + + public String getGraphQlTypeName() { + return (String) get("__typename"); + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + default: return false; + } + } } - public interface MediaEdgeQueryDefinition { - void define(MediaEdgeQuery _queryBuilder); + public interface MetafieldReferenceQueryDefinition { + void define(MetafieldReferenceQuery _queryBuilder); } /** - * An auto-generated type which holds one Media and a cursor during pagination. + * Returns the resource which is being referred to by a metafield. */ - public static class MediaEdgeQuery extends Query { - MediaEdgeQuery(StringBuilder _queryBuilder) { + public static class MetafieldReferenceQuery extends Query { + MetafieldReferenceQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("__typename"); } - /** - * A cursor for use in pagination. - */ - public MediaEdgeQuery cursor() { - startField("cursor"); + public MetafieldReferenceQuery onCollection(CollectionQueryDefinition queryDef) { + startInlineFragment("Collection"); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + public MetafieldReferenceQuery onGenericFile(GenericFileQueryDefinition queryDef) { + startInlineFragment("GenericFile"); + queryDef.define(new GenericFileQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The item at the end of MediaEdge. - */ - public MediaEdgeQuery node(MediaQueryDefinition queryDef) { - startField("node"); + public MetafieldReferenceQuery onMediaImage(MediaImageQueryDefinition queryDef) { + startInlineFragment("MediaImage"); + queryDef.define(new MediaImageQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new MediaQuery(_queryBuilder)); + public MetafieldReferenceQuery onMetaobject(MetaobjectQueryDefinition queryDef) { + startInlineFragment("Metaobject"); + queryDef.define(new MetaobjectQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldReferenceQuery onModel3d(Model3dQueryDefinition queryDef) { + startInlineFragment("Model3d"); + queryDef.define(new Model3dQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldReferenceQuery onPage(PageQueryDefinition queryDef) { + startInlineFragment("Page"); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldReferenceQuery onProduct(ProductQueryDefinition queryDef) { + startInlineFragment("Product"); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldReferenceQuery onProductVariant(ProductVariantQueryDefinition queryDef) { + startInlineFragment("ProductVariant"); + queryDef.define(new ProductVariantQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; + } + public MetafieldReferenceQuery onVideo(VideoQueryDefinition queryDef) { + startInlineFragment("Video"); + queryDef.define(new VideoQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } + public interface MetafieldReference { + String getGraphQlTypeName(); + } + /** - * An auto-generated type which holds one Media and a cursor during pagination. + * Returns the resource which is being referred to by a metafield. */ - public static class MediaEdge extends AbstractResponse { - public MediaEdge() { + public static class UnknownMetafieldReference extends AbstractResponse implements MetafieldReference { + public UnknownMetafieldReference() { } - public MediaEdge(JsonObject fields) throws SchemaViolationError { + public UnknownMetafieldReference(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "node": { - responseData.put(key, UnknownMedia.create(jsonAsObject(field.getValue(), key))); - - break; - } - case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -45100,165 +41619,108 @@ public MediaEdge(JsonObject fields) throws SchemaViolationError { } } - public String getGraphQlTypeName() { - return "MediaEdge"; - } - - /** - * A cursor for use in pagination. - */ - - public String getCursor() { - return (String) get("cursor"); - } - - public MediaEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; - } - - /** - * The item at the end of MediaEdge. - */ - - public Media getNode() { - return (Media) get("node"); - } - - public MediaEdge setNode(Media arg) { - optimisticData.put(getKey("node"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; + public static MetafieldReference create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "Collection": { + return new Collection(fields); + } - case "node": return false; + case "GenericFile": { + return new GenericFile(fields); + } - default: return false; - } - } - } + case "MediaImage": { + return new MediaImage(fields); + } - /** - * Host for a Media Resource. - */ - public enum MediaHost { - /** - * Host for Vimeo embedded videos. - */ - VIMEO, + case "Metaobject": { + return new Metaobject(fields); + } - /** - * Host for YouTube embedded videos. - */ - YOUTUBE, + case "Model3d": { + return new Model3d(fields); + } - UNKNOWN_VALUE; + case "Page": { + return new Page(fields); + } - public static MediaHost fromGraphQl(String value) { - if (value == null) { - return null; - } + case "Product": { + return new Product(fields); + } - switch (value) { - case "VIMEO": { - return VIMEO; + case "ProductVariant": { + return new ProductVariant(fields); } - case "YOUTUBE": { - return YOUTUBE; + case "Video": { + return new Video(fields); } default: { - return UNKNOWN_VALUE; + return new UnknownMetafieldReference(fields); } } } - public String toString() { - switch (this) { - case VIMEO: { - return "VIMEO"; - } - case YOUTUBE: { - return "YOUTUBE"; - } + public String getGraphQlTypeName() { + return (String) get("__typename"); + } - default: { - return ""; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + default: return false; } } } - public interface MediaImageQueryDefinition { - void define(MediaImageQuery _queryBuilder); + public interface MetafieldReferenceConnectionQueryDefinition { + void define(MetafieldReferenceConnectionQuery _queryBuilder); } /** - * Represents a Shopify hosted image. + * An auto-generated type for paginating through multiple MetafieldReferences. */ - public static class MediaImageQuery extends Query { - MediaImageQuery(StringBuilder _queryBuilder) { + public static class MetafieldReferenceConnectionQuery extends Query { + MetafieldReferenceConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("id"); } /** - * A word or phrase to share the nature or contents of a media. - */ - public MediaImageQuery alt() { - startField("alt"); - - return this; - } - - /** - * The image for the media. + * A list of edges. */ - public MediaImageQuery image(ImageQueryDefinition queryDef) { - startField("image"); + public MetafieldReferenceConnectionQuery edges(MetafieldReferenceEdgeQueryDefinition queryDef) { + startField("edges"); _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); + queryDef.define(new MetafieldReferenceEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The media content type. - */ - public MediaImageQuery mediaContentType() { - startField("mediaContentType"); - - return this; - } - - /** - * The presentation for a media. + * A list of the nodes contained in MetafieldReferenceEdge. */ - public MediaImageQuery presentation(MediaPresentationQueryDefinition queryDef) { - startField("presentation"); + public MetafieldReferenceConnectionQuery nodes(MetafieldReferenceQueryDefinition queryDef) { + startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new MediaPresentationQuery(_queryBuilder)); + queryDef.define(new MetafieldReferenceQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The preview image for the media. + * Information to aid in pagination. */ - public MediaImageQuery previewImage(ImageQueryDefinition queryDef) { - startField("previewImage"); + public MetafieldReferenceConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); + queryDef.define(new PageInfoQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -45266,69 +41728,41 @@ public MediaImageQuery previewImage(ImageQueryDefinition queryDef) { } /** - * Represents a Shopify hosted image. + * An auto-generated type for paginating through multiple MetafieldReferences. */ - public static class MediaImage extends AbstractResponse implements Media, MetafieldReference, Node { - public MediaImage() { + public static class MetafieldReferenceConnection extends AbstractResponse { + public MetafieldReferenceConnection() { } - public MediaImage(JsonObject fields) throws SchemaViolationError { + public MetafieldReferenceConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "alt": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - - break; - } - - case "image": { - Image optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new MetafieldReferenceEdge(jsonAsObject(element1, key))); } - responseData.put(key, optional1); - - break; - } - - case "mediaContentType": { - responseData.put(key, MediaContentType.fromGraphQl(jsonAsString(field.getValue(), key))); + responseData.put(key, list1); break; } - case "presentation": { - MediaPresentation optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MediaPresentation(jsonAsObject(field.getValue(), key)); + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(UnknownMetafieldReference.create(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "previewImage": { - Image optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } @@ -45344,161 +41778,117 @@ public MediaImage(JsonObject fields) throws SchemaViolationError { } } - public MediaImage(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "MediaImage"; - } - - /** - * A word or phrase to share the nature or contents of a media. - */ - - public String getAlt() { - return (String) get("alt"); - } - - public MediaImage setAlt(String arg) { - optimisticData.put(getKey("alt"), arg); - return this; - } - - /** - * A globally-unique ID. - */ - - public ID getId() { - return (ID) get("id"); - } - - /** - * The image for the media. - */ - - public Image getImage() { - return (Image) get("image"); - } - - public MediaImage setImage(Image arg) { - optimisticData.put(getKey("image"), arg); - return this; + return "MetafieldReferenceConnection"; } /** - * The media content type. + * A list of edges. */ - public MediaContentType getMediaContentType() { - return (MediaContentType) get("mediaContentType"); + public List getEdges() { + return (List) get("edges"); } - public MediaImage setMediaContentType(MediaContentType arg) { - optimisticData.put(getKey("mediaContentType"), arg); + public MetafieldReferenceConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * The presentation for a media. + * A list of the nodes contained in MetafieldReferenceEdge. */ - public MediaPresentation getPresentation() { - return (MediaPresentation) get("presentation"); + public List getNodes() { + return (List) get("nodes"); } - public MediaImage setPresentation(MediaPresentation arg) { - optimisticData.put(getKey("presentation"), arg); + public MetafieldReferenceConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * The preview image for the media. + * Information to aid in pagination. */ - public Image getPreviewImage() { - return (Image) get("previewImage"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public MediaImage setPreviewImage(Image arg) { - optimisticData.put(getKey("previewImage"), arg); + public MetafieldReferenceConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "alt": return false; - - case "id": return false; - - case "image": return true; - - case "mediaContentType": return false; + case "edges": return true; - case "presentation": return true; + case "nodes": return false; - case "previewImage": return true; + case "pageInfo": return true; default: return false; } } } - public interface MediaPresentationQueryDefinition { - void define(MediaPresentationQuery _queryBuilder); + public interface MetafieldReferenceEdgeQueryDefinition { + void define(MetafieldReferenceEdgeQuery _queryBuilder); } /** - * A media presentation. + * An auto-generated type which holds one MetafieldReference and a cursor during pagination. */ - public static class MediaPresentationQuery extends Query { - MediaPresentationQuery(StringBuilder _queryBuilder) { + public static class MetafieldReferenceEdgeQuery extends Query { + MetafieldReferenceEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("id"); } /** - * A JSON object representing a presentation view. + * A cursor for use in pagination. */ - public MediaPresentationQuery asJson(MediaPresentationFormat format) { - startField("asJson"); + public MetafieldReferenceEdgeQuery cursor() { + startField("cursor"); - _queryBuilder.append("(format:"); - _queryBuilder.append(format.toString()); + return this; + } - _queryBuilder.append(')'); + /** + * The item at the end of MetafieldReferenceEdge. + */ + public MetafieldReferenceEdgeQuery node(MetafieldReferenceQueryDefinition queryDef) { + startField("node"); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldReferenceQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * A media presentation. + * An auto-generated type which holds one MetafieldReference and a cursor during pagination. */ - public static class MediaPresentation extends AbstractResponse implements Node { - public MediaPresentation() { + public static class MetafieldReferenceEdge extends AbstractResponse { + public MetafieldReferenceEdge() { } - public MediaPresentation(JsonObject fields) throws SchemaViolationError { + public MetafieldReferenceEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "asJson": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case "node": { + responseData.put(key, UnknownMetafieldReference.create(jsonAsObject(field.getValue(), key))); break; } @@ -45514,200 +41904,147 @@ public MediaPresentation(JsonObject fields) throws SchemaViolationError { } } - public MediaPresentation(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "MediaPresentation"; + return "MetafieldReferenceEdge"; } /** - * A JSON object representing a presentation view. + * A cursor for use in pagination. */ - public String getAsJson() { - return (String) get("asJson"); + public String getCursor() { + return (String) get("cursor"); } - public MediaPresentation setAsJson(String arg) { - optimisticData.put(getKey("asJson"), arg); + public MetafieldReferenceEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * A globally-unique ID. + * The item at the end of MetafieldReferenceEdge. */ - public ID getId() { - return (ID) get("id"); + public MetafieldReference getNode() { + return (MetafieldReference) get("node"); + } + + public MetafieldReferenceEdge setNode(MetafieldReference arg) { + optimisticData.put(getKey("node"), arg); + return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "asJson": return false; + case "cursor": return false; - case "id": return false; + case "node": return false; default: return false; } } } - /** - * The possible formats for a media presentation. - */ - public enum MediaPresentationFormat { - /** - * A media image presentation. - */ - IMAGE, - - /** - * A model viewer presentation. - */ - MODEL_VIEWER, - - UNKNOWN_VALUE; - - public static MediaPresentationFormat fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "IMAGE": { - return IMAGE; - } - - case "MODEL_VIEWER": { - return MODEL_VIEWER; - } - - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case IMAGE: { - return "IMAGE"; - } - - case MODEL_VIEWER: { - return "MODEL_VIEWER"; - } - - default: { - return ""; - } - } - } - } - - public interface MenuQueryDefinition { - void define(MenuQuery _queryBuilder); + public interface MetafieldsSetUserErrorQueryDefinition { + void define(MetafieldsSetUserErrorQuery _queryBuilder); } /** - * A [navigation menu](https://help.shopify.com/manual/online-store/menus-and-links) representing a - * hierarchy - * of hyperlinks (items). + * An error that occurs during the execution of `MetafieldsSet`. */ - public static class MenuQuery extends Query { - MenuQuery(StringBuilder _queryBuilder) { + public static class MetafieldsSetUserErrorQuery extends Query { + MetafieldsSetUserErrorQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("id"); } /** - * The menu's handle. + * The error code. */ - public MenuQuery handle() { - startField("handle"); + public MetafieldsSetUserErrorQuery code() { + startField("code"); return this; } /** - * The menu's child items. + * The index of the array element that's causing the error. */ - public MenuQuery items(MenuItemQueryDefinition queryDef) { - startField("items"); - - _queryBuilder.append('{'); - queryDef.define(new MenuItemQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MetafieldsSetUserErrorQuery elementIndex() { + startField("elementIndex"); return this; } /** - * The count of items on the menu. + * The path to the input field that caused the error. */ - public MenuQuery itemsCount() { - startField("itemsCount"); + public MetafieldsSetUserErrorQuery field() { + startField("field"); return this; } /** - * The menu's title. + * The error message. */ - public MenuQuery title() { - startField("title"); + public MetafieldsSetUserErrorQuery message() { + startField("message"); return this; } } /** - * A [navigation menu](https://help.shopify.com/manual/online-store/menus-and-links) representing a - * hierarchy - * of hyperlinks (items). + * An error that occurs during the execution of `MetafieldsSet`. */ - public static class Menu extends AbstractResponse implements Node { - public Menu() { + public static class MetafieldsSetUserError extends AbstractResponse implements DisplayableError { + public MetafieldsSetUserError() { } - public Menu(JsonObject fields) throws SchemaViolationError { + public MetafieldsSetUserError(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "handle": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } + case "code": { + MetafieldsSetUserErrorCode optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = MetafieldsSetUserErrorCode.fromGraphQl(jsonAsString(field.getValue(), key)); + } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + responseData.put(key, optional1); break; } - case "items": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new MenuItem(jsonAsObject(element1, key))); + case "elementIndex": { + Integer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsInteger(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "itemsCount": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + case "field": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + optional1 = list1; + } + + responseData.put(key, optional1); break; } - case "title": { + case "message": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -45724,200 +42061,345 @@ public Menu(JsonObject fields) throws SchemaViolationError { } } - public Menu(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "Menu"; + return "MetafieldsSetUserError"; } /** - * The menu's handle. + * The error code. */ - public String getHandle() { - return (String) get("handle"); + public MetafieldsSetUserErrorCode getCode() { + return (MetafieldsSetUserErrorCode) get("code"); } - public Menu setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); + public MetafieldsSetUserError setCode(MetafieldsSetUserErrorCode arg) { + optimisticData.put(getKey("code"), arg); return this; } /** - * A globally-unique ID. + * The index of the array element that's causing the error. */ - public ID getId() { - return (ID) get("id"); + public Integer getElementIndex() { + return (Integer) get("elementIndex"); + } + + public MetafieldsSetUserError setElementIndex(Integer arg) { + optimisticData.put(getKey("elementIndex"), arg); + return this; } /** - * The menu's child items. + * The path to the input field that caused the error. */ - public List getItems() { - return (List) get("items"); + public List getField() { + return (List) get("field"); } - public Menu setItems(List arg) { - optimisticData.put(getKey("items"), arg); + public MetafieldsSetUserError setField(List arg) { + optimisticData.put(getKey("field"), arg); return this; } /** - * The count of items on the menu. + * The error message. */ - public Integer getItemsCount() { - return (Integer) get("itemsCount"); + public String getMessage() { + return (String) get("message"); } - public Menu setItemsCount(Integer arg) { - optimisticData.put(getKey("itemsCount"), arg); + public MetafieldsSetUserError setMessage(String arg) { + optimisticData.put(getKey("message"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "code": return false; + + case "elementIndex": return false; + + case "field": return false; + + case "message": return false; + + default: return false; + } + } + } + + /** + * Possible error codes that can be returned by `MetafieldsSetUserError`. + */ + public enum MetafieldsSetUserErrorCode { + /** + * The input value is blank. + */ + BLANK, + /** - * The menu's title. + * The input value isn't included in the list. */ + INCLUSION, - public String getTitle() { - return (String) get("title"); - } + /** + * The owner ID is invalid. + */ + INVALID_OWNER, - public Menu setTitle(String arg) { - optimisticData.put(getKey("title"), arg); - return this; + /** + * The type is invalid. + */ + INVALID_TYPE, + + /** + * The value is invalid for metafield type or for definition options. + */ + INVALID_VALUE, + + /** + * The input value should be less than or equal to the maximum value allowed. + */ + LESS_THAN_OR_EQUAL_TO, + + /** + * The input value needs to be blank. + */ + PRESENT, + + /** + * The input value is too long. + */ + TOO_LONG, + + /** + * The input value is too short. + */ + TOO_SHORT, + + UNKNOWN_VALUE; + + public static MetafieldsSetUserErrorCode fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "BLANK": { + return BLANK; + } + + case "INCLUSION": { + return INCLUSION; + } + + case "INVALID_OWNER": { + return INVALID_OWNER; + } + + case "INVALID_TYPE": { + return INVALID_TYPE; + } + + case "INVALID_VALUE": { + return INVALID_VALUE; + } + + case "LESS_THAN_OR_EQUAL_TO": { + return LESS_THAN_OR_EQUAL_TO; + } + + case "PRESENT": { + return PRESENT; + } + + case "TOO_LONG": { + return TOO_LONG; + } + + case "TOO_SHORT": { + return TOO_SHORT; + } + + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case BLANK: { + return "BLANK"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "handle": return false; + case INCLUSION: { + return "INCLUSION"; + } - case "id": return false; + case INVALID_OWNER: { + return "INVALID_OWNER"; + } - case "items": return true; + case INVALID_TYPE: { + return "INVALID_TYPE"; + } - case "itemsCount": return false; + case INVALID_VALUE: { + return "INVALID_VALUE"; + } - case "title": return false; + case LESS_THAN_OR_EQUAL_TO: { + return "LESS_THAN_OR_EQUAL_TO"; + } - default: return false; + case PRESENT: { + return "PRESENT"; + } + + case TOO_LONG: { + return "TOO_LONG"; + } + + case TOO_SHORT: { + return "TOO_SHORT"; + } + + default: { + return ""; + } } } } - public interface MenuItemQueryDefinition { - void define(MenuItemQuery _queryBuilder); + public interface MetaobjectQueryDefinition { + void define(MetaobjectQuery _queryBuilder); } /** - * A menu item within a parent menu. + * An instance of a user-defined model based on a MetaobjectDefinition. */ - public static class MenuItemQuery extends Query { - MenuItemQuery(StringBuilder _queryBuilder) { + public static class MetaobjectQuery extends Query { + MetaobjectQuery(StringBuilder _queryBuilder) { super(_queryBuilder); startField("id"); } /** - * The menu item's child items. + * Accesses a field of the object by key. */ - public MenuItemQuery items(MenuItemQueryDefinition queryDef) { - startField("items"); + public MetaobjectQuery field(String key, MetaobjectFieldQueryDefinition queryDef) { + startField("field"); + + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new MenuItemQuery(_queryBuilder)); + queryDef.define(new MetaobjectFieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The linked resource. + * All object fields with defined values. + * Omitted object keys can be assumed null, and no guarantees are made about field order. */ - public MenuItemQuery resource(MenuItemResourceQueryDefinition queryDef) { - startField("resource"); + public MetaobjectQuery fields(MetaobjectFieldQueryDefinition queryDef) { + startField("fields"); _queryBuilder.append('{'); - queryDef.define(new MenuItemResourceQuery(_queryBuilder)); + queryDef.define(new MetaobjectFieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The ID of the linked resource. + * The unique handle of the metaobject. Useful as a custom ID. */ - public MenuItemQuery resourceId() { - startField("resourceId"); + public MetaobjectQuery handle() { + startField("handle"); return this; } /** - * The menu item's tags to filter a collection. + * The URL used for viewing the metaobject on the shop's Online Store. Returns `null` if the metaobject + * definition doesn't have the `online_store` capability. */ - public MenuItemQuery tags() { - startField("tags"); + public MetaobjectQuery onlineStoreUrl() { + startField("onlineStoreUrl"); return this; } /** - * The menu item's title. + * The metaobject's SEO information. Returns `null` if the metaobject definition + * doesn't have the `renderable` capability. */ - public MenuItemQuery title() { - startField("title"); + public MetaobjectQuery seo(MetaobjectSEOQueryDefinition queryDef) { + startField("seo"); + + _queryBuilder.append('{'); + queryDef.define(new MetaobjectSEOQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The menu item's type. + * The type of the metaobject. Defines the namespace of its associated metafields. */ - public MenuItemQuery type() { + public MetaobjectQuery type() { startField("type"); return this; } /** - * The menu item's URL. + * The date and time when the metaobject was last updated. */ - public MenuItemQuery url() { - startField("url"); + public MetaobjectQuery updatedAt() { + startField("updatedAt"); return this; } } /** - * A menu item within a parent menu. + * An instance of a user-defined model based on a MetaobjectDefinition. */ - public static class MenuItem extends AbstractResponse implements Node { - public MenuItem() { + public static class Metaobject extends AbstractResponse implements MenuItemResource, MetafieldReference, Node, OnlineStorePublishable { + public Metaobject() { } - public MenuItem(JsonObject fields) throws SchemaViolationError { + public Metaobject(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case "field": { + MetaobjectField optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MetaobjectField(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "items": { - List list1 = new ArrayList<>(); + case "fields": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new MenuItem(jsonAsObject(element1, key))); + list1.add(new MetaobjectField(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -45925,58 +42407,48 @@ public MenuItem(JsonObject fields) throws SchemaViolationError { break; } - case "resource": { - MenuItemResource optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = UnknownMenuItemResource.create(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "resourceId": { - ID optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ID(jsonAsString(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); break; } - case "tags": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); + case "onlineStoreUrl": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "seo": { + MetaobjectSEO optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MetaobjectSEO(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } case "type": { - responseData.put(key, MenuItemType.fromGraphQl(jsonAsString(field.getValue(), key))); + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "url": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); break; } @@ -45992,496 +42464,358 @@ public MenuItem(JsonObject fields) throws SchemaViolationError { } } - public MenuItem(ID id) { + public Metaobject(ID id) { this(); optimisticData.put("id", id); } public String getGraphQlTypeName() { - return "MenuItem"; + return "Metaobject"; } /** - * A globally-unique ID. + * Accesses a field of the object by key. */ - public ID getId() { - return (ID) get("id"); + public MetaobjectField getField() { + return (MetaobjectField) get("field"); + } + + public Metaobject setField(MetaobjectField arg) { + optimisticData.put(getKey("field"), arg); + return this; } /** - * The menu item's child items. + * All object fields with defined values. + * Omitted object keys can be assumed null, and no guarantees are made about field order. */ - public List getItems() { - return (List) get("items"); + public List getFields() { + return (List) get("fields"); } - public MenuItem setItems(List arg) { - optimisticData.put(getKey("items"), arg); + public Metaobject setFields(List arg) { + optimisticData.put(getKey("fields"), arg); return this; } /** - * The linked resource. + * The unique handle of the metaobject. Useful as a custom ID. */ - public MenuItemResource getResource() { - return (MenuItemResource) get("resource"); + public String getHandle() { + return (String) get("handle"); } - public MenuItem setResource(MenuItemResource arg) { - optimisticData.put(getKey("resource"), arg); + public Metaobject setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); return this; } /** - * The ID of the linked resource. + * A globally-unique ID. */ - public ID getResourceId() { - return (ID) get("resourceId"); - } - - public MenuItem setResourceId(ID arg) { - optimisticData.put(getKey("resourceId"), arg); - return this; + public ID getId() { + return (ID) get("id"); } /** - * The menu item's tags to filter a collection. + * The URL used for viewing the metaobject on the shop's Online Store. Returns `null` if the metaobject + * definition doesn't have the `online_store` capability. */ - public List getTags() { - return (List) get("tags"); + public String getOnlineStoreUrl() { + return (String) get("onlineStoreUrl"); } - public MenuItem setTags(List arg) { - optimisticData.put(getKey("tags"), arg); + public Metaobject setOnlineStoreUrl(String arg) { + optimisticData.put(getKey("onlineStoreUrl"), arg); return this; } /** - * The menu item's title. + * The metaobject's SEO information. Returns `null` if the metaobject definition + * doesn't have the `renderable` capability. */ - public String getTitle() { - return (String) get("title"); + public MetaobjectSEO getSeo() { + return (MetaobjectSEO) get("seo"); } - public MenuItem setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public Metaobject setSeo(MetaobjectSEO arg) { + optimisticData.put(getKey("seo"), arg); return this; } /** - * The menu item's type. + * The type of the metaobject. Defines the namespace of its associated metafields. */ - public MenuItemType getType() { - return (MenuItemType) get("type"); + public String getType() { + return (String) get("type"); } - public MenuItem setType(MenuItemType arg) { + public Metaobject setType(String arg) { optimisticData.put(getKey("type"), arg); return this; } /** - * The menu item's URL. + * The date and time when the metaobject was last updated. */ - public String getUrl() { - return (String) get("url"); + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); } - public MenuItem setUrl(String arg) { - optimisticData.put(getKey("url"), arg); + public Metaobject setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "id": return false; + case "field": return true; - case "items": return true; + case "fields": return true; - case "resource": return false; + case "handle": return false; - case "resourceId": return false; + case "id": return false; - case "tags": return false; + case "onlineStoreUrl": return false; - case "title": return false; + case "seo": return true; case "type": return false; - case "url": return false; + case "updatedAt": return false; default: return false; } } } - public interface MenuItemResourceQueryDefinition { - void define(MenuItemResourceQuery _queryBuilder); + public interface MetaobjectConnectionQueryDefinition { + void define(MetaobjectConnectionQuery _queryBuilder); } /** - * The list of possible resources a `MenuItem` can reference. + * An auto-generated type for paginating through multiple Metaobjects. */ - public static class MenuItemResourceQuery extends Query { - MenuItemResourceQuery(StringBuilder _queryBuilder) { + public static class MetaobjectConnectionQuery extends Query { + MetaobjectConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("__typename"); } - public MenuItemResourceQuery onArticle(ArticleQueryDefinition queryDef) { - startInlineFragment("Article"); - queryDef.define(new ArticleQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * A list of edges. + */ + public MetaobjectConnectionQuery edges(MetaobjectEdgeQueryDefinition queryDef) { + startField("edges"); - public MenuItemResourceQuery onBlog(BlogQueryDefinition queryDef) { - startInlineFragment("Blog"); - queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new MetaobjectEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public MenuItemResourceQuery onCollection(CollectionQueryDefinition queryDef) { - startInlineFragment("Collection"); - queryDef.define(new CollectionQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public MenuItemResourceQuery onMetaobject(MetaobjectQueryDefinition queryDef) { - startInlineFragment("Metaobject"); + /** + * A list of the nodes contained in MetaobjectEdge. + */ + public MetaobjectConnectionQuery nodes(MetaobjectQueryDefinition queryDef) { + startField("nodes"); + + _queryBuilder.append('{'); queryDef.define(new MetaobjectQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public MenuItemResourceQuery onPage(PageQueryDefinition queryDef) { - startInlineFragment("Page"); - queryDef.define(new PageQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public MenuItemResourceQuery onProduct(ProductQueryDefinition queryDef) { - startInlineFragment("Product"); - queryDef.define(new ProductQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * Information to aid in pagination. + */ + public MetaobjectConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - public MenuItemResourceQuery onShopPolicy(ShopPolicyQueryDefinition queryDef) { - startInlineFragment("ShopPolicy"); - queryDef.define(new ShopPolicyQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } } - public interface MenuItemResource { - String getGraphQlTypeName(); - } - /** - * The list of possible resources a `MenuItem` can reference. + * An auto-generated type for paginating through multiple Metaobjects. */ - public static class UnknownMenuItemResource extends AbstractResponse implements MenuItemResource { - public UnknownMenuItemResource() { + public static class MetaobjectConnection extends AbstractResponse { + public MetaobjectConnection() { } - public UnknownMenuItemResource(JsonObject fields) throws SchemaViolationError { + public MetaobjectConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new MetaobjectEdge(jsonAsObject(element1, key))); + } - public static MenuItemResource create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "Article": { - return new Article(fields); - } + responseData.put(key, list1); - case "Blog": { - return new Blog(fields); - } + break; + } - case "Collection": { - return new Collection(fields); - } + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Metaobject(jsonAsObject(element1, key))); + } - case "Metaobject": { - return new Metaobject(fields); - } + responseData.put(key, list1); - case "Page": { - return new Page(fields); - } + break; + } - case "Product": { - return new Product(fields); - } + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - case "ShopPolicy": { - return new ShopPolicy(fields); - } + break; + } - default: { - return new UnknownMenuItemResource(fields); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } } } public String getGraphQlTypeName() { - return (String) get("__typename"); - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - default: return false; - } + return "MetaobjectConnection"; } - } - - /** - * A menu item type. - */ - public enum MenuItemType { - /** - * An article link. - */ - ARTICLE, - - /** - * A blog link. - */ - BLOG, - - /** - * A catalog link. - */ - CATALOG, - - /** - * A collection link. - */ - COLLECTION, - - /** - * A collection link. - */ - COLLECTIONS, /** - * A frontpage link. + * A list of edges. */ - FRONTPAGE, - /** - * An http link. - */ - HTTP, + public List getEdges() { + return (List) get("edges"); + } - /** - * A metaobject page link. - */ - METAOBJECT, + public MetaobjectConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; + } /** - * A page link. + * A list of the nodes contained in MetaobjectEdge. */ - PAGE, - /** - * A product link. - */ - PRODUCT, + public List getNodes() { + return (List) get("nodes"); + } - /** - * A search link. - */ - SEARCH, + public MetaobjectConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; + } /** - * A shop policy link. + * Information to aid in pagination. */ - SHOP_POLICY, - - UNKNOWN_VALUE; - - public static MenuItemType fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "ARTICLE": { - return ARTICLE; - } - - case "BLOG": { - return BLOG; - } - - case "CATALOG": { - return CATALOG; - } - - case "COLLECTION": { - return COLLECTION; - } - - case "COLLECTIONS": { - return COLLECTIONS; - } - - case "FRONTPAGE": { - return FRONTPAGE; - } - - case "HTTP": { - return HTTP; - } - - case "METAOBJECT": { - return METAOBJECT; - } - - case "PAGE": { - return PAGE; - } - - case "PRODUCT": { - return PRODUCT; - } - - case "SEARCH": { - return SEARCH; - } - - case "SHOP_POLICY": { - return SHOP_POLICY; - } - default: { - return UNKNOWN_VALUE; - } - } + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public String toString() { - switch (this) { - case ARTICLE: { - return "ARTICLE"; - } - - case BLOG: { - return "BLOG"; - } - - case CATALOG: { - return "CATALOG"; - } - - case COLLECTION: { - return "COLLECTION"; - } - - case COLLECTIONS: { - return "COLLECTIONS"; - } - - case FRONTPAGE: { - return "FRONTPAGE"; - } - - case HTTP: { - return "HTTP"; - } - - case METAOBJECT: { - return "METAOBJECT"; - } - case PAGE: { - return "PAGE"; - } + public MetaobjectConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); + return this; + } - case PRODUCT: { - return "PRODUCT"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - case SEARCH: { - return "SEARCH"; - } + case "nodes": return true; - case SHOP_POLICY: { - return "SHOP_POLICY"; - } + case "pageInfo": return true; - default: { - return ""; - } + default: return false; } } } - public interface MerchandiseQueryDefinition { - void define(MerchandiseQuery _queryBuilder); + public interface MetaobjectEdgeQueryDefinition { + void define(MetaobjectEdgeQuery _queryBuilder); } /** - * The merchandise to be purchased at checkout. + * An auto-generated type which holds one Metaobject and a cursor during pagination. */ - public static class MerchandiseQuery extends Query { - MerchandiseQuery(StringBuilder _queryBuilder) { + public static class MetaobjectEdgeQuery extends Query { + MetaobjectEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + } - startField("__typename"); + /** + * A cursor for use in pagination. + */ + public MetaobjectEdgeQuery cursor() { + startField("cursor"); + + return this; } - public MerchandiseQuery onProductVariant(ProductVariantQueryDefinition queryDef) { - startInlineFragment("ProductVariant"); - queryDef.define(new ProductVariantQuery(_queryBuilder)); + /** + * The item at the end of MetaobjectEdge. + */ + public MetaobjectEdgeQuery node(MetaobjectQueryDefinition queryDef) { + startField("node"); + + _queryBuilder.append('{'); + queryDef.define(new MetaobjectQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } } - public interface Merchandise { - String getGraphQlTypeName(); - } - /** - * The merchandise to be purchased at checkout. + * An auto-generated type which holds one Metaobject and a cursor during pagination. */ - public static class UnknownMerchandise extends AbstractResponse implements Merchandise { - public UnknownMerchandise() { + public static class MetaobjectEdge extends AbstractResponse { + public MetaobjectEdge() { } - public UnknownMerchandise(JsonObject fields) throws SchemaViolationError { + public MetaobjectEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "node": { + responseData.put(key, new Metaobject(jsonAsObject(field.getValue(), key))); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -46493,99 +42827,72 @@ public UnknownMerchandise(JsonObject fields) throws SchemaViolationError { } } - public static Merchandise create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "ProductVariant": { - return new ProductVariant(fields); - } - - default: { - return new UnknownMerchandise(fields); - } - } - } - public String getGraphQlTypeName() { - return (String) get("__typename"); - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - default: return false; - } - } - } - - public interface MetafieldQueryDefinition { - void define(MetafieldQuery _queryBuilder); - } - - /** - * Metafields represent custom metadata attached to a resource. Metafields can be sorted into - * namespaces and are - * comprised of keys, values, and value types. - */ - public static class MetafieldQuery extends Query { - MetafieldQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - - startField("id"); + return "MetaobjectEdge"; } /** - * The date and time when the storefront metafield was created. + * A cursor for use in pagination. */ - public MetafieldQuery createdAt() { - startField("createdAt"); + public String getCursor() { + return (String) get("cursor"); + } + + public MetaobjectEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * The description of a metafield. + * The item at the end of MetaobjectEdge. */ - public MetafieldQuery description() { - startField("description"); + public Metaobject getNode() { + return (Metaobject) get("node"); + } + + public MetaobjectEdge setNode(Metaobject arg) { + optimisticData.put(getKey("node"), arg); return this; } - /** - * The unique identifier for the metafield within its namespace. - */ - public MetafieldQuery key() { - startField("key"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - return this; + case "node": return true; + + default: return false; + } } + } - /** - * The container for a group of metafields that the metafield is associated with. - */ - public MetafieldQuery namespace() { - startField("namespace"); + public interface MetaobjectFieldQueryDefinition { + void define(MetaobjectFieldQuery _queryBuilder); + } - return this; + /** + * Provides the value of a Metaobject field. + */ + public static class MetaobjectFieldQuery extends Query { + MetaobjectFieldQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The type of resource that the metafield is attached to. + * The field key. */ - public MetafieldQuery parentResource(MetafieldParentResourceQueryDefinition queryDef) { - startField("parentResource"); - - _queryBuilder.append('{'); - queryDef.define(new MetafieldParentResourceQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MetaobjectFieldQuery key() { + startField("key"); return this; } /** - * Returns a reference object if the metafield's type is a resource reference. + * A referenced object if the field type is a resource reference. */ - public MetafieldQuery reference(MetafieldReferenceQueryDefinition queryDef) { + public MetaobjectFieldQuery reference(MetafieldReferenceQueryDefinition queryDef) { startField("reference"); _queryBuilder.append('{'); @@ -46650,16 +42957,16 @@ public interface ReferencesArgumentsDefinition { } /** - * A list of reference objects if the metafield's type is a resource reference list. + * A list of referenced objects if the field type is a resource reference list. */ - public MetafieldQuery references(MetafieldReferenceConnectionQueryDefinition queryDef) { + public MetaobjectFieldQuery references(MetafieldReferenceConnectionQueryDefinition queryDef) { return references(args -> {}, queryDef); } /** - * A list of reference objects if the metafield's type is a resource reference list. + * A list of referenced objects if the field type is a resource reference list. */ - public MetafieldQuery references(ReferencesArgumentsDefinition argsDef, MetafieldReferenceConnectionQueryDefinition queryDef) { + public MetaobjectFieldQuery references(ReferencesArgumentsDefinition argsDef, MetafieldReferenceConnectionQueryDefinition queryDef) { startField("references"); ReferencesArguments args = new ReferencesArguments(_queryBuilder); @@ -46674,55 +42981,437 @@ public MetafieldQuery references(ReferencesArgumentsDefinition argsDef, Metafiel } /** - * The type name of the metafield. - * Refer to the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). + * The type name of the field. + * See the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). */ - public MetafieldQuery type() { + public MetaobjectFieldQuery type() { startField("type"); return this; } /** - * The date and time when the metafield was last updated. + * The field value. */ - public MetafieldQuery updatedAt() { - startField("updatedAt"); + public MetaobjectFieldQuery value() { + startField("value"); + + return this; + } + } + + /** + * Provides the value of a Metaobject field. + */ + public static class MetaobjectField extends AbstractResponse { + public MetaobjectField() { + } + + public MetaobjectField(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "key": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "reference": { + MetafieldReference optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = UnknownMetafieldReference.create(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "references": { + MetafieldReferenceConnection optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MetafieldReferenceConnection(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "type": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "value": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "MetaobjectField"; + } + + /** + * The field key. + */ + + public String getKey() { + return (String) get("key"); + } + public MetaobjectField setKey(String arg) { + optimisticData.put(getKey("key"), arg); return this; } /** - * The data stored in the metafield. Always stored as a string, regardless of the metafield's type. + * A referenced object if the field type is a resource reference. */ - public MetafieldQuery value() { - startField("value"); + + public MetafieldReference getReference() { + return (MetafieldReference) get("reference"); + } + + public MetaobjectField setReference(MetafieldReference arg) { + optimisticData.put(getKey("reference"), arg); + return this; + } + + /** + * A list of referenced objects if the field type is a resource reference list. + */ + + public MetafieldReferenceConnection getReferences() { + return (MetafieldReferenceConnection) get("references"); + } + + public MetaobjectField setReferences(MetafieldReferenceConnection arg) { + optimisticData.put(getKey("references"), arg); + return this; + } + + /** + * The type name of the field. + * See the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). + */ + + public String getType() { + return (String) get("type"); + } + + public MetaobjectField setType(String arg) { + optimisticData.put(getKey("type"), arg); + return this; + } + + /** + * The field value. + */ + + public String getValue() { + return (String) get("value"); + } + + public MetaobjectField setValue(String arg) { + optimisticData.put(getKey("value"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "key": return false; + + case "reference": return false; + + case "references": return true; + + case "type": return false; + + case "value": return false; + + default: return false; + } + } + } + + public static class MetaobjectHandleInput implements Serializable { + private String handle; + + private String type; + + public MetaobjectHandleInput(String handle, String type) { + this.handle = handle; + + this.type = type; + } + + public String getHandle() { + return handle; + } + + public MetaobjectHandleInput setHandle(String handle) { + this.handle = handle; + return this; + } + + public String getType() { + return type; + } + + public MetaobjectHandleInput setType(String type) { + this.type = type; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("handle:"); + Query.appendQuotedString(_queryBuilder, handle.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("type:"); + Query.appendQuotedString(_queryBuilder, type.toString()); + + _queryBuilder.append('}'); + } + } + + public interface MetaobjectSEOQueryDefinition { + void define(MetaobjectSEOQuery _queryBuilder); + } + + /** + * SEO information for a metaobject. + */ + public static class MetaobjectSEOQuery extends Query { + MetaobjectSEOQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The meta description. + */ + public MetaobjectSEOQuery description(MetaobjectFieldQueryDefinition queryDef) { + startField("description"); + + _queryBuilder.append('{'); + queryDef.define(new MetaobjectFieldQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The SEO title. + */ + public MetaobjectSEOQuery title(MetaobjectFieldQueryDefinition queryDef) { + startField("title"); + + _queryBuilder.append('{'); + queryDef.define(new MetaobjectFieldQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * SEO information for a metaobject. + */ + public static class MetaobjectSEO extends AbstractResponse { + public MetaobjectSEO() { + } + + public MetaobjectSEO(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "description": { + MetaobjectField optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MetaobjectField(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "title": { + MetaobjectField optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MetaobjectField(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "MetaobjectSEO"; + } + + /** + * The meta description. + */ + + public MetaobjectField getDescription() { + return (MetaobjectField) get("description"); + } + + public MetaobjectSEO setDescription(MetaobjectField arg) { + optimisticData.put(getKey("description"), arg); + return this; + } + + /** + * The SEO title. + */ + + public MetaobjectField getTitle() { + return (MetaobjectField) get("title"); + } + + public MetaobjectSEO setTitle(MetaobjectField arg) { + optimisticData.put(getKey("title"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "description": return true; + + case "title": return true; + + default: return false; + } + } + } + + public interface Model3dQueryDefinition { + void define(Model3dQuery _queryBuilder); + } + + /** + * Represents a Shopify hosted 3D model. + */ + public static class Model3dQuery extends Query { + Model3dQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); + } + + /** + * A word or phrase to share the nature or contents of a media. + */ + public Model3dQuery alt() { + startField("alt"); + + return this; + } + + /** + * The media content type. + */ + public Model3dQuery mediaContentType() { + startField("mediaContentType"); + + return this; + } + + /** + * The presentation for a media. + */ + public Model3dQuery presentation(MediaPresentationQueryDefinition queryDef) { + startField("presentation"); + + _queryBuilder.append('{'); + queryDef.define(new MediaPresentationQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The preview image for the media. + */ + public Model3dQuery previewImage(ImageQueryDefinition queryDef) { + startField("previewImage"); + + _queryBuilder.append('{'); + queryDef.define(new ImageQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The sources for a 3d model. + */ + public Model3dQuery sources(Model3dSourceQueryDefinition queryDef) { + startField("sources"); + + _queryBuilder.append('{'); + queryDef.define(new Model3dSourceQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * Metafields represent custom metadata attached to a resource. Metafields can be sorted into - * namespaces and are - * comprised of keys, values, and value types. + * Represents a Shopify hosted 3D model. */ - public static class Metafield extends AbstractResponse implements Node { - public Metafield() { + public static class Model3d extends AbstractResponse implements Media, MetafieldReference, Node { + public Model3d() { } - public Metafield(JsonObject fields) throws SchemaViolationError { + public Model3d(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "createdAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - - break; - } - - case "description": { + case "alt": { String optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = jsonAsString(field.getValue(), key); @@ -46739,28 +43428,16 @@ public Metafield(JsonObject fields) throws SchemaViolationError { break; } - case "key": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "namespace": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "parentResource": { - responseData.put(key, UnknownMetafieldParentResource.create(jsonAsObject(field.getValue(), key))); + case "mediaContentType": { + responseData.put(key, MediaContentType.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "reference": { - MetafieldReference optional1 = null; + case "presentation": { + MediaPresentation optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = UnknownMetafieldReference.create(jsonAsObject(field.getValue(), key)); + optional1 = new MediaPresentation(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -46768,10 +43445,10 @@ public Metafield(JsonObject fields) throws SchemaViolationError { break; } - case "references": { - MetafieldReferenceConnection optional1 = null; + case "previewImage": { + Image optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MetafieldReferenceConnection(jsonAsObject(field.getValue(), key)); + optional1 = new Image(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -46779,20 +43456,13 @@ public Metafield(JsonObject fields) throws SchemaViolationError { break; } - case "type": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "updatedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - - break; - } + case "sources": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Model3dSource(jsonAsObject(element1, key))); + } - case "value": { - responseData.put(key, jsonAsString(field.getValue(), key)); + responseData.put(key, list1); break; } @@ -46808,316 +43478,372 @@ public Metafield(JsonObject fields) throws SchemaViolationError { } } - public Metafield(ID id) { + public Model3d(ID id) { this(); optimisticData.put("id", id); } public String getGraphQlTypeName() { - return "Metafield"; + return "Model3d"; } /** - * The date and time when the storefront metafield was created. + * A word or phrase to share the nature or contents of a media. */ - public DateTime getCreatedAt() { - return (DateTime) get("createdAt"); + public String getAlt() { + return (String) get("alt"); } - public Metafield setCreatedAt(DateTime arg) { - optimisticData.put(getKey("createdAt"), arg); + public Model3d setAlt(String arg) { + optimisticData.put(getKey("alt"), arg); return this; } /** - * The description of a metafield. + * A globally-unique ID. */ - public String getDescription() { - return (String) get("description"); + public ID getId() { + return (ID) get("id"); } - public Metafield setDescription(String arg) { - optimisticData.put(getKey("description"), arg); + /** + * The media content type. + */ + + public MediaContentType getMediaContentType() { + return (MediaContentType) get("mediaContentType"); + } + + public Model3d setMediaContentType(MediaContentType arg) { + optimisticData.put(getKey("mediaContentType"), arg); return this; } /** - * A globally-unique ID. + * The presentation for a media. */ - public ID getId() { - return (ID) get("id"); + public MediaPresentation getPresentation() { + return (MediaPresentation) get("presentation"); + } + + public Model3d setPresentation(MediaPresentation arg) { + optimisticData.put(getKey("presentation"), arg); + return this; } /** - * The unique identifier for the metafield within its namespace. + * The preview image for the media. */ - public String getKey() { - return (String) get("key"); + public Image getPreviewImage() { + return (Image) get("previewImage"); } - public Metafield setKey(String arg) { - optimisticData.put(getKey("key"), arg); + public Model3d setPreviewImage(Image arg) { + optimisticData.put(getKey("previewImage"), arg); return this; } /** - * The container for a group of metafields that the metafield is associated with. + * The sources for a 3d model. */ - public String getNamespace() { - return (String) get("namespace"); + public List getSources() { + return (List) get("sources"); } - public Metafield setNamespace(String arg) { - optimisticData.put(getKey("namespace"), arg); + public Model3d setSources(List arg) { + optimisticData.put(getKey("sources"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "alt": return false; + + case "id": return false; + + case "mediaContentType": return false; + + case "presentation": return true; + + case "previewImage": return true; + + case "sources": return true; + + default: return false; + } + } + } + + public interface Model3dSourceQueryDefinition { + void define(Model3dSourceQuery _queryBuilder); + } + + /** + * Represents a source for a Shopify hosted 3d model. + */ + public static class Model3dSourceQuery extends Query { + Model3dSourceQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + /** - * The type of resource that the metafield is attached to. + * The filesize of the 3d model. */ + public Model3dSourceQuery filesize() { + startField("filesize"); - public MetafieldParentResource getParentResource() { - return (MetafieldParentResource) get("parentResource"); + return this; } - public Metafield setParentResource(MetafieldParentResource arg) { - optimisticData.put(getKey("parentResource"), arg); + /** + * The format of the 3d model. + */ + public Model3dSourceQuery format() { + startField("format"); + return this; } /** - * Returns a reference object if the metafield's type is a resource reference. + * The MIME type of the 3d model. */ + public Model3dSourceQuery mimeType() { + startField("mimeType"); - public MetafieldReference getReference() { - return (MetafieldReference) get("reference"); + return this; } - public Metafield setReference(MetafieldReference arg) { - optimisticData.put(getKey("reference"), arg); + /** + * The URL of the 3d model. + */ + public Model3dSourceQuery url() { + startField("url"); + return this; } + } + + /** + * Represents a source for a Shopify hosted 3d model. + */ + public static class Model3dSource extends AbstractResponse { + public Model3dSource() { + } + + public Model3dSource(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "filesize": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); + + break; + } + + case "format": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "mimeType": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "url": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "Model3dSource"; + } /** - * A list of reference objects if the metafield's type is a resource reference list. + * The filesize of the 3d model. */ - public MetafieldReferenceConnection getReferences() { - return (MetafieldReferenceConnection) get("references"); + public Integer getFilesize() { + return (Integer) get("filesize"); } - public Metafield setReferences(MetafieldReferenceConnection arg) { - optimisticData.put(getKey("references"), arg); + public Model3dSource setFilesize(Integer arg) { + optimisticData.put(getKey("filesize"), arg); return this; } /** - * The type name of the metafield. - * Refer to the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). + * The format of the 3d model. */ - public String getType() { - return (String) get("type"); + public String getFormat() { + return (String) get("format"); } - public Metafield setType(String arg) { - optimisticData.put(getKey("type"), arg); + public Model3dSource setFormat(String arg) { + optimisticData.put(getKey("format"), arg); return this; } /** - * The date and time when the metafield was last updated. + * The MIME type of the 3d model. */ - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); + public String getMimeType() { + return (String) get("mimeType"); } - public Metafield setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); + public Model3dSource setMimeType(String arg) { + optimisticData.put(getKey("mimeType"), arg); return this; } /** - * The data stored in the metafield. Always stored as a string, regardless of the metafield's type. + * The URL of the 3d model. */ - public String getValue() { - return (String) get("value"); + public String getUrl() { + return (String) get("url"); } - public Metafield setValue(String arg) { - optimisticData.put(getKey("value"), arg); + public Model3dSource setUrl(String arg) { + optimisticData.put(getKey("url"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "createdAt": return false; - - case "description": return false; - - case "id": return false; - - case "key": return false; - - case "namespace": return false; - - case "parentResource": return false; - - case "reference": return false; - - case "references": return true; + case "filesize": return false; - case "type": return false; + case "format": return false; - case "updatedAt": return false; + case "mimeType": return false; - case "value": return false; + case "url": return false; default: return false; } } } - /** - * Possible error codes that can be returned by `MetafieldDeleteUserError`. - */ - public enum MetafieldDeleteErrorCode { - /** - * The owner ID is invalid. - */ - INVALID_OWNER, + public static class MoneyInput implements Serializable { + private String amount; - /** - * Metafield not found. - */ - METAFIELD_DOES_NOT_EXIST, + private CurrencyCode currencyCode; - UNKNOWN_VALUE; + public MoneyInput(String amount, CurrencyCode currencyCode) { + this.amount = amount; - public static MetafieldDeleteErrorCode fromGraphQl(String value) { - if (value == null) { - return null; - } + this.currencyCode = currencyCode; + } - switch (value) { - case "INVALID_OWNER": { - return INVALID_OWNER; - } + public String getAmount() { + return amount; + } - case "METAFIELD_DOES_NOT_EXIST": { - return METAFIELD_DOES_NOT_EXIST; - } + public MoneyInput setAmount(String amount) { + this.amount = amount; + return this; + } - default: { - return UNKNOWN_VALUE; - } - } + public CurrencyCode getCurrencyCode() { + return currencyCode; } - public String toString() { - switch (this) { - case INVALID_OWNER: { - return "INVALID_OWNER"; - } - case METAFIELD_DOES_NOT_EXIST: { - return "METAFIELD_DOES_NOT_EXIST"; - } + public MoneyInput setCurrencyCode(CurrencyCode currencyCode) { + this.currencyCode = currencyCode; + return this; + } - default: { - return ""; - } - } + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("amount:"); + Query.appendQuotedString(_queryBuilder, amount.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("currencyCode:"); + _queryBuilder.append(currencyCode.toString()); + + _queryBuilder.append('}'); } } - public interface MetafieldDeleteUserErrorQueryDefinition { - void define(MetafieldDeleteUserErrorQuery _queryBuilder); + public interface MoneyV2QueryDefinition { + void define(MoneyV2Query _queryBuilder); } /** - * An error that occurs during the execution of cart metafield deletion. + * A monetary value with currency. */ - public static class MetafieldDeleteUserErrorQuery extends Query { - MetafieldDeleteUserErrorQuery(StringBuilder _queryBuilder) { + public static class MoneyV2Query extends Query { + MoneyV2Query(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The error code. - */ - public MetafieldDeleteUserErrorQuery code() { - startField("code"); - - return this; - } - - /** - * The path to the input field that caused the error. + * Decimal money amount. */ - public MetafieldDeleteUserErrorQuery field() { - startField("field"); + public MoneyV2Query amount() { + startField("amount"); return this; } /** - * The error message. + * Currency of the money. */ - public MetafieldDeleteUserErrorQuery message() { - startField("message"); + public MoneyV2Query currencyCode() { + startField("currencyCode"); return this; } } /** - * An error that occurs during the execution of cart metafield deletion. + * A monetary value with currency. */ - public static class MetafieldDeleteUserError extends AbstractResponse implements DisplayableError { - public MetafieldDeleteUserError() { + public static class MoneyV2 extends AbstractResponse implements PricingValue, SellingPlanCheckoutChargeValue { + public MoneyV2() { } - public MetafieldDeleteUserError(JsonObject fields) throws SchemaViolationError { + public MoneyV2(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "code": { - MetafieldDeleteErrorCode optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = MetafieldDeleteErrorCode.fromGraphQl(jsonAsString(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "field": { - List optional1 = null; - if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } - - optional1 = list1; - } - - responseData.put(key, optional1); + case "amount": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "message": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "currencyCode": { + responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); break; } @@ -47134,838 +43860,946 @@ public MetafieldDeleteUserError(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "MetafieldDeleteUserError"; - } - - /** - * The error code. - */ - - public MetafieldDeleteErrorCode getCode() { - return (MetafieldDeleteErrorCode) get("code"); - } - - public MetafieldDeleteUserError setCode(MetafieldDeleteErrorCode arg) { - optimisticData.put(getKey("code"), arg); - return this; + return "MoneyV2"; } /** - * The path to the input field that caused the error. + * Decimal money amount. */ - public List getField() { - return (List) get("field"); + public String getAmount() { + return (String) get("amount"); } - public MetafieldDeleteUserError setField(List arg) { - optimisticData.put(getKey("field"), arg); + public MoneyV2 setAmount(String arg) { + optimisticData.put(getKey("amount"), arg); return this; } /** - * The error message. + * Currency of the money. */ - public String getMessage() { - return (String) get("message"); + public CurrencyCode getCurrencyCode() { + return (CurrencyCode) get("currencyCode"); } - public MetafieldDeleteUserError setMessage(String arg) { - optimisticData.put(getKey("message"), arg); + public MoneyV2 setCurrencyCode(CurrencyCode arg) { + optimisticData.put(getKey("currencyCode"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "code": return false; - - case "field": return false; + case "amount": return false; - case "message": return false; + case "currencyCode": return false; default: return false; } } } - public static class MetafieldFilter implements Serializable { - private String namespace; + public interface MutationQueryDefinition { + void define(MutationQuery _queryBuilder); + } - private String key; + /** + * The schema’s entry-point for mutations. This acts as the public, top-level API from which all + * mutation queries must start. + */ + public static class MutationQuery extends Query { + MutationQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - private String value; + /** + * Updates the attributes on a cart. + */ + public MutationQuery cartAttributesUpdate(List attributes, ID cartId, CartAttributesUpdatePayloadQueryDefinition queryDef) { + startField("cartAttributesUpdate"); - public MetafieldFilter(String namespace, String key, String value) { - this.namespace = namespace; + _queryBuilder.append("(attributes:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (AttributeInput item1 : attributes) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); - this.key = key; + _queryBuilder.append(",cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); - this.value = value; - } + _queryBuilder.append(')'); - public String getNamespace() { - return namespace; - } + _queryBuilder.append('{'); + queryDef.define(new CartAttributesUpdatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - public MetafieldFilter setNamespace(String namespace) { - this.namespace = namespace; return this; } - public String getKey() { - return key; - } + public class CartBillingAddressUpdateArguments extends Arguments { + CartBillingAddressUpdateArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } - public MetafieldFilter setKey(String key) { - this.key = key; - return this; + /** + * The customer's billing address. + */ + public CartBillingAddressUpdateArguments billingAddress(MailingAddressInput value) { + if (value != null) { + startArgument("billingAddress"); + value.appendTo(_queryBuilder); + } + return this; + } } - public String getValue() { - return value; + public interface CartBillingAddressUpdateArgumentsDefinition { + void define(CartBillingAddressUpdateArguments args); } - public MetafieldFilter setValue(String value) { - this.value = value; - return this; + /** + * Updates the billing address on the cart. + */ + public MutationQuery cartBillingAddressUpdate(ID cartId, CartBillingAddressUpdatePayloadQueryDefinition queryDef) { + return cartBillingAddressUpdate(cartId, args -> {}, queryDef); } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + /** + * Updates the billing address on the cart. + */ + public MutationQuery cartBillingAddressUpdate(ID cartId, CartBillingAddressUpdateArgumentsDefinition argsDef, CartBillingAddressUpdatePayloadQueryDefinition queryDef) { + startField("cartBillingAddressUpdate"); - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("namespace:"); - Query.appendQuotedString(_queryBuilder, namespace.toString()); + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + argsDef.define(new CartBillingAddressUpdateArguments(_queryBuilder)); - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("value:"); - Query.appendQuotedString(_queryBuilder, value.toString()); + _queryBuilder.append(')'); + _queryBuilder.append('{'); + queryDef.define(new CartBillingAddressUpdatePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); + + return this; } - } - public interface MetafieldParentResourceQueryDefinition { - void define(MetafieldParentResourceQuery _queryBuilder); - } + /** + * Updates customer information associated with a cart. + * Buyer identity is used to determine + * [international + * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing) + * and should match the customer's shipping address. + */ + public MutationQuery cartBuyerIdentityUpdate(ID cartId, CartBuyerIdentityInput buyerIdentity, CartBuyerIdentityUpdatePayloadQueryDefinition queryDef) { + startField("cartBuyerIdentityUpdate"); - /** - * A resource that the metafield belongs to. - */ - public static class MetafieldParentResourceQuery extends Query { - MetafieldParentResourceQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); - startField("__typename"); - } + _queryBuilder.append(",buyerIdentity:"); + buyerIdentity.appendTo(_queryBuilder); - public MetafieldParentResourceQuery onArticle(ArticleQueryDefinition queryDef) { - startInlineFragment("Article"); - queryDef.define(new ArticleQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + _queryBuilder.append(')'); - public MetafieldParentResourceQuery onBlog(BlogQueryDefinition queryDef) { - startInlineFragment("Blog"); - queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new CartBuyerIdentityUpdatePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public MetafieldParentResourceQuery onCart(CartQueryDefinition queryDef) { - startInlineFragment("Cart"); - queryDef.define(new CartQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public MetafieldParentResourceQuery onCollection(CollectionQueryDefinition queryDef) { - startInlineFragment("Collection"); - queryDef.define(new CollectionQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + public class CartCreateArguments extends Arguments { + CartCreateArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - public MetafieldParentResourceQuery onCompany(CompanyQueryDefinition queryDef) { - startInlineFragment("Company"); - queryDef.define(new CompanyQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + /** + * The fields used to create a cart. + */ + public CartCreateArguments input(CartInput value) { + if (value != null) { + startArgument("input"); + value.appendTo(_queryBuilder); + } + return this; + } } - public MetafieldParentResourceQuery onCompanyLocation(CompanyLocationQueryDefinition queryDef) { - startInlineFragment("CompanyLocation"); - queryDef.define(new CompanyLocationQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public interface CartCreateArgumentsDefinition { + void define(CartCreateArguments args); } - public MetafieldParentResourceQuery onCustomer(CustomerQueryDefinition queryDef) { - startInlineFragment("Customer"); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + /** + * Creates a new cart. + */ + public MutationQuery cartCreate(CartCreatePayloadQueryDefinition queryDef) { + return cartCreate(args -> {}, queryDef); } - public MetafieldParentResourceQuery onLocation(LocationQueryDefinition queryDef) { - startInlineFragment("Location"); - queryDef.define(new LocationQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * Creates a new cart. + */ + public MutationQuery cartCreate(CartCreateArgumentsDefinition argsDef, CartCreatePayloadQueryDefinition queryDef) { + startField("cartCreate"); - public MetafieldParentResourceQuery onMarket(MarketQueryDefinition queryDef) { - startInlineFragment("Market"); - queryDef.define(new MarketQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + CartCreateArguments args = new CartCreateArguments(_queryBuilder); + argsDef.define(args); + CartCreateArguments.end(args); - public MetafieldParentResourceQuery onOrder(OrderQueryDefinition queryDef) { - startInlineFragment("Order"); - queryDef.define(new OrderQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new CartCreatePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - public MetafieldParentResourceQuery onPage(PageQueryDefinition queryDef) { - startInlineFragment("Page"); - queryDef.define(new PageQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public class CartDiscountCodesUpdateArguments extends Arguments { + CartDiscountCodesUpdateArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } + + /** + * The case-insensitive discount codes that the customer added at checkout. + * The input must not contain more than `250` values. + */ + public CartDiscountCodesUpdateArguments discountCodes(List value) { + if (value != null) { + startArgument("discountCodes"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (String item1 : value) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + Query.appendQuotedString(_queryBuilder, item1.toString()); + } + } + _queryBuilder.append(']'); + } + return this; + } } - public MetafieldParentResourceQuery onProduct(ProductQueryDefinition queryDef) { - startInlineFragment("Product"); - queryDef.define(new ProductQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public interface CartDiscountCodesUpdateArgumentsDefinition { + void define(CartDiscountCodesUpdateArguments args); } - public MetafieldParentResourceQuery onProductVariant(ProductVariantQueryDefinition queryDef) { - startInlineFragment("ProductVariant"); - queryDef.define(new ProductVariantQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + /** + * Updates the discount codes applied to the cart. + */ + public MutationQuery cartDiscountCodesUpdate(ID cartId, CartDiscountCodesUpdatePayloadQueryDefinition queryDef) { + return cartDiscountCodesUpdate(cartId, args -> {}, queryDef); } - public MetafieldParentResourceQuery onShop(ShopQueryDefinition queryDef) { - startInlineFragment("Shop"); - queryDef.define(new ShopQuery(_queryBuilder)); + /** + * Updates the discount codes applied to the cart. + */ + public MutationQuery cartDiscountCodesUpdate(ID cartId, CartDiscountCodesUpdateArgumentsDefinition argsDef, CartDiscountCodesUpdatePayloadQueryDefinition queryDef) { + startField("cartDiscountCodesUpdate"); + + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); + + argsDef.define(new CartDiscountCodesUpdateArguments(_queryBuilder)); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CartDiscountCodesUpdatePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - } - public interface MetafieldParentResource { - String getGraphQlTypeName(); - } + /** + * Updates the gift card codes applied to the cart. + */ + public MutationQuery cartGiftCardCodesUpdate(ID cartId, List giftCardCodes, CartGiftCardCodesUpdatePayloadQueryDefinition queryDef) { + startField("cartGiftCardCodesUpdate"); - /** - * A resource that the metafield belongs to. - */ - public static class UnknownMetafieldParentResource extends AbstractResponse implements MetafieldParentResource { - public UnknownMetafieldParentResource() { - } + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); - public UnknownMetafieldParentResource(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + _queryBuilder.append(",giftCardCodes:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (String item1 : giftCardCodes) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + Query.appendQuotedString(_queryBuilder, item1.toString()); } } + _queryBuilder.append(']'); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CartGiftCardCodesUpdatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } - public static MetafieldParentResource create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "Article": { - return new Article(fields); - } + /** + * Adds a merchandise line to the cart. + */ + public MutationQuery cartLinesAdd(List lines, ID cartId, CartLinesAddPayloadQueryDefinition queryDef) { + startField("cartLinesAdd"); - case "Blog": { - return new Blog(fields); + _queryBuilder.append("(lines:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (CartLineInput item1 : lines) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); } + } + _queryBuilder.append(']'); - case "Cart": { - return new Cart(fields); - } + _queryBuilder.append(",cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); - case "Collection": { - return new Collection(fields); - } + _queryBuilder.append(')'); - case "Company": { - return new Company(fields); - } + _queryBuilder.append('{'); + queryDef.define(new CartLinesAddPayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "CompanyLocation": { - return new CompanyLocation(fields); - } + return this; + } - case "Customer": { - return new Customer(fields); - } + /** + * Removes one or more merchandise lines from the cart. + */ + public MutationQuery cartLinesRemove(ID cartId, List lineIds, CartLinesRemovePayloadQueryDefinition queryDef) { + startField("cartLinesRemove"); - case "Location": { - return new Location(fields); - } + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); - case "Market": { - return new Market(fields); + _queryBuilder.append(",lineIds:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ID item1 : lineIds) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + Query.appendQuotedString(_queryBuilder, item1.toString()); } + } + _queryBuilder.append(']'); - case "Order": { - return new Order(fields); - } + _queryBuilder.append(')'); - case "Page": { - return new Page(fields); - } + _queryBuilder.append('{'); + queryDef.define(new CartLinesRemovePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "Product": { - return new Product(fields); - } + return this; + } - case "ProductVariant": { - return new ProductVariant(fields); - } + /** + * Updates one or more merchandise lines on a cart. + */ + public MutationQuery cartLinesUpdate(ID cartId, List lines, CartLinesUpdatePayloadQueryDefinition queryDef) { + startField("cartLinesUpdate"); - case "Shop": { - return new Shop(fields); - } + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); - default: { - return new UnknownMetafieldParentResource(fields); + _queryBuilder.append(",lines:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (CartLineUpdateInput item1 : lines) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); } } - } + _queryBuilder.append(']'); - public String getGraphQlTypeName() { - return (String) get("__typename"); - } + _queryBuilder.append(')'); - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - default: return false; - } + _queryBuilder.append('{'); + queryDef.define(new CartLinesUpdatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } - } - public interface MetafieldReferenceQueryDefinition { - void define(MetafieldReferenceQuery _queryBuilder); - } + /** + * Deletes a cart metafield. + */ + public MutationQuery cartMetafieldDelete(CartMetafieldDeleteInput input, CartMetafieldDeletePayloadQueryDefinition queryDef) { + startField("cartMetafieldDelete"); - /** - * Returns the resource which is being referred to by a metafield. - */ - public static class MetafieldReferenceQuery extends Query { - MetafieldReferenceQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + _queryBuilder.append("(input:"); + input.appendTo(_queryBuilder); - startField("__typename"); - } + _queryBuilder.append(')'); - public MetafieldReferenceQuery onCollection(CollectionQueryDefinition queryDef) { - startInlineFragment("Collection"); - queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new CartMetafieldDeletePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public MetafieldReferenceQuery onGenericFile(GenericFileQueryDefinition queryDef) { - startInlineFragment("GenericFile"); - queryDef.define(new GenericFileQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public MetafieldReferenceQuery onMediaImage(MediaImageQueryDefinition queryDef) { - startInlineFragment("MediaImage"); - queryDef.define(new MediaImageQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * Sets cart metafield values. Cart metafield values will be set regardless if they were previously + * created or not. + * Allows a maximum of 25 cart metafields to be set at a time. + */ + public MutationQuery cartMetafieldsSet(List metafields, CartMetafieldsSetPayloadQueryDefinition queryDef) { + startField("cartMetafieldsSet"); - public MetafieldReferenceQuery onMetaobject(MetaobjectQueryDefinition queryDef) { - startInlineFragment("Metaobject"); - queryDef.define(new MetaobjectQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + _queryBuilder.append("(metafields:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (CartMetafieldsSetInput item1 : metafields) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); - public MetafieldReferenceQuery onModel3d(Model3dQueryDefinition queryDef) { - startInlineFragment("Model3d"); - queryDef.define(new Model3dQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + _queryBuilder.append(')'); - public MetafieldReferenceQuery onPage(PageQueryDefinition queryDef) { - startInlineFragment("Page"); - queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new CartMetafieldsSetPayloadQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public MetafieldReferenceQuery onProduct(ProductQueryDefinition queryDef) { - startInlineFragment("Product"); - queryDef.define(new ProductQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public MetafieldReferenceQuery onProductVariant(ProductVariantQueryDefinition queryDef) { - startInlineFragment("ProductVariant"); - queryDef.define(new ProductVariantQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * Updates the note on the cart. + */ + public MutationQuery cartNoteUpdate(ID cartId, String note, CartNoteUpdatePayloadQueryDefinition queryDef) { + startField("cartNoteUpdate"); + + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); + + _queryBuilder.append(",note:"); + Query.appendQuotedString(_queryBuilder, note.toString()); + + _queryBuilder.append(')'); - public MetafieldReferenceQuery onVideo(VideoQueryDefinition queryDef) { - startInlineFragment("Video"); - queryDef.define(new VideoQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new CartNoteUpdatePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - } - - public interface MetafieldReference { - String getGraphQlTypeName(); - } - /** - * Returns the resource which is being referred to by a metafield. - */ - public static class UnknownMetafieldReference extends AbstractResponse implements MetafieldReference { - public UnknownMetafieldReference() { - } + /** + * Update the customer's payment method that will be used to checkout. + */ + public MutationQuery cartPaymentUpdate(ID cartId, CartPaymentInput payment, CartPaymentUpdatePayloadQueryDefinition queryDef) { + startField("cartPaymentUpdate"); - public UnknownMetafieldReference(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); - public static MetafieldReference create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "Collection": { - return new Collection(fields); - } + _queryBuilder.append(",payment:"); + payment.appendTo(_queryBuilder); - case "GenericFile": { - return new GenericFile(fields); - } + _queryBuilder.append(')'); - case "MediaImage": { - return new MediaImage(fields); - } + _queryBuilder.append('{'); + queryDef.define(new CartPaymentUpdatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "Metaobject": { - return new Metaobject(fields); - } + return this; + } - case "Model3d": { - return new Model3d(fields); - } + /** + * Update the selected delivery options for a delivery group. + */ + public MutationQuery cartSelectedDeliveryOptionsUpdate(ID cartId, List selectedDeliveryOptions, CartSelectedDeliveryOptionsUpdatePayloadQueryDefinition queryDef) { + startField("cartSelectedDeliveryOptionsUpdate"); - case "Page": { - return new Page(fields); - } + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); - case "Product": { - return new Product(fields); + _queryBuilder.append(",selectedDeliveryOptions:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (CartSelectedDeliveryOptionInput item1 : selectedDeliveryOptions) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); } + } + _queryBuilder.append(']'); - case "ProductVariant": { - return new ProductVariant(fields); - } + _queryBuilder.append(')'); - case "Video": { - return new Video(fields); - } + _queryBuilder.append('{'); + queryDef.define(new CartSelectedDeliveryOptionsUpdatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - default: { - return new UnknownMetafieldReference(fields); - } - } + return this; } - public String getGraphQlTypeName() { - return (String) get("__typename"); - } + /** + * Submit the cart for checkout completion. + */ + public MutationQuery cartSubmitForCompletion(ID cartId, String attemptToken, CartSubmitForCompletionPayloadQueryDefinition queryDef) { + startField("cartSubmitForCompletion"); - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - default: return false; - } - } - } + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); - public interface MetafieldReferenceConnectionQueryDefinition { - void define(MetafieldReferenceConnectionQuery _queryBuilder); - } + _queryBuilder.append(",attemptToken:"); + Query.appendQuotedString(_queryBuilder, attemptToken.toString()); - /** - * An auto-generated type for paginating through multiple MetafieldReferences. - */ - public static class MetafieldReferenceConnectionQuery extends Query { - MetafieldReferenceConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CartSubmitForCompletionPayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * A list of edges. + * Creates a customer access token. + * The customer access token is required to modify the customer object in any way. */ - public MetafieldReferenceConnectionQuery edges(MetafieldReferenceEdgeQueryDefinition queryDef) { - startField("edges"); + public MutationQuery customerAccessTokenCreate(CustomerAccessTokenCreateInput input, CustomerAccessTokenCreatePayloadQueryDefinition queryDef) { + startField("customerAccessTokenCreate"); + + _queryBuilder.append("(input:"); + input.appendTo(_queryBuilder); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new MetafieldReferenceEdgeQuery(_queryBuilder)); + queryDef.define(new CustomerAccessTokenCreatePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in MetafieldReferenceEdge. + * Creates a customer access token using a + * [multipass token](https://shopify.dev/api/multipass) instead of email and + * password. A customer record is created if the customer doesn't exist. If a customer + * record already exists but the record is disabled, then the customer record is enabled. */ - public MetafieldReferenceConnectionQuery nodes(MetafieldReferenceQueryDefinition queryDef) { - startField("nodes"); + public MutationQuery customerAccessTokenCreateWithMultipass(String multipassToken, CustomerAccessTokenCreateWithMultipassPayloadQueryDefinition queryDef) { + startField("customerAccessTokenCreateWithMultipass"); + + _queryBuilder.append("(multipassToken:"); + Query.appendQuotedString(_queryBuilder, multipassToken.toString()); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new MetafieldReferenceQuery(_queryBuilder)); + queryDef.define(new CustomerAccessTokenCreateWithMultipassPayloadQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Information to aid in pagination. + * Permanently destroys a customer access token. */ - public MetafieldReferenceConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + public MutationQuery customerAccessTokenDelete(String customerAccessToken, CustomerAccessTokenDeletePayloadQueryDefinition queryDef) { + startField("customerAccessTokenDelete"); + + _queryBuilder.append("(customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); + queryDef.define(new CustomerAccessTokenDeletePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - } - /** - * An auto-generated type for paginating through multiple MetafieldReferences. - */ - public static class MetafieldReferenceConnection extends AbstractResponse { - public MetafieldReferenceConnection() { - } + /** + * Renews a customer access token. + * Access token renewal must happen *before* a token expires. + * If a token has already expired, a new one should be created instead via `customerAccessTokenCreate`. + */ + public MutationQuery customerAccessTokenRenew(String customerAccessToken, CustomerAccessTokenRenewPayloadQueryDefinition queryDef) { + startField("customerAccessTokenRenew"); - public MetafieldReferenceConnection(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new MetafieldReferenceEdge(jsonAsObject(element1, key))); - } + _queryBuilder.append("(customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - responseData.put(key, list1); + _queryBuilder.append(')'); - break; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenRenewPayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(UnknownMetafieldReference.create(jsonAsObject(element1, key))); - } + return this; + } - responseData.put(key, list1); + /** + * Activates a customer. + */ + public MutationQuery customerActivate(ID id, CustomerActivateInput input, CustomerActivatePayloadQueryDefinition queryDef) { + startField("customerActivate"); - break; - } + _queryBuilder.append("(id:"); + Query.appendQuotedString(_queryBuilder, id.toString()); - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + _queryBuilder.append(",input:"); + input.appendTo(_queryBuilder); - break; - } + _queryBuilder.append(')'); - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + _queryBuilder.append('{'); + queryDef.define(new CustomerActivatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - public String getGraphQlTypeName() { - return "MetafieldReferenceConnection"; + return this; } /** - * A list of edges. + * Activates a customer with the activation url received from `customerCreate`. */ + public MutationQuery customerActivateByUrl(String activationUrl, String password, CustomerActivateByUrlPayloadQueryDefinition queryDef) { + startField("customerActivateByUrl"); - public List getEdges() { - return (List) get("edges"); - } + _queryBuilder.append("(activationUrl:"); + Query.appendQuotedString(_queryBuilder, activationUrl.toString()); + + _queryBuilder.append(",password:"); + Query.appendQuotedString(_queryBuilder, password.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CustomerActivateByUrlPayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - public MetafieldReferenceConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); return this; } /** - * A list of the nodes contained in MetafieldReferenceEdge. + * Creates a new address for a customer. */ + public MutationQuery customerAddressCreate(String customerAccessToken, MailingAddressInput address, CustomerAddressCreatePayloadQueryDefinition queryDef) { + startField("customerAddressCreate"); - public List getNodes() { - return (List) get("nodes"); - } + _queryBuilder.append("(customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + + _queryBuilder.append(",address:"); + address.appendTo(_queryBuilder); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CustomerAddressCreatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - public MetafieldReferenceConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); return this; } /** - * Information to aid in pagination. + * Permanently deletes the address of an existing customer. */ + public MutationQuery customerAddressDelete(ID id, String customerAccessToken, CustomerAddressDeletePayloadQueryDefinition queryDef) { + startField("customerAddressDelete"); - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } + _queryBuilder.append("(id:"); + Query.appendQuotedString(_queryBuilder, id.toString()); + + _queryBuilder.append(",customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CustomerAddressDeletePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - public MetafieldReferenceConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; + /** + * Updates the address of an existing customer. + */ + public MutationQuery customerAddressUpdate(String customerAccessToken, ID id, MailingAddressInput address, CustomerAddressUpdatePayloadQueryDefinition queryDef) { + startField("customerAddressUpdate"); - case "nodes": return false; + _queryBuilder.append("(customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - case "pageInfo": return true; + _queryBuilder.append(",id:"); + Query.appendQuotedString(_queryBuilder, id.toString()); - default: return false; - } - } - } + _queryBuilder.append(",address:"); + address.appendTo(_queryBuilder); - public interface MetafieldReferenceEdgeQueryDefinition { - void define(MetafieldReferenceEdgeQuery _queryBuilder); - } + _queryBuilder.append(')'); - /** - * An auto-generated type which holds one MetafieldReference and a cursor during pagination. - */ - public static class MetafieldReferenceEdgeQuery extends Query { - MetafieldReferenceEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + _queryBuilder.append('{'); + queryDef.define(new CustomerAddressUpdatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * A cursor for use in pagination. + * Creates a new customer. */ - public MetafieldReferenceEdgeQuery cursor() { - startField("cursor"); + public MutationQuery customerCreate(CustomerCreateInput input, CustomerCreatePayloadQueryDefinition queryDef) { + startField("customerCreate"); + + _queryBuilder.append("(input:"); + input.appendTo(_queryBuilder); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CustomerCreatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The item at the end of MetafieldReferenceEdge. + * Updates the default address of an existing customer. */ - public MetafieldReferenceEdgeQuery node(MetafieldReferenceQueryDefinition queryDef) { - startField("node"); + public MutationQuery customerDefaultAddressUpdate(String customerAccessToken, ID addressId, CustomerDefaultAddressUpdatePayloadQueryDefinition queryDef) { + startField("customerDefaultAddressUpdate"); + + _queryBuilder.append("(customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + + _queryBuilder.append(",addressId:"); + Query.appendQuotedString(_queryBuilder, addressId.toString()); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new MetafieldReferenceQuery(_queryBuilder)); + queryDef.define(new CustomerDefaultAddressUpdatePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - } - - /** - * An auto-generated type which holds one MetafieldReference and a cursor during pagination. - */ - public static class MetafieldReferenceEdge extends AbstractResponse { - public MetafieldReferenceEdge() { - } - - public MetafieldReferenceEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } + /** + * Sends a reset password email to the customer. The reset password + * email contains a reset password URL and token that you can pass to + * the [`customerResetByUrl`](https://shopify.dev/api/storefront/latest/mutations/customerResetByUrl) + * or + * [`customerReset`](https://shopify.dev/api/storefront/latest/mutations/customerReset) mutation to + * reset the + * customer password. + * This mutation is throttled by IP. With private access, + * you can provide a + * [`Shopify-Storefront-Buyer-IP`](https://shopify.dev/api/usage/authentication#optional-ip-header) + * instead of the request IP. + * The header is case-sensitive and must be sent as `Shopify-Storefront-Buyer-IP`. + * Make sure that the value provided to `Shopify-Storefront-Buyer-IP` is trusted. Unthrottled access to + * this + * mutation presents a security risk. + */ + public MutationQuery customerRecover(String email, CustomerRecoverPayloadQueryDefinition queryDef) { + startField("customerRecover"); - case "node": { - responseData.put(key, UnknownMetafieldReference.create(jsonAsObject(field.getValue(), key))); + _queryBuilder.append("(email:"); + Query.appendQuotedString(_queryBuilder, email.toString()); - break; - } + _queryBuilder.append(')'); - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + _queryBuilder.append('{'); + queryDef.define(new CustomerRecoverPayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - public String getGraphQlTypeName() { - return "MetafieldReferenceEdge"; + return this; } /** - * A cursor for use in pagination. + * "Resets a customer’s password with the token received from a reset password email. You can send a + * reset password email with the + * [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation." */ + public MutationQuery customerReset(ID id, CustomerResetInput input, CustomerResetPayloadQueryDefinition queryDef) { + startField("customerReset"); - public String getCursor() { - return (String) get("cursor"); - } + _queryBuilder.append("(id:"); + Query.appendQuotedString(_queryBuilder, id.toString()); + + _queryBuilder.append(",input:"); + input.appendTo(_queryBuilder); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CustomerResetPayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - public MetafieldReferenceEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); return this; } /** - * The item at the end of MetafieldReferenceEdge. + * "Resets a customer’s password with the reset password URL received from a reset password email. You + * can send a reset password email with the + * [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation." */ + public MutationQuery customerResetByUrl(String resetUrl, String password, CustomerResetByUrlPayloadQueryDefinition queryDef) { + startField("customerResetByUrl"); - public MetafieldReference getNode() { - return (MetafieldReference) get("node"); - } + _queryBuilder.append("(resetUrl:"); + Query.appendQuotedString(_queryBuilder, resetUrl.toString()); + + _queryBuilder.append(",password:"); + Query.appendQuotedString(_queryBuilder, password.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CustomerResetByUrlPayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - public MetafieldReferenceEdge setNode(MetafieldReference arg) { - optimisticData.put(getKey("node"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; + /** + * Updates an existing customer. + */ + public MutationQuery customerUpdate(String customerAccessToken, CustomerUpdateInput customer, CustomerUpdatePayloadQueryDefinition queryDef) { + startField("customerUpdate"); - case "node": return false; + _queryBuilder.append("(customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - default: return false; - } - } - } + _queryBuilder.append(",customer:"); + customer.appendTo(_queryBuilder); - public interface MetafieldsSetUserErrorQueryDefinition { - void define(MetafieldsSetUserErrorQuery _queryBuilder); - } + _queryBuilder.append(')'); - /** - * An error that occurs during the execution of `MetafieldsSet`. - */ - public static class MetafieldsSetUserErrorQuery extends Query { - MetafieldsSetUserErrorQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + _queryBuilder.append('{'); + queryDef.define(new CustomerUpdatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * The error code. + * Create a new Shop Pay payment request session. */ - public MetafieldsSetUserErrorQuery code() { - startField("code"); + public MutationQuery shopPayPaymentRequestSessionCreate(String sourceIdentifier, ShopPayPaymentRequestInput paymentRequest, ShopPayPaymentRequestSessionCreatePayloadQueryDefinition queryDef) { + startField("shopPayPaymentRequestSessionCreate"); + + _queryBuilder.append("(sourceIdentifier:"); + Query.appendQuotedString(_queryBuilder, sourceIdentifier.toString()); + + _queryBuilder.append(",paymentRequest:"); + paymentRequest.appendTo(_queryBuilder); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestSessionCreatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The index of the array element that's causing the error. - */ - public MetafieldsSetUserErrorQuery elementIndex() { - startField("elementIndex"); + public class ShopPayPaymentRequestSessionSubmitArguments extends Arguments { + ShopPayPaymentRequestSessionSubmitArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } - return this; + /** + * The order name to be used for the order created from the payment request. + */ + public ShopPayPaymentRequestSessionSubmitArguments orderName(String value) { + if (value != null) { + startArgument("orderName"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + } + + public interface ShopPayPaymentRequestSessionSubmitArgumentsDefinition { + void define(ShopPayPaymentRequestSessionSubmitArguments args); } /** - * The path to the input field that caused the error. + * Submits a Shop Pay payment request session. */ - public MetafieldsSetUserErrorQuery field() { - startField("field"); - - return this; + public MutationQuery shopPayPaymentRequestSessionSubmit(String token, ShopPayPaymentRequestInput paymentRequest, String idempotencyKey, ShopPayPaymentRequestSessionSubmitPayloadQueryDefinition queryDef) { + return shopPayPaymentRequestSessionSubmit(token, paymentRequest, idempotencyKey, args -> {}, queryDef); } /** - * The error message. + * Submits a Shop Pay payment request session. */ - public MetafieldsSetUserErrorQuery message() { - startField("message"); + public MutationQuery shopPayPaymentRequestSessionSubmit(String token, ShopPayPaymentRequestInput paymentRequest, String idempotencyKey, ShopPayPaymentRequestSessionSubmitArgumentsDefinition argsDef, ShopPayPaymentRequestSessionSubmitPayloadQueryDefinition queryDef) { + startField("shopPayPaymentRequestSessionSubmit"); + + _queryBuilder.append("(token:"); + Query.appendQuotedString(_queryBuilder, token.toString()); + + _queryBuilder.append(",paymentRequest:"); + paymentRequest.appendTo(_queryBuilder); + + _queryBuilder.append(",idempotencyKey:"); + Query.appendQuotedString(_queryBuilder, idempotencyKey.toString()); + + argsDef.define(new ShopPayPaymentRequestSessionSubmitArguments(_queryBuilder)); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestSessionSubmitPayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } + + public String toString() { + return _queryBuilder.toString(); + } } /** - * An error that occurs during the execution of `MetafieldsSet`. + * The schema’s entry-point for mutations. This acts as the public, top-level API from which all + * mutation queries must start. */ - public static class MetafieldsSetUserError extends AbstractResponse implements DisplayableError { - public MetafieldsSetUserError() { + public static class Mutation extends AbstractResponse { + public Mutation() { } - public MetafieldsSetUserError(JsonObject fields) throws SchemaViolationError { + public Mutation(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "code": { - MetafieldsSetUserErrorCode optional1 = null; + case "cartAttributesUpdate": { + CartAttributesUpdatePayload optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = MetafieldsSetUserErrorCode.fromGraphQl(jsonAsString(field.getValue(), key)); + optional1 = new CartAttributesUpdatePayload(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -47973,10 +44807,10 @@ public MetafieldsSetUserError(JsonObject fields) throws SchemaViolationError { break; } - case "elementIndex": { - Integer optional1 = null; + case "cartBillingAddressUpdate": { + CartBillingAddressUpdatePayload optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); + optional1 = new CartBillingAddressUpdatePayload(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -47984,15 +44818,10 @@ public MetafieldsSetUserError(JsonObject fields) throws SchemaViolationError { break; } - case "field": { - List optional1 = null; + case "cartBuyerIdentityUpdate": { + CartBuyerIdentityUpdatePayload optional1 = null; if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } - - optional1 = list1; + optional1 = new CartBuyerIdentityUpdatePayload(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -48000,351 +44829,241 @@ public MetafieldsSetUserError(JsonObject fields) throws SchemaViolationError { break; } - case "message": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "cartCreate": { + CartCreatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartCreatePayload(jsonAsObject(field.getValue(), key)); + } - break; - } + responseData.put(key, optional1); - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "MetafieldsSetUserError"; - } - - /** - * The error code. - */ - - public MetafieldsSetUserErrorCode getCode() { - return (MetafieldsSetUserErrorCode) get("code"); - } - - public MetafieldsSetUserError setCode(MetafieldsSetUserErrorCode arg) { - optimisticData.put(getKey("code"), arg); - return this; - } - - /** - * The index of the array element that's causing the error. - */ - - public Integer getElementIndex() { - return (Integer) get("elementIndex"); - } - - public MetafieldsSetUserError setElementIndex(Integer arg) { - optimisticData.put(getKey("elementIndex"), arg); - return this; - } - /** - * The path to the input field that caused the error. - */ - - public List getField() { - return (List) get("field"); - } - - public MetafieldsSetUserError setField(List arg) { - optimisticData.put(getKey("field"), arg); - return this; - } - - /** - * The error message. - */ - - public String getMessage() { - return (String) get("message"); - } + case "cartDiscountCodesUpdate": { + CartDiscountCodesUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartDiscountCodesUpdatePayload(jsonAsObject(field.getValue(), key)); + } - public MetafieldsSetUserError setMessage(String arg) { - optimisticData.put(getKey("message"), arg); - return this; - } + responseData.put(key, optional1); - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "code": return false; + break; + } - case "elementIndex": return false; + case "cartGiftCardCodesUpdate": { + CartGiftCardCodesUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartGiftCardCodesUpdatePayload(jsonAsObject(field.getValue(), key)); + } - case "field": return false; + responseData.put(key, optional1); - case "message": return false; + break; + } - default: return false; - } - } - } + case "cartLinesAdd": { + CartLinesAddPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartLinesAddPayload(jsonAsObject(field.getValue(), key)); + } - /** - * Possible error codes that can be returned by `MetafieldsSetUserError`. - */ - public enum MetafieldsSetUserErrorCode { - /** - * The input value is blank. - */ - BLANK, + responseData.put(key, optional1); - /** - * The input value isn't included in the list. - */ - INCLUSION, + break; + } - /** - * The owner ID is invalid. - */ - INVALID_OWNER, + case "cartLinesRemove": { + CartLinesRemovePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartLinesRemovePayload(jsonAsObject(field.getValue(), key)); + } - /** - * The type is invalid. - */ - INVALID_TYPE, + responseData.put(key, optional1); - /** - * The value is invalid for metafield type or for definition options. - */ - INVALID_VALUE, + break; + } - /** - * The input value should be less than or equal to the maximum value allowed. - */ - LESS_THAN_OR_EQUAL_TO, + case "cartLinesUpdate": { + CartLinesUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartLinesUpdatePayload(jsonAsObject(field.getValue(), key)); + } - /** - * The input value needs to be blank. - */ - PRESENT, + responseData.put(key, optional1); - /** - * The input value is too long. - */ - TOO_LONG, + break; + } - /** - * The input value is too short. - */ - TOO_SHORT, + case "cartMetafieldDelete": { + CartMetafieldDeletePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartMetafieldDeletePayload(jsonAsObject(field.getValue(), key)); + } - UNKNOWN_VALUE; + responseData.put(key, optional1); - public static MetafieldsSetUserErrorCode fromGraphQl(String value) { - if (value == null) { - return null; - } + break; + } - switch (value) { - case "BLANK": { - return BLANK; - } + case "cartMetafieldsSet": { + CartMetafieldsSetPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartMetafieldsSetPayload(jsonAsObject(field.getValue(), key)); + } - case "INCLUSION": { - return INCLUSION; - } + responseData.put(key, optional1); - case "INVALID_OWNER": { - return INVALID_OWNER; - } + break; + } - case "INVALID_TYPE": { - return INVALID_TYPE; - } + case "cartNoteUpdate": { + CartNoteUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartNoteUpdatePayload(jsonAsObject(field.getValue(), key)); + } - case "INVALID_VALUE": { - return INVALID_VALUE; - } + responseData.put(key, optional1); - case "LESS_THAN_OR_EQUAL_TO": { - return LESS_THAN_OR_EQUAL_TO; - } + break; + } - case "PRESENT": { - return PRESENT; - } + case "cartPaymentUpdate": { + CartPaymentUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartPaymentUpdatePayload(jsonAsObject(field.getValue(), key)); + } - case "TOO_LONG": { - return TOO_LONG; - } + responseData.put(key, optional1); - case "TOO_SHORT": { - return TOO_SHORT; - } + break; + } - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case BLANK: { - return "BLANK"; - } + case "cartSelectedDeliveryOptionsUpdate": { + CartSelectedDeliveryOptionsUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartSelectedDeliveryOptionsUpdatePayload(jsonAsObject(field.getValue(), key)); + } - case INCLUSION: { - return "INCLUSION"; - } + responseData.put(key, optional1); - case INVALID_OWNER: { - return "INVALID_OWNER"; - } + break; + } - case INVALID_TYPE: { - return "INVALID_TYPE"; - } + case "cartSubmitForCompletion": { + CartSubmitForCompletionPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartSubmitForCompletionPayload(jsonAsObject(field.getValue(), key)); + } - case INVALID_VALUE: { - return "INVALID_VALUE"; - } + responseData.put(key, optional1); - case LESS_THAN_OR_EQUAL_TO: { - return "LESS_THAN_OR_EQUAL_TO"; - } + break; + } - case PRESENT: { - return "PRESENT"; - } + case "customerAccessTokenCreate": { + CustomerAccessTokenCreatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessTokenCreatePayload(jsonAsObject(field.getValue(), key)); + } - case TOO_LONG: { - return "TOO_LONG"; - } + responseData.put(key, optional1); - case TOO_SHORT: { - return "TOO_SHORT"; - } + break; + } - default: { - return ""; - } - } - } - } + case "customerAccessTokenCreateWithMultipass": { + CustomerAccessTokenCreateWithMultipassPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessTokenCreateWithMultipassPayload(jsonAsObject(field.getValue(), key)); + } - public interface MetaobjectQueryDefinition { - void define(MetaobjectQuery _queryBuilder); - } + responseData.put(key, optional1); - /** - * An instance of a user-defined model based on a MetaobjectDefinition. - */ - public static class MetaobjectQuery extends Query { - MetaobjectQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + break; + } - startField("id"); - } + case "customerAccessTokenDelete": { + CustomerAccessTokenDeletePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessTokenDeletePayload(jsonAsObject(field.getValue(), key)); + } - /** - * Accesses a field of the object by key. - */ - public MetaobjectQuery field(String key, MetaobjectFieldQueryDefinition queryDef) { - startField("field"); + responseData.put(key, optional1); - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + break; + } - _queryBuilder.append(')'); + case "customerAccessTokenRenew": { + CustomerAccessTokenRenewPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessTokenRenewPayload(jsonAsObject(field.getValue(), key)); + } - _queryBuilder.append('{'); - queryDef.define(new MetaobjectFieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + responseData.put(key, optional1); - return this; - } + break; + } - /** - * All object fields with defined values. - * Omitted object keys can be assumed null, and no guarantees are made about field order. - */ - public MetaobjectQuery fields(MetaobjectFieldQueryDefinition queryDef) { - startField("fields"); + case "customerActivate": { + CustomerActivatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerActivatePayload(jsonAsObject(field.getValue(), key)); + } - _queryBuilder.append('{'); - queryDef.define(new MetaobjectFieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + responseData.put(key, optional1); - return this; - } + break; + } - /** - * The unique handle of the metaobject. Useful as a custom ID. - */ - public MetaobjectQuery handle() { - startField("handle"); + case "customerActivateByUrl": { + CustomerActivateByUrlPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerActivateByUrlPayload(jsonAsObject(field.getValue(), key)); + } - return this; - } + responseData.put(key, optional1); - /** - * The URL used for viewing the metaobject on the shop's Online Store. Returns `null` if the metaobject - * definition doesn't have the `online_store` capability. - */ - public MetaobjectQuery onlineStoreUrl() { - startField("onlineStoreUrl"); + break; + } - return this; - } + case "customerAddressCreate": { + CustomerAddressCreatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAddressCreatePayload(jsonAsObject(field.getValue(), key)); + } - /** - * The metaobject's SEO information. Returns `null` if the metaobject definition - * doesn't have the `renderable` capability. - */ - public MetaobjectQuery seo(MetaobjectSEOQueryDefinition queryDef) { - startField("seo"); + responseData.put(key, optional1); - _queryBuilder.append('{'); - queryDef.define(new MetaobjectSEOQuery(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; - } + case "customerAddressDelete": { + CustomerAddressDeletePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAddressDeletePayload(jsonAsObject(field.getValue(), key)); + } - /** - * The type of the metaobject. Defines the namespace of its associated metafields. - */ - public MetaobjectQuery type() { - startField("type"); + responseData.put(key, optional1); - return this; - } + break; + } - /** - * The date and time when the metaobject was last updated. - */ - public MetaobjectQuery updatedAt() { - startField("updatedAt"); + case "customerAddressUpdate": { + CustomerAddressUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAddressUpdatePayload(jsonAsObject(field.getValue(), key)); + } - return this; - } - } + responseData.put(key, optional1); - /** - * An instance of a user-defined model based on a MetaobjectDefinition. - */ - public static class Metaobject extends AbstractResponse implements MenuItemResource, MetafieldReference, Node, OnlineStorePublishable { - public Metaobject() { - } + break; + } - public Metaobject(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "field": { - MetaobjectField optional1 = null; + case "customerCreate": { + CustomerCreatePayload optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MetaobjectField(jsonAsObject(field.getValue(), key)); + optional1 = new CustomerCreatePayload(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -48352,33 +45071,43 @@ public Metaobject(JsonObject fields) throws SchemaViolationError { break; } - case "fields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new MetaobjectField(jsonAsObject(element1, key))); + case "customerDefaultAddressUpdate": { + CustomerDefaultAddressUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerDefaultAddressUpdatePayload(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "handle": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "customerRecover": { + CustomerRecoverPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerRecoverPayload(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case "customerReset": { + CustomerResetPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerResetPayload(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "onlineStoreUrl": { - String optional1 = null; + case "customerResetByUrl": { + CustomerResetByUrlPayload optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new CustomerResetByUrlPayload(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -48386,10 +45115,10 @@ public Metaobject(JsonObject fields) throws SchemaViolationError { break; } - case "seo": { - MetaobjectSEO optional1 = null; + case "customerUpdate": { + CustomerUpdatePayload optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MetaobjectSEO(jsonAsObject(field.getValue(), key)); + optional1 = new CustomerUpdatePayload(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -48397,14 +45126,24 @@ public Metaobject(JsonObject fields) throws SchemaViolationError { break; } - case "type": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "shopPayPaymentRequestSessionCreate": { + ShopPayPaymentRequestSessionCreatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPayPaymentRequestSessionCreatePayload(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "updatedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + case "shopPayPaymentRequestSessionSubmit": { + ShopPayPaymentRequestSessionSubmitPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPayPaymentRequestSessionSubmitPayload(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } @@ -48420,1202 +45159,1082 @@ public Metaobject(JsonObject fields) throws SchemaViolationError { } } - public Metaobject(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "Metaobject"; + return "Mutation"; } /** - * Accesses a field of the object by key. + * Updates the attributes on a cart. */ - public MetaobjectField getField() { - return (MetaobjectField) get("field"); + public CartAttributesUpdatePayload getCartAttributesUpdate() { + return (CartAttributesUpdatePayload) get("cartAttributesUpdate"); } - public Metaobject setField(MetaobjectField arg) { - optimisticData.put(getKey("field"), arg); + public Mutation setCartAttributesUpdate(CartAttributesUpdatePayload arg) { + optimisticData.put(getKey("cartAttributesUpdate"), arg); return this; } /** - * All object fields with defined values. - * Omitted object keys can be assumed null, and no guarantees are made about field order. + * Updates the billing address on the cart. */ - public List getFields() { - return (List) get("fields"); + public CartBillingAddressUpdatePayload getCartBillingAddressUpdate() { + return (CartBillingAddressUpdatePayload) get("cartBillingAddressUpdate"); } - public Metaobject setFields(List arg) { - optimisticData.put(getKey("fields"), arg); + public Mutation setCartBillingAddressUpdate(CartBillingAddressUpdatePayload arg) { + optimisticData.put(getKey("cartBillingAddressUpdate"), arg); return this; } /** - * The unique handle of the metaobject. Useful as a custom ID. + * Updates customer information associated with a cart. + * Buyer identity is used to determine + * [international + * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing) + * and should match the customer's shipping address. */ - public String getHandle() { - return (String) get("handle"); + public CartBuyerIdentityUpdatePayload getCartBuyerIdentityUpdate() { + return (CartBuyerIdentityUpdatePayload) get("cartBuyerIdentityUpdate"); } - public Metaobject setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); + public Mutation setCartBuyerIdentityUpdate(CartBuyerIdentityUpdatePayload arg) { + optimisticData.put(getKey("cartBuyerIdentityUpdate"), arg); return this; } /** - * A globally-unique ID. - */ - - public ID getId() { - return (ID) get("id"); - } - - /** - * The URL used for viewing the metaobject on the shop's Online Store. Returns `null` if the metaobject - * definition doesn't have the `online_store` capability. + * Creates a new cart. */ - public String getOnlineStoreUrl() { - return (String) get("onlineStoreUrl"); + public CartCreatePayload getCartCreate() { + return (CartCreatePayload) get("cartCreate"); } - public Metaobject setOnlineStoreUrl(String arg) { - optimisticData.put(getKey("onlineStoreUrl"), arg); + public Mutation setCartCreate(CartCreatePayload arg) { + optimisticData.put(getKey("cartCreate"), arg); return this; } /** - * The metaobject's SEO information. Returns `null` if the metaobject definition - * doesn't have the `renderable` capability. + * Updates the discount codes applied to the cart. */ - public MetaobjectSEO getSeo() { - return (MetaobjectSEO) get("seo"); + public CartDiscountCodesUpdatePayload getCartDiscountCodesUpdate() { + return (CartDiscountCodesUpdatePayload) get("cartDiscountCodesUpdate"); } - public Metaobject setSeo(MetaobjectSEO arg) { - optimisticData.put(getKey("seo"), arg); + public Mutation setCartDiscountCodesUpdate(CartDiscountCodesUpdatePayload arg) { + optimisticData.put(getKey("cartDiscountCodesUpdate"), arg); return this; } /** - * The type of the metaobject. Defines the namespace of its associated metafields. + * Updates the gift card codes applied to the cart. */ - public String getType() { - return (String) get("type"); + public CartGiftCardCodesUpdatePayload getCartGiftCardCodesUpdate() { + return (CartGiftCardCodesUpdatePayload) get("cartGiftCardCodesUpdate"); } - public Metaobject setType(String arg) { - optimisticData.put(getKey("type"), arg); + public Mutation setCartGiftCardCodesUpdate(CartGiftCardCodesUpdatePayload arg) { + optimisticData.put(getKey("cartGiftCardCodesUpdate"), arg); return this; } /** - * The date and time when the metaobject was last updated. + * Adds a merchandise line to the cart. */ - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); + public CartLinesAddPayload getCartLinesAdd() { + return (CartLinesAddPayload) get("cartLinesAdd"); } - public Metaobject setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); + public Mutation setCartLinesAdd(CartLinesAddPayload arg) { + optimisticData.put(getKey("cartLinesAdd"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "field": return true; - - case "fields": return true; - - case "handle": return false; - - case "id": return false; - - case "onlineStoreUrl": return false; - - case "seo": return true; - - case "type": return false; - - case "updatedAt": return false; - - default: return false; - } - } - } - - public interface MetaobjectConnectionQueryDefinition { - void define(MetaobjectConnectionQuery _queryBuilder); - } - - /** - * An auto-generated type for paginating through multiple Metaobjects. - */ - public static class MetaobjectConnectionQuery extends Query { - MetaobjectConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - /** - * A list of edges. + * Removes one or more merchandise lines from the cart. */ - public MetaobjectConnectionQuery edges(MetaobjectEdgeQueryDefinition queryDef) { - startField("edges"); - _queryBuilder.append('{'); - queryDef.define(new MetaobjectEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CartLinesRemovePayload getCartLinesRemove() { + return (CartLinesRemovePayload) get("cartLinesRemove"); + } + public Mutation setCartLinesRemove(CartLinesRemovePayload arg) { + optimisticData.put(getKey("cartLinesRemove"), arg); return this; } /** - * A list of the nodes contained in MetaobjectEdge. + * Updates one or more merchandise lines on a cart. */ - public MetaobjectConnectionQuery nodes(MetaobjectQueryDefinition queryDef) { - startField("nodes"); - _queryBuilder.append('{'); - queryDef.define(new MetaobjectQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CartLinesUpdatePayload getCartLinesUpdate() { + return (CartLinesUpdatePayload) get("cartLinesUpdate"); + } + public Mutation setCartLinesUpdate(CartLinesUpdatePayload arg) { + optimisticData.put(getKey("cartLinesUpdate"), arg); return this; } /** - * Information to aid in pagination. + * Deletes a cart metafield. */ - public MetaobjectConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * An auto-generated type for paginating through multiple Metaobjects. - */ - public static class MetaobjectConnection extends AbstractResponse { - public MetaobjectConnection() { - } - - public MetaobjectConnection(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new MetaobjectEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Metaobject(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - - break; - } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public CartMetafieldDeletePayload getCartMetafieldDelete() { + return (CartMetafieldDeletePayload) get("cartMetafieldDelete"); } - public String getGraphQlTypeName() { - return "MetaobjectConnection"; + public Mutation setCartMetafieldDelete(CartMetafieldDeletePayload arg) { + optimisticData.put(getKey("cartMetafieldDelete"), arg); + return this; } /** - * A list of edges. + * Sets cart metafield values. Cart metafield values will be set regardless if they were previously + * created or not. + * Allows a maximum of 25 cart metafields to be set at a time. */ - public List getEdges() { - return (List) get("edges"); + public CartMetafieldsSetPayload getCartMetafieldsSet() { + return (CartMetafieldsSetPayload) get("cartMetafieldsSet"); } - public MetaobjectConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); + public Mutation setCartMetafieldsSet(CartMetafieldsSetPayload arg) { + optimisticData.put(getKey("cartMetafieldsSet"), arg); return this; } /** - * A list of the nodes contained in MetaobjectEdge. + * Updates the note on the cart. */ - public List getNodes() { - return (List) get("nodes"); + public CartNoteUpdatePayload getCartNoteUpdate() { + return (CartNoteUpdatePayload) get("cartNoteUpdate"); } - public MetaobjectConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + public Mutation setCartNoteUpdate(CartNoteUpdatePayload arg) { + optimisticData.put(getKey("cartNoteUpdate"), arg); return this; } /** - * Information to aid in pagination. + * Update the customer's payment method that will be used to checkout. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public CartPaymentUpdatePayload getCartPaymentUpdate() { + return (CartPaymentUpdatePayload) get("cartPaymentUpdate"); } - public MetaobjectConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public Mutation setCartPaymentUpdate(CartPaymentUpdatePayload arg) { + optimisticData.put(getKey("cartPaymentUpdate"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return true; - - case "pageInfo": return true; - - default: return false; - } - } - } - - public interface MetaobjectEdgeQueryDefinition { - void define(MetaobjectEdgeQuery _queryBuilder); - } - - /** - * An auto-generated type which holds one Metaobject and a cursor during pagination. - */ - public static class MetaobjectEdgeQuery extends Query { - MetaobjectEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - /** - * A cursor for use in pagination. + * Update the selected delivery options for a delivery group. */ - public MetaobjectEdgeQuery cursor() { - startField("cursor"); - return this; + public CartSelectedDeliveryOptionsUpdatePayload getCartSelectedDeliveryOptionsUpdate() { + return (CartSelectedDeliveryOptionsUpdatePayload) get("cartSelectedDeliveryOptionsUpdate"); } - /** - * The item at the end of MetaobjectEdge. - */ - public MetaobjectEdgeQuery node(MetaobjectQueryDefinition queryDef) { - startField("node"); - - _queryBuilder.append('{'); - queryDef.define(new MetaobjectQuery(_queryBuilder)); - _queryBuilder.append('}'); - + public Mutation setCartSelectedDeliveryOptionsUpdate(CartSelectedDeliveryOptionsUpdatePayload arg) { + optimisticData.put(getKey("cartSelectedDeliveryOptionsUpdate"), arg); return this; } - } - - /** - * An auto-generated type which holds one Metaobject and a cursor during pagination. - */ - public static class MetaobjectEdge extends AbstractResponse { - public MetaobjectEdge() { - } - - public MetaobjectEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "node": { - responseData.put(key, new Metaobject(jsonAsObject(field.getValue(), key))); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "MetaobjectEdge"; - } /** - * A cursor for use in pagination. + * Submit the cart for checkout completion. */ - public String getCursor() { - return (String) get("cursor"); + public CartSubmitForCompletionPayload getCartSubmitForCompletion() { + return (CartSubmitForCompletionPayload) get("cartSubmitForCompletion"); } - public MetaobjectEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public Mutation setCartSubmitForCompletion(CartSubmitForCompletionPayload arg) { + optimisticData.put(getKey("cartSubmitForCompletion"), arg); return this; } /** - * The item at the end of MetaobjectEdge. + * Creates a customer access token. + * The customer access token is required to modify the customer object in any way. */ - public Metaobject getNode() { - return (Metaobject) get("node"); + public CustomerAccessTokenCreatePayload getCustomerAccessTokenCreate() { + return (CustomerAccessTokenCreatePayload) get("customerAccessTokenCreate"); } - public MetaobjectEdge setNode(Metaobject arg) { - optimisticData.put(getKey("node"), arg); + public Mutation setCustomerAccessTokenCreate(CustomerAccessTokenCreatePayload arg) { + optimisticData.put(getKey("customerAccessTokenCreate"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; - - case "node": return true; - - default: return false; - } - } - } - - public interface MetaobjectFieldQueryDefinition { - void define(MetaobjectFieldQuery _queryBuilder); - } - - /** - * Provides the value of a Metaobject field. - */ - public static class MetaobjectFieldQuery extends Query { - MetaobjectFieldQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - /** - * The field key. + * Creates a customer access token using a + * [multipass token](https://shopify.dev/api/multipass) instead of email and + * password. A customer record is created if the customer doesn't exist. If a customer + * record already exists but the record is disabled, then the customer record is enabled. */ - public MetaobjectFieldQuery key() { - startField("key"); + public CustomerAccessTokenCreateWithMultipassPayload getCustomerAccessTokenCreateWithMultipass() { + return (CustomerAccessTokenCreateWithMultipassPayload) get("customerAccessTokenCreateWithMultipass"); + } + + public Mutation setCustomerAccessTokenCreateWithMultipass(CustomerAccessTokenCreateWithMultipassPayload arg) { + optimisticData.put(getKey("customerAccessTokenCreateWithMultipass"), arg); return this; } /** - * A referenced object if the field type is a resource reference. + * Permanently destroys a customer access token. */ - public MetaobjectFieldQuery reference(MetafieldReferenceQueryDefinition queryDef) { - startField("reference"); - _queryBuilder.append('{'); - queryDef.define(new MetafieldReferenceQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CustomerAccessTokenDeletePayload getCustomerAccessTokenDelete() { + return (CustomerAccessTokenDeletePayload) get("customerAccessTokenDelete"); + } + public Mutation setCustomerAccessTokenDelete(CustomerAccessTokenDeletePayload arg) { + optimisticData.put(getKey("customerAccessTokenDelete"), arg); return this; } - public class ReferencesArguments extends Arguments { - ReferencesArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public ReferencesArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public ReferencesArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the last `n` elements from the list. - */ - public ReferencesArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public ReferencesArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - } + /** + * Renews a customer access token. + * Access token renewal must happen *before* a token expires. + * If a token has already expired, a new one should be created instead via `customerAccessTokenCreate`. + */ - public interface ReferencesArgumentsDefinition { - void define(ReferencesArguments args); + public CustomerAccessTokenRenewPayload getCustomerAccessTokenRenew() { + return (CustomerAccessTokenRenewPayload) get("customerAccessTokenRenew"); } - /** - * A list of referenced objects if the field type is a resource reference list. - */ - public MetaobjectFieldQuery references(MetafieldReferenceConnectionQueryDefinition queryDef) { - return references(args -> {}, queryDef); + public Mutation setCustomerAccessTokenRenew(CustomerAccessTokenRenewPayload arg) { + optimisticData.put(getKey("customerAccessTokenRenew"), arg); + return this; } /** - * A list of referenced objects if the field type is a resource reference list. + * Activates a customer. */ - public MetaobjectFieldQuery references(ReferencesArgumentsDefinition argsDef, MetafieldReferenceConnectionQueryDefinition queryDef) { - startField("references"); - - ReferencesArguments args = new ReferencesArguments(_queryBuilder); - argsDef.define(args); - ReferencesArguments.end(args); - _queryBuilder.append('{'); - queryDef.define(new MetafieldReferenceConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CustomerActivatePayload getCustomerActivate() { + return (CustomerActivatePayload) get("customerActivate"); + } + public Mutation setCustomerActivate(CustomerActivatePayload arg) { + optimisticData.put(getKey("customerActivate"), arg); return this; } /** - * The type name of the field. - * See the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). + * Activates a customer with the activation url received from `customerCreate`. */ - public MetaobjectFieldQuery type() { - startField("type"); + public CustomerActivateByUrlPayload getCustomerActivateByUrl() { + return (CustomerActivateByUrlPayload) get("customerActivateByUrl"); + } + + public Mutation setCustomerActivateByUrl(CustomerActivateByUrlPayload arg) { + optimisticData.put(getKey("customerActivateByUrl"), arg); return this; } /** - * The field value. + * Creates a new address for a customer. */ - public MetaobjectFieldQuery value() { - startField("value"); - return this; + public CustomerAddressCreatePayload getCustomerAddressCreate() { + return (CustomerAddressCreatePayload) get("customerAddressCreate"); } - } - /** - * Provides the value of a Metaobject field. - */ - public static class MetaobjectField extends AbstractResponse { - public MetaobjectField() { + public Mutation setCustomerAddressCreate(CustomerAddressCreatePayload arg) { + optimisticData.put(getKey("customerAddressCreate"), arg); + return this; } - public MetaobjectField(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "key": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Permanently deletes the address of an existing customer. + */ - break; - } + public CustomerAddressDeletePayload getCustomerAddressDelete() { + return (CustomerAddressDeletePayload) get("customerAddressDelete"); + } - case "reference": { - MetafieldReference optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = UnknownMetafieldReference.create(jsonAsObject(field.getValue(), key)); - } + public Mutation setCustomerAddressDelete(CustomerAddressDeletePayload arg) { + optimisticData.put(getKey("customerAddressDelete"), arg); + return this; + } - responseData.put(key, optional1); + /** + * Updates the address of an existing customer. + */ - break; - } + public CustomerAddressUpdatePayload getCustomerAddressUpdate() { + return (CustomerAddressUpdatePayload) get("customerAddressUpdate"); + } - case "references": { - MetafieldReferenceConnection optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MetafieldReferenceConnection(jsonAsObject(field.getValue(), key)); - } + public Mutation setCustomerAddressUpdate(CustomerAddressUpdatePayload arg) { + optimisticData.put(getKey("customerAddressUpdate"), arg); + return this; + } - responseData.put(key, optional1); + /** + * Creates a new customer. + */ - break; - } + public CustomerCreatePayload getCustomerCreate() { + return (CustomerCreatePayload) get("customerCreate"); + } - case "type": { - responseData.put(key, jsonAsString(field.getValue(), key)); + public Mutation setCustomerCreate(CustomerCreatePayload arg) { + optimisticData.put(getKey("customerCreate"), arg); + return this; + } - break; - } + /** + * Updates the default address of an existing customer. + */ - case "value": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + public CustomerDefaultAddressUpdatePayload getCustomerDefaultAddressUpdate() { + return (CustomerDefaultAddressUpdatePayload) get("customerDefaultAddressUpdate"); + } - responseData.put(key, optional1); + public Mutation setCustomerDefaultAddressUpdate(CustomerDefaultAddressUpdatePayload arg) { + optimisticData.put(getKey("customerDefaultAddressUpdate"), arg); + return this; + } - break; - } + /** + * Sends a reset password email to the customer. The reset password + * email contains a reset password URL and token that you can pass to + * the [`customerResetByUrl`](https://shopify.dev/api/storefront/latest/mutations/customerResetByUrl) + * or + * [`customerReset`](https://shopify.dev/api/storefront/latest/mutations/customerReset) mutation to + * reset the + * customer password. + * This mutation is throttled by IP. With private access, + * you can provide a + * [`Shopify-Storefront-Buyer-IP`](https://shopify.dev/api/usage/authentication#optional-ip-header) + * instead of the request IP. + * The header is case-sensitive and must be sent as `Shopify-Storefront-Buyer-IP`. + * Make sure that the value provided to `Shopify-Storefront-Buyer-IP` is trusted. Unthrottled access to + * this + * mutation presents a security risk. + */ - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public CustomerRecoverPayload getCustomerRecover() { + return (CustomerRecoverPayload) get("customerRecover"); } - public String getGraphQlTypeName() { - return "MetaobjectField"; + public Mutation setCustomerRecover(CustomerRecoverPayload arg) { + optimisticData.put(getKey("customerRecover"), arg); + return this; } /** - * The field key. + * "Resets a customer’s password with the token received from a reset password email. You can send a + * reset password email with the + * [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation." */ - public String getKey() { - return (String) get("key"); + public CustomerResetPayload getCustomerReset() { + return (CustomerResetPayload) get("customerReset"); } - public MetaobjectField setKey(String arg) { - optimisticData.put(getKey("key"), arg); + public Mutation setCustomerReset(CustomerResetPayload arg) { + optimisticData.put(getKey("customerReset"), arg); return this; } /** - * A referenced object if the field type is a resource reference. + * "Resets a customer’s password with the reset password URL received from a reset password email. You + * can send a reset password email with the + * [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation." */ - public MetafieldReference getReference() { - return (MetafieldReference) get("reference"); + public CustomerResetByUrlPayload getCustomerResetByUrl() { + return (CustomerResetByUrlPayload) get("customerResetByUrl"); } - public MetaobjectField setReference(MetafieldReference arg) { - optimisticData.put(getKey("reference"), arg); + public Mutation setCustomerResetByUrl(CustomerResetByUrlPayload arg) { + optimisticData.put(getKey("customerResetByUrl"), arg); return this; } /** - * A list of referenced objects if the field type is a resource reference list. + * Updates an existing customer. */ - public MetafieldReferenceConnection getReferences() { - return (MetafieldReferenceConnection) get("references"); + public CustomerUpdatePayload getCustomerUpdate() { + return (CustomerUpdatePayload) get("customerUpdate"); } - public MetaobjectField setReferences(MetafieldReferenceConnection arg) { - optimisticData.put(getKey("references"), arg); + public Mutation setCustomerUpdate(CustomerUpdatePayload arg) { + optimisticData.put(getKey("customerUpdate"), arg); return this; } /** - * The type name of the field. - * See the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). + * Create a new Shop Pay payment request session. */ - public String getType() { - return (String) get("type"); + public ShopPayPaymentRequestSessionCreatePayload getShopPayPaymentRequestSessionCreate() { + return (ShopPayPaymentRequestSessionCreatePayload) get("shopPayPaymentRequestSessionCreate"); } - public MetaobjectField setType(String arg) { - optimisticData.put(getKey("type"), arg); + public Mutation setShopPayPaymentRequestSessionCreate(ShopPayPaymentRequestSessionCreatePayload arg) { + optimisticData.put(getKey("shopPayPaymentRequestSessionCreate"), arg); return this; } /** - * The field value. + * Submits a Shop Pay payment request session. */ - public String getValue() { - return (String) get("value"); + public ShopPayPaymentRequestSessionSubmitPayload getShopPayPaymentRequestSessionSubmit() { + return (ShopPayPaymentRequestSessionSubmitPayload) get("shopPayPaymentRequestSessionSubmit"); } - public MetaobjectField setValue(String arg) { - optimisticData.put(getKey("value"), arg); + public Mutation setShopPayPaymentRequestSessionSubmit(ShopPayPaymentRequestSessionSubmitPayload arg) { + optimisticData.put(getKey("shopPayPaymentRequestSessionSubmit"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "key": return false; + case "cartAttributesUpdate": return true; - case "reference": return false; + case "cartBillingAddressUpdate": return true; - case "references": return true; + case "cartBuyerIdentityUpdate": return true; - case "type": return false; + case "cartCreate": return true; - case "value": return false; + case "cartDiscountCodesUpdate": return true; - default: return false; - } - } - } + case "cartGiftCardCodesUpdate": return true; - public static class MetaobjectHandleInput implements Serializable { - private String handle; + case "cartLinesAdd": return true; - private String type; + case "cartLinesRemove": return true; - public MetaobjectHandleInput(String handle, String type) { - this.handle = handle; + case "cartLinesUpdate": return true; - this.type = type; - } + case "cartMetafieldDelete": return true; - public String getHandle() { - return handle; - } + case "cartMetafieldsSet": return true; - public MetaobjectHandleInput setHandle(String handle) { - this.handle = handle; - return this; - } + case "cartNoteUpdate": return true; - public String getType() { - return type; - } + case "cartPaymentUpdate": return true; - public MetaobjectHandleInput setType(String type) { - this.type = type; - return this; - } + case "cartSelectedDeliveryOptionsUpdate": return true; - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + case "cartSubmitForCompletion": return true; - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("handle:"); - Query.appendQuotedString(_queryBuilder, handle.toString()); + case "customerAccessTokenCreate": return true; - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("type:"); - Query.appendQuotedString(_queryBuilder, type.toString()); + case "customerAccessTokenCreateWithMultipass": return true; - _queryBuilder.append('}'); + case "customerAccessTokenDelete": return true; + + case "customerAccessTokenRenew": return true; + + case "customerActivate": return true; + + case "customerActivateByUrl": return true; + + case "customerAddressCreate": return true; + + case "customerAddressDelete": return true; + + case "customerAddressUpdate": return true; + + case "customerCreate": return true; + + case "customerDefaultAddressUpdate": return true; + + case "customerRecover": return true; + + case "customerReset": return true; + + case "customerResetByUrl": return true; + + case "customerUpdate": return true; + + case "shopPayPaymentRequestSessionCreate": return true; + + case "shopPayPaymentRequestSessionSubmit": return true; + + default: return false; + } } } - public interface MetaobjectSEOQueryDefinition { - void define(MetaobjectSEOQuery _queryBuilder); + public interface NodeQueryDefinition { + void define(NodeQuery _queryBuilder); } /** - * SEO information for a metaobject. + * 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. */ - public static class MetaobjectSEOQuery extends Query { - MetaobjectSEOQuery(StringBuilder _queryBuilder) { + public static class NodeQuery extends Query { + NodeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("__typename"); } /** - * The meta description. + * A globally-unique ID. */ - public MetaobjectSEOQuery description(MetaobjectFieldQueryDefinition queryDef) { - startField("description"); - - _queryBuilder.append('{'); - queryDef.define(new MetaobjectFieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + public NodeQuery id() { + startField("id"); return this; } - /** - * The SEO title. - */ - public MetaobjectSEOQuery title(MetaobjectFieldQueryDefinition queryDef) { - startField("title"); - - _queryBuilder.append('{'); - queryDef.define(new MetaobjectFieldQuery(_queryBuilder)); + public NodeQuery onAppliedGiftCard(AppliedGiftCardQueryDefinition queryDef) { + startInlineFragment("AppliedGiftCard"); + queryDef.define(new AppliedGiftCardQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; } - } - /** - * SEO information for a metaobject. - */ - public static class MetaobjectSEO extends AbstractResponse { - public MetaobjectSEO() { + public NodeQuery onArticle(ArticleQueryDefinition queryDef) { + startInlineFragment("Article"); + queryDef.define(new ArticleQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public MetaobjectSEO(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "description": { - MetaobjectField optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MetaobjectField(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + public NodeQuery onBlog(BlogQueryDefinition queryDef) { + startInlineFragment("Blog"); + queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - break; - } + public NodeQuery onCart(CartQueryDefinition queryDef) { + startInlineFragment("Cart"); + queryDef.define(new CartQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case "title": { - MetaobjectField optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MetaobjectField(jsonAsObject(field.getValue(), key)); - } + public NodeQuery onCartLine(CartLineQueryDefinition queryDef) { + startInlineFragment("CartLine"); + queryDef.define(new CartLineQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - responseData.put(key, optional1); + public NodeQuery onCollection(CollectionQueryDefinition queryDef) { + startInlineFragment("Collection"); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - break; - } + public NodeQuery onComment(CommentQueryDefinition queryDef) { + startInlineFragment("Comment"); + queryDef.define(new CommentQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public NodeQuery onCompany(CompanyQueryDefinition queryDef) { + startInlineFragment("Company"); + queryDef.define(new CompanyQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public String getGraphQlTypeName() { - return "MetaobjectSEO"; + public NodeQuery onCompanyContact(CompanyContactQueryDefinition queryDef) { + startInlineFragment("CompanyContact"); + queryDef.define(new CompanyContactQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - /** - * The meta description. - */ + public NodeQuery onCompanyLocation(CompanyLocationQueryDefinition queryDef) { + startInlineFragment("CompanyLocation"); + queryDef.define(new CompanyLocationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - public MetaobjectField getDescription() { - return (MetaobjectField) get("description"); + public NodeQuery onComponentizableCartLine(ComponentizableCartLineQueryDefinition queryDef) { + startInlineFragment("ComponentizableCartLine"); + queryDef.define(new ComponentizableCartLineQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public MetaobjectSEO setDescription(MetaobjectField arg) { - optimisticData.put(getKey("description"), arg); + public NodeQuery onExternalVideo(ExternalVideoQueryDefinition queryDef) { + startInlineFragment("ExternalVideo"); + queryDef.define(new ExternalVideoQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The SEO title. - */ + public NodeQuery onGenericFile(GenericFileQueryDefinition queryDef) { + startInlineFragment("GenericFile"); + queryDef.define(new GenericFileQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - public MetaobjectField getTitle() { - return (MetaobjectField) get("title"); + public NodeQuery onLocation(LocationQueryDefinition queryDef) { + startInlineFragment("Location"); + queryDef.define(new LocationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public MetaobjectSEO setTitle(MetaobjectField arg) { - optimisticData.put(getKey("title"), arg); + public NodeQuery onMailingAddress(MailingAddressQueryDefinition queryDef) { + startInlineFragment("MailingAddress"); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "description": return true; + public NodeQuery onMarket(MarketQueryDefinition queryDef) { + startInlineFragment("Market"); + queryDef.define(new MarketQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case "title": return true; + public NodeQuery onMediaImage(MediaImageQueryDefinition queryDef) { + startInlineFragment("MediaImage"); + queryDef.define(new MediaImageQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - default: return false; - } + public NodeQuery onMediaPresentation(MediaPresentationQueryDefinition queryDef) { + startInlineFragment("MediaPresentation"); + queryDef.define(new MediaPresentationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - } - public interface Model3dQueryDefinition { - void define(Model3dQuery _queryBuilder); - } + public NodeQuery onMenu(MenuQueryDefinition queryDef) { + startInlineFragment("Menu"); + queryDef.define(new MenuQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - /** - * Represents a Shopify hosted 3D model. - */ - public static class Model3dQuery extends Query { - Model3dQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public NodeQuery onMenuItem(MenuItemQueryDefinition queryDef) { + startInlineFragment("MenuItem"); + queryDef.define(new MenuItemQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - startField("id"); + public NodeQuery onMetafield(MetafieldQueryDefinition queryDef) { + startInlineFragment("Metafield"); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - /** - * A word or phrase to share the nature or contents of a media. - */ - public Model3dQuery alt() { - startField("alt"); - + public NodeQuery onMetaobject(MetaobjectQueryDefinition queryDef) { + startInlineFragment("Metaobject"); + queryDef.define(new MetaobjectQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The media content type. - */ - public Model3dQuery mediaContentType() { - startField("mediaContentType"); + public NodeQuery onModel3d(Model3dQueryDefinition queryDef) { + startInlineFragment("Model3d"); + queryDef.define(new Model3dQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + public NodeQuery onOrder(OrderQueryDefinition queryDef) { + startInlineFragment("Order"); + queryDef.define(new OrderQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The presentation for a media. - */ - public Model3dQuery presentation(MediaPresentationQueryDefinition queryDef) { - startField("presentation"); + public NodeQuery onPage(PageQueryDefinition queryDef) { + startInlineFragment("Page"); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new MediaPresentationQuery(_queryBuilder)); + public NodeQuery onProduct(ProductQueryDefinition queryDef) { + startInlineFragment("Product"); + queryDef.define(new ProductQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; + } + public NodeQuery onProductOption(ProductOptionQueryDefinition queryDef) { + startInlineFragment("ProductOption"); + queryDef.define(new ProductOptionQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The preview image for the media. - */ - public Model3dQuery previewImage(ImageQueryDefinition queryDef) { - startField("previewImage"); + public NodeQuery onProductOptionValue(ProductOptionValueQueryDefinition queryDef) { + startInlineFragment("ProductOptionValue"); + queryDef.define(new ProductOptionValueQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); + public NodeQuery onProductVariant(ProductVariantQueryDefinition queryDef) { + startInlineFragment("ProductVariant"); + queryDef.define(new ProductVariantQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; + } + public NodeQuery onShop(ShopQueryDefinition queryDef) { + startInlineFragment("Shop"); + queryDef.define(new ShopQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The sources for a 3d model. - */ - public Model3dQuery sources(Model3dSourceQueryDefinition queryDef) { - startField("sources"); + public NodeQuery onShopPolicy(ShopPolicyQueryDefinition queryDef) { + startInlineFragment("ShopPolicy"); + queryDef.define(new ShopPolicyQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new Model3dSourceQuery(_queryBuilder)); + public NodeQuery onUrlRedirect(UrlRedirectQueryDefinition queryDef) { + startInlineFragment("UrlRedirect"); + queryDef.define(new UrlRedirectQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; + } + public NodeQuery onVideo(VideoQueryDefinition queryDef) { + startInlineFragment("Video"); + queryDef.define(new VideoQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } + public interface Node extends com.shopify.graphql.support.Node { + String getGraphQlTypeName(); + + ID getId(); + } + /** - * Represents a Shopify hosted 3D model. + * 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. */ - public static class Model3d extends AbstractResponse implements Media, MetafieldReference, Node { - public Model3d() { + public static class UnknownNode extends AbstractResponse implements Node { + public UnknownNode() { } - public Model3d(JsonObject fields) throws SchemaViolationError { + public UnknownNode(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "alt": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - case "id": { responseData.put(key, new ID(jsonAsString(field.getValue(), key))); break; } - case "mediaContentType": { - responseData.put(key, MediaContentType.fromGraphQl(jsonAsString(field.getValue(), key))); - + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - case "presentation": { - MediaPresentation optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MediaPresentation(jsonAsObject(field.getValue(), key)); - } + public static Node create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "AppliedGiftCard": { + return new AppliedGiftCard(fields); + } - responseData.put(key, optional1); + case "Article": { + return new Article(fields); + } - break; - } + case "Blog": { + return new Blog(fields); + } - case "previewImage": { - Image optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); - } + case "Cart": { + return new Cart(fields); + } - responseData.put(key, optional1); + case "CartLine": { + return new CartLine(fields); + } - break; - } + case "Collection": { + return new Collection(fields); + } - case "sources": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Model3dSource(jsonAsObject(element1, key))); - } + case "Comment": { + return new Comment(fields); + } - responseData.put(key, list1); + case "Company": { + return new Company(fields); + } - break; - } + case "CompanyContact": { + return new CompanyContact(fields); + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "CompanyLocation": { + return new CompanyLocation(fields); } - } - } - public Model3d(ID id) { - this(); - optimisticData.put("id", id); - } + case "ComponentizableCartLine": { + return new ComponentizableCartLine(fields); + } - public String getGraphQlTypeName() { - return "Model3d"; - } + case "ExternalVideo": { + return new ExternalVideo(fields); + } - /** - * A word or phrase to share the nature or contents of a media. - */ + case "GenericFile": { + return new GenericFile(fields); + } - public String getAlt() { - return (String) get("alt"); - } + case "Location": { + return new Location(fields); + } - public Model3d setAlt(String arg) { - optimisticData.put(getKey("alt"), arg); - return this; - } + case "MailingAddress": { + return new MailingAddress(fields); + } - /** - * A globally-unique ID. - */ + case "Market": { + return new Market(fields); + } - public ID getId() { - return (ID) get("id"); - } + case "MediaImage": { + return new MediaImage(fields); + } - /** - * The media content type. - */ + case "MediaPresentation": { + return new MediaPresentation(fields); + } - public MediaContentType getMediaContentType() { - return (MediaContentType) get("mediaContentType"); - } + case "Menu": { + return new Menu(fields); + } - public Model3d setMediaContentType(MediaContentType arg) { - optimisticData.put(getKey("mediaContentType"), arg); - return this; - } + case "MenuItem": { + return new MenuItem(fields); + } - /** - * The presentation for a media. - */ + case "Metafield": { + return new Metafield(fields); + } - public MediaPresentation getPresentation() { - return (MediaPresentation) get("presentation"); - } + case "Metaobject": { + return new Metaobject(fields); + } - public Model3d setPresentation(MediaPresentation arg) { - optimisticData.put(getKey("presentation"), arg); - return this; - } + case "Model3d": { + return new Model3d(fields); + } - /** - * The preview image for the media. - */ + case "Order": { + return new Order(fields); + } - public Image getPreviewImage() { - return (Image) get("previewImage"); + case "Page": { + return new Page(fields); + } + + case "Product": { + return new Product(fields); + } + + case "ProductOption": { + return new ProductOption(fields); + } + + case "ProductOptionValue": { + return new ProductOptionValue(fields); + } + + case "ProductVariant": { + return new ProductVariant(fields); + } + + case "Shop": { + return new Shop(fields); + } + + case "ShopPolicy": { + return new ShopPolicy(fields); + } + + case "UrlRedirect": { + return new UrlRedirect(fields); + } + + case "Video": { + return new Video(fields); + } + + default: { + return new UnknownNode(fields); + } + } } - public Model3d setPreviewImage(Image arg) { - optimisticData.put(getKey("previewImage"), arg); - return this; + public String getGraphQlTypeName() { + return (String) get("__typename"); } /** - * The sources for a 3d model. + * A globally-unique ID. */ - public List getSources() { - return (List) get("sources"); + public ID getId() { + return (ID) get("id"); } - public Model3d setSources(List arg) { - optimisticData.put(getKey("sources"), arg); + public UnknownNode setId(ID arg) { + optimisticData.put(getKey("id"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "alt": return false; - case "id": return false; - case "mediaContentType": return false; - - case "presentation": return true; - - case "previewImage": return true; - - case "sources": return true; - default: return false; } } } - public interface Model3dSourceQueryDefinition { - void define(Model3dSourceQuery _queryBuilder); + public interface OnlineStorePublishableQueryDefinition { + void define(OnlineStorePublishableQuery _queryBuilder); } /** - * Represents a source for a Shopify hosted 3d model. + * Represents a resource that can be published to the Online Store sales channel. */ - public static class Model3dSourceQuery extends Query { - Model3dSourceQuery(StringBuilder _queryBuilder) { + public static class OnlineStorePublishableQuery extends Query { + OnlineStorePublishableQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("__typename"); } /** - * The filesize of the 3d model. + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. */ - public Model3dSourceQuery filesize() { - startField("filesize"); + public OnlineStorePublishableQuery onlineStoreUrl() { + startField("onlineStoreUrl"); return this; } - /** - * The format of the 3d model. - */ - public Model3dSourceQuery format() { - startField("format"); + public OnlineStorePublishableQuery onArticle(ArticleQueryDefinition queryDef) { + startInlineFragment("Article"); + queryDef.define(new ArticleQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + public OnlineStorePublishableQuery onBlog(BlogQueryDefinition queryDef) { + startInlineFragment("Blog"); + queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The MIME type of the 3d model. - */ - public Model3dSourceQuery mimeType() { - startField("mimeType"); + public OnlineStorePublishableQuery onCollection(CollectionQueryDefinition queryDef) { + startInlineFragment("Collection"); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + public OnlineStorePublishableQuery onMetaobject(MetaobjectQueryDefinition queryDef) { + startInlineFragment("Metaobject"); + queryDef.define(new MetaobjectQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The URL of the 3d model. - */ - public Model3dSourceQuery url() { - startField("url"); + public OnlineStorePublishableQuery onPage(PageQueryDefinition queryDef) { + startInlineFragment("Page"); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + public OnlineStorePublishableQuery onProduct(ProductQueryDefinition queryDef) { + startInlineFragment("Product"); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } + public interface OnlineStorePublishable { + String getGraphQlTypeName(); + + String getOnlineStoreUrl(); + } + /** - * Represents a source for a Shopify hosted 3d model. + * Represents a resource that can be published to the Online Store sales channel. */ - public static class Model3dSource extends AbstractResponse { - public Model3dSource() { + public static class UnknownOnlineStorePublishable extends AbstractResponse implements OnlineStorePublishable { + public UnknownOnlineStorePublishable() { } - public Model3dSource(JsonObject fields) throws SchemaViolationError { + public UnknownOnlineStorePublishable(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "filesize": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); - - break; - } - - case "format": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "mimeType": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } + case "onlineStoreUrl": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "url": { - responseData.put(key, jsonAsString(field.getValue(), key)); + responseData.put(key, optional1); break; } @@ -49631,449 +46250,498 @@ public Model3dSource(JsonObject fields) throws SchemaViolationError { } } - public String getGraphQlTypeName() { - return "Model3dSource"; + public static OnlineStorePublishable create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "Article": { + return new Article(fields); + } + + case "Blog": { + return new Blog(fields); + } + + case "Collection": { + return new Collection(fields); + } + + case "Metaobject": { + return new Metaobject(fields); + } + + case "Page": { + return new Page(fields); + } + + case "Product": { + return new Product(fields); + } + + default: { + return new UnknownOnlineStorePublishable(fields); + } + } + } + + public String getGraphQlTypeName() { + return (String) get("__typename"); + } + + /** + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. + */ + + public String getOnlineStoreUrl() { + return (String) get("onlineStoreUrl"); + } + + public UnknownOnlineStorePublishable setOnlineStoreUrl(String arg) { + optimisticData.put(getKey("onlineStoreUrl"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "onlineStoreUrl": return false; + + default: return false; + } + } + } + + public interface OrderQueryDefinition { + void define(OrderQuery _queryBuilder); + } + + /** + * An order is a customer’s completed request to purchase one or more products from a shop. An order is + * created when a customer completes the checkout process, during which time they provides an email + * address, billing address and payment information. + */ + public static class OrderQuery extends Query { + OrderQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); } /** - * The filesize of the 3d model. + * The address associated with the payment method. */ + public OrderQuery billingAddress(MailingAddressQueryDefinition queryDef) { + startField("billingAddress"); - public Integer getFilesize() { - return (Integer) get("filesize"); - } + _queryBuilder.append('{'); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Model3dSource setFilesize(Integer arg) { - optimisticData.put(getKey("filesize"), arg); return this; } /** - * The format of the 3d model. + * The reason for the order's cancellation. Returns `null` if the order wasn't canceled. */ + public OrderQuery cancelReason() { + startField("cancelReason"); - public String getFormat() { - return (String) get("format"); - } - - public Model3dSource setFormat(String arg) { - optimisticData.put(getKey("format"), arg); return this; } /** - * The MIME type of the 3d model. + * The date and time when the order was canceled. Returns null if the order wasn't canceled. */ + public OrderQuery canceledAt() { + startField("canceledAt"); - public String getMimeType() { - return (String) get("mimeType"); - } - - public Model3dSource setMimeType(String arg) { - optimisticData.put(getKey("mimeType"), arg); return this; } /** - * The URL of the 3d model. + * The code of the currency used for the payment. */ + public OrderQuery currencyCode() { + startField("currencyCode"); - public String getUrl() { - return (String) get("url"); - } - - public Model3dSource setUrl(String arg) { - optimisticData.put(getKey("url"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "filesize": return false; - - case "format": return false; - - case "mimeType": return false; + /** + * The subtotal of line items and their discounts, excluding line items that have been removed. Does + * not contain order-level discounts, duties, shipping costs, or shipping discounts. Taxes aren't + * included unless the order is a taxes-included order. + */ + public OrderQuery currentSubtotalPrice(MoneyV2QueryDefinition queryDef) { + startField("currentSubtotalPrice"); - case "url": return false; + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - default: return false; - } + return this; } - } - - public static class MoneyInput implements Serializable { - private String amount; - private CurrencyCode currencyCode; + /** + * The total cost of duties for the order, including refunds. + */ + public OrderQuery currentTotalDuties(MoneyV2QueryDefinition queryDef) { + startField("currentTotalDuties"); - public MoneyInput(String amount, CurrencyCode currencyCode) { - this.amount = amount; + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - this.currencyCode = currencyCode; + return this; } - public String getAmount() { - return amount; - } + /** + * The total amount of the order, including duties, taxes and discounts, minus amounts for line items + * that have been removed. + */ + public OrderQuery currentTotalPrice(MoneyV2QueryDefinition queryDef) { + startField("currentTotalPrice"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public MoneyInput setAmount(String amount) { - this.amount = amount; return this; } - public CurrencyCode getCurrencyCode() { - return currencyCode; - } + /** + * 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. + */ + public OrderQuery currentTotalShippingPrice(MoneyV2QueryDefinition queryDef) { + startField("currentTotalShippingPrice"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public MoneyInput setCurrencyCode(CurrencyCode currencyCode) { - this.currencyCode = currencyCode; return this; } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; + /** + * The total of all taxes applied to the order, excluding taxes for returned line items. + */ + public OrderQuery currentTotalTax(MoneyV2QueryDefinition queryDef) { + startField("currentTotalTax"); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("amount:"); - Query.appendQuotedString(_queryBuilder, amount.toString()); + return this; + } - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("currencyCode:"); - _queryBuilder.append(currencyCode.toString()); + /** + * A list of the custom attributes added to the order. + */ + public OrderQuery customAttributes(AttributeQueryDefinition queryDef) { + startField("customAttributes"); + _queryBuilder.append('{'); + queryDef.define(new AttributeQuery(_queryBuilder)); _queryBuilder.append('}'); - } - } - - public interface MoneyV2QueryDefinition { - void define(MoneyV2Query _queryBuilder); - } - /** - * A monetary value with currency. - */ - public static class MoneyV2Query extends Query { - MoneyV2Query(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * Decimal money amount. + * The locale code in which this specific order happened. */ - public MoneyV2Query amount() { - startField("amount"); + public OrderQuery customerLocale() { + startField("customerLocale"); return this; } /** - * Currency of the money. + * The unique URL that the customer can use to access the order. */ - public MoneyV2Query currencyCode() { - startField("currencyCode"); + public OrderQuery customerUrl() { + startField("customerUrl"); return this; } - } - /** - * A monetary value with currency. - */ - public static class MoneyV2 extends AbstractResponse implements PricingValue, SellingPlanCheckoutChargeValue { - public MoneyV2() { - } + public class DiscountApplicationsArguments extends Arguments { + DiscountApplicationsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - public MoneyV2(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "amount": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Returns up to the first `n` elements from the list. + */ + public DiscountApplicationsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - break; - } + /** + * Returns the elements that come after the specified cursor. + */ + public DiscountApplicationsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "currencyCode": { - responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); + /** + * Returns up to the last `n` elements from the list. + */ + public DiscountApplicationsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - break; - } + /** + * Returns the elements that come before the specified cursor. + */ + public DiscountApplicationsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + /** + * Reverse the order of the underlying list. + */ + public DiscountApplicationsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; } } - public String getGraphQlTypeName() { - return "MoneyV2"; + public interface DiscountApplicationsArgumentsDefinition { + void define(DiscountApplicationsArguments args); } /** - * Decimal money amount. + * Discounts that have been applied on the order. */ - - public String getAmount() { - return (String) get("amount"); - } - - public MoneyV2 setAmount(String arg) { - optimisticData.put(getKey("amount"), arg); - return this; + public OrderQuery discountApplications(DiscountApplicationConnectionQueryDefinition queryDef) { + return discountApplications(args -> {}, queryDef); } /** - * Currency of the money. + * Discounts that have been applied on the order. */ + public OrderQuery discountApplications(DiscountApplicationsArgumentsDefinition argsDef, DiscountApplicationConnectionQueryDefinition queryDef) { + startField("discountApplications"); - public CurrencyCode getCurrencyCode() { - return (CurrencyCode) get("currencyCode"); - } + DiscountApplicationsArguments args = new DiscountApplicationsArguments(_queryBuilder); + argsDef.define(args); + DiscountApplicationsArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new DiscountApplicationConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public MoneyV2 setCurrencyCode(CurrencyCode arg) { - optimisticData.put(getKey("currencyCode"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "amount": return false; - - case "currencyCode": return false; + /** + * Whether the order has had any edits applied or not. + */ + public OrderQuery edited() { + startField("edited"); - default: return false; - } + return this; } - } - public interface MutationQueryDefinition { - void define(MutationQuery _queryBuilder); - } + /** + * The customer's email address. + */ + public OrderQuery email() { + startField("email"); - /** - * The schema’s entry-point for mutations. This acts as the public, top-level API from which all - * mutation queries must start. - */ - public static class MutationQuery extends Query { - MutationQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * Updates the attributes on a cart. + * The financial status of the order. */ - public MutationQuery cartAttributesUpdate(List attributes, ID cartId, CartAttributesUpdatePayloadQueryDefinition queryDef) { - startField("cartAttributesUpdate"); - - _queryBuilder.append("(attributes:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (AttributeInput item1 : attributes) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(",cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CartAttributesUpdatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public OrderQuery financialStatus() { + startField("financialStatus"); return this; } /** - * Updates customer information associated with a cart. - * Buyer identity is used to determine - * [international - * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing) - * and should match the customer's shipping address. + * The fulfillment status for the order. */ - public MutationQuery cartBuyerIdentityUpdate(ID cartId, CartBuyerIdentityInput buyerIdentity, CartBuyerIdentityUpdatePayloadQueryDefinition queryDef) { - startField("cartBuyerIdentityUpdate"); + public OrderQuery fulfillmentStatus() { + startField("fulfillmentStatus"); - _queryBuilder.append("(cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); + return this; + } - _queryBuilder.append(",buyerIdentity:"); - buyerIdentity.appendTo(_queryBuilder); + public class LineItemsArguments extends Arguments { + LineItemsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - _queryBuilder.append(')'); + /** + * Returns up to the first `n` elements from the list. + */ + public LineItemsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - _queryBuilder.append('{'); - queryDef.define(new CartBuyerIdentityUpdatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Returns the elements that come after the specified cursor. + */ + public LineItemsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - return this; - } + /** + * Returns up to the last `n` elements from the list. + */ + public LineItemsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - public class CartCreateArguments extends Arguments { - CartCreateArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); + /** + * Returns the elements that come before the specified cursor. + */ + public LineItemsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; } /** - * The fields used to create a cart. + * Reverse the order of the underlying list. */ - public CartCreateArguments input(CartInput value) { + public LineItemsArguments reverse(Boolean value) { if (value != null) { - startArgument("input"); - value.appendTo(_queryBuilder); + startArgument("reverse"); + _queryBuilder.append(value); } return this; } } - public interface CartCreateArgumentsDefinition { - void define(CartCreateArguments args); + public interface LineItemsArgumentsDefinition { + void define(LineItemsArguments args); } /** - * Creates a new cart. + * List of the order’s line items. */ - public MutationQuery cartCreate(CartCreatePayloadQueryDefinition queryDef) { - return cartCreate(args -> {}, queryDef); + public OrderQuery lineItems(OrderLineItemConnectionQueryDefinition queryDef) { + return lineItems(args -> {}, queryDef); } /** - * Creates a new cart. + * List of the order’s line items. */ - public MutationQuery cartCreate(CartCreateArgumentsDefinition argsDef, CartCreatePayloadQueryDefinition queryDef) { - startField("cartCreate"); + public OrderQuery lineItems(LineItemsArgumentsDefinition argsDef, OrderLineItemConnectionQueryDefinition queryDef) { + startField("lineItems"); - CartCreateArguments args = new CartCreateArguments(_queryBuilder); + LineItemsArguments args = new LineItemsArguments(_queryBuilder); argsDef.define(args); - CartCreateArguments.end(args); + LineItemsArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new CartCreatePayloadQuery(_queryBuilder)); + queryDef.define(new OrderLineItemConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - public class CartDiscountCodesUpdateArguments extends Arguments { - CartDiscountCodesUpdateArguments(StringBuilder _queryBuilder) { + public class MetafieldArguments extends Arguments { + MetafieldArguments(StringBuilder _queryBuilder) { super(_queryBuilder, false); } /** - * The case-insensitive discount codes that the customer added at checkout. - * The input must not contain more than `250` values. + * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. */ - public CartDiscountCodesUpdateArguments discountCodes(List value) { + public MetafieldArguments namespace(String value) { if (value != null) { - startArgument("discountCodes"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (String item1 : value) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - Query.appendQuotedString(_queryBuilder, item1.toString()); - } - } - _queryBuilder.append(']'); + startArgument("namespace"); + Query.appendQuotedString(_queryBuilder, value.toString()); } return this; } } - public interface CartDiscountCodesUpdateArgumentsDefinition { - void define(CartDiscountCodesUpdateArguments args); - } - - /** - * Updates the discount codes applied to the cart. - */ - public MutationQuery cartDiscountCodesUpdate(ID cartId, CartDiscountCodesUpdatePayloadQueryDefinition queryDef) { - return cartDiscountCodesUpdate(cartId, args -> {}, queryDef); + public interface MetafieldArgumentsDefinition { + void define(MetafieldArguments args); } /** - * Updates the discount codes applied to the cart. + * Returns a metafield found by namespace and key. */ - public MutationQuery cartDiscountCodesUpdate(ID cartId, CartDiscountCodesUpdateArgumentsDefinition argsDef, CartDiscountCodesUpdatePayloadQueryDefinition queryDef) { - startField("cartDiscountCodesUpdate"); - - _queryBuilder.append("(cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); - - argsDef.define(new CartDiscountCodesUpdateArguments(_queryBuilder)); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CartDiscountCodesUpdatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + public OrderQuery metafield(String key, MetafieldQueryDefinition queryDef) { + return metafield(key, args -> {}, queryDef); } /** - * Adds a merchandise line to the cart. + * Returns a metafield found by namespace and key. */ - public MutationQuery cartLinesAdd(List lines, ID cartId, CartLinesAddPayloadQueryDefinition queryDef) { - startField("cartLinesAdd"); - - _queryBuilder.append("(lines:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (CartLineInput item1 : lines) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); + public OrderQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { + startField("metafield"); - _queryBuilder.append(",cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + argsDef.define(new MetafieldArguments(_queryBuilder)); _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new CartLinesAddPayloadQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Removes one or more merchandise lines from the cart. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public MutationQuery cartLinesRemove(ID cartId, List lineIds, CartLinesRemovePayloadQueryDefinition queryDef) { - startField("cartLinesRemove"); - - _queryBuilder.append("(cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); + public OrderQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); - _queryBuilder.append(",lineIds:"); + _queryBuilder.append("(identifiers:"); _queryBuilder.append('['); { String listSeperator1 = ""; - for (ID item1 : lineIds) { + for (HasMetafieldsIdentifier item1 : identifiers) { _queryBuilder.append(listSeperator1); listSeperator1 = ","; - Query.appendQuotedString(_queryBuilder, item1.toString()); + item1.appendTo(_queryBuilder); } } _queryBuilder.append(']'); @@ -50081,1526 +46749,1538 @@ public MutationQuery cartLinesRemove(ID cartId, List lineIds, CartLinesRemov _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new CartLinesRemovePayloadQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Updates one or more merchandise lines on a cart. + * Unique identifier for the order that appears on the order. + * For example, _#1000_ or _Store1001. */ - public MutationQuery cartLinesUpdate(ID cartId, List lines, CartLinesUpdatePayloadQueryDefinition queryDef) { - startField("cartLinesUpdate"); + public OrderQuery name() { + startField("name"); - _queryBuilder.append("(cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); + return this; + } - _queryBuilder.append(",lines:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (CartLineUpdateInput item1 : lines) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); + /** + * A unique numeric identifier for the order for use by shop owner and customer. + */ + public OrderQuery orderNumber() { + startField("orderNumber"); - _queryBuilder.append(')'); + return this; + } + + /** + * The total cost of duties charged at checkout. + */ + public OrderQuery originalTotalDuties(MoneyV2QueryDefinition queryDef) { + startField("originalTotalDuties"); _queryBuilder.append('{'); - queryDef.define(new CartLinesUpdatePayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Deletes a cart metafield. + * The total price of the order before any applied edits. */ - public MutationQuery cartMetafieldDelete(CartMetafieldDeleteInput input, CartMetafieldDeletePayloadQueryDefinition queryDef) { - startField("cartMetafieldDelete"); - - _queryBuilder.append("(input:"); - input.appendTo(_queryBuilder); - - _queryBuilder.append(')'); + public OrderQuery originalTotalPrice(MoneyV2QueryDefinition queryDef) { + startField("originalTotalPrice"); _queryBuilder.append('{'); - queryDef.define(new CartMetafieldDeletePayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Sets cart metafield values. Cart metafield values will be set regardless if they were previously - * created or not. - * Allows a maximum of 25 cart metafields to be set at a time. + * The customer's phone number for receiving SMS notifications. */ - public MutationQuery cartMetafieldsSet(List metafields, CartMetafieldsSetPayloadQueryDefinition queryDef) { - startField("cartMetafieldsSet"); - - _queryBuilder.append("(metafields:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (CartMetafieldsSetInput item1 : metafields) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); + public OrderQuery phone() { + startField("phone"); - _queryBuilder.append(')'); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new CartMetafieldsSetPayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The date and time when the order was imported. + * This value can be set to dates in the past when importing from other systems. + * If no value is provided, it will be auto-generated based on current date and time. + */ + public OrderQuery processedAt() { + startField("processedAt"); return this; } /** - * Updates the note on the cart. + * The address to where the order will be shipped. */ - public MutationQuery cartNoteUpdate(ID cartId, String note, CartNoteUpdatePayloadQueryDefinition queryDef) { - startField("cartNoteUpdate"); + public OrderQuery shippingAddress(MailingAddressQueryDefinition queryDef) { + startField("shippingAddress"); - _queryBuilder.append("(cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); + _queryBuilder.append('{'); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); - _queryBuilder.append(",note:"); - Query.appendQuotedString(_queryBuilder, note.toString()); + return this; + } - _queryBuilder.append(')'); + /** + * The discounts that have been allocated onto the shipping line by discount applications. + */ + public OrderQuery shippingDiscountAllocations(DiscountAllocationQueryDefinition queryDef) { + startField("shippingDiscountAllocations"); _queryBuilder.append('{'); - queryDef.define(new CartNoteUpdatePayloadQuery(_queryBuilder)); + queryDef.define(new DiscountAllocationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Update the customer's payment method that will be used to checkout. + * The unique URL for the order's status page. */ - public MutationQuery cartPaymentUpdate(ID cartId, CartPaymentInput payment, CartPaymentUpdatePayloadQueryDefinition queryDef) { - startField("cartPaymentUpdate"); - - _queryBuilder.append("(cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); + public OrderQuery statusUrl() { + startField("statusUrl"); - _queryBuilder.append(",payment:"); - payment.appendTo(_queryBuilder); + return this; + } - _queryBuilder.append(')'); + /** + * Price of the order before shipping and taxes. + */ + public OrderQuery subtotalPrice(MoneyV2QueryDefinition queryDef) { + startField("subtotalPrice"); _queryBuilder.append('{'); - queryDef.define(new CartPaymentUpdatePayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Update the selected delivery options for a delivery group. + * Price of the order before duties, shipping and taxes. + * + * @deprecated Use `subtotalPrice` instead. */ - public MutationQuery cartSelectedDeliveryOptionsUpdate(ID cartId, List selectedDeliveryOptions, CartSelectedDeliveryOptionsUpdatePayloadQueryDefinition queryDef) { - startField("cartSelectedDeliveryOptionsUpdate"); + @Deprecated + public OrderQuery subtotalPriceV2(MoneyV2QueryDefinition queryDef) { + startField("subtotalPriceV2"); - _queryBuilder.append("(cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - _queryBuilder.append(",selectedDeliveryOptions:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (CartSelectedDeliveryOptionInput item1 : selectedDeliveryOptions) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); + return this; + } + + public class SuccessfulFulfillmentsArguments extends Arguments { + SuccessfulFulfillmentsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * Truncate the array result to this size. + */ + public SuccessfulFulfillmentsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); } + return this; } - _queryBuilder.append(']'); + } - _queryBuilder.append(')'); + public interface SuccessfulFulfillmentsArgumentsDefinition { + void define(SuccessfulFulfillmentsArguments args); + } + + /** + * List of the order’s successful fulfillments. + */ + public OrderQuery successfulFulfillments(FulfillmentQueryDefinition queryDef) { + return successfulFulfillments(args -> {}, queryDef); + } + + /** + * List of the order’s successful fulfillments. + */ + public OrderQuery successfulFulfillments(SuccessfulFulfillmentsArgumentsDefinition argsDef, FulfillmentQueryDefinition queryDef) { + startField("successfulFulfillments"); + + SuccessfulFulfillmentsArguments args = new SuccessfulFulfillmentsArguments(_queryBuilder); + argsDef.define(args); + SuccessfulFulfillmentsArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new CartSelectedDeliveryOptionsUpdatePayloadQuery(_queryBuilder)); + queryDef.define(new FulfillmentQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Submit the cart for checkout completion. + * The sum of all the prices of all the items in the order, duties, taxes and discounts included (must + * be positive). */ - public MutationQuery cartSubmitForCompletion(ID cartId, String attemptToken, CartSubmitForCompletionPayloadQueryDefinition queryDef) { - startField("cartSubmitForCompletion"); - - _queryBuilder.append("(cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); - - _queryBuilder.append(",attemptToken:"); - Query.appendQuotedString(_queryBuilder, attemptToken.toString()); - - _queryBuilder.append(')'); + public OrderQuery totalPrice(MoneyV2QueryDefinition queryDef) { + startField("totalPrice"); _queryBuilder.append('{'); - queryDef.define(new CartSubmitForCompletionPayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Updates the attributes of a checkout if `allowPartialAddresses` is `true`. + * The sum of all the prices of all the items in the order, duties, taxes and discounts included (must + * be positive). * - * @deprecated 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. + * @deprecated Use `totalPrice` instead. */ @Deprecated - public MutationQuery checkoutAttributesUpdateV2(ID checkoutId, CheckoutAttributesUpdateV2Input input, CheckoutAttributesUpdateV2PayloadQueryDefinition queryDef) { - startField("checkoutAttributesUpdateV2"); + public OrderQuery totalPriceV2(MoneyV2QueryDefinition queryDef) { + startField("totalPriceV2"); - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - _queryBuilder.append(",input:"); - input.appendTo(_queryBuilder); + return this; + } - _queryBuilder.append(')'); + /** + * The total amount that has been refunded. + */ + public OrderQuery totalRefunded(MoneyV2QueryDefinition queryDef) { + startField("totalRefunded"); _queryBuilder.append('{'); - queryDef.define(new CheckoutAttributesUpdateV2PayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * 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. + * The total amount that has been refunded. * - * @deprecated 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. + * @deprecated Use `totalRefunded` instead. */ @Deprecated - public MutationQuery checkoutCompleteFree(ID checkoutId, CheckoutCompleteFreePayloadQueryDefinition queryDef) { - startField("checkoutCompleteFree"); + public OrderQuery totalRefundedV2(MoneyV2QueryDefinition queryDef) { + startField("totalRefundedV2"); - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - _queryBuilder.append(')'); + return this; + } + + /** + * The total cost of shipping. + */ + public OrderQuery totalShippingPrice(MoneyV2QueryDefinition queryDef) { + startField("totalShippingPrice"); _queryBuilder.append('{'); - queryDef.define(new CheckoutCompleteFreePayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * 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). + * The total cost of shipping. * - * @deprecated 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. + * @deprecated Use `totalShippingPrice` instead. */ @Deprecated - public MutationQuery checkoutCompleteWithCreditCardV2(ID checkoutId, CreditCardPaymentInputV2 payment, CheckoutCompleteWithCreditCardV2PayloadQueryDefinition queryDef) { - startField("checkoutCompleteWithCreditCardV2"); + public OrderQuery totalShippingPriceV2(MoneyV2QueryDefinition queryDef) { + startField("totalShippingPriceV2"); - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - _queryBuilder.append(",payment:"); - payment.appendTo(_queryBuilder); + return this; + } - _queryBuilder.append(')'); + /** + * The total cost of taxes. + */ + public OrderQuery totalTax(MoneyV2QueryDefinition queryDef) { + startField("totalTax"); _queryBuilder.append('{'); - queryDef.define(new CheckoutCompleteWithCreditCardV2PayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Completes a checkout with a tokenized payment. + * The total cost of taxes. * - * @deprecated 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. + * @deprecated Use `totalTax` instead. */ @Deprecated - public MutationQuery checkoutCompleteWithTokenizedPaymentV3(ID checkoutId, TokenizedPaymentInputV3 payment, CheckoutCompleteWithTokenizedPaymentV3PayloadQueryDefinition queryDef) { - startField("checkoutCompleteWithTokenizedPaymentV3"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",payment:"); - payment.appendTo(_queryBuilder); - - _queryBuilder.append(')'); + public OrderQuery totalTaxV2(MoneyV2QueryDefinition queryDef) { + startField("totalTaxV2"); _queryBuilder.append('{'); - queryDef.define(new CheckoutCompleteWithTokenizedPaymentV3PayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - public class CheckoutCreateArguments extends Arguments { - CheckoutCreateArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } - - /** - * The checkout queue token. Available only to selected stores. - */ - public CheckoutCreateArguments queueToken(String value) { - if (value != null) { - startArgument("queueToken"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + /** + * An order is a customer’s completed request to purchase one or more products from a shop. An order is + * created when a customer completes the checkout process, during which time they provides an email + * address, billing address and payment information. + */ + public static class Order extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { + public Order() { } - public interface CheckoutCreateArgumentsDefinition { - void define(CheckoutCreateArguments args); - } + public Order(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "billingAddress": { + MailingAddress optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); + } - /** - * Creates a new checkout. - * - * @deprecated 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. - */ - public MutationQuery checkoutCreate(CheckoutCreateInput input, CheckoutCreatePayloadQueryDefinition queryDef) { - return checkoutCreate(input, args -> {}, queryDef); - } + responseData.put(key, optional1); + + break; + } + + case "cancelReason": { + OrderCancelReason optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = OrderCancelReason.fromGraphQl(jsonAsString(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "canceledAt": { + DateTime optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = Utils.parseDateTime(jsonAsString(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "currencyCode": { + responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "currentSubtotalPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "currentTotalDuties": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "currentTotalPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "currentTotalShippingPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "currentTotalTax": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "customAttributes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Attribute(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "customerLocale": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "customerUrl": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "discountApplications": { + responseData.put(key, new DiscountApplicationConnection(jsonAsObject(field.getValue(), key))); + + break; + } + + case "edited": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); + + break; + } + + case "email": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "financialStatus": { + OrderFinancialStatus optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = OrderFinancialStatus.fromGraphQl(jsonAsString(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "fulfillmentStatus": { + responseData.put(key, OrderFulfillmentStatus.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "lineItems": { + responseData.put(key, new OrderLineItemConnection(jsonAsObject(field.getValue(), key))); + + break; + } + + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } + + list1.add(optional2); + } + + responseData.put(key, list1); + + break; + } + + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "orderNumber": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); - /** - * Creates a new checkout. - * - * @deprecated 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. - */ - @Deprecated - public MutationQuery checkoutCreate(CheckoutCreateInput input, CheckoutCreateArgumentsDefinition argsDef, CheckoutCreatePayloadQueryDefinition queryDef) { - startField("checkoutCreate"); + break; + } - _queryBuilder.append("(input:"); - input.appendTo(_queryBuilder); + case "originalTotalDuties": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } - argsDef.define(new CheckoutCreateArguments(_queryBuilder)); + responseData.put(key, optional1); - _queryBuilder.append(')'); + break; + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutCreatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "originalTotalPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - return this; - } + break; + } - /** - * Associates a customer to the checkout. - * - * @deprecated 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. - */ - @Deprecated - public MutationQuery checkoutCustomerAssociateV2(ID checkoutId, String customerAccessToken, CheckoutCustomerAssociateV2PayloadQueryDefinition queryDef) { - startField("checkoutCustomerAssociateV2"); + case "phone": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); + responseData.put(key, optional1); - _queryBuilder.append(",customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + break; + } - _queryBuilder.append(')'); + case "processedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - _queryBuilder.append('{'); - queryDef.define(new CheckoutCustomerAssociateV2PayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; - } + case "shippingAddress": { + MailingAddress optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); + } - /** - * Disassociates the current checkout customer from the checkout. - * - * @deprecated 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. - */ - @Deprecated - public MutationQuery checkoutCustomerDisassociateV2(ID checkoutId, CheckoutCustomerDisassociateV2PayloadQueryDefinition queryDef) { - startField("checkoutCustomerDisassociateV2"); + responseData.put(key, optional1); - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); + break; + } - _queryBuilder.append(')'); + case "shippingDiscountAllocations": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new DiscountAllocation(jsonAsObject(element1, key))); + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutCustomerDisassociateV2PayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + responseData.put(key, list1); - return this; - } + break; + } - /** - * Applies a discount to an existing checkout using a discount code. - * - * @deprecated 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. - */ - @Deprecated - public MutationQuery checkoutDiscountCodeApplyV2(String discountCode, ID checkoutId, CheckoutDiscountCodeApplyV2PayloadQueryDefinition queryDef) { - startField("checkoutDiscountCodeApplyV2"); + case "statusUrl": { + responseData.put(key, jsonAsString(field.getValue(), key)); - _queryBuilder.append("(discountCode:"); - Query.appendQuotedString(_queryBuilder, discountCode.toString()); + break; + } - _queryBuilder.append(",checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); + case "subtotalPrice": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } - _queryBuilder.append(')'); + responseData.put(key, optional1); - _queryBuilder.append('{'); - queryDef.define(new CheckoutDiscountCodeApplyV2PayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; - } + case "subtotalPriceV2": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } - /** - * Removes the applied discounts from an existing checkout. - * - * @deprecated 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. - */ - @Deprecated - public MutationQuery checkoutDiscountCodeRemove(ID checkoutId, CheckoutDiscountCodeRemovePayloadQueryDefinition queryDef) { - startField("checkoutDiscountCodeRemove"); + responseData.put(key, optional1); - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); + break; + } - _queryBuilder.append(')'); + case "successfulFulfillments": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Fulfillment(jsonAsObject(element1, key))); + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutDiscountCodeRemovePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + optional1 = list1; + } - return this; - } + responseData.put(key, optional1); - /** - * Updates the email on an existing checkout. - * - * @deprecated 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. - */ - @Deprecated - public MutationQuery checkoutEmailUpdateV2(ID checkoutId, String email, CheckoutEmailUpdateV2PayloadQueryDefinition queryDef) { - startField("checkoutEmailUpdateV2"); + break; + } - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); + case "totalPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - _queryBuilder.append(",email:"); - Query.appendQuotedString(_queryBuilder, email.toString()); + break; + } - _queryBuilder.append(')'); + case "totalPriceV2": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - _queryBuilder.append('{'); - queryDef.define(new CheckoutEmailUpdateV2PayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; - } + case "totalRefunded": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - /** - * Removes an applied gift card from the checkout. - * - * @deprecated 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. - */ - @Deprecated - public MutationQuery checkoutGiftCardRemoveV2(ID appliedGiftCardId, ID checkoutId, CheckoutGiftCardRemoveV2PayloadQueryDefinition queryDef) { - startField("checkoutGiftCardRemoveV2"); + break; + } - _queryBuilder.append("(appliedGiftCardId:"); - Query.appendQuotedString(_queryBuilder, appliedGiftCardId.toString()); + case "totalRefundedV2": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - _queryBuilder.append(",checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); + break; + } - _queryBuilder.append(')'); + case "totalShippingPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - _queryBuilder.append('{'); - queryDef.define(new CheckoutGiftCardRemoveV2PayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; - } + case "totalShippingPriceV2": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - /** - * Appends gift cards to an existing checkout. - * - * @deprecated 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. - */ - @Deprecated - public MutationQuery checkoutGiftCardsAppend(List giftCardCodes, ID checkoutId, CheckoutGiftCardsAppendPayloadQueryDefinition queryDef) { - startField("checkoutGiftCardsAppend"); + break; + } - _queryBuilder.append("(giftCardCodes:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (String item1 : giftCardCodes) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - Query.appendQuotedString(_queryBuilder, item1.toString()); - } - } - _queryBuilder.append(']'); + case "totalTax": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } - _queryBuilder.append(",checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); + responseData.put(key, optional1); - _queryBuilder.append(')'); + break; + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutGiftCardsAppendPayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "totalTaxV2": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } - return this; - } + responseData.put(key, optional1); - /** - * Adds a list of line items to a checkout. - * - * @deprecated 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. - */ - @Deprecated - public MutationQuery checkoutLineItemsAdd(List lineItems, ID checkoutId, CheckoutLineItemsAddPayloadQueryDefinition queryDef) { - startField("checkoutLineItemsAdd"); + break; + } - _queryBuilder.append("(lineItems:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (CheckoutLineItemInput item1 : lineItems) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } } - _queryBuilder.append(']'); - - _queryBuilder.append(",checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(')'); + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutLineItemsAddPayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Order(ID id) { + this(); + optimisticData.put("id", id); + } - return this; + public String getGraphQlTypeName() { + return "Order"; } /** - * Removes line items from an existing checkout. - * - * @deprecated 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. + * The address associated with the payment method. */ - @Deprecated - public MutationQuery checkoutLineItemsRemove(ID checkoutId, List lineItemIds, CheckoutLineItemsRemovePayloadQueryDefinition queryDef) { - startField("checkoutLineItemsRemove"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",lineItemIds:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (ID item1 : lineItemIds) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - Query.appendQuotedString(_queryBuilder, item1.toString()); - } - } - _queryBuilder.append(']'); - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutLineItemsRemovePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MailingAddress getBillingAddress() { + return (MailingAddress) get("billingAddress"); + } + public Order setBillingAddress(MailingAddress arg) { + optimisticData.put(getKey("billingAddress"), arg); return this; } /** - * Sets a list of line items to a checkout. - * - * @deprecated 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. + * The reason for the order's cancellation. Returns `null` if the order wasn't canceled. */ - @Deprecated - public MutationQuery checkoutLineItemsReplace(List lineItems, ID checkoutId, CheckoutLineItemsReplacePayloadQueryDefinition queryDef) { - startField("checkoutLineItemsReplace"); - - _queryBuilder.append("(lineItems:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (CheckoutLineItemInput item1 : lineItems) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(",checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new CheckoutLineItemsReplacePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public OrderCancelReason getCancelReason() { + return (OrderCancelReason) get("cancelReason"); + } + public Order setCancelReason(OrderCancelReason arg) { + optimisticData.put(getKey("cancelReason"), arg); return this; } /** - * Updates line items on a checkout. - * - * @deprecated 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. + * The date and time when the order was canceled. Returns null if the order wasn't canceled. */ - @Deprecated - public MutationQuery checkoutLineItemsUpdate(ID checkoutId, List lineItems, CheckoutLineItemsUpdatePayloadQueryDefinition queryDef) { - startField("checkoutLineItemsUpdate"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",lineItems:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (CheckoutLineItemUpdateInput item1 : lineItems) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new CheckoutLineItemsUpdatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public DateTime getCanceledAt() { + return (DateTime) get("canceledAt"); + } + public Order setCanceledAt(DateTime arg) { + optimisticData.put(getKey("canceledAt"), arg); return this; } /** - * Updates the shipping address of an existing checkout. - * - * @deprecated 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. + * The code of the currency used for the payment. */ - @Deprecated - public MutationQuery checkoutShippingAddressUpdateV2(MailingAddressInput shippingAddress, ID checkoutId, CheckoutShippingAddressUpdateV2PayloadQueryDefinition queryDef) { - startField("checkoutShippingAddressUpdateV2"); - - _queryBuilder.append("(shippingAddress:"); - shippingAddress.appendTo(_queryBuilder); - - _queryBuilder.append(",checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutShippingAddressUpdateV2PayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CurrencyCode getCurrencyCode() { + return (CurrencyCode) get("currencyCode"); + } + public Order setCurrencyCode(CurrencyCode arg) { + optimisticData.put(getKey("currencyCode"), arg); return this; } /** - * Updates the shipping lines on an existing checkout. - * - * @deprecated 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. + * The subtotal of line items and their discounts, excluding line items that have been removed. Does + * not contain order-level discounts, duties, shipping costs, or shipping discounts. Taxes aren't + * included unless the order is a taxes-included order. */ - @Deprecated - public MutationQuery checkoutShippingLineUpdate(ID checkoutId, String shippingRateHandle, CheckoutShippingLineUpdatePayloadQueryDefinition queryDef) { - startField("checkoutShippingLineUpdate"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",shippingRateHandle:"); - Query.appendQuotedString(_queryBuilder, shippingRateHandle.toString()); - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutShippingLineUpdatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getCurrentSubtotalPrice() { + return (MoneyV2) get("currentSubtotalPrice"); + } + public Order setCurrentSubtotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("currentSubtotalPrice"), arg); return this; } /** - * Creates a customer access token. - * The customer access token is required to modify the customer object in any way. + * The total cost of duties for the order, including refunds. */ - public MutationQuery customerAccessTokenCreate(CustomerAccessTokenCreateInput input, CustomerAccessTokenCreatePayloadQueryDefinition queryDef) { - startField("customerAccessTokenCreate"); - - _queryBuilder.append("(input:"); - input.appendTo(_queryBuilder); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenCreatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getCurrentTotalDuties() { + return (MoneyV2) get("currentTotalDuties"); + } + public Order setCurrentTotalDuties(MoneyV2 arg) { + optimisticData.put(getKey("currentTotalDuties"), arg); return this; } /** - * Creates a customer access token using a - * [multipass token](https://shopify.dev/api/multipass) instead of email and - * password. A customer record is created if the customer doesn't exist. If a customer - * record already exists but the record is disabled, then the customer record is enabled. + * The total amount of the order, including duties, taxes and discounts, minus amounts for line items + * that have been removed. */ - public MutationQuery customerAccessTokenCreateWithMultipass(String multipassToken, CustomerAccessTokenCreateWithMultipassPayloadQueryDefinition queryDef) { - startField("customerAccessTokenCreateWithMultipass"); - - _queryBuilder.append("(multipassToken:"); - Query.appendQuotedString(_queryBuilder, multipassToken.toString()); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenCreateWithMultipassPayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getCurrentTotalPrice() { + return (MoneyV2) get("currentTotalPrice"); + } + public Order setCurrentTotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("currentTotalPrice"), arg); return this; } /** - * Permanently destroys a customer access token. + * 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. */ - public MutationQuery customerAccessTokenDelete(String customerAccessToken, CustomerAccessTokenDeletePayloadQueryDefinition queryDef) { - startField("customerAccessTokenDelete"); - - _queryBuilder.append("(customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenDeletePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getCurrentTotalShippingPrice() { + return (MoneyV2) get("currentTotalShippingPrice"); + } + public Order setCurrentTotalShippingPrice(MoneyV2 arg) { + optimisticData.put(getKey("currentTotalShippingPrice"), arg); return this; } /** - * Renews a customer access token. - * Access token renewal must happen *before* a token expires. - * If a token has already expired, a new one should be created instead via `customerAccessTokenCreate`. + * The total of all taxes applied to the order, excluding taxes for returned line items. */ - public MutationQuery customerAccessTokenRenew(String customerAccessToken, CustomerAccessTokenRenewPayloadQueryDefinition queryDef) { - startField("customerAccessTokenRenew"); - - _queryBuilder.append("(customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenRenewPayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getCurrentTotalTax() { + return (MoneyV2) get("currentTotalTax"); + } + public Order setCurrentTotalTax(MoneyV2 arg) { + optimisticData.put(getKey("currentTotalTax"), arg); return this; } /** - * Activates a customer. + * A list of the custom attributes added to the order. */ - public MutationQuery customerActivate(ID id, CustomerActivateInput input, CustomerActivatePayloadQueryDefinition queryDef) { - startField("customerActivate"); - - _queryBuilder.append("(id:"); - Query.appendQuotedString(_queryBuilder, id.toString()); - - _queryBuilder.append(",input:"); - input.appendTo(_queryBuilder); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new CustomerActivatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public List getCustomAttributes() { + return (List) get("customAttributes"); + } + public Order setCustomAttributes(List arg) { + optimisticData.put(getKey("customAttributes"), arg); return this; } /** - * Activates a customer with the activation url received from `customerCreate`. + * The locale code in which this specific order happened. */ - public MutationQuery customerActivateByUrl(String activationUrl, String password, CustomerActivateByUrlPayloadQueryDefinition queryDef) { - startField("customerActivateByUrl"); - - _queryBuilder.append("(activationUrl:"); - Query.appendQuotedString(_queryBuilder, activationUrl.toString()); - - _queryBuilder.append(",password:"); - Query.appendQuotedString(_queryBuilder, password.toString()); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new CustomerActivateByUrlPayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getCustomerLocale() { + return (String) get("customerLocale"); + } + public Order setCustomerLocale(String arg) { + optimisticData.put(getKey("customerLocale"), arg); return this; } /** - * Creates a new address for a customer. + * The unique URL that the customer can use to access the order. */ - public MutationQuery customerAddressCreate(String customerAccessToken, MailingAddressInput address, CustomerAddressCreatePayloadQueryDefinition queryDef) { - startField("customerAddressCreate"); - - _queryBuilder.append("(customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - - _queryBuilder.append(",address:"); - address.appendTo(_queryBuilder); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new CustomerAddressCreatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getCustomerUrl() { + return (String) get("customerUrl"); + } + public Order setCustomerUrl(String arg) { + optimisticData.put(getKey("customerUrl"), arg); return this; } /** - * Permanently deletes the address of an existing customer. + * Discounts that have been applied on the order. */ - public MutationQuery customerAddressDelete(ID id, String customerAccessToken, CustomerAddressDeletePayloadQueryDefinition queryDef) { - startField("customerAddressDelete"); - - _queryBuilder.append("(id:"); - Query.appendQuotedString(_queryBuilder, id.toString()); - - _queryBuilder.append(",customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new CustomerAddressDeletePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public DiscountApplicationConnection getDiscountApplications() { + return (DiscountApplicationConnection) get("discountApplications"); + } + public Order setDiscountApplications(DiscountApplicationConnection arg) { + optimisticData.put(getKey("discountApplications"), arg); return this; } /** - * Updates the address of an existing customer. + * Whether the order has had any edits applied or not. */ - public MutationQuery customerAddressUpdate(String customerAccessToken, ID id, MailingAddressInput address, CustomerAddressUpdatePayloadQueryDefinition queryDef) { - startField("customerAddressUpdate"); - - _queryBuilder.append("(customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - _queryBuilder.append(",id:"); - Query.appendQuotedString(_queryBuilder, id.toString()); + public Boolean getEdited() { + return (Boolean) get("edited"); + } - _queryBuilder.append(",address:"); - address.appendTo(_queryBuilder); + public Order setEdited(Boolean arg) { + optimisticData.put(getKey("edited"), arg); + return this; + } - _queryBuilder.append(')'); + /** + * The customer's email address. + */ - _queryBuilder.append('{'); - queryDef.define(new CustomerAddressUpdatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getEmail() { + return (String) get("email"); + } + public Order setEmail(String arg) { + optimisticData.put(getKey("email"), arg); return this; } /** - * Creates a new customer. + * The financial status of the order. */ - public MutationQuery customerCreate(CustomerCreateInput input, CustomerCreatePayloadQueryDefinition queryDef) { - startField("customerCreate"); - - _queryBuilder.append("(input:"); - input.appendTo(_queryBuilder); - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CustomerCreatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public OrderFinancialStatus getFinancialStatus() { + return (OrderFinancialStatus) get("financialStatus"); + } + public Order setFinancialStatus(OrderFinancialStatus arg) { + optimisticData.put(getKey("financialStatus"), arg); return this; } /** - * Updates the default address of an existing customer. + * The fulfillment status for the order. */ - public MutationQuery customerDefaultAddressUpdate(String customerAccessToken, ID addressId, CustomerDefaultAddressUpdatePayloadQueryDefinition queryDef) { - startField("customerDefaultAddressUpdate"); - - _queryBuilder.append("(customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - - _queryBuilder.append(",addressId:"); - Query.appendQuotedString(_queryBuilder, addressId.toString()); - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CustomerDefaultAddressUpdatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public OrderFulfillmentStatus getFulfillmentStatus() { + return (OrderFulfillmentStatus) get("fulfillmentStatus"); + } + public Order setFulfillmentStatus(OrderFulfillmentStatus arg) { + optimisticData.put(getKey("fulfillmentStatus"), arg); return this; } /** - * Sends a reset password email to the customer. The reset password - * email contains a reset password URL and token that you can pass to - * the [`customerResetByUrl`](https://shopify.dev/api/storefront/latest/mutations/customerResetByUrl) - * or - * [`customerReset`](https://shopify.dev/api/storefront/latest/mutations/customerReset) mutation to - * reset the - * customer password. - * This mutation is throttled by IP. With private access, - * you can provide a - * [`Shopify-Storefront-Buyer-IP`](https://shopify.dev/api/usage/authentication#optional-ip-header) - * instead of the request IP. - * The header is case-sensitive and must be sent as `Shopify-Storefront-Buyer-IP`. - * Make sure that the value provided to `Shopify-Storefront-Buyer-IP` is trusted. Unthrottled access to - * this - * mutation presents a security risk. + * A globally-unique ID. */ - public MutationQuery customerRecover(String email, CustomerRecoverPayloadQueryDefinition queryDef) { - startField("customerRecover"); - _queryBuilder.append("(email:"); - Query.appendQuotedString(_queryBuilder, email.toString()); + public ID getId() { + return (ID) get("id"); + } - _queryBuilder.append(')'); + /** + * List of the order’s line items. + */ - _queryBuilder.append('{'); - queryDef.define(new CustomerRecoverPayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public OrderLineItemConnection getLineItems() { + return (OrderLineItemConnection) get("lineItems"); + } + public Order setLineItems(OrderLineItemConnection arg) { + optimisticData.put(getKey("lineItems"), arg); return this; } /** - * "Resets a customer’s password with the token received from a reset password email. You can send a - * reset password email with the - * [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation." + * Returns a metafield found by namespace and key. */ - public MutationQuery customerReset(ID id, CustomerResetInput input, CustomerResetPayloadQueryDefinition queryDef) { - startField("customerReset"); - - _queryBuilder.append("(id:"); - Query.appendQuotedString(_queryBuilder, id.toString()); - - _queryBuilder.append(",input:"); - input.appendTo(_queryBuilder); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new CustomerResetPayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } + public Order setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); return this; } /** - * "Resets a customer’s password with the reset password URL received from a reset password email. You - * can send a reset password email with the - * [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation." + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public MutationQuery customerResetByUrl(String resetUrl, String password, CustomerResetByUrlPayloadQueryDefinition queryDef) { - startField("customerResetByUrl"); - _queryBuilder.append("(resetUrl:"); - Query.appendQuotedString(_queryBuilder, resetUrl.toString()); + public List getMetafields() { + return (List) get("metafields"); + } - _queryBuilder.append(",password:"); - Query.appendQuotedString(_queryBuilder, password.toString()); + public Order setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); + return this; + } - _queryBuilder.append(')'); + /** + * Unique identifier for the order that appears on the order. + * For example, _#1000_ or _Store1001. + */ - _queryBuilder.append('{'); - queryDef.define(new CustomerResetByUrlPayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getName() { + return (String) get("name"); + } + public Order setName(String arg) { + optimisticData.put(getKey("name"), arg); return this; } /** - * Updates an existing customer. + * A unique numeric identifier for the order for use by shop owner and customer. */ - public MutationQuery customerUpdate(String customerAccessToken, CustomerUpdateInput customer, CustomerUpdatePayloadQueryDefinition queryDef) { - startField("customerUpdate"); - _queryBuilder.append("(customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + public Integer getOrderNumber() { + return (Integer) get("orderNumber"); + } - _queryBuilder.append(",customer:"); - customer.appendTo(_queryBuilder); + public Order setOrderNumber(Integer arg) { + optimisticData.put(getKey("orderNumber"), arg); + return this; + } - _queryBuilder.append(')'); + /** + * The total cost of duties charged at checkout. + */ - _queryBuilder.append('{'); - queryDef.define(new CustomerUpdatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getOriginalTotalDuties() { + return (MoneyV2) get("originalTotalDuties"); + } + public Order setOriginalTotalDuties(MoneyV2 arg) { + optimisticData.put(getKey("originalTotalDuties"), arg); return this; } - public String toString() { - return _queryBuilder.toString(); - } - } + /** + * The total price of the order before any applied edits. + */ - /** - * The schema’s entry-point for mutations. This acts as the public, top-level API from which all - * mutation queries must start. - */ - public static class Mutation extends AbstractResponse { - public Mutation() { + public MoneyV2 getOriginalTotalPrice() { + return (MoneyV2) get("originalTotalPrice"); } - public Mutation(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cartAttributesUpdate": { - CartAttributesUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartAttributesUpdatePayload(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + public Order setOriginalTotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("originalTotalPrice"), arg); + return this; + } - break; - } + /** + * The customer's phone number for receiving SMS notifications. + */ - case "cartBuyerIdentityUpdate": { - CartBuyerIdentityUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartBuyerIdentityUpdatePayload(jsonAsObject(field.getValue(), key)); - } + public String getPhone() { + return (String) get("phone"); + } - responseData.put(key, optional1); + public Order setPhone(String arg) { + optimisticData.put(getKey("phone"), arg); + return this; + } - break; - } + /** + * The date and time when the order was imported. + * This value can be set to dates in the past when importing from other systems. + * If no value is provided, it will be auto-generated based on current date and time. + */ - case "cartCreate": { - CartCreatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartCreatePayload(jsonAsObject(field.getValue(), key)); - } + public DateTime getProcessedAt() { + return (DateTime) get("processedAt"); + } - responseData.put(key, optional1); + public Order setProcessedAt(DateTime arg) { + optimisticData.put(getKey("processedAt"), arg); + return this; + } - break; - } + /** + * The address to where the order will be shipped. + */ - case "cartDiscountCodesUpdate": { - CartDiscountCodesUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartDiscountCodesUpdatePayload(jsonAsObject(field.getValue(), key)); - } + public MailingAddress getShippingAddress() { + return (MailingAddress) get("shippingAddress"); + } - responseData.put(key, optional1); + public Order setShippingAddress(MailingAddress arg) { + optimisticData.put(getKey("shippingAddress"), arg); + return this; + } - break; - } + /** + * The discounts that have been allocated onto the shipping line by discount applications. + */ - case "cartLinesAdd": { - CartLinesAddPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartLinesAddPayload(jsonAsObject(field.getValue(), key)); - } + public List getShippingDiscountAllocations() { + return (List) get("shippingDiscountAllocations"); + } - responseData.put(key, optional1); + public Order setShippingDiscountAllocations(List arg) { + optimisticData.put(getKey("shippingDiscountAllocations"), arg); + return this; + } - break; - } + /** + * The unique URL for the order's status page. + */ - case "cartLinesRemove": { - CartLinesRemovePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartLinesRemovePayload(jsonAsObject(field.getValue(), key)); - } + public String getStatusUrl() { + return (String) get("statusUrl"); + } - responseData.put(key, optional1); + public Order setStatusUrl(String arg) { + optimisticData.put(getKey("statusUrl"), arg); + return this; + } - break; - } + /** + * Price of the order before shipping and taxes. + */ - case "cartLinesUpdate": { - CartLinesUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartLinesUpdatePayload(jsonAsObject(field.getValue(), key)); - } + public MoneyV2 getSubtotalPrice() { + return (MoneyV2) get("subtotalPrice"); + } - responseData.put(key, optional1); + public Order setSubtotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("subtotalPrice"), arg); + return this; + } - break; - } + /** + * Price of the order before duties, shipping and taxes. + * + * @deprecated Use `subtotalPrice` instead. + */ - case "cartMetafieldDelete": { - CartMetafieldDeletePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartMetafieldDeletePayload(jsonAsObject(field.getValue(), key)); - } + public MoneyV2 getSubtotalPriceV2() { + return (MoneyV2) get("subtotalPriceV2"); + } - responseData.put(key, optional1); + public Order setSubtotalPriceV2(MoneyV2 arg) { + optimisticData.put(getKey("subtotalPriceV2"), arg); + return this; + } - break; - } + /** + * List of the order’s successful fulfillments. + */ - case "cartMetafieldsSet": { - CartMetafieldsSetPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartMetafieldsSetPayload(jsonAsObject(field.getValue(), key)); - } + public List getSuccessfulFulfillments() { + return (List) get("successfulFulfillments"); + } - responseData.put(key, optional1); + public Order setSuccessfulFulfillments(List arg) { + optimisticData.put(getKey("successfulFulfillments"), arg); + return this; + } - break; - } + /** + * The sum of all the prices of all the items in the order, duties, taxes and discounts included (must + * be positive). + */ - case "cartNoteUpdate": { - CartNoteUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartNoteUpdatePayload(jsonAsObject(field.getValue(), key)); - } + public MoneyV2 getTotalPrice() { + return (MoneyV2) get("totalPrice"); + } - responseData.put(key, optional1); + public Order setTotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("totalPrice"), arg); + return this; + } - break; - } + /** + * The sum of all the prices of all the items in the order, duties, taxes and discounts included (must + * be positive). + * + * @deprecated Use `totalPrice` instead. + */ - case "cartPaymentUpdate": { - CartPaymentUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartPaymentUpdatePayload(jsonAsObject(field.getValue(), key)); - } + public MoneyV2 getTotalPriceV2() { + return (MoneyV2) get("totalPriceV2"); + } - responseData.put(key, optional1); + public Order setTotalPriceV2(MoneyV2 arg) { + optimisticData.put(getKey("totalPriceV2"), arg); + return this; + } - break; - } + /** + * The total amount that has been refunded. + */ - case "cartSelectedDeliveryOptionsUpdate": { - CartSelectedDeliveryOptionsUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartSelectedDeliveryOptionsUpdatePayload(jsonAsObject(field.getValue(), key)); - } + public MoneyV2 getTotalRefunded() { + return (MoneyV2) get("totalRefunded"); + } - responseData.put(key, optional1); + public Order setTotalRefunded(MoneyV2 arg) { + optimisticData.put(getKey("totalRefunded"), arg); + return this; + } - break; - } + /** + * The total amount that has been refunded. + * + * @deprecated Use `totalRefunded` instead. + */ - case "cartSubmitForCompletion": { - CartSubmitForCompletionPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartSubmitForCompletionPayload(jsonAsObject(field.getValue(), key)); - } + public MoneyV2 getTotalRefundedV2() { + return (MoneyV2) get("totalRefundedV2"); + } - responseData.put(key, optional1); + public Order setTotalRefundedV2(MoneyV2 arg) { + optimisticData.put(getKey("totalRefundedV2"), arg); + return this; + } - break; - } + /** + * The total cost of shipping. + */ - case "checkoutAttributesUpdateV2": { - CheckoutAttributesUpdateV2Payload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutAttributesUpdateV2Payload(jsonAsObject(field.getValue(), key)); - } + public MoneyV2 getTotalShippingPrice() { + return (MoneyV2) get("totalShippingPrice"); + } - responseData.put(key, optional1); + public Order setTotalShippingPrice(MoneyV2 arg) { + optimisticData.put(getKey("totalShippingPrice"), arg); + return this; + } - break; - } + /** + * The total cost of shipping. + * + * @deprecated Use `totalShippingPrice` instead. + */ - case "checkoutCompleteFree": { - CheckoutCompleteFreePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutCompleteFreePayload(jsonAsObject(field.getValue(), key)); - } + public MoneyV2 getTotalShippingPriceV2() { + return (MoneyV2) get("totalShippingPriceV2"); + } - responseData.put(key, optional1); + public Order setTotalShippingPriceV2(MoneyV2 arg) { + optimisticData.put(getKey("totalShippingPriceV2"), arg); + return this; + } - break; - } + /** + * The total cost of taxes. + */ - case "checkoutCompleteWithCreditCardV2": { - CheckoutCompleteWithCreditCardV2Payload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutCompleteWithCreditCardV2Payload(jsonAsObject(field.getValue(), key)); - } + public MoneyV2 getTotalTax() { + return (MoneyV2) get("totalTax"); + } - responseData.put(key, optional1); + public Order setTotalTax(MoneyV2 arg) { + optimisticData.put(getKey("totalTax"), arg); + return this; + } - break; - } + /** + * The total cost of taxes. + * + * @deprecated Use `totalTax` instead. + */ - case "checkoutCompleteWithTokenizedPaymentV3": { - CheckoutCompleteWithTokenizedPaymentV3Payload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutCompleteWithTokenizedPaymentV3Payload(jsonAsObject(field.getValue(), key)); - } + public MoneyV2 getTotalTaxV2() { + return (MoneyV2) get("totalTaxV2"); + } - responseData.put(key, optional1); + public Order setTotalTaxV2(MoneyV2 arg) { + optimisticData.put(getKey("totalTaxV2"), arg); + return this; + } - break; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "billingAddress": return true; - case "checkoutCreate": { - CheckoutCreatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutCreatePayload(jsonAsObject(field.getValue(), key)); - } + case "cancelReason": return false; - responseData.put(key, optional1); + case "canceledAt": return false; - break; - } + case "currencyCode": return false; - case "checkoutCustomerAssociateV2": { - CheckoutCustomerAssociateV2Payload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutCustomerAssociateV2Payload(jsonAsObject(field.getValue(), key)); - } + case "currentSubtotalPrice": return true; - responseData.put(key, optional1); + case "currentTotalDuties": return true; - break; - } + case "currentTotalPrice": return true; - case "checkoutCustomerDisassociateV2": { - CheckoutCustomerDisassociateV2Payload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutCustomerDisassociateV2Payload(jsonAsObject(field.getValue(), key)); - } + case "currentTotalShippingPrice": return true; - responseData.put(key, optional1); + case "currentTotalTax": return true; - break; - } + case "customAttributes": return true; - case "checkoutDiscountCodeApplyV2": { - CheckoutDiscountCodeApplyV2Payload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutDiscountCodeApplyV2Payload(jsonAsObject(field.getValue(), key)); - } + case "customerLocale": return false; - responseData.put(key, optional1); + case "customerUrl": return false; - break; - } + case "discountApplications": return true; - case "checkoutDiscountCodeRemove": { - CheckoutDiscountCodeRemovePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutDiscountCodeRemovePayload(jsonAsObject(field.getValue(), key)); - } + case "edited": return false; - responseData.put(key, optional1); + case "email": return false; - break; - } + case "financialStatus": return false; - case "checkoutEmailUpdateV2": { - CheckoutEmailUpdateV2Payload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutEmailUpdateV2Payload(jsonAsObject(field.getValue(), key)); - } + case "fulfillmentStatus": return false; - responseData.put(key, optional1); + case "id": return false; - break; - } + case "lineItems": return true; - case "checkoutGiftCardRemoveV2": { - CheckoutGiftCardRemoveV2Payload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutGiftCardRemoveV2Payload(jsonAsObject(field.getValue(), key)); - } + case "metafield": return true; - responseData.put(key, optional1); + case "metafields": return true; - break; - } + case "name": return false; - case "checkoutGiftCardsAppend": { - CheckoutGiftCardsAppendPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutGiftCardsAppendPayload(jsonAsObject(field.getValue(), key)); - } + case "orderNumber": return false; - responseData.put(key, optional1); + case "originalTotalDuties": return true; - break; - } + case "originalTotalPrice": return true; - case "checkoutLineItemsAdd": { - CheckoutLineItemsAddPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutLineItemsAddPayload(jsonAsObject(field.getValue(), key)); - } + case "phone": return false; - responseData.put(key, optional1); + case "processedAt": return false; - break; - } + case "shippingAddress": return true; - case "checkoutLineItemsRemove": { - CheckoutLineItemsRemovePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutLineItemsRemovePayload(jsonAsObject(field.getValue(), key)); - } + case "shippingDiscountAllocations": return true; - responseData.put(key, optional1); + case "statusUrl": return false; - break; - } + case "subtotalPrice": return true; - case "checkoutLineItemsReplace": { - CheckoutLineItemsReplacePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutLineItemsReplacePayload(jsonAsObject(field.getValue(), key)); - } + case "subtotalPriceV2": return true; - responseData.put(key, optional1); + case "successfulFulfillments": return true; - break; - } + case "totalPrice": return true; - case "checkoutLineItemsUpdate": { - CheckoutLineItemsUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutLineItemsUpdatePayload(jsonAsObject(field.getValue(), key)); - } + case "totalPriceV2": return true; - responseData.put(key, optional1); + case "totalRefunded": return true; - break; - } + case "totalRefundedV2": return true; - case "checkoutShippingAddressUpdateV2": { - CheckoutShippingAddressUpdateV2Payload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutShippingAddressUpdateV2Payload(jsonAsObject(field.getValue(), key)); - } + case "totalShippingPrice": return true; - responseData.put(key, optional1); + case "totalShippingPriceV2": return true; - break; - } + case "totalTax": return true; - case "checkoutShippingLineUpdate": { - CheckoutShippingLineUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutShippingLineUpdatePayload(jsonAsObject(field.getValue(), key)); - } + case "totalTaxV2": return true; - responseData.put(key, optional1); + default: return false; + } + } + } - break; - } + /** + * Represents the reason for the order's cancellation. + */ + public enum OrderCancelReason { + /** + * The customer wanted to cancel the order. + */ + CUSTOMER, - case "customerAccessTokenCreate": { - CustomerAccessTokenCreatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessTokenCreatePayload(jsonAsObject(field.getValue(), key)); - } + /** + * Payment was declined. + */ + DECLINED, - responseData.put(key, optional1); + /** + * The order was fraudulent. + */ + FRAUD, - break; - } + /** + * There was insufficient inventory. + */ + INVENTORY, - case "customerAccessTokenCreateWithMultipass": { - CustomerAccessTokenCreateWithMultipassPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessTokenCreateWithMultipassPayload(jsonAsObject(field.getValue(), key)); - } + /** + * The order was canceled for an unlisted reason. + */ + OTHER, - responseData.put(key, optional1); + /** + * Staff made an error. + */ + STAFF, - break; - } + UNKNOWN_VALUE; - case "customerAccessTokenDelete": { - CustomerAccessTokenDeletePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessTokenDeletePayload(jsonAsObject(field.getValue(), key)); - } + public static OrderCancelReason fromGraphQl(String value) { + if (value == null) { + return null; + } - responseData.put(key, optional1); + switch (value) { + case "CUSTOMER": { + return CUSTOMER; + } - break; - } + case "DECLINED": { + return DECLINED; + } - case "customerAccessTokenRenew": { - CustomerAccessTokenRenewPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessTokenRenewPayload(jsonAsObject(field.getValue(), key)); - } + case "FRAUD": { + return FRAUD; + } - responseData.put(key, optional1); + case "INVENTORY": { + return INVENTORY; + } - break; - } + case "OTHER": { + return OTHER; + } - case "customerActivate": { - CustomerActivatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerActivatePayload(jsonAsObject(field.getValue(), key)); - } + case "STAFF": { + return STAFF; + } - responseData.put(key, optional1); + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case CUSTOMER: { + return "CUSTOMER"; + } - break; - } + case DECLINED: { + return "DECLINED"; + } - case "customerActivateByUrl": { - CustomerActivateByUrlPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerActivateByUrlPayload(jsonAsObject(field.getValue(), key)); - } + case FRAUD: { + return "FRAUD"; + } - responseData.put(key, optional1); + case INVENTORY: { + return "INVENTORY"; + } - break; - } + case OTHER: { + return "OTHER"; + } - case "customerAddressCreate": { - CustomerAddressCreatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAddressCreatePayload(jsonAsObject(field.getValue(), key)); - } + case STAFF: { + return "STAFF"; + } - responseData.put(key, optional1); + default: { + return ""; + } + } + } + } - break; - } + public interface OrderConnectionQueryDefinition { + void define(OrderConnectionQuery _queryBuilder); + } - case "customerAddressDelete": { - CustomerAddressDeletePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAddressDeletePayload(jsonAsObject(field.getValue(), key)); - } + /** + * An auto-generated type for paginating through multiple Orders. + */ + public static class OrderConnectionQuery extends Query { + OrderConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - responseData.put(key, optional1); + /** + * A list of edges. + */ + public OrderConnectionQuery edges(OrderEdgeQueryDefinition queryDef) { + startField("edges"); - break; - } + _queryBuilder.append('{'); + queryDef.define(new OrderEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "customerAddressUpdate": { - CustomerAddressUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAddressUpdatePayload(jsonAsObject(field.getValue(), key)); - } + return this; + } - responseData.put(key, optional1); + /** + * A list of the nodes contained in OrderEdge. + */ + public OrderConnectionQuery nodes(OrderQueryDefinition queryDef) { + startField("nodes"); - break; - } + _queryBuilder.append('{'); + queryDef.define(new OrderQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "customerCreate": { - CustomerCreatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerCreatePayload(jsonAsObject(field.getValue(), key)); - } + return this; + } - responseData.put(key, optional1); + /** + * Information to aid in pagination. + */ + public OrderConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - break; - } + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "customerDefaultAddressUpdate": { - CustomerDefaultAddressUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerDefaultAddressUpdatePayload(jsonAsObject(field.getValue(), key)); - } + return this; + } - responseData.put(key, optional1); + /** + * The total count of Orders. + */ + public OrderConnectionQuery totalCount() { + startField("totalCount"); - break; - } + return this; + } + } - case "customerRecover": { - CustomerRecoverPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerRecoverPayload(jsonAsObject(field.getValue(), key)); + /** + * An auto-generated type for paginating through multiple Orders. + */ + public static class OrderConnection extends AbstractResponse { + public OrderConnection() { + } + + public OrderConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new OrderEdge(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "customerReset": { - CustomerResetPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerResetPayload(jsonAsObject(field.getValue(), key)); + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Order(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "customerResetByUrl": { - CustomerResetByUrlPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerResetByUrlPayload(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } - case "customerUpdate": { - CustomerUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerUpdatePayload(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "totalCount": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -51617,1074 +48297,1418 @@ public Mutation(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "Mutation"; + return "OrderConnection"; } /** - * Updates the attributes on a cart. + * A list of edges. */ - public CartAttributesUpdatePayload getCartAttributesUpdate() { - return (CartAttributesUpdatePayload) get("cartAttributesUpdate"); + public List getEdges() { + return (List) get("edges"); } - public Mutation setCartAttributesUpdate(CartAttributesUpdatePayload arg) { - optimisticData.put(getKey("cartAttributesUpdate"), arg); + public OrderConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * Updates customer information associated with a cart. - * Buyer identity is used to determine - * [international - * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing) - * and should match the customer's shipping address. + * A list of the nodes contained in OrderEdge. */ - public CartBuyerIdentityUpdatePayload getCartBuyerIdentityUpdate() { - return (CartBuyerIdentityUpdatePayload) get("cartBuyerIdentityUpdate"); + public List getNodes() { + return (List) get("nodes"); } - public Mutation setCartBuyerIdentityUpdate(CartBuyerIdentityUpdatePayload arg) { - optimisticData.put(getKey("cartBuyerIdentityUpdate"), arg); + public OrderConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * Creates a new cart. + * Information to aid in pagination. */ - public CartCreatePayload getCartCreate() { - return (CartCreatePayload) get("cartCreate"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public Mutation setCartCreate(CartCreatePayload arg) { - optimisticData.put(getKey("cartCreate"), arg); + public OrderConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } /** - * Updates the discount codes applied to the cart. + * The total count of Orders. */ - public CartDiscountCodesUpdatePayload getCartDiscountCodesUpdate() { - return (CartDiscountCodesUpdatePayload) get("cartDiscountCodesUpdate"); + public String getTotalCount() { + return (String) get("totalCount"); } - public Mutation setCartDiscountCodesUpdate(CartDiscountCodesUpdatePayload arg) { - optimisticData.put(getKey("cartDiscountCodesUpdate"), arg); + public OrderConnection setTotalCount(String arg) { + optimisticData.put(getKey("totalCount"), arg); return this; } - /** - * Adds a merchandise line to the cart. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - public CartLinesAddPayload getCartLinesAdd() { - return (CartLinesAddPayload) get("cartLinesAdd"); - } + case "nodes": return true; - public Mutation setCartLinesAdd(CartLinesAddPayload arg) { - optimisticData.put(getKey("cartLinesAdd"), arg); - return this; - } + case "pageInfo": return true; - /** - * Removes one or more merchandise lines from the cart. - */ + case "totalCount": return false; - public CartLinesRemovePayload getCartLinesRemove() { - return (CartLinesRemovePayload) get("cartLinesRemove"); + default: return false; + } } + } - public Mutation setCartLinesRemove(CartLinesRemovePayload arg) { - optimisticData.put(getKey("cartLinesRemove"), arg); - return this; + public interface OrderEdgeQueryDefinition { + void define(OrderEdgeQuery _queryBuilder); + } + + /** + * An auto-generated type which holds one Order and a cursor during pagination. + */ + public static class OrderEdgeQuery extends Query { + OrderEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * Updates one or more merchandise lines on a cart. + * A cursor for use in pagination. */ + public OrderEdgeQuery cursor() { + startField("cursor"); - public CartLinesUpdatePayload getCartLinesUpdate() { - return (CartLinesUpdatePayload) get("cartLinesUpdate"); - } - - public Mutation setCartLinesUpdate(CartLinesUpdatePayload arg) { - optimisticData.put(getKey("cartLinesUpdate"), arg); return this; } /** - * Deletes a cart metafield. + * The item at the end of OrderEdge. */ + public OrderEdgeQuery node(OrderQueryDefinition queryDef) { + startField("node"); - public CartMetafieldDeletePayload getCartMetafieldDelete() { - return (CartMetafieldDeletePayload) get("cartMetafieldDelete"); - } + _queryBuilder.append('{'); + queryDef.define(new OrderQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Mutation setCartMetafieldDelete(CartMetafieldDeletePayload arg) { - optimisticData.put(getKey("cartMetafieldDelete"), arg); return this; } + } - /** - * Sets cart metafield values. Cart metafield values will be set regardless if they were previously - * created or not. - * Allows a maximum of 25 cart metafields to be set at a time. - */ - - public CartMetafieldsSetPayload getCartMetafieldsSet() { - return (CartMetafieldsSetPayload) get("cartMetafieldsSet"); - } - - public Mutation setCartMetafieldsSet(CartMetafieldsSetPayload arg) { - optimisticData.put(getKey("cartMetafieldsSet"), arg); - return this; + /** + * An auto-generated type which holds one Order and a cursor during pagination. + */ + public static class OrderEdge extends AbstractResponse { + public OrderEdge() { } - /** - * Updates the note on the cart. - */ + public OrderEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - public CartNoteUpdatePayload getCartNoteUpdate() { - return (CartNoteUpdatePayload) get("cartNoteUpdate"); - } + break; + } - public Mutation setCartNoteUpdate(CartNoteUpdatePayload arg) { - optimisticData.put(getKey("cartNoteUpdate"), arg); - return this; - } + case "node": { + responseData.put(key, new Order(jsonAsObject(field.getValue(), key))); - /** - * Update the customer's payment method that will be used to checkout. - */ + break; + } - public CartPaymentUpdatePayload getCartPaymentUpdate() { - return (CartPaymentUpdatePayload) get("cartPaymentUpdate"); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public Mutation setCartPaymentUpdate(CartPaymentUpdatePayload arg) { - optimisticData.put(getKey("cartPaymentUpdate"), arg); - return this; + public String getGraphQlTypeName() { + return "OrderEdge"; } /** - * Update the selected delivery options for a delivery group. + * A cursor for use in pagination. */ - public CartSelectedDeliveryOptionsUpdatePayload getCartSelectedDeliveryOptionsUpdate() { - return (CartSelectedDeliveryOptionsUpdatePayload) get("cartSelectedDeliveryOptionsUpdate"); + public String getCursor() { + return (String) get("cursor"); } - public Mutation setCartSelectedDeliveryOptionsUpdate(CartSelectedDeliveryOptionsUpdatePayload arg) { - optimisticData.put(getKey("cartSelectedDeliveryOptionsUpdate"), arg); + public OrderEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * Submit the cart for checkout completion. + * The item at the end of OrderEdge. */ - public CartSubmitForCompletionPayload getCartSubmitForCompletion() { - return (CartSubmitForCompletionPayload) get("cartSubmitForCompletion"); + public Order getNode() { + return (Order) get("node"); } - public Mutation setCartSubmitForCompletion(CartSubmitForCompletionPayload arg) { - optimisticData.put(getKey("cartSubmitForCompletion"), arg); + public OrderEdge setNode(Order arg) { + optimisticData.put(getKey("node"), arg); return this; } - /** - * Updates the attributes of a checkout if `allowPartialAddresses` is `true`. - * - * @deprecated 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. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - public CheckoutAttributesUpdateV2Payload getCheckoutAttributesUpdateV2() { - return (CheckoutAttributesUpdateV2Payload) get("checkoutAttributesUpdateV2"); - } + case "node": return true; - public Mutation setCheckoutAttributesUpdateV2(CheckoutAttributesUpdateV2Payload arg) { - optimisticData.put(getKey("checkoutAttributesUpdateV2"), arg); - return this; + default: return false; + } } + } + /** + * Represents the order's current financial status. + */ + public enum OrderFinancialStatus { /** - * 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. - * - * @deprecated 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. + * Displayed as **Authorized**. */ + AUTHORIZED, - public CheckoutCompleteFreePayload getCheckoutCompleteFree() { - return (CheckoutCompleteFreePayload) get("checkoutCompleteFree"); - } + /** + * Displayed as **Paid**. + */ + PAID, - public Mutation setCheckoutCompleteFree(CheckoutCompleteFreePayload arg) { - optimisticData.put(getKey("checkoutCompleteFree"), arg); - return this; - } + /** + * Displayed as **Partially paid**. + */ + PARTIALLY_PAID, /** - * 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). - * - * @deprecated 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. + * Displayed as **Partially refunded**. */ + PARTIALLY_REFUNDED, - public CheckoutCompleteWithCreditCardV2Payload getCheckoutCompleteWithCreditCardV2() { - return (CheckoutCompleteWithCreditCardV2Payload) get("checkoutCompleteWithCreditCardV2"); - } + /** + * Displayed as **Pending**. + */ + PENDING, - public Mutation setCheckoutCompleteWithCreditCardV2(CheckoutCompleteWithCreditCardV2Payload arg) { - optimisticData.put(getKey("checkoutCompleteWithCreditCardV2"), arg); - return this; - } + /** + * Displayed as **Refunded**. + */ + REFUNDED, /** - * Completes a checkout with a tokenized payment. - * - * @deprecated 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. + * Displayed as **Voided**. */ + VOIDED, - public CheckoutCompleteWithTokenizedPaymentV3Payload getCheckoutCompleteWithTokenizedPaymentV3() { - return (CheckoutCompleteWithTokenizedPaymentV3Payload) get("checkoutCompleteWithTokenizedPaymentV3"); - } + UNKNOWN_VALUE; - public Mutation setCheckoutCompleteWithTokenizedPaymentV3(CheckoutCompleteWithTokenizedPaymentV3Payload arg) { - optimisticData.put(getKey("checkoutCompleteWithTokenizedPaymentV3"), arg); - return this; - } + public static OrderFinancialStatus fromGraphQl(String value) { + if (value == null) { + return null; + } - /** - * Creates a new checkout. - * - * @deprecated 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. - */ + switch (value) { + case "AUTHORIZED": { + return AUTHORIZED; + } - public CheckoutCreatePayload getCheckoutCreate() { - return (CheckoutCreatePayload) get("checkoutCreate"); - } + case "PAID": { + return PAID; + } - public Mutation setCheckoutCreate(CheckoutCreatePayload arg) { - optimisticData.put(getKey("checkoutCreate"), arg); - return this; - } + case "PARTIALLY_PAID": { + return PARTIALLY_PAID; + } - /** - * Associates a customer to the checkout. - * - * @deprecated 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. - */ + case "PARTIALLY_REFUNDED": { + return PARTIALLY_REFUNDED; + } - public CheckoutCustomerAssociateV2Payload getCheckoutCustomerAssociateV2() { - return (CheckoutCustomerAssociateV2Payload) get("checkoutCustomerAssociateV2"); - } + case "PENDING": { + return PENDING; + } - public Mutation setCheckoutCustomerAssociateV2(CheckoutCustomerAssociateV2Payload arg) { - optimisticData.put(getKey("checkoutCustomerAssociateV2"), arg); - return this; - } + case "REFUNDED": { + return REFUNDED; + } - /** - * Disassociates the current checkout customer from the checkout. - * - * @deprecated 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. - */ + case "VOIDED": { + return VOIDED; + } - public CheckoutCustomerDisassociateV2Payload getCheckoutCustomerDisassociateV2() { - return (CheckoutCustomerDisassociateV2Payload) get("checkoutCustomerDisassociateV2"); + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case AUTHORIZED: { + return "AUTHORIZED"; + } - public Mutation setCheckoutCustomerDisassociateV2(CheckoutCustomerDisassociateV2Payload arg) { - optimisticData.put(getKey("checkoutCustomerDisassociateV2"), arg); - return this; - } + case PAID: { + return "PAID"; + } - /** - * Applies a discount to an existing checkout using a discount code. - * - * @deprecated 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. - */ + case PARTIALLY_PAID: { + return "PARTIALLY_PAID"; + } - public CheckoutDiscountCodeApplyV2Payload getCheckoutDiscountCodeApplyV2() { - return (CheckoutDiscountCodeApplyV2Payload) get("checkoutDiscountCodeApplyV2"); - } + case PARTIALLY_REFUNDED: { + return "PARTIALLY_REFUNDED"; + } - public Mutation setCheckoutDiscountCodeApplyV2(CheckoutDiscountCodeApplyV2Payload arg) { - optimisticData.put(getKey("checkoutDiscountCodeApplyV2"), arg); - return this; - } + case PENDING: { + return "PENDING"; + } - /** - * Removes the applied discounts from an existing checkout. - * - * @deprecated 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. - */ + case REFUNDED: { + return "REFUNDED"; + } - public CheckoutDiscountCodeRemovePayload getCheckoutDiscountCodeRemove() { - return (CheckoutDiscountCodeRemovePayload) get("checkoutDiscountCodeRemove"); - } + case VOIDED: { + return "VOIDED"; + } - public Mutation setCheckoutDiscountCodeRemove(CheckoutDiscountCodeRemovePayload arg) { - optimisticData.put(getKey("checkoutDiscountCodeRemove"), arg); - return this; + default: { + return ""; + } + } } + } + /** + * Represents the order's aggregated fulfillment status for display purposes. + */ + public enum OrderFulfillmentStatus { /** - * Updates the email on an existing checkout. - * - * @deprecated 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. + * Displayed as **Fulfilled**. All of the items in the order have been fulfilled. */ + FULFILLED, - public CheckoutEmailUpdateV2Payload getCheckoutEmailUpdateV2() { - return (CheckoutEmailUpdateV2Payload) get("checkoutEmailUpdateV2"); - } - - public Mutation setCheckoutEmailUpdateV2(CheckoutEmailUpdateV2Payload arg) { - optimisticData.put(getKey("checkoutEmailUpdateV2"), arg); - return this; - } + /** + * Displayed as **In progress**. Some of the items in the order have been fulfilled, or a request for + * fulfillment has been sent to the fulfillment service. + */ + IN_PROGRESS, /** - * Removes an applied gift card from the checkout. - * - * @deprecated 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. + * Displayed as **On hold**. All of the unfulfilled items in this order are on hold. */ + ON_HOLD, - public CheckoutGiftCardRemoveV2Payload getCheckoutGiftCardRemoveV2() { - return (CheckoutGiftCardRemoveV2Payload) get("checkoutGiftCardRemoveV2"); - } + /** + * Displayed as **Open**. None of the items in the order have been fulfilled. Replaced by "UNFULFILLED" + * status. + */ + OPEN, - public Mutation setCheckoutGiftCardRemoveV2(CheckoutGiftCardRemoveV2Payload arg) { - optimisticData.put(getKey("checkoutGiftCardRemoveV2"), arg); - return this; - } + /** + * Displayed as **Partially fulfilled**. Some of the items in the order have been fulfilled. + */ + PARTIALLY_FULFILLED, /** - * Appends gift cards to an existing checkout. - * - * @deprecated 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. + * Displayed as **Pending fulfillment**. A request for fulfillment of some items awaits a response from + * the fulfillment service. Replaced by "IN_PROGRESS" status. */ + PENDING_FULFILLMENT, - public CheckoutGiftCardsAppendPayload getCheckoutGiftCardsAppend() { - return (CheckoutGiftCardsAppendPayload) get("checkoutGiftCardsAppend"); - } + /** + * Displayed as **Restocked**. All of the items in the order have been restocked. Replaced by + * "UNFULFILLED" status. + */ + RESTOCKED, - public Mutation setCheckoutGiftCardsAppend(CheckoutGiftCardsAppendPayload arg) { - optimisticData.put(getKey("checkoutGiftCardsAppend"), arg); - return this; - } + /** + * Displayed as **Scheduled**. All of the unfulfilled items in this order are scheduled for fulfillment + * at later time. + */ + SCHEDULED, /** - * Adds a list of line items to a checkout. - * - * @deprecated 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. + * Displayed as **Unfulfilled**. None of the items in the order have been fulfilled. */ + UNFULFILLED, - public CheckoutLineItemsAddPayload getCheckoutLineItemsAdd() { - return (CheckoutLineItemsAddPayload) get("checkoutLineItemsAdd"); - } + UNKNOWN_VALUE; - public Mutation setCheckoutLineItemsAdd(CheckoutLineItemsAddPayload arg) { - optimisticData.put(getKey("checkoutLineItemsAdd"), arg); - return this; - } + public static OrderFulfillmentStatus fromGraphQl(String value) { + if (value == null) { + return null; + } - /** - * Removes line items from an existing checkout. - * - * @deprecated 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. - */ + switch (value) { + case "FULFILLED": { + return FULFILLED; + } - public CheckoutLineItemsRemovePayload getCheckoutLineItemsRemove() { - return (CheckoutLineItemsRemovePayload) get("checkoutLineItemsRemove"); - } + case "IN_PROGRESS": { + return IN_PROGRESS; + } - public Mutation setCheckoutLineItemsRemove(CheckoutLineItemsRemovePayload arg) { - optimisticData.put(getKey("checkoutLineItemsRemove"), arg); - return this; - } + case "ON_HOLD": { + return ON_HOLD; + } - /** - * Sets a list of line items to a checkout. - * - * @deprecated 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. - */ + case "OPEN": { + return OPEN; + } - public CheckoutLineItemsReplacePayload getCheckoutLineItemsReplace() { - return (CheckoutLineItemsReplacePayload) get("checkoutLineItemsReplace"); - } + case "PARTIALLY_FULFILLED": { + return PARTIALLY_FULFILLED; + } - public Mutation setCheckoutLineItemsReplace(CheckoutLineItemsReplacePayload arg) { - optimisticData.put(getKey("checkoutLineItemsReplace"), arg); - return this; + case "PENDING_FULFILLMENT": { + return PENDING_FULFILLMENT; + } + + case "RESTOCKED": { + return RESTOCKED; + } + + case "SCHEDULED": { + return SCHEDULED; + } + + case "UNFULFILLED": { + return UNFULFILLED; + } + + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case FULFILLED: { + return "FULFILLED"; + } - /** - * Updates line items on a checkout. - * - * @deprecated 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. - */ + case IN_PROGRESS: { + return "IN_PROGRESS"; + } + + case ON_HOLD: { + return "ON_HOLD"; + } + + case OPEN: { + return "OPEN"; + } + + case PARTIALLY_FULFILLED: { + return "PARTIALLY_FULFILLED"; + } - public CheckoutLineItemsUpdatePayload getCheckoutLineItemsUpdate() { - return (CheckoutLineItemsUpdatePayload) get("checkoutLineItemsUpdate"); + case PENDING_FULFILLMENT: { + return "PENDING_FULFILLMENT"; + } + + case RESTOCKED: { + return "RESTOCKED"; + } + + case SCHEDULED: { + return "SCHEDULED"; + } + + case UNFULFILLED: { + return "UNFULFILLED"; + } + + default: { + return ""; + } + } } + } - public Mutation setCheckoutLineItemsUpdate(CheckoutLineItemsUpdatePayload arg) { - optimisticData.put(getKey("checkoutLineItemsUpdate"), arg); - return this; + public interface OrderLineItemQueryDefinition { + void define(OrderLineItemQuery _queryBuilder); + } + + /** + * Represents a single line in an order. There is one line item for each distinct product variant. + */ + public static class OrderLineItemQuery extends Query { + OrderLineItemQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * Updates the shipping address of an existing checkout. - * - * @deprecated 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. + * The number of entries associated to the line item minus the items that have been removed. */ + public OrderLineItemQuery currentQuantity() { + startField("currentQuantity"); - public CheckoutShippingAddressUpdateV2Payload getCheckoutShippingAddressUpdateV2() { - return (CheckoutShippingAddressUpdateV2Payload) get("checkoutShippingAddressUpdateV2"); - } - - public Mutation setCheckoutShippingAddressUpdateV2(CheckoutShippingAddressUpdateV2Payload arg) { - optimisticData.put(getKey("checkoutShippingAddressUpdateV2"), arg); return this; } /** - * Updates the shipping lines on an existing checkout. - * - * @deprecated 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. + * List of custom attributes associated to the line item. */ + public OrderLineItemQuery customAttributes(AttributeQueryDefinition queryDef) { + startField("customAttributes"); - public CheckoutShippingLineUpdatePayload getCheckoutShippingLineUpdate() { - return (CheckoutShippingLineUpdatePayload) get("checkoutShippingLineUpdate"); - } + _queryBuilder.append('{'); + queryDef.define(new AttributeQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Mutation setCheckoutShippingLineUpdate(CheckoutShippingLineUpdatePayload arg) { - optimisticData.put(getKey("checkoutShippingLineUpdate"), arg); return this; } /** - * Creates a customer access token. - * The customer access token is required to modify the customer object in any way. + * The discounts that have been allocated onto the order line item by discount applications. */ + public OrderLineItemQuery discountAllocations(DiscountAllocationQueryDefinition queryDef) { + startField("discountAllocations"); - public CustomerAccessTokenCreatePayload getCustomerAccessTokenCreate() { - return (CustomerAccessTokenCreatePayload) get("customerAccessTokenCreate"); - } + _queryBuilder.append('{'); + queryDef.define(new DiscountAllocationQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Mutation setCustomerAccessTokenCreate(CustomerAccessTokenCreatePayload arg) { - optimisticData.put(getKey("customerAccessTokenCreate"), arg); return this; } /** - * Creates a customer access token using a - * [multipass token](https://shopify.dev/api/multipass) instead of email and - * password. A customer record is created if the customer doesn't exist. If a customer - * record already exists but the record is disabled, then the customer record is enabled. + * The total price of the line item, including discounts, and displayed in the presentment currency. */ + public OrderLineItemQuery discountedTotalPrice(MoneyV2QueryDefinition queryDef) { + startField("discountedTotalPrice"); - public CustomerAccessTokenCreateWithMultipassPayload getCustomerAccessTokenCreateWithMultipass() { - return (CustomerAccessTokenCreateWithMultipassPayload) get("customerAccessTokenCreateWithMultipass"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public Mutation setCustomerAccessTokenCreateWithMultipass(CustomerAccessTokenCreateWithMultipassPayload arg) { - optimisticData.put(getKey("customerAccessTokenCreateWithMultipass"), arg); return this; } /** - * Permanently destroys a customer access token. + * The total price of the line item, not including any discounts. The total price is calculated using + * the original unit price multiplied by the quantity, and it's displayed in the presentment currency. */ + public OrderLineItemQuery originalTotalPrice(MoneyV2QueryDefinition queryDef) { + startField("originalTotalPrice"); - public CustomerAccessTokenDeletePayload getCustomerAccessTokenDelete() { - return (CustomerAccessTokenDeletePayload) get("customerAccessTokenDelete"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public Mutation setCustomerAccessTokenDelete(CustomerAccessTokenDeletePayload arg) { - optimisticData.put(getKey("customerAccessTokenDelete"), arg); return this; } /** - * Renews a customer access token. - * Access token renewal must happen *before* a token expires. - * If a token has already expired, a new one should be created instead via `customerAccessTokenCreate`. + * The number of products variants associated to the line item. */ + public OrderLineItemQuery quantity() { + startField("quantity"); - public CustomerAccessTokenRenewPayload getCustomerAccessTokenRenew() { - return (CustomerAccessTokenRenewPayload) get("customerAccessTokenRenew"); - } - - public Mutation setCustomerAccessTokenRenew(CustomerAccessTokenRenewPayload arg) { - optimisticData.put(getKey("customerAccessTokenRenew"), arg); return this; } /** - * Activates a customer. + * The title of the product combined with title of the variant. */ + public OrderLineItemQuery title() { + startField("title"); - public CustomerActivatePayload getCustomerActivate() { - return (CustomerActivatePayload) get("customerActivate"); - } - - public Mutation setCustomerActivate(CustomerActivatePayload arg) { - optimisticData.put(getKey("customerActivate"), arg); return this; } /** - * Activates a customer with the activation url received from `customerCreate`. + * The product variant object associated to the line item. */ + public OrderLineItemQuery variant(ProductVariantQueryDefinition queryDef) { + startField("variant"); - public CustomerActivateByUrlPayload getCustomerActivateByUrl() { - return (CustomerActivateByUrlPayload) get("customerActivateByUrl"); - } + _queryBuilder.append('{'); + queryDef.define(new ProductVariantQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Mutation setCustomerActivateByUrl(CustomerActivateByUrlPayload arg) { - optimisticData.put(getKey("customerActivateByUrl"), arg); return this; } + } - /** - * Creates a new address for a customer. - */ + /** + * Represents a single line in an order. There is one line item for each distinct product variant. + */ + public static class OrderLineItem extends AbstractResponse { + public OrderLineItem() { + } - public CustomerAddressCreatePayload getCustomerAddressCreate() { - return (CustomerAddressCreatePayload) get("customerAddressCreate"); + public OrderLineItem(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "currentQuantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); + + break; + } + + case "customAttributes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Attribute(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "discountAllocations": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new DiscountAllocation(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "discountedTotalPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "originalTotalPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "quantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); + + break; + } + + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "variant": { + ProductVariant optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ProductVariant(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public Mutation setCustomerAddressCreate(CustomerAddressCreatePayload arg) { - optimisticData.put(getKey("customerAddressCreate"), arg); - return this; + public String getGraphQlTypeName() { + return "OrderLineItem"; } /** - * Permanently deletes the address of an existing customer. + * The number of entries associated to the line item minus the items that have been removed. */ - public CustomerAddressDeletePayload getCustomerAddressDelete() { - return (CustomerAddressDeletePayload) get("customerAddressDelete"); + public Integer getCurrentQuantity() { + return (Integer) get("currentQuantity"); } - - public Mutation setCustomerAddressDelete(CustomerAddressDeletePayload arg) { - optimisticData.put(getKey("customerAddressDelete"), arg); + + public OrderLineItem setCurrentQuantity(Integer arg) { + optimisticData.put(getKey("currentQuantity"), arg); return this; } /** - * Updates the address of an existing customer. + * List of custom attributes associated to the line item. */ - public CustomerAddressUpdatePayload getCustomerAddressUpdate() { - return (CustomerAddressUpdatePayload) get("customerAddressUpdate"); + public List getCustomAttributes() { + return (List) get("customAttributes"); } - public Mutation setCustomerAddressUpdate(CustomerAddressUpdatePayload arg) { - optimisticData.put(getKey("customerAddressUpdate"), arg); + public OrderLineItem setCustomAttributes(List arg) { + optimisticData.put(getKey("customAttributes"), arg); return this; } /** - * Creates a new customer. + * The discounts that have been allocated onto the order line item by discount applications. */ - public CustomerCreatePayload getCustomerCreate() { - return (CustomerCreatePayload) get("customerCreate"); + public List getDiscountAllocations() { + return (List) get("discountAllocations"); } - public Mutation setCustomerCreate(CustomerCreatePayload arg) { - optimisticData.put(getKey("customerCreate"), arg); + public OrderLineItem setDiscountAllocations(List arg) { + optimisticData.put(getKey("discountAllocations"), arg); return this; } /** - * Updates the default address of an existing customer. + * The total price of the line item, including discounts, and displayed in the presentment currency. */ - public CustomerDefaultAddressUpdatePayload getCustomerDefaultAddressUpdate() { - return (CustomerDefaultAddressUpdatePayload) get("customerDefaultAddressUpdate"); + public MoneyV2 getDiscountedTotalPrice() { + return (MoneyV2) get("discountedTotalPrice"); } - public Mutation setCustomerDefaultAddressUpdate(CustomerDefaultAddressUpdatePayload arg) { - optimisticData.put(getKey("customerDefaultAddressUpdate"), arg); + public OrderLineItem setDiscountedTotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("discountedTotalPrice"), arg); return this; } /** - * Sends a reset password email to the customer. The reset password - * email contains a reset password URL and token that you can pass to - * the [`customerResetByUrl`](https://shopify.dev/api/storefront/latest/mutations/customerResetByUrl) - * or - * [`customerReset`](https://shopify.dev/api/storefront/latest/mutations/customerReset) mutation to - * reset the - * customer password. - * This mutation is throttled by IP. With private access, - * you can provide a - * [`Shopify-Storefront-Buyer-IP`](https://shopify.dev/api/usage/authentication#optional-ip-header) - * instead of the request IP. - * The header is case-sensitive and must be sent as `Shopify-Storefront-Buyer-IP`. - * Make sure that the value provided to `Shopify-Storefront-Buyer-IP` is trusted. Unthrottled access to - * this - * mutation presents a security risk. + * The total price of the line item, not including any discounts. The total price is calculated using + * the original unit price multiplied by the quantity, and it's displayed in the presentment currency. */ - public CustomerRecoverPayload getCustomerRecover() { - return (CustomerRecoverPayload) get("customerRecover"); + public MoneyV2 getOriginalTotalPrice() { + return (MoneyV2) get("originalTotalPrice"); } - public Mutation setCustomerRecover(CustomerRecoverPayload arg) { - optimisticData.put(getKey("customerRecover"), arg); + public OrderLineItem setOriginalTotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("originalTotalPrice"), arg); return this; } /** - * "Resets a customer’s password with the token received from a reset password email. You can send a - * reset password email with the - * [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation." + * The number of products variants associated to the line item. */ - public CustomerResetPayload getCustomerReset() { - return (CustomerResetPayload) get("customerReset"); + public Integer getQuantity() { + return (Integer) get("quantity"); } - public Mutation setCustomerReset(CustomerResetPayload arg) { - optimisticData.put(getKey("customerReset"), arg); + public OrderLineItem setQuantity(Integer arg) { + optimisticData.put(getKey("quantity"), arg); return this; } /** - * "Resets a customer’s password with the reset password URL received from a reset password email. You - * can send a reset password email with the - * [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation." + * The title of the product combined with title of the variant. */ - public CustomerResetByUrlPayload getCustomerResetByUrl() { - return (CustomerResetByUrlPayload) get("customerResetByUrl"); + public String getTitle() { + return (String) get("title"); } - public Mutation setCustomerResetByUrl(CustomerResetByUrlPayload arg) { - optimisticData.put(getKey("customerResetByUrl"), arg); + public OrderLineItem setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } /** - * Updates an existing customer. + * The product variant object associated to the line item. */ - public CustomerUpdatePayload getCustomerUpdate() { - return (CustomerUpdatePayload) get("customerUpdate"); + public ProductVariant getVariant() { + return (ProductVariant) get("variant"); } - public Mutation setCustomerUpdate(CustomerUpdatePayload arg) { - optimisticData.put(getKey("customerUpdate"), arg); + public OrderLineItem setVariant(ProductVariant arg) { + optimisticData.put(getKey("variant"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cartAttributesUpdate": return true; - - case "cartBuyerIdentityUpdate": return true; - - case "cartCreate": return true; - - case "cartDiscountCodesUpdate": return true; + case "currentQuantity": return false; - case "cartLinesAdd": return true; + case "customAttributes": return true; - case "cartLinesRemove": return true; + case "discountAllocations": return true; - case "cartLinesUpdate": return true; + case "discountedTotalPrice": return true; - case "cartMetafieldDelete": return true; + case "originalTotalPrice": return true; - case "cartMetafieldsSet": return true; + case "quantity": return false; - case "cartNoteUpdate": return true; + case "title": return false; - case "cartPaymentUpdate": return true; + case "variant": return true; - case "cartSelectedDeliveryOptionsUpdate": return true; + default: return false; + } + } + } - case "cartSubmitForCompletion": return true; + public interface OrderLineItemConnectionQueryDefinition { + void define(OrderLineItemConnectionQuery _queryBuilder); + } - case "checkoutAttributesUpdateV2": return true; + /** + * An auto-generated type for paginating through multiple OrderLineItems. + */ + public static class OrderLineItemConnectionQuery extends Query { + OrderLineItemConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "checkoutCompleteFree": return true; + /** + * A list of edges. + */ + public OrderLineItemConnectionQuery edges(OrderLineItemEdgeQueryDefinition queryDef) { + startField("edges"); - case "checkoutCompleteWithCreditCardV2": return true; + _queryBuilder.append('{'); + queryDef.define(new OrderLineItemEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "checkoutCompleteWithTokenizedPaymentV3": return true; + return this; + } - case "checkoutCreate": return true; + /** + * A list of the nodes contained in OrderLineItemEdge. + */ + public OrderLineItemConnectionQuery nodes(OrderLineItemQueryDefinition queryDef) { + startField("nodes"); - case "checkoutCustomerAssociateV2": return true; + _queryBuilder.append('{'); + queryDef.define(new OrderLineItemQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "checkoutCustomerDisassociateV2": return true; + return this; + } - case "checkoutDiscountCodeApplyV2": return true; + /** + * Information to aid in pagination. + */ + public OrderLineItemConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - case "checkoutDiscountCodeRemove": return true; + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "checkoutEmailUpdateV2": return true; + return this; + } + } - case "checkoutGiftCardRemoveV2": return true; + /** + * An auto-generated type for paginating through multiple OrderLineItems. + */ + public static class OrderLineItemConnection extends AbstractResponse { + public OrderLineItemConnection() { + } - case "checkoutGiftCardsAppend": return true; + public OrderLineItemConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new OrderLineItemEdge(jsonAsObject(element1, key))); + } - case "checkoutLineItemsAdd": return true; + responseData.put(key, list1); - case "checkoutLineItemsRemove": return true; + break; + } - case "checkoutLineItemsReplace": return true; + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new OrderLineItem(jsonAsObject(element1, key))); + } - case "checkoutLineItemsUpdate": return true; + responseData.put(key, list1); - case "checkoutShippingAddressUpdateV2": return true; + break; + } - case "checkoutShippingLineUpdate": return true; + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - case "customerAccessTokenCreate": return true; + break; + } - case "customerAccessTokenCreateWithMultipass": return true; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - case "customerAccessTokenDelete": return true; + public String getGraphQlTypeName() { + return "OrderLineItemConnection"; + } - case "customerAccessTokenRenew": return true; + /** + * A list of edges. + */ - case "customerActivate": return true; + public List getEdges() { + return (List) get("edges"); + } - case "customerActivateByUrl": return true; + public OrderLineItemConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; + } - case "customerAddressCreate": return true; + /** + * A list of the nodes contained in OrderLineItemEdge. + */ - case "customerAddressDelete": return true; + public List getNodes() { + return (List) get("nodes"); + } - case "customerAddressUpdate": return true; + public OrderLineItemConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; + } - case "customerCreate": return true; + /** + * Information to aid in pagination. + */ - case "customerDefaultAddressUpdate": return true; + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } - case "customerRecover": return true; + public OrderLineItemConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); + return this; + } - case "customerReset": return true; + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - case "customerResetByUrl": return true; + case "nodes": return true; - case "customerUpdate": return true; + case "pageInfo": return true; default: return false; } } } - public interface NodeQueryDefinition { - void define(NodeQuery _queryBuilder); + public interface OrderLineItemEdgeQueryDefinition { + void define(OrderLineItemEdgeQuery _queryBuilder); } /** - * 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. + * An auto-generated type which holds one OrderLineItem and a cursor during pagination. */ - public static class NodeQuery extends Query { - NodeQuery(StringBuilder _queryBuilder) { + public static class OrderLineItemEdgeQuery extends Query { + OrderLineItemEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("__typename"); } /** - * A globally-unique ID. + * A cursor for use in pagination. */ - public NodeQuery id() { - startField("id"); + public OrderLineItemEdgeQuery cursor() { + startField("cursor"); return this; } - public NodeQuery onAppliedGiftCard(AppliedGiftCardQueryDefinition queryDef) { - startInlineFragment("AppliedGiftCard"); - queryDef.define(new AppliedGiftCardQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * The item at the end of OrderLineItemEdge. + */ + public OrderLineItemEdgeQuery node(OrderLineItemQueryDefinition queryDef) { + startField("node"); - public NodeQuery onArticle(ArticleQueryDefinition queryDef) { - startInlineFragment("Article"); - queryDef.define(new ArticleQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new OrderLineItemQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public NodeQuery onBlog(BlogQueryDefinition queryDef) { - startInlineFragment("Blog"); - queryDef.define(new BlogQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } + } - public NodeQuery onCart(CartQueryDefinition queryDef) { - startInlineFragment("Cart"); - queryDef.define(new CartQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + /** + * An auto-generated type which holds one OrderLineItem and a cursor during pagination. + */ + public static class OrderLineItemEdge extends AbstractResponse { + public OrderLineItemEdge() { } - public NodeQuery onCartLine(CartLineQueryDefinition queryDef) { - startInlineFragment("CartLine"); - queryDef.define(new CartLineQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + public OrderLineItemEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - public NodeQuery onCheckout(CheckoutQueryDefinition queryDef) { - startInlineFragment("Checkout"); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + break; + } + + case "node": { + responseData.put(key, new OrderLineItem(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public NodeQuery onCheckoutLineItem(CheckoutLineItemQueryDefinition queryDef) { - startInlineFragment("CheckoutLineItem"); - queryDef.define(new CheckoutLineItemQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public String getGraphQlTypeName() { + return "OrderLineItemEdge"; } - public NodeQuery onCollection(CollectionQueryDefinition queryDef) { - startInlineFragment("Collection"); - queryDef.define(new CollectionQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + /** + * A cursor for use in pagination. + */ + + public String getCursor() { + return (String) get("cursor"); } - public NodeQuery onComment(CommentQueryDefinition queryDef) { - startInlineFragment("Comment"); - queryDef.define(new CommentQuery(_queryBuilder)); - _queryBuilder.append('}'); + public OrderLineItemEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } - public NodeQuery onCompany(CompanyQueryDefinition queryDef) { - startInlineFragment("Company"); - queryDef.define(new CompanyQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + /** + * The item at the end of OrderLineItemEdge. + */ + + public OrderLineItem getNode() { + return (OrderLineItem) get("node"); } - public NodeQuery onCompanyContact(CompanyContactQueryDefinition queryDef) { - startInlineFragment("CompanyContact"); - queryDef.define(new CompanyContactQuery(_queryBuilder)); - _queryBuilder.append('}'); + public OrderLineItemEdge setNode(OrderLineItem arg) { + optimisticData.put(getKey("node"), arg); return this; } - public NodeQuery onCompanyLocation(CompanyLocationQueryDefinition queryDef) { - startInlineFragment("CompanyLocation"); - queryDef.define(new CompanyLocationQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; + + case "node": return true; + + default: return false; + } } + } - public NodeQuery onComponentizableCartLine(ComponentizableCartLineQueryDefinition queryDef) { - startInlineFragment("ComponentizableCartLine"); - queryDef.define(new ComponentizableCartLineQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + /** + * The set of valid sort keys for the Order query. + */ + public enum OrderSortKeys { + /** + * Sort by the `id` value. + */ + ID, + + /** + * Sort by the `processed_at` value. + */ + PROCESSED_AT, + + /** + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. + */ + RELEVANCE, + + /** + * Sort by the `total_price` value. + */ + TOTAL_PRICE, + + UNKNOWN_VALUE; + + public static OrderSortKeys fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "ID": { + return ID; + } + + case "PROCESSED_AT": { + return PROCESSED_AT; + } + + case "RELEVANCE": { + return RELEVANCE; + } + + case "TOTAL_PRICE": { + return TOTAL_PRICE; + } + + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case ID: { + return "ID"; + } - public NodeQuery onExternalVideo(ExternalVideoQueryDefinition queryDef) { - startInlineFragment("ExternalVideo"); - queryDef.define(new ExternalVideoQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + case PROCESSED_AT: { + return "PROCESSED_AT"; + } + + case RELEVANCE: { + return "RELEVANCE"; + } + + case TOTAL_PRICE: { + return "TOTAL_PRICE"; + } + + default: { + return ""; + } + } } + } - public NodeQuery onGenericFile(GenericFileQueryDefinition queryDef) { - startInlineFragment("GenericFile"); - queryDef.define(new GenericFileQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public interface PageQueryDefinition { + void define(PageQuery _queryBuilder); + } + + /** + * Shopify merchants can create pages to hold static HTML content. Each Page object represents a custom + * page on the online store. + */ + public static class PageQuery extends Query { + PageQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); } - public NodeQuery onLocation(LocationQueryDefinition queryDef) { - startInlineFragment("Location"); - queryDef.define(new LocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The description of the page, complete with HTML formatting. + */ + public PageQuery body() { + startField("body"); + return this; } - public NodeQuery onMailingAddress(MailingAddressQueryDefinition queryDef) { - startInlineFragment("MailingAddress"); - queryDef.define(new MailingAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Summary of the page body. + */ + public PageQuery bodySummary() { + startField("bodySummary"); + return this; } - public NodeQuery onMarket(MarketQueryDefinition queryDef) { - startInlineFragment("Market"); - queryDef.define(new MarketQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The timestamp of the page creation. + */ + public PageQuery createdAt() { + startField("createdAt"); + return this; } - public NodeQuery onMediaImage(MediaImageQueryDefinition queryDef) { - startInlineFragment("MediaImage"); - queryDef.define(new MediaImageQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * A human-friendly unique string for the page automatically generated from its title. + */ + public PageQuery handle() { + startField("handle"); + return this; } - public NodeQuery onMediaPresentation(MediaPresentationQueryDefinition queryDef) { - startInlineFragment("MediaPresentation"); - queryDef.define(new MediaPresentationQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public class MetafieldArguments extends Arguments { + MetafieldArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } + + /** + * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. + */ + public MetafieldArguments namespace(String value) { + if (value != null) { + startArgument("namespace"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } } - public NodeQuery onMenu(MenuQueryDefinition queryDef) { - startInlineFragment("Menu"); - queryDef.define(new MenuQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public interface MetafieldArgumentsDefinition { + void define(MetafieldArguments args); } - public NodeQuery onMenuItem(MenuItemQueryDefinition queryDef) { - startInlineFragment("MenuItem"); - queryDef.define(new MenuItemQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + /** + * Returns a metafield found by namespace and key. + */ + public PageQuery metafield(String key, MetafieldQueryDefinition queryDef) { + return metafield(key, args -> {}, queryDef); } - public NodeQuery onMetafield(MetafieldQueryDefinition queryDef) { - startInlineFragment("Metafield"); + /** + * Returns a metafield found by namespace and key. + */ + public PageQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { + startField("metafield"); + + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + argsDef.define(new MetafieldArguments(_queryBuilder)); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public NodeQuery onMetaobject(MetaobjectQueryDefinition queryDef) { - startInlineFragment("Metaobject"); - queryDef.define(new MetaobjectQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public NodeQuery onModel3d(Model3dQueryDefinition queryDef) { - startInlineFragment("Model3d"); - queryDef.define(new Model3dQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ + public PageQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); - public NodeQuery onOrder(OrderQueryDefinition queryDef) { - startInlineFragment("Order"); - queryDef.define(new OrderQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); - public NodeQuery onPage(PageQueryDefinition queryDef) { - startInlineFragment("Page"); - queryDef.define(new PageQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + _queryBuilder.append(')'); - public NodeQuery onPayment(PaymentQueryDefinition queryDef) { - startInlineFragment("Payment"); - queryDef.define(new PaymentQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public NodeQuery onProduct(ProductQueryDefinition queryDef) { - startInlineFragment("Product"); - queryDef.define(new ProductQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public NodeQuery onProductOption(ProductOptionQueryDefinition queryDef) { - startInlineFragment("ProductOption"); - queryDef.define(new ProductOptionQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. + */ + public PageQuery onlineStoreUrl() { + startField("onlineStoreUrl"); - public NodeQuery onProductVariant(ProductVariantQueryDefinition queryDef) { - startInlineFragment("ProductVariant"); - queryDef.define(new ProductVariantQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public NodeQuery onShop(ShopQueryDefinition queryDef) { - startInlineFragment("Shop"); - queryDef.define(new ShopQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * The page's SEO information. + */ + public PageQuery seo(SEOQueryDefinition queryDef) { + startField("seo"); - public NodeQuery onShopPolicy(ShopPolicyQueryDefinition queryDef) { - startInlineFragment("ShopPolicy"); - queryDef.define(new ShopPolicyQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new SEOQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - public NodeQuery onUrlRedirect(UrlRedirectQueryDefinition queryDef) { - startInlineFragment("UrlRedirect"); - queryDef.define(new UrlRedirectQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The title of the page. + */ + public PageQuery title() { + startField("title"); + return this; } - public NodeQuery onVideo(VideoQueryDefinition queryDef) { - startInlineFragment("Video"); - queryDef.define(new VideoQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for + * tracking the origin of the traffic. + */ + public PageQuery trackingParameters() { + startField("trackingParameters"); + return this; } - } - public interface Node extends com.shopify.graphql.support.Node { - String getGraphQlTypeName(); + /** + * The timestamp of the latest page update. + */ + public PageQuery updatedAt() { + startField("updatedAt"); - ID getId(); + return this; + } } /** - * 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. + * Shopify merchants can create pages to hold static HTML content. Each Page object represents a custom + * page on the online store. */ - public static class UnknownNode extends AbstractResponse implements Node { - public UnknownNode() { + public static class Page extends AbstractResponse implements HasMetafields, MenuItemResource, MetafieldParentResource, MetafieldReference, Node, OnlineStorePublishable, SearchResultItem, Trackable { + public Page() { } - public UnknownNode(JsonObject fields) throws SchemaViolationError { + public Page(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { + case "body": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "bodySummary": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "createdAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + case "id": { responseData.put(key, new ID(jsonAsString(field.getValue(), key))); break; } + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } + + list1.add(optional2); + } + + responseData.put(key, list1); + + break; + } + + case "onlineStoreUrl": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "seo": { + SEO optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new SEO(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "trackingParameters": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -52696,273 +49720,287 @@ public UnknownNode(JsonObject fields) throws SchemaViolationError { } } - public static Node create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "AppliedGiftCard": { - return new AppliedGiftCard(fields); - } - - case "Article": { - return new Article(fields); - } - - case "Blog": { - return new Blog(fields); - } - - case "Cart": { - return new Cart(fields); - } + public Page(ID id) { + this(); + optimisticData.put("id", id); + } - case "CartLine": { - return new CartLine(fields); - } + public String getGraphQlTypeName() { + return "Page"; + } - case "Checkout": { - return new Checkout(fields); - } + /** + * The description of the page, complete with HTML formatting. + */ - case "CheckoutLineItem": { - return new CheckoutLineItem(fields); - } + public String getBody() { + return (String) get("body"); + } - case "Collection": { - return new Collection(fields); - } + public Page setBody(String arg) { + optimisticData.put(getKey("body"), arg); + return this; + } - case "Comment": { - return new Comment(fields); - } + /** + * Summary of the page body. + */ - case "Company": { - return new Company(fields); - } + public String getBodySummary() { + return (String) get("bodySummary"); + } - case "CompanyContact": { - return new CompanyContact(fields); - } + public Page setBodySummary(String arg) { + optimisticData.put(getKey("bodySummary"), arg); + return this; + } - case "CompanyLocation": { - return new CompanyLocation(fields); - } + /** + * The timestamp of the page creation. + */ - case "ComponentizableCartLine": { - return new ComponentizableCartLine(fields); - } + public DateTime getCreatedAt() { + return (DateTime) get("createdAt"); + } - case "ExternalVideo": { - return new ExternalVideo(fields); - } + public Page setCreatedAt(DateTime arg) { + optimisticData.put(getKey("createdAt"), arg); + return this; + } - case "GenericFile": { - return new GenericFile(fields); - } + /** + * A human-friendly unique string for the page automatically generated from its title. + */ - case "Location": { - return new Location(fields); - } + public String getHandle() { + return (String) get("handle"); + } - case "MailingAddress": { - return new MailingAddress(fields); - } + public Page setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); + return this; + } - case "Market": { - return new Market(fields); - } + /** + * A globally-unique ID. + */ - case "MediaImage": { - return new MediaImage(fields); - } + public ID getId() { + return (ID) get("id"); + } - case "MediaPresentation": { - return new MediaPresentation(fields); - } + /** + * Returns a metafield found by namespace and key. + */ - case "Menu": { - return new Menu(fields); - } + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } - case "MenuItem": { - return new MenuItem(fields); - } + public Page setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); + return this; + } - case "Metafield": { - return new Metafield(fields); - } + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ - case "Metaobject": { - return new Metaobject(fields); - } + public List getMetafields() { + return (List) get("metafields"); + } - case "Model3d": { - return new Model3d(fields); - } + public Page setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); + return this; + } - case "Order": { - return new Order(fields); - } + /** + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. + */ - case "Page": { - return new Page(fields); - } + public String getOnlineStoreUrl() { + return (String) get("onlineStoreUrl"); + } - case "Payment": { - return new Payment(fields); - } + public Page setOnlineStoreUrl(String arg) { + optimisticData.put(getKey("onlineStoreUrl"), arg); + return this; + } - case "Product": { - return new Product(fields); - } + /** + * The page's SEO information. + */ - case "ProductOption": { - return new ProductOption(fields); - } + public SEO getSeo() { + return (SEO) get("seo"); + } - case "ProductVariant": { - return new ProductVariant(fields); - } + public Page setSeo(SEO arg) { + optimisticData.put(getKey("seo"), arg); + return this; + } - case "Shop": { - return new Shop(fields); - } + /** + * The title of the page. + */ - case "ShopPolicy": { - return new ShopPolicy(fields); - } + public String getTitle() { + return (String) get("title"); + } - case "UrlRedirect": { - return new UrlRedirect(fields); - } + public Page setTitle(String arg) { + optimisticData.put(getKey("title"), arg); + return this; + } - case "Video": { - return new Video(fields); - } + /** + * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for + * tracking the origin of the traffic. + */ - default: { - return new UnknownNode(fields); - } - } + public String getTrackingParameters() { + return (String) get("trackingParameters"); } - public String getGraphQlTypeName() { - return (String) get("__typename"); + public Page setTrackingParameters(String arg) { + optimisticData.put(getKey("trackingParameters"), arg); + return this; } /** - * A globally-unique ID. + * The timestamp of the latest page update. */ - public ID getId() { - return (ID) get("id"); + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); } - public UnknownNode setId(ID arg) { - optimisticData.put(getKey("id"), arg); + public Page setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { + case "body": return false; + + case "bodySummary": return false; + + case "createdAt": return false; + + case "handle": return false; + case "id": return false; + case "metafield": return true; + + case "metafields": return true; + + case "onlineStoreUrl": return false; + + case "seo": return true; + + case "title": return false; + + case "trackingParameters": return false; + + case "updatedAt": return false; + default: return false; } } } - public interface OnlineStorePublishableQueryDefinition { - void define(OnlineStorePublishableQuery _queryBuilder); + public interface PageConnectionQueryDefinition { + void define(PageConnectionQuery _queryBuilder); } /** - * Represents a resource that can be published to the Online Store sales channel. + * An auto-generated type for paginating through multiple Pages. */ - public static class OnlineStorePublishableQuery extends Query { - OnlineStorePublishableQuery(StringBuilder _queryBuilder) { + public static class PageConnectionQuery extends Query { + PageConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("__typename"); } /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. + * A list of edges. */ - public OnlineStorePublishableQuery onlineStoreUrl() { - startField("onlineStoreUrl"); - - return this; - } - - public OnlineStorePublishableQuery onArticle(ArticleQueryDefinition queryDef) { - startInlineFragment("Article"); - queryDef.define(new ArticleQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + public PageConnectionQuery edges(PageEdgeQueryDefinition queryDef) { + startField("edges"); - public OnlineStorePublishableQuery onBlog(BlogQueryDefinition queryDef) { - startInlineFragment("Blog"); - queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new PageEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public OnlineStorePublishableQuery onCollection(CollectionQueryDefinition queryDef) { - startInlineFragment("Collection"); - queryDef.define(new CollectionQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public OnlineStorePublishableQuery onMetaobject(MetaobjectQueryDefinition queryDef) { - startInlineFragment("Metaobject"); - queryDef.define(new MetaobjectQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * A list of the nodes contained in PageEdge. + */ + public PageConnectionQuery nodes(PageQueryDefinition queryDef) { + startField("nodes"); - public OnlineStorePublishableQuery onPage(PageQueryDefinition queryDef) { - startInlineFragment("Page"); + _queryBuilder.append('{'); queryDef.define(new PageQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - public OnlineStorePublishableQuery onProduct(ProductQueryDefinition queryDef) { - startInlineFragment("Product"); - queryDef.define(new ProductQuery(_queryBuilder)); + /** + * Information to aid in pagination. + */ + public PageConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); + + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } } - public interface OnlineStorePublishable { - String getGraphQlTypeName(); - - String getOnlineStoreUrl(); - } - /** - * Represents a resource that can be published to the Online Store sales channel. + * An auto-generated type for paginating through multiple Pages. */ - public static class UnknownOnlineStorePublishable extends AbstractResponse implements OnlineStorePublishable { - public UnknownOnlineStorePublishable() { + public static class PageConnection extends AbstractResponse { + public PageConnection() { } - public UnknownOnlineStorePublishable(JsonObject fields) throws SchemaViolationError { + public PageConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "onlineStoreUrl": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new PageEdge(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); + + break; + } + + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Page(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } @@ -52978,784 +50016,840 @@ public UnknownOnlineStorePublishable(JsonObject fields) throws SchemaViolationEr } } - public static OnlineStorePublishable create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "Article": { - return new Article(fields); - } - - case "Blog": { - return new Blog(fields); - } + public String getGraphQlTypeName() { + return "PageConnection"; + } - case "Collection": { - return new Collection(fields); - } + /** + * A list of edges. + */ - case "Metaobject": { - return new Metaobject(fields); - } + public List getEdges() { + return (List) get("edges"); + } - case "Page": { - return new Page(fields); - } + public PageConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; + } - case "Product": { - return new Product(fields); - } + /** + * A list of the nodes contained in PageEdge. + */ - default: { - return new UnknownOnlineStorePublishable(fields); - } - } + public List getNodes() { + return (List) get("nodes"); } - public String getGraphQlTypeName() { - return (String) get("__typename"); + public PageConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; } /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. + * Information to aid in pagination. */ - public String getOnlineStoreUrl() { - return (String) get("onlineStoreUrl"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public UnknownOnlineStorePublishable setOnlineStoreUrl(String arg) { - optimisticData.put(getKey("onlineStoreUrl"), arg); + public PageConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "onlineStoreUrl": return false; + case "edges": return true; + + case "nodes": return true; + + case "pageInfo": return true; default: return false; } } } - public interface OrderQueryDefinition { - void define(OrderQuery _queryBuilder); + public interface PageEdgeQueryDefinition { + void define(PageEdgeQuery _queryBuilder); } /** - * An order is a customer’s completed request to purchase one or more products from a shop. An order is - * created when a customer completes the checkout process, during which time they provides an email - * address, billing address and payment information. + * An auto-generated type which holds one Page and a cursor during pagination. */ - public static class OrderQuery extends Query { - OrderQuery(StringBuilder _queryBuilder) { + public static class PageEdgeQuery extends Query { + PageEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("id"); } /** - * The address associated with the payment method. + * A cursor for use in pagination. */ - public OrderQuery billingAddress(MailingAddressQueryDefinition queryDef) { - startField("billingAddress"); - - _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); + public PageEdgeQuery cursor() { + startField("cursor"); return this; } /** - * The reason for the order's cancellation. Returns `null` if the order wasn't canceled. + * The item at the end of PageEdge. */ - public OrderQuery cancelReason() { - startField("cancelReason"); + public PageEdgeQuery node(PageQueryDefinition queryDef) { + startField("node"); + + _queryBuilder.append('{'); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } + } - /** - * The date and time when the order was canceled. Returns null if the order wasn't canceled. - */ - public OrderQuery canceledAt() { - startField("canceledAt"); - - return this; + /** + * An auto-generated type which holds one Page and a cursor during pagination. + */ + public static class PageEdge extends AbstractResponse { + public PageEdge() { } - /** - * The code of the currency used for the payment. - */ - public OrderQuery currencyCode() { - startField("currencyCode"); + public PageEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - return this; + break; + } + + case "node": { + responseData.put(key, new Page(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "PageEdge"; } /** - * The subtotal of line items and their discounts, excluding line items that have been removed. Does - * not contain order-level discounts, duties, shipping costs, or shipping discounts. Taxes aren't - * included unless the order is a taxes-included order. + * A cursor for use in pagination. */ - public OrderQuery currentSubtotalPrice(MoneyV2QueryDefinition queryDef) { - startField("currentSubtotalPrice"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public String getCursor() { + return (String) get("cursor"); + } + public PageEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * The total cost of duties for the order, including refunds. + * The item at the end of PageEdge. */ - public OrderQuery currentTotalDuties(MoneyV2QueryDefinition queryDef) { - startField("currentTotalDuties"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public Page getNode() { + return (Page) get("node"); + } + public PageEdge setNode(Page arg) { + optimisticData.put(getKey("node"), arg); return this; } - /** - * The total amount of the order, including duties, taxes and discounts, minus amounts for line items - * that have been removed. - */ - public OrderQuery currentTotalPrice(MoneyV2QueryDefinition queryDef) { - startField("currentTotalPrice"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + case "node": return true; - return this; + default: return false; + } + } + } + + public interface PageInfoQueryDefinition { + void define(PageInfoQuery _queryBuilder); + } + + /** + * Returns information about pagination in a connection, in accordance with the + * [Relay specification](https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo). + * For more information, please read our [GraphQL Pagination Usage + * Guide](https://shopify.dev/api/usage/pagination-graphql). + */ + public static class PageInfoQuery extends Query { + PageInfoQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The total of all taxes applied to the order, excluding taxes for returned line items. + * The cursor corresponding to the last node in edges. */ - public OrderQuery currentTotalTax(MoneyV2QueryDefinition queryDef) { - startField("currentTotalTax"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public PageInfoQuery endCursor() { + startField("endCursor"); return this; } /** - * A list of the custom attributes added to the order. + * Whether there are more pages to fetch following the current page. */ - public OrderQuery customAttributes(AttributeQueryDefinition queryDef) { - startField("customAttributes"); - - _queryBuilder.append('{'); - queryDef.define(new AttributeQuery(_queryBuilder)); - _queryBuilder.append('}'); + public PageInfoQuery hasNextPage() { + startField("hasNextPage"); return this; } /** - * The locale code in which this specific order happened. + * Whether there are any pages prior to the current page. */ - public OrderQuery customerLocale() { - startField("customerLocale"); + public PageInfoQuery hasPreviousPage() { + startField("hasPreviousPage"); return this; } /** - * The unique URL that the customer can use to access the order. + * The cursor corresponding to the first node in edges. */ - public OrderQuery customerUrl() { - startField("customerUrl"); + public PageInfoQuery startCursor() { + startField("startCursor"); return this; } + } - public class DiscountApplicationsArguments extends Arguments { - DiscountApplicationsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * Returns information about pagination in a connection, in accordance with the + * [Relay specification](https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo). + * For more information, please read our [GraphQL Pagination Usage + * Guide](https://shopify.dev/api/usage/pagination-graphql). + */ + public static class PageInfo extends AbstractResponse { + public PageInfo() { + } - /** - * Returns up to the first `n` elements from the list. - */ - public DiscountApplicationsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public PageInfo(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "endCursor": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - /** - * Returns the elements that come after the specified cursor. - */ - public DiscountApplicationsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + responseData.put(key, optional1); - /** - * Returns up to the last `n` elements from the list. - */ - public DiscountApplicationsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + break; + } - /** - * Returns the elements that come before the specified cursor. - */ - public DiscountApplicationsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + case "hasNextPage": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - /** - * Reverse the order of the underlying list. - */ - public DiscountApplicationsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - } + break; + } - public interface DiscountApplicationsArgumentsDefinition { - void define(DiscountApplicationsArguments args); - } + case "hasPreviousPage": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - /** - * Discounts that have been applied on the order. - */ - public OrderQuery discountApplications(DiscountApplicationConnectionQueryDefinition queryDef) { - return discountApplications(args -> {}, queryDef); - } + break; + } - /** - * Discounts that have been applied on the order. - */ - public OrderQuery discountApplications(DiscountApplicationsArgumentsDefinition argsDef, DiscountApplicationConnectionQueryDefinition queryDef) { - startField("discountApplications"); + case "startCursor": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - DiscountApplicationsArguments args = new DiscountApplicationsArguments(_queryBuilder); - argsDef.define(args); - DiscountApplicationsArguments.end(args); + responseData.put(key, optional1); - _queryBuilder.append('{'); - queryDef.define(new DiscountApplicationConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - return this; + public String getGraphQlTypeName() { + return "PageInfo"; } /** - * Whether the order has had any edits applied or not. + * The cursor corresponding to the last node in edges. */ - public OrderQuery edited() { - startField("edited"); + public String getEndCursor() { + return (String) get("endCursor"); + } + + public PageInfo setEndCursor(String arg) { + optimisticData.put(getKey("endCursor"), arg); return this; } /** - * The customer's email address. + * Whether there are more pages to fetch following the current page. */ - public OrderQuery email() { - startField("email"); + public Boolean getHasNextPage() { + return (Boolean) get("hasNextPage"); + } + + public PageInfo setHasNextPage(Boolean arg) { + optimisticData.put(getKey("hasNextPage"), arg); return this; } /** - * The financial status of the order. + * Whether there are any pages prior to the current page. */ - public OrderQuery financialStatus() { - startField("financialStatus"); + public Boolean getHasPreviousPage() { + return (Boolean) get("hasPreviousPage"); + } + + public PageInfo setHasPreviousPage(Boolean arg) { + optimisticData.put(getKey("hasPreviousPage"), arg); return this; } /** - * The fulfillment status for the order. + * The cursor corresponding to the first node in edges. */ - public OrderQuery fulfillmentStatus() { - startField("fulfillmentStatus"); - return this; + public String getStartCursor() { + return (String) get("startCursor"); } - public class LineItemsArguments extends Arguments { - LineItemsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + public PageInfo setStartCursor(String arg) { + optimisticData.put(getKey("startCursor"), arg); + return this; + } - /** - * Returns up to the first `n` elements from the list. - */ - public LineItemsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "endCursor": return false; - /** - * Returns the elements that come after the specified cursor. - */ - public LineItemsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + case "hasNextPage": return false; - /** - * Returns up to the last `n` elements from the list. - */ - public LineItemsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + case "hasPreviousPage": return false; - /** - * Returns the elements that come before the specified cursor. - */ - public LineItemsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + case "startCursor": return false; - /** - * Reverse the order of the underlying list. - */ - public LineItemsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; + default: return false; } } + } - public interface LineItemsArgumentsDefinition { - void define(LineItemsArguments args); - } - + /** + * The set of valid sort keys for the Page query. + */ + public enum PageSortKeys { /** - * List of the order’s line items. + * Sort by the `id` value. */ - public OrderQuery lineItems(OrderLineItemConnectionQueryDefinition queryDef) { - return lineItems(args -> {}, queryDef); - } + ID, /** - * List of the order’s line items. + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. */ - public OrderQuery lineItems(LineItemsArgumentsDefinition argsDef, OrderLineItemConnectionQueryDefinition queryDef) { - startField("lineItems"); + RELEVANCE, - LineItemsArguments args = new LineItemsArguments(_queryBuilder); - argsDef.define(args); - LineItemsArguments.end(args); + /** + * Sort by the `title` value. + */ + TITLE, - _queryBuilder.append('{'); - queryDef.define(new OrderLineItemConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Sort by the `updated_at` value. + */ + UPDATED_AT, - return this; - } + UNKNOWN_VALUE; - public class MetafieldArguments extends Arguments { - MetafieldArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); + public static PageSortKeys fromGraphQl(String value) { + if (value == null) { + return null; } - /** - * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. - */ - public MetafieldArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); + switch (value) { + case "ID": { + return ID; } - return this; - } - } - public interface MetafieldArgumentsDefinition { - void define(MetafieldArguments args); - } + case "RELEVANCE": { + return RELEVANCE; + } - /** - * Returns a metafield found by namespace and key. - */ - public OrderQuery metafield(String key, MetafieldQueryDefinition queryDef) { - return metafield(key, args -> {}, queryDef); + case "TITLE": { + return TITLE; + } + + case "UPDATED_AT": { + return UPDATED_AT; + } + + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case ID: { + return "ID"; + } - /** - * Returns a metafield found by namespace and key. - */ - public OrderQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { - startField("metafield"); + case RELEVANCE: { + return "RELEVANCE"; + } - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + case TITLE: { + return "TITLE"; + } - argsDef.define(new MetafieldArguments(_queryBuilder)); + case UPDATED_AT: { + return "UPDATED_AT"; + } - _queryBuilder.append(')'); + default: { + return ""; + } + } + } + } - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + public interface PaymentSettingsQueryDefinition { + void define(PaymentSettingsQuery _queryBuilder); + } - return this; + /** + * Settings related to payments. + */ + public static class PaymentSettingsQuery extends Query { + PaymentSettingsQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * List of the card brands which the shop accepts. */ - public OrderQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); - - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + public PaymentSettingsQuery acceptedCardBrands() { + startField("acceptedCardBrands"); return this; } /** - * Unique identifier for the order that appears on the order. - * For example, _#1000_ or _Store1001. + * The url pointing to the endpoint to vault credit cards. */ - public OrderQuery name() { - startField("name"); + public PaymentSettingsQuery cardVaultUrl() { + startField("cardVaultUrl"); return this; } /** - * A unique numeric identifier for the order for use by shop owner and customer. + * The country where the shop is located. */ - public OrderQuery orderNumber() { - startField("orderNumber"); + public PaymentSettingsQuery countryCode() { + startField("countryCode"); return this; } /** - * The total cost of duties charged at checkout. + * The three-letter code for the shop's primary currency. */ - public OrderQuery originalTotalDuties(MoneyV2QueryDefinition queryDef) { - startField("originalTotalDuties"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public PaymentSettingsQuery currencyCode() { + startField("currencyCode"); return this; } /** - * The total price of the order before any applied edits. + * A list of enabled currencies (ISO 4217 format) that the shop accepts. + * Merchants can enable currencies from their Shopify Payments settings in the Shopify admin. */ - public OrderQuery originalTotalPrice(MoneyV2QueryDefinition queryDef) { - startField("originalTotalPrice"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public PaymentSettingsQuery enabledPresentmentCurrencies() { + startField("enabledPresentmentCurrencies"); return this; } /** - * The customer's phone number for receiving SMS notifications. + * The shop’s Shopify Payments account ID. */ - public OrderQuery phone() { - startField("phone"); + public PaymentSettingsQuery shopifyPaymentsAccountId() { + startField("shopifyPaymentsAccountId"); return this; } /** - * The date and time when the order was imported. - * This value can be set to dates in the past when importing from other systems. - * If no value is provided, it will be auto-generated based on current date and time. + * List of the digital wallets which the shop supports. */ - public OrderQuery processedAt() { - startField("processedAt"); + public PaymentSettingsQuery supportedDigitalWallets() { + startField("supportedDigitalWallets"); return this; } + } + + /** + * Settings related to payments. + */ + public static class PaymentSettings extends AbstractResponse { + public PaymentSettings() { + } + + public PaymentSettings(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "acceptedCardBrands": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(CardBrand.fromGraphQl(jsonAsString(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "cardVaultUrl": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "countryCode": { + responseData.put(key, CountryCode.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "currencyCode": { + responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "enabledPresentmentCurrencies": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(CurrencyCode.fromGraphQl(jsonAsString(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "shopifyPaymentsAccountId": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "supportedDigitalWallets": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(DigitalWallet.fromGraphQl(jsonAsString(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "PaymentSettings"; + } /** - * The address to where the order will be shipped. + * List of the card brands which the shop accepts. */ - public OrderQuery shippingAddress(MailingAddressQueryDefinition queryDef) { - startField("shippingAddress"); - _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); + public List getAcceptedCardBrands() { + return (List) get("acceptedCardBrands"); + } + public PaymentSettings setAcceptedCardBrands(List arg) { + optimisticData.put(getKey("acceptedCardBrands"), arg); return this; } /** - * The discounts that have been allocated onto the shipping line by discount applications. + * The url pointing to the endpoint to vault credit cards. */ - public OrderQuery shippingDiscountAllocations(DiscountAllocationQueryDefinition queryDef) { - startField("shippingDiscountAllocations"); - _queryBuilder.append('{'); - queryDef.define(new DiscountAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getCardVaultUrl() { + return (String) get("cardVaultUrl"); + } + public PaymentSettings setCardVaultUrl(String arg) { + optimisticData.put(getKey("cardVaultUrl"), arg); return this; } /** - * The unique URL for the order's status page. + * The country where the shop is located. */ - public OrderQuery statusUrl() { - startField("statusUrl"); + public CountryCode getCountryCode() { + return (CountryCode) get("countryCode"); + } + + public PaymentSettings setCountryCode(CountryCode arg) { + optimisticData.put(getKey("countryCode"), arg); return this; } /** - * Price of the order before shipping and taxes. + * The three-letter code for the shop's primary currency. */ - public OrderQuery subtotalPrice(MoneyV2QueryDefinition queryDef) { - startField("subtotalPrice"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public CurrencyCode getCurrencyCode() { + return (CurrencyCode) get("currencyCode"); + } + public PaymentSettings setCurrencyCode(CurrencyCode arg) { + optimisticData.put(getKey("currencyCode"), arg); return this; } /** - * Price of the order before duties, shipping and taxes. - * - * @deprecated Use `subtotalPrice` instead. + * A list of enabled currencies (ISO 4217 format) that the shop accepts. + * Merchants can enable currencies from their Shopify Payments settings in the Shopify admin. */ - @Deprecated - public OrderQuery subtotalPriceV2(MoneyV2QueryDefinition queryDef) { - startField("subtotalPriceV2"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public List getEnabledPresentmentCurrencies() { + return (List) get("enabledPresentmentCurrencies"); + } + public PaymentSettings setEnabledPresentmentCurrencies(List arg) { + optimisticData.put(getKey("enabledPresentmentCurrencies"), arg); return this; } - public class SuccessfulFulfillmentsArguments extends Arguments { - SuccessfulFulfillmentsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * The shop’s Shopify Payments account ID. + */ - /** - * Truncate the array result to this size. - */ - public SuccessfulFulfillmentsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public String getShopifyPaymentsAccountId() { + return (String) get("shopifyPaymentsAccountId"); } - public interface SuccessfulFulfillmentsArgumentsDefinition { - void define(SuccessfulFulfillmentsArguments args); + public PaymentSettings setShopifyPaymentsAccountId(String arg) { + optimisticData.put(getKey("shopifyPaymentsAccountId"), arg); + return this; } /** - * List of the order’s successful fulfillments. + * List of the digital wallets which the shop supports. */ - public OrderQuery successfulFulfillments(FulfillmentQueryDefinition queryDef) { - return successfulFulfillments(args -> {}, queryDef); + + public List getSupportedDigitalWallets() { + return (List) get("supportedDigitalWallets"); } - /** - * List of the order’s successful fulfillments. - */ - public OrderQuery successfulFulfillments(SuccessfulFulfillmentsArgumentsDefinition argsDef, FulfillmentQueryDefinition queryDef) { - startField("successfulFulfillments"); + public PaymentSettings setSupportedDigitalWallets(List arg) { + optimisticData.put(getKey("supportedDigitalWallets"), arg); + return this; + } - SuccessfulFulfillmentsArguments args = new SuccessfulFulfillmentsArguments(_queryBuilder); - argsDef.define(args); - SuccessfulFulfillmentsArguments.end(args); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "acceptedCardBrands": return false; - _queryBuilder.append('{'); - queryDef.define(new FulfillmentQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "cardVaultUrl": return false; + + case "countryCode": return false; + + case "currencyCode": return false; + + case "enabledPresentmentCurrencies": return false; + + case "shopifyPaymentsAccountId": return false; + + case "supportedDigitalWallets": return false; - return this; + default: return false; + } } + } + /** + * Decides the distribution of results. + */ + public enum PredictiveSearchLimitScope { /** - * The sum of all the prices of all the items in the order, duties, taxes and discounts included (must - * be positive). + * Return results up to limit across all types. */ - public OrderQuery totalPrice(MoneyV2QueryDefinition queryDef) { - startField("totalPrice"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } + ALL, /** - * The sum of all the prices of all the items in the order, duties, taxes and discounts included (must - * be positive). - * - * @deprecated Use `totalPrice` instead. + * Return results up to limit per type. */ - @Deprecated - public OrderQuery totalPriceV2(MoneyV2QueryDefinition queryDef) { - startField("totalPriceV2"); + EACH, - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + UNKNOWN_VALUE; - return this; + public static PredictiveSearchLimitScope fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "ALL": { + return ALL; + } + + case "EACH": { + return EACH; + } + + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case ALL: { + return "ALL"; + } - /** - * The total amount that has been refunded. - */ - public OrderQuery totalRefunded(MoneyV2QueryDefinition queryDef) { - startField("totalRefunded"); + case EACH: { + return "EACH"; + } - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + default: { + return ""; + } + } + } + } - return this; + public interface PredictiveSearchResultQueryDefinition { + void define(PredictiveSearchResultQuery _queryBuilder); + } + + /** + * A predictive search result represents a list of products, collections, pages, articles, and query + * suggestions + * that matches the predictive search query. + */ + public static class PredictiveSearchResultQuery extends Query { + PredictiveSearchResultQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The total amount that has been refunded. - * - * @deprecated Use `totalRefunded` instead. + * The articles that match the search query. */ - @Deprecated - public OrderQuery totalRefundedV2(MoneyV2QueryDefinition queryDef) { - startField("totalRefundedV2"); + public PredictiveSearchResultQuery articles(ArticleQueryDefinition queryDef) { + startField("articles"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new ArticleQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The total cost of shipping. + * The articles that match the search query. */ - public OrderQuery totalShippingPrice(MoneyV2QueryDefinition queryDef) { - startField("totalShippingPrice"); + public PredictiveSearchResultQuery collections(CollectionQueryDefinition queryDef) { + startField("collections"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new CollectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The total cost of shipping. - * - * @deprecated Use `totalShippingPrice` instead. + * The pages that match the search query. */ - @Deprecated - public OrderQuery totalShippingPriceV2(MoneyV2QueryDefinition queryDef) { - startField("totalShippingPriceV2"); + public PredictiveSearchResultQuery pages(PageQueryDefinition queryDef) { + startField("pages"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new PageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The total cost of taxes. + * The products that match the search query. */ - public OrderQuery totalTax(MoneyV2QueryDefinition queryDef) { - startField("totalTax"); + public PredictiveSearchResultQuery products(ProductQueryDefinition queryDef) { + startField("products"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new ProductQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The total cost of taxes. - * - * @deprecated Use `totalTax` instead. + * The query suggestions that are relevant to the search query. */ - @Deprecated - public OrderQuery totalTaxV2(MoneyV2QueryDefinition queryDef) { - startField("totalTaxV2"); + public PredictiveSearchResultQuery queries(SearchQuerySuggestionQueryDefinition queryDef) { + startField("queries"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new SearchQuerySuggestionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -53763,91 +50857,23 @@ public OrderQuery totalTaxV2(MoneyV2QueryDefinition queryDef) { } /** - * An order is a customer’s completed request to purchase one or more products from a shop. An order is - * created when a customer completes the checkout process, during which time they provides an email - * address, billing address and payment information. + * A predictive search result represents a list of products, collections, pages, articles, and query + * suggestions + * that matches the predictive search query. */ - public static class Order extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { - public Order() { + public static class PredictiveSearchResult extends AbstractResponse { + public PredictiveSearchResult() { } - public Order(JsonObject fields) throws SchemaViolationError { + public PredictiveSearchResult(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "billingAddress": { - MailingAddress optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "cancelReason": { - OrderCancelReason optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = OrderCancelReason.fromGraphQl(jsonAsString(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "canceledAt": { - DateTime optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = Utils.parseDateTime(jsonAsString(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "currencyCode": { - responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "currentSubtotalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "currentTotalDuties": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "currentTotalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "currentTotalTax": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "customAttributes": { - List list1 = new ArrayList<>(); + case "articles": { + List
list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Attribute(jsonAsObject(element1, key))); + list1.add(new Article(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -53855,100 +50881,43 @@ public Order(JsonObject fields) throws SchemaViolationError { break; } - case "customerLocale": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "customerUrl": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "discountApplications": { - responseData.put(key, new DiscountApplicationConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "edited": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "email": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "collections": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Collection(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "financialStatus": { - OrderFinancialStatus optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = OrderFinancialStatus.fromGraphQl(jsonAsString(field.getValue(), key)); + case "pages": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Page(jsonAsObject(element1, key))); } - responseData.put(key, optional1); - - break; - } - - case "fulfillmentStatus": { - responseData.put(key, OrderFulfillmentStatus.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - - break; - } - - case "lineItems": { - responseData.put(key, new OrderLineItemConnection(jsonAsObject(field.getValue(), key))); + responseData.put(key, list1); break; } - case "metafield": { - Metafield optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + case "products": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Product(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "metafields": { - List list1 = new ArrayList<>(); + case "queries": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } - - list1.add(optional2); + list1.add(new SearchQuerySuggestion(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -53956,1842 +50925,2333 @@ public Order(JsonObject fields) throws SchemaViolationError { break; } - case "name": { + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); - break; } - - case "orderNumber": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); - - break; + default: { + throw new SchemaViolationError(this, key, field.getValue()); } + } + } + } - case "originalTotalDuties": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } + public String getGraphQlTypeName() { + return "PredictiveSearchResult"; + } - responseData.put(key, optional1); + /** + * The articles that match the search query. + */ - break; - } + public List
getArticles() { + return (List
) get("articles"); + } - case "originalTotalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + public PredictiveSearchResult setArticles(List
arg) { + optimisticData.put(getKey("articles"), arg); + return this; + } - break; - } + /** + * The articles that match the search query. + */ - case "phone": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + public List getCollections() { + return (List) get("collections"); + } - responseData.put(key, optional1); + public PredictiveSearchResult setCollections(List arg) { + optimisticData.put(getKey("collections"), arg); + return this; + } - break; - } + /** + * The pages that match the search query. + */ - case "processedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + public List getPages() { + return (List) get("pages"); + } - break; - } + public PredictiveSearchResult setPages(List arg) { + optimisticData.put(getKey("pages"), arg); + return this; + } - case "shippingAddress": { - MailingAddress optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); - } + /** + * The products that match the search query. + */ - responseData.put(key, optional1); + public List getProducts() { + return (List) get("products"); + } - break; - } + public PredictiveSearchResult setProducts(List arg) { + optimisticData.put(getKey("products"), arg); + return this; + } - case "shippingDiscountAllocations": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new DiscountAllocation(jsonAsObject(element1, key))); - } + /** + * The query suggestions that are relevant to the search query. + */ - responseData.put(key, list1); + public List getQueries() { + return (List) get("queries"); + } - break; - } + public PredictiveSearchResult setQueries(List arg) { + optimisticData.put(getKey("queries"), arg); + return this; + } - case "statusUrl": { - responseData.put(key, jsonAsString(field.getValue(), key)); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "articles": return true; - break; - } + case "collections": return true; - case "subtotalPrice": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } + case "pages": return true; - responseData.put(key, optional1); + case "products": return true; - break; - } + case "queries": return true; - case "subtotalPriceV2": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } + default: return false; + } + } + } - responseData.put(key, optional1); + /** + * The types of search items to perform predictive search on. + */ + public enum PredictiveSearchType { + /** + * Returns matching articles. + */ + ARTICLE, - break; - } + /** + * Returns matching collections. + */ + COLLECTION, - case "successfulFulfillments": { - List optional1 = null; - if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Fulfillment(jsonAsObject(element1, key))); - } + /** + * Returns matching pages. + */ + PAGE, - optional1 = list1; - } + /** + * Returns matching products. + */ + PRODUCT, - responseData.put(key, optional1); + /** + * Returns matching query strings. + */ + QUERY, - break; - } + UNKNOWN_VALUE; - case "totalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + public static PredictiveSearchType fromGraphQl(String value) { + if (value == null) { + return null; + } - break; - } + switch (value) { + case "ARTICLE": { + return ARTICLE; + } - case "totalPriceV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "COLLECTION": { + return COLLECTION; + } + + case "PAGE": { + return PAGE; + } - break; - } + case "PRODUCT": { + return PRODUCT; + } - case "totalRefunded": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "QUERY": { + return QUERY; + } - break; - } + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case ARTICLE: { + return "ARTICLE"; + } - case "totalRefundedV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case COLLECTION: { + return "COLLECTION"; + } - break; - } + case PAGE: { + return "PAGE"; + } - case "totalShippingPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case PRODUCT: { + return "PRODUCT"; + } - break; - } + case QUERY: { + return "QUERY"; + } - case "totalShippingPriceV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + default: { + return ""; + } + } + } + } - break; - } + /** + * The preferred delivery methods such as shipping, local pickup or through pickup points. + */ + public enum PreferenceDeliveryMethodType { + /** + * A delivery method used to let buyers collect purchases at designated locations like parcel lockers. + */ + PICKUP_POINT, - case "totalTax": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } + /** + * A delivery method used to let buyers receive items directly from a specific location within an area. + */ + PICK_UP, - responseData.put(key, optional1); + /** + * A delivery method used to send items directly to a buyer’s specified address. + */ + SHIPPING, - break; - } + UNKNOWN_VALUE; - case "totalTaxV2": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } + public static PreferenceDeliveryMethodType fromGraphQl(String value) { + if (value == null) { + return null; + } - responseData.put(key, optional1); + switch (value) { + case "PICKUP_POINT": { + return PICKUP_POINT; + } - break; - } + case "PICK_UP": { + return PICK_UP; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "SHIPPING": { + return SHIPPING; } - } - } - public Order(ID id) { - this(); - optimisticData.put("id", id); + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case PICKUP_POINT: { + return "PICKUP_POINT"; + } - public String getGraphQlTypeName() { - return "Order"; - } + case PICK_UP: { + return "PICK_UP"; + } - /** - * The address associated with the payment method. - */ + case SHIPPING: { + return "SHIPPING"; + } - public MailingAddress getBillingAddress() { - return (MailingAddress) get("billingAddress"); + default: { + return ""; + } + } } + } - public Order setBillingAddress(MailingAddress arg) { - optimisticData.put(getKey("billingAddress"), arg); - return this; - } + public static class PriceRangeFilter implements Serializable { + private Input min = Input.undefined(); - /** - * The reason for the order's cancellation. Returns `null` if the order wasn't canceled. - */ + private Input max = Input.undefined(); - public OrderCancelReason getCancelReason() { - return (OrderCancelReason) get("cancelReason"); + public Double getMin() { + return min.getValue(); } - public Order setCancelReason(OrderCancelReason arg) { - optimisticData.put(getKey("cancelReason"), arg); - return this; + public Input getMinInput() { + return min; } - /** - * The date and time when the order was canceled. Returns null if the order wasn't canceled. - */ - - public DateTime getCanceledAt() { - return (DateTime) get("canceledAt"); + public PriceRangeFilter setMin(Double min) { + this.min = Input.optional(min); + return this; } - public Order setCanceledAt(DateTime arg) { - optimisticData.put(getKey("canceledAt"), arg); + public PriceRangeFilter setMinInput(Input min) { + if (min == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.min = min; return this; } - /** - * The code of the currency used for the payment. - */ - - public CurrencyCode getCurrencyCode() { - return (CurrencyCode) get("currencyCode"); + public Double getMax() { + return max.getValue(); } - public Order setCurrencyCode(CurrencyCode arg) { - optimisticData.put(getKey("currencyCode"), arg); - return this; + public Input getMaxInput() { + return max; } - /** - * The subtotal of line items and their discounts, excluding line items that have been removed. Does - * not contain order-level discounts, duties, shipping costs, or shipping discounts. Taxes aren't - * included unless the order is a taxes-included order. - */ - - public MoneyV2 getCurrentSubtotalPrice() { - return (MoneyV2) get("currentSubtotalPrice"); + public PriceRangeFilter setMax(Double max) { + this.max = Input.optional(max); + return this; } - public Order setCurrentSubtotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("currentSubtotalPrice"), arg); + public PriceRangeFilter setMaxInput(Input max) { + if (max == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.max = max; return this; } - /** - * The total cost of duties for the order, including refunds. - */ + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - public MoneyV2 getCurrentTotalDuties() { - return (MoneyV2) get("currentTotalDuties"); + if (this.min.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("min:"); + if (min.getValue() != null) { + _queryBuilder.append(min.getValue()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.max.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("max:"); + if (max.getValue() != null) { + _queryBuilder.append(max.getValue()); + } else { + _queryBuilder.append("null"); + } + } + + _queryBuilder.append('}'); } + } - public Order setCurrentTotalDuties(MoneyV2 arg) { - optimisticData.put(getKey("currentTotalDuties"), arg); - return this; + public interface PricingPercentageValueQueryDefinition { + void define(PricingPercentageValueQuery _queryBuilder); + } + + /** + * The value of the percentage pricing object. + */ + public static class PricingPercentageValueQuery extends Query { + PricingPercentageValueQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The total amount of the order, including duties, taxes and discounts, minus amounts for line items - * that have been removed. + * The percentage value of the object. */ + public PricingPercentageValueQuery percentage() { + startField("percentage"); - public MoneyV2 getCurrentTotalPrice() { - return (MoneyV2) get("currentTotalPrice"); + return this; } + } - public Order setCurrentTotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("currentTotalPrice"), arg); - return this; + /** + * The value of the percentage pricing object. + */ + public static class PricingPercentageValue extends AbstractResponse implements PricingValue { + public PricingPercentageValue() { } - /** - * The total of all taxes applied to the order, excluding taxes for returned line items. - */ + public PricingPercentageValue(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "percentage": { + responseData.put(key, jsonAsDouble(field.getValue(), key)); - public MoneyV2 getCurrentTotalTax() { - return (MoneyV2) get("currentTotalTax"); + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public Order setCurrentTotalTax(MoneyV2 arg) { - optimisticData.put(getKey("currentTotalTax"), arg); - return this; + public String getGraphQlTypeName() { + return "PricingPercentageValue"; } /** - * A list of the custom attributes added to the order. + * The percentage value of the object. */ - public List getCustomAttributes() { - return (List) get("customAttributes"); + public Double getPercentage() { + return (Double) get("percentage"); } - public Order setCustomAttributes(List arg) { - optimisticData.put(getKey("customAttributes"), arg); + public PricingPercentageValue setPercentage(Double arg) { + optimisticData.put(getKey("percentage"), arg); return this; } - /** - * The locale code in which this specific order happened. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "percentage": return false; - public String getCustomerLocale() { - return (String) get("customerLocale"); + default: return false; + } } + } - public Order setCustomerLocale(String arg) { - optimisticData.put(getKey("customerLocale"), arg); - return this; - } + public interface PricingValueQueryDefinition { + void define(PricingValueQuery _queryBuilder); + } - /** - * The unique URL that the customer can use to access the order. - */ + /** + * The price value (fixed or percentage) for a discount application. + */ + public static class PricingValueQuery extends Query { + PricingValueQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - public String getCustomerUrl() { - return (String) get("customerUrl"); + startField("__typename"); } - public Order setCustomerUrl(String arg) { - optimisticData.put(getKey("customerUrl"), arg); + public PricingValueQuery onMoneyV2(MoneyV2QueryDefinition queryDef) { + startInlineFragment("MoneyV2"); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * Discounts that have been applied on the order. - */ - - public DiscountApplicationConnection getDiscountApplications() { - return (DiscountApplicationConnection) get("discountApplications"); - } - - public Order setDiscountApplications(DiscountApplicationConnection arg) { - optimisticData.put(getKey("discountApplications"), arg); + public PricingValueQuery onPricingPercentageValue(PricingPercentageValueQueryDefinition queryDef) { + startInlineFragment("PricingPercentageValue"); + queryDef.define(new PricingPercentageValueQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } + } - /** - * Whether the order has had any edits applied or not. - */ + public interface PricingValue { + String getGraphQlTypeName(); + } - public Boolean getEdited() { - return (Boolean) get("edited"); + /** + * The price value (fixed or percentage) for a discount application. + */ + public static class UnknownPricingValue extends AbstractResponse implements PricingValue { + public UnknownPricingValue() { } - public Order setEdited(Boolean arg) { - optimisticData.put(getKey("edited"), arg); - return this; + public UnknownPricingValue(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - /** - * The customer's email address. - */ + public static PricingValue create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "MoneyV2": { + return new MoneyV2(fields); + } - public String getEmail() { - return (String) get("email"); - } + case "PricingPercentageValue": { + return new PricingPercentageValue(fields); + } - public Order setEmail(String arg) { - optimisticData.put(getKey("email"), arg); - return this; + default: { + return new UnknownPricingValue(fields); + } + } } - /** - * The financial status of the order. - */ - - public OrderFinancialStatus getFinancialStatus() { - return (OrderFinancialStatus) get("financialStatus"); + public String getGraphQlTypeName() { + return (String) get("__typename"); } - public Order setFinancialStatus(OrderFinancialStatus arg) { - optimisticData.put(getKey("financialStatus"), arg); - return this; + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + default: return false; + } } + } - /** - * The fulfillment status for the order. - */ + public interface ProductQueryDefinition { + void define(ProductQuery _queryBuilder); + } - public OrderFulfillmentStatus getFulfillmentStatus() { - return (OrderFulfillmentStatus) get("fulfillmentStatus"); - } + /** + * A product represents an individual item for sale in a Shopify store. Products are often physical, + * but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also + * qualifies as a product, as do services (such as equipment rental, work for hire, + * customization of another product or an extended warranty). + */ + public static class ProductQuery extends Query { + ProductQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - public Order setFulfillmentStatus(OrderFulfillmentStatus arg) { - optimisticData.put(getKey("fulfillmentStatus"), arg); - return this; + startField("id"); } /** - * A globally-unique ID. + * Indicates if at least one product variant is available for sale. */ + public ProductQuery availableForSale() { + startField("availableForSale"); - public ID getId() { - return (ID) get("id"); + return this; } - /** - * List of the order’s line items. - */ + public class CollectionsArguments extends Arguments { + CollectionsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - public OrderLineItemConnection getLineItems() { - return (OrderLineItemConnection) get("lineItems"); - } + /** + * Returns up to the first `n` elements from the list. + */ + public CollectionsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - public Order setLineItems(OrderLineItemConnection arg) { - optimisticData.put(getKey("lineItems"), arg); - return this; - } + /** + * Returns the elements that come after the specified cursor. + */ + public CollectionsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - /** - * Returns a metafield found by namespace and key. - */ + /** + * Returns up to the last `n` elements from the list. + */ + public CollectionsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - public Metafield getMetafield() { - return (Metafield) get("metafield"); + /** + * Returns the elements that come before the specified cursor. + */ + public CollectionsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Reverse the order of the underlying list. + */ + public CollectionsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } } - public Order setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); - return this; + public interface CollectionsArgumentsDefinition { + void define(CollectionsArguments args); } /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * List of collections a product belongs to. */ - - public List getMetafields() { - return (List) get("metafields"); - } - - public Order setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); - return this; + public ProductQuery collections(CollectionConnectionQueryDefinition queryDef) { + return collections(args -> {}, queryDef); } /** - * Unique identifier for the order that appears on the order. - * For example, _#1000_ or _Store1001. + * List of collections a product belongs to. */ + public ProductQuery collections(CollectionsArgumentsDefinition argsDef, CollectionConnectionQueryDefinition queryDef) { + startField("collections"); - public String getName() { - return (String) get("name"); - } + CollectionsArguments args = new CollectionsArguments(_queryBuilder); + argsDef.define(args); + CollectionsArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new CollectionConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Order setName(String arg) { - optimisticData.put(getKey("name"), arg); return this; } /** - * A unique numeric identifier for the order for use by shop owner and customer. + * The compare at price of the product across all variants. */ + public ProductQuery compareAtPriceRange(ProductPriceRangeQueryDefinition queryDef) { + startField("compareAtPriceRange"); - public Integer getOrderNumber() { - return (Integer) get("orderNumber"); - } + _queryBuilder.append('{'); + queryDef.define(new ProductPriceRangeQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Order setOrderNumber(Integer arg) { - optimisticData.put(getKey("orderNumber"), arg); return this; } /** - * The total cost of duties charged at checkout. + * The date and time when the product was created. */ + public ProductQuery createdAt() { + startField("createdAt"); - public MoneyV2 getOriginalTotalDuties() { - return (MoneyV2) get("originalTotalDuties"); - } - - public Order setOriginalTotalDuties(MoneyV2 arg) { - optimisticData.put(getKey("originalTotalDuties"), arg); return this; } - /** - * The total price of the order before any applied edits. - */ + public class DescriptionArguments extends Arguments { + DescriptionArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - public MoneyV2 getOriginalTotalPrice() { - return (MoneyV2) get("originalTotalPrice"); + /** + * Truncates string after the given length. + */ + public DescriptionArguments truncateAt(Integer value) { + if (value != null) { + startArgument("truncateAt"); + _queryBuilder.append(value); + } + return this; + } } - public Order setOriginalTotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("originalTotalPrice"), arg); - return this; + public interface DescriptionArgumentsDefinition { + void define(DescriptionArguments args); } /** - * The customer's phone number for receiving SMS notifications. + * Stripped description of the product, single line with HTML tags removed. */ - - public String getPhone() { - return (String) get("phone"); - } - - public Order setPhone(String arg) { - optimisticData.put(getKey("phone"), arg); - return this; + public ProductQuery description() { + return description(args -> {}); } /** - * The date and time when the order was imported. - * This value can be set to dates in the past when importing from other systems. - * If no value is provided, it will be auto-generated based on current date and time. + * Stripped description of the product, single line with HTML tags removed. */ + public ProductQuery description(DescriptionArgumentsDefinition argsDef) { + startField("description"); - public DateTime getProcessedAt() { - return (DateTime) get("processedAt"); - } + DescriptionArguments args = new DescriptionArguments(_queryBuilder); + argsDef.define(args); + DescriptionArguments.end(args); - public Order setProcessedAt(DateTime arg) { - optimisticData.put(getKey("processedAt"), arg); return this; } /** - * The address to where the order will be shipped. + * The description of the product, complete with HTML formatting. */ + public ProductQuery descriptionHtml() { + startField("descriptionHtml"); - public MailingAddress getShippingAddress() { - return (MailingAddress) get("shippingAddress"); - } - - public Order setShippingAddress(MailingAddress arg) { - optimisticData.put(getKey("shippingAddress"), arg); return this; } /** - * The discounts that have been allocated onto the shipping line by discount applications. + * The featured image for the product. + * This field is functionally equivalent to `images(first: 1)`. */ + public ProductQuery featuredImage(ImageQueryDefinition queryDef) { + startField("featuredImage"); - public List getShippingDiscountAllocations() { - return (List) get("shippingDiscountAllocations"); - } + _queryBuilder.append('{'); + queryDef.define(new ImageQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Order setShippingDiscountAllocations(List arg) { - optimisticData.put(getKey("shippingDiscountAllocations"), arg); return this; } /** - * The unique URL for the order's status page. + * A human-friendly unique string for the Product automatically generated from its title. + * They are used by the Liquid templating language to refer to objects. */ + public ProductQuery handle() { + startField("handle"); - public String getStatusUrl() { - return (String) get("statusUrl"); - } - - public Order setStatusUrl(String arg) { - optimisticData.put(getKey("statusUrl"), arg); return this; } - /** - * Price of the order before shipping and taxes. - */ + public class ImagesArguments extends Arguments { + ImagesArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - public MoneyV2 getSubtotalPrice() { - return (MoneyV2) get("subtotalPrice"); - } + /** + * Returns up to the first `n` elements from the list. + */ + public ImagesArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - public Order setSubtotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("subtotalPrice"), arg); - return this; - } + /** + * Returns the elements that come after the specified cursor. + */ + public ImagesArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - /** - * Price of the order before duties, shipping and taxes. - * - * @deprecated Use `subtotalPrice` instead. - */ + /** + * Returns up to the last `n` elements from the list. + */ + public ImagesArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - public MoneyV2 getSubtotalPriceV2() { - return (MoneyV2) get("subtotalPriceV2"); + /** + * Returns the elements that come before the specified cursor. + */ + public ImagesArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Reverse the order of the underlying list. + */ + public ImagesArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Sort the underlying list by the given key. + */ + public ImagesArguments sortKey(ProductImageSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; + } } - public Order setSubtotalPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("subtotalPriceV2"), arg); - return this; + public interface ImagesArgumentsDefinition { + void define(ImagesArguments args); } /** - * List of the order’s successful fulfillments. + * List of images associated with the product. */ - - public List getSuccessfulFulfillments() { - return (List) get("successfulFulfillments"); - } - - public Order setSuccessfulFulfillments(List arg) { - optimisticData.put(getKey("successfulFulfillments"), arg); - return this; + public ProductQuery images(ImageConnectionQueryDefinition queryDef) { + return images(args -> {}, queryDef); } /** - * The sum of all the prices of all the items in the order, duties, taxes and discounts included (must - * be positive). + * List of images associated with the product. */ + public ProductQuery images(ImagesArgumentsDefinition argsDef, ImageConnectionQueryDefinition queryDef) { + startField("images"); - public MoneyV2 getTotalPrice() { - return (MoneyV2) get("totalPrice"); - } + ImagesArguments args = new ImagesArguments(_queryBuilder); + argsDef.define(args); + ImagesArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new ImageConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Order setTotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("totalPrice"), arg); return this; } /** - * The sum of all the prices of all the items in the order, duties, taxes and discounts included (must - * be positive). - * - * @deprecated Use `totalPrice` instead. + * Whether the product is a gift card. */ + public ProductQuery isGiftCard() { + startField("isGiftCard"); - public MoneyV2 getTotalPriceV2() { - return (MoneyV2) get("totalPriceV2"); - } - - public Order setTotalPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("totalPriceV2"), arg); return this; } - /** - * The total amount that has been refunded. - */ + public class MediaArguments extends Arguments { + MediaArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - public MoneyV2 getTotalRefunded() { - return (MoneyV2) get("totalRefunded"); - } + /** + * Returns up to the first `n` elements from the list. + */ + public MediaArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - public Order setTotalRefunded(MoneyV2 arg) { - optimisticData.put(getKey("totalRefunded"), arg); - return this; - } + /** + * Returns the elements that come after the specified cursor. + */ + public MediaArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - /** - * The total amount that has been refunded. - * - * @deprecated Use `totalRefunded` instead. - */ + /** + * Returns up to the last `n` elements from the list. + */ + public MediaArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - public MoneyV2 getTotalRefundedV2() { - return (MoneyV2) get("totalRefundedV2"); + /** + * Returns the elements that come before the specified cursor. + */ + public MediaArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Reverse the order of the underlying list. + */ + public MediaArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Sort the underlying list by the given key. + */ + public MediaArguments sortKey(ProductMediaSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; + } } - public Order setTotalRefundedV2(MoneyV2 arg) { - optimisticData.put(getKey("totalRefundedV2"), arg); - return this; + public interface MediaArgumentsDefinition { + void define(MediaArguments args); } /** - * The total cost of shipping. + * The media associated with the product. */ - - public MoneyV2 getTotalShippingPrice() { - return (MoneyV2) get("totalShippingPrice"); - } - - public Order setTotalShippingPrice(MoneyV2 arg) { - optimisticData.put(getKey("totalShippingPrice"), arg); - return this; + public ProductQuery media(MediaConnectionQueryDefinition queryDef) { + return media(args -> {}, queryDef); } /** - * The total cost of shipping. - * - * @deprecated Use `totalShippingPrice` instead. + * The media associated with the product. */ + public ProductQuery media(MediaArgumentsDefinition argsDef, MediaConnectionQueryDefinition queryDef) { + startField("media"); - public MoneyV2 getTotalShippingPriceV2() { - return (MoneyV2) get("totalShippingPriceV2"); - } + MediaArguments args = new MediaArguments(_queryBuilder); + argsDef.define(args); + MediaArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new MediaConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Order setTotalShippingPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("totalShippingPriceV2"), arg); return this; } - /** - * The total cost of taxes. - */ + public class MetafieldArguments extends Arguments { + MetafieldArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } - public MoneyV2 getTotalTax() { - return (MoneyV2) get("totalTax"); + /** + * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. + */ + public MetafieldArguments namespace(String value) { + if (value != null) { + startArgument("namespace"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } } - public Order setTotalTax(MoneyV2 arg) { - optimisticData.put(getKey("totalTax"), arg); - return this; + public interface MetafieldArgumentsDefinition { + void define(MetafieldArguments args); } /** - * The total cost of taxes. - * - * @deprecated Use `totalTax` instead. + * Returns a metafield found by namespace and key. */ - - public MoneyV2 getTotalTaxV2() { - return (MoneyV2) get("totalTaxV2"); - } - - public Order setTotalTaxV2(MoneyV2 arg) { - optimisticData.put(getKey("totalTaxV2"), arg); - return this; + public ProductQuery metafield(String key, MetafieldQueryDefinition queryDef) { + return metafield(key, args -> {}, queryDef); } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "billingAddress": return true; - - case "cancelReason": return false; - - case "canceledAt": return false; - - case "currencyCode": return false; - - case "currentSubtotalPrice": return true; - - case "currentTotalDuties": return true; - - case "currentTotalPrice": return true; - - case "currentTotalTax": return true; - - case "customAttributes": return true; - - case "customerLocale": return false; - - case "customerUrl": return false; - - case "discountApplications": return true; - - case "edited": return false; - - case "email": return false; - - case "financialStatus": return false; - - case "fulfillmentStatus": return false; - - case "id": return false; - - case "lineItems": return true; - - case "metafield": return true; - - case "metafields": return true; - - case "name": return false; - - case "orderNumber": return false; - - case "originalTotalDuties": return true; - - case "originalTotalPrice": return true; - - case "phone": return false; - - case "processedAt": return false; - - case "shippingAddress": return true; + /** + * Returns a metafield found by namespace and key. + */ + public ProductQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { + startField("metafield"); - case "shippingDiscountAllocations": return true; + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); - case "statusUrl": return false; + argsDef.define(new MetafieldArguments(_queryBuilder)); - case "subtotalPrice": return true; + _queryBuilder.append(')'); - case "subtotalPriceV2": return true; + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "successfulFulfillments": return true; + return this; + } - case "totalPrice": return true; + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ + public ProductQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); - case "totalPriceV2": return true; + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); - case "totalRefunded": return true; + _queryBuilder.append(')'); - case "totalRefundedV2": return true; + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "totalShippingPrice": return true; + return this; + } - case "totalShippingPriceV2": return true; + /** + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. + */ + public ProductQuery onlineStoreUrl() { + startField("onlineStoreUrl"); - case "totalTax": return true; + return this; + } - case "totalTaxV2": return true; + public class OptionsArguments extends Arguments { + OptionsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - default: return false; + /** + * Truncate the array result to this size. + */ + public OptionsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; } } - } - /** - * Represents the reason for the order's cancellation. - */ - public enum OrderCancelReason { - /** - * The customer wanted to cancel the order. - */ - CUSTOMER, + public interface OptionsArgumentsDefinition { + void define(OptionsArguments args); + } /** - * Payment was declined. + * List of product options. */ - DECLINED, + public ProductQuery options(ProductOptionQueryDefinition queryDef) { + return options(args -> {}, queryDef); + } /** - * The order was fraudulent. + * List of product options. */ - FRAUD, + public ProductQuery options(OptionsArgumentsDefinition argsDef, ProductOptionQueryDefinition queryDef) { + startField("options"); - /** - * There was insufficient inventory. - */ - INVENTORY, + OptionsArguments args = new OptionsArguments(_queryBuilder); + argsDef.define(args); + OptionsArguments.end(args); - /** - * The order was canceled for an unlisted reason. - */ - OTHER, + _queryBuilder.append('{'); + queryDef.define(new ProductOptionQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } /** - * Staff made an error. + * The price range. */ - STAFF, - - UNKNOWN_VALUE; + public ProductQuery priceRange(ProductPriceRangeQueryDefinition queryDef) { + startField("priceRange"); - public static OrderCancelReason fromGraphQl(String value) { - if (value == null) { - return null; - } + _queryBuilder.append('{'); + queryDef.define(new ProductPriceRangeQuery(_queryBuilder)); + _queryBuilder.append('}'); - switch (value) { - case "CUSTOMER": { - return CUSTOMER; - } + return this; + } - case "DECLINED": { - return DECLINED; - } + /** + * A categorization that a product can be tagged with, commonly used for filtering and searching. + */ + public ProductQuery productType() { + startField("productType"); - case "FRAUD": { - return FRAUD; - } + return this; + } - case "INVENTORY": { - return INVENTORY; - } + /** + * The date and time when the product was published to the channel. + */ + public ProductQuery publishedAt() { + startField("publishedAt"); - case "OTHER": { - return OTHER; - } + return this; + } - case "STAFF": { - return STAFF; - } + /** + * Whether the product can only be purchased with a selling plan. + */ + public ProductQuery requiresSellingPlan() { + startField("requiresSellingPlan"); - default: { - return UNKNOWN_VALUE; - } - } + return this; } - public String toString() { - switch (this) { - case CUSTOMER: { - return "CUSTOMER"; - } - case DECLINED: { - return "DECLINED"; - } + public class SellingPlanGroupsArguments extends Arguments { + SellingPlanGroupsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case FRAUD: { - return "FRAUD"; + /** + * Returns up to the first `n` elements from the list. + */ + public SellingPlanGroupsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); } + return this; + } - case INVENTORY: { - return "INVENTORY"; + /** + * Returns the elements that come after the specified cursor. + */ + public SellingPlanGroupsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - case OTHER: { - return "OTHER"; + /** + * Returns up to the last `n` elements from the list. + */ + public SellingPlanGroupsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); } + return this; + } - case STAFF: { - return "STAFF"; + /** + * Returns the elements that come before the specified cursor. + */ + public SellingPlanGroupsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - default: { - return ""; + /** + * Reverse the order of the underlying list. + */ + public SellingPlanGroupsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; } } - } - public interface OrderConnectionQueryDefinition { - void define(OrderConnectionQuery _queryBuilder); - } + public interface SellingPlanGroupsArgumentsDefinition { + void define(SellingPlanGroupsArguments args); + } - /** - * An auto-generated type for paginating through multiple Orders. - */ - public static class OrderConnectionQuery extends Query { - OrderConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + /** + * A list of a product's available selling plan groups. A selling plan group represents a selling + * method. For example, 'Subscribe and save' is a selling method where customers pay for goods or + * services per delivery. A selling plan group contains individual selling plans. + */ + public ProductQuery sellingPlanGroups(SellingPlanGroupConnectionQueryDefinition queryDef) { + return sellingPlanGroups(args -> {}, queryDef); } /** - * A list of edges. + * A list of a product's available selling plan groups. A selling plan group represents a selling + * method. For example, 'Subscribe and save' is a selling method where customers pay for goods or + * services per delivery. A selling plan group contains individual selling plans. */ - public OrderConnectionQuery edges(OrderEdgeQueryDefinition queryDef) { - startField("edges"); + public ProductQuery sellingPlanGroups(SellingPlanGroupsArgumentsDefinition argsDef, SellingPlanGroupConnectionQueryDefinition queryDef) { + startField("sellingPlanGroups"); + + SellingPlanGroupsArguments args = new SellingPlanGroupsArguments(_queryBuilder); + argsDef.define(args); + SellingPlanGroupsArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new OrderEdgeQuery(_queryBuilder)); + queryDef.define(new SellingPlanGroupConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in OrderEdge. + * The product's SEO information. */ - public OrderConnectionQuery nodes(OrderQueryDefinition queryDef) { - startField("nodes"); + public ProductQuery seo(SEOQueryDefinition queryDef) { + startField("seo"); _queryBuilder.append('{'); - queryDef.define(new OrderQuery(_queryBuilder)); + queryDef.define(new SEOQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Information to aid in pagination. + * A comma separated list of tags that have been added to the product. + * Additional access scope required for private apps: unauthenticated_read_product_tags. */ - public OrderConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ProductQuery tags() { + startField("tags"); return this; } /** - * The total count of Orders. + * The product’s title. */ - public OrderConnectionQuery totalCount() { - startField("totalCount"); + public ProductQuery title() { + startField("title"); return this; } - } - - /** - * An auto-generated type for paginating through multiple Orders. - */ - public static class OrderConnection extends AbstractResponse { - public OrderConnection() { - } - - public OrderConnection(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new OrderEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Order(jsonAsObject(element1, key))); - } + /** + * The total quantity of inventory in stock for this Product. + */ + public ProductQuery totalInventory() { + startField("totalInventory"); - responseData.put(key, list1); + return this; + } - break; - } + /** + * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for + * tracking the origin of the traffic. + */ + public ProductQuery trackingParameters() { + startField("trackingParameters"); - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + return this; + } - break; - } + /** + * The date and time when the product was last modified. + * A product's `updatedAt` value can change for different reasons. For example, if an order + * is placed for a product that has inventory tracking set up, then the inventory adjustment + * is counted as an update. + */ + public ProductQuery updatedAt() { + startField("updatedAt"); - case "totalCount": { - responseData.put(key, jsonAsString(field.getValue(), key)); + return this; + } - break; - } + public class VariantBySelectedOptionsArguments extends Arguments { + VariantBySelectedOptionsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + /** + * Whether to ignore unknown product options. + */ + public VariantBySelectedOptionsArguments ignoreUnknownOptions(Boolean value) { + if (value != null) { + startArgument("ignoreUnknownOptions"); + _queryBuilder.append(value); } + return this; } - } - - public String getGraphQlTypeName() { - return "OrderConnection"; - } - - /** - * A list of edges. - */ - public List getEdges() { - return (List) get("edges"); + /** + * Whether to perform case insensitive match on option names and values. + */ + public VariantBySelectedOptionsArguments caseInsensitiveMatch(Boolean value) { + if (value != null) { + startArgument("caseInsensitiveMatch"); + _queryBuilder.append(value); + } + return this; + } } - public OrderConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; + public interface VariantBySelectedOptionsArgumentsDefinition { + void define(VariantBySelectedOptionsArguments args); } /** - * A list of the nodes contained in OrderEdge. + * Find a product’s variant based on its selected options. + * This is useful for converting a user’s selection of product options into a single matching variant. + * If there is not a variant for the selected options, `null` will be returned. */ - - public List getNodes() { - return (List) get("nodes"); - } - - public OrderConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; + public ProductQuery variantBySelectedOptions(List selectedOptions, ProductVariantQueryDefinition queryDef) { + return variantBySelectedOptions(selectedOptions, args -> {}, queryDef); } /** - * Information to aid in pagination. + * Find a product’s variant based on its selected options. + * This is useful for converting a user’s selection of product options into a single matching variant. + * If there is not a variant for the selected options, `null` will be returned. */ + public ProductQuery variantBySelectedOptions(List selectedOptions, VariantBySelectedOptionsArgumentsDefinition argsDef, ProductVariantQueryDefinition queryDef) { + startField("variantBySelectedOptions"); - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } + _queryBuilder.append("(selectedOptions:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (SelectedOptionInput item1 : selectedOptions) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); - public OrderConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); - return this; - } + argsDef.define(new VariantBySelectedOptionsArguments(_queryBuilder)); - /** - * The total count of Orders. - */ + _queryBuilder.append(')'); - public String getTotalCount() { - return (String) get("totalCount"); - } + _queryBuilder.append('{'); + queryDef.define(new ProductVariantQuery(_queryBuilder)); + _queryBuilder.append('}'); - public OrderConnection setTotalCount(String arg) { - optimisticData.put(getKey("totalCount"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; + public class VariantsArguments extends Arguments { + VariantsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "nodes": return true; + /** + * Returns up to the first `n` elements from the list. + */ + public VariantsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - case "pageInfo": return true; + /** + * Returns the elements that come after the specified cursor. + */ + public VariantsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "totalCount": return false; + /** + * Returns up to the last `n` elements from the list. + */ + public VariantsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - default: return false; + /** + * Returns the elements that come before the specified cursor. + */ + public VariantsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; } - } - } - public interface OrderEdgeQueryDefinition { - void define(OrderEdgeQuery _queryBuilder); - } + /** + * Reverse the order of the underlying list. + */ + public VariantsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } - /** - * An auto-generated type which holds one Order and a cursor during pagination. - */ - public static class OrderEdgeQuery extends Query { - OrderEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + /** + * Sort the underlying list by the given key. + */ + public VariantsArguments sortKey(ProductVariantSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; + } + } + + public interface VariantsArgumentsDefinition { + void define(VariantsArguments args); } /** - * A cursor for use in pagination. + * List of the product’s variants. */ - public OrderEdgeQuery cursor() { - startField("cursor"); - - return this; + public ProductQuery variants(ProductVariantConnectionQueryDefinition queryDef) { + return variants(args -> {}, queryDef); } /** - * The item at the end of OrderEdge. + * List of the product’s variants. */ - public OrderEdgeQuery node(OrderQueryDefinition queryDef) { - startField("node"); + public ProductQuery variants(VariantsArgumentsDefinition argsDef, ProductVariantConnectionQueryDefinition queryDef) { + startField("variants"); + + VariantsArguments args = new VariantsArguments(_queryBuilder); + argsDef.define(args); + VariantsArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new OrderQuery(_queryBuilder)); + queryDef.define(new ProductVariantConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + + /** + * The product’s vendor name. + */ + public ProductQuery vendor() { + startField("vendor"); + + return this; + } } /** - * An auto-generated type which holds one Order and a cursor during pagination. + * A product represents an individual item for sale in a Shopify store. Products are often physical, + * but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also + * qualifies as a product, as do services (such as equipment rental, work for hire, + * customization of another product or an extended warranty). */ - public static class OrderEdge extends AbstractResponse { - public OrderEdge() { + public static class Product extends AbstractResponse implements HasMetafields, MenuItemResource, MetafieldParentResource, MetafieldReference, Node, OnlineStorePublishable, SearchResultItem, Trackable { + public Product() { } - public OrderEdge(JsonObject fields) throws SchemaViolationError { + public Product(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "availableForSale": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } - case "node": { - responseData.put(key, new Order(jsonAsObject(field.getValue(), key))); + case "collections": { + responseData.put(key, new CollectionConnection(jsonAsObject(field.getValue(), key))); break; } - case "__typename": { + case "compareAtPriceRange": { + responseData.put(key, new ProductPriceRange(jsonAsObject(field.getValue(), key))); + + break; + } + + case "createdAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + + case "description": { responseData.put(key, jsonAsString(field.getValue(), key)); + break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); + + case "descriptionHtml": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; } - } - } - } - public String getGraphQlTypeName() { - return "OrderEdge"; - } + case "featuredImage": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); + } - /** - * A cursor for use in pagination. - */ + responseData.put(key, optional1); - public String getCursor() { - return (String) get("cursor"); - } + break; + } - public OrderEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; - } + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * The item at the end of OrderEdge. - */ + break; + } - public Order getNode() { - return (Order) get("node"); - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - public OrderEdge setNode(Order arg) { - optimisticData.put(getKey("node"), arg); - return this; - } + break; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; + case "images": { + responseData.put(key, new ImageConnection(jsonAsObject(field.getValue(), key))); - case "node": return true; + break; + } - default: return false; - } - } - } + case "isGiftCard": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - /** - * Represents the order's current financial status. - */ - public enum OrderFinancialStatus { - /** - * Displayed as **Authorized**. - */ - AUTHORIZED, + break; + } - /** - * Displayed as **Paid**. - */ - PAID, + case "media": { + responseData.put(key, new MediaConnection(jsonAsObject(field.getValue(), key))); - /** - * Displayed as **Partially paid**. - */ - PARTIALLY_PAID, + break; + } - /** - * Displayed as **Partially refunded**. - */ - PARTIALLY_REFUNDED, + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } - /** - * Displayed as **Pending**. - */ - PENDING, + responseData.put(key, optional1); - /** - * Displayed as **Refunded**. - */ - REFUNDED, + break; + } - /** - * Displayed as **Voided**. - */ - VOIDED, + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } - UNKNOWN_VALUE; + list1.add(optional2); + } - public static OrderFinancialStatus fromGraphQl(String value) { - if (value == null) { - return null; - } + responseData.put(key, list1); - switch (value) { - case "AUTHORIZED": { - return AUTHORIZED; - } + break; + } - case "PAID": { - return PAID; - } + case "onlineStoreUrl": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "PARTIALLY_PAID": { - return PARTIALLY_PAID; - } + responseData.put(key, optional1); - case "PARTIALLY_REFUNDED": { - return PARTIALLY_REFUNDED; - } + break; + } - case "PENDING": { - return PENDING; - } + case "options": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ProductOption(jsonAsObject(element1, key))); + } - case "REFUNDED": { - return REFUNDED; - } + responseData.put(key, list1); - case "VOIDED": { - return VOIDED; - } + break; + } - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case AUTHORIZED: { - return "AUTHORIZED"; - } + case "priceRange": { + responseData.put(key, new ProductPriceRange(jsonAsObject(field.getValue(), key))); - case PAID: { - return "PAID"; - } + break; + } - case PARTIALLY_PAID: { - return "PARTIALLY_PAID"; - } + case "productType": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case PARTIALLY_REFUNDED: { - return "PARTIALLY_REFUNDED"; - } + break; + } - case PENDING: { - return "PENDING"; - } + case "publishedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - case REFUNDED: { - return "REFUNDED"; - } + break; + } - case VOIDED: { - return "VOIDED"; - } + case "requiresSellingPlan": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - default: { - return ""; - } - } - } - } + break; + } - /** - * Represents the order's aggregated fulfillment status for display purposes. - */ - public enum OrderFulfillmentStatus { - /** - * Displayed as **Fulfilled**. All of the items in the order have been fulfilled. - */ - FULFILLED, + case "sellingPlanGroups": { + responseData.put(key, new SellingPlanGroupConnection(jsonAsObject(field.getValue(), key))); - /** - * Displayed as **In progress**. Some of the items in the order have been fulfilled, or a request for - * fulfillment has been sent to the fulfillment service. - */ - IN_PROGRESS, + break; + } - /** - * Displayed as **On hold**. All of the unfulfilled items in this order are on hold. - */ - ON_HOLD, + case "seo": { + responseData.put(key, new SEO(jsonAsObject(field.getValue(), key))); - /** - * Displayed as **Open**. None of the items in the order have been fulfilled. Replaced by "UNFULFILLED" - * status. - */ - OPEN, + break; + } - /** - * Displayed as **Partially fulfilled**. Some of the items in the order have been fulfilled. - */ - PARTIALLY_FULFILLED, + case "tags": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } - /** - * Displayed as **Pending fulfillment**. A request for fulfillment of some items awaits a response from - * the fulfillment service. Replaced by "IN_PROGRESS" status. - */ - PENDING_FULFILLMENT, + responseData.put(key, list1); - /** - * Displayed as **Restocked**. All of the items in the order have been restocked. Replaced by - * "UNFULFILLED" status. - */ - RESTOCKED, + break; + } - /** - * Displayed as **Scheduled**. All of the unfulfilled items in this order are scheduled for fulfillment - * at later time. - */ - SCHEDULED, + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * Displayed as **Unfulfilled**. None of the items in the order have been fulfilled. - */ - UNFULFILLED, + break; + } - UNKNOWN_VALUE; + case "totalInventory": { + Integer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsInteger(field.getValue(), key); + } - public static OrderFulfillmentStatus fromGraphQl(String value) { - if (value == null) { - return null; - } + responseData.put(key, optional1); - switch (value) { - case "FULFILLED": { - return FULFILLED; - } + break; + } - case "IN_PROGRESS": { - return IN_PROGRESS; - } + case "trackingParameters": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "ON_HOLD": { - return ON_HOLD; - } + responseData.put(key, optional1); - case "OPEN": { - return OPEN; - } + break; + } - case "PARTIALLY_FULFILLED": { - return PARTIALLY_FULFILLED; - } + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - case "PENDING_FULFILLMENT": { - return PENDING_FULFILLMENT; - } + break; + } - case "RESTOCKED": { - return RESTOCKED; - } + case "variantBySelectedOptions": { + ProductVariant optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ProductVariant(jsonAsObject(field.getValue(), key)); + } - case "SCHEDULED": { - return SCHEDULED; - } + responseData.put(key, optional1); - case "UNFULFILLED": { - return UNFULFILLED; - } + break; + } - default: { - return UNKNOWN_VALUE; + case "variants": { + responseData.put(key, new ProductVariantConnection(jsonAsObject(field.getValue(), key))); + + break; + } + + case "vendor": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } } } - public String toString() { - switch (this) { - case FULFILLED: { - return "FULFILLED"; - } - case IN_PROGRESS: { - return "IN_PROGRESS"; - } + public Product(ID id) { + this(); + optimisticData.put("id", id); + } - case ON_HOLD: { - return "ON_HOLD"; - } + public String getGraphQlTypeName() { + return "Product"; + } - case OPEN: { - return "OPEN"; - } + /** + * Indicates if at least one product variant is available for sale. + */ - case PARTIALLY_FULFILLED: { - return "PARTIALLY_FULFILLED"; - } + public Boolean getAvailableForSale() { + return (Boolean) get("availableForSale"); + } - case PENDING_FULFILLMENT: { - return "PENDING_FULFILLMENT"; - } + public Product setAvailableForSale(Boolean arg) { + optimisticData.put(getKey("availableForSale"), arg); + return this; + } - case RESTOCKED: { - return "RESTOCKED"; - } + /** + * List of collections a product belongs to. + */ - case SCHEDULED: { - return "SCHEDULED"; - } + public CollectionConnection getCollections() { + return (CollectionConnection) get("collections"); + } - case UNFULFILLED: { - return "UNFULFILLED"; - } + public Product setCollections(CollectionConnection arg) { + optimisticData.put(getKey("collections"), arg); + return this; + } - default: { - return ""; - } - } + /** + * The compare at price of the product across all variants. + */ + + public ProductPriceRange getCompareAtPriceRange() { + return (ProductPriceRange) get("compareAtPriceRange"); + } + + public Product setCompareAtPriceRange(ProductPriceRange arg) { + optimisticData.put(getKey("compareAtPriceRange"), arg); + return this; + } + + /** + * The date and time when the product was created. + */ + + public DateTime getCreatedAt() { + return (DateTime) get("createdAt"); + } + + public Product setCreatedAt(DateTime arg) { + optimisticData.put(getKey("createdAt"), arg); + return this; } - } - public interface OrderLineItemQueryDefinition { - void define(OrderLineItemQuery _queryBuilder); - } + /** + * Stripped description of the product, single line with HTML tags removed. + */ - /** - * Represents a single line in an order. There is one line item for each distinct product variant. - */ - public static class OrderLineItemQuery extends Query { - OrderLineItemQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public String getDescription() { + return (String) get("description"); + } + + public Product setDescription(String arg) { + optimisticData.put(getKey("description"), arg); + return this; } /** - * The number of entries associated to the line item minus the items that have been removed. + * The description of the product, complete with HTML formatting. */ - public OrderLineItemQuery currentQuantity() { - startField("currentQuantity"); + public String getDescriptionHtml() { + return (String) get("descriptionHtml"); + } + + public Product setDescriptionHtml(String arg) { + optimisticData.put(getKey("descriptionHtml"), arg); return this; } /** - * List of custom attributes associated to the line item. + * The featured image for the product. + * This field is functionally equivalent to `images(first: 1)`. */ - public OrderLineItemQuery customAttributes(AttributeQueryDefinition queryDef) { - startField("customAttributes"); - _queryBuilder.append('{'); - queryDef.define(new AttributeQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Image getFeaturedImage() { + return (Image) get("featuredImage"); + } + public Product setFeaturedImage(Image arg) { + optimisticData.put(getKey("featuredImage"), arg); return this; } /** - * The discounts that have been allocated onto the order line item by discount applications. + * A human-friendly unique string for the Product automatically generated from its title. + * They are used by the Liquid templating language to refer to objects. */ - public OrderLineItemQuery discountAllocations(DiscountAllocationQueryDefinition queryDef) { - startField("discountAllocations"); - _queryBuilder.append('{'); - queryDef.define(new DiscountAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getHandle() { + return (String) get("handle"); + } + public Product setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); return this; } /** - * The total price of the line item, including discounts, and displayed in the presentment currency. + * A globally-unique ID. */ - public OrderLineItemQuery discountedTotalPrice(MoneyV2QueryDefinition queryDef) { - startField("discountedTotalPrice"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public ID getId() { + return (ID) get("id"); + } + + /** + * List of images associated with the product. + */ + + public ImageConnection getImages() { + return (ImageConnection) get("images"); + } + public Product setImages(ImageConnection arg) { + optimisticData.put(getKey("images"), arg); return this; } /** - * The total price of the line item, not including any discounts. The total price is calculated using - * the original unit price multiplied by the quantity, and it's displayed in the presentment currency. + * Whether the product is a gift card. */ - public OrderLineItemQuery originalTotalPrice(MoneyV2QueryDefinition queryDef) { - startField("originalTotalPrice"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public Boolean getIsGiftCard() { + return (Boolean) get("isGiftCard"); + } + public Product setIsGiftCard(Boolean arg) { + optimisticData.put(getKey("isGiftCard"), arg); return this; } /** - * The number of products variants associated to the line item. + * The media associated with the product. */ - public OrderLineItemQuery quantity() { - startField("quantity"); + public MediaConnection getMedia() { + return (MediaConnection) get("media"); + } + + public Product setMedia(MediaConnection arg) { + optimisticData.put(getKey("media"), arg); return this; } /** - * The title of the product combined with title of the variant. + * Returns a metafield found by namespace and key. */ - public OrderLineItemQuery title() { - startField("title"); + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } + + public Product setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); return this; } /** - * The product variant object associated to the line item. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public OrderLineItemQuery variant(ProductVariantQueryDefinition queryDef) { - startField("variant"); - _queryBuilder.append('{'); - queryDef.define(new ProductVariantQuery(_queryBuilder)); - _queryBuilder.append('}'); + public List getMetafields() { + return (List) get("metafields"); + } + public Product setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); return this; } - } - /** - * Represents a single line in an order. There is one line item for each distinct product variant. - */ - public static class OrderLineItem extends AbstractResponse { - public OrderLineItem() { + /** + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. + */ + + public String getOnlineStoreUrl() { + return (String) get("onlineStoreUrl"); } - public OrderLineItem(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "currentQuantity": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + public Product setOnlineStoreUrl(String arg) { + optimisticData.put(getKey("onlineStoreUrl"), arg); + return this; + } - break; - } + /** + * List of product options. + */ - case "customAttributes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Attribute(jsonAsObject(element1, key))); - } + public List getOptions() { + return (List) get("options"); + } - responseData.put(key, list1); + public Product setOptions(List arg) { + optimisticData.put(getKey("options"), arg); + return this; + } - break; - } + /** + * The price range. + */ - case "discountAllocations": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new DiscountAllocation(jsonAsObject(element1, key))); - } + public ProductPriceRange getPriceRange() { + return (ProductPriceRange) get("priceRange"); + } - responseData.put(key, list1); + public Product setPriceRange(ProductPriceRange arg) { + optimisticData.put(getKey("priceRange"), arg); + return this; + } - break; - } + /** + * A categorization that a product can be tagged with, commonly used for filtering and searching. + */ - case "discountedTotalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + public String getProductType() { + return (String) get("productType"); + } - break; - } + public Product setProductType(String arg) { + optimisticData.put(getKey("productType"), arg); + return this; + } - case "originalTotalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + /** + * The date and time when the product was published to the channel. + */ - break; - } + public DateTime getPublishedAt() { + return (DateTime) get("publishedAt"); + } - case "quantity": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + public Product setPublishedAt(DateTime arg) { + optimisticData.put(getKey("publishedAt"), arg); + return this; + } - break; - } + /** + * Whether the product can only be purchased with a selling plan. + */ - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + public Boolean getRequiresSellingPlan() { + return (Boolean) get("requiresSellingPlan"); + } - break; - } + public Product setRequiresSellingPlan(Boolean arg) { + optimisticData.put(getKey("requiresSellingPlan"), arg); + return this; + } - case "variant": { - ProductVariant optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ProductVariant(jsonAsObject(field.getValue(), key)); - } + /** + * A list of a product's available selling plan groups. A selling plan group represents a selling + * method. For example, 'Subscribe and save' is a selling method where customers pay for goods or + * services per delivery. A selling plan group contains individual selling plans. + */ - responseData.put(key, optional1); + public SellingPlanGroupConnection getSellingPlanGroups() { + return (SellingPlanGroupConnection) get("sellingPlanGroups"); + } - break; - } + public Product setSellingPlanGroups(SellingPlanGroupConnection arg) { + optimisticData.put(getKey("sellingPlanGroups"), arg); + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + /** + * The product's SEO information. + */ + + public SEO getSeo() { + return (SEO) get("seo"); } - public String getGraphQlTypeName() { - return "OrderLineItem"; + public Product setSeo(SEO arg) { + optimisticData.put(getKey("seo"), arg); + return this; } /** - * The number of entries associated to the line item minus the items that have been removed. + * A comma separated list of tags that have been added to the product. + * Additional access scope required for private apps: unauthenticated_read_product_tags. */ - public Integer getCurrentQuantity() { - return (Integer) get("currentQuantity"); + public List getTags() { + return (List) get("tags"); } - public OrderLineItem setCurrentQuantity(Integer arg) { - optimisticData.put(getKey("currentQuantity"), arg); + public Product setTags(List arg) { + optimisticData.put(getKey("tags"), arg); return this; } /** - * List of custom attributes associated to the line item. + * The product’s title. */ - public List getCustomAttributes() { - return (List) get("customAttributes"); + public String getTitle() { + return (String) get("title"); } - public OrderLineItem setCustomAttributes(List arg) { - optimisticData.put(getKey("customAttributes"), arg); + public Product setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } /** - * The discounts that have been allocated onto the order line item by discount applications. + * The total quantity of inventory in stock for this Product. */ - public List getDiscountAllocations() { - return (List) get("discountAllocations"); + public Integer getTotalInventory() { + return (Integer) get("totalInventory"); } - public OrderLineItem setDiscountAllocations(List arg) { - optimisticData.put(getKey("discountAllocations"), arg); + public Product setTotalInventory(Integer arg) { + optimisticData.put(getKey("totalInventory"), arg); return this; } /** - * The total price of the line item, including discounts, and displayed in the presentment currency. + * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for + * tracking the origin of the traffic. */ - public MoneyV2 getDiscountedTotalPrice() { - return (MoneyV2) get("discountedTotalPrice"); + public String getTrackingParameters() { + return (String) get("trackingParameters"); } - public OrderLineItem setDiscountedTotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("discountedTotalPrice"), arg); + public Product setTrackingParameters(String arg) { + optimisticData.put(getKey("trackingParameters"), arg); return this; } /** - * The total price of the line item, not including any discounts. The total price is calculated using - * the original unit price multiplied by the quantity, and it's displayed in the presentment currency. + * The date and time when the product was last modified. + * A product's `updatedAt` value can change for different reasons. For example, if an order + * is placed for a product that has inventory tracking set up, then the inventory adjustment + * is counted as an update. */ - public MoneyV2 getOriginalTotalPrice() { - return (MoneyV2) get("originalTotalPrice"); + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); } - public OrderLineItem setOriginalTotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("originalTotalPrice"), arg); + public Product setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); return this; } /** - * The number of products variants associated to the line item. + * Find a product’s variant based on its selected options. + * This is useful for converting a user’s selection of product options into a single matching variant. + * If there is not a variant for the selected options, `null` will be returned. */ - public Integer getQuantity() { - return (Integer) get("quantity"); + public ProductVariant getVariantBySelectedOptions() { + return (ProductVariant) get("variantBySelectedOptions"); } - public OrderLineItem setQuantity(Integer arg) { - optimisticData.put(getKey("quantity"), arg); + public Product setVariantBySelectedOptions(ProductVariant arg) { + optimisticData.put(getKey("variantBySelectedOptions"), arg); return this; } /** - * The title of the product combined with title of the variant. + * List of the product’s variants. */ - public String getTitle() { - return (String) get("title"); + public ProductVariantConnection getVariants() { + return (ProductVariantConnection) get("variants"); } - public OrderLineItem setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public Product setVariants(ProductVariantConnection arg) { + optimisticData.put(getKey("variants"), arg); return this; } /** - * The product variant object associated to the line item. + * The product’s vendor name. */ - public ProductVariant getVariant() { - return (ProductVariant) get("variant"); + public String getVendor() { + return (String) get("vendor"); } - public OrderLineItem setVariant(ProductVariant arg) { - optimisticData.put(getKey("variant"), arg); + public Product setVendor(String arg) { + optimisticData.put(getKey("vendor"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "currentQuantity": return false; + case "availableForSale": return false; + + case "collections": return true; + + case "compareAtPriceRange": return true; + + case "createdAt": return false; + + case "description": return false; + + case "descriptionHtml": return false; + + case "featuredImage": return true; + + case "handle": return false; + + case "id": return false; + + case "images": return true; + + case "isGiftCard": return false; + + case "media": return true; + + case "metafield": return true; + + case "metafields": return true; + + case "onlineStoreUrl": return false; + + case "options": return true; + + case "priceRange": return true; + + case "productType": return false; + + case "publishedAt": return false; + + case "requiresSellingPlan": return false; + + case "sellingPlanGroups": return true; + + case "seo": return true; + + case "tags": return false; + + case "title": return false; + + case "totalInventory": return false; + + case "trackingParameters": return false; + + case "updatedAt": return false; + + case "variantBySelectedOptions": return true; + + case "variants": return true; + + case "vendor": return false; + + default: return false; + } + } + } + + /** + * The set of valid sort keys for the ProductCollection query. + */ + public enum ProductCollectionSortKeys { + /** + * Sort by the `best-selling` value. + */ + BEST_SELLING, + + /** + * Sort by the `collection-default` value. + */ + COLLECTION_DEFAULT, + + /** + * Sort by the `created` value. + */ + CREATED, + + /** + * Sort by the `id` value. + */ + ID, + + /** + * Sort by the `manual` value. + */ + MANUAL, + + /** + * Sort by the `price` value. + */ + PRICE, + + /** + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. + */ + RELEVANCE, + + /** + * Sort by the `title` value. + */ + TITLE, + + UNKNOWN_VALUE; + + public static ProductCollectionSortKeys fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "BEST_SELLING": { + return BEST_SELLING; + } + + case "COLLECTION_DEFAULT": { + return COLLECTION_DEFAULT; + } + + case "CREATED": { + return CREATED; + } + + case "ID": { + return ID; + } + + case "MANUAL": { + return MANUAL; + } + + case "PRICE": { + return PRICE; + } + + case "RELEVANCE": { + return RELEVANCE; + } + + case "TITLE": { + return TITLE; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case BEST_SELLING: { + return "BEST_SELLING"; + } - case "customAttributes": return true; + case COLLECTION_DEFAULT: { + return "COLLECTION_DEFAULT"; + } - case "discountAllocations": return true; + case CREATED: { + return "CREATED"; + } - case "discountedTotalPrice": return true; + case ID: { + return "ID"; + } - case "originalTotalPrice": return true; + case MANUAL: { + return "MANUAL"; + } - case "quantity": return false; + case PRICE: { + return "PRICE"; + } - case "title": return false; + case RELEVANCE: { + return "RELEVANCE"; + } - case "variant": return true; + case TITLE: { + return "TITLE"; + } - default: return false; + default: { + return ""; + } } } } - public interface OrderLineItemConnectionQueryDefinition { - void define(OrderLineItemConnectionQuery _queryBuilder); + public interface ProductConnectionQueryDefinition { + void define(ProductConnectionQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple OrderLineItems. + * An auto-generated type for paginating through multiple Products. */ - public static class OrderLineItemConnectionQuery extends Query { - OrderLineItemConnectionQuery(StringBuilder _queryBuilder) { + public static class ProductConnectionQuery extends Query { + ProductConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A list of edges. */ - public OrderLineItemConnectionQuery edges(OrderLineItemEdgeQueryDefinition queryDef) { + public ProductConnectionQuery edges(ProductEdgeQueryDefinition queryDef) { startField("edges"); _queryBuilder.append('{'); - queryDef.define(new OrderLineItemEdgeQuery(_queryBuilder)); + queryDef.define(new ProductEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in OrderLineItemEdge. + * A list of available filters. */ - public OrderLineItemConnectionQuery nodes(OrderLineItemQueryDefinition queryDef) { + public ProductConnectionQuery filters(FilterQueryDefinition queryDef) { + startField("filters"); + + _queryBuilder.append('{'); + queryDef.define(new FilterQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * A list of the nodes contained in ProductEdge. + */ + public ProductConnectionQuery nodes(ProductQueryDefinition queryDef) { startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new OrderLineItemQuery(_queryBuilder)); + queryDef.define(new ProductQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -55800,7 +53260,7 @@ public OrderLineItemConnectionQuery nodes(OrderLineItemQueryDefinition queryDef) /** * Information to aid in pagination. */ - public OrderLineItemConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + public ProductConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { startField("pageInfo"); _queryBuilder.append('{'); @@ -55812,21 +53272,32 @@ public OrderLineItemConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { } /** - * An auto-generated type for paginating through multiple OrderLineItems. + * An auto-generated type for paginating through multiple Products. */ - public static class OrderLineItemConnection extends AbstractResponse { - public OrderLineItemConnection() { + public static class ProductConnection extends AbstractResponse { + public ProductConnection() { } - public OrderLineItemConnection(JsonObject fields) throws SchemaViolationError { + public ProductConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { case "edges": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new OrderLineItemEdge(jsonAsObject(element1, key))); + list1.add(new ProductEdge(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "filters": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Filter(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -55835,9 +53306,9 @@ public OrderLineItemConnection(JsonObject fields) throws SchemaViolationError { } case "nodes": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new OrderLineItem(jsonAsObject(element1, key))); + list1.add(new Product(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -55863,31 +53334,44 @@ public OrderLineItemConnection(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "OrderLineItemConnection"; + return "ProductConnection"; } /** * A list of edges. */ - public List getEdges() { - return (List) get("edges"); + public List getEdges() { + return (List) get("edges"); } - public OrderLineItemConnection setEdges(List arg) { + public ProductConnection setEdges(List arg) { optimisticData.put(getKey("edges"), arg); return this; } /** - * A list of the nodes contained in OrderLineItemEdge. + * A list of available filters. */ - public List getNodes() { - return (List) get("nodes"); + public List getFilters() { + return (List) get("filters"); } - public OrderLineItemConnection setNodes(List arg) { + public ProductConnection setFilters(List arg) { + optimisticData.put(getKey("filters"), arg); + return this; + } + + /** + * A list of the nodes contained in ProductEdge. + */ + + public List getNodes() { + return (List) get("nodes"); + } + + public ProductConnection setNodes(List arg) { optimisticData.put(getKey("nodes"), arg); return this; } @@ -55900,7 +53384,7 @@ public PageInfo getPageInfo() { return (PageInfo) get("pageInfo"); } - public OrderLineItemConnection setPageInfo(PageInfo arg) { + public ProductConnection setPageInfo(PageInfo arg) { optimisticData.put(getKey("pageInfo"), arg); return this; } @@ -55909,6 +53393,8 @@ public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "edges": return true; + case "filters": return true; + case "nodes": return true; case "pageInfo": return true; @@ -55918,35 +53404,35 @@ public boolean unwrapsToObject(String key) { } } - public interface OrderLineItemEdgeQueryDefinition { - void define(OrderLineItemEdgeQuery _queryBuilder); + public interface ProductEdgeQueryDefinition { + void define(ProductEdgeQuery _queryBuilder); } /** - * An auto-generated type which holds one OrderLineItem and a cursor during pagination. + * An auto-generated type which holds one Product and a cursor during pagination. */ - public static class OrderLineItemEdgeQuery extends Query { - OrderLineItemEdgeQuery(StringBuilder _queryBuilder) { + public static class ProductEdgeQuery extends Query { + ProductEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A cursor for use in pagination. */ - public OrderLineItemEdgeQuery cursor() { + public ProductEdgeQuery cursor() { startField("cursor"); return this; } /** - * The item at the end of OrderLineItemEdge. + * The item at the end of ProductEdge. */ - public OrderLineItemEdgeQuery node(OrderLineItemQueryDefinition queryDef) { + public ProductEdgeQuery node(ProductQueryDefinition queryDef) { startField("node"); _queryBuilder.append('{'); - queryDef.define(new OrderLineItemQuery(_queryBuilder)); + queryDef.define(new ProductQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -55954,13 +53440,13 @@ public OrderLineItemEdgeQuery node(OrderLineItemQueryDefinition queryDef) { } /** - * An auto-generated type which holds one OrderLineItem and a cursor during pagination. + * An auto-generated type which holds one Product and a cursor during pagination. */ - public static class OrderLineItemEdge extends AbstractResponse { - public OrderLineItemEdge() { + public static class ProductEdge extends AbstractResponse { + public ProductEdge() { } - public OrderLineItemEdge(JsonObject fields) throws SchemaViolationError { + public ProductEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -55972,7 +53458,7 @@ public OrderLineItemEdge(JsonObject fields) throws SchemaViolationError { } case "node": { - responseData.put(key, new OrderLineItem(jsonAsObject(field.getValue(), key))); + responseData.put(key, new Product(jsonAsObject(field.getValue(), key))); break; } @@ -55989,7 +53475,7 @@ public OrderLineItemEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "OrderLineItemEdge"; + return "ProductEdge"; } /** @@ -56000,20 +53486,20 @@ public String getCursor() { return (String) get("cursor"); } - public OrderLineItemEdge setCursor(String arg) { + public ProductEdge setCursor(String arg) { optimisticData.put(getKey("cursor"), arg); return this; } /** - * The item at the end of OrderLineItemEdge. + * The item at the end of ProductEdge. */ - public OrderLineItem getNode() { - return (OrderLineItem) get("node"); + public Product getNode() { + return (Product) get("node"); } - public OrderLineItemEdge setNode(OrderLineItem arg) { + public ProductEdge setNode(Product arg) { optimisticData.put(getKey("node"), arg); return this; } @@ -56029,661 +53515,513 @@ public boolean unwrapsToObject(String key) { } } - /** - * The set of valid sort keys for the Order query. - */ - public enum OrderSortKeys { - /** - * Sort by the `id` value. - */ - ID, - - /** - * Sort by the `processed_at` value. - */ - PROCESSED_AT, - - /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. - */ - RELEVANCE, - - /** - * Sort by the `total_price` value. - */ - TOTAL_PRICE, - - UNKNOWN_VALUE; - - public static OrderSortKeys fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "ID": { - return ID; - } - - case "PROCESSED_AT": { - return PROCESSED_AT; - } - - case "RELEVANCE": { - return RELEVANCE; - } - - case "TOTAL_PRICE": { - return TOTAL_PRICE; - } - - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case ID: { - return "ID"; - } - - case PROCESSED_AT: { - return "PROCESSED_AT"; - } - - case RELEVANCE: { - return "RELEVANCE"; - } - - case TOTAL_PRICE: { - return "TOTAL_PRICE"; - } - - default: { - return ""; - } - } - } - } - - public interface PageQueryDefinition { - void define(PageQuery _queryBuilder); - } - - /** - * Shopify merchants can create pages to hold static HTML content. Each Page object represents a custom - * page on the online store. - */ - public static class PageQuery extends Query { - PageQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - - startField("id"); - } - - /** - * The description of the page, complete with HTML formatting. - */ - public PageQuery body() { - startField("body"); - - return this; - } - - /** - * Summary of the page body. - */ - public PageQuery bodySummary() { - startField("bodySummary"); - - return this; - } - - /** - * The timestamp of the page creation. - */ - public PageQuery createdAt() { - startField("createdAt"); - - return this; - } - - /** - * A human-friendly unique string for the page automatically generated from its title. - */ - public PageQuery handle() { - startField("handle"); - - return this; - } - - public class MetafieldArguments extends Arguments { - MetafieldArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } - - /** - * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. - */ - public MetafieldArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - } - - public interface MetafieldArgumentsDefinition { - void define(MetafieldArguments args); - } - - /** - * Returns a metafield found by namespace and key. - */ - public PageQuery metafield(String key, MetafieldQueryDefinition queryDef) { - return metafield(key, args -> {}, queryDef); - } - - /** - * Returns a metafield found by namespace and key. - */ - public PageQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { - startField("metafield"); - - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); - - argsDef.define(new MetafieldArguments(_queryBuilder)); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ - public PageQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); - - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. - */ - public PageQuery onlineStoreUrl() { - startField("onlineStoreUrl"); - - return this; - } - - /** - * The page's SEO information. - */ - public PageQuery seo(SEOQueryDefinition queryDef) { - startField("seo"); - - _queryBuilder.append('{'); - queryDef.define(new SEOQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The title of the page. - */ - public PageQuery title() { - startField("title"); - - return this; - } - - /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. - */ - public PageQuery trackingParameters() { - startField("trackingParameters"); - - return this; - } - - /** - * The timestamp of the latest page update. - */ - public PageQuery updatedAt() { - startField("updatedAt"); - - return this; - } - } - - /** - * Shopify merchants can create pages to hold static HTML content. Each Page object represents a custom - * page on the online store. - */ - public static class Page extends AbstractResponse implements HasMetafields, MenuItemResource, MetafieldParentResource, MetafieldReference, Node, OnlineStorePublishable, SearchResultItem, Trackable { - public Page() { - } - - public Page(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "body": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "bodySummary": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "createdAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - - break; - } - - case "handle": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - - break; - } - - case "metafield": { - Metafield optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "metafields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } - - list1.add(optional2); - } - - responseData.put(key, list1); - - break; - } - - case "onlineStoreUrl": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "seo": { - SEO optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new SEO(jsonAsObject(field.getValue(), key)); - } + public static class ProductFilter implements Serializable { + private Input available = Input.undefined(); - responseData.put(key, optional1); + private Input variantOption = Input.undefined(); - break; - } + private Input productType = Input.undefined(); - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + private Input productVendor = Input.undefined(); - break; - } + private Input price = Input.undefined(); - case "trackingParameters": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + private Input productMetafield = Input.undefined(); - responseData.put(key, optional1); + private Input variantMetafield = Input.undefined(); - break; - } + private Input tag = Input.undefined(); - case "updatedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + public Boolean getAvailable() { + return available.getValue(); + } - break; - } + public Input getAvailableInput() { + return available; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public ProductFilter setAvailable(Boolean available) { + this.available = Input.optional(available); + return this; } - public Page(ID id) { - this(); - optimisticData.put("id", id); + public ProductFilter setAvailableInput(Input available) { + if (available == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.available = available; + return this; } - public String getGraphQlTypeName() { - return "Page"; + public VariantOptionFilter getVariantOption() { + return variantOption.getValue(); } - /** - * The description of the page, complete with HTML formatting. - */ + public Input getVariantOptionInput() { + return variantOption; + } - public String getBody() { - return (String) get("body"); + public ProductFilter setVariantOption(VariantOptionFilter variantOption) { + this.variantOption = Input.optional(variantOption); + return this; } - public Page setBody(String arg) { - optimisticData.put(getKey("body"), arg); + public ProductFilter setVariantOptionInput(Input variantOption) { + if (variantOption == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.variantOption = variantOption; return this; } - /** - * Summary of the page body. - */ + public String getProductType() { + return productType.getValue(); + } - public String getBodySummary() { - return (String) get("bodySummary"); + public Input getProductTypeInput() { + return productType; } - public Page setBodySummary(String arg) { - optimisticData.put(getKey("bodySummary"), arg); + public ProductFilter setProductType(String productType) { + this.productType = Input.optional(productType); return this; } - /** - * The timestamp of the page creation. - */ + public ProductFilter setProductTypeInput(Input productType) { + if (productType == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.productType = productType; + return this; + } - public DateTime getCreatedAt() { - return (DateTime) get("createdAt"); + public String getProductVendor() { + return productVendor.getValue(); } - public Page setCreatedAt(DateTime arg) { - optimisticData.put(getKey("createdAt"), arg); + public Input getProductVendorInput() { + return productVendor; + } + + public ProductFilter setProductVendor(String productVendor) { + this.productVendor = Input.optional(productVendor); return this; } - /** - * A human-friendly unique string for the page automatically generated from its title. - */ + public ProductFilter setProductVendorInput(Input productVendor) { + if (productVendor == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.productVendor = productVendor; + return this; + } - public String getHandle() { - return (String) get("handle"); + public PriceRangeFilter getPrice() { + return price.getValue(); } - public Page setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); + public Input getPriceInput() { + return price; + } + + public ProductFilter setPrice(PriceRangeFilter price) { + this.price = Input.optional(price); return this; } - /** - * A globally-unique ID. - */ + public ProductFilter setPriceInput(Input price) { + if (price == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.price = price; + return this; + } - public ID getId() { - return (ID) get("id"); + public MetafieldFilter getProductMetafield() { + return productMetafield.getValue(); } - /** - * Returns a metafield found by namespace and key. - */ + public Input getProductMetafieldInput() { + return productMetafield; + } - public Metafield getMetafield() { - return (Metafield) get("metafield"); + public ProductFilter setProductMetafield(MetafieldFilter productMetafield) { + this.productMetafield = Input.optional(productMetafield); + return this; } - public Page setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); + public ProductFilter setProductMetafieldInput(Input productMetafield) { + if (productMetafield == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.productMetafield = productMetafield; return this; } - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ + public MetafieldFilter getVariantMetafield() { + return variantMetafield.getValue(); + } - public List getMetafields() { - return (List) get("metafields"); + public Input getVariantMetafieldInput() { + return variantMetafield; } - public Page setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); + public ProductFilter setVariantMetafield(MetafieldFilter variantMetafield) { + this.variantMetafield = Input.optional(variantMetafield); return this; } - /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. - */ - - public String getOnlineStoreUrl() { - return (String) get("onlineStoreUrl"); + public ProductFilter setVariantMetafieldInput(Input variantMetafield) { + if (variantMetafield == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.variantMetafield = variantMetafield; + return this; } - public Page setOnlineStoreUrl(String arg) { - optimisticData.put(getKey("onlineStoreUrl"), arg); - return this; + public String getTag() { + return tag.getValue(); } - /** - * The page's SEO information. - */ + public Input getTagInput() { + return tag; + } - public SEO getSeo() { - return (SEO) get("seo"); + public ProductFilter setTag(String tag) { + this.tag = Input.optional(tag); + return this; } - public Page setSeo(SEO arg) { - optimisticData.put(getKey("seo"), arg); + public ProductFilter setTagInput(Input tag) { + if (tag == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.tag = tag; return this; } - /** - * The title of the page. - */ + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - public String getTitle() { - return (String) get("title"); - } + if (this.available.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("available:"); + if (available.getValue() != null) { + _queryBuilder.append(available.getValue()); + } else { + _queryBuilder.append("null"); + } + } - public Page setTitle(String arg) { - optimisticData.put(getKey("title"), arg); - return this; + if (this.variantOption.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("variantOption:"); + if (variantOption.getValue() != null) { + variantOption.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + if (this.productType.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("productType:"); + if (productType.getValue() != null) { + Query.appendQuotedString(_queryBuilder, productType.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.productVendor.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("productVendor:"); + if (productVendor.getValue() != null) { + Query.appendQuotedString(_queryBuilder, productVendor.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.price.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("price:"); + if (price.getValue() != null) { + price.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + if (this.productMetafield.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("productMetafield:"); + if (productMetafield.getValue() != null) { + productMetafield.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + if (this.variantMetafield.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("variantMetafield:"); + if (variantMetafield.getValue() != null) { + variantMetafield.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + if (this.tag.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("tag:"); + if (tag.getValue() != null) { + Query.appendQuotedString(_queryBuilder, tag.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + _queryBuilder.append('}'); } + } + /** + * The set of valid sort keys for the ProductImage query. + */ + public enum ProductImageSortKeys { /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * Sort by the `created_at` value. */ + CREATED_AT, - public String getTrackingParameters() { - return (String) get("trackingParameters"); - } + /** + * Sort by the `id` value. + */ + ID, - public Page setTrackingParameters(String arg) { - optimisticData.put(getKey("trackingParameters"), arg); - return this; - } + /** + * Sort by the `position` value. + */ + POSITION, /** - * The timestamp of the latest page update. + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. */ + RELEVANCE, - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); - } + UNKNOWN_VALUE; - public Page setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); - return this; + public static ProductImageSortKeys fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "CREATED_AT": { + return CREATED_AT; + } + + case "ID": { + return ID; + } + + case "POSITION": { + return POSITION; + } + + case "RELEVANCE": { + return RELEVANCE; + } + + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case CREATED_AT: { + return "CREATED_AT"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "body": return false; + case ID: { + return "ID"; + } - case "bodySummary": return false; + case POSITION: { + return "POSITION"; + } - case "createdAt": return false; + case RELEVANCE: { + return "RELEVANCE"; + } - case "handle": return false; + default: { + return ""; + } + } + } + } - case "id": return false; + /** + * The set of valid sort keys for the ProductMedia query. + */ + public enum ProductMediaSortKeys { + /** + * Sort by the `id` value. + */ + ID, - case "metafield": return true; + /** + * Sort by the `position` value. + */ + POSITION, - case "metafields": return true; + /** + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. + */ + RELEVANCE, - case "onlineStoreUrl": return false; + UNKNOWN_VALUE; - case "seo": return true; + public static ProductMediaSortKeys fromGraphQl(String value) { + if (value == null) { + return null; + } - case "title": return false; + switch (value) { + case "ID": { + return ID; + } - case "trackingParameters": return false; + case "POSITION": { + return POSITION; + } - case "updatedAt": return false; + case "RELEVANCE": { + return RELEVANCE; + } - default: return false; + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case ID: { + return "ID"; + } + + case POSITION: { + return "POSITION"; + } + + case RELEVANCE: { + return "RELEVANCE"; + } + + default: { + return ""; + } } } } - public interface PageConnectionQueryDefinition { - void define(PageConnectionQuery _queryBuilder); + public interface ProductOptionQueryDefinition { + void define(ProductOptionQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple Pages. + * Product property names like "Size", "Color", and "Material" that the customers can select. + * Variants are selected based on permutations of these options. + * 255 characters limit each. */ - public static class PageConnectionQuery extends Query { - PageConnectionQuery(StringBuilder _queryBuilder) { + public static class ProductOptionQuery extends Query { + ProductOptionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * A list of edges. + * The product option’s name. */ - public PageConnectionQuery edges(PageEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new PageEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ProductOptionQuery name() { + startField("name"); return this; } /** - * A list of the nodes contained in PageEdge. + * The corresponding option value to the product option. */ - public PageConnectionQuery nodes(PageQueryDefinition queryDef) { - startField("nodes"); + public ProductOptionQuery optionValues(ProductOptionValueQueryDefinition queryDef) { + startField("optionValues"); _queryBuilder.append('{'); - queryDef.define(new PageQuery(_queryBuilder)); + queryDef.define(new ProductOptionValueQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Information to aid in pagination. + * The corresponding value to the product option name. + * + * @deprecated Use `optionValues` instead. */ - public PageConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + @Deprecated + public ProductOptionQuery values() { + startField("values"); return this; } } /** - * An auto-generated type for paginating through multiple Pages. + * Product property names like "Size", "Color", and "Material" that the customers can select. + * Variants are selected based on permutations of these options. + * 255 characters limit each. */ - public static class PageConnection extends AbstractResponse { - public PageConnection() { + public static class ProductOption extends AbstractResponse implements Node { + public ProductOption() { } - public PageConnection(JsonObject fields) throws SchemaViolationError { + public ProductOption(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new PageEdge(jsonAsObject(element1, key))); - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - responseData.put(key, list1); + break; + } + + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "nodes": { - List list1 = new ArrayList<>(); + case "optionValues": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Page(jsonAsObject(element1, key))); + list1.add(new ProductOptionValue(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -56691,8 +54029,13 @@ public PageConnection(JsonObject fields) throws SchemaViolationError { break; } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "values": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + responseData.put(key, list1); break; } @@ -56708,91 +54051,110 @@ public PageConnection(JsonObject fields) throws SchemaViolationError { } } + public ProductOption(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "PageConnection"; + return "ProductOption"; } /** - * A list of edges. + * A globally-unique ID. */ - public List getEdges() { - return (List) get("edges"); + public ID getId() { + return (ID) get("id"); } - public PageConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); + /** + * The product option’s name. + */ + + public String getName() { + return (String) get("name"); + } + + public ProductOption setName(String arg) { + optimisticData.put(getKey("name"), arg); return this; } /** - * A list of the nodes contained in PageEdge. + * The corresponding option value to the product option. */ - public List getNodes() { - return (List) get("nodes"); + public List getOptionValues() { + return (List) get("optionValues"); } - public PageConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + public ProductOption setOptionValues(List arg) { + optimisticData.put(getKey("optionValues"), arg); return this; } /** - * Information to aid in pagination. + * The corresponding value to the product option name. + * + * @deprecated Use `optionValues` instead. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public List getValues() { + return (List) get("values"); } - public PageConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public ProductOption setValues(List arg) { + optimisticData.put(getKey("values"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "edges": return true; + case "id": return false; - case "nodes": return true; + case "name": return false; - case "pageInfo": return true; + case "optionValues": return true; + + case "values": return false; default: return false; } } } - public interface PageEdgeQueryDefinition { - void define(PageEdgeQuery _queryBuilder); + public interface ProductOptionValueQueryDefinition { + void define(ProductOptionValueQuery _queryBuilder); } /** - * An auto-generated type which holds one Page and a cursor during pagination. + * The product option value names. For example, "Red", "Blue", and "Green" for a "Color" option. */ - public static class PageEdgeQuery extends Query { - PageEdgeQuery(StringBuilder _queryBuilder) { + public static class ProductOptionValueQuery extends Query { + ProductOptionValueQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * A cursor for use in pagination. + * The name of the product option value. */ - public PageEdgeQuery cursor() { - startField("cursor"); + public ProductOptionValueQuery name() { + startField("name"); return this; } /** - * The item at the end of PageEdge. + * The swatch of the product option value. */ - public PageEdgeQuery node(PageQueryDefinition queryDef) { - startField("node"); + public ProductOptionValueQuery swatch(ProductOptionValueSwatchQueryDefinition queryDef) { + startField("swatch"); _queryBuilder.append('{'); - queryDef.define(new PageQuery(_queryBuilder)); + queryDef.define(new ProductOptionValueSwatchQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -56800,25 +54162,36 @@ public PageEdgeQuery node(PageQueryDefinition queryDef) { } /** - * An auto-generated type which holds one Page and a cursor during pagination. + * The product option value names. For example, "Red", "Blue", and "Green" for a "Color" option. */ - public static class PageEdge extends AbstractResponse { - public PageEdge() { + public static class ProductOptionValue extends AbstractResponse implements Node { + public ProductOptionValue() { } - public PageEdge(JsonObject fields) throws SchemaViolationError { + public ProductOptionValue(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cursor": { + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "name": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "node": { - responseData.put(key, new Page(jsonAsObject(field.getValue(), key))); + case "swatch": { + ProductOptionValueSwatch optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ProductOptionValueSwatch(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } @@ -56834,115 +54207,110 @@ public PageEdge(JsonObject fields) throws SchemaViolationError { } } + public ProductOptionValue(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "PageEdge"; + return "ProductOptionValue"; } /** - * A cursor for use in pagination. + * A globally-unique ID. */ - public String getCursor() { - return (String) get("cursor"); + public ID getId() { + return (ID) get("id"); } - public PageEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + /** + * The name of the product option value. + */ + + public String getName() { + return (String) get("name"); + } + + public ProductOptionValue setName(String arg) { + optimisticData.put(getKey("name"), arg); return this; } /** - * The item at the end of PageEdge. + * The swatch of the product option value. */ - public Page getNode() { - return (Page) get("node"); + public ProductOptionValueSwatch getSwatch() { + return (ProductOptionValueSwatch) get("swatch"); } - public PageEdge setNode(Page arg) { - optimisticData.put(getKey("node"), arg); + public ProductOptionValue setSwatch(ProductOptionValueSwatch arg) { + optimisticData.put(getKey("swatch"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cursor": return false; + case "id": return false; - case "node": return true; + case "name": return false; + + case "swatch": return true; default: return false; } } } - public interface PageInfoQueryDefinition { - void define(PageInfoQuery _queryBuilder); + public interface ProductOptionValueSwatchQueryDefinition { + void define(ProductOptionValueSwatchQuery _queryBuilder); } /** - * Returns information about pagination in a connection, in accordance with the - * [Relay specification](https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo). - * For more information, please read our [GraphQL Pagination Usage - * Guide](https://shopify.dev/api/usage/pagination-graphql). + * The product option value swatch. */ - public static class PageInfoQuery extends Query { - PageInfoQuery(StringBuilder _queryBuilder) { + public static class ProductOptionValueSwatchQuery extends Query { + ProductOptionValueSwatchQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The cursor corresponding to the last node in edges. - */ - public PageInfoQuery endCursor() { - startField("endCursor"); - - return this; - } - - /** - * Whether there are more pages to fetch following the current page. + * The swatch color. */ - public PageInfoQuery hasNextPage() { - startField("hasNextPage"); + public ProductOptionValueSwatchQuery color() { + startField("color"); return this; } /** - * Whether there are any pages prior to the current page. + * The swatch image. */ - public PageInfoQuery hasPreviousPage() { - startField("hasPreviousPage"); - - return this; - } + public ProductOptionValueSwatchQuery image(MediaQueryDefinition queryDef) { + startField("image"); - /** - * The cursor corresponding to the first node in edges. - */ - public PageInfoQuery startCursor() { - startField("startCursor"); + _queryBuilder.append('{'); + queryDef.define(new MediaQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * Returns information about pagination in a connection, in accordance with the - * [Relay specification](https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo). - * For more information, please read our [GraphQL Pagination Usage - * Guide](https://shopify.dev/api/usage/pagination-graphql). + * The product option value swatch. */ - public static class PageInfo extends AbstractResponse { - public PageInfo() { + public static class ProductOptionValueSwatch extends AbstractResponse { + public ProductOptionValueSwatch() { } - public PageInfo(JsonObject fields) throws SchemaViolationError { + public ProductOptionValueSwatch(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "endCursor": { + case "color": { String optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = jsonAsString(field.getValue(), key); @@ -56953,22 +54321,10 @@ public PageInfo(JsonObject fields) throws SchemaViolationError { break; } - case "hasNextPage": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "hasPreviousPage": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "startCursor": { - String optional1 = null; + case "image": { + Media optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = UnknownMedia.create(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -56988,174 +54344,63 @@ public PageInfo(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "PageInfo"; - } - - /** - * The cursor corresponding to the last node in edges. - */ - - public String getEndCursor() { - return (String) get("endCursor"); - } - - public PageInfo setEndCursor(String arg) { - optimisticData.put(getKey("endCursor"), arg); - return this; - } - - /** - * Whether there are more pages to fetch following the current page. - */ - - public Boolean getHasNextPage() { - return (Boolean) get("hasNextPage"); - } - - public PageInfo setHasNextPage(Boolean arg) { - optimisticData.put(getKey("hasNextPage"), arg); - return this; + return "ProductOptionValueSwatch"; } /** - * Whether there are any pages prior to the current page. + * The swatch color. */ - public Boolean getHasPreviousPage() { - return (Boolean) get("hasPreviousPage"); + public String getColor() { + return (String) get("color"); } - public PageInfo setHasPreviousPage(Boolean arg) { - optimisticData.put(getKey("hasPreviousPage"), arg); + public ProductOptionValueSwatch setColor(String arg) { + optimisticData.put(getKey("color"), arg); return this; } /** - * The cursor corresponding to the first node in edges. + * The swatch image. */ - public String getStartCursor() { - return (String) get("startCursor"); + public Media getImage() { + return (Media) get("image"); } - public PageInfo setStartCursor(String arg) { - optimisticData.put(getKey("startCursor"), arg); + public ProductOptionValueSwatch setImage(Media arg) { + optimisticData.put(getKey("image"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "endCursor": return false; - - case "hasNextPage": return false; - - case "hasPreviousPage": return false; + case "color": return false; - case "startCursor": return false; + case "image": return false; default: return false; } } } - /** - * The set of valid sort keys for the Page query. - */ - public enum PageSortKeys { - /** - * Sort by the `id` value. - */ - ID, - - /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. - */ - RELEVANCE, - - /** - * Sort by the `title` value. - */ - TITLE, - - /** - * Sort by the `updated_at` value. - */ - UPDATED_AT, - - UNKNOWN_VALUE; - - public static PageSortKeys fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "ID": { - return ID; - } - - case "RELEVANCE": { - return RELEVANCE; - } - - case "TITLE": { - return TITLE; - } - - case "UPDATED_AT": { - return UPDATED_AT; - } - - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case ID: { - return "ID"; - } - - case RELEVANCE: { - return "RELEVANCE"; - } - - case TITLE: { - return "TITLE"; - } - - case UPDATED_AT: { - return "UPDATED_AT"; - } - - default: { - return ""; - } - } - } - } - - public interface PaymentQueryDefinition { - void define(PaymentQuery _queryBuilder); + public interface ProductPriceRangeQueryDefinition { + void define(ProductPriceRangeQuery _queryBuilder); } /** - * A payment applied to a checkout. + * The price range of the product. */ - public static class PaymentQuery extends Query { - PaymentQuery(StringBuilder _queryBuilder) { + public static class ProductPriceRangeQuery extends Query { + ProductPriceRangeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("id"); } /** - * The amount of the payment. + * The highest variant's price. */ - public PaymentQuery amount(MoneyV2QueryDefinition queryDef) { - startField("amount"); + public ProductPriceRangeQuery maxVariantPrice(MoneyV2QueryDefinition queryDef) { + startField("maxVariantPrice"); _queryBuilder.append('{'); queryDef.define(new MoneyV2Query(_queryBuilder)); @@ -57165,13 +54410,10 @@ public PaymentQuery amount(MoneyV2QueryDefinition queryDef) { } /** - * The amount of the payment. - * - * @deprecated Use `amount` instead. + * The lowest variant's price. */ - @Deprecated - public PaymentQuery amountV2(MoneyV2QueryDefinition queryDef) { - startField("amountV2"); + public ProductPriceRangeQuery minVariantPrice(MoneyV2QueryDefinition queryDef) { + startField("minVariantPrice"); _queryBuilder.append('{'); queryDef.define(new MoneyV2Query(_queryBuilder)); @@ -57179,217 +54421,28 @@ public PaymentQuery amountV2(MoneyV2QueryDefinition queryDef) { return this; } - - /** - * The billing address for the payment. - */ - public PaymentQuery billingAddress(MailingAddressQueryDefinition queryDef) { - startField("billingAddress"); - - _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The checkout to which the payment belongs. - */ - public PaymentQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The credit card used for the payment in the case of direct payments. - */ - public PaymentQuery creditCard(CreditCardQueryDefinition queryDef) { - startField("creditCard"); - - _queryBuilder.append('{'); - queryDef.define(new CreditCardQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * A message describing a processing error during asynchronous processing. - */ - public PaymentQuery errorMessage() { - startField("errorMessage"); - - return this; - } - - /** - * 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). - */ - public PaymentQuery idempotencyKey() { - startField("idempotencyKey"); - - return this; - } - - /** - * The URL where the customer needs to be redirected so they can complete the 3D Secure payment flow. - */ - public PaymentQuery nextActionUrl() { - startField("nextActionUrl"); - - return this; - } - - /** - * Whether the payment is still processing asynchronously. - */ - public PaymentQuery ready() { - startField("ready"); - - return this; - } - - /** - * A flag to indicate if the payment is to be done in test mode for gateways that support it. - */ - public PaymentQuery test() { - startField("test"); - - return this; - } - - /** - * The actual transaction recorded by Shopify after having processed the payment with the gateway. - */ - public PaymentQuery transaction(TransactionQueryDefinition queryDef) { - startField("transaction"); - - _queryBuilder.append('{'); - queryDef.define(new TransactionQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } } /** - * A payment applied to a checkout. + * The price range of the product. */ - public static class Payment extends AbstractResponse implements Node { - public Payment() { + public static class ProductPriceRange extends AbstractResponse { + public ProductPriceRange() { } - public Payment(JsonObject fields) throws SchemaViolationError { + public ProductPriceRange(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "amount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "amountV2": { + case "maxVariantPrice": { responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - break; - } - - case "billingAddress": { - MailingAddress optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "checkout": { - responseData.put(key, new Checkout(jsonAsObject(field.getValue(), key))); - - break; - } - - case "creditCard": { - CreditCard optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CreditCard(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "errorMessage": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - - break; - } - - case "idempotencyKey": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "nextActionUrl": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "ready": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "test": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "transaction": { - Transaction optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Transaction(jsonAsObject(field.getValue(), key)); - } + break; + } - responseData.put(key, optional1); + case "minVariantPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } @@ -57405,1073 +54458,1251 @@ public Payment(JsonObject fields) throws SchemaViolationError { } } - public Payment(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "Payment"; + return "ProductPriceRange"; } /** - * The amount of the payment. + * The highest variant's price. */ - public MoneyV2 getAmount() { - return (MoneyV2) get("amount"); + public MoneyV2 getMaxVariantPrice() { + return (MoneyV2) get("maxVariantPrice"); } - public Payment setAmount(MoneyV2 arg) { - optimisticData.put(getKey("amount"), arg); + public ProductPriceRange setMaxVariantPrice(MoneyV2 arg) { + optimisticData.put(getKey("maxVariantPrice"), arg); return this; } /** - * The amount of the payment. - * - * @deprecated Use `amount` instead. + * The lowest variant's price. */ - public MoneyV2 getAmountV2() { - return (MoneyV2) get("amountV2"); + public MoneyV2 getMinVariantPrice() { + return (MoneyV2) get("minVariantPrice"); } - public Payment setAmountV2(MoneyV2 arg) { - optimisticData.put(getKey("amountV2"), arg); + public ProductPriceRange setMinVariantPrice(MoneyV2 arg) { + optimisticData.put(getKey("minVariantPrice"), arg); return this; } - /** - * The billing address for the payment. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "maxVariantPrice": return true; - public MailingAddress getBillingAddress() { - return (MailingAddress) get("billingAddress"); - } + case "minVariantPrice": return true; - public Payment setBillingAddress(MailingAddress arg) { - optimisticData.put(getKey("billingAddress"), arg); - return this; + default: return false; + } } + } + /** + * The recommendation intent that is used to generate product recommendations. + * You can use intent to generate product recommendations according to different strategies. + */ + public enum ProductRecommendationIntent { /** - * The checkout to which the payment belongs. + * Offer customers products that are complementary to a product for which recommendations are to be + * fetched. An example is add-on products that display in a Pair it with section. */ - - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } - - public Payment setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; - } + COMPLEMENTARY, /** - * The credit card used for the payment in the case of direct payments. + * Offer customers a mix of products that are similar or complementary to a product for which + * recommendations are to be fetched. An example is substitutable products that display in a You may + * also like section. */ + RELATED, - public CreditCard getCreditCard() { - return (CreditCard) get("creditCard"); - } + UNKNOWN_VALUE; - public Payment setCreditCard(CreditCard arg) { - optimisticData.put(getKey("creditCard"), arg); - return this; - } + public static ProductRecommendationIntent fromGraphQl(String value) { + if (value == null) { + return null; + } - /** - * A message describing a processing error during asynchronous processing. - */ + switch (value) { + case "COMPLEMENTARY": { + return COMPLEMENTARY; + } + + case "RELATED": { + return RELATED; + } - public String getErrorMessage() { - return (String) get("errorMessage"); + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case COMPLEMENTARY: { + return "COMPLEMENTARY"; + } - public Payment setErrorMessage(String arg) { - optimisticData.put(getKey("errorMessage"), arg); - return this; + case RELATED: { + return "RELATED"; + } + + default: { + return ""; + } + } } + } + /** + * The set of valid sort keys for the Product query. + */ + public enum ProductSortKeys { /** - * A globally-unique ID. + * Sort by the `best_selling` value. */ + BEST_SELLING, - public ID getId() { - return (ID) get("id"); - } + /** + * Sort by the `created_at` value. + */ + CREATED_AT, /** - * 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). + * Sort by the `id` value. */ + ID, - public String getIdempotencyKey() { - return (String) get("idempotencyKey"); - } + /** + * Sort by the `price` value. + */ + PRICE, - public Payment setIdempotencyKey(String arg) { - optimisticData.put(getKey("idempotencyKey"), arg); - return this; - } + /** + * Sort by the `product_type` value. + */ + PRODUCT_TYPE, /** - * The URL where the customer needs to be redirected so they can complete the 3D Secure payment flow. + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. */ + RELEVANCE, - public String getNextActionUrl() { - return (String) get("nextActionUrl"); - } + /** + * Sort by the `title` value. + */ + TITLE, - public Payment setNextActionUrl(String arg) { - optimisticData.put(getKey("nextActionUrl"), arg); - return this; - } + /** + * Sort by the `updated_at` value. + */ + UPDATED_AT, /** - * Whether the payment is still processing asynchronously. + * Sort by the `vendor` value. */ + VENDOR, - public Boolean getReady() { - return (Boolean) get("ready"); - } + UNKNOWN_VALUE; - public Payment setReady(Boolean arg) { - optimisticData.put(getKey("ready"), arg); - return this; - } + public static ProductSortKeys fromGraphQl(String value) { + if (value == null) { + return null; + } - /** - * A flag to indicate if the payment is to be done in test mode for gateways that support it. - */ + switch (value) { + case "BEST_SELLING": { + return BEST_SELLING; + } - public Boolean getTest() { - return (Boolean) get("test"); - } + case "CREATED_AT": { + return CREATED_AT; + } - public Payment setTest(Boolean arg) { - optimisticData.put(getKey("test"), arg); - return this; - } + case "ID": { + return ID; + } - /** - * The actual transaction recorded by Shopify after having processed the payment with the gateway. - */ + case "PRICE": { + return PRICE; + } - public Transaction getTransaction() { - return (Transaction) get("transaction"); - } + case "PRODUCT_TYPE": { + return PRODUCT_TYPE; + } - public Payment setTransaction(Transaction arg) { - optimisticData.put(getKey("transaction"), arg); - return this; - } + case "RELEVANCE": { + return RELEVANCE; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "amount": return true; + case "TITLE": { + return TITLE; + } - case "amountV2": return true; + case "UPDATED_AT": { + return UPDATED_AT; + } - case "billingAddress": return true; + case "VENDOR": { + return VENDOR; + } - case "checkout": return true; + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case BEST_SELLING: { + return "BEST_SELLING"; + } - case "creditCard": return true; + case CREATED_AT: { + return "CREATED_AT"; + } - case "errorMessage": return false; + case ID: { + return "ID"; + } - case "id": return false; + case PRICE: { + return "PRICE"; + } - case "idempotencyKey": return false; + case PRODUCT_TYPE: { + return "PRODUCT_TYPE"; + } - case "nextActionUrl": return false; + case RELEVANCE: { + return "RELEVANCE"; + } - case "ready": return false; + case TITLE: { + return "TITLE"; + } - case "test": return false; + case UPDATED_AT: { + return "UPDATED_AT"; + } - case "transaction": return true; + case VENDOR: { + return "VENDOR"; + } - default: return false; + default: { + return ""; + } } } } - public interface PaymentSettingsQueryDefinition { - void define(PaymentSettingsQuery _queryBuilder); + public interface ProductVariantQueryDefinition { + void define(ProductVariantQuery _queryBuilder); } /** - * Settings related to payments. + * A product variant represents a different version of a product, such as differing sizes or differing + * colors. */ - public static class PaymentSettingsQuery extends Query { - PaymentSettingsQuery(StringBuilder _queryBuilder) { + public static class ProductVariantQuery extends Query { + ProductVariantQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * List of the card brands which the shop accepts. + * Indicates if the product variant is available for sale. */ - public PaymentSettingsQuery acceptedCardBrands() { - startField("acceptedCardBrands"); + public ProductVariantQuery availableForSale() { + startField("availableForSale"); return this; } /** - * The url pointing to the endpoint to vault credit cards. + * The barcode (for example, ISBN, UPC, or GTIN) associated with the variant. */ - public PaymentSettingsQuery cardVaultUrl() { - startField("cardVaultUrl"); + public ProductVariantQuery barcode() { + startField("barcode"); return this; } /** - * The country where the shop is located. + * The compare at price of the variant. This can be used to mark a variant as on sale, when + * `compareAtPrice` is higher than `price`. */ - public PaymentSettingsQuery countryCode() { - startField("countryCode"); + public ProductVariantQuery compareAtPrice(MoneyV2QueryDefinition queryDef) { + startField("compareAtPrice"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The three-letter code for the shop's primary currency. + * The compare at price of the variant. This can be used to mark a variant as on sale, when + * `compareAtPriceV2` is higher than `priceV2`. + * + * @deprecated Use `compareAtPrice` instead. */ - public PaymentSettingsQuery currencyCode() { - startField("currencyCode"); + @Deprecated + public ProductVariantQuery compareAtPriceV2(MoneyV2QueryDefinition queryDef) { + startField("compareAtPriceV2"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } + public class ComponentsArguments extends Arguments { + ComponentsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * Returns up to the first `n` elements from the list. + */ + public ComponentsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come after the specified cursor. + */ + public ComponentsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Returns up to the last `n` elements from the list. + */ + public ComponentsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come before the specified cursor. + */ + public ComponentsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + } + + public interface ComponentsArgumentsDefinition { + void define(ComponentsArguments args); + } + /** - * A list of enabled currencies (ISO 4217 format) that the shop accepts. - * Merchants can enable currencies from their Shopify Payments settings in the Shopify admin. + * List of bundles components included in the variant considering only fixed bundles. */ - public PaymentSettingsQuery enabledPresentmentCurrencies() { - startField("enabledPresentmentCurrencies"); - - return this; + public ProductVariantQuery components(ProductVariantComponentConnectionQueryDefinition queryDef) { + return components(args -> {}, queryDef); } /** - * The shop’s Shopify Payments account ID. + * List of bundles components included in the variant considering only fixed bundles. */ - public PaymentSettingsQuery shopifyPaymentsAccountId() { - startField("shopifyPaymentsAccountId"); + public ProductVariantQuery components(ComponentsArgumentsDefinition argsDef, ProductVariantComponentConnectionQueryDefinition queryDef) { + startField("components"); + + ComponentsArguments args = new ComponentsArguments(_queryBuilder); + argsDef.define(args); + ComponentsArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new ProductVariantComponentConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * List of the digital wallets which the shop supports. + * Whether a product is out of stock but still available for purchase (used for backorders). */ - public PaymentSettingsQuery supportedDigitalWallets() { - startField("supportedDigitalWallets"); + public ProductVariantQuery currentlyNotInStock() { + startField("currentlyNotInStock"); return this; } - } - - /** - * Settings related to payments. - */ - public static class PaymentSettings extends AbstractResponse { - public PaymentSettings() { - } - - public PaymentSettings(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "acceptedCardBrands": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(CardBrand.fromGraphQl(jsonAsString(element1, key))); - } - - responseData.put(key, list1); - - break; - } - case "cardVaultUrl": { - responseData.put(key, jsonAsString(field.getValue(), key)); + public class GroupedByArguments extends Arguments { + GroupedByArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - break; - } + /** + * Returns up to the first `n` elements from the list. + */ + public GroupedByArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - case "countryCode": { - responseData.put(key, CountryCode.fromGraphQl(jsonAsString(field.getValue(), key))); + /** + * Returns the elements that come after the specified cursor. + */ + public GroupedByArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - break; - } + /** + * Returns up to the last `n` elements from the list. + */ + public GroupedByArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - case "currencyCode": { - responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); + /** + * Returns the elements that come before the specified cursor. + */ + public GroupedByArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + } - break; - } + public interface GroupedByArgumentsDefinition { + void define(GroupedByArguments args); + } - case "enabledPresentmentCurrencies": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(CurrencyCode.fromGraphQl(jsonAsString(element1, key))); - } + /** + * List of bundles that include this variant considering only fixed bundles. + */ + public ProductVariantQuery groupedBy(ProductVariantConnectionQueryDefinition queryDef) { + return groupedBy(args -> {}, queryDef); + } - responseData.put(key, list1); + /** + * List of bundles that include this variant considering only fixed bundles. + */ + public ProductVariantQuery groupedBy(GroupedByArgumentsDefinition argsDef, ProductVariantConnectionQueryDefinition queryDef) { + startField("groupedBy"); - break; - } + GroupedByArguments args = new GroupedByArguments(_queryBuilder); + argsDef.define(args); + GroupedByArguments.end(args); - case "shopifyPaymentsAccountId": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + _queryBuilder.append('{'); + queryDef.define(new ProductVariantConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - responseData.put(key, optional1); + return this; + } - break; - } + /** + * Image associated with the product variant. This field falls back to the product image if no image is + * available. + */ + public ProductVariantQuery image(ImageQueryDefinition queryDef) { + startField("image"); - case "supportedDigitalWallets": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(DigitalWallet.fromGraphQl(jsonAsString(element1, key))); - } + _queryBuilder.append('{'); + queryDef.define(new ImageQuery(_queryBuilder)); + _queryBuilder.append('}'); - responseData.put(key, list1); + return this; + } - break; - } + public class MetafieldArguments extends Arguments { + MetafieldArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + /** + * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. + */ + public MetafieldArguments namespace(String value) { + if (value != null) { + startArgument("namespace"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } } - public String getGraphQlTypeName() { - return "PaymentSettings"; + public interface MetafieldArgumentsDefinition { + void define(MetafieldArguments args); } /** - * List of the card brands which the shop accepts. + * Returns a metafield found by namespace and key. */ - - public List getAcceptedCardBrands() { - return (List) get("acceptedCardBrands"); - } - - public PaymentSettings setAcceptedCardBrands(List arg) { - optimisticData.put(getKey("acceptedCardBrands"), arg); - return this; + public ProductVariantQuery metafield(String key, MetafieldQueryDefinition queryDef) { + return metafield(key, args -> {}, queryDef); } /** - * The url pointing to the endpoint to vault credit cards. + * Returns a metafield found by namespace and key. */ + public ProductVariantQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { + startField("metafield"); - public String getCardVaultUrl() { - return (String) get("cardVaultUrl"); - } + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + argsDef.define(new MetafieldArguments(_queryBuilder)); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - public PaymentSettings setCardVaultUrl(String arg) { - optimisticData.put(getKey("cardVaultUrl"), arg); return this; } /** - * The country where the shop is located. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ + public ProductVariantQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); - public CountryCode getCountryCode() { - return (CountryCode) get("countryCode"); - } + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - public PaymentSettings setCountryCode(CountryCode arg) { - optimisticData.put(getKey("countryCode"), arg); return this; } /** - * The three-letter code for the shop's primary currency. + * The product variant’s price. */ + public ProductVariantQuery price(MoneyV2QueryDefinition queryDef) { + startField("price"); - public CurrencyCode getCurrencyCode() { - return (CurrencyCode) get("currencyCode"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public PaymentSettings setCurrencyCode(CurrencyCode arg) { - optimisticData.put(getKey("currencyCode"), arg); return this; } /** - * A list of enabled currencies (ISO 4217 format) that the shop accepts. - * Merchants can enable currencies from their Shopify Payments settings in the Shopify admin. + * The product variant’s price. + * + * @deprecated Use `price` instead. */ + @Deprecated + public ProductVariantQuery priceV2(MoneyV2QueryDefinition queryDef) { + startField("priceV2"); - public List getEnabledPresentmentCurrencies() { - return (List) get("enabledPresentmentCurrencies"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public PaymentSettings setEnabledPresentmentCurrencies(List arg) { - optimisticData.put(getKey("enabledPresentmentCurrencies"), arg); return this; } /** - * The shop’s Shopify Payments account ID. + * The product object that the product variant belongs to. */ + public ProductVariantQuery product(ProductQueryDefinition queryDef) { + startField("product"); - public String getShopifyPaymentsAccountId() { - return (String) get("shopifyPaymentsAccountId"); - } + _queryBuilder.append('{'); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); - public PaymentSettings setShopifyPaymentsAccountId(String arg) { - optimisticData.put(getKey("shopifyPaymentsAccountId"), arg); return this; } /** - * List of the digital wallets which the shop supports. + * The total sellable quantity of the variant for online sales channels. */ + public ProductVariantQuery quantityAvailable() { + startField("quantityAvailable"); - public List getSupportedDigitalWallets() { - return (List) get("supportedDigitalWallets"); - } - - public PaymentSettings setSupportedDigitalWallets(List arg) { - optimisticData.put(getKey("supportedDigitalWallets"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "acceptedCardBrands": return false; - - case "cardVaultUrl": return false; - - case "countryCode": return false; - - case "currencyCode": return false; + public class QuantityPriceBreaksArguments extends Arguments { + QuantityPriceBreaksArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "enabledPresentmentCurrencies": return false; + /** + * Returns up to the first `n` elements from the list. + */ + public QuantityPriceBreaksArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - case "shopifyPaymentsAccountId": return false; + /** + * Returns the elements that come after the specified cursor. + */ + public QuantityPriceBreaksArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "supportedDigitalWallets": return false; + /** + * Returns up to the last `n` elements from the list. + */ + public QuantityPriceBreaksArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - default: return false; + /** + * Returns the elements that come before the specified cursor. + */ + public QuantityPriceBreaksArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; } } - } - /** - * The valid values for the types of payment token. - */ - public enum PaymentTokenType { + public interface QuantityPriceBreaksArgumentsDefinition { + void define(QuantityPriceBreaksArguments args); + } + /** - * Apple Pay token type. + * A list of quantity breaks for the product variant. */ - APPLE_PAY, + public ProductVariantQuery quantityPriceBreaks(QuantityPriceBreakConnectionQueryDefinition queryDef) { + return quantityPriceBreaks(args -> {}, queryDef); + } /** - * Google Pay token type. + * A list of quantity breaks for the product variant. */ - GOOGLE_PAY, + public ProductVariantQuery quantityPriceBreaks(QuantityPriceBreaksArgumentsDefinition argsDef, QuantityPriceBreakConnectionQueryDefinition queryDef) { + startField("quantityPriceBreaks"); + + QuantityPriceBreaksArguments args = new QuantityPriceBreaksArguments(_queryBuilder); + argsDef.define(args); + QuantityPriceBreaksArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new QuantityPriceBreakConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } /** - * Shopify Pay token type. + * The quantity rule for the product variant in a given context. */ - SHOPIFY_PAY, + public ProductVariantQuery quantityRule(QuantityRuleQueryDefinition queryDef) { + startField("quantityRule"); + + _queryBuilder.append('{'); + queryDef.define(new QuantityRuleQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } /** - * Stripe token type. + * 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. */ - STRIPE_VAULT_TOKEN, + public ProductVariantQuery requiresComponents() { + startField("requiresComponents"); + + return this; + } /** - * Vault payment token type. + * Whether a customer needs to provide a shipping address when placing an order for the product + * variant. */ - VAULT, - - UNKNOWN_VALUE; + public ProductVariantQuery requiresShipping() { + startField("requiresShipping"); - public static PaymentTokenType fromGraphQl(String value) { - if (value == null) { - return null; - } + return this; + } - switch (value) { - case "APPLE_PAY": { - return APPLE_PAY; - } + /** + * List of product options applied to the variant. + */ + public ProductVariantQuery selectedOptions(SelectedOptionQueryDefinition queryDef) { + startField("selectedOptions"); - case "GOOGLE_PAY": { - return GOOGLE_PAY; - } + _queryBuilder.append('{'); + queryDef.define(new SelectedOptionQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "SHOPIFY_PAY": { - return SHOPIFY_PAY; - } + return this; + } - case "STRIPE_VAULT_TOKEN": { - return STRIPE_VAULT_TOKEN; - } + public class SellingPlanAllocationsArguments extends Arguments { + SellingPlanAllocationsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "VAULT": { - return VAULT; + /** + * Returns up to the first `n` elements from the list. + */ + public SellingPlanAllocationsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); } + return this; + } - default: { - return UNKNOWN_VALUE; + /** + * Returns the elements that come after the specified cursor. + */ + public SellingPlanAllocationsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } - } - public String toString() { - switch (this) { - case APPLE_PAY: { - return "APPLE_PAY"; - } - case GOOGLE_PAY: { - return "GOOGLE_PAY"; + /** + * Returns up to the last `n` elements from the list. + */ + public SellingPlanAllocationsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); } + return this; + } - case SHOPIFY_PAY: { - return "SHOPIFY_PAY"; + /** + * Returns the elements that come before the specified cursor. + */ + public SellingPlanAllocationsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - case STRIPE_VAULT_TOKEN: { - return "STRIPE_VAULT_TOKEN"; + /** + * Reverse the order of the underlying list. + */ + public SellingPlanAllocationsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; + } + } - case VAULT: { - return "VAULT"; - } + public interface SellingPlanAllocationsArgumentsDefinition { + void define(SellingPlanAllocationsArguments args); + } - default: { - return ""; - } - } + /** + * Represents an association between a variant and a selling plan. Selling plan allocations describe + * which selling plans are available for each variant, and what their impact is on pricing. + */ + public ProductVariantQuery sellingPlanAllocations(SellingPlanAllocationConnectionQueryDefinition queryDef) { + return sellingPlanAllocations(args -> {}, queryDef); } - } - /** - * Decides the distribution of results. - */ - public enum PredictiveSearchLimitScope { /** - * Return results up to limit across all types. + * Represents an association between a variant and a selling plan. Selling plan allocations describe + * which selling plans are available for each variant, and what their impact is on pricing. */ - ALL, + public ProductVariantQuery sellingPlanAllocations(SellingPlanAllocationsArgumentsDefinition argsDef, SellingPlanAllocationConnectionQueryDefinition queryDef) { + startField("sellingPlanAllocations"); + + SellingPlanAllocationsArguments args = new SellingPlanAllocationsArguments(_queryBuilder); + argsDef.define(args); + SellingPlanAllocationsArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new SellingPlanAllocationConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } /** - * Return results up to limit per type. + * The SKU (stock keeping unit) associated with the variant. */ - EACH, + public ProductVariantQuery sku() { + startField("sku"); - UNKNOWN_VALUE; + return this; + } - public static PredictiveSearchLimitScope fromGraphQl(String value) { - if (value == null) { - return null; + public class StoreAvailabilityArguments extends Arguments { + StoreAvailabilityArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); } - switch (value) { - case "ALL": { - return ALL; + /** + * Used to sort results based on proximity to the provided location. + */ + public StoreAvailabilityArguments near(GeoCoordinateInput value) { + if (value != null) { + startArgument("near"); + value.appendTo(_queryBuilder); } + return this; + } - case "EACH": { - return EACH; + /** + * Returns up to the first `n` elements from the list. + */ + public StoreAvailabilityArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); } + return this; + } - default: { - return UNKNOWN_VALUE; + /** + * Returns the elements that come after the specified cursor. + */ + public StoreAvailabilityArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } - } - public String toString() { - switch (this) { - case ALL: { - return "ALL"; + + /** + * Returns up to the last `n` elements from the list. + */ + public StoreAvailabilityArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); } + return this; + } - case EACH: { - return "EACH"; + /** + * Returns the elements that come before the specified cursor. + */ + public StoreAvailabilityArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - default: { - return ""; + /** + * Reverse the order of the underlying list. + */ + public StoreAvailabilityArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; } } - } - public interface PredictiveSearchResultQueryDefinition { - void define(PredictiveSearchResultQuery _queryBuilder); - } + public interface StoreAvailabilityArgumentsDefinition { + void define(StoreAvailabilityArguments args); + } - /** - * A predictive search result represents a list of products, collections, pages, articles, and query - * suggestions - * that matches the predictive search query. - */ - public static class PredictiveSearchResultQuery extends Query { - PredictiveSearchResultQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + /** + * The in-store pickup availability of this variant by location. + */ + public ProductVariantQuery storeAvailability(StoreAvailabilityConnectionQueryDefinition queryDef) { + return storeAvailability(args -> {}, queryDef); } /** - * The articles that match the search query. + * The in-store pickup availability of this variant by location. */ - public PredictiveSearchResultQuery articles(ArticleQueryDefinition queryDef) { - startField("articles"); + public ProductVariantQuery storeAvailability(StoreAvailabilityArgumentsDefinition argsDef, StoreAvailabilityConnectionQueryDefinition queryDef) { + startField("storeAvailability"); + + StoreAvailabilityArguments args = new StoreAvailabilityArguments(_queryBuilder); + argsDef.define(args); + StoreAvailabilityArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new ArticleQuery(_queryBuilder)); + queryDef.define(new StoreAvailabilityConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The articles that match the search query. + * Whether tax is charged when the product variant is sold. */ - public PredictiveSearchResultQuery collections(CollectionQueryDefinition queryDef) { - startField("collections"); + public ProductVariantQuery taxable() { + startField("taxable"); - _queryBuilder.append('{'); - queryDef.define(new CollectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * The product variant’s title. + */ + public ProductVariantQuery title() { + startField("title"); return this; } /** - * The pages that match the search query. + * The unit price value for the variant based on the variant's measurement. */ - public PredictiveSearchResultQuery pages(PageQueryDefinition queryDef) { - startField("pages"); + public ProductVariantQuery unitPrice(MoneyV2QueryDefinition queryDef) { + startField("unitPrice"); _queryBuilder.append('{'); - queryDef.define(new PageQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The products that match the search query. + * The unit price measurement for the variant. */ - public PredictiveSearchResultQuery products(ProductQueryDefinition queryDef) { - startField("products"); + public ProductVariantQuery unitPriceMeasurement(UnitPriceMeasurementQueryDefinition queryDef) { + startField("unitPriceMeasurement"); _queryBuilder.append('{'); - queryDef.define(new ProductQuery(_queryBuilder)); + queryDef.define(new UnitPriceMeasurementQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The query suggestions that are relevant to the search query. + * The weight of the product variant in the unit system specified with `weight_unit`. */ - public PredictiveSearchResultQuery queries(SearchQuerySuggestionQueryDefinition queryDef) { - startField("queries"); + public ProductVariantQuery weight() { + startField("weight"); - _queryBuilder.append('{'); - queryDef.define(new SearchQuerySuggestionQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * Unit of measurement for weight. + */ + public ProductVariantQuery weightUnit() { + startField("weightUnit"); return this; } } /** - * A predictive search result represents a list of products, collections, pages, articles, and query - * suggestions - * that matches the predictive search query. + * A product variant represents a different version of a product, such as differing sizes or differing + * colors. */ - public static class PredictiveSearchResult extends AbstractResponse { - public PredictiveSearchResult() { + public static class ProductVariant extends AbstractResponse implements HasMetafields, Merchandise, MetafieldParentResource, MetafieldReference, Node { + public ProductVariant() { } - public PredictiveSearchResult(JsonObject fields) throws SchemaViolationError { + public ProductVariant(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "articles": { - List
list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Article(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "collections": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Collection(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "availableForSale": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } - case "pages": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Page(jsonAsObject(element1, key))); + case "barcode": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "products": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Product(jsonAsObject(element1, key))); + case "compareAtPrice": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "queries": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SearchQuerySuggestion(jsonAsObject(element1, key))); + case "compareAtPriceV2": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "components": { + responseData.put(key, new ProductVariantComponentConnection(jsonAsObject(field.getValue(), key))); + break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "PredictiveSearchResult"; - } - - /** - * The articles that match the search query. - */ - - public List
getArticles() { - return (List
) get("articles"); - } - public PredictiveSearchResult setArticles(List
arg) { - optimisticData.put(getKey("articles"), arg); - return this; - } + case "currentlyNotInStock": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - /** - * The articles that match the search query. - */ + break; + } - public List getCollections() { - return (List) get("collections"); - } + case "groupedBy": { + responseData.put(key, new ProductVariantConnection(jsonAsObject(field.getValue(), key))); - public PredictiveSearchResult setCollections(List arg) { - optimisticData.put(getKey("collections"), arg); - return this; - } + break; + } - /** - * The pages that match the search query. - */ + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - public List getPages() { - return (List) get("pages"); - } + break; + } - public PredictiveSearchResult setPages(List arg) { - optimisticData.put(getKey("pages"), arg); - return this; - } + case "image": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); + } - /** - * The products that match the search query. - */ + responseData.put(key, optional1); - public List getProducts() { - return (List) get("products"); - } + break; + } - public PredictiveSearchResult setProducts(List arg) { - optimisticData.put(getKey("products"), arg); - return this; - } + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } - /** - * The query suggestions that are relevant to the search query. - */ + responseData.put(key, optional1); - public List getQueries() { - return (List) get("queries"); - } + break; + } - public PredictiveSearchResult setQueries(List arg) { - optimisticData.put(getKey("queries"), arg); - return this; - } + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "articles": return true; + list1.add(optional2); + } - case "collections": return true; + responseData.put(key, list1); - case "pages": return true; + break; + } - case "products": return true; + case "price": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - case "queries": return true; + break; + } - default: return false; - } - } - } + case "priceV2": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - /** - * The types of search items to perform predictive search on. - */ - public enum PredictiveSearchType { - /** - * Returns matching articles. - */ - ARTICLE, + break; + } - /** - * Returns matching collections. - */ - COLLECTION, + case "product": { + responseData.put(key, new Product(jsonAsObject(field.getValue(), key))); - /** - * Returns matching pages. - */ - PAGE, + break; + } - /** - * Returns matching products. - */ - PRODUCT, + case "quantityAvailable": { + Integer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsInteger(field.getValue(), key); + } - /** - * Returns matching query strings. - */ - QUERY, + responseData.put(key, optional1); - UNKNOWN_VALUE; + break; + } - public static PredictiveSearchType fromGraphQl(String value) { - if (value == null) { - return null; - } + case "quantityPriceBreaks": { + responseData.put(key, new QuantityPriceBreakConnection(jsonAsObject(field.getValue(), key))); - switch (value) { - case "ARTICLE": { - return ARTICLE; - } + break; + } - case "COLLECTION": { - return COLLECTION; - } + case "quantityRule": { + responseData.put(key, new QuantityRule(jsonAsObject(field.getValue(), key))); - case "PAGE": { - return PAGE; - } + break; + } - case "PRODUCT": { - return PRODUCT; - } + case "requiresComponents": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - case "QUERY": { - return QUERY; - } + break; + } - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case ARTICLE: { - return "ARTICLE"; - } + case "requiresShipping": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - case COLLECTION: { - return "COLLECTION"; - } + break; + } - case PAGE: { - return "PAGE"; - } + case "selectedOptions": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SelectedOption(jsonAsObject(element1, key))); + } - case PRODUCT: { - return "PRODUCT"; - } + responseData.put(key, list1); - case QUERY: { - return "QUERY"; - } + break; + } - default: { - return ""; - } - } - } - } + case "sellingPlanAllocations": { + responseData.put(key, new SellingPlanAllocationConnection(jsonAsObject(field.getValue(), key))); - public static class PriceRangeFilter implements Serializable { - private Input min = Input.undefined(); + break; + } - private Input max = Input.undefined(); + case "sku": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - public Double getMin() { - return min.getValue(); - } + responseData.put(key, optional1); - public Input getMinInput() { - return min; - } + break; + } - public PriceRangeFilter setMin(Double min) { - this.min = Input.optional(min); - return this; - } + case "storeAvailability": { + responseData.put(key, new StoreAvailabilityConnection(jsonAsObject(field.getValue(), key))); - public PriceRangeFilter setMinInput(Input min) { - if (min == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.min = min; - return this; - } + break; + } - public Double getMax() { - return max.getValue(); - } + case "taxable": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - public Input getMaxInput() { - return max; - } + break; + } - public PriceRangeFilter setMax(Double max) { - this.max = Input.optional(max); - return this; - } + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); - public PriceRangeFilter setMaxInput(Input max) { - if (max == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.max = max; - return this; - } + break; + } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + case "unitPrice": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } - if (this.min.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("min:"); - if (min.getValue() != null) { - _queryBuilder.append(min.getValue()); - } else { - _queryBuilder.append("null"); - } - } + responseData.put(key, optional1); - if (this.max.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("max:"); - if (max.getValue() != null) { - _queryBuilder.append(max.getValue()); - } else { - _queryBuilder.append("null"); - } - } + break; + } - _queryBuilder.append('}'); - } - } + case "unitPriceMeasurement": { + UnitPriceMeasurement optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new UnitPriceMeasurement(jsonAsObject(field.getValue(), key)); + } - public interface PricingPercentageValueQueryDefinition { - void define(PricingPercentageValueQuery _queryBuilder); - } + responseData.put(key, optional1); - /** - * The value of the percentage pricing object. - */ - public static class PricingPercentageValueQuery extends Query { - PricingPercentageValueQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + break; + } - /** - * The percentage value of the object. - */ - public PricingPercentageValueQuery percentage() { - startField("percentage"); + case "weight": { + Double optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsDouble(field.getValue(), key); + } - return this; - } - } + responseData.put(key, optional1); - /** - * The value of the percentage pricing object. - */ - public static class PricingPercentageValue extends AbstractResponse implements PricingValue { - public PricingPercentageValue() { - } + break; + } - public PricingPercentageValue(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "percentage": { - responseData.put(key, jsonAsDouble(field.getValue(), key)); + case "weightUnit": { + responseData.put(key, WeightUnit.fromGraphQl(jsonAsString(field.getValue(), key))); break; } @@ -58487,1272 +55718,1279 @@ public PricingPercentageValue(JsonObject fields) throws SchemaViolationError { } } + public ProductVariant(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "PricingPercentageValue"; + return "ProductVariant"; } /** - * The percentage value of the object. + * Indicates if the product variant is available for sale. */ - public Double getPercentage() { - return (Double) get("percentage"); + public Boolean getAvailableForSale() { + return (Boolean) get("availableForSale"); } - public PricingPercentageValue setPercentage(Double arg) { - optimisticData.put(getKey("percentage"), arg); + public ProductVariant setAvailableForSale(Boolean arg) { + optimisticData.put(getKey("availableForSale"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "percentage": return false; + /** + * The barcode (for example, ISBN, UPC, or GTIN) associated with the variant. + */ - default: return false; - } + public String getBarcode() { + return (String) get("barcode"); } - } - public interface PricingValueQueryDefinition { - void define(PricingValueQuery _queryBuilder); - } + public ProductVariant setBarcode(String arg) { + optimisticData.put(getKey("barcode"), arg); + return this; + } - /** - * The price value (fixed or percentage) for a discount application. - */ - public static class PricingValueQuery extends Query { - PricingValueQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + /** + * The compare at price of the variant. This can be used to mark a variant as on sale, when + * `compareAtPrice` is higher than `price`. + */ - startField("__typename"); + public MoneyV2 getCompareAtPrice() { + return (MoneyV2) get("compareAtPrice"); } - public PricingValueQuery onMoneyV2(MoneyV2QueryDefinition queryDef) { - startInlineFragment("MoneyV2"); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public ProductVariant setCompareAtPrice(MoneyV2 arg) { + optimisticData.put(getKey("compareAtPrice"), arg); return this; } - public PricingValueQuery onPricingPercentageValue(PricingPercentageValueQueryDefinition queryDef) { - startInlineFragment("PricingPercentageValue"); - queryDef.define(new PricingPercentageValueQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The compare at price of the variant. This can be used to mark a variant as on sale, when + * `compareAtPriceV2` is higher than `priceV2`. + * + * @deprecated Use `compareAtPrice` instead. + */ + + public MoneyV2 getCompareAtPriceV2() { + return (MoneyV2) get("compareAtPriceV2"); + } + + public ProductVariant setCompareAtPriceV2(MoneyV2 arg) { + optimisticData.put(getKey("compareAtPriceV2"), arg); return this; } - } - public interface PricingValue { - String getGraphQlTypeName(); - } + /** + * List of bundles components included in the variant considering only fixed bundles. + */ - /** - * The price value (fixed or percentage) for a discount application. - */ - public static class UnknownPricingValue extends AbstractResponse implements PricingValue { - public UnknownPricingValue() { + public ProductVariantComponentConnection getComponents() { + return (ProductVariantComponentConnection) get("components"); } - public UnknownPricingValue(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public ProductVariant setComponents(ProductVariantComponentConnection arg) { + optimisticData.put(getKey("components"), arg); + return this; } - public static PricingValue create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "MoneyV2": { - return new MoneyV2(fields); - } + /** + * Whether a product is out of stock but still available for purchase (used for backorders). + */ - case "PricingPercentageValue": { - return new PricingPercentageValue(fields); - } + public Boolean getCurrentlyNotInStock() { + return (Boolean) get("currentlyNotInStock"); + } + + public ProductVariant setCurrentlyNotInStock(Boolean arg) { + optimisticData.put(getKey("currentlyNotInStock"), arg); + return this; + } - default: { - return new UnknownPricingValue(fields); - } - } + /** + * List of bundles that include this variant considering only fixed bundles. + */ + + public ProductVariantConnection getGroupedBy() { + return (ProductVariantConnection) get("groupedBy"); } - public String getGraphQlTypeName() { - return (String) get("__typename"); + public ProductVariant setGroupedBy(ProductVariantConnection arg) { + optimisticData.put(getKey("groupedBy"), arg); + return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - default: return false; - } + /** + * A globally-unique ID. + */ + + public ID getId() { + return (ID) get("id"); } - } - public interface ProductQueryDefinition { - void define(ProductQuery _queryBuilder); - } + /** + * Image associated with the product variant. This field falls back to the product image if no image is + * available. + */ - /** - * A product represents an individual item for sale in a Shopify store. Products are often physical, - * but they don't have to be. - * For example, a digital download (such as a movie, music or ebook file) also - * qualifies as a product, as do services (such as equipment rental, work for hire, - * customization of another product or an extended warranty). - */ - public static class ProductQuery extends Query { - ProductQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public Image getImage() { + return (Image) get("image"); + } - startField("id"); + public ProductVariant setImage(Image arg) { + optimisticData.put(getKey("image"), arg); + return this; } /** - * Indicates if at least one product variant is available for sale. + * Returns a metafield found by namespace and key. */ - public ProductQuery availableForSale() { - startField("availableForSale"); - return this; + public Metafield getMetafield() { + return (Metafield) get("metafield"); } - public class CollectionsArguments extends Arguments { - CollectionsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + public ProductVariant setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); + return this; + } - /** - * Returns up to the first `n` elements from the list. - */ - public CollectionsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ - /** - * Returns the elements that come after the specified cursor. - */ - public CollectionsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public List getMetafields() { + return (List) get("metafields"); + } - /** - * Returns up to the last `n` elements from the list. - */ - public CollectionsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + public ProductVariant setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); + return this; + } - /** - * Returns the elements that come before the specified cursor. - */ - public CollectionsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + /** + * The product variant’s price. + */ - /** - * Reverse the order of the underlying list. - */ - public CollectionsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + public MoneyV2 getPrice() { + return (MoneyV2) get("price"); } - public interface CollectionsArgumentsDefinition { - void define(CollectionsArguments args); + public ProductVariant setPrice(MoneyV2 arg) { + optimisticData.put(getKey("price"), arg); + return this; } /** - * List of collections a product belongs to. + * The product variant’s price. + * + * @deprecated Use `price` instead. */ - public ProductQuery collections(CollectionConnectionQueryDefinition queryDef) { - return collections(args -> {}, queryDef); + + public MoneyV2 getPriceV2() { + return (MoneyV2) get("priceV2"); + } + + public ProductVariant setPriceV2(MoneyV2 arg) { + optimisticData.put(getKey("priceV2"), arg); + return this; } /** - * List of collections a product belongs to. + * The product object that the product variant belongs to. */ - public ProductQuery collections(CollectionsArgumentsDefinition argsDef, CollectionConnectionQueryDefinition queryDef) { - startField("collections"); - - CollectionsArguments args = new CollectionsArguments(_queryBuilder); - argsDef.define(args); - CollectionsArguments.end(args); - _queryBuilder.append('{'); - queryDef.define(new CollectionConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Product getProduct() { + return (Product) get("product"); + } + public ProductVariant setProduct(Product arg) { + optimisticData.put(getKey("product"), arg); return this; } /** - * The compare at price of the product across all variants. + * The total sellable quantity of the variant for online sales channels. */ - public ProductQuery compareAtPriceRange(ProductPriceRangeQueryDefinition queryDef) { - startField("compareAtPriceRange"); - _queryBuilder.append('{'); - queryDef.define(new ProductPriceRangeQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Integer getQuantityAvailable() { + return (Integer) get("quantityAvailable"); + } + public ProductVariant setQuantityAvailable(Integer arg) { + optimisticData.put(getKey("quantityAvailable"), arg); return this; } /** - * The date and time when the product was created. + * A list of quantity breaks for the product variant. */ - public ProductQuery createdAt() { - startField("createdAt"); + public QuantityPriceBreakConnection getQuantityPriceBreaks() { + return (QuantityPriceBreakConnection) get("quantityPriceBreaks"); + } + + public ProductVariant setQuantityPriceBreaks(QuantityPriceBreakConnection arg) { + optimisticData.put(getKey("quantityPriceBreaks"), arg); return this; } - public class DescriptionArguments extends Arguments { - DescriptionArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * The quantity rule for the product variant in a given context. + */ - /** - * Truncates string after the given length. - */ - public DescriptionArguments truncateAt(Integer value) { - if (value != null) { - startArgument("truncateAt"); - _queryBuilder.append(value); - } - return this; - } + public QuantityRule getQuantityRule() { + return (QuantityRule) get("quantityRule"); } - public interface DescriptionArgumentsDefinition { - void define(DescriptionArguments args); + public ProductVariant setQuantityRule(QuantityRule arg) { + optimisticData.put(getKey("quantityRule"), arg); + return this; } /** - * Stripped description of the product, single line with HTML tags removed. + * 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. */ - public ProductQuery description() { - return description(args -> {}); + + public Boolean getRequiresComponents() { + return (Boolean) get("requiresComponents"); + } + + public ProductVariant setRequiresComponents(Boolean arg) { + optimisticData.put(getKey("requiresComponents"), arg); + return this; } /** - * Stripped description of the product, single line with HTML tags removed. + * Whether a customer needs to provide a shipping address when placing an order for the product + * variant. */ - public ProductQuery description(DescriptionArgumentsDefinition argsDef) { - startField("description"); - DescriptionArguments args = new DescriptionArguments(_queryBuilder); - argsDef.define(args); - DescriptionArguments.end(args); + public Boolean getRequiresShipping() { + return (Boolean) get("requiresShipping"); + } + public ProductVariant setRequiresShipping(Boolean arg) { + optimisticData.put(getKey("requiresShipping"), arg); return this; } /** - * The description of the product, complete with HTML formatting. + * List of product options applied to the variant. */ - public ProductQuery descriptionHtml() { - startField("descriptionHtml"); + public List getSelectedOptions() { + return (List) get("selectedOptions"); + } + + public ProductVariant setSelectedOptions(List arg) { + optimisticData.put(getKey("selectedOptions"), arg); return this; } /** - * The featured image for the product. - * This field is functionally equivalent to `images(first: 1)`. + * Represents an association between a variant and a selling plan. Selling plan allocations describe + * which selling plans are available for each variant, and what their impact is on pricing. */ - public ProductQuery featuredImage(ImageQueryDefinition queryDef) { - startField("featuredImage"); - _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SellingPlanAllocationConnection getSellingPlanAllocations() { + return (SellingPlanAllocationConnection) get("sellingPlanAllocations"); + } + public ProductVariant setSellingPlanAllocations(SellingPlanAllocationConnection arg) { + optimisticData.put(getKey("sellingPlanAllocations"), arg); return this; } /** - * A human-friendly unique string for the Product automatically generated from its title. - * They are used by the Liquid templating language to refer to objects. + * The SKU (stock keeping unit) associated with the variant. */ - public ProductQuery handle() { - startField("handle"); + public String getSku() { + return (String) get("sku"); + } + + public ProductVariant setSku(String arg) { + optimisticData.put(getKey("sku"), arg); return this; } - public class ImagesArguments extends Arguments { - ImagesArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * The in-store pickup availability of this variant by location. + */ - /** - * Returns up to the first `n` elements from the list. - */ - public ImagesArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public StoreAvailabilityConnection getStoreAvailability() { + return (StoreAvailabilityConnection) get("storeAvailability"); + } - /** - * Returns the elements that come after the specified cursor. - */ - public ImagesArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public ProductVariant setStoreAvailability(StoreAvailabilityConnection arg) { + optimisticData.put(getKey("storeAvailability"), arg); + return this; + } - /** - * Returns up to the last `n` elements from the list. - */ - public ImagesArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + /** + * Whether tax is charged when the product variant is sold. + */ - /** - * Returns the elements that come before the specified cursor. - */ - public ImagesArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public Boolean getTaxable() { + return (Boolean) get("taxable"); + } - /** - * Reverse the order of the underlying list. - */ - public ImagesArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + public ProductVariant setTaxable(Boolean arg) { + optimisticData.put(getKey("taxable"), arg); + return this; + } - /** - * Sort the underlying list by the given key. - */ - public ImagesArguments sortKey(ProductImageSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; - } + /** + * The product variant’s title. + */ + + public String getTitle() { + return (String) get("title"); } - public interface ImagesArgumentsDefinition { - void define(ImagesArguments args); + public ProductVariant setTitle(String arg) { + optimisticData.put(getKey("title"), arg); + return this; } /** - * List of images associated with the product. + * The unit price value for the variant based on the variant's measurement. */ - public ProductQuery images(ImageConnectionQueryDefinition queryDef) { - return images(args -> {}, queryDef); + + public MoneyV2 getUnitPrice() { + return (MoneyV2) get("unitPrice"); + } + + public ProductVariant setUnitPrice(MoneyV2 arg) { + optimisticData.put(getKey("unitPrice"), arg); + return this; } /** - * List of images associated with the product. + * The unit price measurement for the variant. */ - public ProductQuery images(ImagesArgumentsDefinition argsDef, ImageConnectionQueryDefinition queryDef) { - startField("images"); - ImagesArguments args = new ImagesArguments(_queryBuilder); - argsDef.define(args); - ImagesArguments.end(args); + public UnitPriceMeasurement getUnitPriceMeasurement() { + return (UnitPriceMeasurement) get("unitPriceMeasurement"); + } - _queryBuilder.append('{'); - queryDef.define(new ImageConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ProductVariant setUnitPriceMeasurement(UnitPriceMeasurement arg) { + optimisticData.put(getKey("unitPriceMeasurement"), arg); + return this; + } + + /** + * The weight of the product variant in the unit system specified with `weight_unit`. + */ + + public Double getWeight() { + return (Double) get("weight"); + } + public ProductVariant setWeight(Double arg) { + optimisticData.put(getKey("weight"), arg); return this; } /** - * Whether the product is a gift card. + * Unit of measurement for weight. */ - public ProductQuery isGiftCard() { - startField("isGiftCard"); + public WeightUnit getWeightUnit() { + return (WeightUnit) get("weightUnit"); + } + + public ProductVariant setWeightUnit(WeightUnit arg) { + optimisticData.put(getKey("weightUnit"), arg); return this; } - public class MediaArguments extends Arguments { - MediaArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "availableForSale": return false; - /** - * Returns up to the first `n` elements from the list. - */ - public MediaArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + case "barcode": return false; - /** - * Returns the elements that come after the specified cursor. - */ - public MediaArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + case "compareAtPrice": return true; - /** - * Returns up to the last `n` elements from the list. - */ - public MediaArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + case "compareAtPriceV2": return true; - /** - * Returns the elements that come before the specified cursor. - */ - public MediaArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + case "components": return true; - /** - * Reverse the order of the underlying list. - */ - public MediaArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + case "currentlyNotInStock": return false; - /** - * Sort the underlying list by the given key. - */ - public MediaArguments sortKey(ProductMediaSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; + case "groupedBy": return true; + + case "id": return false; + + case "image": return true; + + case "metafield": return true; + + case "metafields": return true; + + case "price": return true; + + case "priceV2": return true; + + case "product": return true; + + case "quantityAvailable": return false; + + case "quantityPriceBreaks": return true; + + case "quantityRule": return true; + + case "requiresComponents": return false; + + case "requiresShipping": return false; + + case "selectedOptions": return true; + + case "sellingPlanAllocations": return true; + + case "sku": return false; + + case "storeAvailability": return true; + + case "taxable": return false; + + case "title": return false; + + case "unitPrice": return true; + + case "unitPriceMeasurement": return true; + + case "weight": return false; + + case "weightUnit": return false; + + default: return false; } } + } - public interface MediaArgumentsDefinition { - void define(MediaArguments args); - } + public interface ProductVariantComponentQueryDefinition { + void define(ProductVariantComponentQuery _queryBuilder); + } - /** - * The media associated with the product. - */ - public ProductQuery media(MediaConnectionQueryDefinition queryDef) { - return media(args -> {}, queryDef); + /** + * Represents a component of a bundle variant. + */ + public static class ProductVariantComponentQuery extends Query { + ProductVariantComponentQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The media associated with the product. + * The product variant object that the component belongs to. */ - public ProductQuery media(MediaArgumentsDefinition argsDef, MediaConnectionQueryDefinition queryDef) { - startField("media"); - - MediaArguments args = new MediaArguments(_queryBuilder); - argsDef.define(args); - MediaArguments.end(args); + public ProductVariantComponentQuery productVariant(ProductVariantQueryDefinition queryDef) { + startField("productVariant"); _queryBuilder.append('{'); - queryDef.define(new MediaConnectionQuery(_queryBuilder)); + queryDef.define(new ProductVariantQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - public class MetafieldArguments extends Arguments { - MetafieldArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } - - /** - * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. - */ - public MetafieldArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - } + /** + * The quantity of component present in the bundle. + */ + public ProductVariantComponentQuery quantity() { + startField("quantity"); - public interface MetafieldArgumentsDefinition { - void define(MetafieldArguments args); + return this; } + } - /** - * Returns a metafield found by namespace and key. - */ - public ProductQuery metafield(String key, MetafieldQueryDefinition queryDef) { - return metafield(key, args -> {}, queryDef); + /** + * Represents a component of a bundle variant. + */ + public static class ProductVariantComponent extends AbstractResponse { + public ProductVariantComponent() { } - /** - * Returns a metafield found by namespace and key. - */ - public ProductQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { - startField("metafield"); + public ProductVariantComponent(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "productVariant": { + responseData.put(key, new ProductVariant(jsonAsObject(field.getValue(), key))); - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + break; + } - argsDef.define(new MetafieldArguments(_queryBuilder)); + case "quantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); - _queryBuilder.append(')'); + break; + } - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - return this; + public String getGraphQlTypeName() { + return "ProductVariantComponent"; } /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * The product variant object that the component belongs to. */ - public ProductQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); - - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ProductVariant getProductVariant() { + return (ProductVariant) get("productVariant"); + } + public ProductVariantComponent setProductVariant(ProductVariant arg) { + optimisticData.put(getKey("productVariant"), arg); return this; } /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. + * The quantity of component present in the bundle. */ - public ProductQuery onlineStoreUrl() { - startField("onlineStoreUrl"); + public Integer getQuantity() { + return (Integer) get("quantity"); + } + + public ProductVariantComponent setQuantity(Integer arg) { + optimisticData.put(getKey("quantity"), arg); return this; } - public class OptionsArguments extends Arguments { - OptionsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "productVariant": return true; - /** - * Truncate the array result to this size. - */ - public OptionsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; + case "quantity": return false; + + default: return false; } } + } - public interface OptionsArgumentsDefinition { - void define(OptionsArguments args); - } + public interface ProductVariantComponentConnectionQueryDefinition { + void define(ProductVariantComponentConnectionQuery _queryBuilder); + } - /** - * List of product options. - */ - public ProductQuery options(ProductOptionQueryDefinition queryDef) { - return options(args -> {}, queryDef); + /** + * An auto-generated type for paginating through multiple ProductVariantComponents. + */ + public static class ProductVariantComponentConnectionQuery extends Query { + ProductVariantComponentConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * List of product options. + * A list of edges. */ - public ProductQuery options(OptionsArgumentsDefinition argsDef, ProductOptionQueryDefinition queryDef) { - startField("options"); - - OptionsArguments args = new OptionsArguments(_queryBuilder); - argsDef.define(args); - OptionsArguments.end(args); + public ProductVariantComponentConnectionQuery edges(ProductVariantComponentEdgeQueryDefinition queryDef) { + startField("edges"); _queryBuilder.append('{'); - queryDef.define(new ProductOptionQuery(_queryBuilder)); + queryDef.define(new ProductVariantComponentEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The price range. + * A list of the nodes contained in ProductVariantComponentEdge. */ - public ProductQuery priceRange(ProductPriceRangeQueryDefinition queryDef) { - startField("priceRange"); + public ProductVariantComponentConnectionQuery nodes(ProductVariantComponentQueryDefinition queryDef) { + startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new ProductPriceRangeQuery(_queryBuilder)); + queryDef.define(new ProductVariantComponentQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A categorization that a product can be tagged with, commonly used for filtering and searching. + * Information to aid in pagination. */ - public ProductQuery productType() { - startField("productType"); + public ProductVariantComponentConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); + + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } + } - /** - * The date and time when the product was published to the channel. - */ - public ProductQuery publishedAt() { - startField("publishedAt"); - - return this; + /** + * An auto-generated type for paginating through multiple ProductVariantComponents. + */ + public static class ProductVariantComponentConnection extends AbstractResponse { + public ProductVariantComponentConnection() { } - /** - * Whether the product can only be purchased with a selling plan. - */ - public ProductQuery requiresSellingPlan() { - startField("requiresSellingPlan"); + public ProductVariantComponentConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ProductVariantComponentEdge(jsonAsObject(element1, key))); + } - return this; - } + responseData.put(key, list1); - public class SellingPlanGroupsArguments extends Arguments { - SellingPlanGroupsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + break; + } - /** - * Returns up to the first `n` elements from the list. - */ - public SellingPlanGroupsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ProductVariantComponent(jsonAsObject(element1, key))); + } - /** - * Returns the elements that come after the specified cursor. - */ - public SellingPlanGroupsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + responseData.put(key, list1); - /** - * Returns up to the last `n` elements from the list. - */ - public SellingPlanGroupsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + break; + } - /** - * Returns the elements that come before the specified cursor. - */ - public SellingPlanGroupsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - /** - * Reverse the order of the underlying list. - */ - public SellingPlanGroupsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } } - public interface SellingPlanGroupsArgumentsDefinition { - void define(SellingPlanGroupsArguments args); - } - - /** - * A list of a product's available selling plan groups. A selling plan group represents a selling - * method. For example, 'Subscribe and save' is a selling method where customers pay for goods or - * services per delivery. A selling plan group contains individual selling plans. - */ - public ProductQuery sellingPlanGroups(SellingPlanGroupConnectionQueryDefinition queryDef) { - return sellingPlanGroups(args -> {}, queryDef); + public String getGraphQlTypeName() { + return "ProductVariantComponentConnection"; } /** - * A list of a product's available selling plan groups. A selling plan group represents a selling - * method. For example, 'Subscribe and save' is a selling method where customers pay for goods or - * services per delivery. A selling plan group contains individual selling plans. + * A list of edges. */ - public ProductQuery sellingPlanGroups(SellingPlanGroupsArgumentsDefinition argsDef, SellingPlanGroupConnectionQueryDefinition queryDef) { - startField("sellingPlanGroups"); - - SellingPlanGroupsArguments args = new SellingPlanGroupsArguments(_queryBuilder); - argsDef.define(args); - SellingPlanGroupsArguments.end(args); - _queryBuilder.append('{'); - queryDef.define(new SellingPlanGroupConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public List getEdges() { + return (List) get("edges"); + } + public ProductVariantComponentConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * The product's SEO information. + * A list of the nodes contained in ProductVariantComponentEdge. */ - public ProductQuery seo(SEOQueryDefinition queryDef) { - startField("seo"); - _queryBuilder.append('{'); - queryDef.define(new SEOQuery(_queryBuilder)); - _queryBuilder.append('}'); + public List getNodes() { + return (List) get("nodes"); + } + public ProductVariantComponentConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * A comma separated list of tags that have been added to the product. - * Additional access scope required for private apps: unauthenticated_read_product_tags. + * Information to aid in pagination. */ - public ProductQuery tags() { - startField("tags"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } + + public ProductVariantComponentConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } - /** - * The product’s title. - */ - public ProductQuery title() { - startField("title"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - return this; + case "nodes": return true; + + case "pageInfo": return true; + + default: return false; + } } + } - /** - * The total quantity of inventory in stock for this Product. - */ - public ProductQuery totalInventory() { - startField("totalInventory"); + public interface ProductVariantComponentEdgeQueryDefinition { + void define(ProductVariantComponentEdgeQuery _queryBuilder); + } - return this; + /** + * An auto-generated type which holds one ProductVariantComponent and a cursor during pagination. + */ + public static class ProductVariantComponentEdgeQuery extends Query { + ProductVariantComponentEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * A cursor for use in pagination. */ - public ProductQuery trackingParameters() { - startField("trackingParameters"); + public ProductVariantComponentEdgeQuery cursor() { + startField("cursor"); return this; } /** - * The date and time when the product was last modified. - * A product's `updatedAt` value can change for different reasons. For example, if an order - * is placed for a product that has inventory tracking set up, then the inventory adjustment - * is counted as an update. + * The item at the end of ProductVariantComponentEdge. */ - public ProductQuery updatedAt() { - startField("updatedAt"); + public ProductVariantComponentEdgeQuery node(ProductVariantComponentQueryDefinition queryDef) { + startField("node"); + + _queryBuilder.append('{'); + queryDef.define(new ProductVariantComponentQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } + } - public class VariantBySelectedOptionsArguments extends Arguments { - VariantBySelectedOptionsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } + /** + * An auto-generated type which holds one ProductVariantComponent and a cursor during pagination. + */ + public static class ProductVariantComponentEdge extends AbstractResponse { + public ProductVariantComponentEdge() { + } - /** - * Whether to ignore unknown product options. - */ - public VariantBySelectedOptionsArguments ignoreUnknownOptions(Boolean value) { - if (value != null) { - startArgument("ignoreUnknownOptions"); - _queryBuilder.append(value); - } - return this; - } + public ProductVariantComponentEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * Whether to perform case insensitive match on option names and values. - */ - public VariantBySelectedOptionsArguments caseInsensitiveMatch(Boolean value) { - if (value != null) { - startArgument("caseInsensitiveMatch"); - _queryBuilder.append(value); + break; + } + + case "node": { + responseData.put(key, new ProductVariantComponent(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } } - public interface VariantBySelectedOptionsArgumentsDefinition { - void define(VariantBySelectedOptionsArguments args); - } - - /** - * Find a product’s variant based on its selected options. - * This is useful for converting a user’s selection of product options into a single matching variant. - * If there is not a variant for the selected options, `null` will be returned. - */ - public ProductQuery variantBySelectedOptions(List selectedOptions, ProductVariantQueryDefinition queryDef) { - return variantBySelectedOptions(selectedOptions, args -> {}, queryDef); + public String getGraphQlTypeName() { + return "ProductVariantComponentEdge"; } /** - * Find a product’s variant based on its selected options. - * This is useful for converting a user’s selection of product options into a single matching variant. - * If there is not a variant for the selected options, `null` will be returned. + * A cursor for use in pagination. */ - public ProductQuery variantBySelectedOptions(List selectedOptions, VariantBySelectedOptionsArgumentsDefinition argsDef, ProductVariantQueryDefinition queryDef) { - startField("variantBySelectedOptions"); - - _queryBuilder.append("(selectedOptions:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (SelectedOptionInput item1 : selectedOptions) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - - argsDef.define(new VariantBySelectedOptionsArguments(_queryBuilder)); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new ProductVariantQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getCursor() { + return (String) get("cursor"); + } + public ProductVariantComponentEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } - public class VariantsArguments extends Arguments { - VariantsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public VariantsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public VariantsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the last `n` elements from the list. - */ - public VariantsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + /** + * The item at the end of ProductVariantComponentEdge. + */ - /** - * Returns the elements that come before the specified cursor. - */ - public VariantsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public ProductVariantComponent getNode() { + return (ProductVariantComponent) get("node"); + } - /** - * Reverse the order of the underlying list. - */ - public VariantsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + public ProductVariantComponentEdge setNode(ProductVariantComponent arg) { + optimisticData.put(getKey("node"), arg); + return this; + } - /** - * Sort the underlying list by the given key. - */ - public VariantsArguments sortKey(ProductVariantSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; + + case "node": return true; + + default: return false; } } + } - public interface VariantsArgumentsDefinition { - void define(VariantsArguments args); + public interface ProductVariantConnectionQueryDefinition { + void define(ProductVariantConnectionQuery _queryBuilder); + } + + /** + * An auto-generated type for paginating through multiple ProductVariants. + */ + public static class ProductVariantConnectionQuery extends Query { + ProductVariantConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * List of the product’s variants. + * A list of edges. */ - public ProductQuery variants(ProductVariantConnectionQueryDefinition queryDef) { - return variants(args -> {}, queryDef); + public ProductVariantConnectionQuery edges(ProductVariantEdgeQueryDefinition queryDef) { + startField("edges"); + + _queryBuilder.append('{'); + queryDef.define(new ProductVariantEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * List of the product’s variants. + * A list of the nodes contained in ProductVariantEdge. */ - public ProductQuery variants(VariantsArgumentsDefinition argsDef, ProductVariantConnectionQueryDefinition queryDef) { - startField("variants"); - - VariantsArguments args = new VariantsArguments(_queryBuilder); - argsDef.define(args); - VariantsArguments.end(args); + public ProductVariantConnectionQuery nodes(ProductVariantQueryDefinition queryDef) { + startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new ProductVariantConnectionQuery(_queryBuilder)); + queryDef.define(new ProductVariantQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The product’s vendor name. + * Information to aid in pagination. */ - public ProductQuery vendor() { - startField("vendor"); + public ProductVariantConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); + + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * A product represents an individual item for sale in a Shopify store. Products are often physical, - * but they don't have to be. - * For example, a digital download (such as a movie, music or ebook file) also - * qualifies as a product, as do services (such as equipment rental, work for hire, - * customization of another product or an extended warranty). + * An auto-generated type for paginating through multiple ProductVariants. */ - public static class Product extends AbstractResponse implements HasMetafields, MenuItemResource, MetafieldParentResource, MetafieldReference, Node, OnlineStorePublishable, SearchResultItem, Trackable { - public Product() { + public static class ProductVariantConnection extends AbstractResponse { + public ProductVariantConnection() { } - public Product(JsonObject fields) throws SchemaViolationError { + public ProductVariantConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "availableForSale": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ProductVariantEdge(jsonAsObject(element1, key))); + } - case "collections": { - responseData.put(key, new CollectionConnection(jsonAsObject(field.getValue(), key))); + responseData.put(key, list1); break; } - case "compareAtPriceRange": { - responseData.put(key, new ProductPriceRange(jsonAsObject(field.getValue(), key))); + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ProductVariant(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } - case "createdAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } - case "description": { + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); - break; } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - case "descriptionHtml": { - responseData.put(key, jsonAsString(field.getValue(), key)); + public String getGraphQlTypeName() { + return "ProductVariantConnection"; + } - break; - } + /** + * A list of edges. + */ - case "featuredImage": { - Image optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); - } + public List getEdges() { + return (List) get("edges"); + } - responseData.put(key, optional1); + public ProductVariantConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; + } - break; - } + /** + * A list of the nodes contained in ProductVariantEdge. + */ - case "handle": { + public List getNodes() { + return (List) get("nodes"); + } + + public ProductVariantConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; + } + + /** + * Information to aid in pagination. + */ + + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } + + public ProductVariantConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; + + case "nodes": return true; + + case "pageInfo": return true; + + default: return false; + } + } + } + + public interface ProductVariantEdgeQueryDefinition { + void define(ProductVariantEdgeQuery _queryBuilder); + } + + /** + * An auto-generated type which holds one ProductVariant and a cursor during pagination. + */ + public static class ProductVariantEdgeQuery extends Query { + ProductVariantEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * A cursor for use in pagination. + */ + public ProductVariantEdgeQuery cursor() { + startField("cursor"); + + return this; + } + + /** + * The item at the end of ProductVariantEdge. + */ + public ProductVariantEdgeQuery node(ProductVariantQueryDefinition queryDef) { + startField("node"); + + _queryBuilder.append('{'); + queryDef.define(new ProductVariantQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * An auto-generated type which holds one ProductVariant and a cursor during pagination. + */ + public static class ProductVariantEdge extends AbstractResponse { + public ProductVariantEdge() { + } + + public ProductVariantEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case "node": { + responseData.put(key, new ProductVariant(jsonAsObject(field.getValue(), key))); break; } - case "images": { - responseData.put(key, new ImageConnection(jsonAsObject(field.getValue(), key))); - + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - case "isGiftCard": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + public String getGraphQlTypeName() { + return "ProductVariantEdge"; + } - break; - } + /** + * A cursor for use in pagination. + */ - case "media": { - responseData.put(key, new MediaConnection(jsonAsObject(field.getValue(), key))); + public String getCursor() { + return (String) get("cursor"); + } - break; - } + public ProductVariantEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); + return this; + } - case "metafield": { - Metafield optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); - } + /** + * The item at the end of ProductVariantEdge. + */ - responseData.put(key, optional1); + public ProductVariant getNode() { + return (ProductVariant) get("node"); + } - break; - } + public ProductVariantEdge setNode(ProductVariant arg) { + optimisticData.put(getKey("node"), arg); + return this; + } - case "metafields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - list1.add(optional2); - } + case "node": return true; - responseData.put(key, list1); + default: return false; + } + } + } - break; - } + /** + * The set of valid sort keys for the ProductVariant query. + */ + public enum ProductVariantSortKeys { + /** + * Sort by the `id` value. + */ + ID, - case "onlineStoreUrl": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + /** + * Sort by the `position` value. + */ + POSITION, - responseData.put(key, optional1); + /** + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. + */ + RELEVANCE, - break; - } + /** + * Sort by the `sku` value. + */ + SKU, - case "options": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ProductOption(jsonAsObject(element1, key))); - } + /** + * Sort by the `title` value. + */ + TITLE, - responseData.put(key, list1); + UNKNOWN_VALUE; - break; - } + public static ProductVariantSortKeys fromGraphQl(String value) { + if (value == null) { + return null; + } - case "priceRange": { - responseData.put(key, new ProductPriceRange(jsonAsObject(field.getValue(), key))); + switch (value) { + case "ID": { + return ID; + } - break; - } + case "POSITION": { + return POSITION; + } - case "productType": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "RELEVANCE": { + return RELEVANCE; + } - break; - } + case "SKU": { + return SKU; + } - case "publishedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + case "TITLE": { + return TITLE; + } - break; - } + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case ID: { + return "ID"; + } - case "requiresSellingPlan": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + case POSITION: { + return "POSITION"; + } - break; - } + case RELEVANCE: { + return "RELEVANCE"; + } - case "sellingPlanGroups": { - responseData.put(key, new SellingPlanGroupConnection(jsonAsObject(field.getValue(), key))); + case SKU: { + return "SKU"; + } - break; - } + case TITLE: { + return "TITLE"; + } - case "seo": { - responseData.put(key, new SEO(jsonAsObject(field.getValue(), key))); + default: { + return ""; + } + } + } + } - break; - } + public interface PurchasingCompanyQueryDefinition { + void define(PurchasingCompanyQuery _queryBuilder); + } - case "tags": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } + /** + * Represents information about the buyer that is interacting with the cart. + */ + public static class PurchasingCompanyQuery extends Query { + PurchasingCompanyQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - responseData.put(key, list1); + /** + * The company associated to the order or draft order. + */ + public PurchasingCompanyQuery company(CompanyQueryDefinition queryDef) { + startField("company"); - break; - } + _queryBuilder.append('{'); + queryDef.define(new CompanyQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + return this; + } - break; - } + /** + * The company contact associated to the order or draft order. + */ + public PurchasingCompanyQuery contact(CompanyContactQueryDefinition queryDef) { + startField("contact"); - case "totalInventory": { - Integer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); - } + _queryBuilder.append('{'); + queryDef.define(new CompanyContactQuery(_queryBuilder)); + _queryBuilder.append('}'); - responseData.put(key, optional1); + return this; + } - break; - } + /** + * The company location associated to the order or draft order. + */ + public PurchasingCompanyQuery location(CompanyLocationQueryDefinition queryDef) { + startField("location"); - case "trackingParameters": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + _queryBuilder.append('{'); + queryDef.define(new CompanyLocationQuery(_queryBuilder)); + _queryBuilder.append('}'); - responseData.put(key, optional1); + return this; + } + } - break; - } + /** + * Represents information about the buyer that is interacting with the cart. + */ + public static class PurchasingCompany extends AbstractResponse { + public PurchasingCompany() { + } - case "updatedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + public PurchasingCompany(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "company": { + responseData.put(key, new Company(jsonAsObject(field.getValue(), key))); break; } - case "variantBySelectedOptions": { - ProductVariant optional1 = null; + case "contact": { + CompanyContact optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new ProductVariant(jsonAsObject(field.getValue(), key)); + optional1 = new CompanyContact(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -59760,14 +56998,8 @@ public Product(JsonObject fields) throws SchemaViolationError { break; } - case "variants": { - responseData.put(key, new ProductVariantConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "vendor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "location": { + responseData.put(key, new CompanyLocation(jsonAsObject(field.getValue(), key))); break; } @@ -59783,2599 +57015,3360 @@ public Product(JsonObject fields) throws SchemaViolationError { } } - public Product(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "Product"; + return "PurchasingCompany"; } /** - * Indicates if at least one product variant is available for sale. + * The company associated to the order or draft order. */ - public Boolean getAvailableForSale() { - return (Boolean) get("availableForSale"); + public Company getCompany() { + return (Company) get("company"); } - public Product setAvailableForSale(Boolean arg) { - optimisticData.put(getKey("availableForSale"), arg); + public PurchasingCompany setCompany(Company arg) { + optimisticData.put(getKey("company"), arg); return this; } /** - * List of collections a product belongs to. + * The company contact associated to the order or draft order. */ - public CollectionConnection getCollections() { - return (CollectionConnection) get("collections"); + public CompanyContact getContact() { + return (CompanyContact) get("contact"); } - public Product setCollections(CollectionConnection arg) { - optimisticData.put(getKey("collections"), arg); + public PurchasingCompany setContact(CompanyContact arg) { + optimisticData.put(getKey("contact"), arg); return this; } /** - * The compare at price of the product across all variants. + * The company location associated to the order or draft order. */ - public ProductPriceRange getCompareAtPriceRange() { - return (ProductPriceRange) get("compareAtPriceRange"); + public CompanyLocation getLocation() { + return (CompanyLocation) get("location"); } - public Product setCompareAtPriceRange(ProductPriceRange arg) { - optimisticData.put(getKey("compareAtPriceRange"), arg); + public PurchasingCompany setLocation(CompanyLocation arg) { + optimisticData.put(getKey("location"), arg); return this; } - /** - * The date and time when the product was created. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "company": return true; - public DateTime getCreatedAt() { - return (DateTime) get("createdAt"); + case "contact": return true; + + case "location": return true; + + default: return false; + } } + } - public Product setCreatedAt(DateTime arg) { - optimisticData.put(getKey("createdAt"), arg); - return this; + public interface QuantityPriceBreakQueryDefinition { + void define(QuantityPriceBreakQuery _queryBuilder); + } + + /** + * Quantity price breaks lets you offer different rates that are based on the + * amount of a specific variant being ordered. + */ + public static class QuantityPriceBreakQuery extends Query { + QuantityPriceBreakQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * Stripped description of the product, single line with HTML tags removed. + * Minimum quantity required to reach new quantity break price. */ + public QuantityPriceBreakQuery minimumQuantity() { + startField("minimumQuantity"); - public String getDescription() { - return (String) get("description"); - } - - public Product setDescription(String arg) { - optimisticData.put(getKey("description"), arg); return this; } /** - * The description of the product, complete with HTML formatting. + * The price of variant after reaching the minimum quanity. */ + public QuantityPriceBreakQuery price(MoneyV2QueryDefinition queryDef) { + startField("price"); - public String getDescriptionHtml() { - return (String) get("descriptionHtml"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public Product setDescriptionHtml(String arg) { - optimisticData.put(getKey("descriptionHtml"), arg); return this; } + } + + /** + * Quantity price breaks lets you offer different rates that are based on the + * amount of a specific variant being ordered. + */ + public static class QuantityPriceBreak extends AbstractResponse { + public QuantityPriceBreak() { + } + + public QuantityPriceBreak(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "minimumQuantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); + + break; + } + + case "price": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "QuantityPriceBreak"; + } /** - * The featured image for the product. - * This field is functionally equivalent to `images(first: 1)`. + * Minimum quantity required to reach new quantity break price. */ - public Image getFeaturedImage() { - return (Image) get("featuredImage"); + public Integer getMinimumQuantity() { + return (Integer) get("minimumQuantity"); } - public Product setFeaturedImage(Image arg) { - optimisticData.put(getKey("featuredImage"), arg); + public QuantityPriceBreak setMinimumQuantity(Integer arg) { + optimisticData.put(getKey("minimumQuantity"), arg); return this; } /** - * A human-friendly unique string for the Product automatically generated from its title. - * They are used by the Liquid templating language to refer to objects. + * The price of variant after reaching the minimum quanity. */ - public String getHandle() { - return (String) get("handle"); + public MoneyV2 getPrice() { + return (MoneyV2) get("price"); } - public Product setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); + public QuantityPriceBreak setPrice(MoneyV2 arg) { + optimisticData.put(getKey("price"), arg); return this; } - /** - * A globally-unique ID. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "minimumQuantity": return false; - public ID getId() { - return (ID) get("id"); + case "price": return true; + + default: return false; + } + } + } + + public interface QuantityPriceBreakConnectionQueryDefinition { + void define(QuantityPriceBreakConnectionQuery _queryBuilder); + } + + /** + * An auto-generated type for paginating through multiple QuantityPriceBreaks. + */ + public static class QuantityPriceBreakConnectionQuery extends Query { + QuantityPriceBreakConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * List of images associated with the product. + * A list of edges. */ + public QuantityPriceBreakConnectionQuery edges(QuantityPriceBreakEdgeQueryDefinition queryDef) { + startField("edges"); - public ImageConnection getImages() { - return (ImageConnection) get("images"); - } + _queryBuilder.append('{'); + queryDef.define(new QuantityPriceBreakEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Product setImages(ImageConnection arg) { - optimisticData.put(getKey("images"), arg); return this; } /** - * Whether the product is a gift card. + * A list of the nodes contained in QuantityPriceBreakEdge. */ + public QuantityPriceBreakConnectionQuery nodes(QuantityPriceBreakQueryDefinition queryDef) { + startField("nodes"); - public Boolean getIsGiftCard() { - return (Boolean) get("isGiftCard"); - } + _queryBuilder.append('{'); + queryDef.define(new QuantityPriceBreakQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Product setIsGiftCard(Boolean arg) { - optimisticData.put(getKey("isGiftCard"), arg); return this; } /** - * The media associated with the product. + * Information to aid in pagination. */ + public QuantityPriceBreakConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - public MediaConnection getMedia() { - return (MediaConnection) get("media"); - } + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Product setMedia(MediaConnection arg) { - optimisticData.put(getKey("media"), arg); return this; } + } - /** - * Returns a metafield found by namespace and key. - */ + /** + * An auto-generated type for paginating through multiple QuantityPriceBreaks. + */ + public static class QuantityPriceBreakConnection extends AbstractResponse { + public QuantityPriceBreakConnection() { + } - public Metafield getMetafield() { - return (Metafield) get("metafield"); + public QuantityPriceBreakConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new QuantityPriceBreakEdge(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new QuantityPriceBreak(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public Product setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); - return this; + public String getGraphQlTypeName() { + return "QuantityPriceBreakConnection"; } /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * A list of edges. */ - public List getMetafields() { - return (List) get("metafields"); + public List getEdges() { + return (List) get("edges"); } - public Product setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); + public QuantityPriceBreakConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. + * A list of the nodes contained in QuantityPriceBreakEdge. */ - public String getOnlineStoreUrl() { - return (String) get("onlineStoreUrl"); + public List getNodes() { + return (List) get("nodes"); } - public Product setOnlineStoreUrl(String arg) { - optimisticData.put(getKey("onlineStoreUrl"), arg); + public QuantityPriceBreakConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * List of product options. + * Information to aid in pagination. */ - public List getOptions() { - return (List) get("options"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public Product setOptions(List arg) { - optimisticData.put(getKey("options"), arg); + public QuantityPriceBreakConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } - /** - * The price range. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - public ProductPriceRange getPriceRange() { - return (ProductPriceRange) get("priceRange"); + case "nodes": return true; + + case "pageInfo": return true; + + default: return false; + } } + } - public Product setPriceRange(ProductPriceRange arg) { - optimisticData.put(getKey("priceRange"), arg); - return this; + public interface QuantityPriceBreakEdgeQueryDefinition { + void define(QuantityPriceBreakEdgeQuery _queryBuilder); + } + + /** + * An auto-generated type which holds one QuantityPriceBreak and a cursor during pagination. + */ + public static class QuantityPriceBreakEdgeQuery extends Query { + QuantityPriceBreakEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * A categorization that a product can be tagged with, commonly used for filtering and searching. + * A cursor for use in pagination. */ + public QuantityPriceBreakEdgeQuery cursor() { + startField("cursor"); - public String getProductType() { - return (String) get("productType"); - } - - public Product setProductType(String arg) { - optimisticData.put(getKey("productType"), arg); return this; } /** - * The date and time when the product was published to the channel. + * The item at the end of QuantityPriceBreakEdge. */ + public QuantityPriceBreakEdgeQuery node(QuantityPriceBreakQueryDefinition queryDef) { + startField("node"); - public DateTime getPublishedAt() { - return (DateTime) get("publishedAt"); - } + _queryBuilder.append('{'); + queryDef.define(new QuantityPriceBreakQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Product setPublishedAt(DateTime arg) { - optimisticData.put(getKey("publishedAt"), arg); return this; } + } - /** - * Whether the product can only be purchased with a selling plan. - */ + /** + * An auto-generated type which holds one QuantityPriceBreak and a cursor during pagination. + */ + public static class QuantityPriceBreakEdge extends AbstractResponse { + public QuantityPriceBreakEdge() { + } - public Boolean getRequiresSellingPlan() { - return (Boolean) get("requiresSellingPlan"); + public QuantityPriceBreakEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "node": { + responseData.put(key, new QuantityPriceBreak(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public Product setRequiresSellingPlan(Boolean arg) { - optimisticData.put(getKey("requiresSellingPlan"), arg); - return this; + public String getGraphQlTypeName() { + return "QuantityPriceBreakEdge"; } /** - * A list of a product's available selling plan groups. A selling plan group represents a selling - * method. For example, 'Subscribe and save' is a selling method where customers pay for goods or - * services per delivery. A selling plan group contains individual selling plans. + * A cursor for use in pagination. */ - public SellingPlanGroupConnection getSellingPlanGroups() { - return (SellingPlanGroupConnection) get("sellingPlanGroups"); + public String getCursor() { + return (String) get("cursor"); } - public Product setSellingPlanGroups(SellingPlanGroupConnection arg) { - optimisticData.put(getKey("sellingPlanGroups"), arg); + public QuantityPriceBreakEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * The product's SEO information. + * The item at the end of QuantityPriceBreakEdge. */ - public SEO getSeo() { - return (SEO) get("seo"); + public QuantityPriceBreak getNode() { + return (QuantityPriceBreak) get("node"); } - public Product setSeo(SEO arg) { - optimisticData.put(getKey("seo"), arg); + public QuantityPriceBreakEdge setNode(QuantityPriceBreak arg) { + optimisticData.put(getKey("node"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; + + case "node": return true; + + default: return false; + } + } + } + + public interface QuantityRuleQueryDefinition { + void define(QuantityRuleQuery _queryBuilder); + } + + /** + * The quantity rule for the product variant in a given context. + */ + public static class QuantityRuleQuery extends Query { + QuantityRuleQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + /** - * A comma separated list of tags that have been added to the product. - * Additional access scope required for private apps: unauthenticated_read_product_tags. + * The value that specifies the quantity increment between minimum and maximum of the rule. + * Only quantities divisible by this value will be considered valid. + * The increment must be lower than or equal to the minimum and the maximum, and both minimum and + * maximum + * must be divisible by this value. */ + public QuantityRuleQuery increment() { + startField("increment"); - public List getTags() { - return (List) get("tags"); + return this; } - public Product setTags(List arg) { - optimisticData.put(getKey("tags"), arg); + /** + * An optional value that defines the highest allowed quantity purchased by the customer. + * If defined, maximum must be lower than or equal to the minimum and must be a multiple of the + * increment. + */ + public QuantityRuleQuery maximum() { + startField("maximum"); + return this; } /** - * The product’s title. + * The value that defines the lowest allowed quantity purchased by the customer. + * The minimum must be a multiple of the quantity rule's increment. */ + public QuantityRuleQuery minimum() { + startField("minimum"); - public String getTitle() { - return (String) get("title"); + return this; + } + } + + /** + * The quantity rule for the product variant in a given context. + */ + public static class QuantityRule extends AbstractResponse { + public QuantityRule() { + } + + public QuantityRule(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "increment": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); + + break; + } + + case "maximum": { + Integer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsInteger(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "minimum": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public Product setTitle(String arg) { - optimisticData.put(getKey("title"), arg); - return this; + public String getGraphQlTypeName() { + return "QuantityRule"; } /** - * The total quantity of inventory in stock for this Product. + * The value that specifies the quantity increment between minimum and maximum of the rule. + * Only quantities divisible by this value will be considered valid. + * The increment must be lower than or equal to the minimum and the maximum, and both minimum and + * maximum + * must be divisible by this value. */ - public Integer getTotalInventory() { - return (Integer) get("totalInventory"); + public Integer getIncrement() { + return (Integer) get("increment"); } - public Product setTotalInventory(Integer arg) { - optimisticData.put(getKey("totalInventory"), arg); + public QuantityRule setIncrement(Integer arg) { + optimisticData.put(getKey("increment"), arg); return this; } /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * An optional value that defines the highest allowed quantity purchased by the customer. + * If defined, maximum must be lower than or equal to the minimum and must be a multiple of the + * increment. */ - public String getTrackingParameters() { - return (String) get("trackingParameters"); + public Integer getMaximum() { + return (Integer) get("maximum"); } - public Product setTrackingParameters(String arg) { - optimisticData.put(getKey("trackingParameters"), arg); + public QuantityRule setMaximum(Integer arg) { + optimisticData.put(getKey("maximum"), arg); return this; } /** - * The date and time when the product was last modified. - * A product's `updatedAt` value can change for different reasons. For example, if an order - * is placed for a product that has inventory tracking set up, then the inventory adjustment - * is counted as an update. + * The value that defines the lowest allowed quantity purchased by the customer. + * The minimum must be a multiple of the quantity rule's increment. */ - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); + public Integer getMinimum() { + return (Integer) get("minimum"); } - public Product setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); + public QuantityRule setMinimum(Integer arg) { + optimisticData.put(getKey("minimum"), arg); return this; } - /** - * Find a product’s variant based on its selected options. - * This is useful for converting a user’s selection of product options into a single matching variant. - * If there is not a variant for the selected options, `null` will be returned. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "increment": return false; - public ProductVariant getVariantBySelectedOptions() { - return (ProductVariant) get("variantBySelectedOptions"); + case "maximum": return false; + + case "minimum": return false; + + default: return false; + } } + } - public Product setVariantBySelectedOptions(ProductVariant arg) { - optimisticData.put(getKey("variantBySelectedOptions"), arg); - return this; + public interface QueryRootQueryDefinition { + void define(QueryRootQuery _queryBuilder); + } + + /** + * The schema’s entry-point for queries. This acts as the public, top-level API from which all queries + * must start. + */ + public static class QueryRootQuery extends Query { + QueryRootQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * List of the product’s variants. + * Fetch a specific Article by its ID. */ + public QueryRootQuery article(ID id, ArticleQueryDefinition queryDef) { + startField("article"); - public ProductVariantConnection getVariants() { - return (ProductVariantConnection) get("variants"); - } + _queryBuilder.append("(id:"); + Query.appendQuotedString(_queryBuilder, id.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new ArticleQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Product setVariants(ProductVariantConnection arg) { - optimisticData.put(getKey("variants"), arg); return this; } - /** - * The product’s vendor name. - */ + public class ArticlesArguments extends Arguments { + ArticlesArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - public String getVendor() { - return (String) get("vendor"); - } + /** + * Returns up to the first `n` elements from the list. + */ + public ArticlesArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - public Product setVendor(String arg) { - optimisticData.put(getKey("vendor"), arg); - return this; - } + /** + * Returns the elements that come after the specified cursor. + */ + public ArticlesArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "availableForSale": return false; + /** + * Returns up to the last `n` elements from the list. + */ + public ArticlesArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - case "collections": return true; + /** + * Returns the elements that come before the specified cursor. + */ + public ArticlesArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "compareAtPriceRange": return true; + /** + * Reverse the order of the underlying list. + */ + public ArticlesArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } - case "createdAt": return false; + /** + * Sort the underlying list by the given key. + */ + public ArticlesArguments sortKey(ArticleSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; + } - case "description": return false; + /** + * Apply one or multiple filters to the query. + * | name | description | acceptable_values | default_value | example_use | + * | ---- | ---- | ---- | ---- | ---- | + * | author | + * | blog_title | + * | created_at | + * | tag | + * | tag_not | + * | updated_at | + * Refer to the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) for more + * information about using filters. + */ + public ArticlesArguments query(String value) { + if (value != null) { + startArgument("query"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + } - case "descriptionHtml": return false; + public interface ArticlesArgumentsDefinition { + void define(ArticlesArguments args); + } - case "featuredImage": return true; + /** + * List of the shop's articles. + */ + public QueryRootQuery articles(ArticleConnectionQueryDefinition queryDef) { + return articles(args -> {}, queryDef); + } - case "handle": return false; + /** + * List of the shop's articles. + */ + public QueryRootQuery articles(ArticlesArgumentsDefinition argsDef, ArticleConnectionQueryDefinition queryDef) { + startField("articles"); - case "id": return false; + ArticlesArguments args = new ArticlesArguments(_queryBuilder); + argsDef.define(args); + ArticlesArguments.end(args); - case "images": return true; + _queryBuilder.append('{'); + queryDef.define(new ArticleConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "isGiftCard": return false; + return this; + } - case "media": return true; + public class BlogArguments extends Arguments { + BlogArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "metafield": return true; + /** + * The handle of the `Blog`. + */ + public BlogArguments handle(String value) { + if (value != null) { + startArgument("handle"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "metafields": return true; + /** + * The ID of the `Blog`. + */ + public BlogArguments id(ID value) { + if (value != null) { + startArgument("id"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + } - case "onlineStoreUrl": return false; + public interface BlogArgumentsDefinition { + void define(BlogArguments args); + } - case "options": return true; + /** + * Fetch a specific `Blog` by one of its unique attributes. + */ + public QueryRootQuery blog(BlogQueryDefinition queryDef) { + return blog(args -> {}, queryDef); + } - case "priceRange": return true; + /** + * Fetch a specific `Blog` by one of its unique attributes. + */ + public QueryRootQuery blog(BlogArgumentsDefinition argsDef, BlogQueryDefinition queryDef) { + startField("blog"); - case "productType": return false; + BlogArguments args = new BlogArguments(_queryBuilder); + argsDef.define(args); + BlogArguments.end(args); - case "publishedAt": return false; + _queryBuilder.append('{'); + queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "requiresSellingPlan": return false; + return this; + } - case "sellingPlanGroups": return true; + /** + * Find a blog by its handle. + * + * @deprecated Use `blog` instead. + */ + @Deprecated + public QueryRootQuery blogByHandle(String handle, BlogQueryDefinition queryDef) { + startField("blogByHandle"); - case "seo": return true; + _queryBuilder.append("(handle:"); + Query.appendQuotedString(_queryBuilder, handle.toString()); - case "tags": return false; + _queryBuilder.append(')'); - case "title": return false; + _queryBuilder.append('{'); + queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "totalInventory": return false; + return this; + } - case "trackingParameters": return false; + public class BlogsArguments extends Arguments { + BlogsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "updatedAt": return false; + /** + * Returns up to the first `n` elements from the list. + */ + public BlogsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - case "variantBySelectedOptions": return true; + /** + * Returns the elements that come after the specified cursor. + */ + public BlogsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "variants": return true; + /** + * Returns up to the last `n` elements from the list. + */ + public BlogsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - case "vendor": return false; + /** + * Returns the elements that come before the specified cursor. + */ + public BlogsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - default: return false; + /** + * Reverse the order of the underlying list. + */ + public BlogsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Sort the underlying list by the given key. + */ + public BlogsArguments sortKey(BlogSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; + } + + /** + * Apply one or multiple filters to the query. + * | name | description | acceptable_values | default_value | example_use | + * | ---- | ---- | ---- | ---- | ---- | + * | created_at | + * | handle | + * | title | + * | updated_at | + * Refer to the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) for more + * information about using filters. + */ + public BlogsArguments query(String value) { + if (value != null) { + startArgument("query"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; } } - } - /** - * The set of valid sort keys for the ProductCollection query. - */ - public enum ProductCollectionSortKeys { - /** - * Sort by the `best-selling` value. - */ - BEST_SELLING, + public interface BlogsArgumentsDefinition { + void define(BlogsArguments args); + } /** - * Sort by the `collection-default` value. + * List of the shop's blogs. */ - COLLECTION_DEFAULT, + public QueryRootQuery blogs(BlogConnectionQueryDefinition queryDef) { + return blogs(args -> {}, queryDef); + } /** - * Sort by the `created` value. + * List of the shop's blogs. */ - CREATED, + public QueryRootQuery blogs(BlogsArgumentsDefinition argsDef, BlogConnectionQueryDefinition queryDef) { + startField("blogs"); - /** - * Sort by the `id` value. - */ - ID, + BlogsArguments args = new BlogsArguments(_queryBuilder); + argsDef.define(args); + BlogsArguments.end(args); - /** - * Sort by the `manual` value. - */ - MANUAL, + _queryBuilder.append('{'); + queryDef.define(new BlogConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Sort by the `price` value. - */ - PRICE, + return this; + } /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. + * Retrieve a cart by its ID. For more information, refer to + * [Manage a cart with the Storefront API](https://shopify.dev/custom-storefronts/cart/manage). */ - RELEVANCE, + public QueryRootQuery cart(ID id, CartQueryDefinition queryDef) { + startField("cart"); + + _queryBuilder.append("(id:"); + Query.appendQuotedString(_queryBuilder, id.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CartQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } /** - * Sort by the `title` value. + * A poll for the status of the cart checkout completion and order creation. */ - TITLE, + public QueryRootQuery cartCompletionAttempt(String attemptId, CartCompletionAttemptResultQueryDefinition queryDef) { + startField("cartCompletionAttempt"); - UNKNOWN_VALUE; + _queryBuilder.append("(attemptId:"); + Query.appendQuotedString(_queryBuilder, attemptId.toString()); - public static ProductCollectionSortKeys fromGraphQl(String value) { - if (value == null) { - return null; + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CartCompletionAttemptResultQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + public class CollectionArguments extends Arguments { + CollectionArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * The ID of the `Collection`. + */ + public CollectionArguments id(ID value) { + if (value != null) { + startArgument("id"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * The handle of the `Collection`. + */ + public CollectionArguments handle(String value) { + if (value != null) { + startArgument("handle"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; } + } + + public interface CollectionArgumentsDefinition { + void define(CollectionArguments args); + } + + /** + * Fetch a specific `Collection` by one of its unique attributes. + */ + public QueryRootQuery collection(CollectionQueryDefinition queryDef) { + return collection(args -> {}, queryDef); + } - switch (value) { - case "BEST_SELLING": { - return BEST_SELLING; - } + /** + * Fetch a specific `Collection` by one of its unique attributes. + */ + public QueryRootQuery collection(CollectionArgumentsDefinition argsDef, CollectionQueryDefinition queryDef) { + startField("collection"); - case "COLLECTION_DEFAULT": { - return COLLECTION_DEFAULT; - } + CollectionArguments args = new CollectionArguments(_queryBuilder); + argsDef.define(args); + CollectionArguments.end(args); - case "CREATED": { - return CREATED; - } + _queryBuilder.append('{'); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "ID": { - return ID; - } + return this; + } - case "MANUAL": { - return MANUAL; - } + /** + * Find a collection by its handle. + * + * @deprecated Use `collection` instead. + */ + @Deprecated + public QueryRootQuery collectionByHandle(String handle, CollectionQueryDefinition queryDef) { + startField("collectionByHandle"); - case "PRICE": { - return PRICE; - } + _queryBuilder.append("(handle:"); + Query.appendQuotedString(_queryBuilder, handle.toString()); - case "RELEVANCE": { - return RELEVANCE; - } + _queryBuilder.append(')'); - case "TITLE": { - return TITLE; - } + _queryBuilder.append('{'); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - default: { - return UNKNOWN_VALUE; - } - } + return this; } - public String toString() { - switch (this) { - case BEST_SELLING: { - return "BEST_SELLING"; - } - case COLLECTION_DEFAULT: { - return "COLLECTION_DEFAULT"; - } + public class CollectionsArguments extends Arguments { + CollectionsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case CREATED: { - return "CREATED"; + /** + * Returns up to the first `n` elements from the list. + */ + public CollectionsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); } + return this; + } - case ID: { - return "ID"; + /** + * Returns the elements that come after the specified cursor. + */ + public CollectionsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - case MANUAL: { - return "MANUAL"; + /** + * Returns up to the last `n` elements from the list. + */ + public CollectionsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); } + return this; + } - case PRICE: { - return "PRICE"; + /** + * Returns the elements that come before the specified cursor. + */ + public CollectionsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - case RELEVANCE: { - return "RELEVANCE"; + /** + * Reverse the order of the underlying list. + */ + public CollectionsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; + } - case TITLE: { - return "TITLE"; + /** + * Sort the underlying list by the given key. + */ + public CollectionsArguments sortKey(CollectionSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); } + return this; + } - default: { - return ""; + /** + * Apply one or multiple filters to the query. + * | name | description | acceptable_values | default_value | example_use | + * | ---- | ---- | ---- | ---- | ---- | + * | collection_type | + * | title | + * | updated_at | + * Refer to the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) for more + * information about using filters. + */ + public CollectionsArguments query(String value) { + if (value != null) { + startArgument("query"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } } - } - - public interface ProductConnectionQueryDefinition { - void define(ProductConnectionQuery _queryBuilder); - } - /** - * An auto-generated type for paginating through multiple Products. - */ - public static class ProductConnectionQuery extends Query { - ProductConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public interface CollectionsArgumentsDefinition { + void define(CollectionsArguments args); } /** - * A list of edges. + * List of the shop’s collections. */ - public ProductConnectionQuery edges(ProductEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new ProductEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + public QueryRootQuery collections(CollectionConnectionQueryDefinition queryDef) { + return collections(args -> {}, queryDef); } /** - * A list of available filters. + * List of the shop’s collections. */ - public ProductConnectionQuery filters(FilterQueryDefinition queryDef) { - startField("filters"); + public QueryRootQuery collections(CollectionsArgumentsDefinition argsDef, CollectionConnectionQueryDefinition queryDef) { + startField("collections"); + + CollectionsArguments args = new CollectionsArguments(_queryBuilder); + argsDef.define(args); + CollectionsArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new FilterQuery(_queryBuilder)); + queryDef.define(new CollectionConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in ProductEdge. + * The customer associated with the given access token. Tokens are obtained by using the + * [`customerAccessTokenCreate` + * mutation](https://shopify.dev/docs/api/storefront/latest/mutations/customerAccessTokenCreate). */ - public ProductConnectionQuery nodes(ProductQueryDefinition queryDef) { - startField("nodes"); + public QueryRootQuery customer(String customerAccessToken, CustomerQueryDefinition queryDef) { + startField("customer"); + + _queryBuilder.append("(customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new ProductQuery(_queryBuilder)); + queryDef.define(new CustomerQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Information to aid in pagination. + * Returns the localized experiences configured for the shop. */ - public ProductConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + public QueryRootQuery localization(LocalizationQueryDefinition queryDef) { + startField("localization"); _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); + queryDef.define(new LocalizationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - } - - /** - * An auto-generated type for paginating through multiple Products. - */ - public static class ProductConnection extends AbstractResponse { - public ProductConnection() { - } - - public ProductConnection(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ProductEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "filters": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Filter(jsonAsObject(element1, key))); - } - responseData.put(key, list1); + public class LocationsArguments extends Arguments { + LocationsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - break; - } + /** + * Returns up to the first `n` elements from the list. + */ + public LocationsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Product(jsonAsObject(element1, key))); - } + /** + * Returns the elements that come after the specified cursor. + */ + public LocationsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - responseData.put(key, list1); + /** + * Returns up to the last `n` elements from the list. + */ + public LocationsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - break; - } + /** + * Returns the elements that come before the specified cursor. + */ + public LocationsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + /** + * Reverse the order of the underlying list. + */ + public LocationsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } - break; - } + /** + * Sort the underlying list by the given key. + */ + public LocationsArguments sortKey(LocationSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + /** + * Used to sort results based on proximity to the provided location. + */ + public LocationsArguments near(GeoCoordinateInput value) { + if (value != null) { + startArgument("near"); + value.appendTo(_queryBuilder); } + return this; } } - public String getGraphQlTypeName() { - return "ProductConnection"; + public interface LocationsArgumentsDefinition { + void define(LocationsArguments args); } /** - * A list of edges. + * List of the shop's locations that support in-store pickup. + * When sorting by distance, you must specify a location via the `near` argument. */ - - public List getEdges() { - return (List) get("edges"); - } - - public ProductConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; + public QueryRootQuery locations(LocationConnectionQueryDefinition queryDef) { + return locations(args -> {}, queryDef); } /** - * A list of available filters. + * List of the shop's locations that support in-store pickup. + * When sorting by distance, you must specify a location via the `near` argument. */ + public QueryRootQuery locations(LocationsArgumentsDefinition argsDef, LocationConnectionQueryDefinition queryDef) { + startField("locations"); - public List getFilters() { - return (List) get("filters"); - } + LocationsArguments args = new LocationsArguments(_queryBuilder); + argsDef.define(args); + LocationsArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new LocationConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ProductConnection setFilters(List arg) { - optimisticData.put(getKey("filters"), arg); return this; } /** - * A list of the nodes contained in ProductEdge. + * Retrieve a [navigation menu](https://help.shopify.com/manual/online-store/menus-and-links) by its + * handle. */ + public QueryRootQuery menu(String handle, MenuQueryDefinition queryDef) { + startField("menu"); - public List getNodes() { - return (List) get("nodes"); - } - - public ProductConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; - } + _queryBuilder.append("(handle:"); + Query.appendQuotedString(_queryBuilder, handle.toString()); - /** - * Information to aid in pagination. - */ + _queryBuilder.append(')'); - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } + _queryBuilder.append('{'); + queryDef.define(new MenuQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ProductConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; - - case "filters": return true; - - case "nodes": return true; + public class MetaobjectArguments extends Arguments { + MetaobjectArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "pageInfo": return true; + /** + * The ID of the metaobject. + */ + public MetaobjectArguments id(ID value) { + if (value != null) { + startArgument("id"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - default: return false; + /** + * The handle and type of the metaobject. + */ + public MetaobjectArguments handle(MetaobjectHandleInput value) { + if (value != null) { + startArgument("handle"); + value.appendTo(_queryBuilder); + } + return this; } } - } - - public interface ProductEdgeQueryDefinition { - void define(ProductEdgeQuery _queryBuilder); - } - /** - * An auto-generated type which holds one Product and a cursor during pagination. - */ - public static class ProductEdgeQuery extends Query { - ProductEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public interface MetaobjectArgumentsDefinition { + void define(MetaobjectArguments args); } /** - * A cursor for use in pagination. + * Fetch a specific Metaobject by one of its unique identifiers. */ - public ProductEdgeQuery cursor() { - startField("cursor"); - - return this; + public QueryRootQuery metaobject(MetaobjectQueryDefinition queryDef) { + return metaobject(args -> {}, queryDef); } /** - * The item at the end of ProductEdge. + * Fetch a specific Metaobject by one of its unique identifiers. */ - public ProductEdgeQuery node(ProductQueryDefinition queryDef) { - startField("node"); + public QueryRootQuery metaobject(MetaobjectArgumentsDefinition argsDef, MetaobjectQueryDefinition queryDef) { + startField("metaobject"); + + MetaobjectArguments args = new MetaobjectArguments(_queryBuilder); + argsDef.define(args); + MetaobjectArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new ProductQuery(_queryBuilder)); + queryDef.define(new MetaobjectQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - } - /** - * An auto-generated type which holds one Product and a cursor during pagination. - */ - public static class ProductEdge extends AbstractResponse { - public ProductEdge() { - } + public class MetaobjectsArguments extends Arguments { + MetaobjectsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } - public ProductEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * The key of a field to sort with. Supports "id" and "updated_at". + */ + public MetaobjectsArguments sortKey(String value) { + if (value != null) { + startArgument("sortKey"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - break; - } + /** + * Returns up to the first `n` elements from the list. + */ + public MetaobjectsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come after the specified cursor. + */ + public MetaobjectsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "node": { - responseData.put(key, new Product(jsonAsObject(field.getValue(), key))); + /** + * Returns up to the last `n` elements from the list. + */ + public MetaobjectsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - break; - } + /** + * Returns the elements that come before the specified cursor. + */ + public MetaobjectsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + /** + * Reverse the order of the underlying list. + */ + public MetaobjectsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; } } - public String getGraphQlTypeName() { - return "ProductEdge"; + public interface MetaobjectsArgumentsDefinition { + void define(MetaobjectsArguments args); } /** - * A cursor for use in pagination. + * All active metaobjects for the shop. */ - - public String getCursor() { - return (String) get("cursor"); - } - - public ProductEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; + public QueryRootQuery metaobjects(String type, MetaobjectConnectionQueryDefinition queryDef) { + return metaobjects(type, args -> {}, queryDef); } /** - * The item at the end of ProductEdge. + * All active metaobjects for the shop. */ + public QueryRootQuery metaobjects(String type, MetaobjectsArgumentsDefinition argsDef, MetaobjectConnectionQueryDefinition queryDef) { + startField("metaobjects"); - public Product getNode() { - return (Product) get("node"); - } + _queryBuilder.append("(type:"); + Query.appendQuotedString(_queryBuilder, type.toString()); - public ProductEdge setNode(Product arg) { - optimisticData.put(getKey("node"), arg); - return this; - } + argsDef.define(new MetaobjectsArguments(_queryBuilder)); - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; + _queryBuilder.append(')'); - case "node": return true; + _queryBuilder.append('{'); + queryDef.define(new MetaobjectConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - default: return false; - } + return this; } - } - - public static class ProductFilter implements Serializable { - private Input available = Input.undefined(); - private Input variantOption = Input.undefined(); + /** + * Returns a specific node by ID. + */ + public QueryRootQuery node(ID id, NodeQueryDefinition queryDef) { + startField("node"); - private Input productType = Input.undefined(); + _queryBuilder.append("(id:"); + Query.appendQuotedString(_queryBuilder, id.toString()); - private Input productVendor = Input.undefined(); + _queryBuilder.append(')'); - private Input price = Input.undefined(); + _queryBuilder.append('{'); + queryDef.define(new NodeQuery(_queryBuilder)); + _queryBuilder.append('}'); - private Input productMetafield = Input.undefined(); + return this; + } - private Input variantMetafield = Input.undefined(); + /** + * Returns the list of nodes with the given IDs. + */ + public QueryRootQuery nodes(List ids, NodeQueryDefinition queryDef) { + startField("nodes"); - private Input tag = Input.undefined(); + _queryBuilder.append("(ids:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ID item1 : ids) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + Query.appendQuotedString(_queryBuilder, item1.toString()); + } + } + _queryBuilder.append(']'); - public Boolean getAvailable() { - return available.getValue(); - } + _queryBuilder.append(')'); - public Input getAvailableInput() { - return available; - } + _queryBuilder.append('{'); + queryDef.define(new NodeQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ProductFilter setAvailable(Boolean available) { - this.available = Input.optional(available); return this; } - public ProductFilter setAvailableInput(Input available) { - if (available == null) { - throw new IllegalArgumentException("Input can not be null"); + public class PageArguments extends Arguments { + PageArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); } - this.available = available; - return this; - } - public VariantOptionFilter getVariantOption() { - return variantOption.getValue(); - } + /** + * The handle of the `Page`. + */ + public PageArguments handle(String value) { + if (value != null) { + startArgument("handle"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - public Input getVariantOptionInput() { - return variantOption; + /** + * The ID of the `Page`. + */ + public PageArguments id(ID value) { + if (value != null) { + startArgument("id"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } } - public ProductFilter setVariantOption(VariantOptionFilter variantOption) { - this.variantOption = Input.optional(variantOption); - return this; + public interface PageArgumentsDefinition { + void define(PageArguments args); } - public ProductFilter setVariantOptionInput(Input variantOption) { - if (variantOption == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.variantOption = variantOption; - return this; + /** + * Fetch a specific `Page` by one of its unique attributes. + */ + public QueryRootQuery page(PageQueryDefinition queryDef) { + return page(args -> {}, queryDef); } - public String getProductType() { - return productType.getValue(); - } + /** + * Fetch a specific `Page` by one of its unique attributes. + */ + public QueryRootQuery page(PageArgumentsDefinition argsDef, PageQueryDefinition queryDef) { + startField("page"); - public Input getProductTypeInput() { - return productType; - } + PageArguments args = new PageArguments(_queryBuilder); + argsDef.define(args); + PageArguments.end(args); - public ProductFilter setProductType(String productType) { - this.productType = Input.optional(productType); - return this; - } + _queryBuilder.append('{'); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ProductFilter setProductTypeInput(Input productType) { - if (productType == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.productType = productType; return this; } - public String getProductVendor() { - return productVendor.getValue(); - } + /** + * Find a page by its handle. + * + * @deprecated Use `page` instead. + */ + @Deprecated + public QueryRootQuery pageByHandle(String handle, PageQueryDefinition queryDef) { + startField("pageByHandle"); - public Input getProductVendorInput() { - return productVendor; - } + _queryBuilder.append("(handle:"); + Query.appendQuotedString(_queryBuilder, handle.toString()); - public ProductFilter setProductVendor(String productVendor) { - this.productVendor = Input.optional(productVendor); - return this; - } + _queryBuilder.append(')'); - public ProductFilter setProductVendorInput(Input productVendor) { - if (productVendor == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.productVendor = productVendor; - return this; - } + _queryBuilder.append('{'); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); - public PriceRangeFilter getPrice() { - return price.getValue(); + return this; } - public Input getPriceInput() { - return price; - } + public class PagesArguments extends Arguments { + PagesArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - public ProductFilter setPrice(PriceRangeFilter price) { - this.price = Input.optional(price); - return this; - } + /** + * Returns up to the first `n` elements from the list. + */ + public PagesArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - public ProductFilter setPriceInput(Input price) { - if (price == null) { - throw new IllegalArgumentException("Input can not be null"); + /** + * Returns the elements that come after the specified cursor. + */ + public PagesArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; } - this.price = price; - return this; - } - public MetafieldFilter getProductMetafield() { - return productMetafield.getValue(); - } + /** + * Returns up to the last `n` elements from the list. + */ + public PagesArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - public Input getProductMetafieldInput() { - return productMetafield; - } + /** + * Returns the elements that come before the specified cursor. + */ + public PagesArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - public ProductFilter setProductMetafield(MetafieldFilter productMetafield) { - this.productMetafield = Input.optional(productMetafield); - return this; - } + /** + * Reverse the order of the underlying list. + */ + public PagesArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } - public ProductFilter setProductMetafieldInput(Input productMetafield) { - if (productMetafield == null) { - throw new IllegalArgumentException("Input can not be null"); + /** + * Sort the underlying list by the given key. + */ + public PagesArguments sortKey(PageSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; } - this.productMetafield = productMetafield; - return this; - } - public MetafieldFilter getVariantMetafield() { - return variantMetafield.getValue(); + /** + * Apply one or multiple filters to the query. + * | name | description | acceptable_values | default_value | example_use | + * | ---- | ---- | ---- | ---- | ---- | + * | created_at | + * | handle | + * | title | + * | updated_at | + * Refer to the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) for more + * information about using filters. + */ + public PagesArguments query(String value) { + if (value != null) { + startArgument("query"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } } - public Input getVariantMetafieldInput() { - return variantMetafield; + public interface PagesArgumentsDefinition { + void define(PagesArguments args); } - public ProductFilter setVariantMetafield(MetafieldFilter variantMetafield) { - this.variantMetafield = Input.optional(variantMetafield); - return this; + /** + * List of the shop's pages. + */ + public QueryRootQuery pages(PageConnectionQueryDefinition queryDef) { + return pages(args -> {}, queryDef); } - public ProductFilter setVariantMetafieldInput(Input variantMetafield) { - if (variantMetafield == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.variantMetafield = variantMetafield; - return this; - } + /** + * List of the shop's pages. + */ + public QueryRootQuery pages(PagesArgumentsDefinition argsDef, PageConnectionQueryDefinition queryDef) { + startField("pages"); - public String getTag() { - return tag.getValue(); - } + PagesArguments args = new PagesArguments(_queryBuilder); + argsDef.define(args); + PagesArguments.end(args); - public Input getTagInput() { - return tag; - } + _queryBuilder.append('{'); + queryDef.define(new PageConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ProductFilter setTag(String tag) { - this.tag = Input.optional(tag); return this; } - public ProductFilter setTagInput(Input tag) { - if (tag == null) { - throw new IllegalArgumentException("Input can not be null"); + public class PredictiveSearchArguments extends Arguments { + PredictiveSearchArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); } - this.tag = tag; - return this; - } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + /** + * Limits the number of results based on `limit_scope`. The value can range from 1 to 10, and the + * default is 10. + */ + public PredictiveSearchArguments limit(Integer value) { + if (value != null) { + startArgument("limit"); + _queryBuilder.append(value); + } + return this; + } - if (this.available.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("available:"); - if (available.getValue() != null) { - _queryBuilder.append(available.getValue()); - } else { - _queryBuilder.append("null"); + /** + * Decides the distribution of results. + */ + public PredictiveSearchArguments limitScope(PredictiveSearchLimitScope value) { + if (value != null) { + startArgument("limitScope"); + _queryBuilder.append(value.toString()); } + return this; } - if (this.variantOption.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("variantOption:"); - if (variantOption.getValue() != null) { - variantOption.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); + /** + * Specifies the list of resource fields to use for search. The default fields searched on are TITLE, + * PRODUCT_TYPE, VARIANT_TITLE, and VENDOR. For the best search experience, you should search on the + * default field set. + * The input must not contain more than `250` values. + */ + public PredictiveSearchArguments searchableFields(List value) { + if (value != null) { + startArgument("searchableFields"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (SearchableField item1 : value) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + _queryBuilder.append(item1.toString()); + } + } + _queryBuilder.append(']'); + } + return this; + } + + /** + * The types of resources to search for. + * The input must not contain more than `250` values. + */ + public PredictiveSearchArguments types(List value) { + if (value != null) { + startArgument("types"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (PredictiveSearchType item1 : value) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + _queryBuilder.append(item1.toString()); + } + } + _queryBuilder.append(']'); + } + return this; + } + + /** + * Specifies how unavailable products are displayed in the search results. + */ + public PredictiveSearchArguments unavailableProducts(SearchUnavailableProductsType value) { + if (value != null) { + startArgument("unavailableProducts"); + _queryBuilder.append(value.toString()); } + return this; } + } + + public interface PredictiveSearchArgumentsDefinition { + void define(PredictiveSearchArguments args); + } + + /** + * List of the predictive search results. + */ + public QueryRootQuery predictiveSearch(String query, PredictiveSearchResultQueryDefinition queryDef) { + return predictiveSearch(query, args -> {}, queryDef); + } + + /** + * List of the predictive search results. + */ + public QueryRootQuery predictiveSearch(String query, PredictiveSearchArgumentsDefinition argsDef, PredictiveSearchResultQueryDefinition queryDef) { + startField("predictiveSearch"); - if (this.productType.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("productType:"); - if (productType.getValue() != null) { - Query.appendQuotedString(_queryBuilder, productType.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + _queryBuilder.append("(query:"); + Query.appendQuotedString(_queryBuilder, query.toString()); - if (this.productVendor.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("productVendor:"); - if (productVendor.getValue() != null) { - Query.appendQuotedString(_queryBuilder, productVendor.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + argsDef.define(new PredictiveSearchArguments(_queryBuilder)); - if (this.price.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("price:"); - if (price.getValue() != null) { - price.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); - } - } + _queryBuilder.append(')'); - if (this.productMetafield.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("productMetafield:"); - if (productMetafield.getValue() != null) { - productMetafield.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); - } + _queryBuilder.append('{'); + queryDef.define(new PredictiveSearchResultQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + public class ProductArguments extends Arguments { + ProductArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); } - if (this.variantMetafield.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("variantMetafield:"); - if (variantMetafield.getValue() != null) { - variantMetafield.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); + /** + * The ID of the `Product`. + */ + public ProductArguments id(ID value) { + if (value != null) { + startArgument("id"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } - if (this.tag.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("tag:"); - if (tag.getValue() != null) { - Query.appendQuotedString(_queryBuilder, tag.getValue().toString()); - } else { - _queryBuilder.append("null"); + /** + * The handle of the `Product`. + */ + public ProductArguments handle(String value) { + if (value != null) { + startArgument("handle"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } + } - _queryBuilder.append('}'); + public interface ProductArgumentsDefinition { + void define(ProductArguments args); } - } - /** - * The set of valid sort keys for the ProductImage query. - */ - public enum ProductImageSortKeys { /** - * Sort by the `created_at` value. + * Fetch a specific `Product` by one of its unique attributes. */ - CREATED_AT, + public QueryRootQuery product(ProductQueryDefinition queryDef) { + return product(args -> {}, queryDef); + } /** - * Sort by the `id` value. + * Fetch a specific `Product` by one of its unique attributes. */ - ID, + public QueryRootQuery product(ProductArgumentsDefinition argsDef, ProductQueryDefinition queryDef) { + startField("product"); - /** - * Sort by the `position` value. - */ - POSITION, + ProductArguments args = new ProductArguments(_queryBuilder); + argsDef.define(args); + ProductArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. + * Find a product by its handle. + * + * @deprecated Use `product` instead. */ - RELEVANCE, - - UNKNOWN_VALUE; + @Deprecated + public QueryRootQuery productByHandle(String handle, ProductQueryDefinition queryDef) { + startField("productByHandle"); - public static ProductImageSortKeys fromGraphQl(String value) { - if (value == null) { - return null; - } + _queryBuilder.append("(handle:"); + Query.appendQuotedString(_queryBuilder, handle.toString()); - switch (value) { - case "CREATED_AT": { - return CREATED_AT; - } + _queryBuilder.append(')'); - case "ID": { - return ID; - } + _queryBuilder.append('{'); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "POSITION": { - return POSITION; - } + return this; + } - case "RELEVANCE": { - return RELEVANCE; - } + public class ProductRecommendationsArguments extends Arguments { + ProductRecommendationsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - default: { - return UNKNOWN_VALUE; + /** + * The id of the product. + */ + public ProductRecommendationsArguments productId(ID value) { + if (value != null) { + startArgument("productId"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } - } - public String toString() { - switch (this) { - case CREATED_AT: { - return "CREATED_AT"; - } - case ID: { - return "ID"; + /** + * The handle of the product. + */ + public ProductRecommendationsArguments productHandle(String value) { + if (value != null) { + startArgument("productHandle"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - case POSITION: { - return "POSITION"; + /** + * 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. + */ + public ProductRecommendationsArguments intent(ProductRecommendationIntent value) { + if (value != null) { + startArgument("intent"); + _queryBuilder.append(value.toString()); } + return this; + } + } - case RELEVANCE: { - return "RELEVANCE"; - } + public interface ProductRecommendationsArgumentsDefinition { + void define(ProductRecommendationsArguments args); + } - default: { - return ""; - } - } + /** + * Find recommended products related to a given `product_id`. + * To learn more about how recommendations are generated, see + * [*Showing product recommendations on product + * pages*](https://help.shopify.com/themes/development/recommended-products). + */ + public QueryRootQuery productRecommendations(ProductQueryDefinition queryDef) { + return productRecommendations(args -> {}, queryDef); } - } - /** - * The set of valid sort keys for the ProductMedia query. - */ - public enum ProductMediaSortKeys { /** - * Sort by the `id` value. + * Find recommended products related to a given `product_id`. + * To learn more about how recommendations are generated, see + * [*Showing product recommendations on product + * pages*](https://help.shopify.com/themes/development/recommended-products). */ - ID, + public QueryRootQuery productRecommendations(ProductRecommendationsArgumentsDefinition argsDef, ProductQueryDefinition queryDef) { + startField("productRecommendations"); + + ProductRecommendationsArguments args = new ProductRecommendationsArguments(_queryBuilder); + argsDef.define(args); + ProductRecommendationsArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } /** - * Sort by the `position` value. + * Tags added to products. + * Additional access scope required: unauthenticated_read_product_tags. */ - POSITION, + public QueryRootQuery productTags(int first, StringConnectionQueryDefinition queryDef) { + startField("productTags"); + + _queryBuilder.append("(first:"); + _queryBuilder.append(first); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new StringConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. + * List of product types for the shop's products that are published to your app. */ - RELEVANCE, + public QueryRootQuery productTypes(int first, StringConnectionQueryDefinition queryDef) { + startField("productTypes"); - UNKNOWN_VALUE; + _queryBuilder.append("(first:"); + _queryBuilder.append(first); - public static ProductMediaSortKeys fromGraphQl(String value) { - if (value == null) { - return null; + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new StringConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + public class ProductsArguments extends Arguments { + ProductsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); } - switch (value) { - case "ID": { - return ID; + /** + * Returns up to the first `n` elements from the list. + */ + public ProductsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); } + return this; + } - case "POSITION": { - return POSITION; + /** + * Returns the elements that come after the specified cursor. + */ + public ProductsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - case "RELEVANCE": { - return RELEVANCE; + /** + * Returns up to the last `n` elements from the list. + */ + public ProductsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); } + return this; + } - default: { - return UNKNOWN_VALUE; + /** + * Returns the elements that come before the specified cursor. + */ + public ProductsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } - } - public String toString() { - switch (this) { - case ID: { - return "ID"; - } - case POSITION: { - return "POSITION"; + /** + * Reverse the order of the underlying list. + */ + public ProductsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; + } - case RELEVANCE: { - return "RELEVANCE"; + /** + * Sort the underlying list by the given key. + */ + public ProductsArguments sortKey(ProductSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); } + return this; + } - default: { - return ""; + /** + * Apply one or multiple filters to the query. + * | name | description | acceptable_values | default_value | example_use | + * | ---- | ---- | ---- | ---- | ---- | + * | available_for_sale | + * | created_at | + * | product_type | + * | tag | + * | tag_not | + * | title | + * | updated_at | + * | variants.price | + * | vendor | + * Refer to the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) for more + * information about using filters. + */ + public ProductsArguments query(String value) { + if (value != null) { + startArgument("query"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } } - } - - public interface ProductOptionQueryDefinition { - void define(ProductOptionQuery _queryBuilder); - } - /** - * Product property names like "Size", "Color", and "Material" that the customers can select. - * Variants are selected based on permutations of these options. - * 255 characters limit each. - */ - public static class ProductOptionQuery extends Query { - ProductOptionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public interface ProductsArgumentsDefinition { + void define(ProductsArguments args); + } - startField("id"); + /** + * List of the shop’s products. For storefront search, use [`search` + * query](https://shopify.dev/docs/api/storefront/latest/queries/search). + */ + public QueryRootQuery products(ProductConnectionQueryDefinition queryDef) { + return products(args -> {}, queryDef); } /** - * The product option’s name. + * List of the shop’s products. For storefront search, use [`search` + * query](https://shopify.dev/docs/api/storefront/latest/queries/search). */ - public ProductOptionQuery name() { - startField("name"); + public QueryRootQuery products(ProductsArgumentsDefinition argsDef, ProductConnectionQueryDefinition queryDef) { + startField("products"); + + ProductsArguments args = new ProductsArguments(_queryBuilder); + argsDef.define(args); + ProductsArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new ProductConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The corresponding value to the product option name. + * The list of public Storefront API versions, including supported, release candidate and unstable + * versions. */ - public ProductOptionQuery values() { - startField("values"); + public QueryRootQuery publicApiVersions(ApiVersionQueryDefinition queryDef) { + startField("publicApiVersions"); + + _queryBuilder.append('{'); + queryDef.define(new ApiVersionQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - } - /** - * Product property names like "Size", "Color", and "Material" that the customers can select. - * Variants are selected based on permutations of these options. - * 255 characters limit each. - */ - public static class ProductOption extends AbstractResponse implements Node { - public ProductOption() { - } + public class SearchArguments extends Arguments { + SearchArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } - public ProductOption(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + /** + * Returns up to the first `n` elements from the list. + */ + public SearchArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - break; - } + /** + * Returns the elements that come after the specified cursor. + */ + public SearchArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Returns up to the last `n` elements from the list. + */ + public SearchArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - break; - } + /** + * Returns the elements that come before the specified cursor. + */ + public SearchArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Reverse the order of the underlying list. + */ + public SearchArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Sort the underlying list by the given key. + */ + public SearchArguments sortKey(SearchSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; + } + + /** + * Specifies whether to perform a partial word match on the last search term. + */ + public SearchArguments prefix(SearchPrefixQueryType value) { + if (value != null) { + startArgument("prefix"); + _queryBuilder.append(value.toString()); + } + return this; + } - case "values": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); + /** + * Returns a subset of products matching all product filters. + * The input must not contain more than `250` values. + */ + public SearchArguments productFilters(List value) { + if (value != null) { + startArgument("productFilters"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ProductFilter item1 : value) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); } - - responseData.put(key, list1); - - break; } + _queryBuilder.append(']'); + } + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); + /** + * The types of resources to search for. + * The input must not contain more than `250` values. + */ + public SearchArguments types(List value) { + if (value != null) { + startArgument("types"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (SearchType item1 : value) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + _queryBuilder.append(item1.toString()); + } } + _queryBuilder.append(']'); } + return this; } - } - public ProductOption(ID id) { - this(); - optimisticData.put("id", id); + /** + * Specifies how unavailable products or variants are displayed in the search results. + */ + public SearchArguments unavailableProducts(SearchUnavailableProductsType value) { + if (value != null) { + startArgument("unavailableProducts"); + _queryBuilder.append(value.toString()); + } + return this; + } } - public String getGraphQlTypeName() { - return "ProductOption"; + public interface SearchArgumentsDefinition { + void define(SearchArguments args); } /** - * A globally-unique ID. + * List of the search results. */ - - public ID getId() { - return (ID) get("id"); + public QueryRootQuery search(String query, SearchResultItemConnectionQueryDefinition queryDef) { + return search(query, args -> {}, queryDef); } /** - * The product option’s name. + * List of the search results. */ + public QueryRootQuery search(String query, SearchArgumentsDefinition argsDef, SearchResultItemConnectionQueryDefinition queryDef) { + startField("search"); - public String getName() { - return (String) get("name"); - } + _queryBuilder.append("(query:"); + Query.appendQuotedString(_queryBuilder, query.toString()); + + argsDef.define(new SearchArguments(_queryBuilder)); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new SearchResultItemConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ProductOption setName(String arg) { - optimisticData.put(getKey("name"), arg); return this; } /** - * The corresponding value to the product option name. + * The shop associated with the storefront access token. */ + public QueryRootQuery shop(ShopQueryDefinition queryDef) { + startField("shop"); - public List getValues() { - return (List) get("values"); - } + _queryBuilder.append('{'); + queryDef.define(new ShopQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ProductOption setValues(List arg) { - optimisticData.put(getKey("values"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "id": return false; + public class UrlRedirectsArguments extends Arguments { + UrlRedirectsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "name": return false; + /** + * Returns up to the first `n` elements from the list. + */ + public UrlRedirectsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - case "values": return false; + /** + * Returns the elements that come after the specified cursor. + */ + public UrlRedirectsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - default: return false; + /** + * Returns up to the last `n` elements from the list. + */ + public UrlRedirectsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; } - } - } - public interface ProductPriceRangeQueryDefinition { - void define(ProductPriceRangeQuery _queryBuilder); - } + /** + * Returns the elements that come before the specified cursor. + */ + public UrlRedirectsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - /** - * The price range of the product. - */ - public static class ProductPriceRangeQuery extends Query { - ProductPriceRangeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + /** + * Reverse the order of the underlying list. + */ + public UrlRedirectsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Apply one or multiple filters to the query. + * | name | description | acceptable_values | default_value | example_use | + * | ---- | ---- | ---- | ---- | ---- | + * | created_at | + * | path | + * | target | + * Refer to the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) for more + * information about using filters. + */ + public UrlRedirectsArguments query(String value) { + if (value != null) { + startArgument("query"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + } + + public interface UrlRedirectsArgumentsDefinition { + void define(UrlRedirectsArguments args); } /** - * The highest variant's price. + * A list of redirects for a shop. */ - public ProductPriceRangeQuery maxVariantPrice(MoneyV2QueryDefinition queryDef) { - startField("maxVariantPrice"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + public QueryRootQuery urlRedirects(UrlRedirectConnectionQueryDefinition queryDef) { + return urlRedirects(args -> {}, queryDef); } /** - * The lowest variant's price. + * A list of redirects for a shop. */ - public ProductPriceRangeQuery minVariantPrice(MoneyV2QueryDefinition queryDef) { - startField("minVariantPrice"); + public QueryRootQuery urlRedirects(UrlRedirectsArgumentsDefinition argsDef, UrlRedirectConnectionQueryDefinition queryDef) { + startField("urlRedirects"); + + UrlRedirectsArguments args = new UrlRedirectsArguments(_queryBuilder); + argsDef.define(args); + UrlRedirectsArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new UrlRedirectConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + + public String toString() { + return _queryBuilder.toString(); + } } /** - * The price range of the product. + * The schema’s entry-point for queries. This acts as the public, top-level API from which all queries + * must start. */ - public static class ProductPriceRange extends AbstractResponse { - public ProductPriceRange() { + public static class QueryRoot extends AbstractResponse { + public QueryRoot() { } - public ProductPriceRange(JsonObject fields) throws SchemaViolationError { + public QueryRoot(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "maxVariantPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "article": { + Article optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Article(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "minVariantPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "articles": { + responseData.put(key, new ArticleConnection(jsonAsObject(field.getValue(), key))); break; } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "blog": { + Blog optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Blog(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); + + case "blogByHandle": { + Blog optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Blog(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; } - } - } - } - public String getGraphQlTypeName() { - return "ProductPriceRange"; - } + case "blogs": { + responseData.put(key, new BlogConnection(jsonAsObject(field.getValue(), key))); - /** - * The highest variant's price. - */ + break; + } - public MoneyV2 getMaxVariantPrice() { - return (MoneyV2) get("maxVariantPrice"); - } + case "cart": { + Cart optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Cart(jsonAsObject(field.getValue(), key)); + } - public ProductPriceRange setMaxVariantPrice(MoneyV2 arg) { - optimisticData.put(getKey("maxVariantPrice"), arg); - return this; - } + responseData.put(key, optional1); - /** - * The lowest variant's price. - */ + break; + } - public MoneyV2 getMinVariantPrice() { - return (MoneyV2) get("minVariantPrice"); - } + case "cartCompletionAttempt": { + CartCompletionAttemptResult optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = UnknownCartCompletionAttemptResult.create(jsonAsObject(field.getValue(), key)); + } - public ProductPriceRange setMinVariantPrice(MoneyV2 arg) { - optimisticData.put(getKey("minVariantPrice"), arg); - return this; - } + responseData.put(key, optional1); - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "maxVariantPrice": return true; + break; + } - case "minVariantPrice": return true; + case "collection": { + Collection optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Collection(jsonAsObject(field.getValue(), key)); + } - default: return false; - } - } - } + responseData.put(key, optional1); - /** - * The recommendation intent that is used to generate product recommendations. - * You can use intent to generate product recommendations according to different strategies. - */ - public enum ProductRecommendationIntent { - /** - * Offer customers products that are complementary to a product for which recommendations are to be - * fetched. An example is add-on products that display in a Pair it with section. - */ - COMPLEMENTARY, + break; + } - /** - * Offer customers a mix of products that are similar or complementary to a product for which - * recommendations are to be fetched. An example is substitutable products that display in a You may - * also like section. - */ - RELATED, + case "collectionByHandle": { + Collection optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Collection(jsonAsObject(field.getValue(), key)); + } - UNKNOWN_VALUE; + responseData.put(key, optional1); - public static ProductRecommendationIntent fromGraphQl(String value) { - if (value == null) { - return null; - } + break; + } - switch (value) { - case "COMPLEMENTARY": { - return COMPLEMENTARY; - } + case "collections": { + responseData.put(key, new CollectionConnection(jsonAsObject(field.getValue(), key))); - case "RELATED": { - return RELATED; - } + break; + } - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case COMPLEMENTARY: { - return "COMPLEMENTARY"; - } + case "customer": { + Customer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Customer(jsonAsObject(field.getValue(), key)); + } - case RELATED: { - return "RELATED"; - } + responseData.put(key, optional1); - default: { - return ""; - } - } - } - } + break; + } - /** - * The set of valid sort keys for the Product query. - */ - public enum ProductSortKeys { - /** - * Sort by the `best_selling` value. - */ - BEST_SELLING, + case "localization": { + responseData.put(key, new Localization(jsonAsObject(field.getValue(), key))); - /** - * Sort by the `created_at` value. - */ - CREATED_AT, + break; + } - /** - * Sort by the `id` value. - */ - ID, + case "locations": { + responseData.put(key, new LocationConnection(jsonAsObject(field.getValue(), key))); - /** - * Sort by the `price` value. - */ - PRICE, + break; + } - /** - * Sort by the `product_type` value. - */ - PRODUCT_TYPE, + case "menu": { + Menu optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Menu(jsonAsObject(field.getValue(), key)); + } - /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. - */ - RELEVANCE, + responseData.put(key, optional1); - /** - * Sort by the `title` value. - */ - TITLE, + break; + } - /** - * Sort by the `updated_at` value. - */ - UPDATED_AT, + case "metaobject": { + Metaobject optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metaobject(jsonAsObject(field.getValue(), key)); + } - /** - * Sort by the `vendor` value. - */ - VENDOR, + responseData.put(key, optional1); - UNKNOWN_VALUE; + break; + } - public static ProductSortKeys fromGraphQl(String value) { - if (value == null) { - return null; - } + case "metaobjects": { + responseData.put(key, new MetaobjectConnection(jsonAsObject(field.getValue(), key))); - switch (value) { - case "BEST_SELLING": { - return BEST_SELLING; - } + break; + } - case "CREATED_AT": { - return CREATED_AT; - } + case "node": { + Node optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = UnknownNode.create(jsonAsObject(field.getValue(), key)); + } - case "ID": { - return ID; - } + responseData.put(key, optional1); + + break; + } + + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Node optional2 = null; + if (!element1.isJsonNull()) { + optional2 = UnknownNode.create(jsonAsObject(element1, key)); + } + + list1.add(optional2); + } + + responseData.put(key, list1); + + break; + } + + case "page": { + Page optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Page(jsonAsObject(field.getValue(), key)); + } - case "PRICE": { - return PRICE; - } + responseData.put(key, optional1); - case "PRODUCT_TYPE": { - return PRODUCT_TYPE; - } + break; + } - case "RELEVANCE": { - return RELEVANCE; - } + case "pageByHandle": { + Page optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Page(jsonAsObject(field.getValue(), key)); + } - case "TITLE": { - return TITLE; - } + responseData.put(key, optional1); - case "UPDATED_AT": { - return UPDATED_AT; - } + break; + } - case "VENDOR": { - return VENDOR; - } + case "pages": { + responseData.put(key, new PageConnection(jsonAsObject(field.getValue(), key))); - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case BEST_SELLING: { - return "BEST_SELLING"; - } + break; + } - case CREATED_AT: { - return "CREATED_AT"; - } + case "predictiveSearch": { + PredictiveSearchResult optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new PredictiveSearchResult(jsonAsObject(field.getValue(), key)); + } - case ID: { - return "ID"; - } + responseData.put(key, optional1); - case PRICE: { - return "PRICE"; - } + break; + } - case PRODUCT_TYPE: { - return "PRODUCT_TYPE"; - } + case "product": { + Product optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Product(jsonAsObject(field.getValue(), key)); + } - case RELEVANCE: { - return "RELEVANCE"; - } + responseData.put(key, optional1); - case TITLE: { - return "TITLE"; - } + break; + } - case UPDATED_AT: { - return "UPDATED_AT"; - } + case "productByHandle": { + Product optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Product(jsonAsObject(field.getValue(), key)); + } - case VENDOR: { - return "VENDOR"; - } + responseData.put(key, optional1); - default: { - return ""; - } - } - } - } + break; + } - public interface ProductVariantQueryDefinition { - void define(ProductVariantQuery _queryBuilder); - } + case "productRecommendations": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Product(jsonAsObject(element1, key))); + } - /** - * A product variant represents a different version of a product, such as differing sizes or differing - * colors. - */ - public static class ProductVariantQuery extends Query { - ProductVariantQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + optional1 = list1; + } - startField("id"); - } + responseData.put(key, optional1); - /** - * Indicates if the product variant is available for sale. - */ - public ProductVariantQuery availableForSale() { - startField("availableForSale"); + break; + } - return this; - } + case "productTags": { + responseData.put(key, new StringConnection(jsonAsObject(field.getValue(), key))); - /** - * The barcode (for example, ISBN, UPC, or GTIN) associated with the variant. - */ - public ProductVariantQuery barcode() { - startField("barcode"); + break; + } - return this; - } + case "productTypes": { + responseData.put(key, new StringConnection(jsonAsObject(field.getValue(), key))); - /** - * The compare at price of the variant. This can be used to mark a variant as on sale, when - * `compareAtPrice` is higher than `price`. - */ - public ProductVariantQuery compareAtPrice(MoneyV2QueryDefinition queryDef) { - startField("compareAtPrice"); + break; + } - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + case "products": { + responseData.put(key, new ProductConnection(jsonAsObject(field.getValue(), key))); - return this; - } + break; + } - /** - * The compare at price of the variant. This can be used to mark a variant as on sale, when - * `compareAtPriceV2` is higher than `priceV2`. - * - * @deprecated Use `compareAtPrice` instead. - */ - @Deprecated - public ProductVariantQuery compareAtPriceV2(MoneyV2QueryDefinition queryDef) { - startField("compareAtPriceV2"); + case "publicApiVersions": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ApiVersion(jsonAsObject(element1, key))); + } - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + responseData.put(key, list1); - return this; - } + break; + } - /** - * Whether a product is out of stock but still available for purchase (used for backorders). - */ - public ProductVariantQuery currentlyNotInStock() { - startField("currentlyNotInStock"); + case "search": { + responseData.put(key, new SearchResultItemConnection(jsonAsObject(field.getValue(), key))); - return this; - } + break; + } - /** - * Image associated with the product variant. This field falls back to the product image if no image is - * available. - */ - public ProductVariantQuery image(ImageQueryDefinition queryDef) { - startField("image"); + case "shop": { + responseData.put(key, new Shop(jsonAsObject(field.getValue(), key))); - _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; - } + case "urlRedirects": { + responseData.put(key, new UrlRedirectConnection(jsonAsObject(field.getValue(), key))); - public class MetafieldArguments extends Arguments { - MetafieldArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } + break; + } - /** - * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. - */ - public MetafieldArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } } - public interface MetafieldArgumentsDefinition { - void define(MetafieldArguments args); - } - - /** - * Returns a metafield found by namespace and key. - */ - public ProductVariantQuery metafield(String key, MetafieldQueryDefinition queryDef) { - return metafield(key, args -> {}, queryDef); + public String getGraphQlTypeName() { + return "QueryRoot"; } /** - * Returns a metafield found by namespace and key. + * Fetch a specific Article by its ID. */ - public ProductVariantQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { - startField("metafield"); - - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); - - argsDef.define(new MetafieldArguments(_queryBuilder)); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Article getArticle() { + return (Article) get("article"); + } + public QueryRoot setArticle(Article arg) { + optimisticData.put(getKey("article"), arg); return this; } /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * List of the shop's articles. */ - public ProductVariantQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); - - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ArticleConnection getArticles() { + return (ArticleConnection) get("articles"); + } + public QueryRoot setArticles(ArticleConnection arg) { + optimisticData.put(getKey("articles"), arg); return this; } /** - * The product variant’s price. + * Fetch a specific `Blog` by one of its unique attributes. */ - public ProductVariantQuery price(MoneyV2QueryDefinition queryDef) { - startField("price"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public Blog getBlog() { + return (Blog) get("blog"); + } + public QueryRoot setBlog(Blog arg) { + optimisticData.put(getKey("blog"), arg); return this; } /** - * The product variant’s price. + * Find a blog by its handle. * - * @deprecated Use `price` instead. + * @deprecated Use `blog` instead. */ - @Deprecated - public ProductVariantQuery priceV2(MoneyV2QueryDefinition queryDef) { - startField("priceV2"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public Blog getBlogByHandle() { + return (Blog) get("blogByHandle"); + } + public QueryRoot setBlogByHandle(Blog arg) { + optimisticData.put(getKey("blogByHandle"), arg); return this; } /** - * The product object that the product variant belongs to. + * List of the shop's blogs. */ - public ProductVariantQuery product(ProductQueryDefinition queryDef) { - startField("product"); - _queryBuilder.append('{'); - queryDef.define(new ProductQuery(_queryBuilder)); - _queryBuilder.append('}'); + public BlogConnection getBlogs() { + return (BlogConnection) get("blogs"); + } + public QueryRoot setBlogs(BlogConnection arg) { + optimisticData.put(getKey("blogs"), arg); return this; } /** - * The total sellable quantity of the variant for online sales channels. + * Retrieve a cart by its ID. For more information, refer to + * [Manage a cart with the Storefront API](https://shopify.dev/custom-storefronts/cart/manage). */ - public ProductVariantQuery quantityAvailable() { - startField("quantityAvailable"); - - return this; - } - - public class QuantityPriceBreaksArguments extends Arguments { - QuantityPriceBreaksArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public QuantityPriceBreaksArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public QuantityPriceBreaksArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the last `n` elements from the list. - */ - public QuantityPriceBreaksArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public QuantityPriceBreaksArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - } - public interface QuantityPriceBreaksArgumentsDefinition { - void define(QuantityPriceBreaksArguments args); + public Cart getCart() { + return (Cart) get("cart"); } - /** - * A list of quantity breaks for the product variant. - */ - public ProductVariantQuery quantityPriceBreaks(QuantityPriceBreakConnectionQueryDefinition queryDef) { - return quantityPriceBreaks(args -> {}, queryDef); + public QueryRoot setCart(Cart arg) { + optimisticData.put(getKey("cart"), arg); + return this; } /** - * A list of quantity breaks for the product variant. + * A poll for the status of the cart checkout completion and order creation. */ - public ProductVariantQuery quantityPriceBreaks(QuantityPriceBreaksArgumentsDefinition argsDef, QuantityPriceBreakConnectionQueryDefinition queryDef) { - startField("quantityPriceBreaks"); - - QuantityPriceBreaksArguments args = new QuantityPriceBreaksArguments(_queryBuilder); - argsDef.define(args); - QuantityPriceBreaksArguments.end(args); - _queryBuilder.append('{'); - queryDef.define(new QuantityPriceBreakConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CartCompletionAttemptResult getCartCompletionAttempt() { + return (CartCompletionAttemptResult) get("cartCompletionAttempt"); + } + public QueryRoot setCartCompletionAttempt(CartCompletionAttemptResult arg) { + optimisticData.put(getKey("cartCompletionAttempt"), arg); return this; } /** - * The quantity rule for the product variant in a given context. + * Fetch a specific `Collection` by one of its unique attributes. */ - public ProductVariantQuery quantityRule(QuantityRuleQueryDefinition queryDef) { - startField("quantityRule"); - - _queryBuilder.append('{'); - queryDef.define(new QuantityRuleQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public Collection getCollection() { + return (Collection) get("collection"); } - /** - * Whether a customer needs to provide a shipping address when placing an order for the product - * variant. - */ - public ProductVariantQuery requiresShipping() { - startField("requiresShipping"); - + public QueryRoot setCollection(Collection arg) { + optimisticData.put(getKey("collection"), arg); return this; } /** - * List of product options applied to the variant. + * Find a collection by its handle. + * + * @deprecated Use `collection` instead. */ - public ProductVariantQuery selectedOptions(SelectedOptionQueryDefinition queryDef) { - startField("selectedOptions"); - _queryBuilder.append('{'); - queryDef.define(new SelectedOptionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Collection getCollectionByHandle() { + return (Collection) get("collectionByHandle"); + } + public QueryRoot setCollectionByHandle(Collection arg) { + optimisticData.put(getKey("collectionByHandle"), arg); return this; } - public class SellingPlanAllocationsArguments extends Arguments { - SellingPlanAllocationsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public SellingPlanAllocationsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public SellingPlanAllocationsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the last `n` elements from the list. - */ - public SellingPlanAllocationsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public SellingPlanAllocationsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + /** + * List of the shop’s collections. + */ - /** - * Reverse the order of the underlying list. - */ - public SellingPlanAllocationsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + public CollectionConnection getCollections() { + return (CollectionConnection) get("collections"); } - public interface SellingPlanAllocationsArgumentsDefinition { - void define(SellingPlanAllocationsArguments args); + public QueryRoot setCollections(CollectionConnection arg) { + optimisticData.put(getKey("collections"), arg); + return this; } /** - * Represents an association between a variant and a selling plan. Selling plan allocations describe - * which selling plans are available for each variant, and what their impact is on pricing. + * The customer associated with the given access token. Tokens are obtained by using the + * [`customerAccessTokenCreate` + * mutation](https://shopify.dev/docs/api/storefront/latest/mutations/customerAccessTokenCreate). */ - public ProductVariantQuery sellingPlanAllocations(SellingPlanAllocationConnectionQueryDefinition queryDef) { - return sellingPlanAllocations(args -> {}, queryDef); + + public Customer getCustomer() { + return (Customer) get("customer"); + } + + public QueryRoot setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); + return this; } /** - * Represents an association between a variant and a selling plan. Selling plan allocations describe - * which selling plans are available for each variant, and what their impact is on pricing. + * Returns the localized experiences configured for the shop. */ - public ProductVariantQuery sellingPlanAllocations(SellingPlanAllocationsArgumentsDefinition argsDef, SellingPlanAllocationConnectionQueryDefinition queryDef) { - startField("sellingPlanAllocations"); - - SellingPlanAllocationsArguments args = new SellingPlanAllocationsArguments(_queryBuilder); - argsDef.define(args); - SellingPlanAllocationsArguments.end(args); - _queryBuilder.append('{'); - queryDef.define(new SellingPlanAllocationConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Localization getLocalization() { + return (Localization) get("localization"); + } + public QueryRoot setLocalization(Localization arg) { + optimisticData.put(getKey("localization"), arg); return this; } /** - * The SKU (stock keeping unit) associated with the variant. + * List of the shop's locations that support in-store pickup. + * When sorting by distance, you must specify a location via the `near` argument. */ - public ProductVariantQuery sku() { - startField("sku"); + public LocationConnection getLocations() { + return (LocationConnection) get("locations"); + } + + public QueryRoot setLocations(LocationConnection arg) { + optimisticData.put(getKey("locations"), arg); return this; } - public class StoreAvailabilityArguments extends Arguments { - StoreAvailabilityArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * Retrieve a [navigation menu](https://help.shopify.com/manual/online-store/menus-and-links) by its + * handle. + */ - /** - * Used to sort results based on proximity to the provided location. - */ - public StoreAvailabilityArguments near(GeoCoordinateInput value) { - if (value != null) { - startArgument("near"); - value.appendTo(_queryBuilder); - } - return this; - } + public Menu getMenu() { + return (Menu) get("menu"); + } - /** - * Returns up to the first `n` elements from the list. - */ - public StoreAvailabilityArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public QueryRoot setMenu(Menu arg) { + optimisticData.put(getKey("menu"), arg); + return this; + } - /** - * Returns the elements that come after the specified cursor. - */ - public StoreAvailabilityArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + /** + * Fetch a specific Metaobject by one of its unique identifiers. + */ - /** - * Returns up to the last `n` elements from the list. - */ - public StoreAvailabilityArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + public Metaobject getMetaobject() { + return (Metaobject) get("metaobject"); + } - /** - * Returns the elements that come before the specified cursor. - */ - public StoreAvailabilityArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public QueryRoot setMetaobject(Metaobject arg) { + optimisticData.put(getKey("metaobject"), arg); + return this; + } - /** - * Reverse the order of the underlying list. - */ - public StoreAvailabilityArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + /** + * All active metaobjects for the shop. + */ + + public MetaobjectConnection getMetaobjects() { + return (MetaobjectConnection) get("metaobjects"); } - public interface StoreAvailabilityArgumentsDefinition { - void define(StoreAvailabilityArguments args); + public QueryRoot setMetaobjects(MetaobjectConnection arg) { + optimisticData.put(getKey("metaobjects"), arg); + return this; } /** - * The in-store pickup availability of this variant by location. + * Returns a specific node by ID. */ - public ProductVariantQuery storeAvailability(StoreAvailabilityConnectionQueryDefinition queryDef) { - return storeAvailability(args -> {}, queryDef); + + public Node getNode() { + return (Node) get("node"); + } + + public QueryRoot setNode(Node arg) { + optimisticData.put(getKey("node"), arg); + return this; } /** - * The in-store pickup availability of this variant by location. + * Returns the list of nodes with the given IDs. */ - public ProductVariantQuery storeAvailability(StoreAvailabilityArgumentsDefinition argsDef, StoreAvailabilityConnectionQueryDefinition queryDef) { - startField("storeAvailability"); - StoreAvailabilityArguments args = new StoreAvailabilityArguments(_queryBuilder); - argsDef.define(args); - StoreAvailabilityArguments.end(args); + public List getNodes() { + return (List) get("nodes"); + } - _queryBuilder.append('{'); - queryDef.define(new StoreAvailabilityConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public QueryRoot setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; + } + + /** + * Fetch a specific `Page` by one of its unique attributes. + */ + + public Page getPage() { + return (Page) get("page"); + } + public QueryRoot setPage(Page arg) { + optimisticData.put(getKey("page"), arg); return this; } /** - * Whether tax is charged when the product variant is sold. + * Find a page by its handle. + * + * @deprecated Use `page` instead. */ - public ProductVariantQuery taxable() { - startField("taxable"); + public Page getPageByHandle() { + return (Page) get("pageByHandle"); + } + + public QueryRoot setPageByHandle(Page arg) { + optimisticData.put(getKey("pageByHandle"), arg); return this; } /** - * The product variant’s title. + * List of the shop's pages. */ - public ProductVariantQuery title() { - startField("title"); + public PageConnection getPages() { + return (PageConnection) get("pages"); + } + + public QueryRoot setPages(PageConnection arg) { + optimisticData.put(getKey("pages"), arg); return this; } /** - * The unit price value for the variant based on the variant's measurement. + * List of the predictive search results. */ - public ProductVariantQuery unitPrice(MoneyV2QueryDefinition queryDef) { - startField("unitPrice"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public PredictiveSearchResult getPredictiveSearch() { + return (PredictiveSearchResult) get("predictiveSearch"); + } + public QueryRoot setPredictiveSearch(PredictiveSearchResult arg) { + optimisticData.put(getKey("predictiveSearch"), arg); return this; } /** - * The unit price measurement for the variant. + * Fetch a specific `Product` by one of its unique attributes. */ - public ProductVariantQuery unitPriceMeasurement(UnitPriceMeasurementQueryDefinition queryDef) { - startField("unitPriceMeasurement"); - _queryBuilder.append('{'); - queryDef.define(new UnitPriceMeasurementQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Product getProduct() { + return (Product) get("product"); + } + public QueryRoot setProduct(Product arg) { + optimisticData.put(getKey("product"), arg); return this; } /** - * The weight of the product variant in the unit system specified with `weight_unit`. + * Find a product by its handle. + * + * @deprecated Use `product` instead. */ - public ProductVariantQuery weight() { - startField("weight"); + public Product getProductByHandle() { + return (Product) get("productByHandle"); + } + + public QueryRoot setProductByHandle(Product arg) { + optimisticData.put(getKey("productByHandle"), arg); return this; } /** - * Unit of measurement for weight. + * Find recommended products related to a given `product_id`. + * To learn more about how recommendations are generated, see + * [*Showing product recommendations on product + * pages*](https://help.shopify.com/themes/development/recommended-products). */ - public ProductVariantQuery weightUnit() { - startField("weightUnit"); + public List getProductRecommendations() { + return (List) get("productRecommendations"); + } + + public QueryRoot setProductRecommendations(List arg) { + optimisticData.put(getKey("productRecommendations"), arg); return this; } - } - /** - * A product variant represents a different version of a product, such as differing sizes or differing - * colors. - */ - public static class ProductVariant extends AbstractResponse implements HasMetafields, Merchandise, MetafieldParentResource, MetafieldReference, Node { - public ProductVariant() { + /** + * Tags added to products. + * Additional access scope required: unauthenticated_read_product_tags. + */ + + public StringConnection getProductTags() { + return (StringConnection) get("productTags"); } - public ProductVariant(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "availableForSale": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + public QueryRoot setProductTags(StringConnection arg) { + optimisticData.put(getKey("productTags"), arg); + return this; + } - break; - } + /** + * List of product types for the shop's products that are published to your app. + */ - case "barcode": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + public StringConnection getProductTypes() { + return (StringConnection) get("productTypes"); + } - responseData.put(key, optional1); + public QueryRoot setProductTypes(StringConnection arg) { + optimisticData.put(getKey("productTypes"), arg); + return this; + } - break; - } + /** + * List of the shop’s products. For storefront search, use [`search` + * query](https://shopify.dev/docs/api/storefront/latest/queries/search). + */ - case "compareAtPrice": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } + public ProductConnection getProducts() { + return (ProductConnection) get("products"); + } - responseData.put(key, optional1); + public QueryRoot setProducts(ProductConnection arg) { + optimisticData.put(getKey("products"), arg); + return this; + } - break; - } + /** + * The list of public Storefront API versions, including supported, release candidate and unstable + * versions. + */ - case "compareAtPriceV2": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } + public List getPublicApiVersions() { + return (List) get("publicApiVersions"); + } - responseData.put(key, optional1); + public QueryRoot setPublicApiVersions(List arg) { + optimisticData.put(getKey("publicApiVersions"), arg); + return this; + } - break; - } + /** + * List of the search results. + */ - case "currentlyNotInStock": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + public SearchResultItemConnection getSearch() { + return (SearchResultItemConnection) get("search"); + } - break; - } + public QueryRoot setSearch(SearchResultItemConnection arg) { + optimisticData.put(getKey("search"), arg); + return this; + } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + /** + * The shop associated with the storefront access token. + */ - break; - } + public Shop getShop() { + return (Shop) get("shop"); + } - case "image": { - Image optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); - } + public QueryRoot setShop(Shop arg) { + optimisticData.put(getKey("shop"), arg); + return this; + } - responseData.put(key, optional1); + /** + * A list of redirects for a shop. + */ - break; - } + public UrlRedirectConnection getUrlRedirects() { + return (UrlRedirectConnection) get("urlRedirects"); + } - case "metafield": { - Metafield optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); - } + public QueryRoot setUrlRedirects(UrlRedirectConnection arg) { + optimisticData.put(getKey("urlRedirects"), arg); + return this; + } - responseData.put(key, optional1); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "article": return true; - break; - } + case "articles": return true; - case "metafields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } + case "blog": return true; - list1.add(optional2); - } + case "blogByHandle": return true; - responseData.put(key, list1); + case "blogs": return true; - break; - } + case "cart": return true; - case "price": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "cartCompletionAttempt": return false; - break; - } + case "collection": return true; - case "priceV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "collectionByHandle": return true; - break; - } + case "collections": return true; - case "product": { - responseData.put(key, new Product(jsonAsObject(field.getValue(), key))); + case "customer": return true; - break; - } + case "localization": return true; - case "quantityAvailable": { - Integer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); - } + case "locations": return true; - responseData.put(key, optional1); + case "menu": return true; - break; - } + case "metaobject": return true; - case "quantityPriceBreaks": { - responseData.put(key, new QuantityPriceBreakConnection(jsonAsObject(field.getValue(), key))); + case "metaobjects": return true; - break; - } + case "node": return false; - case "quantityRule": { - responseData.put(key, new QuantityRule(jsonAsObject(field.getValue(), key))); + case "nodes": return false; - break; - } + case "page": return true; - case "requiresShipping": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + case "pageByHandle": return true; - break; - } + case "pages": return true; - case "selectedOptions": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SelectedOption(jsonAsObject(element1, key))); - } + case "predictiveSearch": return true; - responseData.put(key, list1); + case "product": return true; - break; - } + case "productByHandle": return true; - case "sellingPlanAllocations": { - responseData.put(key, new SellingPlanAllocationConnection(jsonAsObject(field.getValue(), key))); + case "productRecommendations": return true; - break; - } + case "productTags": return true; - case "sku": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case "productTypes": return true; - responseData.put(key, optional1); + case "products": return true; - break; - } + case "publicApiVersions": return true; - case "storeAvailability": { - responseData.put(key, new StoreAvailabilityConnection(jsonAsObject(field.getValue(), key))); + case "search": return true; - break; - } + case "shop": return true; - case "taxable": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + case "urlRedirects": return true; - break; - } + default: return false; + } + } + } + + public interface SEOQueryDefinition { + void define(SEOQuery _queryBuilder); + } + + /** + * SEO information. + */ + public static class SEOQuery extends Query { + SEOQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * The meta description. + */ + public SEOQuery description() { + startField("description"); - break; - } + return this; + } - case "unitPrice": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } + /** + * The SEO title. + */ + public SEOQuery title() { + startField("title"); - responseData.put(key, optional1); + return this; + } + } - break; - } + /** + * SEO information. + */ + public static class SEO extends AbstractResponse { + public SEO() { + } - case "unitPriceMeasurement": { - UnitPriceMeasurement optional1 = null; + public SEO(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "description": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new UnitPriceMeasurement(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -62383,10 +60376,10 @@ public ProductVariant(JsonObject fields) throws SchemaViolationError { break; } - case "weight": { - Double optional1 = null; + case "title": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsDouble(field.getValue(), key); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -62394,12 +60387,6 @@ public ProductVariant(JsonObject fields) throws SchemaViolationError { break; } - case "weightUnit": { - responseData.put(key, WeightUnit.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -62411,449 +60398,574 @@ public ProductVariant(JsonObject fields) throws SchemaViolationError { } } - public ProductVariant(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "ProductVariant"; + return "SEO"; } /** - * Indicates if the product variant is available for sale. + * The meta description. */ - public Boolean getAvailableForSale() { - return (Boolean) get("availableForSale"); + public String getDescription() { + return (String) get("description"); } - public ProductVariant setAvailableForSale(Boolean arg) { - optimisticData.put(getKey("availableForSale"), arg); + public SEO setDescription(String arg) { + optimisticData.put(getKey("description"), arg); return this; } /** - * The barcode (for example, ISBN, UPC, or GTIN) associated with the variant. + * The SEO title. */ - public String getBarcode() { - return (String) get("barcode"); + public String getTitle() { + return (String) get("title"); } - public ProductVariant setBarcode(String arg) { - optimisticData.put(getKey("barcode"), arg); + public SEO setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } - /** - * The compare at price of the variant. This can be used to mark a variant as on sale, when - * `compareAtPrice` is higher than `price`. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "description": return false; - public MoneyV2 getCompareAtPrice() { - return (MoneyV2) get("compareAtPrice"); + case "title": return false; + + default: return false; + } } + } - public ProductVariant setCompareAtPrice(MoneyV2 arg) { - optimisticData.put(getKey("compareAtPrice"), arg); - return this; + public interface ScriptDiscountApplicationQueryDefinition { + void define(ScriptDiscountApplicationQuery _queryBuilder); + } + + /** + * Script discount applications capture the intentions of a discount that + * was created by a Shopify Script. + */ + public static class ScriptDiscountApplicationQuery extends Query { + ScriptDiscountApplicationQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The compare at price of the variant. This can be used to mark a variant as on sale, when - * `compareAtPriceV2` is higher than `priceV2`. - * - * @deprecated Use `compareAtPrice` instead. + * The method by which the discount's value is allocated to its entitled items. */ + public ScriptDiscountApplicationQuery allocationMethod() { + startField("allocationMethod"); - public MoneyV2 getCompareAtPriceV2() { - return (MoneyV2) get("compareAtPriceV2"); - } - - public ProductVariant setCompareAtPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("compareAtPriceV2"), arg); return this; } /** - * Whether a product is out of stock but still available for purchase (used for backorders). + * Which lines of targetType that the discount is allocated over. */ + public ScriptDiscountApplicationQuery targetSelection() { + startField("targetSelection"); - public Boolean getCurrentlyNotInStock() { - return (Boolean) get("currentlyNotInStock"); - } - - public ProductVariant setCurrentlyNotInStock(Boolean arg) { - optimisticData.put(getKey("currentlyNotInStock"), arg); return this; } /** - * A globally-unique ID. + * The type of line that the discount is applicable towards. */ + public ScriptDiscountApplicationQuery targetType() { + startField("targetType"); - public ID getId() { - return (ID) get("id"); + return this; } /** - * Image associated with the product variant. This field falls back to the product image if no image is - * available. + * The title of the application as defined by the Script. */ + public ScriptDiscountApplicationQuery title() { + startField("title"); - public Image getImage() { - return (Image) get("image"); - } - - public ProductVariant setImage(Image arg) { - optimisticData.put(getKey("image"), arg); return this; } /** - * Returns a metafield found by namespace and key. + * The value of the discount application. */ + public ScriptDiscountApplicationQuery value(PricingValueQueryDefinition queryDef) { + startField("value"); - public Metafield getMetafield() { - return (Metafield) get("metafield"); - } + _queryBuilder.append('{'); + queryDef.define(new PricingValueQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ProductVariant setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); return this; } + } - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ - - public List getMetafields() { - return (List) get("metafields"); + /** + * Script discount applications capture the intentions of a discount that + * was created by a Shopify Script. + */ + public static class ScriptDiscountApplication extends AbstractResponse implements DiscountApplication { + public ScriptDiscountApplication() { } - public ProductVariant setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); - return this; - } + public ScriptDiscountApplication(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "allocationMethod": { + responseData.put(key, DiscountApplicationAllocationMethod.fromGraphQl(jsonAsString(field.getValue(), key))); - /** - * The product variant’s price. - */ + break; + } - public MoneyV2 getPrice() { - return (MoneyV2) get("price"); - } + case "targetSelection": { + responseData.put(key, DiscountApplicationTargetSelection.fromGraphQl(jsonAsString(field.getValue(), key))); - public ProductVariant setPrice(MoneyV2 arg) { - optimisticData.put(getKey("price"), arg); - return this; - } + break; + } - /** - * The product variant’s price. - * - * @deprecated Use `price` instead. - */ + case "targetType": { + responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); - public MoneyV2 getPriceV2() { - return (MoneyV2) get("priceV2"); - } + break; + } - public ProductVariant setPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("priceV2"), arg); - return this; - } + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * The product object that the product variant belongs to. - */ + break; + } - public Product getProduct() { - return (Product) get("product"); + case "value": { + responseData.put(key, UnknownPricingValue.create(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public ProductVariant setProduct(Product arg) { - optimisticData.put(getKey("product"), arg); - return this; + public String getGraphQlTypeName() { + return "ScriptDiscountApplication"; } /** - * The total sellable quantity of the variant for online sales channels. + * The method by which the discount's value is allocated to its entitled items. */ - public Integer getQuantityAvailable() { - return (Integer) get("quantityAvailable"); + public DiscountApplicationAllocationMethod getAllocationMethod() { + return (DiscountApplicationAllocationMethod) get("allocationMethod"); } - public ProductVariant setQuantityAvailable(Integer arg) { - optimisticData.put(getKey("quantityAvailable"), arg); + public ScriptDiscountApplication setAllocationMethod(DiscountApplicationAllocationMethod arg) { + optimisticData.put(getKey("allocationMethod"), arg); return this; } /** - * A list of quantity breaks for the product variant. + * Which lines of targetType that the discount is allocated over. */ - public QuantityPriceBreakConnection getQuantityPriceBreaks() { - return (QuantityPriceBreakConnection) get("quantityPriceBreaks"); + public DiscountApplicationTargetSelection getTargetSelection() { + return (DiscountApplicationTargetSelection) get("targetSelection"); } - public ProductVariant setQuantityPriceBreaks(QuantityPriceBreakConnection arg) { - optimisticData.put(getKey("quantityPriceBreaks"), arg); + public ScriptDiscountApplication setTargetSelection(DiscountApplicationTargetSelection arg) { + optimisticData.put(getKey("targetSelection"), arg); return this; } /** - * The quantity rule for the product variant in a given context. + * The type of line that the discount is applicable towards. */ - public QuantityRule getQuantityRule() { - return (QuantityRule) get("quantityRule"); + public DiscountApplicationTargetType getTargetType() { + return (DiscountApplicationTargetType) get("targetType"); } - public ProductVariant setQuantityRule(QuantityRule arg) { - optimisticData.put(getKey("quantityRule"), arg); + public ScriptDiscountApplication setTargetType(DiscountApplicationTargetType arg) { + optimisticData.put(getKey("targetType"), arg); return this; } /** - * Whether a customer needs to provide a shipping address when placing an order for the product - * variant. + * The title of the application as defined by the Script. */ - public Boolean getRequiresShipping() { - return (Boolean) get("requiresShipping"); + public String getTitle() { + return (String) get("title"); } - public ProductVariant setRequiresShipping(Boolean arg) { - optimisticData.put(getKey("requiresShipping"), arg); + public ScriptDiscountApplication setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } /** - * List of product options applied to the variant. + * The value of the discount application. */ - public List getSelectedOptions() { - return (List) get("selectedOptions"); + public PricingValue getValue() { + return (PricingValue) get("value"); } - public ProductVariant setSelectedOptions(List arg) { - optimisticData.put(getKey("selectedOptions"), arg); + public ScriptDiscountApplication setValue(PricingValue arg) { + optimisticData.put(getKey("value"), arg); return this; } - /** - * Represents an association between a variant and a selling plan. Selling plan allocations describe - * which selling plans are available for each variant, and what their impact is on pricing. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "allocationMethod": return false; - public SellingPlanAllocationConnection getSellingPlanAllocations() { - return (SellingPlanAllocationConnection) get("sellingPlanAllocations"); - } + case "targetSelection": return false; - public ProductVariant setSellingPlanAllocations(SellingPlanAllocationConnection arg) { - optimisticData.put(getKey("sellingPlanAllocations"), arg); - return this; + case "targetType": return false; + + case "title": return false; + + case "value": return false; + + default: return false; + } } + } + /** + * Specifies whether to perform a partial word match on the last search term. + */ + public enum SearchPrefixQueryType { /** - * The SKU (stock keeping unit) associated with the variant. + * Perform a partial word match on the last search term. */ + LAST, - public String getSku() { - return (String) get("sku"); - } + /** + * Don't perform a partial word match on the last search term. + */ + NONE, - public ProductVariant setSku(String arg) { - optimisticData.put(getKey("sku"), arg); - return this; + UNKNOWN_VALUE; + + public static SearchPrefixQueryType fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "LAST": { + return LAST; + } + + case "NONE": { + return NONE; + } + + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case LAST: { + return "LAST"; + } - /** - * The in-store pickup availability of this variant by location. - */ + case NONE: { + return "NONE"; + } - public StoreAvailabilityConnection getStoreAvailability() { - return (StoreAvailabilityConnection) get("storeAvailability"); + default: { + return ""; + } + } } + } - public ProductVariant setStoreAvailability(StoreAvailabilityConnection arg) { - optimisticData.put(getKey("storeAvailability"), arg); - return this; + public interface SearchQuerySuggestionQueryDefinition { + void define(SearchQuerySuggestionQuery _queryBuilder); + } + + /** + * A search query suggestion. + */ + public static class SearchQuerySuggestionQuery extends Query { + SearchQuerySuggestionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * Whether tax is charged when the product variant is sold. + * The text of the search query suggestion with highlighted HTML tags. */ + public SearchQuerySuggestionQuery styledText() { + startField("styledText"); - public Boolean getTaxable() { - return (Boolean) get("taxable"); - } - - public ProductVariant setTaxable(Boolean arg) { - optimisticData.put(getKey("taxable"), arg); return this; } /** - * The product variant’s title. + * The text of the search query suggestion. */ + public SearchQuerySuggestionQuery text() { + startField("text"); - public String getTitle() { - return (String) get("title"); - } - - public ProductVariant setTitle(String arg) { - optimisticData.put(getKey("title"), arg); return this; } /** - * The unit price value for the variant based on the variant's measurement. + * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for + * tracking the origin of the traffic. */ + public SearchQuerySuggestionQuery trackingParameters() { + startField("trackingParameters"); - public MoneyV2 getUnitPrice() { - return (MoneyV2) get("unitPrice"); + return this; } + } - public ProductVariant setUnitPrice(MoneyV2 arg) { - optimisticData.put(getKey("unitPrice"), arg); - return this; + /** + * A search query suggestion. + */ + public static class SearchQuerySuggestion extends AbstractResponse implements Trackable { + public SearchQuerySuggestion() { } - /** - * The unit price measurement for the variant. - */ + public SearchQuerySuggestion(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "styledText": { + responseData.put(key, jsonAsString(field.getValue(), key)); - public UnitPriceMeasurement getUnitPriceMeasurement() { - return (UnitPriceMeasurement) get("unitPriceMeasurement"); + break; + } + + case "text": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "trackingParameters": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public ProductVariant setUnitPriceMeasurement(UnitPriceMeasurement arg) { - optimisticData.put(getKey("unitPriceMeasurement"), arg); - return this; + public String getGraphQlTypeName() { + return "SearchQuerySuggestion"; } /** - * The weight of the product variant in the unit system specified with `weight_unit`. + * The text of the search query suggestion with highlighted HTML tags. */ - public Double getWeight() { - return (Double) get("weight"); + public String getStyledText() { + return (String) get("styledText"); } - public ProductVariant setWeight(Double arg) { - optimisticData.put(getKey("weight"), arg); + public SearchQuerySuggestion setStyledText(String arg) { + optimisticData.put(getKey("styledText"), arg); return this; } /** - * Unit of measurement for weight. + * The text of the search query suggestion. */ - public WeightUnit getWeightUnit() { - return (WeightUnit) get("weightUnit"); + public String getText() { + return (String) get("text"); } - public ProductVariant setWeightUnit(WeightUnit arg) { - optimisticData.put(getKey("weightUnit"), arg); + public SearchQuerySuggestion setText(String arg) { + optimisticData.put(getKey("text"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "availableForSale": return false; - - case "barcode": return false; - - case "compareAtPrice": return true; - - case "compareAtPriceV2": return true; - - case "currentlyNotInStock": return false; - - case "id": return false; + /** + * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for + * tracking the origin of the traffic. + */ - case "image": return true; + public String getTrackingParameters() { + return (String) get("trackingParameters"); + } - case "metafield": return true; + public SearchQuerySuggestion setTrackingParameters(String arg) { + optimisticData.put(getKey("trackingParameters"), arg); + return this; + } - case "metafields": return true; + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "styledText": return false; - case "price": return true; + case "text": return false; - case "priceV2": return true; + case "trackingParameters": return false; - case "product": return true; + default: return false; + } + } + } - case "quantityAvailable": return false; + public interface SearchResultItemQueryDefinition { + void define(SearchResultItemQuery _queryBuilder); + } - case "quantityPriceBreaks": return true; + /** + * A search result that matches the search query. + */ + public static class SearchResultItemQuery extends Query { + SearchResultItemQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - case "quantityRule": return true; + startField("__typename"); + } - case "requiresShipping": return false; + public SearchResultItemQuery onArticle(ArticleQueryDefinition queryDef) { + startInlineFragment("Article"); + queryDef.define(new ArticleQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case "selectedOptions": return true; + public SearchResultItemQuery onPage(PageQueryDefinition queryDef) { + startInlineFragment("Page"); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case "sellingPlanAllocations": return true; + public SearchResultItemQuery onProduct(ProductQueryDefinition queryDef) { + startInlineFragment("Product"); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + } - case "sku": return false; + public interface SearchResultItem { + String getGraphQlTypeName(); + } - case "storeAvailability": return true; + /** + * A search result that matches the search query. + */ + public static class UnknownSearchResultItem extends AbstractResponse implements SearchResultItem { + public UnknownSearchResultItem() { + } - case "taxable": return false; + public UnknownSearchResultItem(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - case "title": return false; + public static SearchResultItem create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "Article": { + return new Article(fields); + } - case "unitPrice": return true; + case "Page": { + return new Page(fields); + } - case "unitPriceMeasurement": return true; + case "Product": { + return new Product(fields); + } - case "weight": return false; + default: { + return new UnknownSearchResultItem(fields); + } + } + } - case "weightUnit": return false; + public String getGraphQlTypeName() { + return (String) get("__typename"); + } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { default: return false; } } } - public interface ProductVariantConnectionQueryDefinition { - void define(ProductVariantConnectionQuery _queryBuilder); + public interface SearchResultItemConnectionQueryDefinition { + void define(SearchResultItemConnectionQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple ProductVariants. + * An auto-generated type for paginating through multiple SearchResultItems. */ - public static class ProductVariantConnectionQuery extends Query { - ProductVariantConnectionQuery(StringBuilder _queryBuilder) { + public static class SearchResultItemConnectionQuery extends Query { + SearchResultItemConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A list of edges. */ - public ProductVariantConnectionQuery edges(ProductVariantEdgeQueryDefinition queryDef) { + public SearchResultItemConnectionQuery edges(SearchResultItemEdgeQueryDefinition queryDef) { startField("edges"); _queryBuilder.append('{'); - queryDef.define(new ProductVariantEdgeQuery(_queryBuilder)); + queryDef.define(new SearchResultItemEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in ProductVariantEdge. + * A list of the nodes contained in SearchResultItemEdge. */ - public ProductVariantConnectionQuery nodes(ProductVariantQueryDefinition queryDef) { + public SearchResultItemConnectionQuery nodes(SearchResultItemQueryDefinition queryDef) { startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new ProductVariantQuery(_queryBuilder)); + queryDef.define(new SearchResultItemQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -62862,7 +60974,7 @@ public ProductVariantConnectionQuery nodes(ProductVariantQueryDefinition queryDe /** * Information to aid in pagination. */ - public ProductVariantConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + public SearchResultItemConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { startField("pageInfo"); _queryBuilder.append('{'); @@ -62871,24 +60983,46 @@ public ProductVariantConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) return this; } + + /** + * A list of available filters. + */ + public SearchResultItemConnectionQuery productFilters(FilterQueryDefinition queryDef) { + startField("productFilters"); + + _queryBuilder.append('{'); + queryDef.define(new FilterQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The total number of results. + */ + public SearchResultItemConnectionQuery totalCount() { + startField("totalCount"); + + return this; + } } /** - * An auto-generated type for paginating through multiple ProductVariants. + * An auto-generated type for paginating through multiple SearchResultItems. */ - public static class ProductVariantConnection extends AbstractResponse { - public ProductVariantConnection() { + public static class SearchResultItemConnection extends AbstractResponse { + public SearchResultItemConnection() { } - public ProductVariantConnection(JsonObject fields) throws SchemaViolationError { + public SearchResultItemConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { case "edges": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ProductVariantEdge(jsonAsObject(element1, key))); + list1.add(new SearchResultItemEdge(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -62897,9 +61031,9 @@ public ProductVariantConnection(JsonObject fields) throws SchemaViolationError { } case "nodes": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ProductVariant(jsonAsObject(element1, key))); + list1.add(UnknownSearchResultItem.create(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -62913,6 +61047,23 @@ public ProductVariantConnection(JsonObject fields) throws SchemaViolationError { break; } + case "productFilters": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Filter(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "totalCount": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -62925,31 +61076,31 @@ public ProductVariantConnection(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "ProductVariantConnection"; + return "SearchResultItemConnection"; } /** * A list of edges. */ - public List getEdges() { - return (List) get("edges"); + public List getEdges() { + return (List) get("edges"); } - public ProductVariantConnection setEdges(List arg) { + public SearchResultItemConnection setEdges(List arg) { optimisticData.put(getKey("edges"), arg); return this; } /** - * A list of the nodes contained in ProductVariantEdge. + * A list of the nodes contained in SearchResultItemEdge. */ - public List getNodes() { - return (List) get("nodes"); + public List getNodes() { + return (List) get("nodes"); } - public ProductVariantConnection setNodes(List arg) { + public SearchResultItemConnection setNodes(List arg) { optimisticData.put(getKey("nodes"), arg); return this; } @@ -62962,53 +61113,83 @@ public PageInfo getPageInfo() { return (PageInfo) get("pageInfo"); } - public ProductVariantConnection setPageInfo(PageInfo arg) { + public SearchResultItemConnection setPageInfo(PageInfo arg) { optimisticData.put(getKey("pageInfo"), arg); return this; } + /** + * A list of available filters. + */ + + public List getProductFilters() { + return (List) get("productFilters"); + } + + public SearchResultItemConnection setProductFilters(List arg) { + optimisticData.put(getKey("productFilters"), arg); + return this; + } + + /** + * The total number of results. + */ + + public Integer getTotalCount() { + return (Integer) get("totalCount"); + } + + public SearchResultItemConnection setTotalCount(Integer arg) { + optimisticData.put(getKey("totalCount"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "edges": return true; - case "nodes": return true; + case "nodes": return false; case "pageInfo": return true; + case "productFilters": return true; + + case "totalCount": return false; + default: return false; } } } - public interface ProductVariantEdgeQueryDefinition { - void define(ProductVariantEdgeQuery _queryBuilder); + public interface SearchResultItemEdgeQueryDefinition { + void define(SearchResultItemEdgeQuery _queryBuilder); } /** - * An auto-generated type which holds one ProductVariant and a cursor during pagination. + * An auto-generated type which holds one SearchResultItem and a cursor during pagination. */ - public static class ProductVariantEdgeQuery extends Query { - ProductVariantEdgeQuery(StringBuilder _queryBuilder) { + public static class SearchResultItemEdgeQuery extends Query { + SearchResultItemEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A cursor for use in pagination. */ - public ProductVariantEdgeQuery cursor() { + public SearchResultItemEdgeQuery cursor() { startField("cursor"); return this; } /** - * The item at the end of ProductVariantEdge. + * The item at the end of SearchResultItemEdge. */ - public ProductVariantEdgeQuery node(ProductVariantQueryDefinition queryDef) { + public SearchResultItemEdgeQuery node(SearchResultItemQueryDefinition queryDef) { startField("node"); _queryBuilder.append('{'); - queryDef.define(new ProductVariantQuery(_queryBuilder)); + queryDef.define(new SearchResultItemQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -63016,13 +61197,13 @@ public ProductVariantEdgeQuery node(ProductVariantQueryDefinition queryDef) { } /** - * An auto-generated type which holds one ProductVariant and a cursor during pagination. + * An auto-generated type which holds one SearchResultItem and a cursor during pagination. */ - public static class ProductVariantEdge extends AbstractResponse { - public ProductVariantEdge() { + public static class SearchResultItemEdge extends AbstractResponse { + public SearchResultItemEdge() { } - public ProductVariantEdge(JsonObject fields) throws SchemaViolationError { + public SearchResultItemEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -63034,7 +61215,7 @@ public ProductVariantEdge(JsonObject fields) throws SchemaViolationError { } case "node": { - responseData.put(key, new ProductVariant(jsonAsObject(field.getValue(), key))); + responseData.put(key, UnknownSearchResultItem.create(jsonAsObject(field.getValue(), key))); break; } @@ -63051,7 +61232,7 @@ public ProductVariantEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "ProductVariantEdge"; + return "SearchResultItemEdge"; } /** @@ -63062,20 +61243,20 @@ public String getCursor() { return (String) get("cursor"); } - public ProductVariantEdge setCursor(String arg) { + public SearchResultItemEdge setCursor(String arg) { optimisticData.put(getKey("cursor"), arg); return this; } /** - * The item at the end of ProductVariantEdge. + * The item at the end of SearchResultItemEdge. */ - public ProductVariant getNode() { - return (ProductVariant) get("node"); + public SearchResultItem getNode() { + return (SearchResultItem) get("node"); } - public ProductVariantEdge setNode(ProductVariant arg) { + public SearchResultItemEdge setNode(SearchResultItem arg) { optimisticData.put(getKey("node"), arg); return this; } @@ -63084,7 +61265,7 @@ public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "cursor": return false; - case "node": return true; + case "node": return false; default: return false; } @@ -63092,63 +61273,280 @@ public boolean unwrapsToObject(String key) { } /** - * The set of valid sort keys for the ProductVariant query. + * The set of valid sort keys for the search query. */ - public enum ProductVariantSortKeys { + public enum SearchSortKeys { /** - * Sort by the `id` value. + * Sort by the `price` value. */ - ID, + PRICE, /** - * Sort by the `position` value. + * Sort by relevance to the search terms. */ - POSITION, + RELEVANCE, + + UNKNOWN_VALUE; + + public static SearchSortKeys fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "PRICE": { + return PRICE; + } + + case "RELEVANCE": { + return RELEVANCE; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case PRICE: { + return "PRICE"; + } + case RELEVANCE: { + return "RELEVANCE"; + } + + default: { + return ""; + } + } + } + } + + /** + * The types of search items to perform search within. + */ + public enum SearchType { /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. + * Returns matching articles. */ - RELEVANCE, + ARTICLE, /** - * Sort by the `sku` value. + * Returns matching pages. */ - SKU, + PAGE, /** - * Sort by the `title` value. + * Returns matching products. + */ + PRODUCT, + + UNKNOWN_VALUE; + + public static SearchType fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "ARTICLE": { + return ARTICLE; + } + + case "PAGE": { + return PAGE; + } + + case "PRODUCT": { + return PRODUCT; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case ARTICLE: { + return "ARTICLE"; + } + + case PAGE: { + return "PAGE"; + } + + case PRODUCT: { + return "PRODUCT"; + } + + default: { + return ""; + } + } + } + } + + /** + * Specifies whether to display results for unavailable products. + */ + public enum SearchUnavailableProductsType { + /** + * Exclude unavailable products. + */ + HIDE, + + /** + * Show unavailable products after all other matching results. This is the default. + */ + LAST, + + /** + * Show unavailable products in the order that they're found. + */ + SHOW, + + UNKNOWN_VALUE; + + public static SearchUnavailableProductsType fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "HIDE": { + return HIDE; + } + + case "LAST": { + return LAST; + } + + case "SHOW": { + return SHOW; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case HIDE: { + return "HIDE"; + } + + case LAST: { + return "LAST"; + } + + case SHOW: { + return "SHOW"; + } + + default: { + return ""; + } + } + } + } + + /** + * Specifies the list of resource fields to search. + */ + public enum SearchableField { + /** + * Author of the page or article. + */ + AUTHOR, + + /** + * Body of the page or article or product description or collection description. + */ + BODY, + + /** + * Product type. + */ + PRODUCT_TYPE, + + /** + * Tag associated with the product or article. + */ + TAG, + + /** + * Title of the page or article or product title or collection title. */ TITLE, + /** + * Variant barcode. + */ + VARIANTS_BARCODE, + + /** + * Variant SKU. + */ + VARIANTS_SKU, + + /** + * Variant title. + */ + VARIANTS_TITLE, + + /** + * Product vendor. + */ + VENDOR, + UNKNOWN_VALUE; - public static ProductVariantSortKeys fromGraphQl(String value) { + public static SearchableField fromGraphQl(String value) { if (value == null) { return null; } switch (value) { - case "ID": { - return ID; + case "AUTHOR": { + return AUTHOR; } - case "POSITION": { - return POSITION; + case "BODY": { + return BODY; } - case "RELEVANCE": { - return RELEVANCE; + case "PRODUCT_TYPE": { + return PRODUCT_TYPE; } - case "SKU": { - return SKU; + case "TAG": { + return TAG; } case "TITLE": { return TITLE; } + case "VARIANTS_BARCODE": { + return VARIANTS_BARCODE; + } + + case "VARIANTS_SKU": { + return VARIANTS_SKU; + } + + case "VARIANTS_TITLE": { + return VARIANTS_TITLE; + } + + case "VENDOR": { + return VENDOR; + } + default: { return UNKNOWN_VALUE; } @@ -63156,26 +61554,42 @@ public static ProductVariantSortKeys fromGraphQl(String value) { } public String toString() { switch (this) { - case ID: { - return "ID"; + case AUTHOR: { + return "AUTHOR"; } - case POSITION: { - return "POSITION"; + case BODY: { + return "BODY"; } - case RELEVANCE: { - return "RELEVANCE"; + case PRODUCT_TYPE: { + return "PRODUCT_TYPE"; } - case SKU: { - return "SKU"; + case TAG: { + return "TAG"; } case TITLE: { return "TITLE"; } + case VARIANTS_BARCODE: { + return "VARIANTS_BARCODE"; + } + + case VARIANTS_SKU: { + return "VARIANTS_SKU"; + } + + case VARIANTS_TITLE: { + return "VARIANTS_TITLE"; + } + + case VENDOR: { + return "VENDOR"; + } + default: { return ""; } @@ -63183,89 +61597,59 @@ public String toString() { } } - public interface PurchasingCompanyQueryDefinition { - void define(PurchasingCompanyQuery _queryBuilder); + public interface SelectedOptionQueryDefinition { + void define(SelectedOptionQuery _queryBuilder); } /** - * Represents information about the buyer that is interacting with the cart. + * Properties used by customers to select a product variant. + * Products can have multiple options, like different sizes or colors. */ - public static class PurchasingCompanyQuery extends Query { - PurchasingCompanyQuery(StringBuilder _queryBuilder) { + public static class SelectedOptionQuery extends Query { + SelectedOptionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The company associated to the order or draft order. - */ - public PurchasingCompanyQuery company(CompanyQueryDefinition queryDef) { - startField("company"); - - _queryBuilder.append('{'); - queryDef.define(new CompanyQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The company contact associated to the order or draft order. + * The product option’s name. */ - public PurchasingCompanyQuery contact(CompanyContactQueryDefinition queryDef) { - startField("contact"); - - _queryBuilder.append('{'); - queryDef.define(new CompanyContactQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SelectedOptionQuery name() { + startField("name"); return this; } /** - * The company location associated to the order or draft order. + * The product option’s value. */ - public PurchasingCompanyQuery location(CompanyLocationQueryDefinition queryDef) { - startField("location"); - - _queryBuilder.append('{'); - queryDef.define(new CompanyLocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SelectedOptionQuery value() { + startField("value"); return this; } } /** - * Represents information about the buyer that is interacting with the cart. + * Properties used by customers to select a product variant. + * Products can have multiple options, like different sizes or colors. */ - public static class PurchasingCompany extends AbstractResponse { - public PurchasingCompany() { + public static class SelectedOption extends AbstractResponse { + public SelectedOption() { } - public PurchasingCompany(JsonObject fields) throws SchemaViolationError { + public SelectedOption(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "company": { - responseData.put(key, new Company(jsonAsObject(field.getValue(), key))); - - break; - } - - case "contact": { - CompanyContact optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CompanyContact(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "location": { - responseData.put(key, new CompanyLocation(jsonAsObject(field.getValue(), key))); + case "value": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -63282,242 +61666,364 @@ public PurchasingCompany(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "PurchasingCompany"; + return "SelectedOption"; } /** - * The company associated to the order or draft order. + * The product option’s name. */ - public Company getCompany() { - return (Company) get("company"); + public String getName() { + return (String) get("name"); } - public PurchasingCompany setCompany(Company arg) { - optimisticData.put(getKey("company"), arg); + public SelectedOption setName(String arg) { + optimisticData.put(getKey("name"), arg); return this; } /** - * The company contact associated to the order or draft order. + * The product option’s value. */ - public CompanyContact getContact() { - return (CompanyContact) get("contact"); + public String getValue() { + return (String) get("value"); } - public PurchasingCompany setContact(CompanyContact arg) { - optimisticData.put(getKey("contact"), arg); + public SelectedOption setValue(String arg) { + optimisticData.put(getKey("value"), arg); return this; } - /** - * The company location associated to the order or draft order. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "name": return false; - public CompanyLocation getLocation() { - return (CompanyLocation) get("location"); + case "value": return false; + + default: return false; + } } + } - public PurchasingCompany setLocation(CompanyLocation arg) { - optimisticData.put(getKey("location"), arg); + public static class SelectedOptionInput implements Serializable { + private String name; + + private String value; + + public SelectedOptionInput(String name, String value) { + this.name = name; + + this.value = value; + } + + public String getName() { + return name; + } + + public SelectedOptionInput setName(String name) { + this.name = name; return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "company": return true; + public String getValue() { + return value; + } - case "contact": return true; + public SelectedOptionInput setValue(String value) { + this.value = value; + return this; + } - case "location": return true; + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - default: return false; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("name:"); + Query.appendQuotedString(_queryBuilder, name.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("value:"); + Query.appendQuotedString(_queryBuilder, value.toString()); + + _queryBuilder.append('}'); } } - public interface QuantityPriceBreakQueryDefinition { - void define(QuantityPriceBreakQuery _queryBuilder); + public interface SellingPlanQueryDefinition { + void define(SellingPlanQuery _queryBuilder); } /** - * Quantity price breaks lets you offer different rates that are based on the - * amount of a specific variant being ordered. + * Represents how products and variants can be sold and purchased. */ - public static class QuantityPriceBreakQuery extends Query { - QuantityPriceBreakQuery(StringBuilder _queryBuilder) { + public static class SellingPlanQuery extends Query { + SellingPlanQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * Minimum quantity required to reach new quantity break price. + * The billing policy for the selling plan. */ - public QuantityPriceBreakQuery minimumQuantity() { - startField("minimumQuantity"); + public SellingPlanQuery billingPolicy(SellingPlanBillingPolicyQueryDefinition queryDef) { + startField("billingPolicy"); + + _queryBuilder.append('{'); + queryDef.define(new SellingPlanBillingPolicyQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The price of variant after reaching the minimum quanity. + * The initial payment due for the purchase. */ - public QuantityPriceBreakQuery price(MoneyV2QueryDefinition queryDef) { - startField("price"); + public SellingPlanQuery checkoutCharge(SellingPlanCheckoutChargeQueryDefinition queryDef) { + startField("checkoutCharge"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new SellingPlanCheckoutChargeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - } - /** - * Quantity price breaks lets you offer different rates that are based on the - * amount of a specific variant being ordered. - */ - public static class QuantityPriceBreak extends AbstractResponse { - public QuantityPriceBreak() { + /** + * The delivery policy for the selling plan. + */ + public SellingPlanQuery deliveryPolicy(SellingPlanDeliveryPolicyQueryDefinition queryDef) { + startField("deliveryPolicy"); + + _queryBuilder.append('{'); + queryDef.define(new SellingPlanDeliveryPolicyQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } - public QuantityPriceBreak(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "minimumQuantity": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + /** + * The description of the selling plan. + */ + public SellingPlanQuery description() { + startField("description"); - break; - } + return this; + } - case "price": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + /** + * A globally-unique ID. + */ + public SellingPlanQuery id() { + startField("id"); - break; - } + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + public class MetafieldArguments extends Arguments { + MetafieldArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } + + /** + * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. + */ + public MetafieldArguments namespace(String value) { + if (value != null) { + startArgument("namespace"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } } - public String getGraphQlTypeName() { - return "QuantityPriceBreak"; + public interface MetafieldArgumentsDefinition { + void define(MetafieldArguments args); } /** - * Minimum quantity required to reach new quantity break price. + * Returns a metafield found by namespace and key. */ - - public Integer getMinimumQuantity() { - return (Integer) get("minimumQuantity"); - } - - public QuantityPriceBreak setMinimumQuantity(Integer arg) { - optimisticData.put(getKey("minimumQuantity"), arg); - return this; + public SellingPlanQuery metafield(String key, MetafieldQueryDefinition queryDef) { + return metafield(key, args -> {}, queryDef); } /** - * The price of variant after reaching the minimum quanity. + * Returns a metafield found by namespace and key. */ + public SellingPlanQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { + startField("metafield"); - public MoneyV2 getPrice() { - return (MoneyV2) get("price"); - } + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + argsDef.define(new MetafieldArguments(_queryBuilder)); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - public QuantityPriceBreak setPrice(MoneyV2 arg) { - optimisticData.put(getKey("price"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "minimumQuantity": return false; - - case "price": return true; + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ + public SellingPlanQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); - default: return false; + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } } + _queryBuilder.append(']'); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } - } - public interface QuantityPriceBreakConnectionQueryDefinition { - void define(QuantityPriceBreakConnectionQuery _queryBuilder); - } + /** + * The name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'. + */ + public SellingPlanQuery name() { + startField("name"); - /** - * An auto-generated type for paginating through multiple QuantityPriceBreaks. - */ - public static class QuantityPriceBreakConnectionQuery extends Query { - QuantityPriceBreakConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * A list of edges. + * The selling plan options available in the drop-down list in the storefront. For example, 'Delivery + * every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the product. + * Individual selling plans contribute their options to the associated selling plan group. For example, + * a selling plan group might have an option called `option1: Delivery every`. One selling plan in that + * group could contribute `option1: 2 weeks` with the pricing for that option, and another selling plan + * could contribute `option1: 4 weeks`, with different pricing. */ - public QuantityPriceBreakConnectionQuery edges(QuantityPriceBreakEdgeQueryDefinition queryDef) { - startField("edges"); + public SellingPlanQuery options(SellingPlanOptionQueryDefinition queryDef) { + startField("options"); _queryBuilder.append('{'); - queryDef.define(new QuantityPriceBreakEdgeQuery(_queryBuilder)); + queryDef.define(new SellingPlanOptionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in QuantityPriceBreakEdge. + * The price adjustments that a selling plan makes when a variant is purchased with a selling plan. */ - public QuantityPriceBreakConnectionQuery nodes(QuantityPriceBreakQueryDefinition queryDef) { - startField("nodes"); + public SellingPlanQuery priceAdjustments(SellingPlanPriceAdjustmentQueryDefinition queryDef) { + startField("priceAdjustments"); _queryBuilder.append('{'); - queryDef.define(new QuantityPriceBreakQuery(_queryBuilder)); + queryDef.define(new SellingPlanPriceAdjustmentQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Information to aid in pagination. + * Whether purchasing the selling plan will result in multiple deliveries. */ - public QuantityPriceBreakConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SellingPlanQuery recurringDeliveries() { + startField("recurringDeliveries"); return this; } } /** - * An auto-generated type for paginating through multiple QuantityPriceBreaks. + * Represents how products and variants can be sold and purchased. */ - public static class QuantityPriceBreakConnection extends AbstractResponse { - public QuantityPriceBreakConnection() { + public static class SellingPlan extends AbstractResponse implements HasMetafields, MetafieldParentResource { + public SellingPlan() { } - public QuantityPriceBreakConnection(JsonObject fields) throws SchemaViolationError { + public SellingPlan(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); + case "billingPolicy": { + SellingPlanBillingPolicy optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = UnknownSellingPlanBillingPolicy.create(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "checkoutCharge": { + responseData.put(key, new SellingPlanCheckoutCharge(jsonAsObject(field.getValue(), key))); + + break; + } + + case "deliveryPolicy": { + SellingPlanDeliveryPolicy optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = UnknownSellingPlanDeliveryPolicy.create(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "description": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "metafields": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new QuantityPriceBreakEdge(jsonAsObject(element1, key))); + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } + + list1.add(optional2); } responseData.put(key, list1); @@ -63525,10 +62031,16 @@ public QuantityPriceBreakConnection(JsonObject fields) throws SchemaViolationErr break; } - case "nodes": { - List list1 = new ArrayList<>(); + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "options": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new QuantityPriceBreak(jsonAsObject(element1, key))); + list1.add(new SellingPlanOption(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -63536,8 +62048,19 @@ public QuantityPriceBreakConnection(JsonObject fields) throws SchemaViolationErr break; } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "priceAdjustments": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlanPriceAdjustment(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "recurringDeliveries": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } @@ -63553,251 +62076,297 @@ public QuantityPriceBreakConnection(JsonObject fields) throws SchemaViolationErr } } - public String getGraphQlTypeName() { - return "QuantityPriceBreakConnection"; + public String getGraphQlTypeName() { + return "SellingPlan"; + } + + /** + * The billing policy for the selling plan. + */ + + public SellingPlanBillingPolicy getBillingPolicy() { + return (SellingPlanBillingPolicy) get("billingPolicy"); + } + + public SellingPlan setBillingPolicy(SellingPlanBillingPolicy arg) { + optimisticData.put(getKey("billingPolicy"), arg); + return this; } /** - * A list of edges. + * The initial payment due for the purchase. */ - public List getEdges() { - return (List) get("edges"); + public SellingPlanCheckoutCharge getCheckoutCharge() { + return (SellingPlanCheckoutCharge) get("checkoutCharge"); } - public QuantityPriceBreakConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); + public SellingPlan setCheckoutCharge(SellingPlanCheckoutCharge arg) { + optimisticData.put(getKey("checkoutCharge"), arg); return this; } /** - * A list of the nodes contained in QuantityPriceBreakEdge. + * The delivery policy for the selling plan. */ - public List getNodes() { - return (List) get("nodes"); + public SellingPlanDeliveryPolicy getDeliveryPolicy() { + return (SellingPlanDeliveryPolicy) get("deliveryPolicy"); } - public QuantityPriceBreakConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + public SellingPlan setDeliveryPolicy(SellingPlanDeliveryPolicy arg) { + optimisticData.put(getKey("deliveryPolicy"), arg); return this; } /** - * Information to aid in pagination. + * The description of the selling plan. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public String getDescription() { + return (String) get("description"); } - public QuantityPriceBreakConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public SellingPlan setDescription(String arg) { + optimisticData.put(getKey("description"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return true; - - case "pageInfo": return true; + /** + * A globally-unique ID. + */ - default: return false; - } + public ID getId() { + return (ID) get("id"); } - } - - public interface QuantityPriceBreakEdgeQueryDefinition { - void define(QuantityPriceBreakEdgeQuery _queryBuilder); - } - /** - * An auto-generated type which holds one QuantityPriceBreak and a cursor during pagination. - */ - public static class QuantityPriceBreakEdgeQuery extends Query { - QuantityPriceBreakEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public SellingPlan setId(ID arg) { + optimisticData.put(getKey("id"), arg); + return this; } /** - * A cursor for use in pagination. + * Returns a metafield found by namespace and key. */ - public QuantityPriceBreakEdgeQuery cursor() { - startField("cursor"); + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } + + public SellingPlan setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); return this; } /** - * The item at the end of QuantityPriceBreakEdge. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public QuantityPriceBreakEdgeQuery node(QuantityPriceBreakQueryDefinition queryDef) { - startField("node"); - - _queryBuilder.append('{'); - queryDef.define(new QuantityPriceBreakQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public List getMetafields() { + return (List) get("metafields"); } - } - /** - * An auto-generated type which holds one QuantityPriceBreak and a cursor during pagination. - */ - public static class QuantityPriceBreakEdge extends AbstractResponse { - public QuantityPriceBreakEdge() { + public SellingPlan setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); + return this; } - public QuantityPriceBreakEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * The name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'. + */ - break; - } + public String getName() { + return (String) get("name"); + } - case "node": { - responseData.put(key, new QuantityPriceBreak(jsonAsObject(field.getValue(), key))); + public SellingPlan setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } - break; - } + /** + * The selling plan options available in the drop-down list in the storefront. For example, 'Delivery + * every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the product. + * Individual selling plans contribute their options to the associated selling plan group. For example, + * a selling plan group might have an option called `option1: Delivery every`. One selling plan in that + * group could contribute `option1: 2 weeks` with the pricing for that option, and another selling plan + * could contribute `option1: 4 weeks`, with different pricing. + */ - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public List getOptions() { + return (List) get("options"); } - public String getGraphQlTypeName() { - return "QuantityPriceBreakEdge"; + public SellingPlan setOptions(List arg) { + optimisticData.put(getKey("options"), arg); + return this; } /** - * A cursor for use in pagination. + * The price adjustments that a selling plan makes when a variant is purchased with a selling plan. */ - public String getCursor() { - return (String) get("cursor"); + public List getPriceAdjustments() { + return (List) get("priceAdjustments"); } - public QuantityPriceBreakEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public SellingPlan setPriceAdjustments(List arg) { + optimisticData.put(getKey("priceAdjustments"), arg); return this; } /** - * The item at the end of QuantityPriceBreakEdge. + * Whether purchasing the selling plan will result in multiple deliveries. */ - public QuantityPriceBreak getNode() { - return (QuantityPriceBreak) get("node"); + public Boolean getRecurringDeliveries() { + return (Boolean) get("recurringDeliveries"); } - public QuantityPriceBreakEdge setNode(QuantityPriceBreak arg) { - optimisticData.put(getKey("node"), arg); + public SellingPlan setRecurringDeliveries(Boolean arg) { + optimisticData.put(getKey("recurringDeliveries"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cursor": return false; + case "billingPolicy": return false; - case "node": return true; + case "checkoutCharge": return true; + + case "deliveryPolicy": return false; + + case "description": return false; + + case "id": return false; + + case "metafield": return true; + + case "metafields": return true; + + case "name": return false; + + case "options": return true; + + case "priceAdjustments": return true; + + case "recurringDeliveries": return false; default: return false; } } } - public interface QuantityRuleQueryDefinition { - void define(QuantityRuleQuery _queryBuilder); + public interface SellingPlanAllocationQueryDefinition { + void define(SellingPlanAllocationQuery _queryBuilder); } /** - * The quantity rule for the product variant in a given context. + * Represents an association between a variant and a selling plan. Selling plan allocations describe + * the options offered for each variant, and the price of the variant when purchased with a selling + * plan. */ - public static class QuantityRuleQuery extends Query { - QuantityRuleQuery(StringBuilder _queryBuilder) { + public static class SellingPlanAllocationQuery extends Query { + SellingPlanAllocationQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The value that specifies the quantity increment between minimum and maximum of the rule. - * Only quantities divisible by this value will be considered valid. - * The increment must be lower than or equal to the minimum and the maximum, and both minimum and - * maximum - * must be divisible by this value. + * The checkout charge amount due for the purchase. */ - public QuantityRuleQuery increment() { - startField("increment"); + public SellingPlanAllocationQuery checkoutChargeAmount(MoneyV2QueryDefinition queryDef) { + startField("checkoutChargeAmount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * An optional value that defines the highest allowed quantity purchased by the customer. - * If defined, maximum must be lower than or equal to the minimum and must be a multiple of the - * increment. + * A list of price adjustments, with a maximum of two. When there are two, the first price adjustment + * goes into effect at the time of purchase, while the second one starts after a certain number of + * orders. A price adjustment represents how a selling plan affects pricing when a variant is purchased + * with a selling plan. Prices display in the customer's currency if the shop is configured for it. */ - public QuantityRuleQuery maximum() { - startField("maximum"); + public SellingPlanAllocationQuery priceAdjustments(SellingPlanAllocationPriceAdjustmentQueryDefinition queryDef) { + startField("priceAdjustments"); + + _queryBuilder.append('{'); + queryDef.define(new SellingPlanAllocationPriceAdjustmentQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The value that defines the lowest allowed quantity purchased by the customer. - * The minimum must be a multiple of the quantity rule's increment. + * The remaining balance charge amount due for the purchase. */ - public QuantityRuleQuery minimum() { - startField("minimum"); + public SellingPlanAllocationQuery remainingBalanceChargeAmount(MoneyV2QueryDefinition queryDef) { + startField("remainingBalanceChargeAmount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * A representation of how products and variants can be sold and purchased. For example, an individual + * selling plan could be '6 weeks of prepaid granola, delivered weekly'. + */ + public SellingPlanAllocationQuery sellingPlan(SellingPlanQueryDefinition queryDef) { + startField("sellingPlan"); + + _queryBuilder.append('{'); + queryDef.define(new SellingPlanQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * The quantity rule for the product variant in a given context. + * Represents an association between a variant and a selling plan. Selling plan allocations describe + * the options offered for each variant, and the price of the variant when purchased with a selling + * plan. */ - public static class QuantityRule extends AbstractResponse { - public QuantityRule() { + public static class SellingPlanAllocation extends AbstractResponse { + public SellingPlanAllocation() { } - public QuantityRule(JsonObject fields) throws SchemaViolationError { + public SellingPlanAllocation(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "increment": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + case "checkoutChargeAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "maximum": { - Integer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); + case "priceAdjustments": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlanAllocationPriceAdjustment(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "minimum": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + case "remainingBalanceChargeAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "sellingPlan": { + responseData.put(key, new SellingPlan(jsonAsObject(field.getValue(), key))); break; } @@ -63814,1827 +62383,1507 @@ public QuantityRule(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "QuantityRule"; + return "SellingPlanAllocation"; } /** - * The value that specifies the quantity increment between minimum and maximum of the rule. - * Only quantities divisible by this value will be considered valid. - * The increment must be lower than or equal to the minimum and the maximum, and both minimum and - * maximum - * must be divisible by this value. + * The checkout charge amount due for the purchase. */ - public Integer getIncrement() { - return (Integer) get("increment"); + public MoneyV2 getCheckoutChargeAmount() { + return (MoneyV2) get("checkoutChargeAmount"); } - public QuantityRule setIncrement(Integer arg) { - optimisticData.put(getKey("increment"), arg); + public SellingPlanAllocation setCheckoutChargeAmount(MoneyV2 arg) { + optimisticData.put(getKey("checkoutChargeAmount"), arg); return this; } /** - * An optional value that defines the highest allowed quantity purchased by the customer. - * If defined, maximum must be lower than or equal to the minimum and must be a multiple of the - * increment. + * A list of price adjustments, with a maximum of two. When there are two, the first price adjustment + * goes into effect at the time of purchase, while the second one starts after a certain number of + * orders. A price adjustment represents how a selling plan affects pricing when a variant is purchased + * with a selling plan. Prices display in the customer's currency if the shop is configured for it. */ - public Integer getMaximum() { - return (Integer) get("maximum"); + public List getPriceAdjustments() { + return (List) get("priceAdjustments"); } - public QuantityRule setMaximum(Integer arg) { - optimisticData.put(getKey("maximum"), arg); + public SellingPlanAllocation setPriceAdjustments(List arg) { + optimisticData.put(getKey("priceAdjustments"), arg); return this; } /** - * The value that defines the lowest allowed quantity purchased by the customer. - * The minimum must be a multiple of the quantity rule's increment. + * The remaining balance charge amount due for the purchase. */ - public Integer getMinimum() { - return (Integer) get("minimum"); + public MoneyV2 getRemainingBalanceChargeAmount() { + return (MoneyV2) get("remainingBalanceChargeAmount"); } - public QuantityRule setMinimum(Integer arg) { - optimisticData.put(getKey("minimum"), arg); + public SellingPlanAllocation setRemainingBalanceChargeAmount(MoneyV2 arg) { + optimisticData.put(getKey("remainingBalanceChargeAmount"), arg); + return this; + } + + /** + * A representation of how products and variants can be sold and purchased. For example, an individual + * selling plan could be '6 weeks of prepaid granola, delivered weekly'. + */ + + public SellingPlan getSellingPlan() { + return (SellingPlan) get("sellingPlan"); + } + + public SellingPlanAllocation setSellingPlan(SellingPlan arg) { + optimisticData.put(getKey("sellingPlan"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "increment": return false; + case "checkoutChargeAmount": return true; - case "maximum": return false; + case "priceAdjustments": return true; - case "minimum": return false; + case "remainingBalanceChargeAmount": return true; + + case "sellingPlan": return true; default: return false; } } } - public interface QueryRootQueryDefinition { - void define(QueryRootQuery _queryBuilder); + public interface SellingPlanAllocationConnectionQueryDefinition { + void define(SellingPlanAllocationConnectionQuery _queryBuilder); } /** - * The schema’s entry-point for queries. This acts as the public, top-level API from which all queries - * must start. + * An auto-generated type for paginating through multiple SellingPlanAllocations. */ - public static class QueryRootQuery extends Query { - QueryRootQuery(StringBuilder _queryBuilder) { + public static class SellingPlanAllocationConnectionQuery extends Query { + SellingPlanAllocationConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * Fetch a specific Article by its ID. + * A list of edges. */ - public QueryRootQuery article(ID id, ArticleQueryDefinition queryDef) { - startField("article"); + public SellingPlanAllocationConnectionQuery edges(SellingPlanAllocationEdgeQueryDefinition queryDef) { + startField("edges"); - _queryBuilder.append("(id:"); - Query.appendQuotedString(_queryBuilder, id.toString()); + _queryBuilder.append('{'); + queryDef.define(new SellingPlanAllocationEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); - _queryBuilder.append(')'); + return this; + } + + /** + * A list of the nodes contained in SellingPlanAllocationEdge. + */ + public SellingPlanAllocationConnectionQuery nodes(SellingPlanAllocationQueryDefinition queryDef) { + startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new ArticleQuery(_queryBuilder)); + queryDef.define(new SellingPlanAllocationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - public class ArticlesArguments extends Arguments { - ArticlesArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * Information to aid in pagination. + */ + public SellingPlanAllocationConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - /** - * Returns up to the first `n` elements from the list. - */ - public ArticlesArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Returns the elements that come after the specified cursor. - */ - public ArticlesArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + return this; + } + } - /** - * Returns up to the last `n` elements from the list. - */ - public ArticlesArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + /** + * An auto-generated type for paginating through multiple SellingPlanAllocations. + */ + public static class SellingPlanAllocationConnection extends AbstractResponse { + public SellingPlanAllocationConnection() { + } - /** - * Returns the elements that come before the specified cursor. - */ - public ArticlesArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public SellingPlanAllocationConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlanAllocationEdge(jsonAsObject(element1, key))); + } - /** - * Reverse the order of the underlying list. - */ - public ArticlesArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + responseData.put(key, list1); - /** - * Sort the underlying list by the given key. - */ - public ArticlesArguments sortKey(ArticleSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; - } + break; + } - /** - * Apply one or multiple filters to the query. - * | name | description | acceptable_values | default_value | example_use | - * | ---- | ---- | ---- | ---- | ---- | - * | author | - * | blog_title | - * | created_at | - * | tag | - * | tag_not | - * | updated_at | - * Refer to the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) for more - * information about using filters. - */ - public ArticlesArguments query(String value) { - if (value != null) { - startArgument("query"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlanAllocation(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } } - public interface ArticlesArgumentsDefinition { - void define(ArticlesArguments args); + public String getGraphQlTypeName() { + return "SellingPlanAllocationConnection"; + } + + /** + * A list of edges. + */ + + public List getEdges() { + return (List) get("edges"); + } + + public SellingPlanAllocationConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; } /** - * List of the shop's articles. + * A list of the nodes contained in SellingPlanAllocationEdge. */ - public QueryRootQuery articles(ArticleConnectionQueryDefinition queryDef) { - return articles(args -> {}, queryDef); + + public List getNodes() { + return (List) get("nodes"); + } + + public SellingPlanAllocationConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; } /** - * List of the shop's articles. + * Information to aid in pagination. */ - public QueryRootQuery articles(ArticlesArgumentsDefinition argsDef, ArticleConnectionQueryDefinition queryDef) { - startField("articles"); - - ArticlesArguments args = new ArticlesArguments(_queryBuilder); - argsDef.define(args); - ArticlesArguments.end(args); - _queryBuilder.append('{'); - queryDef.define(new ArticleConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } + public SellingPlanAllocationConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } - public class BlogArguments extends Arguments { - BlogArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - /** - * The ID of the `Blog`. - */ - public BlogArguments id(ID value) { - if (value != null) { - startArgument("id"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + case "nodes": return true; - /** - * The handle of the `Blog`. - */ - public BlogArguments handle(String value) { - if (value != null) { - startArgument("handle"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; + case "pageInfo": return true; + + default: return false; } } + } - public interface BlogArgumentsDefinition { - void define(BlogArguments args); - } + public interface SellingPlanAllocationEdgeQueryDefinition { + void define(SellingPlanAllocationEdgeQuery _queryBuilder); + } - /** - * Fetch a specific `Blog` by one of its unique attributes. - */ - public QueryRootQuery blog(BlogQueryDefinition queryDef) { - return blog(args -> {}, queryDef); + /** + * An auto-generated type which holds one SellingPlanAllocation and a cursor during pagination. + */ + public static class SellingPlanAllocationEdgeQuery extends Query { + SellingPlanAllocationEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * Fetch a specific `Blog` by one of its unique attributes. + * A cursor for use in pagination. */ - public QueryRootQuery blog(BlogArgumentsDefinition argsDef, BlogQueryDefinition queryDef) { - startField("blog"); - - BlogArguments args = new BlogArguments(_queryBuilder); - argsDef.define(args); - BlogArguments.end(args); - - _queryBuilder.append('{'); - queryDef.define(new BlogQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SellingPlanAllocationEdgeQuery cursor() { + startField("cursor"); return this; } /** - * Find a blog by its handle. - * - * @deprecated Use `blog` instead. + * The item at the end of SellingPlanAllocationEdge. */ - @Deprecated - public QueryRootQuery blogByHandle(String handle, BlogQueryDefinition queryDef) { - startField("blogByHandle"); - - _queryBuilder.append("(handle:"); - Query.appendQuotedString(_queryBuilder, handle.toString()); - - _queryBuilder.append(')'); + public SellingPlanAllocationEdgeQuery node(SellingPlanAllocationQueryDefinition queryDef) { + startField("node"); _queryBuilder.append('{'); - queryDef.define(new BlogQuery(_queryBuilder)); + queryDef.define(new SellingPlanAllocationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - public class BlogsArguments extends Arguments { - BlogsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * An auto-generated type which holds one SellingPlanAllocation and a cursor during pagination. + */ + public static class SellingPlanAllocationEdge extends AbstractResponse { + public SellingPlanAllocationEdge() { + } - /** - * Returns up to the first `n` elements from the list. - */ - public BlogsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public SellingPlanAllocationEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * Returns the elements that come after the specified cursor. - */ - public BlogsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + break; + } - /** - * Returns up to the last `n` elements from the list. - */ - public BlogsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + case "node": { + responseData.put(key, new SellingPlanAllocation(jsonAsObject(field.getValue(), key))); - /** - * Returns the elements that come before the specified cursor. - */ - public BlogsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + break; + } - /** - * Reverse the order of the underlying list. - */ - public BlogsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } + } - /** - * Sort the underlying list by the given key. - */ - public BlogsArguments sortKey(BlogSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; - } + public String getGraphQlTypeName() { + return "SellingPlanAllocationEdge"; + } - /** - * Apply one or multiple filters to the query. - * | name | description | acceptable_values | default_value | example_use | - * | ---- | ---- | ---- | ---- | ---- | - * | created_at | - * | handle | - * | title | - * | updated_at | - * Refer to the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) for more - * information about using filters. - */ - public BlogsArguments query(String value) { - if (value != null) { - startArgument("query"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + /** + * A cursor for use in pagination. + */ + + public String getCursor() { + return (String) get("cursor"); } - public interface BlogsArgumentsDefinition { - void define(BlogsArguments args); + public SellingPlanAllocationEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); + return this; } /** - * List of the shop's blogs. + * The item at the end of SellingPlanAllocationEdge. */ - public QueryRootQuery blogs(BlogConnectionQueryDefinition queryDef) { - return blogs(args -> {}, queryDef); + + public SellingPlanAllocation getNode() { + return (SellingPlanAllocation) get("node"); + } + + public SellingPlanAllocationEdge setNode(SellingPlanAllocation arg) { + optimisticData.put(getKey("node"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; + + case "node": return true; + + default: return false; + } + } + } + + public interface SellingPlanAllocationPriceAdjustmentQueryDefinition { + void define(SellingPlanAllocationPriceAdjustmentQuery _queryBuilder); + } + + /** + * The resulting prices for variants when they're purchased with a specific selling plan. + */ + public static class SellingPlanAllocationPriceAdjustmentQuery extends Query { + SellingPlanAllocationPriceAdjustmentQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * List of the shop's blogs. + * The price of the variant when it's purchased without a selling plan for the same number of + * deliveries. For example, if a customer purchases 6 deliveries of $10.00 granola separately, then the + * price is 6 x $10.00 = $60.00. */ - public QueryRootQuery blogs(BlogsArgumentsDefinition argsDef, BlogConnectionQueryDefinition queryDef) { - startField("blogs"); - - BlogsArguments args = new BlogsArguments(_queryBuilder); - argsDef.define(args); - BlogsArguments.end(args); + public SellingPlanAllocationPriceAdjustmentQuery compareAtPrice(MoneyV2QueryDefinition queryDef) { + startField("compareAtPrice"); _queryBuilder.append('{'); - queryDef.define(new BlogConnectionQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Retrieve a cart by its ID. For more information, refer to - * [Manage a cart with the Storefront API](https://shopify.dev/custom-storefronts/cart/manage). + * The effective price for a single delivery. For example, for a prepaid subscription plan that + * includes 6 deliveries at the price of $48.00, the per delivery price is $8.00. */ - public QueryRootQuery cart(ID id, CartQueryDefinition queryDef) { - startField("cart"); - - _queryBuilder.append("(id:"); - Query.appendQuotedString(_queryBuilder, id.toString()); - - _queryBuilder.append(')'); + public SellingPlanAllocationPriceAdjustmentQuery perDeliveryPrice(MoneyV2QueryDefinition queryDef) { + startField("perDeliveryPrice"); _queryBuilder.append('{'); - queryDef.define(new CartQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A poll for the status of the cart checkout completion and order creation. + * The price of the variant when it's purchased with a selling plan For example, for a prepaid + * subscription plan that includes 6 deliveries of $10.00 granola, where the customer gets 20% off, the + * price is 6 x $10.00 x 0.80 = $48.00. */ - public QueryRootQuery cartCompletionAttempt(String attemptId, CartCompletionAttemptResultQueryDefinition queryDef) { - startField("cartCompletionAttempt"); + public SellingPlanAllocationPriceAdjustmentQuery price(MoneyV2QueryDefinition queryDef) { + startField("price"); - _queryBuilder.append("(attemptId:"); - Query.appendQuotedString(_queryBuilder, attemptId.toString()); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - _queryBuilder.append(')'); + return this; + } + + /** + * The resulting price per unit for the variant associated with the selling plan. If the variant isn't + * sold by quantity or measurement, then this field returns `null`. + */ + public SellingPlanAllocationPriceAdjustmentQuery unitPrice(MoneyV2QueryDefinition queryDef) { + startField("unitPrice"); _queryBuilder.append('{'); - queryDef.define(new CartCompletionAttemptResultQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - public class CollectionArguments extends Arguments { - CollectionArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * The resulting prices for variants when they're purchased with a specific selling plan. + */ + public static class SellingPlanAllocationPriceAdjustment extends AbstractResponse { + public SellingPlanAllocationPriceAdjustment() { + } - /** - * The ID of the `Collection`. - */ - public CollectionArguments id(ID value) { - if (value != null) { - startArgument("id"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public SellingPlanAllocationPriceAdjustment(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "compareAtPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - /** - * The handle of the `Collection`. - */ - public CollectionArguments handle(String value) { - if (value != null) { - startArgument("handle"); - Query.appendQuotedString(_queryBuilder, value.toString()); + break; + } + + case "perDeliveryPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "price": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "unitPrice": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } } - public interface CollectionArgumentsDefinition { - void define(CollectionArguments args); + public String getGraphQlTypeName() { + return "SellingPlanAllocationPriceAdjustment"; } /** - * Fetch a specific `Collection` by one of its unique attributes. + * The price of the variant when it's purchased without a selling plan for the same number of + * deliveries. For example, if a customer purchases 6 deliveries of $10.00 granola separately, then the + * price is 6 x $10.00 = $60.00. */ - public QueryRootQuery collection(CollectionQueryDefinition queryDef) { - return collection(args -> {}, queryDef); + + public MoneyV2 getCompareAtPrice() { + return (MoneyV2) get("compareAtPrice"); + } + + public SellingPlanAllocationPriceAdjustment setCompareAtPrice(MoneyV2 arg) { + optimisticData.put(getKey("compareAtPrice"), arg); + return this; } /** - * Fetch a specific `Collection` by one of its unique attributes. + * The effective price for a single delivery. For example, for a prepaid subscription plan that + * includes 6 deliveries at the price of $48.00, the per delivery price is $8.00. */ - public QueryRootQuery collection(CollectionArgumentsDefinition argsDef, CollectionQueryDefinition queryDef) { - startField("collection"); - - CollectionArguments args = new CollectionArguments(_queryBuilder); - argsDef.define(args); - CollectionArguments.end(args); - _queryBuilder.append('{'); - queryDef.define(new CollectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getPerDeliveryPrice() { + return (MoneyV2) get("perDeliveryPrice"); + } + public SellingPlanAllocationPriceAdjustment setPerDeliveryPrice(MoneyV2 arg) { + optimisticData.put(getKey("perDeliveryPrice"), arg); return this; } /** - * Find a collection by its handle. - * - * @deprecated Use `collection` instead. + * The price of the variant when it's purchased with a selling plan For example, for a prepaid + * subscription plan that includes 6 deliveries of $10.00 granola, where the customer gets 20% off, the + * price is 6 x $10.00 x 0.80 = $48.00. */ - @Deprecated - public QueryRootQuery collectionByHandle(String handle, CollectionQueryDefinition queryDef) { - startField("collectionByHandle"); - _queryBuilder.append("(handle:"); - Query.appendQuotedString(_queryBuilder, handle.toString()); + public MoneyV2 getPrice() { + return (MoneyV2) get("price"); + } - _queryBuilder.append(')'); + public SellingPlanAllocationPriceAdjustment setPrice(MoneyV2 arg) { + optimisticData.put(getKey("price"), arg); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new CollectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The resulting price per unit for the variant associated with the selling plan. If the variant isn't + * sold by quantity or measurement, then this field returns `null`. + */ + public MoneyV2 getUnitPrice() { + return (MoneyV2) get("unitPrice"); + } + + public SellingPlanAllocationPriceAdjustment setUnitPrice(MoneyV2 arg) { + optimisticData.put(getKey("unitPrice"), arg); return this; } - public class CollectionsArguments extends Arguments { - CollectionsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "compareAtPrice": return true; - /** - * Returns up to the first `n` elements from the list. - */ - public CollectionsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + case "perDeliveryPrice": return true; - /** - * Returns the elements that come after the specified cursor. - */ - public CollectionsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; + case "price": return true; + + case "unitPrice": return true; + + default: return false; } + } + } + + public interface SellingPlanBillingPolicyQueryDefinition { + void define(SellingPlanBillingPolicyQuery _queryBuilder); + } + + /** + * The selling plan billing policy. + */ + public static class SellingPlanBillingPolicyQuery extends Query { + SellingPlanBillingPolicyQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("__typename"); + } + + public SellingPlanBillingPolicyQuery onSellingPlanRecurringBillingPolicy(SellingPlanRecurringBillingPolicyQueryDefinition queryDef) { + startInlineFragment("SellingPlanRecurringBillingPolicy"); + queryDef.define(new SellingPlanRecurringBillingPolicyQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + } + + public interface SellingPlanBillingPolicy { + String getGraphQlTypeName(); + } - /** - * Returns up to the last `n` elements from the list. - */ - public CollectionsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + /** + * The selling plan billing policy. + */ + public static class UnknownSellingPlanBillingPolicy extends AbstractResponse implements SellingPlanBillingPolicy { + public UnknownSellingPlanBillingPolicy() { + } - /** - * Returns the elements that come before the specified cursor. - */ - public CollectionsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); + public UnknownSellingPlanBillingPolicy(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } + } - /** - * Reverse the order of the underlying list. - */ - public CollectionsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); + public static SellingPlanBillingPolicy create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "SellingPlanRecurringBillingPolicy": { + return new SellingPlanRecurringBillingPolicy(fields); } - return this; - } - /** - * Sort the underlying list by the given key. - */ - public CollectionsArguments sortKey(CollectionSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); + default: { + return new UnknownSellingPlanBillingPolicy(fields); } - return this; } + } - /** - * Apply one or multiple filters to the query. - * | name | description | acceptable_values | default_value | example_use | - * | ---- | ---- | ---- | ---- | ---- | - * | collection_type | - * | title | - * | updated_at | - * Refer to the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) for more - * information about using filters. - */ - public CollectionsArguments query(String value) { - if (value != null) { - startArgument("query"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; + public String getGraphQlTypeName() { + return (String) get("__typename"); + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + default: return false; } } + } - public interface CollectionsArgumentsDefinition { - void define(CollectionsArguments args); + public interface SellingPlanCheckoutChargeQueryDefinition { + void define(SellingPlanCheckoutChargeQuery _queryBuilder); + } + + /** + * The initial payment due for the purchase. + */ + public static class SellingPlanCheckoutChargeQuery extends Query { + SellingPlanCheckoutChargeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * List of the shop’s collections. + * The charge type for the checkout charge. */ - public QueryRootQuery collections(CollectionConnectionQueryDefinition queryDef) { - return collections(args -> {}, queryDef); + public SellingPlanCheckoutChargeQuery type() { + startField("type"); + + return this; } /** - * List of the shop’s collections. + * The charge value for the checkout charge. */ - public QueryRootQuery collections(CollectionsArgumentsDefinition argsDef, CollectionConnectionQueryDefinition queryDef) { - startField("collections"); - - CollectionsArguments args = new CollectionsArguments(_queryBuilder); - argsDef.define(args); - CollectionsArguments.end(args); + public SellingPlanCheckoutChargeQuery value(SellingPlanCheckoutChargeValueQueryDefinition queryDef) { + startField("value"); _queryBuilder.append('{'); - queryDef.define(new CollectionConnectionQuery(_queryBuilder)); + queryDef.define(new SellingPlanCheckoutChargeValueQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - /** - * The customer associated with the given access token. Tokens are obtained by using the - * [`customerAccessTokenCreate` - * mutation](https://shopify.dev/docs/api/storefront/latest/mutations/customerAccessTokenCreate). - */ - public QueryRootQuery customer(String customerAccessToken, CustomerQueryDefinition queryDef) { - startField("customer"); + /** + * The initial payment due for the purchase. + */ + public static class SellingPlanCheckoutCharge extends AbstractResponse { + public SellingPlanCheckoutCharge() { + } - _queryBuilder.append("(customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + public SellingPlanCheckoutCharge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "type": { + responseData.put(key, SellingPlanCheckoutChargeType.fromGraphQl(jsonAsString(field.getValue(), key))); - _queryBuilder.append(')'); + break; + } - _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "value": { + responseData.put(key, UnknownSellingPlanCheckoutChargeValue.create(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "SellingPlanCheckoutCharge"; + } + /** + * The charge type for the checkout charge. + */ + + public SellingPlanCheckoutChargeType getType() { + return (SellingPlanCheckoutChargeType) get("type"); + } + + public SellingPlanCheckoutCharge setType(SellingPlanCheckoutChargeType arg) { + optimisticData.put(getKey("type"), arg); return this; } /** - * Returns the localized experiences configured for the shop. + * The charge value for the checkout charge. */ - public QueryRootQuery localization(LocalizationQueryDefinition queryDef) { - startField("localization"); - _queryBuilder.append('{'); - queryDef.define(new LocalizationQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SellingPlanCheckoutChargeValue getValue() { + return (SellingPlanCheckoutChargeValue) get("value"); + } + public SellingPlanCheckoutCharge setValue(SellingPlanCheckoutChargeValue arg) { + optimisticData.put(getKey("value"), arg); return this; } - public class LocationsArguments extends Arguments { - LocationsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "type": return false; - /** - * Returns up to the first `n` elements from the list. - */ - public LocationsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + case "value": return false; - /** - * Returns the elements that come after the specified cursor. - */ - public LocationsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; + default: return false; } + } + } - /** - * Returns up to the last `n` elements from the list. - */ - public LocationsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + public interface SellingPlanCheckoutChargePercentageValueQueryDefinition { + void define(SellingPlanCheckoutChargePercentageValueQuery _queryBuilder); + } - /** - * Returns the elements that come before the specified cursor. - */ - public LocationsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + /** + * The percentage value of the price used for checkout charge. + */ + public static class SellingPlanCheckoutChargePercentageValueQuery extends Query { + SellingPlanCheckoutChargePercentageValueQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - /** - * Reverse the order of the underlying list. - */ - public LocationsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + /** + * The percentage value of the price used for checkout charge. + */ + public SellingPlanCheckoutChargePercentageValueQuery percentage() { + startField("percentage"); - /** - * Sort the underlying list by the given key. - */ - public LocationsArguments sortKey(LocationSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; - } + return this; + } + } - /** - * Used to sort results based on proximity to the provided location. - */ - public LocationsArguments near(GeoCoordinateInput value) { - if (value != null) { - startArgument("near"); - value.appendTo(_queryBuilder); + /** + * The percentage value of the price used for checkout charge. + */ + public static class SellingPlanCheckoutChargePercentageValue extends AbstractResponse implements SellingPlanCheckoutChargeValue { + public SellingPlanCheckoutChargePercentageValue() { + } + + public SellingPlanCheckoutChargePercentageValue(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "percentage": { + responseData.put(key, jsonAsDouble(field.getValue(), key)); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } } - public interface LocationsArgumentsDefinition { - void define(LocationsArguments args); + public String getGraphQlTypeName() { + return "SellingPlanCheckoutChargePercentageValue"; } /** - * List of the shop's locations that support in-store pickup. - * When sorting by distance, you must specify a location via the `near` argument. + * The percentage value of the price used for checkout charge. */ - public QueryRootQuery locations(LocationConnectionQueryDefinition queryDef) { - return locations(args -> {}, queryDef); - } - /** - * List of the shop's locations that support in-store pickup. - * When sorting by distance, you must specify a location via the `near` argument. - */ - public QueryRootQuery locations(LocationsArgumentsDefinition argsDef, LocationConnectionQueryDefinition queryDef) { - startField("locations"); + public Double getPercentage() { + return (Double) get("percentage"); + } - LocationsArguments args = new LocationsArguments(_queryBuilder); - argsDef.define(args); - LocationsArguments.end(args); + public SellingPlanCheckoutChargePercentageValue setPercentage(Double arg) { + optimisticData.put(getKey("percentage"), arg); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new LocationConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "percentage": return false; - return this; + default: return false; + } } + } + /** + * The checkout charge when the full amount isn't charged at checkout. + */ + public enum SellingPlanCheckoutChargeType { /** - * Retrieve a [navigation menu](https://help.shopify.com/manual/online-store/menus-and-links) by its - * handle. + * The checkout charge is a percentage of the product or variant price. */ - public QueryRootQuery menu(String handle, MenuQueryDefinition queryDef) { - startField("menu"); - - _queryBuilder.append("(handle:"); - Query.appendQuotedString(_queryBuilder, handle.toString()); - - _queryBuilder.append(')'); + PERCENTAGE, - _queryBuilder.append('{'); - queryDef.define(new MenuQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The checkout charge is a fixed price amount. + */ + PRICE, - return this; - } + UNKNOWN_VALUE; - public class MetaobjectArguments extends Arguments { - MetaobjectArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); + public static SellingPlanCheckoutChargeType fromGraphQl(String value) { + if (value == null) { + return null; } - /** - * The ID of the metaobject. - */ - public MetaobjectArguments id(ID value) { - if (value != null) { - startArgument("id"); - Query.appendQuotedString(_queryBuilder, value.toString()); + switch (value) { + case "PERCENTAGE": { + return PERCENTAGE; } - return this; - } - /** - * The handle and type of the metaobject. - */ - public MetaobjectArguments handle(MetaobjectHandleInput value) { - if (value != null) { - startArgument("handle"); - value.appendTo(_queryBuilder); + case "PRICE": { + return PRICE; + } + + default: { + return UNKNOWN_VALUE; } - return this; } } + public String toString() { + switch (this) { + case PERCENTAGE: { + return "PERCENTAGE"; + } - public interface MetaobjectArgumentsDefinition { - void define(MetaobjectArguments args); - } + case PRICE: { + return "PRICE"; + } - /** - * Fetch a specific Metaobject by one of its unique identifiers. - */ - public QueryRootQuery metaobject(MetaobjectQueryDefinition queryDef) { - return metaobject(args -> {}, queryDef); + default: { + return ""; + } + } } + } - /** - * Fetch a specific Metaobject by one of its unique identifiers. - */ - public QueryRootQuery metaobject(MetaobjectArgumentsDefinition argsDef, MetaobjectQueryDefinition queryDef) { - startField("metaobject"); + public interface SellingPlanCheckoutChargeValueQueryDefinition { + void define(SellingPlanCheckoutChargeValueQuery _queryBuilder); + } - MetaobjectArguments args = new MetaobjectArguments(_queryBuilder); - argsDef.define(args); - MetaobjectArguments.end(args); + /** + * The portion of the price to be charged at checkout. + */ + public static class SellingPlanCheckoutChargeValueQuery extends Query { + SellingPlanCheckoutChargeValueQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - _queryBuilder.append('{'); - queryDef.define(new MetaobjectQuery(_queryBuilder)); - _queryBuilder.append('}'); + startField("__typename"); + } + public SellingPlanCheckoutChargeValueQuery onMoneyV2(MoneyV2QueryDefinition queryDef) { + startInlineFragment("MoneyV2"); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } - public class MetaobjectsArguments extends Arguments { - MetaobjectsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } + public SellingPlanCheckoutChargeValueQuery onSellingPlanCheckoutChargePercentageValue(SellingPlanCheckoutChargePercentageValueQueryDefinition queryDef) { + startInlineFragment("SellingPlanCheckoutChargePercentageValue"); + queryDef.define(new SellingPlanCheckoutChargePercentageValueQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + } - /** - * The key of a field to sort with. Supports "id" and "updated_at". - */ - public MetaobjectsArguments sortKey(String value) { - if (value != null) { - startArgument("sortKey"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public interface SellingPlanCheckoutChargeValue { + String getGraphQlTypeName(); + } - /** - * Returns up to the first `n` elements from the list. - */ - public MetaobjectsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + /** + * The portion of the price to be charged at checkout. + */ + public static class UnknownSellingPlanCheckoutChargeValue extends AbstractResponse implements SellingPlanCheckoutChargeValue { + public UnknownSellingPlanCheckoutChargeValue() { + } - /** - * Returns the elements that come after the specified cursor. - */ - public MetaobjectsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); + public UnknownSellingPlanCheckoutChargeValue(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } + } - /** - * Returns up to the last `n` elements from the list. - */ - public MetaobjectsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); + public static SellingPlanCheckoutChargeValue create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "MoneyV2": { + return new MoneyV2(fields); } - return this; - } - /** - * Returns the elements that come before the specified cursor. - */ - public MetaobjectsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "SellingPlanCheckoutChargePercentageValue": { + return new SellingPlanCheckoutChargePercentageValue(fields); } - return this; - } - /** - * Reverse the order of the underlying list. - */ - public MetaobjectsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); + default: { + return new UnknownSellingPlanCheckoutChargeValue(fields); } - return this; } } - public interface MetaobjectsArgumentsDefinition { - void define(MetaobjectsArguments args); + public String getGraphQlTypeName() { + return (String) get("__typename"); } - /** - * All active metaobjects for the shop. - */ - public QueryRootQuery metaobjects(String type, MetaobjectConnectionQueryDefinition queryDef) { - return metaobjects(type, args -> {}, queryDef); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + default: return false; + } } + } - /** - * All active metaobjects for the shop. - */ - public QueryRootQuery metaobjects(String type, MetaobjectsArgumentsDefinition argsDef, MetaobjectConnectionQueryDefinition queryDef) { - startField("metaobjects"); - - _queryBuilder.append("(type:"); - Query.appendQuotedString(_queryBuilder, type.toString()); + public interface SellingPlanConnectionQueryDefinition { + void define(SellingPlanConnectionQuery _queryBuilder); + } - argsDef.define(new MetaobjectsArguments(_queryBuilder)); + /** + * An auto-generated type for paginating through multiple SellingPlans. + */ + public static class SellingPlanConnectionQuery extends Query { + SellingPlanConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - _queryBuilder.append(')'); + /** + * A list of edges. + */ + public SellingPlanConnectionQuery edges(SellingPlanEdgeQueryDefinition queryDef) { + startField("edges"); _queryBuilder.append('{'); - queryDef.define(new MetaobjectConnectionQuery(_queryBuilder)); + queryDef.define(new SellingPlanEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Returns a specific node by ID. + * A list of the nodes contained in SellingPlanEdge. */ - public QueryRootQuery node(ID id, NodeQueryDefinition queryDef) { - startField("node"); - - _queryBuilder.append("(id:"); - Query.appendQuotedString(_queryBuilder, id.toString()); - - _queryBuilder.append(')'); + public SellingPlanConnectionQuery nodes(SellingPlanQueryDefinition queryDef) { + startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new NodeQuery(_queryBuilder)); + queryDef.define(new SellingPlanQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Returns the list of nodes with the given IDs. + * Information to aid in pagination. */ - public QueryRootQuery nodes(List ids, NodeQueryDefinition queryDef) { - startField("nodes"); - - _queryBuilder.append("(ids:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (ID item1 : ids) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - Query.appendQuotedString(_queryBuilder, item1.toString()); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); + public SellingPlanConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); _queryBuilder.append('{'); - queryDef.define(new NodeQuery(_queryBuilder)); + queryDef.define(new PageInfoQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - public class PageArguments extends Arguments { - PageArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * An auto-generated type for paginating through multiple SellingPlans. + */ + public static class SellingPlanConnection extends AbstractResponse { + public SellingPlanConnection() { + } - /** - * The ID of the `Page`. - */ - public PageArguments id(ID value) { - if (value != null) { - startArgument("id"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public SellingPlanConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlanEdge(jsonAsObject(element1, key))); + } - /** - * The handle of the `Page`. - */ - public PageArguments handle(String value) { - if (value != null) { - startArgument("handle"); - Query.appendQuotedString(_queryBuilder, value.toString()); + responseData.put(key, list1); + + break; + } + + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlan(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } } - public interface PageArgumentsDefinition { - void define(PageArguments args); + public String getGraphQlTypeName() { + return "SellingPlanConnection"; } /** - * Fetch a specific `Page` by one of its unique attributes. + * A list of edges. */ - public QueryRootQuery page(PageQueryDefinition queryDef) { - return page(args -> {}, queryDef); + + public List getEdges() { + return (List) get("edges"); + } + + public SellingPlanConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; } /** - * Fetch a specific `Page` by one of its unique attributes. + * A list of the nodes contained in SellingPlanEdge. */ - public QueryRootQuery page(PageArgumentsDefinition argsDef, PageQueryDefinition queryDef) { - startField("page"); - - PageArguments args = new PageArguments(_queryBuilder); - argsDef.define(args); - PageArguments.end(args); - _queryBuilder.append('{'); - queryDef.define(new PageQuery(_queryBuilder)); - _queryBuilder.append('}'); + public List getNodes() { + return (List) get("nodes"); + } + public SellingPlanConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * Find a page by its handle. - * - * @deprecated Use `page` instead. + * Information to aid in pagination. */ - @Deprecated - public QueryRootQuery pageByHandle(String handle, PageQueryDefinition queryDef) { - startField("pageByHandle"); - - _queryBuilder.append("(handle:"); - Query.appendQuotedString(_queryBuilder, handle.toString()); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new PageQuery(_queryBuilder)); - _queryBuilder.append('}'); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } + public SellingPlanConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } - public class PagesArguments extends Arguments { - PagesArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public PagesArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public PagesArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the last `n` elements from the list. - */ - public PagesArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public PagesArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - /** - * Reverse the order of the underlying list. - */ - public PagesArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + case "nodes": return true; - /** - * Sort the underlying list by the given key. - */ - public PagesArguments sortKey(PageSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; - } + case "pageInfo": return true; - /** - * Apply one or multiple filters to the query. - * | name | description | acceptable_values | default_value | example_use | - * | ---- | ---- | ---- | ---- | ---- | - * | created_at | - * | handle | - * | title | - * | updated_at | - * Refer to the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) for more - * information about using filters. - */ - public PagesArguments query(String value) { - if (value != null) { - startArgument("query"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; + default: return false; } } + } - public interface PagesArgumentsDefinition { - void define(PagesArguments args); - } - - /** - * List of the shop's pages. - */ - public QueryRootQuery pages(PageConnectionQueryDefinition queryDef) { - return pages(args -> {}, queryDef); - } + public interface SellingPlanDeliveryPolicyQueryDefinition { + void define(SellingPlanDeliveryPolicyQuery _queryBuilder); + } - /** - * List of the shop's pages. - */ - public QueryRootQuery pages(PagesArgumentsDefinition argsDef, PageConnectionQueryDefinition queryDef) { - startField("pages"); + /** + * The selling plan delivery policy. + */ + public static class SellingPlanDeliveryPolicyQuery extends Query { + SellingPlanDeliveryPolicyQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - PagesArguments args = new PagesArguments(_queryBuilder); - argsDef.define(args); - PagesArguments.end(args); + startField("__typename"); + } - _queryBuilder.append('{'); - queryDef.define(new PageConnectionQuery(_queryBuilder)); + public SellingPlanDeliveryPolicyQuery onSellingPlanRecurringDeliveryPolicy(SellingPlanRecurringDeliveryPolicyQueryDefinition queryDef) { + startInlineFragment("SellingPlanRecurringDeliveryPolicy"); + queryDef.define(new SellingPlanRecurringDeliveryPolicyQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; } + } - public class PredictiveSearchArguments extends Arguments { - PredictiveSearchArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } - - /** - * Limits the number of results based on `limit_scope`. The value can range from 1 to 10, and the - * default is 10. - */ - public PredictiveSearchArguments limit(Integer value) { - if (value != null) { - startArgument("limit"); - _queryBuilder.append(value); - } - return this; - } + public interface SellingPlanDeliveryPolicy { + String getGraphQlTypeName(); + } - /** - * Decides the distribution of results. - */ - public PredictiveSearchArguments limitScope(PredictiveSearchLimitScope value) { - if (value != null) { - startArgument("limitScope"); - _queryBuilder.append(value.toString()); - } - return this; - } + /** + * The selling plan delivery policy. + */ + public static class UnknownSellingPlanDeliveryPolicy extends AbstractResponse implements SellingPlanDeliveryPolicy { + public UnknownSellingPlanDeliveryPolicy() { + } - /** - * Specifies the list of resource fields to use for search. The default fields searched on are TITLE, - * PRODUCT_TYPE, VARIANT_TITLE, and VENDOR. For the best search experience, you should search on the - * default field set. - * The input must not contain more than `250` values. - */ - public PredictiveSearchArguments searchableFields(List value) { - if (value != null) { - startArgument("searchableFields"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (SearchableField item1 : value) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - _queryBuilder.append(item1.toString()); - } + public UnknownSellingPlanDeliveryPolicy(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); } - _queryBuilder.append(']'); } - return this; } + } - /** - * The types of resources to search for. - * The input must not contain more than `250` values. - */ - public PredictiveSearchArguments types(List value) { - if (value != null) { - startArgument("types"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (PredictiveSearchType item1 : value) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - _queryBuilder.append(item1.toString()); - } - } - _queryBuilder.append(']'); + public static SellingPlanDeliveryPolicy create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "SellingPlanRecurringDeliveryPolicy": { + return new SellingPlanRecurringDeliveryPolicy(fields); } - return this; - } - /** - * Specifies how unavailable products are displayed in the search results. - */ - public PredictiveSearchArguments unavailableProducts(SearchUnavailableProductsType value) { - if (value != null) { - startArgument("unavailableProducts"); - _queryBuilder.append(value.toString()); + default: { + return new UnknownSellingPlanDeliveryPolicy(fields); } - return this; } } - public interface PredictiveSearchArgumentsDefinition { - void define(PredictiveSearchArguments args); - } - - /** - * List of the predictive search results. - */ - public QueryRootQuery predictiveSearch(String query, PredictiveSearchResultQueryDefinition queryDef) { - return predictiveSearch(query, args -> {}, queryDef); - } - - /** - * List of the predictive search results. - */ - public QueryRootQuery predictiveSearch(String query, PredictiveSearchArgumentsDefinition argsDef, PredictiveSearchResultQueryDefinition queryDef) { - startField("predictiveSearch"); - - _queryBuilder.append("(query:"); - Query.appendQuotedString(_queryBuilder, query.toString()); - - argsDef.define(new PredictiveSearchArguments(_queryBuilder)); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new PredictiveSearchResultQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + public String getGraphQlTypeName() { + return (String) get("__typename"); } - public class ProductArguments extends Arguments { - ProductArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * The ID of the `Product`. - */ - public ProductArguments id(ID value) { - if (value != null) { - startArgument("id"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * The handle of the `Product`. - */ - public ProductArguments handle(String value) { - if (value != null) { - startArgument("handle"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + default: return false; } } + } - public interface ProductArgumentsDefinition { - void define(ProductArguments args); + public interface SellingPlanEdgeQueryDefinition { + void define(SellingPlanEdgeQuery _queryBuilder); + } + + /** + * An auto-generated type which holds one SellingPlan and a cursor during pagination. + */ + public static class SellingPlanEdgeQuery extends Query { + SellingPlanEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * Fetch a specific `Product` by one of its unique attributes. + * A cursor for use in pagination. */ - public QueryRootQuery product(ProductQueryDefinition queryDef) { - return product(args -> {}, queryDef); + public SellingPlanEdgeQuery cursor() { + startField("cursor"); + + return this; } /** - * Fetch a specific `Product` by one of its unique attributes. + * The item at the end of SellingPlanEdge. */ - public QueryRootQuery product(ProductArgumentsDefinition argsDef, ProductQueryDefinition queryDef) { - startField("product"); - - ProductArguments args = new ProductArguments(_queryBuilder); - argsDef.define(args); - ProductArguments.end(args); + public SellingPlanEdgeQuery node(SellingPlanQueryDefinition queryDef) { + startField("node"); _queryBuilder.append('{'); - queryDef.define(new ProductQuery(_queryBuilder)); + queryDef.define(new SellingPlanQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - /** - * Find a product by its handle. - * - * @deprecated Use `product` instead. - */ - @Deprecated - public QueryRootQuery productByHandle(String handle, ProductQueryDefinition queryDef) { - startField("productByHandle"); - - _queryBuilder.append("(handle:"); - Query.appendQuotedString(_queryBuilder, handle.toString()); + /** + * An auto-generated type which holds one SellingPlan and a cursor during pagination. + */ + public static class SellingPlanEdge extends AbstractResponse { + public SellingPlanEdge() { + } - _queryBuilder.append(')'); + public SellingPlanEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - _queryBuilder.append('{'); - queryDef.define(new ProductQuery(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; - } + case "node": { + responseData.put(key, new SellingPlan(jsonAsObject(field.getValue(), key))); - public class ProductRecommendationsArguments extends Arguments { - ProductRecommendationsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } + break; + } - /** - * 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. - */ - public ProductRecommendationsArguments intent(ProductRecommendationIntent value) { - if (value != null) { - startArgument("intent"); - _queryBuilder.append(value.toString()); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } } - public interface ProductRecommendationsArgumentsDefinition { - void define(ProductRecommendationsArguments args); + public String getGraphQlTypeName() { + return "SellingPlanEdge"; } /** - * Find recommended products related to a given `product_id`. - * To learn more about how recommendations are generated, see - * [*Showing product recommendations on product - * pages*](https://help.shopify.com/themes/development/recommended-products). + * A cursor for use in pagination. */ - public QueryRootQuery productRecommendations(ID productId, ProductQueryDefinition queryDef) { - return productRecommendations(productId, args -> {}, queryDef); + + public String getCursor() { + return (String) get("cursor"); + } + + public SellingPlanEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); + return this; } /** - * Find recommended products related to a given `product_id`. - * To learn more about how recommendations are generated, see - * [*Showing product recommendations on product - * pages*](https://help.shopify.com/themes/development/recommended-products). + * The item at the end of SellingPlanEdge. */ - public QueryRootQuery productRecommendations(ID productId, ProductRecommendationsArgumentsDefinition argsDef, ProductQueryDefinition queryDef) { - startField("productRecommendations"); - - _queryBuilder.append("(productId:"); - Query.appendQuotedString(_queryBuilder, productId.toString()); - argsDef.define(new ProductRecommendationsArguments(_queryBuilder)); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new ProductQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SellingPlan getNode() { + return (SellingPlan) get("node"); + } + public SellingPlanEdge setNode(SellingPlan arg) { + optimisticData.put(getKey("node"), arg); return this; } - /** - * Tags added to products. - * Additional access scope required: unauthenticated_read_product_tags. - */ - public QueryRootQuery productTags(int first, StringConnectionQueryDefinition queryDef) { - startField("productTags"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - _queryBuilder.append("(first:"); - _queryBuilder.append(first); + case "node": return true; - _queryBuilder.append(')'); + default: return false; + } + } + } - _queryBuilder.append('{'); - queryDef.define(new StringConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public interface SellingPlanFixedAmountPriceAdjustmentQueryDefinition { + void define(SellingPlanFixedAmountPriceAdjustmentQuery _queryBuilder); + } - return this; + /** + * A fixed amount that's deducted from the original variant price. For example, $10.00 off. + */ + public static class SellingPlanFixedAmountPriceAdjustmentQuery extends Query { + SellingPlanFixedAmountPriceAdjustmentQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * List of product types for the shop's products that are published to your app. + * The money value of the price adjustment. */ - public QueryRootQuery productTypes(int first, StringConnectionQueryDefinition queryDef) { - startField("productTypes"); - - _queryBuilder.append("(first:"); - _queryBuilder.append(first); - - _queryBuilder.append(')'); + public SellingPlanFixedAmountPriceAdjustmentQuery adjustmentAmount(MoneyV2QueryDefinition queryDef) { + startField("adjustmentAmount"); _queryBuilder.append('{'); - queryDef.define(new StringConnectionQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - public class ProductsArguments extends Arguments { - ProductsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public ProductsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public ProductsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the last `n` elements from the list. - */ - public ProductsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public ProductsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + /** + * A fixed amount that's deducted from the original variant price. For example, $10.00 off. + */ + public static class SellingPlanFixedAmountPriceAdjustment extends AbstractResponse implements SellingPlanPriceAdjustmentValue { + public SellingPlanFixedAmountPriceAdjustment() { + } - /** - * Reverse the order of the underlying list. - */ - public ProductsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + public SellingPlanFixedAmountPriceAdjustment(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "adjustmentAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - /** - * Sort the underlying list by the given key. - */ - public ProductsArguments sortKey(ProductSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; - } + break; + } - /** - * Apply one or multiple filters to the query. - * | name | description | acceptable_values | default_value | example_use | - * | ---- | ---- | ---- | ---- | ---- | - * | available_for_sale | - * | created_at | - * | product_type | - * | tag | - * | tag_not | - * | title | - * | updated_at | - * | variants.price | - * | vendor | - * Refer to the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) for more - * information about using filters. - */ - public ProductsArguments query(String value) { - if (value != null) { - startArgument("query"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } } - public interface ProductsArgumentsDefinition { - void define(ProductsArguments args); + public String getGraphQlTypeName() { + return "SellingPlanFixedAmountPriceAdjustment"; } /** - * List of the shop’s products. For storefront search, use [`search` - * query](https://shopify.dev/docs/api/storefront/latest/queries/search). + * The money value of the price adjustment. */ - public QueryRootQuery products(ProductConnectionQueryDefinition queryDef) { - return products(args -> {}, queryDef); + + public MoneyV2 getAdjustmentAmount() { + return (MoneyV2) get("adjustmentAmount"); } - /** - * List of the shop’s products. For storefront search, use [`search` - * query](https://shopify.dev/docs/api/storefront/latest/queries/search). - */ - public QueryRootQuery products(ProductsArgumentsDefinition argsDef, ProductConnectionQueryDefinition queryDef) { - startField("products"); + public SellingPlanFixedAmountPriceAdjustment setAdjustmentAmount(MoneyV2 arg) { + optimisticData.put(getKey("adjustmentAmount"), arg); + return this; + } - ProductsArguments args = new ProductsArguments(_queryBuilder); - argsDef.define(args); - ProductsArguments.end(args); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "adjustmentAmount": return true; - _queryBuilder.append('{'); - queryDef.define(new ProductConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + default: return false; + } + } + } - return this; + public interface SellingPlanFixedPriceAdjustmentQueryDefinition { + void define(SellingPlanFixedPriceAdjustmentQuery _queryBuilder); + } + + /** + * A fixed price adjustment for a variant that's purchased with a selling plan. + */ + public static class SellingPlanFixedPriceAdjustmentQuery extends Query { + SellingPlanFixedPriceAdjustmentQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The list of public Storefront API versions, including supported, release candidate and unstable - * versions. + * A new price of the variant when it's purchased with the selling plan. */ - public QueryRootQuery publicApiVersions(ApiVersionQueryDefinition queryDef) { - startField("publicApiVersions"); + public SellingPlanFixedPriceAdjustmentQuery price(MoneyV2QueryDefinition queryDef) { + startField("price"); _queryBuilder.append('{'); - queryDef.define(new ApiVersionQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - public class SearchArguments extends Arguments { - SearchArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public SearchArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + /** + * A fixed price adjustment for a variant that's purchased with a selling plan. + */ + public static class SellingPlanFixedPriceAdjustment extends AbstractResponse implements SellingPlanPriceAdjustmentValue { + public SellingPlanFixedPriceAdjustment() { + } - /** - * Returns the elements that come after the specified cursor. - */ - public SearchArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public SellingPlanFixedPriceAdjustment(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "price": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - /** - * Returns up to the last `n` elements from the list. - */ - public SearchArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + break; + } - /** - * Returns the elements that come before the specified cursor. - */ - public SearchArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } + } - /** - * Reverse the order of the underlying list. - */ - public SearchArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + public String getGraphQlTypeName() { + return "SellingPlanFixedPriceAdjustment"; + } - /** - * Sort the underlying list by the given key. - */ - public SearchArguments sortKey(SearchSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; - } + /** + * A new price of the variant when it's purchased with the selling plan. + */ - /** - * Specifies whether to perform a partial word match on the last search term. - */ - public SearchArguments prefix(SearchPrefixQueryType value) { - if (value != null) { - startArgument("prefix"); - _queryBuilder.append(value.toString()); - } - return this; - } + public MoneyV2 getPrice() { + return (MoneyV2) get("price"); + } - /** - * Returns a subset of products matching all product filters. - * The input must not contain more than `250` values. - */ - public SearchArguments productFilters(List value) { - if (value != null) { - startArgument("productFilters"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (ProductFilter item1 : value) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - } - return this; - } + public SellingPlanFixedPriceAdjustment setPrice(MoneyV2 arg) { + optimisticData.put(getKey("price"), arg); + return this; + } - /** - * The types of resources to search for. - * The input must not contain more than `250` values. - */ - public SearchArguments types(List value) { - if (value != null) { - startArgument("types"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (SearchType item1 : value) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - _queryBuilder.append(item1.toString()); - } - } - _queryBuilder.append(']'); - } - return this; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "price": return true; - /** - * Specifies how unavailable products or variants are displayed in the search results. - */ - public SearchArguments unavailableProducts(SearchUnavailableProductsType value) { - if (value != null) { - startArgument("unavailableProducts"); - _queryBuilder.append(value.toString()); - } - return this; + default: return false; } } + } - public interface SearchArgumentsDefinition { - void define(SearchArguments args); - } + public interface SellingPlanGroupQueryDefinition { + void define(SellingPlanGroupQuery _queryBuilder); + } - /** - * List of the search results. - */ - public QueryRootQuery search(String query, SearchResultItemConnectionQueryDefinition queryDef) { - return search(query, args -> {}, queryDef); + /** + * Represents a selling method. For example, 'Subscribe and save' is a selling method where customers + * pay for goods or services per delivery. A selling plan group contains individual selling plans. + */ + public static class SellingPlanGroupQuery extends Query { + SellingPlanGroupQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * List of the search results. + * A display friendly name for the app that created the selling plan group. */ - public QueryRootQuery search(String query, SearchArgumentsDefinition argsDef, SearchResultItemConnectionQueryDefinition queryDef) { - startField("search"); - - _queryBuilder.append("(query:"); - Query.appendQuotedString(_queryBuilder, query.toString()); - - argsDef.define(new SearchArguments(_queryBuilder)); + public SellingPlanGroupQuery appName() { + startField("appName"); - _queryBuilder.append(')'); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new SearchResultItemConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The name of the selling plan group. + */ + public SellingPlanGroupQuery name() { + startField("name"); return this; } /** - * The shop associated with the storefront access token. + * Represents the selling plan options available in the drop-down list in the storefront. For example, + * 'Delivery every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the + * product. */ - public QueryRootQuery shop(ShopQueryDefinition queryDef) { - startField("shop"); + public SellingPlanGroupQuery options(SellingPlanGroupOptionQueryDefinition queryDef) { + startField("options"); _queryBuilder.append('{'); - queryDef.define(new ShopQuery(_queryBuilder)); + queryDef.define(new SellingPlanGroupOptionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - public class UrlRedirectsArguments extends Arguments { - UrlRedirectsArguments(StringBuilder _queryBuilder) { + public class SellingPlansArguments extends Arguments { + SellingPlansArguments(StringBuilder _queryBuilder) { super(_queryBuilder, true); } /** * Returns up to the first `n` elements from the list. */ - public UrlRedirectsArguments first(Integer value) { + public SellingPlansArguments first(Integer value) { if (value != null) { startArgument("first"); _queryBuilder.append(value); @@ -65645,7 +63894,7 @@ public UrlRedirectsArguments first(Integer value) { /** * Returns the elements that come after the specified cursor. */ - public UrlRedirectsArguments after(String value) { + public SellingPlansArguments after(String value) { if (value != null) { startArgument("after"); Query.appendQuotedString(_queryBuilder, value.toString()); @@ -65656,7 +63905,7 @@ public UrlRedirectsArguments after(String value) { /** * Returns up to the last `n` elements from the list. */ - public UrlRedirectsArguments last(Integer value) { + public SellingPlansArguments last(Integer value) { if (value != null) { startArgument("last"); _queryBuilder.append(value); @@ -65667,7 +63916,7 @@ public UrlRedirectsArguments last(Integer value) { /** * Returns the elements that come before the specified cursor. */ - public UrlRedirectsArguments before(String value) { + public SellingPlansArguments before(String value) { if (value != null) { startArgument("before"); Query.appendQuotedString(_queryBuilder, value.toString()); @@ -65678,322 +63927,65 @@ public UrlRedirectsArguments before(String value) { /** * Reverse the order of the underlying list. */ - public UrlRedirectsArguments reverse(Boolean value) { + public SellingPlansArguments reverse(Boolean value) { if (value != null) { startArgument("reverse"); _queryBuilder.append(value); } return this; } - - /** - * Apply one or multiple filters to the query. - * | name | description | acceptable_values | default_value | example_use | - * | ---- | ---- | ---- | ---- | ---- | - * | created_at | - * | path | - * | target | - * Refer to the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) for more - * information about using filters. - */ - public UrlRedirectsArguments query(String value) { - if (value != null) { - startArgument("query"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } } - public interface UrlRedirectsArgumentsDefinition { - void define(UrlRedirectsArguments args); + public interface SellingPlansArgumentsDefinition { + void define(SellingPlansArguments args); } /** - * A list of redirects for a shop. + * A list of selling plans in a selling plan group. A selling plan is a representation of how products + * and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of + * prepaid granola, delivered weekly'. */ - public QueryRootQuery urlRedirects(UrlRedirectConnectionQueryDefinition queryDef) { - return urlRedirects(args -> {}, queryDef); + public SellingPlanGroupQuery sellingPlans(SellingPlanConnectionQueryDefinition queryDef) { + return sellingPlans(args -> {}, queryDef); } /** - * A list of redirects for a shop. + * A list of selling plans in a selling plan group. A selling plan is a representation of how products + * and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of + * prepaid granola, delivered weekly'. */ - public QueryRootQuery urlRedirects(UrlRedirectsArgumentsDefinition argsDef, UrlRedirectConnectionQueryDefinition queryDef) { - startField("urlRedirects"); + public SellingPlanGroupQuery sellingPlans(SellingPlansArgumentsDefinition argsDef, SellingPlanConnectionQueryDefinition queryDef) { + startField("sellingPlans"); - UrlRedirectsArguments args = new UrlRedirectsArguments(_queryBuilder); + SellingPlansArguments args = new SellingPlansArguments(_queryBuilder); argsDef.define(args); - UrlRedirectsArguments.end(args); + SellingPlansArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new UrlRedirectConnectionQuery(_queryBuilder)); + queryDef.define(new SellingPlanConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - - public String toString() { - return _queryBuilder.toString(); - } } /** - * The schema’s entry-point for queries. This acts as the public, top-level API from which all queries - * must start. + * Represents a selling method. For example, 'Subscribe and save' is a selling method where customers + * pay for goods or services per delivery. A selling plan group contains individual selling plans. */ - public static class QueryRoot extends AbstractResponse { - public QueryRoot() { + public static class SellingPlanGroup extends AbstractResponse { + public SellingPlanGroup() { } - public QueryRoot(JsonObject fields) throws SchemaViolationError { + public SellingPlanGroup(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "article": { - Article optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Article(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "articles": { - responseData.put(key, new ArticleConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "blog": { - Blog optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Blog(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "blogByHandle": { - Blog optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Blog(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "blogs": { - responseData.put(key, new BlogConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "cart": { - Cart optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Cart(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "cartCompletionAttempt": { - CartCompletionAttemptResult optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = UnknownCartCompletionAttemptResult.create(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "collection": { - Collection optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Collection(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "collectionByHandle": { - Collection optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Collection(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "collections": { - responseData.put(key, new CollectionConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "customer": { - Customer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "localization": { - responseData.put(key, new Localization(jsonAsObject(field.getValue(), key))); - - break; - } - - case "locations": { - responseData.put(key, new LocationConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "menu": { - Menu optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Menu(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "metaobject": { - Metaobject optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metaobject(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "metaobjects": { - responseData.put(key, new MetaobjectConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "node": { - Node optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = UnknownNode.create(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Node optional2 = null; - if (!element1.isJsonNull()) { - optional2 = UnknownNode.create(jsonAsObject(element1, key)); - } - - list1.add(optional2); - } - - responseData.put(key, list1); - - break; - } - - case "page": { - Page optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Page(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "pageByHandle": { - Page optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Page(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "pages": { - responseData.put(key, new PageConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "predictiveSearch": { - PredictiveSearchResult optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new PredictiveSearchResult(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "product": { - Product optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Product(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "productByHandle": { - Product optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Product(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "productRecommendations": { - List optional1 = null; + case "appName": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Product(jsonAsObject(element1, key))); - } - - optional1 = list1; + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -66001,28 +63993,16 @@ public QueryRoot(JsonObject fields) throws SchemaViolationError { break; } - case "productTags": { - responseData.put(key, new StringConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "productTypes": { - responseData.put(key, new StringConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "products": { - responseData.put(key, new ProductConnection(jsonAsObject(field.getValue(), key))); + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "publicApiVersions": { - List list1 = new ArrayList<>(); + case "options": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ApiVersion(jsonAsObject(element1, key))); + list1.add(new SellingPlanGroupOption(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -66030,20 +64010,8 @@ public QueryRoot(JsonObject fields) throws SchemaViolationError { break; } - case "search": { - responseData.put(key, new SearchResultItemConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "shop": { - responseData.put(key, new Shop(jsonAsObject(field.getValue(), key))); - - break; - } - - case "urlRedirects": { - responseData.put(key, new UrlRedirectConnection(jsonAsObject(field.getValue(), key))); + case "sellingPlans": { + responseData.put(key, new SellingPlanConnection(jsonAsObject(field.getValue(), key))); break; } @@ -66058,561 +64026,598 @@ public QueryRoot(JsonObject fields) throws SchemaViolationError { } } } - - public String getGraphQlTypeName() { - return "QueryRoot"; - } - - /** - * Fetch a specific Article by its ID. - */ - - public Article getArticle() { - return (Article) get("article"); - } - - public QueryRoot setArticle(Article arg) { - optimisticData.put(getKey("article"), arg); - return this; - } - - /** - * List of the shop's articles. - */ - - public ArticleConnection getArticles() { - return (ArticleConnection) get("articles"); - } - - public QueryRoot setArticles(ArticleConnection arg) { - optimisticData.put(getKey("articles"), arg); - return this; - } - - /** - * Fetch a specific `Blog` by one of its unique attributes. - */ - - public Blog getBlog() { - return (Blog) get("blog"); - } - - public QueryRoot setBlog(Blog arg) { - optimisticData.put(getKey("blog"), arg); - return this; - } - - /** - * Find a blog by its handle. - * - * @deprecated Use `blog` instead. - */ - - public Blog getBlogByHandle() { - return (Blog) get("blogByHandle"); - } - - public QueryRoot setBlogByHandle(Blog arg) { - optimisticData.put(getKey("blogByHandle"), arg); - return this; - } - - /** - * List of the shop's blogs. - */ - - public BlogConnection getBlogs() { - return (BlogConnection) get("blogs"); - } - - public QueryRoot setBlogs(BlogConnection arg) { - optimisticData.put(getKey("blogs"), arg); - return this; - } - - /** - * Retrieve a cart by its ID. For more information, refer to - * [Manage a cart with the Storefront API](https://shopify.dev/custom-storefronts/cart/manage). - */ - - public Cart getCart() { - return (Cart) get("cart"); - } - - public QueryRoot setCart(Cart arg) { - optimisticData.put(getKey("cart"), arg); - return this; - } - - /** - * A poll for the status of the cart checkout completion and order creation. - */ - - public CartCompletionAttemptResult getCartCompletionAttempt() { - return (CartCompletionAttemptResult) get("cartCompletionAttempt"); - } - - public QueryRoot setCartCompletionAttempt(CartCompletionAttemptResult arg) { - optimisticData.put(getKey("cartCompletionAttempt"), arg); - return this; - } - - /** - * Fetch a specific `Collection` by one of its unique attributes. - */ - - public Collection getCollection() { - return (Collection) get("collection"); - } - - public QueryRoot setCollection(Collection arg) { - optimisticData.put(getKey("collection"), arg); - return this; - } - - /** - * Find a collection by its handle. - * - * @deprecated Use `collection` instead. - */ - - public Collection getCollectionByHandle() { - return (Collection) get("collectionByHandle"); - } - - public QueryRoot setCollectionByHandle(Collection arg) { - optimisticData.put(getKey("collectionByHandle"), arg); - return this; - } - - /** - * List of the shop’s collections. - */ - - public CollectionConnection getCollections() { - return (CollectionConnection) get("collections"); - } - - public QueryRoot setCollections(CollectionConnection arg) { - optimisticData.put(getKey("collections"), arg); - return this; + + public String getGraphQlTypeName() { + return "SellingPlanGroup"; } /** - * The customer associated with the given access token. Tokens are obtained by using the - * [`customerAccessTokenCreate` - * mutation](https://shopify.dev/docs/api/storefront/latest/mutations/customerAccessTokenCreate). + * A display friendly name for the app that created the selling plan group. */ - public Customer getCustomer() { - return (Customer) get("customer"); + public String getAppName() { + return (String) get("appName"); } - public QueryRoot setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); + public SellingPlanGroup setAppName(String arg) { + optimisticData.put(getKey("appName"), arg); return this; } /** - * Returns the localized experiences configured for the shop. + * The name of the selling plan group. */ - public Localization getLocalization() { - return (Localization) get("localization"); + public String getName() { + return (String) get("name"); } - public QueryRoot setLocalization(Localization arg) { - optimisticData.put(getKey("localization"), arg); + public SellingPlanGroup setName(String arg) { + optimisticData.put(getKey("name"), arg); return this; } /** - * List of the shop's locations that support in-store pickup. - * When sorting by distance, you must specify a location via the `near` argument. + * Represents the selling plan options available in the drop-down list in the storefront. For example, + * 'Delivery every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the + * product. */ - public LocationConnection getLocations() { - return (LocationConnection) get("locations"); + public List getOptions() { + return (List) get("options"); } - public QueryRoot setLocations(LocationConnection arg) { - optimisticData.put(getKey("locations"), arg); + public SellingPlanGroup setOptions(List arg) { + optimisticData.put(getKey("options"), arg); return this; } /** - * Retrieve a [navigation menu](https://help.shopify.com/manual/online-store/menus-and-links) by its - * handle. + * A list of selling plans in a selling plan group. A selling plan is a representation of how products + * and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of + * prepaid granola, delivered weekly'. */ - public Menu getMenu() { - return (Menu) get("menu"); + public SellingPlanConnection getSellingPlans() { + return (SellingPlanConnection) get("sellingPlans"); } - public QueryRoot setMenu(Menu arg) { - optimisticData.put(getKey("menu"), arg); + public SellingPlanGroup setSellingPlans(SellingPlanConnection arg) { + optimisticData.put(getKey("sellingPlans"), arg); return this; } - /** - * Fetch a specific Metaobject by one of its unique identifiers. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "appName": return false; - public Metaobject getMetaobject() { - return (Metaobject) get("metaobject"); - } + case "name": return false; - public QueryRoot setMetaobject(Metaobject arg) { - optimisticData.put(getKey("metaobject"), arg); - return this; - } + case "options": return true; - /** - * All active metaobjects for the shop. - */ + case "sellingPlans": return true; - public MetaobjectConnection getMetaobjects() { - return (MetaobjectConnection) get("metaobjects"); + default: return false; + } } + } - public QueryRoot setMetaobjects(MetaobjectConnection arg) { - optimisticData.put(getKey("metaobjects"), arg); - return this; + public interface SellingPlanGroupConnectionQueryDefinition { + void define(SellingPlanGroupConnectionQuery _queryBuilder); + } + + /** + * An auto-generated type for paginating through multiple SellingPlanGroups. + */ + public static class SellingPlanGroupConnectionQuery extends Query { + SellingPlanGroupConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * Returns a specific node by ID. + * A list of edges. */ + public SellingPlanGroupConnectionQuery edges(SellingPlanGroupEdgeQueryDefinition queryDef) { + startField("edges"); - public Node getNode() { - return (Node) get("node"); - } + _queryBuilder.append('{'); + queryDef.define(new SellingPlanGroupEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); - public QueryRoot setNode(Node arg) { - optimisticData.put(getKey("node"), arg); return this; } /** - * Returns the list of nodes with the given IDs. + * A list of the nodes contained in SellingPlanGroupEdge. */ + public SellingPlanGroupConnectionQuery nodes(SellingPlanGroupQueryDefinition queryDef) { + startField("nodes"); - public List getNodes() { - return (List) get("nodes"); - } + _queryBuilder.append('{'); + queryDef.define(new SellingPlanGroupQuery(_queryBuilder)); + _queryBuilder.append('}'); - public QueryRoot setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); return this; } /** - * Fetch a specific `Page` by one of its unique attributes. + * Information to aid in pagination. */ + public SellingPlanGroupConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - public Page getPage() { - return (Page) get("page"); - } + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); - public QueryRoot setPage(Page arg) { - optimisticData.put(getKey("page"), arg); return this; } + } - /** - * Find a page by its handle. - * - * @deprecated Use `page` instead. - */ + /** + * An auto-generated type for paginating through multiple SellingPlanGroups. + */ + public static class SellingPlanGroupConnection extends AbstractResponse { + public SellingPlanGroupConnection() { + } - public Page getPageByHandle() { - return (Page) get("pageByHandle"); + public SellingPlanGroupConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlanGroupEdge(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlanGroup(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public QueryRoot setPageByHandle(Page arg) { - optimisticData.put(getKey("pageByHandle"), arg); - return this; + public String getGraphQlTypeName() { + return "SellingPlanGroupConnection"; } /** - * List of the shop's pages. + * A list of edges. */ - public PageConnection getPages() { - return (PageConnection) get("pages"); + public List getEdges() { + return (List) get("edges"); } - public QueryRoot setPages(PageConnection arg) { - optimisticData.put(getKey("pages"), arg); + public SellingPlanGroupConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * List of the predictive search results. + * A list of the nodes contained in SellingPlanGroupEdge. */ - public PredictiveSearchResult getPredictiveSearch() { - return (PredictiveSearchResult) get("predictiveSearch"); + public List getNodes() { + return (List) get("nodes"); } - public QueryRoot setPredictiveSearch(PredictiveSearchResult arg) { - optimisticData.put(getKey("predictiveSearch"), arg); + public SellingPlanGroupConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * Fetch a specific `Product` by one of its unique attributes. + * Information to aid in pagination. */ - public Product getProduct() { - return (Product) get("product"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public QueryRoot setProduct(Product arg) { - optimisticData.put(getKey("product"), arg); + public SellingPlanGroupConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } - /** - * Find a product by its handle. - * - * @deprecated Use `product` instead. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - public Product getProductByHandle() { - return (Product) get("productByHandle"); + case "nodes": return true; + + case "pageInfo": return true; + + default: return false; + } } + } - public QueryRoot setProductByHandle(Product arg) { - optimisticData.put(getKey("productByHandle"), arg); - return this; + public interface SellingPlanGroupEdgeQueryDefinition { + void define(SellingPlanGroupEdgeQuery _queryBuilder); + } + + /** + * An auto-generated type which holds one SellingPlanGroup and a cursor during pagination. + */ + public static class SellingPlanGroupEdgeQuery extends Query { + SellingPlanGroupEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * Find recommended products related to a given `product_id`. - * To learn more about how recommendations are generated, see - * [*Showing product recommendations on product - * pages*](https://help.shopify.com/themes/development/recommended-products). + * A cursor for use in pagination. */ + public SellingPlanGroupEdgeQuery cursor() { + startField("cursor"); - public List getProductRecommendations() { - return (List) get("productRecommendations"); - } - - public QueryRoot setProductRecommendations(List arg) { - optimisticData.put(getKey("productRecommendations"), arg); return this; } /** - * Tags added to products. - * Additional access scope required: unauthenticated_read_product_tags. + * The item at the end of SellingPlanGroupEdge. */ + public SellingPlanGroupEdgeQuery node(SellingPlanGroupQueryDefinition queryDef) { + startField("node"); - public StringConnection getProductTags() { - return (StringConnection) get("productTags"); - } + _queryBuilder.append('{'); + queryDef.define(new SellingPlanGroupQuery(_queryBuilder)); + _queryBuilder.append('}'); - public QueryRoot setProductTags(StringConnection arg) { - optimisticData.put(getKey("productTags"), arg); return this; } + } - /** - * List of product types for the shop's products that are published to your app. - */ + /** + * An auto-generated type which holds one SellingPlanGroup and a cursor during pagination. + */ + public static class SellingPlanGroupEdge extends AbstractResponse { + public SellingPlanGroupEdge() { + } - public StringConnection getProductTypes() { - return (StringConnection) get("productTypes"); + public SellingPlanGroupEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "node": { + responseData.put(key, new SellingPlanGroup(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public QueryRoot setProductTypes(StringConnection arg) { - optimisticData.put(getKey("productTypes"), arg); - return this; + public String getGraphQlTypeName() { + return "SellingPlanGroupEdge"; } /** - * List of the shop’s products. For storefront search, use [`search` - * query](https://shopify.dev/docs/api/storefront/latest/queries/search). + * A cursor for use in pagination. */ - public ProductConnection getProducts() { - return (ProductConnection) get("products"); + public String getCursor() { + return (String) get("cursor"); } - public QueryRoot setProducts(ProductConnection arg) { - optimisticData.put(getKey("products"), arg); + public SellingPlanGroupEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * The list of public Storefront API versions, including supported, release candidate and unstable - * versions. + * The item at the end of SellingPlanGroupEdge. */ - public List getPublicApiVersions() { - return (List) get("publicApiVersions"); + public SellingPlanGroup getNode() { + return (SellingPlanGroup) get("node"); } - public QueryRoot setPublicApiVersions(List arg) { - optimisticData.put(getKey("publicApiVersions"), arg); + public SellingPlanGroupEdge setNode(SellingPlanGroup arg) { + optimisticData.put(getKey("node"), arg); return this; } - /** - * List of the search results. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - public SearchResultItemConnection getSearch() { - return (SearchResultItemConnection) get("search"); + case "node": return true; + + default: return false; + } } + } - public QueryRoot setSearch(SearchResultItemConnection arg) { - optimisticData.put(getKey("search"), arg); - return this; + public interface SellingPlanGroupOptionQueryDefinition { + void define(SellingPlanGroupOptionQuery _queryBuilder); + } + + /** + * Represents an option on a selling plan group that's available in the drop-down list in the + * storefront. + * Individual selling plans contribute their options to the associated selling plan group. For example, + * a selling plan group might have an option called `option1: Delivery every`. One selling plan in that + * group could contribute `option1: 2 weeks` with the pricing for that option, and another selling plan + * could contribute `option1: 4 weeks`, with different pricing. + */ + public static class SellingPlanGroupOptionQuery extends Query { + SellingPlanGroupOptionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The shop associated with the storefront access token. + * The name of the option. For example, 'Delivery every'. */ + public SellingPlanGroupOptionQuery name() { + startField("name"); - public Shop getShop() { - return (Shop) get("shop"); - } - - public QueryRoot setShop(Shop arg) { - optimisticData.put(getKey("shop"), arg); return this; } /** - * A list of redirects for a shop. + * The values for the options specified by the selling plans in the selling plan group. For example, '1 + * week', '2 weeks', '3 weeks'. */ + public SellingPlanGroupOptionQuery values() { + startField("values"); - public UrlRedirectConnection getUrlRedirects() { - return (UrlRedirectConnection) get("urlRedirects"); - } - - public QueryRoot setUrlRedirects(UrlRedirectConnection arg) { - optimisticData.put(getKey("urlRedirects"), arg); return this; } + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "article": return true; - - case "articles": return true; + /** + * Represents an option on a selling plan group that's available in the drop-down list in the + * storefront. + * Individual selling plans contribute their options to the associated selling plan group. For example, + * a selling plan group might have an option called `option1: Delivery every`. One selling plan in that + * group could contribute `option1: 2 weeks` with the pricing for that option, and another selling plan + * could contribute `option1: 4 weeks`, with different pricing. + */ + public static class SellingPlanGroupOption extends AbstractResponse { + public SellingPlanGroupOption() { + } - case "blog": return true; + public SellingPlanGroupOption(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case "blogByHandle": return true; + break; + } - case "blogs": return true; + case "values": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } - case "cart": return true; + responseData.put(key, list1); - case "cartCompletionAttempt": return false; + break; + } - case "collection": return true; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - case "collectionByHandle": return true; + public String getGraphQlTypeName() { + return "SellingPlanGroupOption"; + } - case "collections": return true; + /** + * The name of the option. For example, 'Delivery every'. + */ - case "customer": return true; + public String getName() { + return (String) get("name"); + } - case "localization": return true; + public SellingPlanGroupOption setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } - case "locations": return true; + /** + * The values for the options specified by the selling plans in the selling plan group. For example, '1 + * week', '2 weeks', '3 weeks'. + */ - case "menu": return true; + public List getValues() { + return (List) get("values"); + } - case "metaobject": return true; + public SellingPlanGroupOption setValues(List arg) { + optimisticData.put(getKey("values"), arg); + return this; + } - case "metaobjects": return true; + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "name": return false; - case "node": return false; + case "values": return false; - case "nodes": return false; + default: return false; + } + } + } - case "page": return true; + /** + * Represents a valid selling plan interval. + */ + public enum SellingPlanInterval { + /** + * Day interval. + */ + DAY, - case "pageByHandle": return true; + /** + * Month interval. + */ + MONTH, - case "pages": return true; + /** + * Week interval. + */ + WEEK, - case "predictiveSearch": return true; + /** + * Year interval. + */ + YEAR, - case "product": return true; + UNKNOWN_VALUE; - case "productByHandle": return true; + public static SellingPlanInterval fromGraphQl(String value) { + if (value == null) { + return null; + } - case "productRecommendations": return true; + switch (value) { + case "DAY": { + return DAY; + } - case "productTags": return true; + case "MONTH": { + return MONTH; + } - case "productTypes": return true; + case "WEEK": { + return WEEK; + } - case "products": return true; + case "YEAR": { + return YEAR; + } - case "publicApiVersions": return true; + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case DAY: { + return "DAY"; + } - case "search": return true; + case MONTH: { + return "MONTH"; + } - case "shop": return true; + case WEEK: { + return "WEEK"; + } - case "urlRedirects": return true; + case YEAR: { + return "YEAR"; + } - default: return false; + default: { + return ""; + } } } } - public interface SEOQueryDefinition { - void define(SEOQuery _queryBuilder); + public interface SellingPlanOptionQueryDefinition { + void define(SellingPlanOptionQuery _queryBuilder); } /** - * SEO information. + * An option provided by a Selling Plan. */ - public static class SEOQuery extends Query { - SEOQuery(StringBuilder _queryBuilder) { + public static class SellingPlanOptionQuery extends Query { + SellingPlanOptionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The meta description. + * The name of the option (ie "Delivery every"). */ - public SEOQuery description() { - startField("description"); + public SellingPlanOptionQuery name() { + startField("name"); return this; } /** - * The SEO title. + * The value of the option (ie "Month"). */ - public SEOQuery title() { - startField("title"); + public SellingPlanOptionQuery value() { + startField("value"); return this; } } /** - * SEO information. + * An option provided by a Selling Plan. */ - public static class SEO extends AbstractResponse { - public SEO() { + public static class SellingPlanOption extends AbstractResponse { + public SellingPlanOption() { } - public SEO(JsonObject fields) throws SchemaViolationError { + public SellingPlanOption(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "description": { + case "name": { String optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = jsonAsString(field.getValue(), key); @@ -66623,7 +64628,7 @@ public SEO(JsonObject fields) throws SchemaViolationError { break; } - case "title": { + case "value": { String optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = jsonAsString(field.getValue(), key); @@ -66646,148 +64651,82 @@ public SEO(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "SEO"; + return "SellingPlanOption"; } /** - * The meta description. + * The name of the option (ie "Delivery every"). */ - public String getDescription() { - return (String) get("description"); + public String getName() { + return (String) get("name"); } - public SEO setDescription(String arg) { - optimisticData.put(getKey("description"), arg); + public SellingPlanOption setName(String arg) { + optimisticData.put(getKey("name"), arg); return this; } /** - * The SEO title. + * The value of the option (ie "Month"). */ - public String getTitle() { - return (String) get("title"); + public String getValue() { + return (String) get("value"); } - public SEO setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public SellingPlanOption setValue(String arg) { + optimisticData.put(getKey("value"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "description": return false; + case "name": return false; - case "title": return false; + case "value": return false; default: return false; } } } - public interface ScriptDiscountApplicationQueryDefinition { - void define(ScriptDiscountApplicationQuery _queryBuilder); + public interface SellingPlanPercentagePriceAdjustmentQueryDefinition { + void define(SellingPlanPercentagePriceAdjustmentQuery _queryBuilder); } /** - * Script discount applications capture the intentions of a discount that - * was created by a Shopify Script. + * A percentage amount that's deducted from the original variant price. For example, 10% off. */ - public static class ScriptDiscountApplicationQuery extends Query { - ScriptDiscountApplicationQuery(StringBuilder _queryBuilder) { + public static class SellingPlanPercentagePriceAdjustmentQuery extends Query { + SellingPlanPercentagePriceAdjustmentQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The method by which the discount's value is allocated to its entitled items. - */ - public ScriptDiscountApplicationQuery allocationMethod() { - startField("allocationMethod"); - - return this; - } - - /** - * Which lines of targetType that the discount is allocated over. - */ - public ScriptDiscountApplicationQuery targetSelection() { - startField("targetSelection"); - - return this; - } - - /** - * The type of line that the discount is applicable towards. - */ - public ScriptDiscountApplicationQuery targetType() { - startField("targetType"); - - return this; - } - - /** - * The title of the application as defined by the Script. - */ - public ScriptDiscountApplicationQuery title() { - startField("title"); - - return this; - } - - /** - * The value of the discount application. + * The percentage value of the price adjustment. */ - public ScriptDiscountApplicationQuery value(PricingValueQueryDefinition queryDef) { - startField("value"); - - _queryBuilder.append('{'); - queryDef.define(new PricingValueQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SellingPlanPercentagePriceAdjustmentQuery adjustmentPercentage() { + startField("adjustmentPercentage"); return this; } } /** - * Script discount applications capture the intentions of a discount that - * was created by a Shopify Script. + * A percentage amount that's deducted from the original variant price. For example, 10% off. */ - public static class ScriptDiscountApplication extends AbstractResponse implements DiscountApplication { - public ScriptDiscountApplication() { + public static class SellingPlanPercentagePriceAdjustment extends AbstractResponse implements SellingPlanPriceAdjustmentValue { + public SellingPlanPercentagePriceAdjustment() { } - public ScriptDiscountApplication(JsonObject fields) throws SchemaViolationError { + public SellingPlanPercentagePriceAdjustment(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "allocationMethod": { - responseData.put(key, DiscountApplicationAllocationMethod.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "targetSelection": { - responseData.put(key, DiscountApplicationTargetSelection.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "targetType": { - responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "value": { - responseData.put(key, UnknownPricingValue.create(jsonAsObject(field.getValue(), key))); + case "adjustmentPercentage": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); break; } @@ -66804,212 +64743,100 @@ public ScriptDiscountApplication(JsonObject fields) throws SchemaViolationError } public String getGraphQlTypeName() { - return "ScriptDiscountApplication"; - } - - /** - * The method by which the discount's value is allocated to its entitled items. - */ - - public DiscountApplicationAllocationMethod getAllocationMethod() { - return (DiscountApplicationAllocationMethod) get("allocationMethod"); - } - - public ScriptDiscountApplication setAllocationMethod(DiscountApplicationAllocationMethod arg) { - optimisticData.put(getKey("allocationMethod"), arg); - return this; - } - - /** - * Which lines of targetType that the discount is allocated over. - */ - - public DiscountApplicationTargetSelection getTargetSelection() { - return (DiscountApplicationTargetSelection) get("targetSelection"); - } - - public ScriptDiscountApplication setTargetSelection(DiscountApplicationTargetSelection arg) { - optimisticData.put(getKey("targetSelection"), arg); - return this; - } - - /** - * The type of line that the discount is applicable towards. - */ - - public DiscountApplicationTargetType getTargetType() { - return (DiscountApplicationTargetType) get("targetType"); - } - - public ScriptDiscountApplication setTargetType(DiscountApplicationTargetType arg) { - optimisticData.put(getKey("targetType"), arg); - return this; - } - - /** - * The title of the application as defined by the Script. - */ - - public String getTitle() { - return (String) get("title"); - } - - public ScriptDiscountApplication setTitle(String arg) { - optimisticData.put(getKey("title"), arg); - return this; + return "SellingPlanPercentagePriceAdjustment"; } /** - * The value of the discount application. + * The percentage value of the price adjustment. */ - public PricingValue getValue() { - return (PricingValue) get("value"); + public Integer getAdjustmentPercentage() { + return (Integer) get("adjustmentPercentage"); } - public ScriptDiscountApplication setValue(PricingValue arg) { - optimisticData.put(getKey("value"), arg); + public SellingPlanPercentagePriceAdjustment setAdjustmentPercentage(Integer arg) { + optimisticData.put(getKey("adjustmentPercentage"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "allocationMethod": return false; - - case "targetSelection": return false; - - case "targetType": return false; - - case "title": return false; - - case "value": return false; + case "adjustmentPercentage": return false; default: return false; } } } - /** - * Specifies whether to perform a partial word match on the last search term. - */ - public enum SearchPrefixQueryType { - /** - * Perform a partial word match on the last search term. - */ - LAST, - - /** - * Don't perform a partial word match on the last search term. - */ - NONE, - - UNKNOWN_VALUE; - - public static SearchPrefixQueryType fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "LAST": { - return LAST; - } - - case "NONE": { - return NONE; - } - - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case LAST: { - return "LAST"; - } - - case NONE: { - return "NONE"; - } - - default: { - return ""; - } - } - } - } - - public interface SearchQuerySuggestionQueryDefinition { - void define(SearchQuerySuggestionQuery _queryBuilder); + public interface SellingPlanPriceAdjustmentQueryDefinition { + void define(SellingPlanPriceAdjustmentQuery _queryBuilder); } /** - * A search query suggestion. + * Represents by how much the price of a variant associated with a selling plan is adjusted. Each + * variant can have up to two price adjustments. If a variant has multiple price adjustments, then the + * first price adjustment applies when the variant is initially purchased. The second price adjustment + * applies after a certain number of orders (specified by the `orderCount` field) are made. If a + * selling plan doesn't have any price adjustments, then the unadjusted price of the variant is the + * effective price. */ - public static class SearchQuerySuggestionQuery extends Query { - SearchQuerySuggestionQuery(StringBuilder _queryBuilder) { + public static class SellingPlanPriceAdjustmentQuery extends Query { + SellingPlanPriceAdjustmentQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The text of the search query suggestion with highlighted HTML tags. + * The type of price adjustment. An adjustment value can have one of three types: percentage, amount + * off, or a new price. */ - public SearchQuerySuggestionQuery styledText() { - startField("styledText"); - - return this; - } + public SellingPlanPriceAdjustmentQuery adjustmentValue(SellingPlanPriceAdjustmentValueQueryDefinition queryDef) { + startField("adjustmentValue"); - /** - * The text of the search query suggestion. - */ - public SearchQuerySuggestionQuery text() { - startField("text"); + _queryBuilder.append('{'); + queryDef.define(new SellingPlanPriceAdjustmentValueQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * The number of orders that the price adjustment applies to. If the price adjustment always applies, + * then this field is `null`. */ - public SearchQuerySuggestionQuery trackingParameters() { - startField("trackingParameters"); + public SellingPlanPriceAdjustmentQuery orderCount() { + startField("orderCount"); return this; } } /** - * A search query suggestion. + * Represents by how much the price of a variant associated with a selling plan is adjusted. Each + * variant can have up to two price adjustments. If a variant has multiple price adjustments, then the + * first price adjustment applies when the variant is initially purchased. The second price adjustment + * applies after a certain number of orders (specified by the `orderCount` field) are made. If a + * selling plan doesn't have any price adjustments, then the unadjusted price of the variant is the + * effective price. */ - public static class SearchQuerySuggestion extends AbstractResponse implements Trackable { - public SearchQuerySuggestion() { + public static class SellingPlanPriceAdjustment extends AbstractResponse { + public SellingPlanPriceAdjustment() { } - public SearchQuerySuggestion(JsonObject fields) throws SchemaViolationError { + public SellingPlanPriceAdjustment(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "styledText": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "text": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "adjustmentValue": { + responseData.put(key, UnknownSellingPlanPriceAdjustmentValue.create(jsonAsObject(field.getValue(), key))); break; } - case "trackingParameters": { - String optional1 = null; + case "orderCount": { + Integer optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = jsonAsInteger(field.getValue(), key); } responseData.put(key, optional1); @@ -67029,110 +64856,98 @@ public SearchQuerySuggestion(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "SearchQuerySuggestion"; - } - - /** - * The text of the search query suggestion with highlighted HTML tags. - */ - - public String getStyledText() { - return (String) get("styledText"); - } - - public SearchQuerySuggestion setStyledText(String arg) { - optimisticData.put(getKey("styledText"), arg); - return this; + return "SellingPlanPriceAdjustment"; } /** - * The text of the search query suggestion. + * The type of price adjustment. An adjustment value can have one of three types: percentage, amount + * off, or a new price. */ - public String getText() { - return (String) get("text"); + public SellingPlanPriceAdjustmentValue getAdjustmentValue() { + return (SellingPlanPriceAdjustmentValue) get("adjustmentValue"); } - public SearchQuerySuggestion setText(String arg) { - optimisticData.put(getKey("text"), arg); + public SellingPlanPriceAdjustment setAdjustmentValue(SellingPlanPriceAdjustmentValue arg) { + optimisticData.put(getKey("adjustmentValue"), arg); return this; } /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * The number of orders that the price adjustment applies to. If the price adjustment always applies, + * then this field is `null`. */ - public String getTrackingParameters() { - return (String) get("trackingParameters"); + public Integer getOrderCount() { + return (Integer) get("orderCount"); } - public SearchQuerySuggestion setTrackingParameters(String arg) { - optimisticData.put(getKey("trackingParameters"), arg); + public SellingPlanPriceAdjustment setOrderCount(Integer arg) { + optimisticData.put(getKey("orderCount"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "styledText": return false; - - case "text": return false; + case "adjustmentValue": return false; - case "trackingParameters": return false; + case "orderCount": return false; default: return false; } } } - public interface SearchResultItemQueryDefinition { - void define(SearchResultItemQuery _queryBuilder); + public interface SellingPlanPriceAdjustmentValueQueryDefinition { + void define(SellingPlanPriceAdjustmentValueQuery _queryBuilder); } /** - * A search result that matches the search query. + * Represents by how much the price of a variant associated with a selling plan is adjusted. Each + * variant can have up to two price adjustments. */ - public static class SearchResultItemQuery extends Query { - SearchResultItemQuery(StringBuilder _queryBuilder) { + public static class SellingPlanPriceAdjustmentValueQuery extends Query { + SellingPlanPriceAdjustmentValueQuery(StringBuilder _queryBuilder) { super(_queryBuilder); startField("__typename"); } - public SearchResultItemQuery onArticle(ArticleQueryDefinition queryDef) { - startInlineFragment("Article"); - queryDef.define(new ArticleQuery(_queryBuilder)); + public SellingPlanPriceAdjustmentValueQuery onSellingPlanFixedAmountPriceAdjustment(SellingPlanFixedAmountPriceAdjustmentQueryDefinition queryDef) { + startInlineFragment("SellingPlanFixedAmountPriceAdjustment"); + queryDef.define(new SellingPlanFixedAmountPriceAdjustmentQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - public SearchResultItemQuery onPage(PageQueryDefinition queryDef) { - startInlineFragment("Page"); - queryDef.define(new PageQuery(_queryBuilder)); + public SellingPlanPriceAdjustmentValueQuery onSellingPlanFixedPriceAdjustment(SellingPlanFixedPriceAdjustmentQueryDefinition queryDef) { + startInlineFragment("SellingPlanFixedPriceAdjustment"); + queryDef.define(new SellingPlanFixedPriceAdjustmentQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - public SearchResultItemQuery onProduct(ProductQueryDefinition queryDef) { - startInlineFragment("Product"); - queryDef.define(new ProductQuery(_queryBuilder)); + public SellingPlanPriceAdjustmentValueQuery onSellingPlanPercentagePriceAdjustment(SellingPlanPercentagePriceAdjustmentQueryDefinition queryDef) { + startInlineFragment("SellingPlanPercentagePriceAdjustment"); + queryDef.define(new SellingPlanPercentagePriceAdjustmentQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } } - public interface SearchResultItem { + public interface SellingPlanPriceAdjustmentValue { String getGraphQlTypeName(); } /** - * A search result that matches the search query. + * Represents by how much the price of a variant associated with a selling plan is adjusted. Each + * variant can have up to two price adjustments. */ - public static class UnknownSearchResultItem extends AbstractResponse implements SearchResultItem { - public UnknownSearchResultItem() { + public static class UnknownSellingPlanPriceAdjustmentValue extends AbstractResponse implements SellingPlanPriceAdjustmentValue { + public UnknownSellingPlanPriceAdjustmentValue() { } - public UnknownSearchResultItem(JsonObject fields) throws SchemaViolationError { + public UnknownSellingPlanPriceAdjustmentValue(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -67148,23 +64963,23 @@ public UnknownSearchResultItem(JsonObject fields) throws SchemaViolationError { } } - public static SearchResultItem create(JsonObject fields) throws SchemaViolationError { + public static SellingPlanPriceAdjustmentValue create(JsonObject fields) throws SchemaViolationError { String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); switch (typeName) { - case "Article": { - return new Article(fields); + case "SellingPlanFixedAmountPriceAdjustment": { + return new SellingPlanFixedAmountPriceAdjustment(fields); } - case "Page": { - return new Page(fields); + case "SellingPlanFixedPriceAdjustment": { + return new SellingPlanFixedPriceAdjustment(fields); } - case "Product": { - return new Product(fields); + case "SellingPlanPercentagePriceAdjustment": { + return new SellingPlanPercentagePriceAdjustment(fields); } default: { - return new UnknownSearchResultItem(fields); + return new UnknownSellingPlanPriceAdjustmentValue(fields); } } } @@ -67180,132 +64995,56 @@ public boolean unwrapsToObject(String key) { } } - public interface SearchResultItemConnectionQueryDefinition { - void define(SearchResultItemConnectionQuery _queryBuilder); + public interface SellingPlanRecurringBillingPolicyQueryDefinition { + void define(SellingPlanRecurringBillingPolicyQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple SearchResultItems. - */ - public static class SearchResultItemConnectionQuery extends Query { - SearchResultItemConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * A list of edges. - */ - public SearchResultItemConnectionQuery edges(SearchResultItemEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new SearchResultItemEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * A list of the nodes contained in SearchResultItemEdge. - */ - public SearchResultItemConnectionQuery nodes(SearchResultItemQueryDefinition queryDef) { - startField("nodes"); - - _queryBuilder.append('{'); - queryDef.define(new SearchResultItemQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * Information to aid in pagination. - */ - public SearchResultItemConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + * The recurring billing policy for the selling plan. + */ + public static class SellingPlanRecurringBillingPolicyQuery extends Query { + SellingPlanRecurringBillingPolicyQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * A list of available filters. + * The billing frequency, it can be either: day, week, month or year. */ - public SearchResultItemConnectionQuery productFilters(FilterQueryDefinition queryDef) { - startField("productFilters"); - - _queryBuilder.append('{'); - queryDef.define(new FilterQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SellingPlanRecurringBillingPolicyQuery interval() { + startField("interval"); return this; } /** - * The total number of results. + * The number of intervals between billings. */ - public SearchResultItemConnectionQuery totalCount() { - startField("totalCount"); + public SellingPlanRecurringBillingPolicyQuery intervalCount() { + startField("intervalCount"); return this; } } /** - * An auto-generated type for paginating through multiple SearchResultItems. + * The recurring billing policy for the selling plan. */ - public static class SearchResultItemConnection extends AbstractResponse { - public SearchResultItemConnection() { + public static class SellingPlanRecurringBillingPolicy extends AbstractResponse implements SellingPlanBillingPolicy { + public SellingPlanRecurringBillingPolicy() { } - public SearchResultItemConnection(JsonObject fields) throws SchemaViolationError { + public SellingPlanRecurringBillingPolicy(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SearchResultItemEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(UnknownSearchResultItem.create(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - - break; - } - - case "productFilters": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Filter(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "interval": { + responseData.put(key, SellingPlanInterval.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "totalCount": { + case "intervalCount": { responseData.put(key, jsonAsInteger(field.getValue(), key)); break; @@ -67323,146 +65062,97 @@ public SearchResultItemConnection(JsonObject fields) throws SchemaViolationError } public String getGraphQlTypeName() { - return "SearchResultItemConnection"; - } - - /** - * A list of edges. - */ - - public List getEdges() { - return (List) get("edges"); - } - - public SearchResultItemConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; - } - - /** - * A list of the nodes contained in SearchResultItemEdge. - */ - - public List getNodes() { - return (List) get("nodes"); - } - - public SearchResultItemConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; - } - - /** - * Information to aid in pagination. - */ - - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } - - public SearchResultItemConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); - return this; + return "SellingPlanRecurringBillingPolicy"; } /** - * A list of available filters. + * The billing frequency, it can be either: day, week, month or year. */ - public List getProductFilters() { - return (List) get("productFilters"); + public SellingPlanInterval getInterval() { + return (SellingPlanInterval) get("interval"); } - public SearchResultItemConnection setProductFilters(List arg) { - optimisticData.put(getKey("productFilters"), arg); + public SellingPlanRecurringBillingPolicy setInterval(SellingPlanInterval arg) { + optimisticData.put(getKey("interval"), arg); return this; } /** - * The total number of results. + * The number of intervals between billings. */ - public Integer getTotalCount() { - return (Integer) get("totalCount"); + public Integer getIntervalCount() { + return (Integer) get("intervalCount"); } - public SearchResultItemConnection setTotalCount(Integer arg) { - optimisticData.put(getKey("totalCount"), arg); + public SellingPlanRecurringBillingPolicy setIntervalCount(Integer arg) { + optimisticData.put(getKey("intervalCount"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return false; - - case "pageInfo": return true; - - case "productFilters": return true; + case "interval": return false; - case "totalCount": return false; + case "intervalCount": return false; default: return false; } } } - public interface SearchResultItemEdgeQueryDefinition { - void define(SearchResultItemEdgeQuery _queryBuilder); + public interface SellingPlanRecurringDeliveryPolicyQueryDefinition { + void define(SellingPlanRecurringDeliveryPolicyQuery _queryBuilder); } /** - * An auto-generated type which holds one SearchResultItem and a cursor during pagination. + * The recurring delivery policy for the selling plan. */ - public static class SearchResultItemEdgeQuery extends Query { - SearchResultItemEdgeQuery(StringBuilder _queryBuilder) { + public static class SellingPlanRecurringDeliveryPolicyQuery extends Query { + SellingPlanRecurringDeliveryPolicyQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A cursor for use in pagination. + * The delivery frequency, it can be either: day, week, month or year. */ - public SearchResultItemEdgeQuery cursor() { - startField("cursor"); + public SellingPlanRecurringDeliveryPolicyQuery interval() { + startField("interval"); return this; } /** - * The item at the end of SearchResultItemEdge. + * The number of intervals between deliveries. */ - public SearchResultItemEdgeQuery node(SearchResultItemQueryDefinition queryDef) { - startField("node"); - - _queryBuilder.append('{'); - queryDef.define(new SearchResultItemQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SellingPlanRecurringDeliveryPolicyQuery intervalCount() { + startField("intervalCount"); return this; } } /** - * An auto-generated type which holds one SearchResultItem and a cursor during pagination. + * The recurring delivery policy for the selling plan. */ - public static class SearchResultItemEdge extends AbstractResponse { - public SearchResultItemEdge() { + public static class SellingPlanRecurringDeliveryPolicy extends AbstractResponse implements SellingPlanDeliveryPolicy { + public SellingPlanRecurringDeliveryPolicy() { } - public SearchResultItemEdge(JsonObject fields) throws SchemaViolationError { + public SellingPlanRecurringDeliveryPolicy(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "interval": { + responseData.put(key, SellingPlanInterval.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "node": { - responseData.put(key, UnknownSearchResultItem.create(jsonAsObject(field.getValue(), key))); + case "intervalCount": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); break; } @@ -67479,642 +65169,889 @@ public SearchResultItemEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "SearchResultItemEdge"; + return "SellingPlanRecurringDeliveryPolicy"; } /** - * A cursor for use in pagination. + * The delivery frequency, it can be either: day, week, month or year. */ - public String getCursor() { - return (String) get("cursor"); + public SellingPlanInterval getInterval() { + return (SellingPlanInterval) get("interval"); } - public SearchResultItemEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public SellingPlanRecurringDeliveryPolicy setInterval(SellingPlanInterval arg) { + optimisticData.put(getKey("interval"), arg); return this; } /** - * The item at the end of SearchResultItemEdge. + * The number of intervals between deliveries. */ - public SearchResultItem getNode() { - return (SearchResultItem) get("node"); + public Integer getIntervalCount() { + return (Integer) get("intervalCount"); } - public SearchResultItemEdge setNode(SearchResultItem arg) { - optimisticData.put(getKey("node"), arg); + public SellingPlanRecurringDeliveryPolicy setIntervalCount(Integer arg) { + optimisticData.put(getKey("intervalCount"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cursor": return false; + case "interval": return false; - case "node": return false; + case "intervalCount": return false; default: return false; } } } + public interface ShopQueryDefinition { + void define(ShopQuery _queryBuilder); + } + /** - * The set of valid sort keys for the search query. + * Shop represents a collection of the general settings and information about the shop. */ - public enum SearchSortKeys { + public static class ShopQuery extends Query { + ShopQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); + } + /** - * Sort by the `price` value. + * The shop's branding configuration. */ - PRICE, + public ShopQuery brand(BrandQueryDefinition queryDef) { + startField("brand"); + + _queryBuilder.append('{'); + queryDef.define(new BrandQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } /** - * Sort by relevance to the search terms. + * A description of the shop. */ - RELEVANCE, + public ShopQuery description() { + startField("description"); - UNKNOWN_VALUE; + return this; + } - public static SearchSortKeys fromGraphQl(String value) { - if (value == null) { - return null; + public class MetafieldArguments extends Arguments { + MetafieldArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); } - switch (value) { - case "PRICE": { - return PRICE; + /** + * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. + */ + public MetafieldArguments namespace(String value) { + if (value != null) { + startArgument("namespace"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } + } - case "RELEVANCE": { - return RELEVANCE; - } + public interface MetafieldArgumentsDefinition { + void define(MetafieldArguments args); + } - default: { - return UNKNOWN_VALUE; - } - } + /** + * Returns a metafield found by namespace and key. + */ + public ShopQuery metafield(String key, MetafieldQueryDefinition queryDef) { + return metafield(key, args -> {}, queryDef); } - public String toString() { - switch (this) { - case PRICE: { - return "PRICE"; - } - case RELEVANCE: { - return "RELEVANCE"; - } + /** + * Returns a metafield found by namespace and key. + */ + public ShopQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { + startField("metafield"); - default: { - return ""; + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + argsDef.define(new MetafieldArguments(_queryBuilder)); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ + public ShopQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); + + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); } } + _queryBuilder.append(']'); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } - } - /** - * The types of search items to perform search within. - */ - public enum SearchType { /** - * Returns matching articles. + * A string representing the way currency is formatted when the currency isn’t specified. */ - ARTICLE, + public ShopQuery moneyFormat() { + startField("moneyFormat"); + + return this; + } /** - * Returns matching pages. + * The shop’s name. */ - PAGE, + public ShopQuery name() { + startField("name"); + + return this; + } /** - * Returns matching products. + * Settings related to payments. */ - PRODUCT, + public ShopQuery paymentSettings(PaymentSettingsQueryDefinition queryDef) { + startField("paymentSettings"); - UNKNOWN_VALUE; + _queryBuilder.append('{'); + queryDef.define(new PaymentSettingsQuery(_queryBuilder)); + _queryBuilder.append('}'); - public static SearchType fromGraphQl(String value) { - if (value == null) { - return null; - } + return this; + } - switch (value) { - case "ARTICLE": { - return ARTICLE; - } + /** + * The primary domain of the shop’s Online Store. + */ + public ShopQuery primaryDomain(DomainQueryDefinition queryDef) { + startField("primaryDomain"); - case "PAGE": { - return PAGE; - } + _queryBuilder.append('{'); + queryDef.define(new DomainQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "PRODUCT": { - return PRODUCT; - } + return this; + } - default: { - return UNKNOWN_VALUE; - } - } + /** + * The shop’s privacy policy. + */ + public ShopQuery privacyPolicy(ShopPolicyQueryDefinition queryDef) { + startField("privacyPolicy"); + + _queryBuilder.append('{'); + queryDef.define(new ShopPolicyQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } - public String toString() { - switch (this) { - case ARTICLE: { - return "ARTICLE"; - } - case PAGE: { - return "PAGE"; - } + /** + * The shop’s refund policy. + */ + public ShopQuery refundPolicy(ShopPolicyQueryDefinition queryDef) { + startField("refundPolicy"); + + _queryBuilder.append('{'); + queryDef.define(new ShopPolicyQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The shop’s shipping policy. + */ + public ShopQuery shippingPolicy(ShopPolicyQueryDefinition queryDef) { + startField("shippingPolicy"); + + _queryBuilder.append('{'); + queryDef.define(new ShopPolicyQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * Countries that the shop ships to. + */ + public ShopQuery shipsToCountries() { + startField("shipsToCountries"); + + return this; + } + + /** + * The shop’s subscription policy. + */ + public ShopQuery subscriptionPolicy(ShopPolicyWithDefaultQueryDefinition queryDef) { + startField("subscriptionPolicy"); + + _queryBuilder.append('{'); + queryDef.define(new ShopPolicyWithDefaultQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The shop’s terms of service. + */ + public ShopQuery termsOfService(ShopPolicyQueryDefinition queryDef) { + startField("termsOfService"); + + _queryBuilder.append('{'); + queryDef.define(new ShopPolicyQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * Shop represents a collection of the general settings and information about the shop. + */ + public static class Shop extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { + public Shop() { + } + + public Shop(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "brand": { + Brand optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Brand(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "description": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } + + list1.add(optional2); + } + + responseData.put(key, list1); + + break; + } + + case "moneyFormat": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "paymentSettings": { + responseData.put(key, new PaymentSettings(jsonAsObject(field.getValue(), key))); + + break; + } + + case "primaryDomain": { + responseData.put(key, new Domain(jsonAsObject(field.getValue(), key))); + + break; + } + + case "privacyPolicy": { + ShopPolicy optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPolicy(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "refundPolicy": { + ShopPolicy optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPolicy(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); - case PRODUCT: { - return "PRODUCT"; - } + break; + } - default: { - return ""; - } - } - } - } + case "shippingPolicy": { + ShopPolicy optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPolicy(jsonAsObject(field.getValue(), key)); + } - /** - * Specifies whether to display results for unavailable products. - */ - public enum SearchUnavailableProductsType { - /** - * Exclude unavailable products. - */ - HIDE, + responseData.put(key, optional1); - /** - * Show unavailable products after all other matching results. This is the default. - */ - LAST, + break; + } - /** - * Show unavailable products in the order that they're found. - */ - SHOW, + case "shipsToCountries": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(CountryCode.fromGraphQl(jsonAsString(element1, key))); + } - UNKNOWN_VALUE; + responseData.put(key, list1); - public static SearchUnavailableProductsType fromGraphQl(String value) { - if (value == null) { - return null; - } + break; + } - switch (value) { - case "HIDE": { - return HIDE; - } + case "subscriptionPolicy": { + ShopPolicyWithDefault optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPolicyWithDefault(jsonAsObject(field.getValue(), key)); + } - case "LAST": { - return LAST; - } + responseData.put(key, optional1); - case "SHOW": { - return SHOW; - } + break; + } - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case HIDE: { - return "HIDE"; - } + case "termsOfService": { + ShopPolicy optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPolicy(jsonAsObject(field.getValue(), key)); + } - case LAST: { - return "LAST"; - } + responseData.put(key, optional1); - case SHOW: { - return "SHOW"; - } + break; + } - default: { - return ""; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } } } - } - /** - * Specifies the list of resource fields to search. - */ - public enum SearchableField { - /** - * Author of the page or article. - */ - AUTHOR, + public Shop(ID id) { + this(); + optimisticData.put("id", id); + } - /** - * Body of the page or article or product description or collection description. - */ - BODY, + public String getGraphQlTypeName() { + return "Shop"; + } /** - * Product type. + * The shop's branding configuration. */ - PRODUCT_TYPE, - /** - * Tag associated with the product or article. - */ - TAG, + public Brand getBrand() { + return (Brand) get("brand"); + } - /** - * Title of the page or article or product title or collection title. - */ - TITLE, + public Shop setBrand(Brand arg) { + optimisticData.put(getKey("brand"), arg); + return this; + } /** - * Variant barcode. + * A description of the shop. */ - VARIANTS_BARCODE, - /** - * Variant SKU. - */ - VARIANTS_SKU, + public String getDescription() { + return (String) get("description"); + } - /** - * Variant title. - */ - VARIANTS_TITLE, + public Shop setDescription(String arg) { + optimisticData.put(getKey("description"), arg); + return this; + } /** - * Product vendor. + * A globally-unique ID. */ - VENDOR, - - UNKNOWN_VALUE; - - public static SearchableField fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "AUTHOR": { - return AUTHOR; - } - case "BODY": { - return BODY; - } + public ID getId() { + return (ID) get("id"); + } - case "PRODUCT_TYPE": { - return PRODUCT_TYPE; - } + /** + * Returns a metafield found by namespace and key. + */ - case "TAG": { - return TAG; - } + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } - case "TITLE": { - return TITLE; - } + public Shop setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); + return this; + } - case "VARIANTS_BARCODE": { - return VARIANTS_BARCODE; - } + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ - case "VARIANTS_SKU": { - return VARIANTS_SKU; - } + public List getMetafields() { + return (List) get("metafields"); + } - case "VARIANTS_TITLE": { - return VARIANTS_TITLE; - } + public Shop setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); + return this; + } - case "VENDOR": { - return VENDOR; - } + /** + * A string representing the way currency is formatted when the currency isn’t specified. + */ - default: { - return UNKNOWN_VALUE; - } - } + public String getMoneyFormat() { + return (String) get("moneyFormat"); } - public String toString() { - switch (this) { - case AUTHOR: { - return "AUTHOR"; - } - case BODY: { - return "BODY"; - } + public Shop setMoneyFormat(String arg) { + optimisticData.put(getKey("moneyFormat"), arg); + return this; + } - case PRODUCT_TYPE: { - return "PRODUCT_TYPE"; - } + /** + * The shop’s name. + */ - case TAG: { - return "TAG"; - } + public String getName() { + return (String) get("name"); + } - case TITLE: { - return "TITLE"; - } + public Shop setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } - case VARIANTS_BARCODE: { - return "VARIANTS_BARCODE"; - } + /** + * Settings related to payments. + */ - case VARIANTS_SKU: { - return "VARIANTS_SKU"; - } + public PaymentSettings getPaymentSettings() { + return (PaymentSettings) get("paymentSettings"); + } - case VARIANTS_TITLE: { - return "VARIANTS_TITLE"; - } + public Shop setPaymentSettings(PaymentSettings arg) { + optimisticData.put(getKey("paymentSettings"), arg); + return this; + } - case VENDOR: { - return "VENDOR"; - } + /** + * The primary domain of the shop’s Online Store. + */ - default: { - return ""; - } - } + public Domain getPrimaryDomain() { + return (Domain) get("primaryDomain"); } - } - - public interface SelectedOptionQueryDefinition { - void define(SelectedOptionQuery _queryBuilder); - } - /** - * Properties used by customers to select a product variant. - * Products can have multiple options, like different sizes or colors. - */ - public static class SelectedOptionQuery extends Query { - SelectedOptionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public Shop setPrimaryDomain(Domain arg) { + optimisticData.put(getKey("primaryDomain"), arg); + return this; } /** - * The product option’s name. + * The shop’s privacy policy. */ - public SelectedOptionQuery name() { - startField("name"); + public ShopPolicy getPrivacyPolicy() { + return (ShopPolicy) get("privacyPolicy"); + } + + public Shop setPrivacyPolicy(ShopPolicy arg) { + optimisticData.put(getKey("privacyPolicy"), arg); return this; } /** - * The product option’s value. + * The shop’s refund policy. */ - public SelectedOptionQuery value() { - startField("value"); - return this; + public ShopPolicy getRefundPolicy() { + return (ShopPolicy) get("refundPolicy"); } - } - /** - * Properties used by customers to select a product variant. - * Products can have multiple options, like different sizes or colors. - */ - public static class SelectedOption extends AbstractResponse { - public SelectedOption() { + public Shop setRefundPolicy(ShopPolicy arg) { + optimisticData.put(getKey("refundPolicy"), arg); + return this; } - public SelectedOption(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * The shop’s shipping policy. + */ - break; - } + public ShopPolicy getShippingPolicy() { + return (ShopPolicy) get("shippingPolicy"); + } - case "value": { - responseData.put(key, jsonAsString(field.getValue(), key)); + public Shop setShippingPolicy(ShopPolicy arg) { + optimisticData.put(getKey("shippingPolicy"), arg); + return this; + } - break; - } + /** + * Countries that the shop ships to. + */ - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public List getShipsToCountries() { + return (List) get("shipsToCountries"); } - public String getGraphQlTypeName() { - return "SelectedOption"; + public Shop setShipsToCountries(List arg) { + optimisticData.put(getKey("shipsToCountries"), arg); + return this; } /** - * The product option’s name. + * The shop’s subscription policy. */ - public String getName() { - return (String) get("name"); + public ShopPolicyWithDefault getSubscriptionPolicy() { + return (ShopPolicyWithDefault) get("subscriptionPolicy"); } - public SelectedOption setName(String arg) { - optimisticData.put(getKey("name"), arg); + public Shop setSubscriptionPolicy(ShopPolicyWithDefault arg) { + optimisticData.put(getKey("subscriptionPolicy"), arg); return this; } /** - * The product option’s value. + * The shop’s terms of service. */ - public String getValue() { - return (String) get("value"); + public ShopPolicy getTermsOfService() { + return (ShopPolicy) get("termsOfService"); } - public SelectedOption setValue(String arg) { - optimisticData.put(getKey("value"), arg); + public Shop setTermsOfService(ShopPolicy arg) { + optimisticData.put(getKey("termsOfService"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { + case "brand": return true; + + case "description": return false; + + case "id": return false; + + case "metafield": return true; + + case "metafields": return true; + + case "moneyFormat": return false; + case "name": return false; - case "value": return false; + case "paymentSettings": return true; + + case "primaryDomain": return true; + + case "privacyPolicy": return true; + + case "refundPolicy": return true; + + case "shippingPolicy": return true; + + case "shipsToCountries": return false; + + case "subscriptionPolicy": return true; + + case "termsOfService": return true; default: return false; } } } - public static class SelectedOptionInput implements Serializable { - private String name; - - private String value; - - public SelectedOptionInput(String name, String value) { - this.name = name; + public interface ShopPayPaymentRequestQueryDefinition { + void define(ShopPayPaymentRequestQuery _queryBuilder); + } - this.value = value; + /** + * Represents a Shop Pay payment request. + */ + public static class ShopPayPaymentRequestQuery extends Query { + ShopPayPaymentRequestQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } - public String getName() { - return name; - } + /** + * The delivery methods for the payment request. + */ + public ShopPayPaymentRequestQuery deliveryMethods(ShopPayPaymentRequestDeliveryMethodQueryDefinition queryDef) { + startField("deliveryMethods"); + + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestDeliveryMethodQuery(_queryBuilder)); + _queryBuilder.append('}'); - public SelectedOptionInput setName(String name) { - this.name = name; return this; } - public String getValue() { - return value; - } + /** + * The discount codes for the payment request. + */ + public ShopPayPaymentRequestQuery discountCodes() { + startField("discountCodes"); - public SelectedOptionInput setValue(String value) { - this.value = value; return this; } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; + /** + * The discounts for the payment request order. + */ + public ShopPayPaymentRequestQuery discounts(ShopPayPaymentRequestDiscountQueryDefinition queryDef) { + startField("discounts"); + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestDiscountQuery(_queryBuilder)); + _queryBuilder.append('}'); - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("name:"); - Query.appendQuotedString(_queryBuilder, name.toString()); + return this; + } - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("value:"); - Query.appendQuotedString(_queryBuilder, value.toString()); + /** + * The line items for the payment request. + */ + public ShopPayPaymentRequestQuery lineItems(ShopPayPaymentRequestLineItemQueryDefinition queryDef) { + startField("lineItems"); + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestLineItemQuery(_queryBuilder)); _queryBuilder.append('}'); + + return this; } - } - public interface SellingPlanQueryDefinition { - void define(SellingPlanQuery _queryBuilder); - } + /** + * The locale for the payment request. + */ + public ShopPayPaymentRequestQuery locale() { + startField("locale"); - /** - * Represents how products and variants can be sold and purchased. - */ - public static class SellingPlanQuery extends Query { - SellingPlanQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * The initial payment due for the purchase. + * The presentment currency for the payment request. */ - public SellingPlanQuery checkoutCharge(SellingPlanCheckoutChargeQueryDefinition queryDef) { - startField("checkoutCharge"); + public ShopPayPaymentRequestQuery presentmentCurrency() { + startField("presentmentCurrency"); - _queryBuilder.append('{'); - queryDef.define(new SellingPlanCheckoutChargeQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * The delivery method type for the payment request. + */ + public ShopPayPaymentRequestQuery selectedDeliveryMethodType() { + startField("selectedDeliveryMethodType"); return this; } /** - * The description of the selling plan. + * The shipping address for the payment request. */ - public SellingPlanQuery description() { - startField("description"); + public ShopPayPaymentRequestQuery shippingAddress(ShopPayPaymentRequestContactFieldQueryDefinition queryDef) { + startField("shippingAddress"); + + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestContactFieldQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * A globally-unique ID. + * The shipping lines for the payment request. */ - public SellingPlanQuery id() { - startField("id"); + public ShopPayPaymentRequestQuery shippingLines(ShopPayPaymentRequestShippingLineQueryDefinition queryDef) { + startField("shippingLines"); + + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestShippingLineQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'. + * The subtotal amount for the payment request. */ - public SellingPlanQuery name() { - startField("name"); + public ShopPayPaymentRequestQuery subtotal(MoneyV2QueryDefinition queryDef) { + startField("subtotal"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The selling plan options available in the drop-down list in the storefront. For example, 'Delivery - * every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the product. - * Individual selling plans contribute their options to the associated selling plan group. For example, - * a selling plan group might have an option called `option1: Delivery every`. One selling plan in that - * group could contribute `option1: 2 weeks` with the pricing for that option, and another selling plan - * could contribute `option1: 4 weeks`, with different pricing. + * The total amount for the payment request. */ - public SellingPlanQuery options(SellingPlanOptionQueryDefinition queryDef) { - startField("options"); + public ShopPayPaymentRequestQuery total(MoneyV2QueryDefinition queryDef) { + startField("total"); _queryBuilder.append('{'); - queryDef.define(new SellingPlanOptionQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The price adjustments that a selling plan makes when a variant is purchased with a selling plan. + * The total shipping price for the payment request. */ - public SellingPlanQuery priceAdjustments(SellingPlanPriceAdjustmentQueryDefinition queryDef) { - startField("priceAdjustments"); + public ShopPayPaymentRequestQuery totalShippingPrice(ShopPayPaymentRequestTotalShippingPriceQueryDefinition queryDef) { + startField("totalShippingPrice"); _queryBuilder.append('{'); - queryDef.define(new SellingPlanPriceAdjustmentQuery(_queryBuilder)); + queryDef.define(new ShopPayPaymentRequestTotalShippingPriceQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Whether purchasing the selling plan will result in multiple deliveries. + * The total tax for the payment request. */ - public SellingPlanQuery recurringDeliveries() { - startField("recurringDeliveries"); + public ShopPayPaymentRequestQuery totalTax(MoneyV2QueryDefinition queryDef) { + startField("totalTax"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * Represents how products and variants can be sold and purchased. + * Represents a Shop Pay payment request. */ - public static class SellingPlan extends AbstractResponse { - public SellingPlan() { + public static class ShopPayPaymentRequest extends AbstractResponse { + public ShopPayPaymentRequest() { } - public SellingPlan(JsonObject fields) throws SchemaViolationError { + public ShopPayPaymentRequest(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "checkoutCharge": { - responseData.put(key, new SellingPlanCheckoutCharge(jsonAsObject(field.getValue(), key))); + case "deliveryMethods": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ShopPayPaymentRequestDeliveryMethod(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } - case "description": { - String optional1 = null; + case "discountCodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + responseData.put(key, list1); + + break; + } + + case "discounts": { + List optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ShopPayPaymentRequestDiscount(jsonAsObject(element1, key))); + } + + optional1 = list1; } responseData.put(key, optional1); @@ -68122,33 +66059,50 @@ public SellingPlan(JsonObject fields) throws SchemaViolationError { break; } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case "lineItems": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ShopPayPaymentRequestLineItem(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } - case "name": { + case "locale": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "options": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanOption(jsonAsObject(element1, key))); + case "presentmentCurrency": { + responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "selectedDeliveryMethodType": { + responseData.put(key, ShopPayPaymentRequestDeliveryMethodType.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "shippingAddress": { + ShopPayPaymentRequestContactField optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPayPaymentRequestContactField(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "priceAdjustments": { - List list1 = new ArrayList<>(); + case "shippingLines": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanPriceAdjustment(jsonAsObject(element1, key))); + list1.add(new ShopPayPaymentRequestShippingLine(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -68156,8 +66110,36 @@ public SellingPlan(JsonObject fields) throws SchemaViolationError { break; } - case "recurringDeliveries": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + case "subtotal": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "total": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "totalShippingPrice": { + ShopPayPaymentRequestTotalShippingPrice optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPayPaymentRequestTotalShippingPrice(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "totalTax": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } @@ -68174,414 +66156,427 @@ public SellingPlan(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "SellingPlan"; + return "ShopPayPaymentRequest"; } /** - * The initial payment due for the purchase. + * The delivery methods for the payment request. */ - public SellingPlanCheckoutCharge getCheckoutCharge() { - return (SellingPlanCheckoutCharge) get("checkoutCharge"); + public List getDeliveryMethods() { + return (List) get("deliveryMethods"); } - public SellingPlan setCheckoutCharge(SellingPlanCheckoutCharge arg) { - optimisticData.put(getKey("checkoutCharge"), arg); + public ShopPayPaymentRequest setDeliveryMethods(List arg) { + optimisticData.put(getKey("deliveryMethods"), arg); return this; } /** - * The description of the selling plan. + * The discount codes for the payment request. */ - public String getDescription() { - return (String) get("description"); + public List getDiscountCodes() { + return (List) get("discountCodes"); } - public SellingPlan setDescription(String arg) { - optimisticData.put(getKey("description"), arg); + public ShopPayPaymentRequest setDiscountCodes(List arg) { + optimisticData.put(getKey("discountCodes"), arg); return this; } /** - * A globally-unique ID. + * The discounts for the payment request order. */ - public ID getId() { - return (ID) get("id"); + public List getDiscounts() { + return (List) get("discounts"); } - public SellingPlan setId(ID arg) { - optimisticData.put(getKey("id"), arg); + public ShopPayPaymentRequest setDiscounts(List arg) { + optimisticData.put(getKey("discounts"), arg); return this; } /** - * The name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'. + * The line items for the payment request. */ - public String getName() { - return (String) get("name"); + public List getLineItems() { + return (List) get("lineItems"); } - public SellingPlan setName(String arg) { - optimisticData.put(getKey("name"), arg); + public ShopPayPaymentRequest setLineItems(List arg) { + optimisticData.put(getKey("lineItems"), arg); return this; } /** - * The selling plan options available in the drop-down list in the storefront. For example, 'Delivery - * every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the product. - * Individual selling plans contribute their options to the associated selling plan group. For example, - * a selling plan group might have an option called `option1: Delivery every`. One selling plan in that - * group could contribute `option1: 2 weeks` with the pricing for that option, and another selling plan - * could contribute `option1: 4 weeks`, with different pricing. + * The locale for the payment request. */ - public List getOptions() { - return (List) get("options"); + public String getLocale() { + return (String) get("locale"); } - public SellingPlan setOptions(List arg) { - optimisticData.put(getKey("options"), arg); + public ShopPayPaymentRequest setLocale(String arg) { + optimisticData.put(getKey("locale"), arg); return this; } /** - * The price adjustments that a selling plan makes when a variant is purchased with a selling plan. + * The presentment currency for the payment request. */ - public List getPriceAdjustments() { - return (List) get("priceAdjustments"); + public CurrencyCode getPresentmentCurrency() { + return (CurrencyCode) get("presentmentCurrency"); } - public SellingPlan setPriceAdjustments(List arg) { - optimisticData.put(getKey("priceAdjustments"), arg); + public ShopPayPaymentRequest setPresentmentCurrency(CurrencyCode arg) { + optimisticData.put(getKey("presentmentCurrency"), arg); return this; } /** - * Whether purchasing the selling plan will result in multiple deliveries. + * The delivery method type for the payment request. */ - public Boolean getRecurringDeliveries() { - return (Boolean) get("recurringDeliveries"); + public ShopPayPaymentRequestDeliveryMethodType getSelectedDeliveryMethodType() { + return (ShopPayPaymentRequestDeliveryMethodType) get("selectedDeliveryMethodType"); } - public SellingPlan setRecurringDeliveries(Boolean arg) { - optimisticData.put(getKey("recurringDeliveries"), arg); + public ShopPayPaymentRequest setSelectedDeliveryMethodType(ShopPayPaymentRequestDeliveryMethodType arg) { + optimisticData.put(getKey("selectedDeliveryMethodType"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkoutCharge": return true; - - case "description": return false; - - case "id": return false; - - case "name": return false; + /** + * The shipping address for the payment request. + */ - case "options": return true; + public ShopPayPaymentRequestContactField getShippingAddress() { + return (ShopPayPaymentRequestContactField) get("shippingAddress"); + } - case "priceAdjustments": return true; + public ShopPayPaymentRequest setShippingAddress(ShopPayPaymentRequestContactField arg) { + optimisticData.put(getKey("shippingAddress"), arg); + return this; + } - case "recurringDeliveries": return false; + /** + * The shipping lines for the payment request. + */ - default: return false; - } + public List getShippingLines() { + return (List) get("shippingLines"); } - } - - public interface SellingPlanAllocationQueryDefinition { - void define(SellingPlanAllocationQuery _queryBuilder); - } - /** - * Represents an association between a variant and a selling plan. Selling plan allocations describe - * the options offered for each variant, and the price of the variant when purchased with a selling - * plan. - */ - public static class SellingPlanAllocationQuery extends Query { - SellingPlanAllocationQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public ShopPayPaymentRequest setShippingLines(List arg) { + optimisticData.put(getKey("shippingLines"), arg); + return this; } /** - * The checkout charge amount due for the purchase. + * The subtotal amount for the payment request. */ - public SellingPlanAllocationQuery checkoutChargeAmount(MoneyV2QueryDefinition queryDef) { - startField("checkoutChargeAmount"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getSubtotal() { + return (MoneyV2) get("subtotal"); + } + public ShopPayPaymentRequest setSubtotal(MoneyV2 arg) { + optimisticData.put(getKey("subtotal"), arg); return this; } /** - * A list of price adjustments, with a maximum of two. When there are two, the first price adjustment - * goes into effect at the time of purchase, while the second one starts after a certain number of - * orders. A price adjustment represents how a selling plan affects pricing when a variant is purchased - * with a selling plan. Prices display in the customer's currency if the shop is configured for it. + * The total amount for the payment request. */ - public SellingPlanAllocationQuery priceAdjustments(SellingPlanAllocationPriceAdjustmentQueryDefinition queryDef) { - startField("priceAdjustments"); - _queryBuilder.append('{'); - queryDef.define(new SellingPlanAllocationPriceAdjustmentQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getTotal() { + return (MoneyV2) get("total"); + } + public ShopPayPaymentRequest setTotal(MoneyV2 arg) { + optimisticData.put(getKey("total"), arg); return this; } /** - * The remaining balance charge amount due for the purchase. + * The total shipping price for the payment request. */ - public SellingPlanAllocationQuery remainingBalanceChargeAmount(MoneyV2QueryDefinition queryDef) { - startField("remainingBalanceChargeAmount"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPayPaymentRequestTotalShippingPrice getTotalShippingPrice() { + return (ShopPayPaymentRequestTotalShippingPrice) get("totalShippingPrice"); + } + public ShopPayPaymentRequest setTotalShippingPrice(ShopPayPaymentRequestTotalShippingPrice arg) { + optimisticData.put(getKey("totalShippingPrice"), arg); return this; } /** - * A representation of how products and variants can be sold and purchased. For example, an individual - * selling plan could be '6 weeks of prepaid granola, delivered weekly'. + * The total tax for the payment request. */ - public SellingPlanAllocationQuery sellingPlan(SellingPlanQueryDefinition queryDef) { - startField("sellingPlan"); - _queryBuilder.append('{'); - queryDef.define(new SellingPlanQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getTotalTax() { + return (MoneyV2) get("totalTax"); + } + public ShopPayPaymentRequest setTotalTax(MoneyV2 arg) { + optimisticData.put(getKey("totalTax"), arg); return this; } - } - /** - * Represents an association between a variant and a selling plan. Selling plan allocations describe - * the options offered for each variant, and the price of the variant when purchased with a selling - * plan. - */ - public static class SellingPlanAllocation extends AbstractResponse { - public SellingPlanAllocation() { - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "deliveryMethods": return true; - public SellingPlanAllocation(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkoutChargeAmount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "discountCodes": return false; - break; - } + case "discounts": return true; - case "priceAdjustments": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanAllocationPriceAdjustment(jsonAsObject(element1, key))); - } + case "lineItems": return true; - responseData.put(key, list1); + case "locale": return false; - break; - } + case "presentmentCurrency": return false; - case "remainingBalanceChargeAmount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "selectedDeliveryMethodType": return false; - break; - } + case "shippingAddress": return true; - case "sellingPlan": { - responseData.put(key, new SellingPlan(jsonAsObject(field.getValue(), key))); + case "shippingLines": return true; - break; - } + case "subtotal": return true; - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } + case "total": return true; + + case "totalShippingPrice": return true; + + case "totalTax": return true; + + default: return false; } } + } - public String getGraphQlTypeName() { - return "SellingPlanAllocation"; + public interface ShopPayPaymentRequestContactFieldQueryDefinition { + void define(ShopPayPaymentRequestContactFieldQuery _queryBuilder); + } + + /** + * Represents a contact field for a Shop Pay payment request. + */ + public static class ShopPayPaymentRequestContactFieldQuery extends Query { + ShopPayPaymentRequestContactFieldQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The checkout charge amount due for the purchase. + * The first address line of the contact field. */ + public ShopPayPaymentRequestContactFieldQuery address1() { + startField("address1"); - public MoneyV2 getCheckoutChargeAmount() { - return (MoneyV2) get("checkoutChargeAmount"); - } - - public SellingPlanAllocation setCheckoutChargeAmount(MoneyV2 arg) { - optimisticData.put(getKey("checkoutChargeAmount"), arg); return this; } /** - * A list of price adjustments, with a maximum of two. When there are two, the first price adjustment - * goes into effect at the time of purchase, while the second one starts after a certain number of - * orders. A price adjustment represents how a selling plan affects pricing when a variant is purchased - * with a selling plan. Prices display in the customer's currency if the shop is configured for it. + * The second address line of the contact field. */ + public ShopPayPaymentRequestContactFieldQuery address2() { + startField("address2"); - public List getPriceAdjustments() { - return (List) get("priceAdjustments"); - } - - public SellingPlanAllocation setPriceAdjustments(List arg) { - optimisticData.put(getKey("priceAdjustments"), arg); return this; } /** - * The remaining balance charge amount due for the purchase. + * The city of the contact field. */ + public ShopPayPaymentRequestContactFieldQuery city() { + startField("city"); - public MoneyV2 getRemainingBalanceChargeAmount() { - return (MoneyV2) get("remainingBalanceChargeAmount"); - } - - public SellingPlanAllocation setRemainingBalanceChargeAmount(MoneyV2 arg) { - optimisticData.put(getKey("remainingBalanceChargeAmount"), arg); return this; } /** - * A representation of how products and variants can be sold and purchased. For example, an individual - * selling plan could be '6 weeks of prepaid granola, delivered weekly'. + * The company name of the contact field. */ + public ShopPayPaymentRequestContactFieldQuery companyName() { + startField("companyName"); - public SellingPlan getSellingPlan() { - return (SellingPlan) get("sellingPlan"); + return this; } - public SellingPlanAllocation setSellingPlan(SellingPlan arg) { - optimisticData.put(getKey("sellingPlan"), arg); + /** + * The country of the contact field. + */ + public ShopPayPaymentRequestContactFieldQuery countryCode() { + startField("countryCode"); + return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkoutChargeAmount": return true; - - case "priceAdjustments": return true; + /** + * The email of the contact field. + */ + public ShopPayPaymentRequestContactFieldQuery email() { + startField("email"); - case "remainingBalanceChargeAmount": return true; + return this; + } - case "sellingPlan": return true; + /** + * The first name of the contact field. + */ + public ShopPayPaymentRequestContactFieldQuery firstName() { + startField("firstName"); - default: return false; - } + return this; } - } - public interface SellingPlanAllocationConnectionQueryDefinition { - void define(SellingPlanAllocationConnectionQuery _queryBuilder); - } + /** + * The first name of the contact field. + */ + public ShopPayPaymentRequestContactFieldQuery lastName() { + startField("lastName"); - /** - * An auto-generated type for paginating through multiple SellingPlanAllocations. - */ - public static class SellingPlanAllocationConnectionQuery extends Query { - SellingPlanAllocationConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * A list of edges. + * The phone number of the contact field. */ - public SellingPlanAllocationConnectionQuery edges(SellingPlanAllocationEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanAllocationEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPayPaymentRequestContactFieldQuery phone() { + startField("phone"); return this; } /** - * A list of the nodes contained in SellingPlanAllocationEdge. + * The postal code of the contact field. */ - public SellingPlanAllocationConnectionQuery nodes(SellingPlanAllocationQueryDefinition queryDef) { - startField("nodes"); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPayPaymentRequestContactFieldQuery postalCode() { + startField("postalCode"); return this; } /** - * Information to aid in pagination. + * The province of the contact field. */ - public SellingPlanAllocationConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPayPaymentRequestContactFieldQuery provinceCode() { + startField("provinceCode"); return this; } } /** - * An auto-generated type for paginating through multiple SellingPlanAllocations. + * Represents a contact field for a Shop Pay payment request. */ - public static class SellingPlanAllocationConnection extends AbstractResponse { - public SellingPlanAllocationConnection() { + public static class ShopPayPaymentRequestContactField extends AbstractResponse { + public ShopPayPaymentRequestContactField() { } - public SellingPlanAllocationConnection(JsonObject fields) throws SchemaViolationError { + public ShopPayPaymentRequestContactField(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanAllocationEdge(jsonAsObject(element1, key))); + case "address1": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "address2": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanAllocation(jsonAsObject(element1, key))); + case "city": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "companyName": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "countryCode": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "email": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "firstName": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "lastName": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "phone": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "postalCode": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "provinceCode": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } @@ -68598,191 +66593,198 @@ public SellingPlanAllocationConnection(JsonObject fields) throws SchemaViolation } public String getGraphQlTypeName() { - return "SellingPlanAllocationConnection"; + return "ShopPayPaymentRequestContactField"; } /** - * A list of edges. + * The first address line of the contact field. */ - public List getEdges() { - return (List) get("edges"); + public String getAddress1() { + return (String) get("address1"); + } + + public ShopPayPaymentRequestContactField setAddress1(String arg) { + optimisticData.put(getKey("address1"), arg); + return this; + } + + /** + * The second address line of the contact field. + */ + + public String getAddress2() { + return (String) get("address2"); + } + + public ShopPayPaymentRequestContactField setAddress2(String arg) { + optimisticData.put(getKey("address2"), arg); + return this; + } + + /** + * The city of the contact field. + */ + + public String getCity() { + return (String) get("city"); } - public SellingPlanAllocationConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); + public ShopPayPaymentRequestContactField setCity(String arg) { + optimisticData.put(getKey("city"), arg); return this; } /** - * A list of the nodes contained in SellingPlanAllocationEdge. + * The company name of the contact field. */ - public List getNodes() { - return (List) get("nodes"); + public String getCompanyName() { + return (String) get("companyName"); } - public SellingPlanAllocationConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + public ShopPayPaymentRequestContactField setCompanyName(String arg) { + optimisticData.put(getKey("companyName"), arg); return this; } /** - * Information to aid in pagination. + * The country of the contact field. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public String getCountryCode() { + return (String) get("countryCode"); } - public SellingPlanAllocationConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public ShopPayPaymentRequestContactField setCountryCode(String arg) { + optimisticData.put(getKey("countryCode"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return true; - - case "pageInfo": return true; + /** + * The email of the contact field. + */ - default: return false; - } + public String getEmail() { + return (String) get("email"); } - } - - public interface SellingPlanAllocationEdgeQueryDefinition { - void define(SellingPlanAllocationEdgeQuery _queryBuilder); - } - /** - * An auto-generated type which holds one SellingPlanAllocation and a cursor during pagination. - */ - public static class SellingPlanAllocationEdgeQuery extends Query { - SellingPlanAllocationEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public ShopPayPaymentRequestContactField setEmail(String arg) { + optimisticData.put(getKey("email"), arg); + return this; } /** - * A cursor for use in pagination. + * The first name of the contact field. */ - public SellingPlanAllocationEdgeQuery cursor() { - startField("cursor"); + public String getFirstName() { + return (String) get("firstName"); + } + + public ShopPayPaymentRequestContactField setFirstName(String arg) { + optimisticData.put(getKey("firstName"), arg); return this; } /** - * The item at the end of SellingPlanAllocationEdge. + * The first name of the contact field. */ - public SellingPlanAllocationEdgeQuery node(SellingPlanAllocationQueryDefinition queryDef) { - startField("node"); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public String getLastName() { + return (String) get("lastName"); } - } - /** - * An auto-generated type which holds one SellingPlanAllocation and a cursor during pagination. - */ - public static class SellingPlanAllocationEdge extends AbstractResponse { - public SellingPlanAllocationEdge() { + public ShopPayPaymentRequestContactField setLastName(String arg) { + optimisticData.put(getKey("lastName"), arg); + return this; } - public SellingPlanAllocationEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "node": { - responseData.put(key, new SellingPlanAllocation(jsonAsObject(field.getValue(), key))); - - break; - } + /** + * The phone number of the contact field. + */ - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public String getPhone() { + return (String) get("phone"); } - public String getGraphQlTypeName() { - return "SellingPlanAllocationEdge"; + public ShopPayPaymentRequestContactField setPhone(String arg) { + optimisticData.put(getKey("phone"), arg); + return this; } /** - * A cursor for use in pagination. + * The postal code of the contact field. */ - public String getCursor() { - return (String) get("cursor"); + public String getPostalCode() { + return (String) get("postalCode"); } - public SellingPlanAllocationEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public ShopPayPaymentRequestContactField setPostalCode(String arg) { + optimisticData.put(getKey("postalCode"), arg); return this; } /** - * The item at the end of SellingPlanAllocationEdge. + * The province of the contact field. */ - public SellingPlanAllocation getNode() { - return (SellingPlanAllocation) get("node"); + public String getProvinceCode() { + return (String) get("provinceCode"); } - public SellingPlanAllocationEdge setNode(SellingPlanAllocation arg) { - optimisticData.put(getKey("node"), arg); + public ShopPayPaymentRequestContactField setProvinceCode(String arg) { + optimisticData.put(getKey("provinceCode"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cursor": return false; + case "address1": return false; - case "node": return true; + case "address2": return false; + + case "city": return false; + + case "companyName": return false; + + case "countryCode": return false; + + case "email": return false; + + case "firstName": return false; + + case "lastName": return false; + + case "phone": return false; + + case "postalCode": return false; + + case "provinceCode": return false; default: return false; } } } - public interface SellingPlanAllocationPriceAdjustmentQueryDefinition { - void define(SellingPlanAllocationPriceAdjustmentQuery _queryBuilder); + public interface ShopPayPaymentRequestDeliveryMethodQueryDefinition { + void define(ShopPayPaymentRequestDeliveryMethodQuery _queryBuilder); } /** - * The resulting prices for variants when they're purchased with a specific selling plan. + * Represents a delivery method for a Shop Pay payment request. */ - public static class SellingPlanAllocationPriceAdjustmentQuery extends Query { - SellingPlanAllocationPriceAdjustmentQuery(StringBuilder _queryBuilder) { + public static class ShopPayPaymentRequestDeliveryMethodQuery extends Query { + ShopPayPaymentRequestDeliveryMethodQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The price of the variant when it's purchased without a selling plan for the same number of - * deliveries. For example, if a customer purchases 6 deliveries of $10.00 granola separately, then the - * price is 6 x $10.00 = $60.00. + * The amount for the delivery method. */ - public SellingPlanAllocationPriceAdjustmentQuery compareAtPrice(MoneyV2QueryDefinition queryDef) { - startField("compareAtPrice"); + public ShopPayPaymentRequestDeliveryMethodQuery amount(MoneyV2QueryDefinition queryDef) { + startField("amount"); _queryBuilder.append('{'); queryDef.define(new MoneyV2Query(_queryBuilder)); @@ -68792,83 +66794,127 @@ public SellingPlanAllocationPriceAdjustmentQuery compareAtPrice(MoneyV2QueryDefi } /** - * The effective price for a single delivery. For example, for a prepaid subscription plan that - * includes 6 deliveries at the price of $48.00, the per delivery price is $8.00. + * The code of the delivery method. */ - public SellingPlanAllocationPriceAdjustmentQuery perDeliveryPrice(MoneyV2QueryDefinition queryDef) { - startField("perDeliveryPrice"); + public ShopPayPaymentRequestDeliveryMethodQuery code() { + startField("code"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * The detail about when the delivery may be expected. + */ + public ShopPayPaymentRequestDeliveryMethodQuery deliveryExpectationLabel() { + startField("deliveryExpectationLabel"); return this; } /** - * The price of the variant when it's purchased with a selling plan For example, for a prepaid - * subscription plan that includes 6 deliveries of $10.00 granola, where the customer gets 20% off, the - * price is 6 x $10.00 x 0.80 = $48.00. + * The detail of the delivery method. */ - public SellingPlanAllocationPriceAdjustmentQuery price(MoneyV2QueryDefinition queryDef) { - startField("price"); + public ShopPayPaymentRequestDeliveryMethodQuery detail() { + startField("detail"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * The label of the delivery method. + */ + public ShopPayPaymentRequestDeliveryMethodQuery label() { + startField("label"); return this; } /** - * The resulting price per unit for the variant associated with the selling plan. If the variant isn't - * sold by quantity or measurement, then this field returns `null`. + * The maximum delivery date for the delivery method. */ - public SellingPlanAllocationPriceAdjustmentQuery unitPrice(MoneyV2QueryDefinition queryDef) { - startField("unitPrice"); + public ShopPayPaymentRequestDeliveryMethodQuery maxDeliveryDate() { + startField("maxDeliveryDate"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * The minimum delivery date for the delivery method. + */ + public ShopPayPaymentRequestDeliveryMethodQuery minDeliveryDate() { + startField("minDeliveryDate"); return this; } } /** - * The resulting prices for variants when they're purchased with a specific selling plan. + * Represents a delivery method for a Shop Pay payment request. */ - public static class SellingPlanAllocationPriceAdjustment extends AbstractResponse { - public SellingPlanAllocationPriceAdjustment() { + public static class ShopPayPaymentRequestDeliveryMethod extends AbstractResponse { + public ShopPayPaymentRequestDeliveryMethod() { } - public SellingPlanAllocationPriceAdjustment(JsonObject fields) throws SchemaViolationError { + public ShopPayPaymentRequestDeliveryMethod(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "compareAtPrice": { + case "amount": { responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "perDeliveryPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "code": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "price": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "deliveryExpectationLabel": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "unitPrice": { - MoneyV2 optional1 = null; + case "detail": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "label": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "maxDeliveryDate": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "minDeliveryDate": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -68888,298 +66934,396 @@ public SellingPlanAllocationPriceAdjustment(JsonObject fields) throws SchemaViol } public String getGraphQlTypeName() { - return "SellingPlanAllocationPriceAdjustment"; + return "ShopPayPaymentRequestDeliveryMethod"; } /** - * The price of the variant when it's purchased without a selling plan for the same number of - * deliveries. For example, if a customer purchases 6 deliveries of $10.00 granola separately, then the - * price is 6 x $10.00 = $60.00. + * The amount for the delivery method. */ - public MoneyV2 getCompareAtPrice() { - return (MoneyV2) get("compareAtPrice"); + public MoneyV2 getAmount() { + return (MoneyV2) get("amount"); } - public SellingPlanAllocationPriceAdjustment setCompareAtPrice(MoneyV2 arg) { - optimisticData.put(getKey("compareAtPrice"), arg); + public ShopPayPaymentRequestDeliveryMethod setAmount(MoneyV2 arg) { + optimisticData.put(getKey("amount"), arg); return this; } /** - * The effective price for a single delivery. For example, for a prepaid subscription plan that - * includes 6 deliveries at the price of $48.00, the per delivery price is $8.00. + * The code of the delivery method. */ - public MoneyV2 getPerDeliveryPrice() { - return (MoneyV2) get("perDeliveryPrice"); + public String getCode() { + return (String) get("code"); } - public SellingPlanAllocationPriceAdjustment setPerDeliveryPrice(MoneyV2 arg) { - optimisticData.put(getKey("perDeliveryPrice"), arg); + public ShopPayPaymentRequestDeliveryMethod setCode(String arg) { + optimisticData.put(getKey("code"), arg); return this; } /** - * The price of the variant when it's purchased with a selling plan For example, for a prepaid - * subscription plan that includes 6 deliveries of $10.00 granola, where the customer gets 20% off, the - * price is 6 x $10.00 x 0.80 = $48.00. + * The detail about when the delivery may be expected. */ - public MoneyV2 getPrice() { - return (MoneyV2) get("price"); + public String getDeliveryExpectationLabel() { + return (String) get("deliveryExpectationLabel"); } - public SellingPlanAllocationPriceAdjustment setPrice(MoneyV2 arg) { - optimisticData.put(getKey("price"), arg); + public ShopPayPaymentRequestDeliveryMethod setDeliveryExpectationLabel(String arg) { + optimisticData.put(getKey("deliveryExpectationLabel"), arg); return this; } /** - * The resulting price per unit for the variant associated with the selling plan. If the variant isn't - * sold by quantity or measurement, then this field returns `null`. + * The detail of the delivery method. */ - public MoneyV2 getUnitPrice() { - return (MoneyV2) get("unitPrice"); + public String getDetail() { + return (String) get("detail"); } - public SellingPlanAllocationPriceAdjustment setUnitPrice(MoneyV2 arg) { - optimisticData.put(getKey("unitPrice"), arg); + public ShopPayPaymentRequestDeliveryMethod setDetail(String arg) { + optimisticData.put(getKey("detail"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "compareAtPrice": return true; - - case "perDeliveryPrice": return true; - - case "price": return true; - - case "unitPrice": return true; + /** + * The label of the delivery method. + */ - default: return false; - } + public String getLabel() { + return (String) get("label"); } - } - - public interface SellingPlanCheckoutChargeQueryDefinition { - void define(SellingPlanCheckoutChargeQuery _queryBuilder); - } - /** - * The initial payment due for the purchase. - */ - public static class SellingPlanCheckoutChargeQuery extends Query { - SellingPlanCheckoutChargeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public ShopPayPaymentRequestDeliveryMethod setLabel(String arg) { + optimisticData.put(getKey("label"), arg); + return this; } /** - * The charge type for the checkout charge. + * The maximum delivery date for the delivery method. */ - public SellingPlanCheckoutChargeQuery type() { - startField("type"); + public String getMaxDeliveryDate() { + return (String) get("maxDeliveryDate"); + } + + public ShopPayPaymentRequestDeliveryMethod setMaxDeliveryDate(String arg) { + optimisticData.put(getKey("maxDeliveryDate"), arg); return this; } /** - * The charge value for the checkout charge. + * The minimum delivery date for the delivery method. */ - public SellingPlanCheckoutChargeQuery value(SellingPlanCheckoutChargeValueQueryDefinition queryDef) { - startField("value"); - _queryBuilder.append('{'); - queryDef.define(new SellingPlanCheckoutChargeValueQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getMinDeliveryDate() { + return (String) get("minDeliveryDate"); + } + public ShopPayPaymentRequestDeliveryMethod setMinDeliveryDate(String arg) { + optimisticData.put(getKey("minDeliveryDate"), arg); return this; } - } - /** - * The initial payment due for the purchase. - */ - public static class SellingPlanCheckoutCharge extends AbstractResponse { - public SellingPlanCheckoutCharge() { + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "amount": return true; + + case "code": return false; + + case "deliveryExpectationLabel": return false; + + case "detail": return false; + + case "label": return false; + + case "maxDeliveryDate": return false; + + case "minDeliveryDate": return false; + + default: return false; + } } + } - public SellingPlanCheckoutCharge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "type": { - responseData.put(key, SellingPlanCheckoutChargeType.fromGraphQl(jsonAsString(field.getValue(), key))); + public static class ShopPayPaymentRequestDeliveryMethodInput implements Serializable { + private Input code = Input.undefined(); - break; - } + private Input label = Input.undefined(); - case "value": { - responseData.put(key, UnknownSellingPlanCheckoutChargeValue.create(jsonAsObject(field.getValue(), key))); + private Input detail = Input.undefined(); - break; - } + private Input amount = Input.undefined(); - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } + private Input minDeliveryDate = Input.undefined(); + + private Input maxDeliveryDate = Input.undefined(); + + private Input deliveryExpectationLabel = Input.undefined(); + + public String getCode() { + return code.getValue(); + } + + public Input getCodeInput() { + return code; + } + + public ShopPayPaymentRequestDeliveryMethodInput setCode(String code) { + this.code = Input.optional(code); + return this; + } + + public ShopPayPaymentRequestDeliveryMethodInput setCodeInput(Input code) { + if (code == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.code = code; + return this; } - public String getGraphQlTypeName() { - return "SellingPlanCheckoutCharge"; + public String getLabel() { + return label.getValue(); } - /** - * The charge type for the checkout charge. - */ + public Input getLabelInput() { + return label; + } - public SellingPlanCheckoutChargeType getType() { - return (SellingPlanCheckoutChargeType) get("type"); + public ShopPayPaymentRequestDeliveryMethodInput setLabel(String label) { + this.label = Input.optional(label); + return this; } - public SellingPlanCheckoutCharge setType(SellingPlanCheckoutChargeType arg) { - optimisticData.put(getKey("type"), arg); + public ShopPayPaymentRequestDeliveryMethodInput setLabelInput(Input label) { + if (label == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.label = label; return this; } - /** - * The charge value for the checkout charge. - */ + public String getDetail() { + return detail.getValue(); + } - public SellingPlanCheckoutChargeValue getValue() { - return (SellingPlanCheckoutChargeValue) get("value"); + public Input getDetailInput() { + return detail; } - public SellingPlanCheckoutCharge setValue(SellingPlanCheckoutChargeValue arg) { - optimisticData.put(getKey("value"), arg); + public ShopPayPaymentRequestDeliveryMethodInput setDetail(String detail) { + this.detail = Input.optional(detail); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "type": return false; + public ShopPayPaymentRequestDeliveryMethodInput setDetailInput(Input detail) { + if (detail == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.detail = detail; + return this; + } - case "value": return false; + public MoneyInput getAmount() { + return amount.getValue(); + } - default: return false; + public Input getAmountInput() { + return amount; + } + + public ShopPayPaymentRequestDeliveryMethodInput setAmount(MoneyInput amount) { + this.amount = Input.optional(amount); + return this; + } + + public ShopPayPaymentRequestDeliveryMethodInput setAmountInput(Input amount) { + if (amount == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.amount = amount; + return this; } - } - public interface SellingPlanCheckoutChargePercentageValueQueryDefinition { - void define(SellingPlanCheckoutChargePercentageValueQuery _queryBuilder); - } + public String getMinDeliveryDate() { + return minDeliveryDate.getValue(); + } - /** - * The percentage value of the price used for checkout charge. - */ - public static class SellingPlanCheckoutChargePercentageValueQuery extends Query { - SellingPlanCheckoutChargePercentageValueQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public Input getMinDeliveryDateInput() { + return minDeliveryDate; } - /** - * The percentage value of the price used for checkout charge. - */ - public SellingPlanCheckoutChargePercentageValueQuery percentage() { - startField("percentage"); + public ShopPayPaymentRequestDeliveryMethodInput setMinDeliveryDate(String minDeliveryDate) { + this.minDeliveryDate = Input.optional(minDeliveryDate); + return this; + } + public ShopPayPaymentRequestDeliveryMethodInput setMinDeliveryDateInput(Input minDeliveryDate) { + if (minDeliveryDate == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.minDeliveryDate = minDeliveryDate; return this; } - } - /** - * The percentage value of the price used for checkout charge. - */ - public static class SellingPlanCheckoutChargePercentageValue extends AbstractResponse implements SellingPlanCheckoutChargeValue { - public SellingPlanCheckoutChargePercentageValue() { + public String getMaxDeliveryDate() { + return maxDeliveryDate.getValue(); } - public SellingPlanCheckoutChargePercentageValue(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "percentage": { - responseData.put(key, jsonAsDouble(field.getValue(), key)); + public Input getMaxDeliveryDateInput() { + return maxDeliveryDate; + } - break; - } + public ShopPayPaymentRequestDeliveryMethodInput setMaxDeliveryDate(String maxDeliveryDate) { + this.maxDeliveryDate = Input.optional(maxDeliveryDate); + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } + public ShopPayPaymentRequestDeliveryMethodInput setMaxDeliveryDateInput(Input maxDeliveryDate) { + if (maxDeliveryDate == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.maxDeliveryDate = maxDeliveryDate; + return this; } - public String getGraphQlTypeName() { - return "SellingPlanCheckoutChargePercentageValue"; + public String getDeliveryExpectationLabel() { + return deliveryExpectationLabel.getValue(); } - /** - * The percentage value of the price used for checkout charge. - */ + public Input getDeliveryExpectationLabelInput() { + return deliveryExpectationLabel; + } - public Double getPercentage() { - return (Double) get("percentage"); + public ShopPayPaymentRequestDeliveryMethodInput setDeliveryExpectationLabel(String deliveryExpectationLabel) { + this.deliveryExpectationLabel = Input.optional(deliveryExpectationLabel); + return this; } - public SellingPlanCheckoutChargePercentageValue setPercentage(Double arg) { - optimisticData.put(getKey("percentage"), arg); + public ShopPayPaymentRequestDeliveryMethodInput setDeliveryExpectationLabelInput(Input deliveryExpectationLabel) { + if (deliveryExpectationLabel == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.deliveryExpectationLabel = deliveryExpectationLabel; return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "percentage": return false; + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + if (this.code.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("code:"); + if (code.getValue() != null) { + Query.appendQuotedString(_queryBuilder, code.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.label.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("label:"); + if (label.getValue() != null) { + Query.appendQuotedString(_queryBuilder, label.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.detail.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("detail:"); + if (detail.getValue() != null) { + Query.appendQuotedString(_queryBuilder, detail.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.amount.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("amount:"); + if (amount.getValue() != null) { + amount.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + if (this.minDeliveryDate.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("minDeliveryDate:"); + if (minDeliveryDate.getValue() != null) { + Query.appendQuotedString(_queryBuilder, minDeliveryDate.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.maxDeliveryDate.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("maxDeliveryDate:"); + if (maxDeliveryDate.getValue() != null) { + Query.appendQuotedString(_queryBuilder, maxDeliveryDate.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - default: return false; + if (this.deliveryExpectationLabel.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("deliveryExpectationLabel:"); + if (deliveryExpectationLabel.getValue() != null) { + Query.appendQuotedString(_queryBuilder, deliveryExpectationLabel.getValue().toString()); + } else { + _queryBuilder.append("null"); + } } + + _queryBuilder.append('}'); } } /** - * The checkout charge when the full amount isn't charged at checkout. + * Represents the delivery method type for a Shop Pay payment request. */ - public enum SellingPlanCheckoutChargeType { + public enum ShopPayPaymentRequestDeliveryMethodType { /** - * The checkout charge is a percentage of the product or variant price. + * The delivery method type is pickup. */ - PERCENTAGE, + PICKUP, /** - * The checkout charge is a fixed price amount. + * The delivery method type is shipping. */ - PRICE, + SHIPPING, UNKNOWN_VALUE; - public static SellingPlanCheckoutChargeType fromGraphQl(String value) { + public static ShopPayPaymentRequestDeliveryMethodType fromGraphQl(String value) { if (value == null) { return null; } switch (value) { - case "PERCENTAGE": { - return PERCENTAGE; + case "PICKUP": { + return PICKUP; } - case "PRICE": { - return PRICE; + case "SHIPPING": { + return SHIPPING; } default: { @@ -69189,12 +67333,12 @@ public static SellingPlanCheckoutChargeType fromGraphQl(String value) { } public String toString() { switch (this) { - case PERCENTAGE: { - return "PERCENTAGE"; + case PICKUP: { + return "PICKUP"; } - case PRICE: { - return "PRICE"; + case SHIPPING: { + return "SHIPPING"; } default: { @@ -69204,51 +67348,65 @@ public String toString() { } } - public interface SellingPlanCheckoutChargeValueQueryDefinition { - void define(SellingPlanCheckoutChargeValueQuery _queryBuilder); + public interface ShopPayPaymentRequestDiscountQueryDefinition { + void define(ShopPayPaymentRequestDiscountQuery _queryBuilder); } /** - * The portion of the price to be charged at checkout. + * Represents a discount for a Shop Pay payment request. */ - public static class SellingPlanCheckoutChargeValueQuery extends Query { - SellingPlanCheckoutChargeValueQuery(StringBuilder _queryBuilder) { + public static class ShopPayPaymentRequestDiscountQuery extends Query { + ShopPayPaymentRequestDiscountQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("__typename"); } - public SellingPlanCheckoutChargeValueQuery onMoneyV2(MoneyV2QueryDefinition queryDef) { - startInlineFragment("MoneyV2"); + /** + * The amount of the discount. + */ + public ShopPayPaymentRequestDiscountQuery amount(MoneyV2QueryDefinition queryDef) { + startField("amount"); + + _queryBuilder.append('{'); queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); + return this; } - public SellingPlanCheckoutChargeValueQuery onSellingPlanCheckoutChargePercentageValue(SellingPlanCheckoutChargePercentageValueQueryDefinition queryDef) { - startInlineFragment("SellingPlanCheckoutChargePercentageValue"); - queryDef.define(new SellingPlanCheckoutChargePercentageValueQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The label of the discount. + */ + public ShopPayPaymentRequestDiscountQuery label() { + startField("label"); + return this; } } - public interface SellingPlanCheckoutChargeValue { - String getGraphQlTypeName(); - } - /** - * The portion of the price to be charged at checkout. + * Represents a discount for a Shop Pay payment request. */ - public static class UnknownSellingPlanCheckoutChargeValue extends AbstractResponse implements SellingPlanCheckoutChargeValue { - public UnknownSellingPlanCheckoutChargeValue() { + public static class ShopPayPaymentRequestDiscount extends AbstractResponse { + public ShopPayPaymentRequestDiscount() { } - public UnknownSellingPlanCheckoutChargeValue(JsonObject fields) throws SchemaViolationError { + public ShopPayPaymentRequestDiscount(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { + case "amount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "label": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -69260,248 +67418,180 @@ public UnknownSellingPlanCheckoutChargeValue(JsonObject fields) throws SchemaVio } } - public static SellingPlanCheckoutChargeValue create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "MoneyV2": { - return new MoneyV2(fields); - } - - case "SellingPlanCheckoutChargePercentageValue": { - return new SellingPlanCheckoutChargePercentageValue(fields); - } - - default: { - return new UnknownSellingPlanCheckoutChargeValue(fields); - } - } - } - public String getGraphQlTypeName() { - return (String) get("__typename"); - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - default: return false; - } - } - } - - public interface SellingPlanConnectionQueryDefinition { - void define(SellingPlanConnectionQuery _queryBuilder); - } - - /** - * An auto-generated type for paginating through multiple SellingPlans. - */ - public static class SellingPlanConnectionQuery extends Query { - SellingPlanConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return "ShopPayPaymentRequestDiscount"; } /** - * A list of edges. + * The amount of the discount. */ - public SellingPlanConnectionQuery edges(SellingPlanEdgeQueryDefinition queryDef) { - startField("edges"); - _queryBuilder.append('{'); - queryDef.define(new SellingPlanEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getAmount() { + return (MoneyV2) get("amount"); + } + public ShopPayPaymentRequestDiscount setAmount(MoneyV2 arg) { + optimisticData.put(getKey("amount"), arg); return this; } /** - * A list of the nodes contained in SellingPlanEdge. + * The label of the discount. */ - public SellingPlanConnectionQuery nodes(SellingPlanQueryDefinition queryDef) { - startField("nodes"); - _queryBuilder.append('{'); - queryDef.define(new SellingPlanQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getLabel() { + return (String) get("label"); + } + public ShopPayPaymentRequestDiscount setLabel(String arg) { + optimisticData.put(getKey("label"), arg); return this; } - /** - * Information to aid in pagination. - */ - public SellingPlanConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "amount": return true; - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "label": return false; - return this; + default: return false; + } } } - /** - * An auto-generated type for paginating through multiple SellingPlans. - */ - public static class SellingPlanConnection extends AbstractResponse { - public SellingPlanConnection() { - } - - public SellingPlanConnection(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlan(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + public static class ShopPayPaymentRequestDiscountInput implements Serializable { + private Input label = Input.undefined(); - break; - } + private Input amount = Input.undefined(); - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public String getLabel() { + return label.getValue(); } - public String getGraphQlTypeName() { - return "SellingPlanConnection"; + public Input getLabelInput() { + return label; } - /** - * A list of edges. - */ - - public List getEdges() { - return (List) get("edges"); + public ShopPayPaymentRequestDiscountInput setLabel(String label) { + this.label = Input.optional(label); + return this; } - public SellingPlanConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); + public ShopPayPaymentRequestDiscountInput setLabelInput(Input label) { + if (label == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.label = label; return this; } - /** - * A list of the nodes contained in SellingPlanEdge. - */ - - public List getNodes() { - return (List) get("nodes"); + public MoneyInput getAmount() { + return amount.getValue(); } - public SellingPlanConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; + public Input getAmountInput() { + return amount; } - /** - * Information to aid in pagination. - */ - - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public ShopPayPaymentRequestDiscountInput setAmount(MoneyInput amount) { + this.amount = Input.optional(amount); + return this; } - public SellingPlanConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public ShopPayPaymentRequestDiscountInput setAmountInput(Input amount) { + if (amount == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.amount = amount; return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return true; + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - case "pageInfo": return true; + if (this.label.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("label:"); + if (label.getValue() != null) { + Query.appendQuotedString(_queryBuilder, label.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - default: return false; + if (this.amount.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("amount:"); + if (amount.getValue() != null) { + amount.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } } + + _queryBuilder.append('}'); } } - public interface SellingPlanEdgeQueryDefinition { - void define(SellingPlanEdgeQuery _queryBuilder); + public interface ShopPayPaymentRequestImageQueryDefinition { + void define(ShopPayPaymentRequestImageQuery _queryBuilder); } /** - * An auto-generated type which holds one SellingPlan and a cursor during pagination. + * Represents an image for a Shop Pay payment request line item. */ - public static class SellingPlanEdgeQuery extends Query { - SellingPlanEdgeQuery(StringBuilder _queryBuilder) { + public static class ShopPayPaymentRequestImageQuery extends Query { + ShopPayPaymentRequestImageQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A cursor for use in pagination. + * The alt text of the image. */ - public SellingPlanEdgeQuery cursor() { - startField("cursor"); + public ShopPayPaymentRequestImageQuery alt() { + startField("alt"); return this; } /** - * The item at the end of SellingPlanEdge. + * The source URL of the image. */ - public SellingPlanEdgeQuery node(SellingPlanQueryDefinition queryDef) { - startField("node"); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPayPaymentRequestImageQuery url() { + startField("url"); return this; } } /** - * An auto-generated type which holds one SellingPlan and a cursor during pagination. + * Represents an image for a Shop Pay payment request line item. */ - public static class SellingPlanEdge extends AbstractResponse { - public SellingPlanEdge() { + public static class ShopPayPaymentRequestImage extends AbstractResponse { + public ShopPayPaymentRequestImage() { } - public SellingPlanEdge(JsonObject fields) throws SchemaViolationError { + public ShopPayPaymentRequestImage(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "alt": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "node": { - responseData.put(key, new SellingPlan(jsonAsObject(field.getValue(), key))); + case "url": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -69518,695 +67608,802 @@ public SellingPlanEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "SellingPlanEdge"; + return "ShopPayPaymentRequestImage"; } /** - * A cursor for use in pagination. + * The alt text of the image. */ - public String getCursor() { - return (String) get("cursor"); + public String getAlt() { + return (String) get("alt"); } - public SellingPlanEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public ShopPayPaymentRequestImage setAlt(String arg) { + optimisticData.put(getKey("alt"), arg); return this; } /** - * The item at the end of SellingPlanEdge. + * The source URL of the image. */ - public SellingPlan getNode() { - return (SellingPlan) get("node"); + public String getUrl() { + return (String) get("url"); } - public SellingPlanEdge setNode(SellingPlan arg) { - optimisticData.put(getKey("node"), arg); + public ShopPayPaymentRequestImage setUrl(String arg) { + optimisticData.put(getKey("url"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cursor": return false; + case "alt": return false; - case "node": return true; + case "url": return false; default: return false; } } } - public interface SellingPlanFixedAmountPriceAdjustmentQueryDefinition { - void define(SellingPlanFixedAmountPriceAdjustmentQuery _queryBuilder); - } + public static class ShopPayPaymentRequestImageInput implements Serializable { + private String url; - /** - * A fixed amount that's deducted from the original variant price. For example, $10.00 off. - */ - public static class SellingPlanFixedAmountPriceAdjustmentQuery extends Query { - SellingPlanFixedAmountPriceAdjustmentQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + private Input alt = Input.undefined(); + + public ShopPayPaymentRequestImageInput(String url) { + this.url = url; } - /** - * The money value of the price adjustment. - */ - public SellingPlanFixedAmountPriceAdjustmentQuery adjustmentAmount(MoneyV2QueryDefinition queryDef) { - startField("adjustmentAmount"); + public String getUrl() { + return url; + } - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPayPaymentRequestImageInput setUrl(String url) { + this.url = url; + return this; + } + + public String getAlt() { + return alt.getValue(); + } + + public Input getAltInput() { + return alt; + } + public ShopPayPaymentRequestImageInput setAlt(String alt) { + this.alt = Input.optional(alt); return this; } - } - /** - * A fixed amount that's deducted from the original variant price. For example, $10.00 off. - */ - public static class SellingPlanFixedAmountPriceAdjustment extends AbstractResponse implements SellingPlanPriceAdjustmentValue { - public SellingPlanFixedAmountPriceAdjustment() { + public ShopPayPaymentRequestImageInput setAltInput(Input alt) { + if (alt == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.alt = alt; + return this; } - public SellingPlanFixedAmountPriceAdjustment(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "adjustmentAmount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - break; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("url:"); + Query.appendQuotedString(_queryBuilder, url.toString()); - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + if (this.alt.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("alt:"); + if (alt.getValue() != null) { + Query.appendQuotedString(_queryBuilder, alt.getValue().toString()); + } else { + _queryBuilder.append("null"); } } - } - public String getGraphQlTypeName() { - return "SellingPlanFixedAmountPriceAdjustment"; + _queryBuilder.append('}'); } + } - /** - * The money value of the price adjustment. - */ + public static class ShopPayPaymentRequestInput implements Serializable { + private MoneyInput total; - public MoneyV2 getAdjustmentAmount() { - return (MoneyV2) get("adjustmentAmount"); + private MoneyInput subtotal; + + private String locale; + + private CurrencyCode presentmentCurrency; + + private Input> discountCodes = Input.undefined(); + + private Input> lineItems = Input.undefined(); + + private Input> shippingLines = Input.undefined(); + + private Input> discounts = Input.undefined(); + + private Input totalShippingPrice = Input.undefined(); + + private Input totalTax = Input.undefined(); + + private Input> deliveryMethods = Input.undefined(); + + private Input selectedDeliveryMethodType = Input.undefined(); + + private Input paymentMethod = Input.undefined(); + + public ShopPayPaymentRequestInput(MoneyInput total, MoneyInput subtotal, String locale, CurrencyCode presentmentCurrency) { + this.total = total; + + this.subtotal = subtotal; + + this.locale = locale; + + this.presentmentCurrency = presentmentCurrency; } - public SellingPlanFixedAmountPriceAdjustment setAdjustmentAmount(MoneyV2 arg) { - optimisticData.put(getKey("adjustmentAmount"), arg); - return this; + public MoneyInput getTotal() { + return total; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "adjustmentAmount": return true; + public ShopPayPaymentRequestInput setTotal(MoneyInput total) { + this.total = total; + return this; + } - default: return false; - } + public MoneyInput getSubtotal() { + return subtotal; } - } - public interface SellingPlanFixedPriceAdjustmentQueryDefinition { - void define(SellingPlanFixedPriceAdjustmentQuery _queryBuilder); - } + public ShopPayPaymentRequestInput setSubtotal(MoneyInput subtotal) { + this.subtotal = subtotal; + return this; + } - /** - * A fixed price adjustment for a variant that's purchased with a selling plan. - */ - public static class SellingPlanFixedPriceAdjustmentQuery extends Query { - SellingPlanFixedPriceAdjustmentQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public String getLocale() { + return locale; } - /** - * A new price of the variant when it's purchased with the selling plan. - */ - public SellingPlanFixedPriceAdjustmentQuery price(MoneyV2QueryDefinition queryDef) { - startField("price"); + public ShopPayPaymentRequestInput setLocale(String locale) { + this.locale = locale; + return this; + } - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public CurrencyCode getPresentmentCurrency() { + return presentmentCurrency; + } + public ShopPayPaymentRequestInput setPresentmentCurrency(CurrencyCode presentmentCurrency) { + this.presentmentCurrency = presentmentCurrency; return this; } - } - /** - * A fixed price adjustment for a variant that's purchased with a selling plan. - */ - public static class SellingPlanFixedPriceAdjustment extends AbstractResponse implements SellingPlanPriceAdjustmentValue { - public SellingPlanFixedPriceAdjustment() { + public List getDiscountCodes() { + return discountCodes.getValue(); } - public SellingPlanFixedPriceAdjustment(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "price": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + public Input> getDiscountCodesInput() { + return discountCodes; + } - break; - } + public ShopPayPaymentRequestInput setDiscountCodes(List discountCodes) { + this.discountCodes = Input.optional(discountCodes); + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } + public ShopPayPaymentRequestInput setDiscountCodesInput(Input> discountCodes) { + if (discountCodes == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.discountCodes = discountCodes; + return this; } - public String getGraphQlTypeName() { - return "SellingPlanFixedPriceAdjustment"; + public List getLineItems() { + return lineItems.getValue(); } - /** - * A new price of the variant when it's purchased with the selling plan. - */ + public Input> getLineItemsInput() { + return lineItems; + } - public MoneyV2 getPrice() { - return (MoneyV2) get("price"); + public ShopPayPaymentRequestInput setLineItems(List lineItems) { + this.lineItems = Input.optional(lineItems); + return this; } - public SellingPlanFixedPriceAdjustment setPrice(MoneyV2 arg) { - optimisticData.put(getKey("price"), arg); + public ShopPayPaymentRequestInput setLineItemsInput(Input> lineItems) { + if (lineItems == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.lineItems = lineItems; return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "price": return true; + public List getShippingLines() { + return shippingLines.getValue(); + } - default: return false; + public Input> getShippingLinesInput() { + return shippingLines; + } + + public ShopPayPaymentRequestInput setShippingLines(List shippingLines) { + this.shippingLines = Input.optional(shippingLines); + return this; + } + + public ShopPayPaymentRequestInput setShippingLinesInput(Input> shippingLines) { + if (shippingLines == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.shippingLines = shippingLines; + return this; } - } - public interface SellingPlanGroupQueryDefinition { - void define(SellingPlanGroupQuery _queryBuilder); - } + public List getDiscounts() { + return discounts.getValue(); + } - /** - * Represents a selling method. For example, 'Subscribe and save' is a selling method where customers - * pay for goods or services per delivery. A selling plan group contains individual selling plans. - */ - public static class SellingPlanGroupQuery extends Query { - SellingPlanGroupQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public Input> getDiscountsInput() { + return discounts; } - /** - * A display friendly name for the app that created the selling plan group. - */ - public SellingPlanGroupQuery appName() { - startField("appName"); + public ShopPayPaymentRequestInput setDiscounts(List discounts) { + this.discounts = Input.optional(discounts); + return this; + } + public ShopPayPaymentRequestInput setDiscountsInput(Input> discounts) { + if (discounts == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.discounts = discounts; return this; } - /** - * The name of the selling plan group. - */ - public SellingPlanGroupQuery name() { - startField("name"); + public ShopPayPaymentRequestTotalShippingPriceInput getTotalShippingPrice() { + return totalShippingPrice.getValue(); + } + + public Input getTotalShippingPriceInput() { + return totalShippingPrice; + } + public ShopPayPaymentRequestInput setTotalShippingPrice(ShopPayPaymentRequestTotalShippingPriceInput totalShippingPrice) { + this.totalShippingPrice = Input.optional(totalShippingPrice); return this; } - /** - * Represents the selling plan options available in the drop-down list in the storefront. For example, - * 'Delivery every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the - * product. - */ - public SellingPlanGroupQuery options(SellingPlanGroupOptionQueryDefinition queryDef) { - startField("options"); + public ShopPayPaymentRequestInput setTotalShippingPriceInput(Input totalShippingPrice) { + if (totalShippingPrice == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.totalShippingPrice = totalShippingPrice; + return this; + } - _queryBuilder.append('{'); - queryDef.define(new SellingPlanGroupOptionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyInput getTotalTax() { + return totalTax.getValue(); + } + + public Input getTotalTaxInput() { + return totalTax; + } + public ShopPayPaymentRequestInput setTotalTax(MoneyInput totalTax) { + this.totalTax = Input.optional(totalTax); return this; } - public class SellingPlansArguments extends Arguments { - SellingPlansArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); + public ShopPayPaymentRequestInput setTotalTaxInput(Input totalTax) { + if (totalTax == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.totalTax = totalTax; + return this; + } - /** - * Returns up to the first `n` elements from the list. - */ - public SellingPlansArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public List getDeliveryMethods() { + return deliveryMethods.getValue(); + } - /** - * Returns the elements that come after the specified cursor. - */ - public SellingPlansArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public Input> getDeliveryMethodsInput() { + return deliveryMethods; + } - /** - * Returns up to the last `n` elements from the list. - */ - public SellingPlansArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + public ShopPayPaymentRequestInput setDeliveryMethods(List deliveryMethods) { + this.deliveryMethods = Input.optional(deliveryMethods); + return this; + } - /** - * Returns the elements that come before the specified cursor. - */ - public SellingPlansArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; + public ShopPayPaymentRequestInput setDeliveryMethodsInput(Input> deliveryMethods) { + if (deliveryMethods == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.deliveryMethods = deliveryMethods; + return this; + } - /** - * Reverse the order of the underlying list. - */ - public SellingPlansArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + public ShopPayPaymentRequestDeliveryMethodType getSelectedDeliveryMethodType() { + return selectedDeliveryMethodType.getValue(); } - public interface SellingPlansArgumentsDefinition { - void define(SellingPlansArguments args); + public Input getSelectedDeliveryMethodTypeInput() { + return selectedDeliveryMethodType; } - /** - * A list of selling plans in a selling plan group. A selling plan is a representation of how products - * and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of - * prepaid granola, delivered weekly'. - */ - public SellingPlanGroupQuery sellingPlans(SellingPlanConnectionQueryDefinition queryDef) { - return sellingPlans(args -> {}, queryDef); + public ShopPayPaymentRequestInput setSelectedDeliveryMethodType(ShopPayPaymentRequestDeliveryMethodType selectedDeliveryMethodType) { + this.selectedDeliveryMethodType = Input.optional(selectedDeliveryMethodType); + return this; } - /** - * A list of selling plans in a selling plan group. A selling plan is a representation of how products - * and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of - * prepaid granola, delivered weekly'. - */ - public SellingPlanGroupQuery sellingPlans(SellingPlansArgumentsDefinition argsDef, SellingPlanConnectionQueryDefinition queryDef) { - startField("sellingPlans"); + public ShopPayPaymentRequestInput setSelectedDeliveryMethodTypeInput(Input selectedDeliveryMethodType) { + if (selectedDeliveryMethodType == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.selectedDeliveryMethodType = selectedDeliveryMethodType; + return this; + } - SellingPlansArguments args = new SellingPlansArguments(_queryBuilder); - argsDef.define(args); - SellingPlansArguments.end(args); + public String getPaymentMethod() { + return paymentMethod.getValue(); + } - _queryBuilder.append('{'); - queryDef.define(new SellingPlanConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Input getPaymentMethodInput() { + return paymentMethod; + } + public ShopPayPaymentRequestInput setPaymentMethod(String paymentMethod) { + this.paymentMethod = Input.optional(paymentMethod); return this; } - } - /** - * Represents a selling method. For example, 'Subscribe and save' is a selling method where customers - * pay for goods or services per delivery. A selling plan group contains individual selling plans. - */ - public static class SellingPlanGroup extends AbstractResponse { - public SellingPlanGroup() { + public ShopPayPaymentRequestInput setPaymentMethodInput(Input paymentMethod) { + if (paymentMethod == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.paymentMethod = paymentMethod; + return this; } - public SellingPlanGroup(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "appName": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - responseData.put(key, optional1); + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("total:"); + total.appendTo(_queryBuilder); - break; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("subtotal:"); + subtotal.appendTo(_queryBuilder); - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("locale:"); + Query.appendQuotedString(_queryBuilder, locale.toString()); - break; + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("presentmentCurrency:"); + _queryBuilder.append(presentmentCurrency.toString()); + + if (this.discountCodes.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("discountCodes:"); + if (discountCodes.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (String item1 : discountCodes.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + Query.appendQuotedString(_queryBuilder, item1.toString()); + } } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } - case "options": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanGroupOption(jsonAsObject(element1, key))); + if (this.lineItems.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("lineItems:"); + if (lineItems.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ShopPayPaymentRequestLineItemInput item1 : lineItems.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } - responseData.put(key, list1); + if (this.shippingLines.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("shippingLines:"); + if (shippingLines.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ShopPayPaymentRequestShippingLineInput item1 : shippingLines.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } - break; + if (this.discounts.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("discounts:"); + if (discounts.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ShopPayPaymentRequestDiscountInput item1 : discounts.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } - case "sellingPlans": { - responseData.put(key, new SellingPlanConnection(jsonAsObject(field.getValue(), key))); + if (this.totalShippingPrice.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("totalShippingPrice:"); + if (totalShippingPrice.getValue() != null) { + totalShippingPrice.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } - break; - } + if (this.totalTax.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("totalTax:"); + if (totalTax.getValue() != null) { + totalTax.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); + if (this.deliveryMethods.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("deliveryMethods:"); + if (deliveryMethods.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ShopPayPaymentRequestDeliveryMethodInput item1 : deliveryMethods.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } + + if (this.selectedDeliveryMethodType.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("selectedDeliveryMethodType:"); + if (selectedDeliveryMethodType.getValue() != null) { + _queryBuilder.append(selectedDeliveryMethodType.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.paymentMethod.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("paymentMethod:"); + if (paymentMethod.getValue() != null) { + Query.appendQuotedString(_queryBuilder, paymentMethod.getValue().toString()); + } else { + _queryBuilder.append("null"); } } + + _queryBuilder.append('}'); } + } - public String getGraphQlTypeName() { - return "SellingPlanGroup"; + public interface ShopPayPaymentRequestLineItemQueryDefinition { + void define(ShopPayPaymentRequestLineItemQuery _queryBuilder); + } + + /** + * Represents a line item for a Shop Pay payment request. + */ + public static class ShopPayPaymentRequestLineItemQuery extends Query { + ShopPayPaymentRequestLineItemQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * A display friendly name for the app that created the selling plan group. + * The final item price for the line item. */ + public ShopPayPaymentRequestLineItemQuery finalItemPrice(MoneyV2QueryDefinition queryDef) { + startField("finalItemPrice"); - public String getAppName() { - return (String) get("appName"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public SellingPlanGroup setAppName(String arg) { - optimisticData.put(getKey("appName"), arg); return this; } /** - * The name of the selling plan group. + * The final line price for the line item. */ + public ShopPayPaymentRequestLineItemQuery finalLinePrice(MoneyV2QueryDefinition queryDef) { + startField("finalLinePrice"); - public String getName() { - return (String) get("name"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public SellingPlanGroup setName(String arg) { - optimisticData.put(getKey("name"), arg); return this; } /** - * Represents the selling plan options available in the drop-down list in the storefront. For example, - * 'Delivery every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the - * product. + * The image of the line item. */ + public ShopPayPaymentRequestLineItemQuery image(ShopPayPaymentRequestImageQueryDefinition queryDef) { + startField("image"); - public List getOptions() { - return (List) get("options"); - } + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestImageQuery(_queryBuilder)); + _queryBuilder.append('}'); - public SellingPlanGroup setOptions(List arg) { - optimisticData.put(getKey("options"), arg); return this; } /** - * A list of selling plans in a selling plan group. A selling plan is a representation of how products - * and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of - * prepaid granola, delivered weekly'. + * The item discounts for the line item. */ + public ShopPayPaymentRequestLineItemQuery itemDiscounts(ShopPayPaymentRequestDiscountQueryDefinition queryDef) { + startField("itemDiscounts"); - public SellingPlanConnection getSellingPlans() { - return (SellingPlanConnection) get("sellingPlans"); - } + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestDiscountQuery(_queryBuilder)); + _queryBuilder.append('}'); - public SellingPlanGroup setSellingPlans(SellingPlanConnection arg) { - optimisticData.put(getKey("sellingPlans"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "appName": return false; - - case "name": return false; - - case "options": return true; - - case "sellingPlans": return true; + /** + * The label of the line item. + */ + public ShopPayPaymentRequestLineItemQuery label() { + startField("label"); - default: return false; - } + return this; } - } - public interface SellingPlanGroupConnectionQueryDefinition { - void define(SellingPlanGroupConnectionQuery _queryBuilder); - } + /** + * The line discounts for the line item. + */ + public ShopPayPaymentRequestLineItemQuery lineDiscounts(ShopPayPaymentRequestDiscountQueryDefinition queryDef) { + startField("lineDiscounts"); - /** - * An auto-generated type for paginating through multiple SellingPlanGroups. - */ - public static class SellingPlanGroupConnectionQuery extends Query { - SellingPlanGroupConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestDiscountQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * A list of edges. + * The original item price for the line item. */ - public SellingPlanGroupConnectionQuery edges(SellingPlanGroupEdgeQueryDefinition queryDef) { - startField("edges"); + public ShopPayPaymentRequestLineItemQuery originalItemPrice(MoneyV2QueryDefinition queryDef) { + startField("originalItemPrice"); _queryBuilder.append('{'); - queryDef.define(new SellingPlanGroupEdgeQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in SellingPlanGroupEdge. + * The original line price for the line item. */ - public SellingPlanGroupConnectionQuery nodes(SellingPlanGroupQueryDefinition queryDef) { - startField("nodes"); + public ShopPayPaymentRequestLineItemQuery originalLinePrice(MoneyV2QueryDefinition queryDef) { + startField("originalLinePrice"); _queryBuilder.append('{'); - queryDef.define(new SellingPlanGroupQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Information to aid in pagination. + * The quantity of the line item. */ - public SellingPlanGroupConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + public ShopPayPaymentRequestLineItemQuery quantity() { + startField("quantity"); - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * Whether the line item requires shipping. + */ + public ShopPayPaymentRequestLineItemQuery requiresShipping() { + startField("requiresShipping"); + + return this; + } + + /** + * The SKU of the line item. + */ + public ShopPayPaymentRequestLineItemQuery sku() { + startField("sku"); return this; } } /** - * An auto-generated type for paginating through multiple SellingPlanGroups. + * Represents a line item for a Shop Pay payment request. */ - public static class SellingPlanGroupConnection extends AbstractResponse { - public SellingPlanGroupConnection() { + public static class ShopPayPaymentRequestLineItem extends AbstractResponse { + public ShopPayPaymentRequestLineItem() { } - public SellingPlanGroupConnection(JsonObject fields) throws SchemaViolationError { + public ShopPayPaymentRequestLineItem(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanGroupEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "finalItemPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanGroup(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "finalLinePrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "image": { + ShopPayPaymentRequestImage optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPayPaymentRequestImage(jsonAsObject(field.getValue(), key)); + } - break; - } + responseData.put(key, optional1); - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "SellingPlanGroupConnection"; - } - - /** - * A list of edges. - */ - - public List getEdges() { - return (List) get("edges"); - } - public SellingPlanGroupConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; - } + case "itemDiscounts": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ShopPayPaymentRequestDiscount(jsonAsObject(element1, key))); + } - /** - * A list of the nodes contained in SellingPlanGroupEdge. - */ + optional1 = list1; + } - public List getNodes() { - return (List) get("nodes"); - } + responseData.put(key, optional1); - public SellingPlanGroupConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; - } + break; + } - /** - * Information to aid in pagination. - */ + case "label": { + responseData.put(key, jsonAsString(field.getValue(), key)); - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } + break; + } - public SellingPlanGroupConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); - return this; - } + case "lineDiscounts": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ShopPayPaymentRequestDiscount(jsonAsObject(element1, key))); + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; + optional1 = list1; + } - case "nodes": return true; + responseData.put(key, optional1); - case "pageInfo": return true; + break; + } - default: return false; - } - } - } + case "originalItemPrice": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } - public interface SellingPlanGroupEdgeQueryDefinition { - void define(SellingPlanGroupEdgeQuery _queryBuilder); - } + responseData.put(key, optional1); - /** - * An auto-generated type which holds one SellingPlanGroup and a cursor during pagination. - */ - public static class SellingPlanGroupEdgeQuery extends Query { - SellingPlanGroupEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + break; + } - /** - * A cursor for use in pagination. - */ - public SellingPlanGroupEdgeQuery cursor() { - startField("cursor"); + case "originalLinePrice": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } - return this; - } + responseData.put(key, optional1); - /** - * The item at the end of SellingPlanGroupEdge. - */ - public SellingPlanGroupEdgeQuery node(SellingPlanGroupQueryDefinition queryDef) { - startField("node"); + break; + } - _queryBuilder.append('{'); - queryDef.define(new SellingPlanGroupQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "quantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); - return this; - } - } + break; + } - /** - * An auto-generated type which holds one SellingPlanGroup and a cursor during pagination. - */ - public static class SellingPlanGroupEdge extends AbstractResponse { - public SellingPlanGroupEdge() { - } + case "requiresShipping": { + Boolean optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsBoolean(field.getValue(), key); + } - public SellingPlanGroupEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + responseData.put(key, optional1); break; } - case "node": { - responseData.put(key, new SellingPlanGroup(jsonAsObject(field.getValue(), key))); + case "sku": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } @@ -70223,436 +68420,638 @@ public SellingPlanGroupEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "SellingPlanGroupEdge"; + return "ShopPayPaymentRequestLineItem"; } /** - * A cursor for use in pagination. + * The final item price for the line item. */ - public String getCursor() { - return (String) get("cursor"); + public MoneyV2 getFinalItemPrice() { + return (MoneyV2) get("finalItemPrice"); } - public SellingPlanGroupEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public ShopPayPaymentRequestLineItem setFinalItemPrice(MoneyV2 arg) { + optimisticData.put(getKey("finalItemPrice"), arg); return this; } /** - * The item at the end of SellingPlanGroupEdge. + * The final line price for the line item. */ - public SellingPlanGroup getNode() { - return (SellingPlanGroup) get("node"); + public MoneyV2 getFinalLinePrice() { + return (MoneyV2) get("finalLinePrice"); } - public SellingPlanGroupEdge setNode(SellingPlanGroup arg) { - optimisticData.put(getKey("node"), arg); + public ShopPayPaymentRequestLineItem setFinalLinePrice(MoneyV2 arg) { + optimisticData.put(getKey("finalLinePrice"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; + /** + * The image of the line item. + */ - case "node": return true; + public ShopPayPaymentRequestImage getImage() { + return (ShopPayPaymentRequestImage) get("image"); + } - default: return false; - } + public ShopPayPaymentRequestLineItem setImage(ShopPayPaymentRequestImage arg) { + optimisticData.put(getKey("image"), arg); + return this; } - } - public interface SellingPlanGroupOptionQueryDefinition { - void define(SellingPlanGroupOptionQuery _queryBuilder); - } + /** + * The item discounts for the line item. + */ - /** - * Represents an option on a selling plan group that's available in the drop-down list in the - * storefront. - * Individual selling plans contribute their options to the associated selling plan group. For example, - * a selling plan group might have an option called `option1: Delivery every`. One selling plan in that - * group could contribute `option1: 2 weeks` with the pricing for that option, and another selling plan - * could contribute `option1: 4 weeks`, with different pricing. - */ - public static class SellingPlanGroupOptionQuery extends Query { - SellingPlanGroupOptionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public List getItemDiscounts() { + return (List) get("itemDiscounts"); + } + + public ShopPayPaymentRequestLineItem setItemDiscounts(List arg) { + optimisticData.put(getKey("itemDiscounts"), arg); + return this; } /** - * The name of the option. For example, 'Delivery every'. + * The label of the line item. */ - public SellingPlanGroupOptionQuery name() { - startField("name"); + public String getLabel() { + return (String) get("label"); + } + + public ShopPayPaymentRequestLineItem setLabel(String arg) { + optimisticData.put(getKey("label"), arg); return this; } /** - * The values for the options specified by the selling plans in the selling plan group. For example, '1 - * week', '2 weeks', '3 weeks'. + * The line discounts for the line item. */ - public SellingPlanGroupOptionQuery values() { - startField("values"); + public List getLineDiscounts() { + return (List) get("lineDiscounts"); + } + + public ShopPayPaymentRequestLineItem setLineDiscounts(List arg) { + optimisticData.put(getKey("lineDiscounts"), arg); return this; } - } - /** - * Represents an option on a selling plan group that's available in the drop-down list in the - * storefront. - * Individual selling plans contribute their options to the associated selling plan group. For example, - * a selling plan group might have an option called `option1: Delivery every`. One selling plan in that - * group could contribute `option1: 2 weeks` with the pricing for that option, and another selling plan - * could contribute `option1: 4 weeks`, with different pricing. - */ - public static class SellingPlanGroupOption extends AbstractResponse { - public SellingPlanGroupOption() { + /** + * The original item price for the line item. + */ + + public MoneyV2 getOriginalItemPrice() { + return (MoneyV2) get("originalItemPrice"); } - public SellingPlanGroupOption(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + public ShopPayPaymentRequestLineItem setOriginalItemPrice(MoneyV2 arg) { + optimisticData.put(getKey("originalItemPrice"), arg); + return this; + } - break; - } + /** + * The original line price for the line item. + */ - case "values": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } + public MoneyV2 getOriginalLinePrice() { + return (MoneyV2) get("originalLinePrice"); + } - responseData.put(key, list1); + public ShopPayPaymentRequestLineItem setOriginalLinePrice(MoneyV2 arg) { + optimisticData.put(getKey("originalLinePrice"), arg); + return this; + } - break; - } + /** + * The quantity of the line item. + */ - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public Integer getQuantity() { + return (Integer) get("quantity"); } - public String getGraphQlTypeName() { - return "SellingPlanGroupOption"; + public ShopPayPaymentRequestLineItem setQuantity(Integer arg) { + optimisticData.put(getKey("quantity"), arg); + return this; } /** - * The name of the option. For example, 'Delivery every'. + * Whether the line item requires shipping. */ - public String getName() { - return (String) get("name"); + public Boolean getRequiresShipping() { + return (Boolean) get("requiresShipping"); } - public SellingPlanGroupOption setName(String arg) { - optimisticData.put(getKey("name"), arg); + public ShopPayPaymentRequestLineItem setRequiresShipping(Boolean arg) { + optimisticData.put(getKey("requiresShipping"), arg); return this; } /** - * The values for the options specified by the selling plans in the selling plan group. For example, '1 - * week', '2 weeks', '3 weeks'. + * The SKU of the line item. */ - public List getValues() { - return (List) get("values"); + public String getSku() { + return (String) get("sku"); } - public SellingPlanGroupOption setValues(List arg) { - optimisticData.put(getKey("values"), arg); + public ShopPayPaymentRequestLineItem setSku(String arg) { + optimisticData.put(getKey("sku"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "name": return false; + case "finalItemPrice": return true; - case "values": return false; + case "finalLinePrice": return true; + + case "image": return true; + + case "itemDiscounts": return true; + + case "label": return false; + + case "lineDiscounts": return true; + + case "originalItemPrice": return true; + + case "originalLinePrice": return true; + + case "quantity": return false; + + case "requiresShipping": return false; + + case "sku": return false; default: return false; } } } - public interface SellingPlanOptionQueryDefinition { - void define(SellingPlanOptionQuery _queryBuilder); - } + public static class ShopPayPaymentRequestLineItemInput implements Serializable { + private int quantity; - /** - * An option provided by a Selling Plan. - */ - public static class SellingPlanOptionQuery extends Query { - SellingPlanOptionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + private Input label = Input.undefined(); + + private Input sku = Input.undefined(); + + private Input requiresShipping = Input.undefined(); + + private Input image = Input.undefined(); + + private Input originalLinePrice = Input.undefined(); + + private Input finalLinePrice = Input.undefined(); + + private Input> lineDiscounts = Input.undefined(); + + private Input originalItemPrice = Input.undefined(); + + private Input finalItemPrice = Input.undefined(); + + private Input> itemDiscounts = Input.undefined(); + + public ShopPayPaymentRequestLineItemInput(int quantity) { + this.quantity = quantity; } - /** - * The name of the option (ie "Delivery every"). - */ - public SellingPlanOptionQuery name() { - startField("name"); + public int getQuantity() { + return quantity; + } + public ShopPayPaymentRequestLineItemInput setQuantity(int quantity) { + this.quantity = quantity; return this; } - /** - * The value of the option (ie "Month"). - */ - public SellingPlanOptionQuery value() { - startField("value"); + public String getLabel() { + return label.getValue(); + } + + public Input getLabelInput() { + return label; + } + public ShopPayPaymentRequestLineItemInput setLabel(String label) { + this.label = Input.optional(label); return this; } - } - /** - * An option provided by a Selling Plan. - */ - public static class SellingPlanOption extends AbstractResponse { - public SellingPlanOption() { + public ShopPayPaymentRequestLineItemInput setLabelInput(Input label) { + if (label == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.label = label; + return this; } - public SellingPlanOption(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "name": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + public String getSku() { + return sku.getValue(); + } - responseData.put(key, optional1); + public Input getSkuInput() { + return sku; + } - break; - } + public ShopPayPaymentRequestLineItemInput setSku(String sku) { + this.sku = Input.optional(sku); + return this; + } - case "value": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + public ShopPayPaymentRequestLineItemInput setSkuInput(Input sku) { + if (sku == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.sku = sku; + return this; + } - responseData.put(key, optional1); + public Boolean getRequiresShipping() { + return requiresShipping.getValue(); + } - break; - } + public Input getRequiresShippingInput() { + return requiresShipping; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } + public ShopPayPaymentRequestLineItemInput setRequiresShipping(Boolean requiresShipping) { + this.requiresShipping = Input.optional(requiresShipping); + return this; + } + + public ShopPayPaymentRequestLineItemInput setRequiresShippingInput(Input requiresShipping) { + if (requiresShipping == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.requiresShipping = requiresShipping; + return this; } - public String getGraphQlTypeName() { - return "SellingPlanOption"; + public ShopPayPaymentRequestImageInput getImage() { + return image.getValue(); } - /** - * The name of the option (ie "Delivery every"). - */ + public Input getImageInput() { + return image; + } - public String getName() { - return (String) get("name"); + public ShopPayPaymentRequestLineItemInput setImage(ShopPayPaymentRequestImageInput image) { + this.image = Input.optional(image); + return this; } - public SellingPlanOption setName(String arg) { - optimisticData.put(getKey("name"), arg); + public ShopPayPaymentRequestLineItemInput setImageInput(Input image) { + if (image == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.image = image; return this; } - /** - * The value of the option (ie "Month"). - */ + public MoneyInput getOriginalLinePrice() { + return originalLinePrice.getValue(); + } - public String getValue() { - return (String) get("value"); + public Input getOriginalLinePriceInput() { + return originalLinePrice; } - public SellingPlanOption setValue(String arg) { - optimisticData.put(getKey("value"), arg); + public ShopPayPaymentRequestLineItemInput setOriginalLinePrice(MoneyInput originalLinePrice) { + this.originalLinePrice = Input.optional(originalLinePrice); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "name": return false; + public ShopPayPaymentRequestLineItemInput setOriginalLinePriceInput(Input originalLinePrice) { + if (originalLinePrice == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.originalLinePrice = originalLinePrice; + return this; + } - case "value": return false; + public MoneyInput getFinalLinePrice() { + return finalLinePrice.getValue(); + } - default: return false; + public Input getFinalLinePriceInput() { + return finalLinePrice; + } + + public ShopPayPaymentRequestLineItemInput setFinalLinePrice(MoneyInput finalLinePrice) { + this.finalLinePrice = Input.optional(finalLinePrice); + return this; + } + + public ShopPayPaymentRequestLineItemInput setFinalLinePriceInput(Input finalLinePrice) { + if (finalLinePrice == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.finalLinePrice = finalLinePrice; + return this; } - } - public interface SellingPlanPercentagePriceAdjustmentQueryDefinition { - void define(SellingPlanPercentagePriceAdjustmentQuery _queryBuilder); - } + public List getLineDiscounts() { + return lineDiscounts.getValue(); + } - /** - * A percentage amount that's deducted from the original variant price. For example, 10% off. - */ - public static class SellingPlanPercentagePriceAdjustmentQuery extends Query { - SellingPlanPercentagePriceAdjustmentQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public Input> getLineDiscountsInput() { + return lineDiscounts; } - /** - * The percentage value of the price adjustment. - */ - public SellingPlanPercentagePriceAdjustmentQuery adjustmentPercentage() { - startField("adjustmentPercentage"); + public ShopPayPaymentRequestLineItemInput setLineDiscounts(List lineDiscounts) { + this.lineDiscounts = Input.optional(lineDiscounts); + return this; + } + public ShopPayPaymentRequestLineItemInput setLineDiscountsInput(Input> lineDiscounts) { + if (lineDiscounts == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.lineDiscounts = lineDiscounts; return this; } - } - /** - * A percentage amount that's deducted from the original variant price. For example, 10% off. - */ - public static class SellingPlanPercentagePriceAdjustment extends AbstractResponse implements SellingPlanPriceAdjustmentValue { - public SellingPlanPercentagePriceAdjustment() { + public MoneyInput getOriginalItemPrice() { + return originalItemPrice.getValue(); } - public SellingPlanPercentagePriceAdjustment(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "adjustmentPercentage": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + public Input getOriginalItemPriceInput() { + return originalItemPrice; + } - break; - } + public ShopPayPaymentRequestLineItemInput setOriginalItemPrice(MoneyInput originalItemPrice) { + this.originalItemPrice = Input.optional(originalItemPrice); + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } + public ShopPayPaymentRequestLineItemInput setOriginalItemPriceInput(Input originalItemPrice) { + if (originalItemPrice == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.originalItemPrice = originalItemPrice; + return this; } - public String getGraphQlTypeName() { - return "SellingPlanPercentagePriceAdjustment"; + public MoneyInput getFinalItemPrice() { + return finalItemPrice.getValue(); } - /** - * The percentage value of the price adjustment. - */ + public Input getFinalItemPriceInput() { + return finalItemPrice; + } - public Integer getAdjustmentPercentage() { - return (Integer) get("adjustmentPercentage"); + public ShopPayPaymentRequestLineItemInput setFinalItemPrice(MoneyInput finalItemPrice) { + this.finalItemPrice = Input.optional(finalItemPrice); + return this; } - public SellingPlanPercentagePriceAdjustment setAdjustmentPercentage(Integer arg) { - optimisticData.put(getKey("adjustmentPercentage"), arg); + public ShopPayPaymentRequestLineItemInput setFinalItemPriceInput(Input finalItemPrice) { + if (finalItemPrice == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.finalItemPrice = finalItemPrice; return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "adjustmentPercentage": return false; + public List getItemDiscounts() { + return itemDiscounts.getValue(); + } - default: return false; + public Input> getItemDiscountsInput() { + return itemDiscounts; + } + + public ShopPayPaymentRequestLineItemInput setItemDiscounts(List itemDiscounts) { + this.itemDiscounts = Input.optional(itemDiscounts); + return this; + } + + public ShopPayPaymentRequestLineItemInput setItemDiscountsInput(Input> itemDiscounts) { + if (itemDiscounts == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.itemDiscounts = itemDiscounts; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("quantity:"); + _queryBuilder.append(quantity); + + if (this.label.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("label:"); + if (label.getValue() != null) { + Query.appendQuotedString(_queryBuilder, label.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.sku.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("sku:"); + if (sku.getValue() != null) { + Query.appendQuotedString(_queryBuilder, sku.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.requiresShipping.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("requiresShipping:"); + if (requiresShipping.getValue() != null) { + _queryBuilder.append(requiresShipping.getValue()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.image.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("image:"); + if (image.getValue() != null) { + image.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + if (this.originalLinePrice.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("originalLinePrice:"); + if (originalLinePrice.getValue() != null) { + originalLinePrice.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + if (this.finalLinePrice.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("finalLinePrice:"); + if (finalLinePrice.getValue() != null) { + finalLinePrice.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + if (this.lineDiscounts.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("lineDiscounts:"); + if (lineDiscounts.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ShopPayPaymentRequestDiscountInput item1 : lineDiscounts.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } + + if (this.originalItemPrice.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("originalItemPrice:"); + if (originalItemPrice.getValue() != null) { + originalItemPrice.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + if (this.finalItemPrice.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("finalItemPrice:"); + if (finalItemPrice.getValue() != null) { + finalItemPrice.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + if (this.itemDiscounts.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("itemDiscounts:"); + if (itemDiscounts.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ShopPayPaymentRequestDiscountInput item1 : itemDiscounts.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } } + + _queryBuilder.append('}'); } } - public interface SellingPlanPriceAdjustmentQueryDefinition { - void define(SellingPlanPriceAdjustmentQuery _queryBuilder); + public interface ShopPayPaymentRequestReceiptQueryDefinition { + void define(ShopPayPaymentRequestReceiptQuery _queryBuilder); } /** - * Represents by how much the price of a variant associated with a selling plan is adjusted. Each - * variant can have up to two price adjustments. If a variant has multiple price adjustments, then the - * first price adjustment applies when the variant is initially purchased. The second price adjustment - * applies after a certain number of orders (specified by the `orderCount` field) are made. If a - * selling plan doesn't have any price adjustments, then the unadjusted price of the variant is the - * effective price. + * Represents a receipt for a Shop Pay payment request. */ - public static class SellingPlanPriceAdjustmentQuery extends Query { - SellingPlanPriceAdjustmentQuery(StringBuilder _queryBuilder) { + public static class ShopPayPaymentRequestReceiptQuery extends Query { + ShopPayPaymentRequestReceiptQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The type of price adjustment. An adjustment value can have one of three types: percentage, amount - * off, or a new price. + * The payment request object. */ - public SellingPlanPriceAdjustmentQuery adjustmentValue(SellingPlanPriceAdjustmentValueQueryDefinition queryDef) { - startField("adjustmentValue"); + public ShopPayPaymentRequestReceiptQuery paymentRequest(ShopPayPaymentRequestQueryDefinition queryDef) { + startField("paymentRequest"); _queryBuilder.append('{'); - queryDef.define(new SellingPlanPriceAdjustmentValueQuery(_queryBuilder)); + queryDef.define(new ShopPayPaymentRequestQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The number of orders that the price adjustment applies to. If the price adjustment always applies, - * then this field is `null`. + * The processing status. + */ + public ShopPayPaymentRequestReceiptQuery processingStatusType() { + startField("processingStatusType"); + + return this; + } + + /** + * The token of the receipt. */ - public SellingPlanPriceAdjustmentQuery orderCount() { - startField("orderCount"); + public ShopPayPaymentRequestReceiptQuery token() { + startField("token"); return this; } } /** - * Represents by how much the price of a variant associated with a selling plan is adjusted. Each - * variant can have up to two price adjustments. If a variant has multiple price adjustments, then the - * first price adjustment applies when the variant is initially purchased. The second price adjustment - * applies after a certain number of orders (specified by the `orderCount` field) are made. If a - * selling plan doesn't have any price adjustments, then the unadjusted price of the variant is the - * effective price. + * Represents a receipt for a Shop Pay payment request. */ - public static class SellingPlanPriceAdjustment extends AbstractResponse { - public SellingPlanPriceAdjustment() { + public static class ShopPayPaymentRequestReceipt extends AbstractResponse { + public ShopPayPaymentRequestReceipt() { } - public SellingPlanPriceAdjustment(JsonObject fields) throws SchemaViolationError { + public ShopPayPaymentRequestReceipt(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "adjustmentValue": { - responseData.put(key, UnknownSellingPlanPriceAdjustmentValue.create(jsonAsObject(field.getValue(), key))); + case "paymentRequest": { + responseData.put(key, new ShopPayPaymentRequest(jsonAsObject(field.getValue(), key))); break; } - case "orderCount": { - Integer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); - } + case "processingStatusType": { + responseData.put(key, jsonAsString(field.getValue(), key)); - responseData.put(key, optional1); + break; + } + + case "token": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -70669,236 +69068,145 @@ public SellingPlanPriceAdjustment(JsonObject fields) throws SchemaViolationError } public String getGraphQlTypeName() { - return "SellingPlanPriceAdjustment"; + return "ShopPayPaymentRequestReceipt"; } /** - * The type of price adjustment. An adjustment value can have one of three types: percentage, amount - * off, or a new price. + * The payment request object. */ - public SellingPlanPriceAdjustmentValue getAdjustmentValue() { - return (SellingPlanPriceAdjustmentValue) get("adjustmentValue"); + public ShopPayPaymentRequest getPaymentRequest() { + return (ShopPayPaymentRequest) get("paymentRequest"); } - public SellingPlanPriceAdjustment setAdjustmentValue(SellingPlanPriceAdjustmentValue arg) { - optimisticData.put(getKey("adjustmentValue"), arg); + public ShopPayPaymentRequestReceipt setPaymentRequest(ShopPayPaymentRequest arg) { + optimisticData.put(getKey("paymentRequest"), arg); return this; } /** - * The number of orders that the price adjustment applies to. If the price adjustment always applies, - * then this field is `null`. + * The processing status. */ - public Integer getOrderCount() { - return (Integer) get("orderCount"); + public String getProcessingStatusType() { + return (String) get("processingStatusType"); } - public SellingPlanPriceAdjustment setOrderCount(Integer arg) { - optimisticData.put(getKey("orderCount"), arg); + public ShopPayPaymentRequestReceipt setProcessingStatusType(String arg) { + optimisticData.put(getKey("processingStatusType"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "adjustmentValue": return false; - - case "orderCount": return false; - - default: return false; - } - } - } - - public interface SellingPlanPriceAdjustmentValueQueryDefinition { - void define(SellingPlanPriceAdjustmentValueQuery _queryBuilder); - } - - /** - * Represents by how much the price of a variant associated with a selling plan is adjusted. Each - * variant can have up to two price adjustments. - */ - public static class SellingPlanPriceAdjustmentValueQuery extends Query { - SellingPlanPriceAdjustmentValueQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - - startField("__typename"); - } - - public SellingPlanPriceAdjustmentValueQuery onSellingPlanFixedAmountPriceAdjustment(SellingPlanFixedAmountPriceAdjustmentQueryDefinition queryDef) { - startInlineFragment("SellingPlanFixedAmountPriceAdjustment"); - queryDef.define(new SellingPlanFixedAmountPriceAdjustmentQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * The token of the receipt. + */ - public SellingPlanPriceAdjustmentValueQuery onSellingPlanFixedPriceAdjustment(SellingPlanFixedPriceAdjustmentQueryDefinition queryDef) { - startInlineFragment("SellingPlanFixedPriceAdjustment"); - queryDef.define(new SellingPlanFixedPriceAdjustmentQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public String getToken() { + return (String) get("token"); } - public SellingPlanPriceAdjustmentValueQuery onSellingPlanPercentagePriceAdjustment(SellingPlanPercentagePriceAdjustmentQueryDefinition queryDef) { - startInlineFragment("SellingPlanPercentagePriceAdjustment"); - queryDef.define(new SellingPlanPercentagePriceAdjustmentQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPayPaymentRequestReceipt setToken(String arg) { + optimisticData.put(getKey("token"), arg); return this; } - } - - public interface SellingPlanPriceAdjustmentValue { - String getGraphQlTypeName(); - } - - /** - * Represents by how much the price of a variant associated with a selling plan is adjusted. Each - * variant can have up to two price adjustments. - */ - public static class UnknownSellingPlanPriceAdjustmentValue extends AbstractResponse implements SellingPlanPriceAdjustmentValue { - public UnknownSellingPlanPriceAdjustmentValue() { - } - - public UnknownSellingPlanPriceAdjustmentValue(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public static SellingPlanPriceAdjustmentValue create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "SellingPlanFixedAmountPriceAdjustment": { - return new SellingPlanFixedAmountPriceAdjustment(fields); - } - - case "SellingPlanFixedPriceAdjustment": { - return new SellingPlanFixedPriceAdjustment(fields); - } - case "SellingPlanPercentagePriceAdjustment": { - return new SellingPlanPercentagePriceAdjustment(fields); - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "paymentRequest": return true; - default: { - return new UnknownSellingPlanPriceAdjustmentValue(fields); - } - } - } + case "processingStatusType": return false; - public String getGraphQlTypeName() { - return (String) get("__typename"); - } + case "token": return false; - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { default: return false; } } } - public interface ShippingRateQueryDefinition { - void define(ShippingRateQuery _queryBuilder); + public interface ShopPayPaymentRequestSessionQueryDefinition { + void define(ShopPayPaymentRequestSessionQuery _queryBuilder); } /** - * A shipping rate to be applied to a checkout. + * Represents a Shop Pay payment request session. */ - public static class ShippingRateQuery extends Query { - ShippingRateQuery(StringBuilder _queryBuilder) { + public static class ShopPayPaymentRequestSessionQuery extends Query { + ShopPayPaymentRequestSessionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * Human-readable unique identifier for this shipping rate. + * The checkout URL of the Shop Pay payment request session. */ - public ShippingRateQuery handle() { - startField("handle"); + public ShopPayPaymentRequestSessionQuery checkoutUrl() { + startField("checkoutUrl"); return this; } /** - * Price of this shipping rate. + * The payment request associated with the Shop Pay payment request session. */ - public ShippingRateQuery price(MoneyV2QueryDefinition queryDef) { - startField("price"); + public ShopPayPaymentRequestSessionQuery paymentRequest(ShopPayPaymentRequestQueryDefinition queryDef) { + startField("paymentRequest"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new ShopPayPaymentRequestQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Price of this shipping rate. - * - * @deprecated Use `price` instead. + * The source identifier of the Shop Pay payment request session. */ - @Deprecated - public ShippingRateQuery priceV2(MoneyV2QueryDefinition queryDef) { - startField("priceV2"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPayPaymentRequestSessionQuery sourceIdentifier() { + startField("sourceIdentifier"); return this; } /** - * Title of this shipping rate. + * The token of the Shop Pay payment request session. */ - public ShippingRateQuery title() { - startField("title"); + public ShopPayPaymentRequestSessionQuery token() { + startField("token"); return this; } } /** - * A shipping rate to be applied to a checkout. + * Represents a Shop Pay payment request session. */ - public static class ShippingRate extends AbstractResponse { - public ShippingRate() { + public static class ShopPayPaymentRequestSession extends AbstractResponse { + public ShopPayPaymentRequestSession() { } - public ShippingRate(JsonObject fields) throws SchemaViolationError { + public ShopPayPaymentRequestSession(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "handle": { + case "checkoutUrl": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "price": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "paymentRequest": { + responseData.put(key, new ShopPayPaymentRequest(jsonAsObject(field.getValue(), key))); break; } - case "priceV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "sourceIdentifier": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "title": { + case "token": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -70916,302 +69224,234 @@ public ShippingRate(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "ShippingRate"; + return "ShopPayPaymentRequestSession"; } /** - * Human-readable unique identifier for this shipping rate. + * The checkout URL of the Shop Pay payment request session. */ - public String getHandle() { - return (String) get("handle"); + public String getCheckoutUrl() { + return (String) get("checkoutUrl"); } - public ShippingRate setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); + public ShopPayPaymentRequestSession setCheckoutUrl(String arg) { + optimisticData.put(getKey("checkoutUrl"), arg); return this; } /** - * Price of this shipping rate. + * The payment request associated with the Shop Pay payment request session. */ - public MoneyV2 getPrice() { - return (MoneyV2) get("price"); + public ShopPayPaymentRequest getPaymentRequest() { + return (ShopPayPaymentRequest) get("paymentRequest"); } - public ShippingRate setPrice(MoneyV2 arg) { - optimisticData.put(getKey("price"), arg); + public ShopPayPaymentRequestSession setPaymentRequest(ShopPayPaymentRequest arg) { + optimisticData.put(getKey("paymentRequest"), arg); return this; } /** - * Price of this shipping rate. - * - * @deprecated Use `price` instead. + * The source identifier of the Shop Pay payment request session. */ - public MoneyV2 getPriceV2() { - return (MoneyV2) get("priceV2"); + public String getSourceIdentifier() { + return (String) get("sourceIdentifier"); } - public ShippingRate setPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("priceV2"), arg); + public ShopPayPaymentRequestSession setSourceIdentifier(String arg) { + optimisticData.put(getKey("sourceIdentifier"), arg); return this; } /** - * Title of this shipping rate. + * The token of the Shop Pay payment request session. */ - public String getTitle() { - return (String) get("title"); + public String getToken() { + return (String) get("token"); } - public ShippingRate setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public ShopPayPaymentRequestSession setToken(String arg) { + optimisticData.put(getKey("token"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "handle": return false; + case "checkoutUrl": return false; - case "price": return true; + case "paymentRequest": return true; - case "priceV2": return true; + case "sourceIdentifier": return false; - case "title": return false; + case "token": return false; default: return false; } } } - public interface ShopQueryDefinition { - void define(ShopQuery _queryBuilder); + public interface ShopPayPaymentRequestSessionCreatePayloadQueryDefinition { + void define(ShopPayPaymentRequestSessionCreatePayloadQuery _queryBuilder); } /** - * Shop represents a collection of the general settings and information about the shop. + * Return type for `shopPayPaymentRequestSessionCreate` mutation. */ - public static class ShopQuery extends Query { - ShopQuery(StringBuilder _queryBuilder) { + public static class ShopPayPaymentRequestSessionCreatePayloadQuery extends Query { + ShopPayPaymentRequestSessionCreatePayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("id"); } /** - * The shop's branding configuration. + * The new Shop Pay payment request session object. */ - public ShopQuery brand(BrandQueryDefinition queryDef) { - startField("brand"); + public ShopPayPaymentRequestSessionCreatePayloadQuery shopPayPaymentRequestSession(ShopPayPaymentRequestSessionQueryDefinition queryDef) { + startField("shopPayPaymentRequestSession"); _queryBuilder.append('{'); - queryDef.define(new BrandQuery(_queryBuilder)); + queryDef.define(new ShopPayPaymentRequestSessionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A description of the shop. + * Error codes for failed Shop Pay payment request session mutations. */ - public ShopQuery description() { - startField("description"); - - return this; - } - - public class MetafieldArguments extends Arguments { - MetafieldArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } + public ShopPayPaymentRequestSessionCreatePayloadQuery userErrors(UserErrorsShopPayPaymentRequestSessionUserErrorsQueryDefinition queryDef) { + startField("userErrors"); - /** - * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. - */ - public MetafieldArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorsShopPayPaymentRequestSessionUserErrorsQuery(_queryBuilder)); + _queryBuilder.append('}'); - public interface MetafieldArgumentsDefinition { - void define(MetafieldArguments args); + return this; } + } - /** - * Returns a metafield found by namespace and key. - */ - public ShopQuery metafield(String key, MetafieldQueryDefinition queryDef) { - return metafield(key, args -> {}, queryDef); + /** + * Return type for `shopPayPaymentRequestSessionCreate` mutation. + */ + public static class ShopPayPaymentRequestSessionCreatePayload extends AbstractResponse { + public ShopPayPaymentRequestSessionCreatePayload() { } - /** - * Returns a metafield found by namespace and key. - */ - public ShopQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { - startField("metafield"); - - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + public ShopPayPaymentRequestSessionCreatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "shopPayPaymentRequestSession": { + ShopPayPaymentRequestSession optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPayPaymentRequestSession(jsonAsObject(field.getValue(), key)); + } - argsDef.define(new MetafieldArguments(_queryBuilder)); + responseData.put(key, optional1); - _queryBuilder.append(')'); + break; + } - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserErrorsShopPayPaymentRequestSessionUserErrors(jsonAsObject(element1, key))); + } - return this; - } + responseData.put(key, list1); - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ - public ShopQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); + break; + } - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * A string representing the way currency is formatted when the currency isn’t specified. - */ - public ShopQuery moneyFormat() { - startField("moneyFormat"); - - return this; } - /** - * The shop’s name. - */ - public ShopQuery name() { - startField("name"); - - return this; + public String getGraphQlTypeName() { + return "ShopPayPaymentRequestSessionCreatePayload"; } /** - * Settings related to payments. + * The new Shop Pay payment request session object. */ - public ShopQuery paymentSettings(PaymentSettingsQueryDefinition queryDef) { - startField("paymentSettings"); - - _queryBuilder.append('{'); - queryDef.define(new PaymentSettingsQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public ShopPayPaymentRequestSession getShopPayPaymentRequestSession() { + return (ShopPayPaymentRequestSession) get("shopPayPaymentRequestSession"); } - /** - * The primary domain of the shop’s Online Store. - */ - public ShopQuery primaryDomain(DomainQueryDefinition queryDef) { - startField("primaryDomain"); - - _queryBuilder.append('{'); - queryDef.define(new DomainQuery(_queryBuilder)); - _queryBuilder.append('}'); - + public ShopPayPaymentRequestSessionCreatePayload setShopPayPaymentRequestSession(ShopPayPaymentRequestSession arg) { + optimisticData.put(getKey("shopPayPaymentRequestSession"), arg); return this; } /** - * The shop’s privacy policy. + * Error codes for failed Shop Pay payment request session mutations. */ - public ShopQuery privacyPolicy(ShopPolicyQueryDefinition queryDef) { - startField("privacyPolicy"); - _queryBuilder.append('{'); - queryDef.define(new ShopPolicyQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + public List getUserErrors() { + return (List) get("userErrors"); } - /** - * The shop’s refund policy. - */ - public ShopQuery refundPolicy(ShopPolicyQueryDefinition queryDef) { - startField("refundPolicy"); - - _queryBuilder.append('{'); - queryDef.define(new ShopPolicyQuery(_queryBuilder)); - _queryBuilder.append('}'); - + public ShopPayPaymentRequestSessionCreatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } - /** - * The shop’s shipping policy. - */ - public ShopQuery shippingPolicy(ShopPolicyQueryDefinition queryDef) { - startField("shippingPolicy"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "shopPayPaymentRequestSession": return true; - _queryBuilder.append('{'); - queryDef.define(new ShopPolicyQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "userErrors": return true; - return this; + default: return false; + } } + } - /** - * Countries that the shop ships to. - */ - public ShopQuery shipsToCountries() { - startField("shipsToCountries"); + public interface ShopPayPaymentRequestSessionSubmitPayloadQueryDefinition { + void define(ShopPayPaymentRequestSessionSubmitPayloadQuery _queryBuilder); + } - return this; + /** + * Return type for `shopPayPaymentRequestSessionSubmit` mutation. + */ + public static class ShopPayPaymentRequestSessionSubmitPayloadQuery extends Query { + ShopPayPaymentRequestSessionSubmitPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The shop’s subscription policy. + * The checkout on which the payment was applied. */ - public ShopQuery subscriptionPolicy(ShopPolicyWithDefaultQueryDefinition queryDef) { - startField("subscriptionPolicy"); + public ShopPayPaymentRequestSessionSubmitPayloadQuery paymentRequestReceipt(ShopPayPaymentRequestReceiptQueryDefinition queryDef) { + startField("paymentRequestReceipt"); _queryBuilder.append('{'); - queryDef.define(new ShopPolicyWithDefaultQuery(_queryBuilder)); + queryDef.define(new ShopPayPaymentRequestReceiptQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The shop’s terms of service. + * Error codes for failed Shop Pay payment request session mutations. */ - public ShopQuery termsOfService(ShopPolicyQueryDefinition queryDef) { - startField("termsOfService"); + public ShopPayPaymentRequestSessionSubmitPayloadQuery userErrors(UserErrorsShopPayPaymentRequestSessionUserErrorsQueryDefinition queryDef) { + startField("userErrors"); _queryBuilder.append('{'); - queryDef.define(new ShopPolicyQuery(_queryBuilder)); + queryDef.define(new UserErrorsShopPayPaymentRequestSessionUserErrorsQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -71219,144 +69459,21 @@ public ShopQuery termsOfService(ShopPolicyQueryDefinition queryDef) { } /** - * Shop represents a collection of the general settings and information about the shop. - */ - public static class Shop extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { - public Shop() { - } - - public Shop(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "brand": { - Brand optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Brand(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "description": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - - break; - } - - case "metafield": { - Metafield optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "metafields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } - - list1.add(optional2); - } - - responseData.put(key, list1); - - break; - } - - case "moneyFormat": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "paymentSettings": { - responseData.put(key, new PaymentSettings(jsonAsObject(field.getValue(), key))); - - break; - } - - case "primaryDomain": { - responseData.put(key, new Domain(jsonAsObject(field.getValue(), key))); - - break; - } - - case "privacyPolicy": { - ShopPolicy optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ShopPolicy(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "refundPolicy": { - ShopPolicy optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ShopPolicy(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "shippingPolicy": { - ShopPolicy optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ShopPolicy(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "shipsToCountries": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(CountryCode.fromGraphQl(jsonAsString(element1, key))); - } - - responseData.put(key, list1); - - break; - } + * Return type for `shopPayPaymentRequestSessionSubmit` mutation. + */ + public static class ShopPayPaymentRequestSessionSubmitPayload extends AbstractResponse { + public ShopPayPaymentRequestSessionSubmitPayload() { + } - case "subscriptionPolicy": { - ShopPolicyWithDefault optional1 = null; + public ShopPayPaymentRequestSessionSubmitPayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "paymentRequestReceipt": { + ShopPayPaymentRequestReceipt optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new ShopPolicyWithDefault(jsonAsObject(field.getValue(), key)); + optional1 = new ShopPayPaymentRequestReceipt(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -71364,13 +69481,13 @@ public Shop(JsonObject fields) throws SchemaViolationError { break; } - case "termsOfService": { - ShopPolicy optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ShopPolicy(jsonAsObject(field.getValue(), key)); + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserErrorsShopPayPaymentRequestSessionUserErrors(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } @@ -71386,239 +69503,575 @@ public Shop(JsonObject fields) throws SchemaViolationError { } } - public Shop(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "Shop"; + return "ShopPayPaymentRequestSessionSubmitPayload"; } /** - * The shop's branding configuration. + * The checkout on which the payment was applied. */ - public Brand getBrand() { - return (Brand) get("brand"); + public ShopPayPaymentRequestReceipt getPaymentRequestReceipt() { + return (ShopPayPaymentRequestReceipt) get("paymentRequestReceipt"); } - public Shop setBrand(Brand arg) { - optimisticData.put(getKey("brand"), arg); + public ShopPayPaymentRequestSessionSubmitPayload setPaymentRequestReceipt(ShopPayPaymentRequestReceipt arg) { + optimisticData.put(getKey("paymentRequestReceipt"), arg); return this; } /** - * A description of the shop. + * Error codes for failed Shop Pay payment request session mutations. */ - public String getDescription() { - return (String) get("description"); + public List getUserErrors() { + return (List) get("userErrors"); } - public Shop setDescription(String arg) { - optimisticData.put(getKey("description"), arg); + public ShopPayPaymentRequestSessionSubmitPayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "paymentRequestReceipt": return true; + + case "userErrors": return true; + + default: return false; + } + } + } + + public interface ShopPayPaymentRequestShippingLineQueryDefinition { + void define(ShopPayPaymentRequestShippingLineQuery _queryBuilder); + } + + /** + * Represents a shipping line for a Shop Pay payment request. + */ + public static class ShopPayPaymentRequestShippingLineQuery extends Query { + ShopPayPaymentRequestShippingLineQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + /** - * A globally-unique ID. + * The amount for the shipping line. */ + public ShopPayPaymentRequestShippingLineQuery amount(MoneyV2QueryDefinition queryDef) { + startField("amount"); - public ID getId() { - return (ID) get("id"); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * Returns a metafield found by namespace and key. + * The code of the shipping line. */ + public ShopPayPaymentRequestShippingLineQuery code() { + startField("code"); - public Metafield getMetafield() { - return (Metafield) get("metafield"); + return this; } - public Shop setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); + /** + * The label of the shipping line. + */ + public ShopPayPaymentRequestShippingLineQuery label() { + startField("label"); + return this; } + } + + /** + * Represents a shipping line for a Shop Pay payment request. + */ + public static class ShopPayPaymentRequestShippingLine extends AbstractResponse { + public ShopPayPaymentRequestShippingLine() { + } + + public ShopPayPaymentRequestShippingLine(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "amount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "code": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "label": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "ShopPayPaymentRequestShippingLine"; + } /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * The amount for the shipping line. */ - public List getMetafields() { - return (List) get("metafields"); + public MoneyV2 getAmount() { + return (MoneyV2) get("amount"); } - public Shop setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); + public ShopPayPaymentRequestShippingLine setAmount(MoneyV2 arg) { + optimisticData.put(getKey("amount"), arg); return this; } /** - * A string representing the way currency is formatted when the currency isn’t specified. + * The code of the shipping line. */ - public String getMoneyFormat() { - return (String) get("moneyFormat"); + public String getCode() { + return (String) get("code"); } - public Shop setMoneyFormat(String arg) { - optimisticData.put(getKey("moneyFormat"), arg); + public ShopPayPaymentRequestShippingLine setCode(String arg) { + optimisticData.put(getKey("code"), arg); return this; } /** - * The shop’s name. + * The label of the shipping line. */ - public String getName() { - return (String) get("name"); + public String getLabel() { + return (String) get("label"); } - public Shop setName(String arg) { - optimisticData.put(getKey("name"), arg); + public ShopPayPaymentRequestShippingLine setLabel(String arg) { + optimisticData.put(getKey("label"), arg); return this; } - /** - * Settings related to payments. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "amount": return true; - public PaymentSettings getPaymentSettings() { - return (PaymentSettings) get("paymentSettings"); + case "code": return false; + + case "label": return false; + + default: return false; + } + } + } + + public static class ShopPayPaymentRequestShippingLineInput implements Serializable { + private Input code = Input.undefined(); + + private Input label = Input.undefined(); + + private Input amount = Input.undefined(); + + public String getCode() { + return code.getValue(); } - public Shop setPaymentSettings(PaymentSettings arg) { - optimisticData.put(getKey("paymentSettings"), arg); + public Input getCodeInput() { + return code; + } + + public ShopPayPaymentRequestShippingLineInput setCode(String code) { + this.code = Input.optional(code); return this; } - /** - * The primary domain of the shop’s Online Store. - */ + public ShopPayPaymentRequestShippingLineInput setCodeInput(Input code) { + if (code == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.code = code; + return this; + } - public Domain getPrimaryDomain() { - return (Domain) get("primaryDomain"); + public String getLabel() { + return label.getValue(); } - public Shop setPrimaryDomain(Domain arg) { - optimisticData.put(getKey("primaryDomain"), arg); + public Input getLabelInput() { + return label; + } + + public ShopPayPaymentRequestShippingLineInput setLabel(String label) { + this.label = Input.optional(label); return this; } - /** - * The shop’s privacy policy. - */ + public ShopPayPaymentRequestShippingLineInput setLabelInput(Input label) { + if (label == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.label = label; + return this; + } - public ShopPolicy getPrivacyPolicy() { - return (ShopPolicy) get("privacyPolicy"); + public MoneyInput getAmount() { + return amount.getValue(); } - public Shop setPrivacyPolicy(ShopPolicy arg) { - optimisticData.put(getKey("privacyPolicy"), arg); + public Input getAmountInput() { + return amount; + } + + public ShopPayPaymentRequestShippingLineInput setAmount(MoneyInput amount) { + this.amount = Input.optional(amount); + return this; + } + + public ShopPayPaymentRequestShippingLineInput setAmountInput(Input amount) { + if (amount == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.amount = amount; return this; } + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + if (this.code.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("code:"); + if (code.getValue() != null) { + Query.appendQuotedString(_queryBuilder, code.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.label.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("label:"); + if (label.getValue() != null) { + Query.appendQuotedString(_queryBuilder, label.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.amount.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("amount:"); + if (amount.getValue() != null) { + amount.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + _queryBuilder.append('}'); + } + } + + public interface ShopPayPaymentRequestTotalShippingPriceQueryDefinition { + void define(ShopPayPaymentRequestTotalShippingPriceQuery _queryBuilder); + } + + /** + * Represents a shipping total for a Shop Pay payment request. + */ + public static class ShopPayPaymentRequestTotalShippingPriceQuery extends Query { + ShopPayPaymentRequestTotalShippingPriceQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + /** - * The shop’s refund policy. + * The discounts for the shipping total. */ + public ShopPayPaymentRequestTotalShippingPriceQuery discounts(ShopPayPaymentRequestDiscountQueryDefinition queryDef) { + startField("discounts"); - public ShopPolicy getRefundPolicy() { - return (ShopPolicy) get("refundPolicy"); - } + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestDiscountQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Shop setRefundPolicy(ShopPolicy arg) { - optimisticData.put(getKey("refundPolicy"), arg); return this; } /** - * The shop’s shipping policy. + * The final total for the shipping total. */ + public ShopPayPaymentRequestTotalShippingPriceQuery finalTotal(MoneyV2QueryDefinition queryDef) { + startField("finalTotal"); - public ShopPolicy getShippingPolicy() { - return (ShopPolicy) get("shippingPolicy"); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } - public Shop setShippingPolicy(ShopPolicy arg) { - optimisticData.put(getKey("shippingPolicy"), arg); + /** + * The original total for the shipping total. + */ + public ShopPayPaymentRequestTotalShippingPriceQuery originalTotal(MoneyV2QueryDefinition queryDef) { + startField("originalTotal"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + return this; } + } + + /** + * Represents a shipping total for a Shop Pay payment request. + */ + public static class ShopPayPaymentRequestTotalShippingPrice extends AbstractResponse { + public ShopPayPaymentRequestTotalShippingPrice() { + } + + public ShopPayPaymentRequestTotalShippingPrice(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "discounts": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ShopPayPaymentRequestDiscount(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "finalTotal": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "originalTotal": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "ShopPayPaymentRequestTotalShippingPrice"; + } /** - * Countries that the shop ships to. + * The discounts for the shipping total. */ - public List getShipsToCountries() { - return (List) get("shipsToCountries"); + public List getDiscounts() { + return (List) get("discounts"); } - public Shop setShipsToCountries(List arg) { - optimisticData.put(getKey("shipsToCountries"), arg); + public ShopPayPaymentRequestTotalShippingPrice setDiscounts(List arg) { + optimisticData.put(getKey("discounts"), arg); return this; } /** - * The shop’s subscription policy. + * The final total for the shipping total. */ - public ShopPolicyWithDefault getSubscriptionPolicy() { - return (ShopPolicyWithDefault) get("subscriptionPolicy"); + public MoneyV2 getFinalTotal() { + return (MoneyV2) get("finalTotal"); } - public Shop setSubscriptionPolicy(ShopPolicyWithDefault arg) { - optimisticData.put(getKey("subscriptionPolicy"), arg); + public ShopPayPaymentRequestTotalShippingPrice setFinalTotal(MoneyV2 arg) { + optimisticData.put(getKey("finalTotal"), arg); return this; } /** - * The shop’s terms of service. + * The original total for the shipping total. */ - public ShopPolicy getTermsOfService() { - return (ShopPolicy) get("termsOfService"); + public MoneyV2 getOriginalTotal() { + return (MoneyV2) get("originalTotal"); } - public Shop setTermsOfService(ShopPolicy arg) { - optimisticData.put(getKey("termsOfService"), arg); + public ShopPayPaymentRequestTotalShippingPrice setOriginalTotal(MoneyV2 arg) { + optimisticData.put(getKey("originalTotal"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "brand": return true; + case "discounts": return true; - case "description": return false; + case "finalTotal": return true; - case "id": return false; + case "originalTotal": return true; - case "metafield": return true; + default: return false; + } + } + } - case "metafields": return true; + public static class ShopPayPaymentRequestTotalShippingPriceInput implements Serializable { + private Input> discounts = Input.undefined(); - case "moneyFormat": return false; + private Input originalTotal = Input.undefined(); - case "name": return false; + private Input finalTotal = Input.undefined(); - case "paymentSettings": return true; + public List getDiscounts() { + return discounts.getValue(); + } - case "primaryDomain": return true; + public Input> getDiscountsInput() { + return discounts; + } - case "privacyPolicy": return true; + public ShopPayPaymentRequestTotalShippingPriceInput setDiscounts(List discounts) { + this.discounts = Input.optional(discounts); + return this; + } - case "refundPolicy": return true; + public ShopPayPaymentRequestTotalShippingPriceInput setDiscountsInput(Input> discounts) { + if (discounts == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.discounts = discounts; + return this; + } - case "shippingPolicy": return true; + public MoneyInput getOriginalTotal() { + return originalTotal.getValue(); + } - case "shipsToCountries": return false; + public Input getOriginalTotalInput() { + return originalTotal; + } - case "subscriptionPolicy": return true; + public ShopPayPaymentRequestTotalShippingPriceInput setOriginalTotal(MoneyInput originalTotal) { + this.originalTotal = Input.optional(originalTotal); + return this; + } - case "termsOfService": return true; + public ShopPayPaymentRequestTotalShippingPriceInput setOriginalTotalInput(Input originalTotal) { + if (originalTotal == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.originalTotal = originalTotal; + return this; + } - default: return false; + public MoneyInput getFinalTotal() { + return finalTotal.getValue(); + } + + public Input getFinalTotalInput() { + return finalTotal; + } + + public ShopPayPaymentRequestTotalShippingPriceInput setFinalTotal(MoneyInput finalTotal) { + this.finalTotal = Input.optional(finalTotal); + return this; + } + + public ShopPayPaymentRequestTotalShippingPriceInput setFinalTotalInput(Input finalTotal) { + if (finalTotal == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.finalTotal = finalTotal; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + if (this.discounts.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("discounts:"); + if (discounts.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ShopPayPaymentRequestDiscountInput item1 : discounts.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } + + if (this.originalTotal.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("originalTotal:"); + if (originalTotal.getValue() != null) { + originalTotal.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } } + + if (this.finalTotal.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("finalTotal:"); + if (finalTotal.getValue() != null) { + finalTotal.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + _queryBuilder.append('}'); } } @@ -74288,175 +72741,6 @@ public boolean unwrapsToObject(String key) { } } - public static class TokenizedPaymentInputV3 implements Serializable { - private MoneyInput paymentAmount; - - private String idempotencyKey; - - private MailingAddressInput billingAddress; - - private String paymentData; - - private PaymentTokenType type; - - private Input test = Input.undefined(); - - private Input identifier = Input.undefined(); - - public TokenizedPaymentInputV3(MoneyInput paymentAmount, String idempotencyKey, MailingAddressInput billingAddress, String paymentData, PaymentTokenType type) { - this.paymentAmount = paymentAmount; - - this.idempotencyKey = idempotencyKey; - - this.billingAddress = billingAddress; - - this.paymentData = paymentData; - - this.type = type; - } - - public MoneyInput getPaymentAmount() { - return paymentAmount; - } - - public TokenizedPaymentInputV3 setPaymentAmount(MoneyInput paymentAmount) { - this.paymentAmount = paymentAmount; - return this; - } - - public String getIdempotencyKey() { - return idempotencyKey; - } - - public TokenizedPaymentInputV3 setIdempotencyKey(String idempotencyKey) { - this.idempotencyKey = idempotencyKey; - return this; - } - - public MailingAddressInput getBillingAddress() { - return billingAddress; - } - - public TokenizedPaymentInputV3 setBillingAddress(MailingAddressInput billingAddress) { - this.billingAddress = billingAddress; - return this; - } - - public String getPaymentData() { - return paymentData; - } - - public TokenizedPaymentInputV3 setPaymentData(String paymentData) { - this.paymentData = paymentData; - return this; - } - - public PaymentTokenType getType() { - return type; - } - - public TokenizedPaymentInputV3 setType(PaymentTokenType type) { - this.type = type; - return this; - } - - public Boolean getTest() { - return test.getValue(); - } - - public Input getTestInput() { - return test; - } - - public TokenizedPaymentInputV3 setTest(Boolean test) { - this.test = Input.optional(test); - return this; - } - - public TokenizedPaymentInputV3 setTestInput(Input test) { - if (test == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.test = test; - return this; - } - - public String getIdentifier() { - return identifier.getValue(); - } - - public Input getIdentifierInput() { - return identifier; - } - - public TokenizedPaymentInputV3 setIdentifier(String identifier) { - this.identifier = Input.optional(identifier); - return this; - } - - public TokenizedPaymentInputV3 setIdentifierInput(Input identifier) { - if (identifier == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.identifier = identifier; - return this; - } - - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("paymentAmount:"); - paymentAmount.appendTo(_queryBuilder); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("idempotencyKey:"); - Query.appendQuotedString(_queryBuilder, idempotencyKey.toString()); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("billingAddress:"); - billingAddress.appendTo(_queryBuilder); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("paymentData:"); - Query.appendQuotedString(_queryBuilder, paymentData.toString()); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("type:"); - _queryBuilder.append(type.toString()); - - if (this.test.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("test:"); - if (test.getValue() != null) { - _queryBuilder.append(test.getValue()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.identifier.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("identifier:"); - if (identifier.getValue() != null) { - Query.appendQuotedString(_queryBuilder, identifier.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - _queryBuilder.append('}'); - } - } - public interface TrackableQueryDefinition { void define(TrackableQuery _queryBuilder); } @@ -74613,426 +72897,6 @@ public boolean unwrapsToObject(String key) { } } - public interface TransactionQueryDefinition { - void define(TransactionQuery _queryBuilder); - } - - /** - * An object representing exchange of money for a product or service. - */ - public static class TransactionQuery extends Query { - TransactionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The amount of money that the transaction was for. - */ - public TransactionQuery amount(MoneyV2QueryDefinition queryDef) { - startField("amount"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The amount of money that the transaction was for. - * - * @deprecated Use `amount` instead. - */ - @Deprecated - public TransactionQuery amountV2(MoneyV2QueryDefinition queryDef) { - startField("amountV2"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The kind of the transaction. - */ - public TransactionQuery kind() { - startField("kind"); - - return this; - } - - /** - * The status of the transaction. - * - * @deprecated Use `statusV2` instead. - */ - @Deprecated - public TransactionQuery status() { - startField("status"); - - return this; - } - - /** - * The status of the transaction. - */ - public TransactionQuery statusV2() { - startField("statusV2"); - - return this; - } - - /** - * Whether the transaction was done in test mode or not. - */ - public TransactionQuery test() { - startField("test"); - - return this; - } - } - - /** - * An object representing exchange of money for a product or service. - */ - public static class Transaction extends AbstractResponse { - public Transaction() { - } - - public Transaction(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "amount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "amountV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "kind": { - responseData.put(key, TransactionKind.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "status": { - responseData.put(key, TransactionStatus.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "statusV2": { - TransactionStatus optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = TransactionStatus.fromGraphQl(jsonAsString(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "test": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "Transaction"; - } - - /** - * The amount of money that the transaction was for. - */ - - public MoneyV2 getAmount() { - return (MoneyV2) get("amount"); - } - - public Transaction setAmount(MoneyV2 arg) { - optimisticData.put(getKey("amount"), arg); - return this; - } - - /** - * The amount of money that the transaction was for. - * - * @deprecated Use `amount` instead. - */ - - public MoneyV2 getAmountV2() { - return (MoneyV2) get("amountV2"); - } - - public Transaction setAmountV2(MoneyV2 arg) { - optimisticData.put(getKey("amountV2"), arg); - return this; - } - - /** - * The kind of the transaction. - */ - - public TransactionKind getKind() { - return (TransactionKind) get("kind"); - } - - public Transaction setKind(TransactionKind arg) { - optimisticData.put(getKey("kind"), arg); - return this; - } - - /** - * The status of the transaction. - * - * @deprecated Use `statusV2` instead. - */ - - public TransactionStatus getStatus() { - return (TransactionStatus) get("status"); - } - - public Transaction setStatus(TransactionStatus arg) { - optimisticData.put(getKey("status"), arg); - return this; - } - - /** - * The status of the transaction. - */ - - public TransactionStatus getStatusV2() { - return (TransactionStatus) get("statusV2"); - } - - public Transaction setStatusV2(TransactionStatus arg) { - optimisticData.put(getKey("statusV2"), arg); - return this; - } - - /** - * Whether the transaction was done in test mode or not. - */ - - public Boolean getTest() { - return (Boolean) get("test"); - } - - public Transaction setTest(Boolean arg) { - optimisticData.put(getKey("test"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "amount": return true; - - case "amountV2": return true; - - case "kind": return false; - - case "status": return false; - - case "statusV2": return false; - - case "test": return false; - - default: return false; - } - } - } - - /** - * The different kinds of order transactions. - */ - public enum TransactionKind { - /** - * An amount reserved against the cardholder's funding source. - * Money does not change hands until the authorization is captured. - */ - AUTHORIZATION, - - /** - * A transfer of the money that was reserved during the authorization stage. - */ - CAPTURE, - - /** - * Money returned to the customer when they have paid too much. - */ - CHANGE, - - /** - * An authorization for a payment taken with an EMV credit card reader. - */ - EMV_AUTHORIZATION, - - /** - * An authorization and capture performed together in a single step. - */ - SALE, - - UNKNOWN_VALUE; - - public static TransactionKind fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "AUTHORIZATION": { - return AUTHORIZATION; - } - - case "CAPTURE": { - return CAPTURE; - } - - case "CHANGE": { - return CHANGE; - } - - case "EMV_AUTHORIZATION": { - return EMV_AUTHORIZATION; - } - - case "SALE": { - return SALE; - } - - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case AUTHORIZATION: { - return "AUTHORIZATION"; - } - - case CAPTURE: { - return "CAPTURE"; - } - - case CHANGE: { - return "CHANGE"; - } - - case EMV_AUTHORIZATION: { - return "EMV_AUTHORIZATION"; - } - - case SALE: { - return "SALE"; - } - - default: { - return ""; - } - } - } - } - - /** - * Transaction statuses describe the status of a transaction. - */ - public enum TransactionStatus { - /** - * There was an error while processing the transaction. - */ - ERROR, - - /** - * The transaction failed. - */ - FAILURE, - - /** - * The transaction is pending. - */ - PENDING, - - /** - * The transaction succeeded. - */ - SUCCESS, - - UNKNOWN_VALUE; - - public static TransactionStatus fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "ERROR": { - return ERROR; - } - - case "FAILURE": { - return FAILURE; - } - - case "PENDING": { - return PENDING; - } - - case "SUCCESS": { - return SUCCESS; - } - - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case ERROR: { - return "ERROR"; - } - - case FAILURE: { - return "FAILURE"; - } - - case PENDING: { - return "PENDING"; - } - - case SUCCESS: { - return "SUCCESS"; - } - - default: { - return ""; - } - } - } - } - public interface UnitPriceMeasurementQueryDefinition { void define(UnitPriceMeasurementQuery _queryBuilder); } @@ -76063,6 +73927,223 @@ public boolean unwrapsToObject(String key) { } } + public interface UserErrorsShopPayPaymentRequestSessionUserErrorsQueryDefinition { + void define(UserErrorsShopPayPaymentRequestSessionUserErrorsQuery _queryBuilder); + } + + /** + * Represents an error that happens during execution of a customer mutation. + */ + public static class UserErrorsShopPayPaymentRequestSessionUserErrorsQuery extends Query { + UserErrorsShopPayPaymentRequestSessionUserErrorsQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The error code. + */ + public UserErrorsShopPayPaymentRequestSessionUserErrorsQuery code() { + startField("code"); + + return this; + } + + /** + * The path to the input field that caused the error. + */ + public UserErrorsShopPayPaymentRequestSessionUserErrorsQuery field() { + startField("field"); + + return this; + } + + /** + * The error message. + */ + public UserErrorsShopPayPaymentRequestSessionUserErrorsQuery message() { + startField("message"); + + return this; + } + } + + /** + * Represents an error that happens during execution of a customer mutation. + */ + public static class UserErrorsShopPayPaymentRequestSessionUserErrors extends AbstractResponse implements DisplayableError { + public UserErrorsShopPayPaymentRequestSessionUserErrors() { + } + + public UserErrorsShopPayPaymentRequestSessionUserErrors(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "code": { + UserErrorsShopPayPaymentRequestSessionUserErrorsCode optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = UserErrorsShopPayPaymentRequestSessionUserErrorsCode.fromGraphQl(jsonAsString(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "field": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + optional1 = list1; + } + + responseData.put(key, optional1); + + break; + } + + case "message": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "UserErrorsShopPayPaymentRequestSessionUserErrors"; + } + + /** + * The error code. + */ + + public UserErrorsShopPayPaymentRequestSessionUserErrorsCode getCode() { + return (UserErrorsShopPayPaymentRequestSessionUserErrorsCode) get("code"); + } + + public UserErrorsShopPayPaymentRequestSessionUserErrors setCode(UserErrorsShopPayPaymentRequestSessionUserErrorsCode arg) { + optimisticData.put(getKey("code"), arg); + return this; + } + + /** + * The path to the input field that caused the error. + */ + + public List getField() { + return (List) get("field"); + } + + public UserErrorsShopPayPaymentRequestSessionUserErrors setField(List arg) { + optimisticData.put(getKey("field"), arg); + return this; + } + + /** + * The error message. + */ + + public String getMessage() { + return (String) get("message"); + } + + public UserErrorsShopPayPaymentRequestSessionUserErrors setMessage(String arg) { + optimisticData.put(getKey("message"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "code": return false; + + case "field": return false; + + case "message": return false; + + default: return false; + } + } + } + + /** + * Possible error codes that can be returned by `ShopPayPaymentRequestSessionUserErrors`. + */ + public enum UserErrorsShopPayPaymentRequestSessionUserErrorsCode { + /** + * Idempotency key has already been used. + */ + IDEMPOTENCY_KEY_ALREADY_USED, + + /** + * Payment request input is invalid. + */ + PAYMENT_REQUEST_INVALID_INPUT, + + /** + * Payment request not found. + */ + PAYMENT_REQUEST_NOT_FOUND, + + UNKNOWN_VALUE; + + public static UserErrorsShopPayPaymentRequestSessionUserErrorsCode fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "IDEMPOTENCY_KEY_ALREADY_USED": { + return IDEMPOTENCY_KEY_ALREADY_USED; + } + + case "PAYMENT_REQUEST_INVALID_INPUT": { + return PAYMENT_REQUEST_INVALID_INPUT; + } + + case "PAYMENT_REQUEST_NOT_FOUND": { + return PAYMENT_REQUEST_NOT_FOUND; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case IDEMPOTENCY_KEY_ALREADY_USED: { + return "IDEMPOTENCY_KEY_ALREADY_USED"; + } + + case PAYMENT_REQUEST_INVALID_INPUT: { + return "PAYMENT_REQUEST_INVALID_INPUT"; + } + + case PAYMENT_REQUEST_NOT_FOUND: { + return "PAYMENT_REQUEST_NOT_FOUND"; + } + + default: { + return ""; + } + } + } + } + public static class VariantOptionFilter implements Serializable { private String name; diff --git a/MobileBuy/buy3/src/main/java/com/shopify/buy3/internal/RealCreditCardVaultCall.kt b/MobileBuy/buy3/src/main/java/com/shopify/buy3/internal/RealCreditCardVaultCall.kt deleted file mode 100644 index 212f5ee9c..000000000 --- a/MobileBuy/buy3/src/main/java/com/shopify/buy3/internal/RealCreditCardVaultCall.kt +++ /dev/null @@ -1,171 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2015 Shopify Inc. - * - * 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. - */ -package com.shopify.buy3.internal - -import android.os.Handler -import android.support.annotation.VisibleForTesting -import com.shopify.buy3.CardVaultResult -import com.shopify.buy3.CardVaultResultCallback -import com.shopify.buy3.CreditCard -import com.shopify.buy3.CreditCardVaultCall -import okhttp3.Call -import okhttp3.HttpUrl -import okhttp3.MediaType -import okhttp3.Request -import okhttp3.RequestBody -import okhttp3.Response -import org.json.JSONException -import org.json.JSONObject -import java.io.IOException -import java.util.concurrent.atomic.AtomicBoolean -import java.util.concurrent.atomic.AtomicReference - -private const val ACCEPT_HEADER_NAME = "Accept" -private const val ACCEPT_HEADER = "application/json" -private val CONTENT_MEDIA_TYPE = MediaType.parse("application/json; charset=utf-8") - -internal class RealCreditCardVaultCall( - internal val creditCard: CreditCard, - internal val endpointUrl: HttpUrl, - internal val httpCallFactory: Call.Factory -) : CreditCardVaultCall { - private val executed = AtomicBoolean() - private var httpCall: Call? = null - private var resultCallback: VaultHttpCallback? = null - - @Volatile override var isCanceled: Boolean = false - private set - - override fun cancel() { - isCanceled = true - - synchronized(this) { - httpCall?.cancel() - httpCall = null - - resultCallback?.cancel() - resultCallback = null - } - } - - override fun clone(): CreditCardVaultCall { - return RealCreditCardVaultCall(creditCard, endpointUrl, httpCallFactory) - } - - override fun enqueue(callbackHandler: Handler?, callback: CardVaultResultCallback): CreditCardVaultCall { - if (!executed.compareAndSet(false, true)) { - throw IllegalStateException("Already Executed") - } - - if (isCanceled) { - val action = { callback(CardVaultResult.Failure(IllegalStateException("Call was canceled"))) } - callbackHandler?.post(action) ?: action() - return this - } - - val payload = try { - creditCard.toJson() - } catch (e: JSONException) { - val action = { callback(CardVaultResult.Failure(RuntimeException("Failed to serialize credit card", e))) } - callbackHandler?.post(action) ?: action() - return this - } - - synchronized(this) { - resultCallback = VaultHttpCallback { - callbackHandler?.post { callback(it) } ?: callback(it) - } - httpCall = httpCallFactory.newVaultHttpCall(endpointUrl = endpointUrl, payload = payload) - .apply { enqueue(resultCallback) } - } - - return this - } -} - -private class VaultHttpCallback(val callback: CardVaultResultCallback) : okhttp3.Callback { - private val originalCallbackRef = AtomicReference(callback) - - override fun onFailure(call: Call, e: IOException) { - originalCallbackRef.getAndSet(null)?.also { callback -> - callback(CardVaultResult.Failure(e)) - } - } - - override fun onResponse(call: Call, response: Response) { - originalCallbackRef.getAndSet(null)?.also { callback -> - val token = try { - response.parseVaultToken() - } catch (e: Exception) { - callback(CardVaultResult.Failure(e)) - return - } - callback(CardVaultResult.Success(token)) - } - } - - fun cancel() { - originalCallbackRef.getAndSet(null)?.also { callback -> - callback(CardVaultResult.Failure(IllegalStateException("Call was canceled"))) - } - } -} - -private fun Call.Factory.newVaultHttpCall(endpointUrl: HttpUrl, payload: String): Call { - val body = RequestBody.create(CONTENT_MEDIA_TYPE, payload) - val request = Request.Builder() - .url(endpointUrl) - .post(body) - .header(ACCEPT_HEADER_NAME, ACCEPT_HEADER) - .build() - return newCall(request) -} - -@Throws(JSONException::class) -private fun CreditCard.toJson(): String { - return JSONObject() - .put( - "credit_card", JSONObject() - .put("number", number) - .put("first_name", firstName) - .put("last_name", lastName) - .put("month", expireMonth) - .put("year", expireYear) - .put("verification_value", verificationCode) - ).toString() -} - -@Throws(IOException::class) -private fun Response.parseVaultToken(): String { - return if (isSuccessful) { - try { - val responseJsonObject = JSONObject(body().string()) - responseJsonObject.getString("id") - } catch (e: Exception) { - throw IOException("Failed to parse vault response", e) - } - } else { - throw IOException("Failed to vault credit card: HTTP(${code()} {${message()}}") - } -} \ No newline at end of file diff --git a/MobileBuy/buy3/src/test/java/com/shopify/buy3/CacheTest.kt b/MobileBuy/buy3/src/test/java/com/shopify/buy3/CacheTest.kt index 1200dd058..1dcbcd086 100644 --- a/MobileBuy/buy3/src/test/java/com/shopify/buy3/CacheTest.kt +++ b/MobileBuy/buy3/src/test/java/com/shopify/buy3/CacheTest.kt @@ -63,7 +63,7 @@ class CacheTest { private lateinit var lastHttResponse: okhttp3.Response private lateinit var okHttpClient: OkHttpClient private val mutationQuery = Storefront.mutation { root -> - root.checkoutCompleteFree(ID("test")) { query -> query.checkout { it.ready() } } + root.cartCreate() { query -> query.cart { it.note() } } } @Before fun setUp() { diff --git a/MobileBuy/buy3/src/test/java/com/shopify/buy3/CardClientTest.kt b/MobileBuy/buy3/src/test/java/com/shopify/buy3/CardClientTest.kt deleted file mode 100644 index 4d6a377ed..000000000 --- a/MobileBuy/buy3/src/test/java/com/shopify/buy3/CardClientTest.kt +++ /dev/null @@ -1,147 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2015 Shopify Inc. - * - * 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. - */ -package com.shopify.buy3 - -import com.google.common.truth.Truth.assertThat -import com.shopify.buy3.internal.RealCreditCardVaultCall -import okhttp3.OkHttpClient -import okhttp3.mockwebserver.MockResponse -import okhttp3.mockwebserver.MockWebServer -import org.json.JSONObject -import org.junit.Test -import java.util.concurrent.TimeUnit -import java.util.concurrent.atomic.AtomicReference - -class CardClientTest { - private val cardClient = CardClient() - private val creditCard = CreditCard.mock() - private val server = MockWebServer() - - @Test fun cardClientInstantiateWithDefaultOkHttpClient() { - val cardClient = CardClient() - assertThat(cardClient.httpCallFactory).isNotNull() - - val call = cardClient.vault(CreditCard.mock(), "http://google.com") as RealCreditCardVaultCall - assertThat(call.httpCallFactory).isEqualTo(cardClient.httpCallFactory) - } - - @Test fun cardClientInstantiateWithOkHttpClient() { - val okHttpClient = OkHttpClient.Builder().build() - - val cardClient = CardClient(okHttpClient) - assertThat(cardClient.httpCallFactory).isEqualTo(okHttpClient) - - val call = cardClient.vault(CreditCard.mock(), "http://google.com") as RealCreditCardVaultCall - assertThat(call.httpCallFactory).isEqualTo(okHttpClient) - } - - @Test fun creditCardPrecondition() { - checkForIllegalArgumentException { CreditCard.mock(firstName = "") } - checkForIllegalArgumentException { CreditCard.mock(lastName = "") } - checkForIllegalArgumentException { CreditCard.mock(number = "") } - checkForIllegalArgumentException { CreditCard.mock(expireMonth = "") } - checkForIllegalArgumentException { CreditCard.mock(expireYear = "") } - checkForIllegalArgumentException { CreditCard.mock(verificationCode = "") } - } - - @Test fun realCardVaultCallInstantiatedCorrectly() { - val call = cardClient.vault(creditCard, "http://google.com") as RealCreditCardVaultCall - assertThat(call.creditCard).isEqualTo(creditCard) - assertThat(call.endpointUrl.toString()).isEqualTo("http://google.com/") - assertThat(call.httpCallFactory).isEqualTo(cardClient.httpCallFactory) - } - - @Test fun realCardVaultCallClone() { - val call = cardClient.vault(creditCard, "http://google.com") as RealCreditCardVaultCall - val clonedCall = call.clone() as RealCreditCardVaultCall - - assertThat(clonedCall).isNotEqualTo(call) - assertThat(clonedCall.creditCard).isEqualTo(call.creditCard) - assertThat(clonedCall.endpointUrl).isEqualTo(call.endpointUrl) - assertThat(clonedCall.httpCallFactory).isEqualTo(call.httpCallFactory) - } - -// @Test fun vaultCreditCardSuccess() { -// server.enqueue(MockResponse().setResponseCode(200).setBody("{\"id\": \"83hru3obno3hu434b3u\"}")) -// -// val token = cardClient.vault(creditCard, server.url("/").toString()).fetchVaultToken() -// -// val recordedRequest = server.takeRequest() -// assertThat(recordedRequest.getHeader("Accept")).isEqualTo("application/json") -// assertThat(recordedRequest.getHeader("Content-Type")).isEqualTo("application/json; charset=utf-8") -// -// val jsonObject = JSONObject(recordedRequest.body.readUtf8()) -// assertThat(jsonObject).isEqualTo(creditCard.asJson()) -// assertThat(token).isEqualTo("83hru3obno3hu434b3u") -// } -// -// @Test -// fun vaultCreditCardFail() { -// server.enqueue(MockResponse().setResponseCode(400)) -// server.enqueue(MockResponse().setResponseCode(200).setBody("")) -// -// var result = cardClient.vault(creditCard, server.url("/").toString()).fetchVaultToken() -// assertThat(result).isInstanceOf(CardVaultResult.Failure::class.java) -// -// result = cardClient.vault(creditCard, server.url("/").toString()).fetchVaultToken() -// assertThat(result).isInstanceOf(CardVaultResult.Failure::class.java) -// } -} - -private fun CreditCard.Companion.mock( - firstName: String = "John", - lastName: String = "Smith", - number: String = "1", - expireMonth: String = "06", - expireYear: String = "2017", - verificationCode: String = "111" -) = CreditCard( - firstName = firstName, - lastName = lastName, - number = number, - expireMonth = expireMonth, - expireYear = expireYear, - verificationCode = verificationCode -) - -private fun CreditCard.asJson() = JSONObject().put( - "credit_card", JSONObject() - .put("number", number) - .put("first_name", firstName) - .put("last_name", lastName) - .put("month", expireMonth) - .put("year", expireYear) - .put("verification_value", verificationCode) -) - -private fun CreditCardVaultCall.fetchVaultToken(): CardVaultResult { - val latch = NamedCountDownLatch("get CreditCardVaultCall result", 1) - val result = AtomicReference() - enqueue { - result.set(it) - latch.countDown() - } - latch.awaitOrThrowWithTimeout(2, TimeUnit.SECONDS) - return result.get()!! -} \ No newline at end of file diff --git a/README.md b/README.md index 6df760856..07a1472fb 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ # Mobile Buy SDK -The Mobile Buy SDK makes it easy to create custom storefronts in your mobile app, where users can buy products using Google Pay or their credit card. The SDK connects to the Shopify platform using GraphQL, and supports a wide range of native storefront experiences. +The Mobile Buy SDK makes it easy to create custom storefronts in your mobile app. The SDK connects to the Shopify platform using GraphQL, and supports a wide range of native storefront experiences. ## Table of contents @@ -38,27 +38,12 @@ The Mobile Buy SDK makes it easy to create custom storefronts in your mobile app - [Comparison operators](#comparison-operators-) - [Exists operator](#exists-operator-) -- [Card vaulting](#card-vaulting-) - - - [Card client](#card-client-) - - [Case studies](#case-studies-) - [Fetch shop](#fetch-shop-) - [Fetch collections and products](#fetch-collections-and-products-) - [Pagination](#pagination-) - [Fetch product details](#fetch-product-details-) - - [Checkout](#checkout-) - - [Creating a checkout](#checkout-) - - [Updating a checkout](#updating-a-checkout-) - - [Polling for checkout readiness](#polling-for-checkout-readiness-) - - [Polling for shipping rates](#polling-for-shipping-rates-) - - [Updating shipping line](#updating-shipping-line-) - - [Completing a checkout](#completing-a-checkout-) - - [Web](#web-checkout-) - - [Credit card](#credit-card-checkout-) - - [Google Pay](#google-pay-checkout-) - - [Polling for checkout completion](#polling-for-checkout-completion-) - [Customer Accounts](#customer-accounts-) - [Creating a customer](#creating-a-customer-) - [Customer login](#customer-login-) @@ -645,48 +630,6 @@ The following example shows how you can find products that don't have any tags. .products(arg -> arg.query("-tag:*"), ... ``` -## Card Vaulting [⤴](#table-of-contents) - -The Buy SDK supports native checkout via GraphQL, which lets you complete a checkout with a credit card. However, it doesn't accept credit card numbers directly. Instead, you need to vault the credit cards via the standalone, PCI-compliant web service. The Buy SDK makes it easy to do this using `CardClient`. - -### Card Client [⤴](#table-of-contents) - -Like `GraphClient`, the `CardClient` manages your interactions with the card server that provides opaque credit card tokens. The tokens are used to complete checkouts. To vault credit cards using the `CardClient`, you will need to request a url for the cardserver from the shop config: - -```java -final Storefront.QueryRootQuery query = Storefront.query(q -> q.shop(shop -> - shop.paymentSettings(paymentSettings -> paymentSettings.cardVaultUrl()) -)) -``` - -After collecting the user's credit card information in a secure manner, create a credit card representation and submit a vault request: - -```java -String cardVaultUrl = ...; -CardClient cardClient = ...; - -CreditCard creditCard = CreditCard.builder() - .firstName("John") - .lastName("Smith") - .number("1") - .expireMonth("06") - .expireYear("2017") - .verificationCode("111") - .build(); - -cardClient.vault(creditCard, cardVaultUrl).enqueue(new CreditCardVaultCall.Callback() { - @Override public void onResponse(@NonNull String token) { - // proceed to complete checkout with token - } - - @Override public void onFailure(@NonNull IOException error) { - // handle error - } -}); -``` - -**IMPORTANT:** The credit card vaulting service does **not** provide any validation for submitted credit cards. As a result, submitting invalid credit card numbers or even missing fields will always yield a vault `token`. Any errors related to invalid credit card information will be surfaced only when the provided `token` is used to complete a checkout. - ## Case studies [⤴](#table-of-contents) Getting started with any SDK can be confusing. The purpose of this section is to explore all areas of the Buy SDK that may be necessary to build a custom storefront on Android and provide a solid starting point for your own implementation. @@ -983,399 +926,6 @@ The corresponding GraphQL query looks like this: } ``` -### Checkout [⤴](#table-of-contents) - -After browsing products and collections, a customer might eventually want to purchase something. The Buy SDK does not provide support for a local shopping cart since the requirements can vary between applications. Instead, the implementation is left up to the custom storefront. Nevertheless, when a customer is ready to make a purchase you'll need to create a checkout. - -Almost every `mutation` query requires an input object. This is the object that dictates what fields will be mutated for a particular resource. In this case, we'll need to create a `Storefront.CheckoutCreateInput`: - -```java -Storefront.CheckoutCreateInput input = new Storefront.CheckoutCreateInput() - .setLineItemsInput(Input.value(Arrays.asList( - new Storefront.CheckoutLineItemInput(new ID("mFyaWFu"), 5), - new Storefront.CheckoutLineItemInput(new ID("8vc2hGl"), 3) - ))); -``` - -The checkout input object accepts other arguments like `email` and `shippingAddress`. In our example we don't have access to that information from the customer until a later time, so we won't include them in this mutation. Given the checkout input, we can execute the `checkoutCreate` mutation: - -```java -Storefront.MutationQuery query = Storefront.mutation(mutationQuery -> mutationQuery - .checkoutCreate(input, createPayloadQuery -> createPayloadQuery - .checkout(checkoutQuery -> checkoutQuery - .webUrl() - ) - .userErrors(userErrorQuery -> userErrorQuery - .field() - .message() - ) - ) -); - -client.mutateGraph(query).enqueue(new GraphCall.Callback() { - @Override public void onResponse(@NonNull GraphResponse response) { - if (!response.data().getCheckoutCreate().getUserErrors().isEmpty()) { - // handle user friendly errors - } else { - String checkoutId = response.data().getCheckoutCreate().getCheckout().getId().toString(); - String checkoutWebUrl = response.data().getCheckoutCreate().getCheckout().getWebUrl(); - } - } - - @Override public void onFailure(@NonNull GraphError error) { - // handle errors - } -}); -``` - -**It is best practice to always include `userErrors` fields in your mutation payload query, where possible.** You should always validate user input before making mutation requests, but it's possible that a validated user input might cause a mismatch between the client and server. In this case, `userErrors` contains an error with a `field` and `message` for any invalid or missing fields. - -Since we'll need to update the checkout with additional information later, all we need from a checkout in this mutation is an `id` so we can keep a reference to it. We can skip all other fields on `Storefront.Checkout` for efficiency and reduced bandwidth. - -#### Updating a checkout [⤴](#table-of-contents) - -A customer's information might not be available when a checkout is created. The Buy SDK provides mutations for updating the specific checkout fields that are required for completion: the `email`, `shippingAddress` and `shippingLine` fields. - -Note that if your checkout contains a line item that requires shipping, you must provide a shipping address and a shipping line as part of your checkout. - -To obtain the handle required for updating a shipping line, you must first poll for shipping rates. - -###### Updating email [⤴](#table-of-contents) - -```java -ID checkoutId = ...; - -Storefront.MutationQuery query = Storefront.mutation(mutationQuery -> mutationQuery - .checkoutEmailUpdate(checkoutId, "john.smith@gmail.com", emailUpdatePayloadQuery -> emailUpdatePayloadQuery - .checkout(checkoutQuery -> checkoutQuery - .webUrl() - ) - .userErrors(userErrorQuery -> userErrorQuery - .field() - .message() - ) - ) -); -``` - -###### Updating shipping address [⤴](#table-of-contents) - -```java -PayAddress address = ...; - -Storefront.MailingAddressInput input = new Storefront.MailingAddressInput() - .setAddress1(address.address1) - .setAddress2(address.address2) - .setCity(address.city) - .setCountry(address.country) - .setFirstName(address.firstName) - .setLastName(address.lastName) - .setPhone(address.phone) - .setProvince(address.province) - .setZip(address.zip); - -Storefront.MutationQuery query = Storefront.mutation((mutationQuery -> mutationQuery - .checkoutShippingAddressUpdate(input, checkoutId, shippingAddressUpdatePayloadQuery -> shippingAddressUpdatePayloadQuery - .checkout(checkoutQuery -> checkoutQuery - .webUrl() - ) - .userErrors(userErrorQuery -> userErrorQuery - .field() - .message() - ) - ) - ) -); -``` - -##### Polling for checkout readiness [⤴](#table-of-contents) - -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 `ready` value is `true`. Fields that are populated asynchronously include duties and taxes. - -All asynchronous computations are completed and the checkout is updated accordingly once the `checkout.ready` flag is `true`. -This flag should be checked (and polled if it is `false`) after every update to the checkout to ensure there are no asynchronous processes running that could affect the fields of the checkout. -Common examples would be after updating the shipping address or adjusting the line items of a checkout. - -```java -Storefront.QueryRootQuery query = Storefront.query(rootQuery -> rootQuery - .node(checkoutId, nodeQuery -> nodeQuery - .onCheckout(checkoutQuery -> checkoutQuery - .ready() // <- Indicates that all fields are up to date after asynchronous operations completed. - .totalDuties(totalDuties -> totalDuties - .amount() - .currencyCode() - ) - .totalTaxV2(totalTax -> totalTax - .amount() - .currencyCode() - ) - .totalPriceV2(totalPrice -> totalPrice - .amount() - .currencyCode() - ) - ) - ) -); -``` - -It is your application's responsibility to continue retrying this query until `checkout.ready == true`. The Buy SDK has [built-in support for retrying requests](#retry-), so we'll create a retry handler and perform the query: - -```java -GraphClient client = ...; -Storefront.QueryRootQuery query = ...; -... - -client.queryGraph(query).enqueue( - new GraphCall.Callback() { - @Override public void onResponse(@NonNull final GraphResponse response) { - Storefront.Checkout checkout = (Storefront.Checkout) response.data().getNode(); - } - - @Override public void onFailure(@NonNull final GraphError error) { - } - }, - null, - RetryHandler.exponentialBackoff(800, TimeUnit.MILLISECONDS, 1.2f) - .whenResponse( - response -> ((Storefront.Checkout) response.data().getNode()).getReady() == false - ) - .maxCount(10) - .build() - ); -``` - -The callback `onResponse` will be called only if `checkout.ready == true` or the retry count reaches 10. - -##### Polling for shipping rates [⤴](#table-of-contents) - -Available shipping rates are specific to a checkout since the cost to ship items depends on the quantity, weight, and other attributes of the items in the checkout. Shipping rates also require a checkout to have a valid `shippingAddress`, which can be updated using steps found in [updating a checkout](#updating-a-checkout-). Available shipping rates are a field on `Storefront.Checkout`, so given a `checkoutId` (that we kept a reference to earlier) we can query for shipping rates: - -```java -ID checkoutId = ...; - -Storefront.QueryRootQuery query = Storefront.query(rootQuery -> rootQuery - .node(checkoutId, nodeQuery -> nodeQuery - .onCheckout(checkoutQuery -> checkoutQuery - .availableShippingRates(availableShippingRatesQuery -> availableShippingRatesQuery - .ready() - .shippingRates(shippingRateQuery -> shippingRateQuery - .handle() - .price() - .title() - ) - ) - ) - ) -); -``` - -The query above starts an asynchronous task on the server to fetch shipping rates from multiple shipping providers. Although the request might return immediately (network latency aside), it does not mean that the list of shipping rates is complete. This is indicated by the `ready` field in the query above. It is your application's responsibility to continue retrying this query until `ready == true`. The Buy SDK has [built-in support for retrying requests](#retry-), so we'll create a retry handler and perform the query: - -```java -GraphClient client = ...; -Storefront.QueryRootQuery query = ...; -... - -client.queryGraph(query).enqueue( - new GraphCall.Callback() { - @Override public void onResponse(@NonNull final GraphResponse response) { - Storefront.Checkout checkout = (Storefront.Checkout) response.data().getNode(); - List shippingRates = checkout.getAvailableShippingRates().getShippingRates(); - } - - @Override public void onFailure(@NonNull final GraphError error) { - } - }, - null, - RetryHandler.exponentialBackoff(800, TimeUnit.MILLISECONDS, 1.2f) - .whenResponse( - response -> ((Storefront.Checkout) response.data().getNode()).getAvailableShippingRates().getReady() == false - ) - .maxCount(5) - .build() - ); -``` - -The callback `onResponse` will be called only if `availableShippingRates.ready == true` or the retry count reaches 10. - -##### Updating shipping line [⤴](#table-of-contents) - -```java -ID checkoutId = ... -Storefront.ShippingRate shippingRate = ... -Storefront.mutation(m -> m.checkoutShippingLineUpdate(checkoutId, shippingRate.getHandle(), update -> - update.userErrors(errors -> errors.field().message()) -)) -``` - -#### Completing a checkout [⤴](#table-of-contents) - -After all required fields have been filled and the customer is ready to pay, you have three ways to complete the checkout and process the payment: - -- [Web](#web-checkout-) -- [Credit card](#credit-card-checkout-) -- [Google Pay](#google-pay-checkout-) - -##### Web checkout [⤴](#table-of-contents) - -The simplest way to complete a checkout is by redirecting the customer to a web view where they will be presented with the same flow that they're familiar with on the web. The `Storefront.Checkout` resource provides a `webUrl` that you can use to present a web view. - -**NOTE**: Although using web checkout is the simplest out of the three approaches, it can make it difficult to observe the checkout state. Since the web view doesn't provide any callbacks for various checkout states, you still need to [poll for checkout completion](#polling-for-checkout-completion-). - -##### Credit card checkout [⤴](#table-of-contents) - -The native credit card checkout offers the most conventional UX out of the three alternatives but is also requires the most effort to implement. You'll be required to implement UI for gathering your customers' name, email, address, payment information, and other fields required to complete checkout. - -Assuming your custom storefront has all the information it needs, the first step to completing a credit card checkout is to vault the provided credit card and exchange it for a payment token that will be used to complete the payment. Please reference the instructions for [vaulting a credit card](#card-vaulting-). - -After obtaining a credit card vault token, we can proceed to complete the checkout by creating a `CreditCardPaymentInput` and executing the mutation query: - -```java -GraphClient client = ...; -ID checkoutId = ...; -BigDecimal amount = ...; -String idempotencyKey = UUID.randomUUID().toString(); -Storefront.MailingAddressInput billingAddress = ...; -String creditCardVaultToken = ...; - -Storefront.CreditCardPaymentInput input = new Storefront.CreditCardPaymentInput(amount, idempotencyKey, billingAddress, - creditCardVaultToken); - -Storefront.MutationQuery query = Storefront.mutation(mutationQuery -> mutationQuery - .checkoutCompleteWithCreditCard(checkoutId, input, payloadQuery -> payloadQuery - .payment(paymentQuery -> paymentQuery - .ready() - .errorMessage() - ) - .checkout(checkoutQuery -> checkoutQuery - .ready() - ) - .userErrors(userErrorQuery -> userErrorQuery - .field() - .message() - ) - ) -); - -client.mutateGraph(query).enqueue(new GraphCall.Callback() { - @Override public void onResponse(@NonNull final GraphResponse response) { - if (!response.data().getCheckoutCompleteWithCreditCard().getUserErrors().isEmpty()) { - // handle user friendly errors - } else { - boolean checkoutReady = response.data().getCheckoutCompleteWithCreditCard().getCheckout().getReady(); - boolean paymentReady = response.data().getCheckoutCompleteWithCreditCard().getPayment().getReady(); - } - } - - @Override public void onFailure(@NonNull final GraphError error) { - // handle errors - } -}); -``` - -##### Google Pay checkout [⤴](#table-of-contents) - -With Google Pay token in-hand, we can complete the checkout: - -```java -GraphClient client = ...; -ID checkoutId = ...; -String idempotencyKey = UUID.randomUUID().toString(); -Storefront.MailingAddressInput billingAddressInput = ...; - -Storefront.TokenizedPaymentInput input = new Storefront.TokenizedPaymentInput(totalPrice, idempotencyKey, - billingAddressInput, "google_pay", googlePayToken).setIdentifier(paymentToken.publicKeyHash); - -Storefront.MutationQuery query = Storefront.mutation(mutationQuery -> mutationQuery - .checkoutCompleteWithTokenizedPayment(checkoutId, input, payloadQuery -> payloadQuery - .payment(paymentQuery -> paymentQuery - .ready() - .errorMessage() - ) - .checkout(checkoutQuery -> checkoutQuery - .ready() - ) - .userErrors(userErrorQuery -> userErrorQuery - .field() - .message() - ) - ) -); - -client.mutateGraph(query).enqueue(new GraphCall.Callback() { - @Override public void onResponse(@NonNull final GraphResponse response) { - if (!response.data().getCheckoutCompleteWithTokenizedPayment().getUserErrors().isEmpty()) { - // handle user friendly errors - } else { - boolean checkoutReady = response.data().getCheckoutCompleteWithTokenizedPayment().getCheckout().getReady(); - boolean paymentReady = response.data().getCheckoutCompleteWithTokenizedPayment().getPayment().getReady(); - } - } - - @Override public void onFailure(@NonNull final GraphError error) { - // handle errors - } -}); -``` - -#### Polling for checkout completion [⤴](#table-of-contents) - -After a successful `checkoutCompleteWith...` mutation, the checkout process starts. This process is usually short, but it isn't immediate. Because of this, polling is required to obtain an updated checkout in a `ready` state - with a `Storefront.Order`. - -```java -GraphClient client = ...; -ID paymentId = ...; - -Storefront.QueryRootQuery query = Storefront.query(rootQuery -> rootQuery - .node(paymentId, nodeQuery -> nodeQuery - .onPayment(paymentQuery -> paymentQuery - .checkout(checkoutQuery -> checkoutQuery - .order(orderQuery -> orderQuery - .processedAt() - .orderNumber() - .totalPrice())) - .errorMessage() - .ready() - ) - ) -); - -client.queryGraph(query).enqueue( - new GraphCall.Callback() { - @Override public void onResponse(@NonNull GraphResponse response) { - - Storefront.Payment payment = (Storefront.Payment) response.data().getNode(); - - if (payment.getErrorMessage() == null || payment.getErrorMessage().isEmpty()){ - Storefront.Checkout checkout = payment.getCheckout(); - String orderId = checkout.getOrder().getId().toString(); - } - else{ - String errorMessage = payment.getErrorMessage(); - } - - } - @Override public void onFailure(@NonNull GraphError error) { - } - }, - null, - RetryHandler.exponentialBackoff(500, TimeUnit.MILLISECONDS, 1.2f) - .whenResponse( - response -> ((Storefront.Payment) ((GraphResponse) response).data().getNode()).getReady() == false - ) - .maxCount(12) - .build() -); -``` - -Again, just like when [polling for available shipping rates](#polling-for-shipping-rates-), we need to create a `RetryHandler` to provide a condition upon which to retry the request. In this case, we're asserting that the `Storefront.Payment` is `false` an continue retrying the request if it is. - -**Support for 3D Secure:** - -If you are located in an area impacted by [PSD2](https://help.shopify.com/en/api/guides/3d-secure), then you need to implement 3D Secure payment processing into your app. To implement 3D Secure, Shopify has added the `next_action` property to the `Payment` resource. This property returns a URL that you can use to redirect the customer to for 3D secure authentication. To complete the redirect your app needs to implement a WebView interface. Your app also needs to poll the checkout until the payment is complete and the `ready` field on the `Payment` resource returns `true`. - -For a detailed guide, see [_Authenticating payments with 3D Secure_](https://help.shopify.com/en/api/guides/3d-secure). - ## Customer Accounts [⤴](#table-of-contents) Using the Buy SDK, you can build custom storefronts that let your customers create accounts, browse previously completed orders, and manage their information. Since most customer-related actions modify states on the server, they are performed using various `mutation` requests. Let's take a look at a few examples.