diff --git a/MobileBuy/buy3/gradle.properties b/MobileBuy/buy3/gradle.properties index a9e6e8ec..b7fe5f94 100644 --- a/MobileBuy/buy3/gradle.properties +++ b/MobileBuy/buy3/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=13.0.0 +VERSION_NAME=14.0.0 POM_ARTIFACT_ID=buy3 POM_GROUP_ID=com.shopify.mobilebuysdk 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 fdadf780..37e013b9 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 = "2022-04"; + public static final String API_VERSION = "2022-07"; public static QueryRootQuery query(QueryRootQueryDefinition queryDef) { return query(Collections.emptyList(), queryDef); @@ -876,108 +876,28 @@ public ArticleQuery metafield(String namespace, String key, MetafieldQueryDefini return this; } - public class MetafieldsArguments extends Arguments { - MetafieldsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Container for a set of metafields (maximum of 20 characters). - */ - public MetafieldsArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the first `n` elements from the list. - */ - public MetafieldsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public MetafieldsArguments 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 MetafieldsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public MetafieldsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Reverse the order of the underlying list. - */ - public MetafieldsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - } - - public interface MetafieldsArgumentsDefinition { - void define(MetafieldsArguments args); - } - - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - - */ - public ArticleQuery metafields(MetafieldConnectionQueryDefinition queryDef) { - return metafields(args -> {}, queryDef); - } - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - @Deprecated - public ArticleQuery metafields(MetafieldsArgumentsDefinition argsDef, MetafieldConnectionQueryDefinition queryDef) { + public ArticleQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { startField("metafields"); - MetafieldsArguments args = new MetafieldsArguments(_queryBuilder); - argsDef.define(args); - MetafieldsArguments.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 MetafieldConnectionQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -1144,7 +1064,17 @@ public Article(JsonObject fields) throws SchemaViolationError { } case "metafields": { - responseData.put(key, new MetafieldConnection(jsonAsObject(field.getValue(), key))); + 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; } @@ -1368,17 +1298,14 @@ public Article setMetafield(Metafield arg) { } /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public MetafieldConnection getMetafields() { - return (MetafieldConnection) get("metafields"); + public List getMetafields() { + return (List) get("metafields"); } - public Article setMetafields(MetafieldConnection arg) { + public Article setMetafields(List arg) { optimisticData.put(getKey("metafields"), arg); return this; } @@ -2761,108 +2688,28 @@ public BlogQuery metafield(String namespace, String key, MetafieldQueryDefinitio return this; } - public class MetafieldsArguments extends Arguments { - MetafieldsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Container for a set of metafields (maximum of 20 characters). - */ - public MetafieldsArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the first `n` elements from the list. - */ - public MetafieldsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public MetafieldsArguments 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 MetafieldsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public MetafieldsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Reverse the order of the underlying list. - */ - public MetafieldsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - } - - public interface MetafieldsArgumentsDefinition { - void define(MetafieldsArguments args); - } - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public BlogQuery metafields(MetafieldConnectionQueryDefinition queryDef) { - return metafields(args -> {}, queryDef); - } - - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - - */ - @Deprecated - public BlogQuery metafields(MetafieldsArgumentsDefinition argsDef, MetafieldConnectionQueryDefinition queryDef) { + public BlogQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { startField("metafields"); - MetafieldsArguments args = new MetafieldsArguments(_queryBuilder); - argsDef.define(args); - MetafieldsArguments.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 MetafieldConnectionQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -2965,7 +2812,17 @@ public Blog(JsonObject fields) throws SchemaViolationError { } case "metafields": { - responseData.put(key, new MetafieldConnection(jsonAsObject(field.getValue(), key))); + 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; } @@ -3092,17 +2949,14 @@ public Blog setMetafield(Metafield arg) { } /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public MetafieldConnection getMetafields() { - return (MetafieldConnection) get("metafields"); + public List getMetafields() { + return (List) get("metafields"); } - public Blog setMetafields(MetafieldConnection arg) { + public Blog setMetafields(List arg) { optimisticData.put(getKey("metafields"), arg); return this; } @@ -3643,6 +3497,24 @@ public static class CartQuery extends Query { startField("id"); } + /** + * An attribute associated with the cart. + */ + public CartQuery attribute(String key, AttributeQueryDefinition queryDef) { + startField("attribute"); + + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new AttributeQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + /** * The attributes associated with the cart. Attributes are represented as key-value pairs. */ @@ -3678,6 +3550,21 @@ public CartQuery checkoutUrl() { return this; } + /** + * The estimated costs that the buyer will pay at checkout. The costs are subject to change and changes + * will be reflected at checkout. The `cost` field uses the `buyerIdentity` field to determine + * [international pricing](https://shopify.dev/api/examples/international-pricing#create-a-cart). + */ + public CartQuery cost(CartCostQueryDefinition queryDef) { + startField("cost"); + + _queryBuilder.append('{'); + queryDef.define(new CartCostQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + /** * The date and time when the cart was created. */ @@ -3777,7 +3664,20 @@ public CartQuery deliveryGroups(DeliveryGroupsArgumentsDefinition argsDef, CartD } /** - * The discount codes that have been applied to the cart. + * The discounts that have been applied to the entire cart. + */ + public CartQuery discountAllocations(CartDiscountAllocationQueryDefinition queryDef) { + startField("discountAllocations"); + + _queryBuilder.append('{'); + queryDef.define(new CartDiscountAllocationQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The case-insensitive discount codes that the customer added at checkout. */ public CartQuery discountCodes(CartDiscountCodeQueryDefinition queryDef) { startField("discountCodes"); @@ -3794,7 +3694,10 @@ public CartQuery discountCodes(CartDiscountCodeQueryDefinition queryDef) { * and changes will be reflected at checkout. The `estimatedCost` field uses the `buyerIdentity` field * to determine [international * pricing](https://shopify.dev/api/examples/international-pricing#create-a-cart). + * + * @deprecated Use `cost` instead */ + @Deprecated public CartQuery estimatedCost(CartEstimatedCostQueryDefinition queryDef) { startField("estimatedCost"); @@ -3904,6 +3807,15 @@ public CartQuery note() { return this; } + /** + * The total number of items in the cart. + */ + public CartQuery totalQuantity() { + startField("totalQuantity"); + + return this; + } + /** * The date and time when the cart was updated. */ @@ -3928,6 +3840,17 @@ public Cart(JsonObject fields) throws SchemaViolationError { 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 "attributes": { List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { @@ -3951,6 +3874,12 @@ public Cart(JsonObject fields) throws SchemaViolationError { break; } + case "cost": { + responseData.put(key, new CartCost(jsonAsObject(field.getValue(), key))); + + break; + } + case "createdAt": { responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); @@ -3963,6 +3892,17 @@ public Cart(JsonObject fields) throws SchemaViolationError { 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 "discountCodes": { List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { @@ -4003,6 +3943,12 @@ public Cart(JsonObject fields) throws SchemaViolationError { break; } + case "totalQuantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); + + break; + } + case "updatedAt": { responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); @@ -4029,6 +3975,19 @@ public String getGraphQlTypeName() { return "Cart"; } + /** + * An attribute associated with the cart. + */ + + public Attribute getAttribute() { + return (Attribute) get("attribute"); + } + + public Cart setAttribute(Attribute arg) { + optimisticData.put(getKey("attribute"), arg); + return this; + } + /** * The attributes associated with the cart. Attributes are represented as key-value pairs. */ @@ -4068,6 +4027,21 @@ public Cart setCheckoutUrl(String arg) { return this; } + /** + * The estimated costs that the buyer will pay at checkout. The costs are subject to change and changes + * will be reflected at checkout. The `cost` field uses the `buyerIdentity` field to determine + * [international pricing](https://shopify.dev/api/examples/international-pricing#create-a-cart). + */ + + public CartCost getCost() { + return (CartCost) get("cost"); + } + + public Cart setCost(CartCost arg) { + optimisticData.put(getKey("cost"), arg); + return this; + } + /** * The date and time when the cart was created. */ @@ -4095,7 +4069,20 @@ public Cart setDeliveryGroups(CartDeliveryGroupConnection arg) { } /** - * The discount codes that have been applied to the cart. + * The discounts that have been applied to the entire cart. + */ + + public List getDiscountAllocations() { + return (List) get("discountAllocations"); + } + + public Cart setDiscountAllocations(List arg) { + optimisticData.put(getKey("discountAllocations"), arg); + return this; + } + + /** + * The case-insensitive discount codes that the customer added at checkout. */ public List getDiscountCodes() { @@ -4112,6 +4099,8 @@ public Cart setDiscountCodes(List arg) { * and changes will be reflected at checkout. The `estimatedCost` field uses the `buyerIdentity` field * to determine [international * pricing](https://shopify.dev/api/examples/international-pricing#create-a-cart). + * + * @deprecated Use `cost` instead */ public CartEstimatedCost getEstimatedCost() { @@ -4158,6 +4147,19 @@ public Cart setNote(String arg) { return this; } + /** + * The total number of items in the cart. + */ + + public Integer getTotalQuantity() { + return (Integer) get("totalQuantity"); + } + + public Cart setTotalQuantity(Integer arg) { + optimisticData.put(getKey("totalQuantity"), arg); + return this; + } + /** * The date and time when the cart was updated. */ @@ -4173,16 +4175,22 @@ public Cart setUpdatedAt(DateTime arg) { public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { + case "attribute": return true; + case "attributes": return true; case "buyerIdentity": return true; case "checkoutUrl": return false; + case "cost": return true; + case "createdAt": return false; case "deliveryGroups": return true; + case "discountAllocations": return false; + case "discountCodes": return true; case "estimatedCost": return true; @@ -4193,6 +4201,8 @@ public boolean unwrapsToObject(String key) { case "note": return false; + case "totalQuantity": return false; + case "updatedAt": return false; default: return false; @@ -5008,6 +5018,363 @@ public boolean unwrapsToObject(String key) { } } + public interface CartCostQueryDefinition { + void define(CartCostQuery _queryBuilder); + } + + /** + * The costs that the buyer will pay at checkout. + * It uses [`CartBuyerIdentity`](https://shopify.dev/api/storefront/reference/cart/cartbuyeridentity) + * to determine + * [international pricing](https://shopify.dev/api/examples/international-pricing#create-a-cart). + */ + public static class CartCostQuery extends Query { + CartCostQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The estimated amount, before taxes and discounts, for the customer to pay at checkout. The checkout + * charge amount doesn't include any deferred payments that'll be paid at a later date. If the cart has + * no deferred payments, the checkout charge amount is equivalent to subtotalAmount. + */ + public CartCostQuery checkoutChargeAmount(MoneyV2QueryDefinition queryDef) { + startField("checkoutChargeAmount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The amount, before taxes and cart-level discounts, for the customer to pay. + */ + public CartCostQuery subtotalAmount(MoneyV2QueryDefinition queryDef) { + startField("subtotalAmount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * Whether or not the subtotal amount is estimated. + */ + public CartCostQuery subtotalAmountEstimated() { + startField("subtotalAmountEstimated"); + + return this; + } + + /** + * The total amount for the customer to pay. + */ + public CartCostQuery totalAmount(MoneyV2QueryDefinition queryDef) { + startField("totalAmount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * Whether or not the total amount is estimated. + */ + public CartCostQuery totalAmountEstimated() { + startField("totalAmountEstimated"); + + return this; + } + + /** + * The duty amount for the customer to pay at checkout. + */ + public CartCostQuery totalDutyAmount(MoneyV2QueryDefinition queryDef) { + startField("totalDutyAmount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * Whether or not the total duty amount is estimated. + */ + public CartCostQuery totalDutyAmountEstimated() { + startField("totalDutyAmountEstimated"); + + return this; + } + + /** + * The tax amount for the customer to pay at checkout. + */ + public CartCostQuery totalTaxAmount(MoneyV2QueryDefinition queryDef) { + startField("totalTaxAmount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * Whether or not the total tax amount is estimated. + */ + public CartCostQuery totalTaxAmountEstimated() { + startField("totalTaxAmountEstimated"); + + return this; + } + } + + /** + * The costs that the buyer will pay at checkout. + * It uses [`CartBuyerIdentity`](https://shopify.dev/api/storefront/reference/cart/cartbuyeridentity) + * to determine + * [international pricing](https://shopify.dev/api/examples/international-pricing#create-a-cart). + */ + public static class CartCost extends AbstractResponse { + public CartCost() { + } + + public CartCost(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))); + + break; + } + + case "subtotalAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "subtotalAmountEstimated": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); + + break; + } + + case "totalAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "totalAmountEstimated": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); + + break; + } + + case "totalDutyAmount": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "totalDutyAmountEstimated": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); + + break; + } + + case "totalTaxAmount": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "totalTaxAmountEstimated": { + 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 "CartCost"; + } + + /** + * The estimated amount, before taxes and discounts, for the customer to pay at checkout. The checkout + * charge amount doesn't include any deferred payments that'll be paid at a later date. If the cart has + * no deferred payments, the checkout charge amount is equivalent to subtotalAmount. + */ + + public MoneyV2 getCheckoutChargeAmount() { + return (MoneyV2) get("checkoutChargeAmount"); + } + + public CartCost setCheckoutChargeAmount(MoneyV2 arg) { + optimisticData.put(getKey("checkoutChargeAmount"), arg); + return this; + } + + /** + * The amount, before taxes and cart-level discounts, for the customer to pay. + */ + + public MoneyV2 getSubtotalAmount() { + return (MoneyV2) get("subtotalAmount"); + } + + public CartCost setSubtotalAmount(MoneyV2 arg) { + optimisticData.put(getKey("subtotalAmount"), arg); + return this; + } + + /** + * Whether or not the subtotal amount is estimated. + */ + + public Boolean getSubtotalAmountEstimated() { + return (Boolean) get("subtotalAmountEstimated"); + } + + public CartCost setSubtotalAmountEstimated(Boolean arg) { + optimisticData.put(getKey("subtotalAmountEstimated"), arg); + return this; + } + + /** + * The total amount for the customer to pay. + */ + + public MoneyV2 getTotalAmount() { + return (MoneyV2) get("totalAmount"); + } + + public CartCost setTotalAmount(MoneyV2 arg) { + optimisticData.put(getKey("totalAmount"), arg); + return this; + } + + /** + * Whether or not the total amount is estimated. + */ + + public Boolean getTotalAmountEstimated() { + return (Boolean) get("totalAmountEstimated"); + } + + public CartCost setTotalAmountEstimated(Boolean arg) { + optimisticData.put(getKey("totalAmountEstimated"), arg); + return this; + } + + /** + * The duty amount for the customer to pay at checkout. + */ + + public MoneyV2 getTotalDutyAmount() { + return (MoneyV2) get("totalDutyAmount"); + } + + public CartCost setTotalDutyAmount(MoneyV2 arg) { + optimisticData.put(getKey("totalDutyAmount"), arg); + return this; + } + + /** + * Whether or not the total duty amount is estimated. + */ + + public Boolean getTotalDutyAmountEstimated() { + return (Boolean) get("totalDutyAmountEstimated"); + } + + public CartCost setTotalDutyAmountEstimated(Boolean arg) { + optimisticData.put(getKey("totalDutyAmountEstimated"), arg); + return this; + } + + /** + * The tax amount for the customer to pay at checkout. + */ + + public MoneyV2 getTotalTaxAmount() { + return (MoneyV2) get("totalTaxAmount"); + } + + public CartCost setTotalTaxAmount(MoneyV2 arg) { + optimisticData.put(getKey("totalTaxAmount"), arg); + return this; + } + + /** + * Whether or not the total tax amount is estimated. + */ + + public Boolean getTotalTaxAmountEstimated() { + return (Boolean) get("totalTaxAmountEstimated"); + } + + public CartCost setTotalTaxAmountEstimated(Boolean arg) { + optimisticData.put(getKey("totalTaxAmountEstimated"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "checkoutChargeAmount": return true; + + case "subtotalAmount": return true; + + case "subtotalAmountEstimated": return false; + + case "totalAmount": return true; + + case "totalAmountEstimated": return false; + + case "totalDutyAmount": return true; + + case "totalDutyAmountEstimated": return false; + + case "totalTaxAmount": return true; + + case "totalTaxAmountEstimated": return false; + + default: return false; + } + } + } + public interface CartCreatePayloadQueryDefinition { void define(CartCreatePayloadQuery _queryBuilder); } @@ -5133,6 +5500,117 @@ public boolean unwrapsToObject(String key) { } } + public interface CartCustomDiscountAllocationQueryDefinition { + void define(CartCustomDiscountAllocationQuery _queryBuilder); + } + + /** + * The discounts automatically applied to the cart line based on prerequisites that have been met. + */ + public static class CartCustomDiscountAllocationQuery extends Query { + CartCustomDiscountAllocationQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The discounted amount that has been applied to the cart line. + */ + public CartCustomDiscountAllocationQuery discountedAmount(MoneyV2QueryDefinition queryDef) { + startField("discountedAmount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The title of the allocated discount. + */ + public CartCustomDiscountAllocationQuery title() { + startField("title"); + + return this; + } + } + + /** + * The discounts automatically applied to the cart line based on prerequisites that have been met. + */ + public static class CartCustomDiscountAllocation extends AbstractResponse implements CartDiscountAllocation { + public CartCustomDiscountAllocation() { + } + + public CartCustomDiscountAllocation(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "discountedAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "title": { + 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 "CartCustomDiscountAllocation"; + } + + /** + * The discounted amount that has been applied to the cart line. + */ + + public MoneyV2 getDiscountedAmount() { + return (MoneyV2) get("discountedAmount"); + } + + public CartCustomDiscountAllocation setDiscountedAmount(MoneyV2 arg) { + optimisticData.put(getKey("discountedAmount"), arg); + return this; + } + + /** + * The title of the allocated discount. + */ + + public String getTitle() { + return (String) get("title"); + } + + public CartCustomDiscountAllocation setTitle(String arg) { + optimisticData.put(getKey("title"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "discountedAmount": return true; + + case "title": return false; + + default: return false; + } + } + } + public interface CartDeliveryGroupQueryDefinition { void define(CartDeliveryGroupQuery _queryBuilder); } @@ -5921,6 +6399,13 @@ public CartDiscountAllocationQuery onCartCodeDiscountAllocation(CartCodeDiscount _queryBuilder.append('}'); return this; } + + public CartDiscountAllocationQuery onCartCustomDiscountAllocation(CartCustomDiscountAllocationQueryDefinition queryDef) { + startInlineFragment("CartCustomDiscountAllocation"); + queryDef.define(new CartCustomDiscountAllocationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } } public interface CartDiscountAllocation { @@ -5969,6 +6454,10 @@ public static CartDiscountAllocation create(JsonObject fields) throws SchemaViol return new CartCodeDiscountAllocation(fields); } + case "CartCustomDiscountAllocation": { + return new CartCustomDiscountAllocation(fields); + } + default: { return new UnknownCartDiscountAllocation(fields); } @@ -6340,7 +6829,22 @@ public static class CartEstimatedCostQuery extends Query } /** - * The estimated amount, before taxes and discounts, for the customer to pay at checkout. + * The estimated amount, before taxes and discounts, for the customer to pay at checkout. The checkout + * charge amount doesn't include any deferred payments that'll be paid at a later date. If the cart has + * no deferred payments, then the checkout charge amount is equivalent to`subtotal_amount`. + */ + public CartEstimatedCostQuery checkoutChargeAmount(MoneyV2QueryDefinition queryDef) { + startField("checkoutChargeAmount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The estimated amount, before taxes and discounts, for the customer to pay. */ public CartEstimatedCostQuery subtotalAmount(MoneyV2QueryDefinition queryDef) { startField("subtotalAmount"); @@ -6353,7 +6857,7 @@ public CartEstimatedCostQuery subtotalAmount(MoneyV2QueryDefinition queryDef) { } /** - * The estimated total amount for the customer to pay at checkout. + * The estimated total amount for the customer to pay. */ public CartEstimatedCostQuery totalAmount(MoneyV2QueryDefinition queryDef) { startField("totalAmount"); @@ -6407,6 +6911,12 @@ public CartEstimatedCost(JsonObject fields) throws SchemaViolationError { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { + case "checkoutChargeAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + case "subtotalAmount": { responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); @@ -6457,7 +6967,22 @@ public String getGraphQlTypeName() { } /** - * The estimated amount, before taxes and discounts, for the customer to pay at checkout. + * The estimated amount, before taxes and discounts, for the customer to pay at checkout. The checkout + * charge amount doesn't include any deferred payments that'll be paid at a later date. If the cart has + * no deferred payments, then the checkout charge amount is equivalent to`subtotal_amount`. + */ + + public MoneyV2 getCheckoutChargeAmount() { + return (MoneyV2) get("checkoutChargeAmount"); + } + + public CartEstimatedCost setCheckoutChargeAmount(MoneyV2 arg) { + optimisticData.put(getKey("checkoutChargeAmount"), arg); + return this; + } + + /** + * The estimated amount, before taxes and discounts, for the customer to pay. */ public MoneyV2 getSubtotalAmount() { @@ -6470,7 +6995,7 @@ public CartEstimatedCost setSubtotalAmount(MoneyV2 arg) { } /** - * The estimated total amount for the customer to pay at checkout. + * The estimated total amount for the customer to pay. */ public MoneyV2 getTotalAmount() { @@ -6510,6 +7035,8 @@ public CartEstimatedCost setTotalTaxAmount(MoneyV2 arg) { public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { + case "checkoutChargeAmount": return true; + case "subtotalAmount": return true; case "totalAmount": return true; @@ -6743,6 +7270,24 @@ public static class CartLineQuery extends Query { startField("id"); } + /** + * An attribute associated with the cart line. + */ + public CartLineQuery attribute(String key, AttributeQueryDefinition queryDef) { + startField("attribute"); + + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new AttributeQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + /** * The attributes associated with the cart line. Attributes are represented as key-value pairs. */ @@ -6756,6 +7301,20 @@ public CartLineQuery attributes(AttributeQueryDefinition queryDef) { return this; } + /** + * 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 CartLineQuery cost(CartLineCostQueryDefinition queryDef) { + startField("cost"); + + _queryBuilder.append('{'); + queryDef.define(new CartLineCostQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + /** * The discounts that have been applied to the cart line. */ @@ -6772,7 +7331,10 @@ public CartLineQuery discountAllocations(CartDiscountAllocationQueryDefinition q /** * 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 CartLineQuery estimatedCost(CartLineEstimatedCostQueryDefinition queryDef) { startField("estimatedCost"); @@ -6832,6 +7394,17 @@ public CartLine(JsonObject fields) throws SchemaViolationError { 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 "attributes": { List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { @@ -6843,6 +7416,12 @@ public CartLine(JsonObject fields) throws SchemaViolationError { 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)) { @@ -6909,6 +7488,19 @@ public String getGraphQlTypeName() { return "CartLine"; } + /** + * An attribute associated with the cart line. + */ + + public Attribute getAttribute() { + return (Attribute) get("attribute"); + } + + public CartLine setAttribute(Attribute arg) { + optimisticData.put(getKey("attribute"), arg); + return this; + } + /** * The attributes associated with the cart line. Attributes are represented as key-value pairs. */ @@ -6922,6 +7514,20 @@ public CartLine setAttributes(List arg) { return this; } + /** + * 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 CartLineCost getCost() { + return (CartLineCost) get("cost"); + } + + public CartLine setCost(CartLineCost arg) { + optimisticData.put(getKey("cost"), arg); + return this; + } + /** * The discounts that have been applied to the cart line. */ @@ -6938,6 +7544,8 @@ public CartLine setDiscountAllocations(List arg) { /** * 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 */ public CartLineEstimatedCost getEstimatedCost() { @@ -6999,8 +7607,12 @@ public CartLine setSellingPlanAllocation(SellingPlanAllocation arg) { public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { + case "attribute": return true; + case "attributes": return true; + case "cost": return true; + case "discountAllocations": return false; case "estimatedCost": return true; @@ -7177,133 +7789,48 @@ public boolean unwrapsToObject(String key) { } } - public interface CartLineEdgeQueryDefinition { - void define(CartLineEdgeQuery _queryBuilder); + public interface CartLineCostQueryDefinition { + void define(CartLineCostQuery _queryBuilder); } /** - * An auto-generated type which holds one CartLine and a cursor during pagination. + * The cost of the merchandise line that the buyer will pay at checkout. */ - public static class CartLineEdgeQuery extends Query { - CartLineEdgeQuery(StringBuilder _queryBuilder) { + public static class CartLineCostQuery extends Query { + CartLineCostQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A cursor for use in pagination. - */ - public CartLineEdgeQuery cursor() { - startField("cursor"); - - return this; - } - - /** - * The item at the end of CartLineEdge. + * The amount of the merchandise line. */ - public CartLineEdgeQuery node(CartLineQueryDefinition queryDef) { - startField("node"); + public CartLineCostQuery amountPerQuantity(MoneyV2QueryDefinition queryDef) { + startField("amountPerQuantity"); _queryBuilder.append('{'); - queryDef.define(new CartLineQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } - } - - /** - * An auto-generated type which holds one CartLine and a cursor during pagination. - */ - public static class CartLineEdge extends AbstractResponse { - public CartLineEdge() { - } - - public CartLineEdge(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 CartLine(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 "CartLineEdge"; - } - - /** - * A cursor for use in pagination. - */ - - public String getCursor() { - return (String) get("cursor"); - } - - public CartLineEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; - } /** - * The item at the end of CartLineEdge. + * The compare at amount of the merchandise line. */ + public CartLineCostQuery compareAtAmountPerQuantity(MoneyV2QueryDefinition queryDef) { + startField("compareAtAmountPerQuantity"); - public CartLine getNode() { - return (CartLine) get("node"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public CartLineEdge setNode(CartLine 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 CartLineEstimatedCostQueryDefinition { - void define(CartLineEstimatedCostQuery _queryBuilder); - } - - /** - * The estimated cost of the merchandise line that the buyer will pay at checkout. - */ - public static class CartLineEstimatedCostQuery extends Query { - CartLineEstimatedCostQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - /** - * The estimated cost of the merchandise line before discounts. + * The cost of the merchandise line before line-level discounts. */ - public CartLineEstimatedCostQuery subtotalAmount(MoneyV2QueryDefinition queryDef) { + public CartLineCostQuery subtotalAmount(MoneyV2QueryDefinition queryDef) { startField("subtotalAmount"); _queryBuilder.append('{'); @@ -7314,9 +7841,9 @@ public CartLineEstimatedCostQuery subtotalAmount(MoneyV2QueryDefinition queryDef } /** - * The estimated total cost of the merchandise line. + * The total cost of the merchandise line. */ - public CartLineEstimatedCostQuery totalAmount(MoneyV2QueryDefinition queryDef) { + public CartLineCostQuery totalAmount(MoneyV2QueryDefinition queryDef) { startField("totalAmount"); _queryBuilder.append('{'); @@ -7328,17 +7855,333 @@ public CartLineEstimatedCostQuery totalAmount(MoneyV2QueryDefinition queryDef) { } /** - * The estimated cost of the merchandise line that the buyer will pay at checkout. + * The cost of the merchandise line that the buyer will pay at checkout. */ - public static class CartLineEstimatedCost extends AbstractResponse { - public CartLineEstimatedCost() { + public static class CartLineCost extends AbstractResponse { + public CartLineCost() { } - public CartLineEstimatedCost(JsonObject fields) throws SchemaViolationError { + public CartLineCost(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { + case "amountPerQuantity": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "compareAtAmountPerQuantity": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "subtotalAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "totalAmount": { + 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 "CartLineCost"; + } + + /** + * The amount of the merchandise line. + */ + + public MoneyV2 getAmountPerQuantity() { + return (MoneyV2) get("amountPerQuantity"); + } + + public CartLineCost setAmountPerQuantity(MoneyV2 arg) { + optimisticData.put(getKey("amountPerQuantity"), arg); + return this; + } + + /** + * The compare at amount of the merchandise line. + */ + + public MoneyV2 getCompareAtAmountPerQuantity() { + return (MoneyV2) get("compareAtAmountPerQuantity"); + } + + public CartLineCost setCompareAtAmountPerQuantity(MoneyV2 arg) { + optimisticData.put(getKey("compareAtAmountPerQuantity"), arg); + return this; + } + + /** + * The cost of the merchandise line before line-level discounts. + */ + + public MoneyV2 getSubtotalAmount() { + return (MoneyV2) get("subtotalAmount"); + } + + public CartLineCost setSubtotalAmount(MoneyV2 arg) { + optimisticData.put(getKey("subtotalAmount"), arg); + return this; + } + + /** + * The total cost of the merchandise line. + */ + + public MoneyV2 getTotalAmount() { + return (MoneyV2) get("totalAmount"); + } + + public CartLineCost setTotalAmount(MoneyV2 arg) { + optimisticData.put(getKey("totalAmount"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "amountPerQuantity": return true; + + case "compareAtAmountPerQuantity": return true; + + case "subtotalAmount": return true; + + case "totalAmount": return true; + + default: return false; + } + } + } + + public interface CartLineEdgeQueryDefinition { + void define(CartLineEdgeQuery _queryBuilder); + } + + /** + * An auto-generated type which holds one CartLine and a cursor during pagination. + */ + public static class CartLineEdgeQuery extends Query { + CartLineEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * A cursor for use in pagination. + */ + public CartLineEdgeQuery cursor() { + startField("cursor"); + + return this; + } + + /** + * The item at the end of CartLineEdge. + */ + public CartLineEdgeQuery node(CartLineQueryDefinition queryDef) { + startField("node"); + + _queryBuilder.append('{'); + queryDef.define(new CartLineQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * An auto-generated type which holds one CartLine and a cursor during pagination. + */ + public static class CartLineEdge extends AbstractResponse { + public CartLineEdge() { + } + + public CartLineEdge(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 CartLine(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 "CartLineEdge"; + } + + /** + * A cursor for use in pagination. + */ + + public String getCursor() { + return (String) get("cursor"); + } + + public CartLineEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); + return this; + } + + /** + * The item at the end of CartLineEdge. + */ + + public CartLine getNode() { + return (CartLine) get("node"); + } + + public CartLineEdge setNode(CartLine 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 CartLineEstimatedCostQueryDefinition { + void define(CartLineEstimatedCostQuery _queryBuilder); + } + + /** + * The estimated cost of the merchandise line that the buyer will pay at checkout. + */ + public static class CartLineEstimatedCostQuery extends Query { + CartLineEstimatedCostQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The amount of the merchandise line. + */ + public CartLineEstimatedCostQuery amount(MoneyV2QueryDefinition queryDef) { + startField("amount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The compare at amount of the merchandise line. + */ + public CartLineEstimatedCostQuery compareAtAmount(MoneyV2QueryDefinition queryDef) { + startField("compareAtAmount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The estimated cost of the merchandise line before discounts. + */ + public CartLineEstimatedCostQuery subtotalAmount(MoneyV2QueryDefinition queryDef) { + startField("subtotalAmount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The estimated total cost of the merchandise line. + */ + public CartLineEstimatedCostQuery totalAmount(MoneyV2QueryDefinition queryDef) { + startField("totalAmount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * The estimated cost of the merchandise line that the buyer will pay at checkout. + */ + public static class CartLineEstimatedCost extends AbstractResponse { + public CartLineEstimatedCost() { + } + + public CartLineEstimatedCost(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 "compareAtAmount": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + case "subtotalAmount": { responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); @@ -7366,6 +8209,32 @@ public String getGraphQlTypeName() { return "CartLineEstimatedCost"; } + /** + * The amount of the merchandise line. + */ + + public MoneyV2 getAmount() { + return (MoneyV2) get("amount"); + } + + public CartLineEstimatedCost setAmount(MoneyV2 arg) { + optimisticData.put(getKey("amount"), arg); + return this; + } + + /** + * The compare at amount of the merchandise line. + */ + + public MoneyV2 getCompareAtAmount() { + return (MoneyV2) get("compareAtAmount"); + } + + public CartLineEstimatedCost setCompareAtAmount(MoneyV2 arg) { + optimisticData.put(getKey("compareAtAmount"), arg); + return this; + } + /** * The estimated cost of the merchandise line before discounts. */ @@ -7394,6 +8263,10 @@ public CartLineEstimatedCost setTotalAmount(MoneyV2 arg) { public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { + case "amount": return true; + + case "compareAtAmount": return true; + case "subtotalAmount": return true; case "totalAmount": return true; @@ -9711,290 +10584,6 @@ public boolean unwrapsToObject(String key) { } } - public static class CheckoutAttributesUpdateInput implements Serializable { - private Input note = Input.undefined(); - - private Input> customAttributes = Input.undefined(); - - private Input allowPartialAddresses = Input.undefined(); - - public String getNote() { - return note.getValue(); - } - - public Input getNoteInput() { - return note; - } - - public CheckoutAttributesUpdateInput setNote(String note) { - this.note = Input.optional(note); - return this; - } - - public CheckoutAttributesUpdateInput 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 CheckoutAttributesUpdateInput setCustomAttributes(List customAttributes) { - this.customAttributes = Input.optional(customAttributes); - return this; - } - - public CheckoutAttributesUpdateInput 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 CheckoutAttributesUpdateInput setAllowPartialAddresses(Boolean allowPartialAddresses) { - this.allowPartialAddresses = Input.optional(allowPartialAddresses); - return this; - } - - public CheckoutAttributesUpdateInput setAllowPartialAddressesInput(Input allowPartialAddresses) { - if (allowPartialAddresses == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.allowPartialAddresses = allowPartialAddresses; - return this; - } - - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - 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"); - } - } - - _queryBuilder.append('}'); - } - } - - public interface CheckoutAttributesUpdatePayloadQueryDefinition { - void define(CheckoutAttributesUpdatePayloadQuery _queryBuilder); - } - - /** - * Return type for `checkoutAttributesUpdate` mutation. - */ - public static class CheckoutAttributesUpdatePayloadQuery extends Query { - CheckoutAttributesUpdatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The updated checkout object. - */ - public CheckoutAttributesUpdatePayloadQuery 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 CheckoutAttributesUpdatePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - @Deprecated - public CheckoutAttributesUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * Return type for `checkoutAttributesUpdate` mutation. - */ - public static class CheckoutAttributesUpdatePayload extends AbstractResponse { - public CheckoutAttributesUpdatePayload() { - } - - public CheckoutAttributesUpdatePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - responseData.put(key, new Checkout(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); - - 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 getGraphQlTypeName() { - return "CheckoutAttributesUpdatePayload"; - } - - /** - * The updated checkout object. - */ - - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } - - public CheckoutAttributesUpdatePayload 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 CheckoutAttributesUpdatePayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - - public List getUserErrors() { - return (List) get("userErrors"); - } - - public CheckoutAttributesUpdatePayload 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 static class CheckoutAttributesUpdateV2Input implements Serializable { private Input note = Input.undefined(); @@ -10564,22 +11153,22 @@ public boolean unwrapsToObject(String key) { } } - public interface CheckoutCompleteWithCreditCardPayloadQueryDefinition { - void define(CheckoutCompleteWithCreditCardPayloadQuery _queryBuilder); + public interface CheckoutCompleteWithCreditCardV2PayloadQueryDefinition { + void define(CheckoutCompleteWithCreditCardV2PayloadQuery _queryBuilder); } /** - * Return type for `checkoutCompleteWithCreditCard` mutation. + * Return type for `checkoutCompleteWithCreditCardV2` mutation. */ - public static class CheckoutCompleteWithCreditCardPayloadQuery extends Query { - CheckoutCompleteWithCreditCardPayloadQuery(StringBuilder _queryBuilder) { + public static class CheckoutCompleteWithCreditCardV2PayloadQuery extends Query { + CheckoutCompleteWithCreditCardV2PayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * The checkout on which the payment was applied. */ - public CheckoutCompleteWithCreditCardPayloadQuery checkout(CheckoutQueryDefinition queryDef) { + public CheckoutCompleteWithCreditCardV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { startField("checkout"); _queryBuilder.append('{'); @@ -10592,7 +11181,7 @@ public CheckoutCompleteWithCreditCardPayloadQuery checkout(CheckoutQueryDefiniti /** * The list of errors that occurred from executing the mutation. */ - public CheckoutCompleteWithCreditCardPayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + public CheckoutCompleteWithCreditCardV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { startField("checkoutUserErrors"); _queryBuilder.append('{'); @@ -10605,7 +11194,7 @@ public CheckoutCompleteWithCreditCardPayloadQuery checkoutUserErrors(CheckoutUse /** * A representation of the attempted payment. */ - public CheckoutCompleteWithCreditCardPayloadQuery payment(PaymentQueryDefinition queryDef) { + public CheckoutCompleteWithCreditCardV2PayloadQuery payment(PaymentQueryDefinition queryDef) { startField("payment"); _queryBuilder.append('{'); @@ -10621,7 +11210,7 @@ public CheckoutCompleteWithCreditCardPayloadQuery payment(PaymentQueryDefinition * @deprecated Use `checkoutUserErrors` instead */ @Deprecated - public CheckoutCompleteWithCreditCardPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + public CheckoutCompleteWithCreditCardV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { startField("userErrors"); _queryBuilder.append('{'); @@ -10633,19 +11222,24 @@ public CheckoutCompleteWithCreditCardPayloadQuery userErrors(UserErrorQueryDefin } /** - * Return type for `checkoutCompleteWithCreditCard` mutation. + * Return type for `checkoutCompleteWithCreditCardV2` mutation. */ - public static class CheckoutCompleteWithCreditCardPayload extends AbstractResponse { - public CheckoutCompleteWithCreditCardPayload() { + public static class CheckoutCompleteWithCreditCardV2Payload extends AbstractResponse { + public CheckoutCompleteWithCreditCardV2Payload() { } - public CheckoutCompleteWithCreditCardPayload(JsonObject fields) throws SchemaViolationError { + public CheckoutCompleteWithCreditCardV2Payload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { case "checkout": { - responseData.put(key, new Checkout(jsonAsObject(field.getValue(), key))); + Checkout optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } @@ -10695,7 +11289,7 @@ public CheckoutCompleteWithCreditCardPayload(JsonObject fields) throws SchemaVio } public String getGraphQlTypeName() { - return "CheckoutCompleteWithCreditCardPayload"; + return "CheckoutCompleteWithCreditCardV2Payload"; } /** @@ -10706,7 +11300,7 @@ public Checkout getCheckout() { return (Checkout) get("checkout"); } - public CheckoutCompleteWithCreditCardPayload setCheckout(Checkout arg) { + public CheckoutCompleteWithCreditCardV2Payload setCheckout(Checkout arg) { optimisticData.put(getKey("checkout"), arg); return this; } @@ -10719,7 +11313,7 @@ public List getCheckoutUserErrors() { return (List) get("checkoutUserErrors"); } - public CheckoutCompleteWithCreditCardPayload setCheckoutUserErrors(List arg) { + public CheckoutCompleteWithCreditCardV2Payload setCheckoutUserErrors(List arg) { optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } @@ -10732,7 +11326,7 @@ public Payment getPayment() { return (Payment) get("payment"); } - public CheckoutCompleteWithCreditCardPayload setPayment(Payment arg) { + public CheckoutCompleteWithCreditCardV2Payload setPayment(Payment arg) { optimisticData.put(getKey("payment"), arg); return this; } @@ -10747,7 +11341,7 @@ public List getUserErrors() { return (List) get("userErrors"); } - public CheckoutCompleteWithCreditCardPayload setUserErrors(List arg) { + public CheckoutCompleteWithCreditCardV2Payload setUserErrors(List arg) { optimisticData.put(getKey("userErrors"), arg); return this; } @@ -10767,22 +11361,22 @@ public boolean unwrapsToObject(String key) { } } - public interface CheckoutCompleteWithCreditCardV2PayloadQueryDefinition { - void define(CheckoutCompleteWithCreditCardV2PayloadQuery _queryBuilder); + public interface CheckoutCompleteWithTokenizedPaymentV3PayloadQueryDefinition { + void define(CheckoutCompleteWithTokenizedPaymentV3PayloadQuery _queryBuilder); } /** - * Return type for `checkoutCompleteWithCreditCardV2` mutation. + * Return type for `checkoutCompleteWithTokenizedPaymentV3` mutation. */ - public static class CheckoutCompleteWithCreditCardV2PayloadQuery extends Query { - CheckoutCompleteWithCreditCardV2PayloadQuery(StringBuilder _queryBuilder) { + public static class CheckoutCompleteWithTokenizedPaymentV3PayloadQuery extends Query { + CheckoutCompleteWithTokenizedPaymentV3PayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * The checkout on which the payment was applied. */ - public CheckoutCompleteWithCreditCardV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { + public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery checkout(CheckoutQueryDefinition queryDef) { startField("checkout"); _queryBuilder.append('{'); @@ -10795,7 +11389,7 @@ public CheckoutCompleteWithCreditCardV2PayloadQuery checkout(CheckoutQueryDefini /** * The list of errors that occurred from executing the mutation. */ - public CheckoutCompleteWithCreditCardV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { startField("checkoutUserErrors"); _queryBuilder.append('{'); @@ -10808,7 +11402,7 @@ public CheckoutCompleteWithCreditCardV2PayloadQuery checkoutUserErrors(CheckoutU /** * A representation of the attempted payment. */ - public CheckoutCompleteWithCreditCardV2PayloadQuery payment(PaymentQueryDefinition queryDef) { + public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery payment(PaymentQueryDefinition queryDef) { startField("payment"); _queryBuilder.append('{'); @@ -10824,7 +11418,7 @@ public CheckoutCompleteWithCreditCardV2PayloadQuery payment(PaymentQueryDefiniti * @deprecated Use `checkoutUserErrors` instead */ @Deprecated - public CheckoutCompleteWithCreditCardV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { startField("userErrors"); _queryBuilder.append('{'); @@ -10836,13 +11430,13 @@ public CheckoutCompleteWithCreditCardV2PayloadQuery userErrors(UserErrorQueryDef } /** - * Return type for `checkoutCompleteWithCreditCardV2` mutation. + * Return type for `checkoutCompleteWithTokenizedPaymentV3` mutation. */ - public static class CheckoutCompleteWithCreditCardV2Payload extends AbstractResponse { - public CheckoutCompleteWithCreditCardV2Payload() { + public static class CheckoutCompleteWithTokenizedPaymentV3Payload extends AbstractResponse { + public CheckoutCompleteWithTokenizedPaymentV3Payload() { } - public CheckoutCompleteWithCreditCardV2Payload(JsonObject fields) throws SchemaViolationError { + public CheckoutCompleteWithTokenizedPaymentV3Payload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -10903,7 +11497,7 @@ public CheckoutCompleteWithCreditCardV2Payload(JsonObject fields) throws SchemaV } public String getGraphQlTypeName() { - return "CheckoutCompleteWithCreditCardV2Payload"; + return "CheckoutCompleteWithTokenizedPaymentV3Payload"; } /** @@ -10914,7 +11508,7 @@ public Checkout getCheckout() { return (Checkout) get("checkout"); } - public CheckoutCompleteWithCreditCardV2Payload setCheckout(Checkout arg) { + public CheckoutCompleteWithTokenizedPaymentV3Payload setCheckout(Checkout arg) { optimisticData.put(getKey("checkout"), arg); return this; } @@ -10927,7 +11521,7 @@ public List getCheckoutUserErrors() { return (List) get("checkoutUserErrors"); } - public CheckoutCompleteWithCreditCardV2Payload setCheckoutUserErrors(List arg) { + public CheckoutCompleteWithTokenizedPaymentV3Payload setCheckoutUserErrors(List arg) { optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } @@ -10940,7 +11534,7 @@ public Payment getPayment() { return (Payment) get("payment"); } - public CheckoutCompleteWithCreditCardV2Payload setPayment(Payment arg) { + public CheckoutCompleteWithTokenizedPaymentV3Payload setPayment(Payment arg) { optimisticData.put(getKey("payment"), arg); return this; } @@ -10955,7 +11549,7 @@ public List getUserErrors() { return (List) get("userErrors"); } - public CheckoutCompleteWithCreditCardV2Payload setUserErrors(List arg) { + public CheckoutCompleteWithTokenizedPaymentV3Payload setUserErrors(List arg) { optimisticData.put(getKey("userErrors"), arg); return this; } @@ -10975,225 +11569,321 @@ public boolean unwrapsToObject(String key) { } } - public interface CheckoutCompleteWithTokenizedPaymentPayloadQueryDefinition { - void define(CheckoutCompleteWithTokenizedPaymentPayloadQuery _queryBuilder); - } + public static class CheckoutCreateInput implements Serializable { + private Input email = Input.undefined(); - /** - * Return type for `checkoutCompleteWithTokenizedPayment` mutation. - */ - public static class CheckoutCompleteWithTokenizedPaymentPayloadQuery extends Query { - CheckoutCompleteWithTokenizedPaymentPayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + private Input> lineItems = Input.undefined(); - /** - * The checkout on which the payment was applied. - */ - public CheckoutCompleteWithTokenizedPaymentPayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + private Input shippingAddress = Input.undefined(); - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + private Input note = Input.undefined(); - return this; - } + private Input> customAttributes = Input.undefined(); - /** - * The list of errors that occurred from executing the mutation. - */ - public CheckoutCompleteWithTokenizedPaymentPayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + private Input allowPartialAddresses = Input.undefined(); - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + private Input presentmentCurrencyCode = Input.undefined(); - return this; + private Input buyerIdentity = Input.undefined(); + + public String getEmail() { + return email.getValue(); } - /** - * A representation of the attempted payment. - */ - public CheckoutCompleteWithTokenizedPaymentPayloadQuery payment(PaymentQueryDefinition queryDef) { - startField("payment"); + public Input getEmailInput() { + return email; + } - _queryBuilder.append('{'); - queryDef.define(new PaymentQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CheckoutCreateInput setEmail(String email) { + this.email = Input.optional(email); + return this; + } + public CheckoutCreateInput setEmailInput(Input email) { + if (email == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.email = email; return this; } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - @Deprecated - public CheckoutCompleteWithTokenizedPaymentPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public List getLineItems() { + return lineItems.getValue(); + } - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Input> getLineItemsInput() { + return lineItems; + } + public CheckoutCreateInput setLineItems(List lineItems) { + this.lineItems = Input.optional(lineItems); return this; } - } - /** - * Return type for `checkoutCompleteWithTokenizedPayment` mutation. - */ - public static class CheckoutCompleteWithTokenizedPaymentPayload extends AbstractResponse { - public CheckoutCompleteWithTokenizedPaymentPayload() { + public CheckoutCreateInput setLineItemsInput(Input> lineItems) { + if (lineItems == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.lineItems = lineItems; + return this; } - public CheckoutCompleteWithTokenizedPaymentPayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - responseData.put(key, new Checkout(jsonAsObject(field.getValue(), key))); + public MailingAddressInput getShippingAddress() { + return shippingAddress.getValue(); + } - break; - } + public Input getShippingAddressInput() { + return shippingAddress; + } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } + public CheckoutCreateInput setShippingAddress(MailingAddressInput shippingAddress) { + this.shippingAddress = Input.optional(shippingAddress); + return this; + } - responseData.put(key, list1); + public CheckoutCreateInput setShippingAddressInput(Input shippingAddress) { + if (shippingAddress == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.shippingAddress = shippingAddress; + return this; + } - break; - } + public String getNote() { + return note.getValue(); + } - case "payment": { - Payment optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Payment(jsonAsObject(field.getValue(), key)); - } + public Input getNoteInput() { + return note; + } - responseData.put(key, optional1); + public CheckoutCreateInput setNote(String note) { + this.note = Input.optional(note); + return this; + } - break; - } + public CheckoutCreateInput setNoteInput(Input note) { + if (note == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.note = note; + return this; + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + public List getCustomAttributes() { + return customAttributes.getValue(); + } - responseData.put(key, list1); + public Input> getCustomAttributesInput() { + return customAttributes; + } - break; - } + public CheckoutCreateInput setCustomAttributes(List customAttributes) { + this.customAttributes = Input.optional(customAttributes); + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } + public CheckoutCreateInput setCustomAttributesInput(Input> customAttributes) { + if (customAttributes == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.customAttributes = customAttributes; + return this; } - public String getGraphQlTypeName() { - return "CheckoutCompleteWithTokenizedPaymentPayload"; + public Boolean getAllowPartialAddresses() { + return allowPartialAddresses.getValue(); } - /** - * The checkout on which the payment was applied. - */ + public Input getAllowPartialAddressesInput() { + return allowPartialAddresses; + } - public Checkout getCheckout() { - return (Checkout) get("checkout"); + public CheckoutCreateInput setAllowPartialAddresses(Boolean allowPartialAddresses) { + this.allowPartialAddresses = Input.optional(allowPartialAddresses); + return this; } - public CheckoutCompleteWithTokenizedPaymentPayload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); + public CheckoutCreateInput setAllowPartialAddressesInput(Input allowPartialAddresses) { + if (allowPartialAddresses == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.allowPartialAddresses = allowPartialAddresses; return this; } - /** - * The list of errors that occurred from executing the mutation. - */ + public CurrencyCode getPresentmentCurrencyCode() { + return presentmentCurrencyCode.getValue(); + } - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); + public Input getPresentmentCurrencyCodeInput() { + return presentmentCurrencyCode; } - public CheckoutCompleteWithTokenizedPaymentPayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); + public CheckoutCreateInput setPresentmentCurrencyCode(CurrencyCode presentmentCurrencyCode) { + this.presentmentCurrencyCode = Input.optional(presentmentCurrencyCode); return this; } - /** - * A representation of the attempted payment. - */ - - public Payment getPayment() { - return (Payment) get("payment"); + public CheckoutCreateInput setPresentmentCurrencyCodeInput(Input presentmentCurrencyCode) { + if (presentmentCurrencyCode == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.presentmentCurrencyCode = presentmentCurrencyCode; + return this; } - public CheckoutCompleteWithTokenizedPaymentPayload setPayment(Payment arg) { - optimisticData.put(getKey("payment"), arg); - return this; + public CheckoutBuyerIdentityInput getBuyerIdentity() { + return buyerIdentity.getValue(); } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ + public Input getBuyerIdentityInput() { + return buyerIdentity; + } - public List getUserErrors() { - return (List) get("userErrors"); + public CheckoutCreateInput setBuyerIdentity(CheckoutBuyerIdentityInput buyerIdentity) { + this.buyerIdentity = Input.optional(buyerIdentity); + return this; } - public CheckoutCompleteWithTokenizedPaymentPayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public CheckoutCreateInput setBuyerIdentityInput(Input buyerIdentity) { + if (buyerIdentity == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.buyerIdentity = buyerIdentity; return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - case "checkoutUserErrors": return true; + 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 "payment": return true; + 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"); + } + } - case "userErrors": return true; + if (this.shippingAddress.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("shippingAddress:"); + if (shippingAddress.getValue() != null) { + shippingAddress.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } - default: return false; + 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 CheckoutCompleteWithTokenizedPaymentV2PayloadQueryDefinition { - void define(CheckoutCompleteWithTokenizedPaymentV2PayloadQuery _queryBuilder); + public interface CheckoutCreatePayloadQueryDefinition { + void define(CheckoutCreatePayloadQuery _queryBuilder); } /** - * Return type for `checkoutCompleteWithTokenizedPaymentV2` mutation. + * Return type for `checkoutCreate` mutation. */ - public static class CheckoutCompleteWithTokenizedPaymentV2PayloadQuery extends Query { - CheckoutCompleteWithTokenizedPaymentV2PayloadQuery(StringBuilder _queryBuilder) { + public static class CheckoutCreatePayloadQuery extends Query { + CheckoutCreatePayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The checkout on which the payment was applied. + * The new checkout object. */ - public CheckoutCompleteWithTokenizedPaymentV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { + public CheckoutCreatePayloadQuery checkout(CheckoutQueryDefinition queryDef) { startField("checkout"); _queryBuilder.append('{'); @@ -11206,7 +11896,7 @@ public CheckoutCompleteWithTokenizedPaymentV2PayloadQuery checkout(CheckoutQuery /** * The list of errors that occurred from executing the mutation. */ - public CheckoutCompleteWithTokenizedPaymentV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + public CheckoutCreatePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { startField("checkoutUserErrors"); _queryBuilder.append('{'); @@ -11217,14 +11907,10 @@ public CheckoutCompleteWithTokenizedPaymentV2PayloadQuery checkoutUserErrors(Che } /** - * A representation of the attempted payment. + * The checkout queue token. Available only to selected stores. */ - public CheckoutCompleteWithTokenizedPaymentV2PayloadQuery payment(PaymentQueryDefinition queryDef) { - startField("payment"); - - _queryBuilder.append('{'); - queryDef.define(new PaymentQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CheckoutCreatePayloadQuery queueToken() { + startField("queueToken"); return this; } @@ -11235,7 +11921,7 @@ public CheckoutCompleteWithTokenizedPaymentV2PayloadQuery payment(PaymentQueryDe * @deprecated Use `checkoutUserErrors` instead */ @Deprecated - public CheckoutCompleteWithTokenizedPaymentV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + public CheckoutCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { startField("userErrors"); _queryBuilder.append('{'); @@ -11247,13 +11933,13 @@ public CheckoutCompleteWithTokenizedPaymentV2PayloadQuery userErrors(UserErrorQu } /** - * Return type for `checkoutCompleteWithTokenizedPaymentV2` mutation. + * Return type for `checkoutCreate` mutation. */ - public static class CheckoutCompleteWithTokenizedPaymentV2Payload extends AbstractResponse { - public CheckoutCompleteWithTokenizedPaymentV2Payload() { + public static class CheckoutCreatePayload extends AbstractResponse { + public CheckoutCreatePayload() { } - public CheckoutCompleteWithTokenizedPaymentV2Payload(JsonObject fields) throws SchemaViolationError { + public CheckoutCreatePayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -11280,10 +11966,10 @@ public CheckoutCompleteWithTokenizedPaymentV2Payload(JsonObject fields) throws S break; } - case "payment": { - Payment optional1 = null; + case "queueToken": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Payment(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -11314,1275 +12000,18 @@ public CheckoutCompleteWithTokenizedPaymentV2Payload(JsonObject fields) throws S } public String getGraphQlTypeName() { - return "CheckoutCompleteWithTokenizedPaymentV2Payload"; - } - - /** - * The checkout on which the payment was applied. - */ - - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } - - public CheckoutCompleteWithTokenizedPaymentV2Payload 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 CheckoutCompleteWithTokenizedPaymentV2Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } - - /** - * A representation of the attempted payment. - */ - - public Payment getPayment() { - return (Payment) get("payment"); - } - - public CheckoutCompleteWithTokenizedPaymentV2Payload setPayment(Payment arg) { - optimisticData.put(getKey("payment"), arg); - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - - public List getUserErrors() { - return (List) get("userErrors"); - } - - public CheckoutCompleteWithTokenizedPaymentV2Payload 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 "payment": return true; - - case "userErrors": return true; - - default: return false; - } - } - } - - public interface CheckoutCompleteWithTokenizedPaymentV3PayloadQueryDefinition { - void define(CheckoutCompleteWithTokenizedPaymentV3PayloadQuery _queryBuilder); - } - - /** - * Return type for `checkoutCompleteWithTokenizedPaymentV3` mutation. - */ - public static class CheckoutCompleteWithTokenizedPaymentV3PayloadQuery extends Query { - CheckoutCompleteWithTokenizedPaymentV3PayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The checkout on which the payment was applied. - */ - public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery 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 CheckoutCompleteWithTokenizedPaymentV3PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * A representation of the attempted payment. - */ - public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery payment(PaymentQueryDefinition queryDef) { - startField("payment"); - - _queryBuilder.append('{'); - queryDef.define(new PaymentQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - @Deprecated - public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * Return type for `checkoutCompleteWithTokenizedPaymentV3` mutation. - */ - public static class CheckoutCompleteWithTokenizedPaymentV3Payload extends AbstractResponse { - public CheckoutCompleteWithTokenizedPaymentV3Payload() { - } - - public CheckoutCompleteWithTokenizedPaymentV3Payload(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); - - 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 getGraphQlTypeName() { - return "CheckoutCompleteWithTokenizedPaymentV3Payload"; - } - - /** - * The checkout on which the payment was applied. - */ - - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } - - public CheckoutCompleteWithTokenizedPaymentV3Payload 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 CheckoutCompleteWithTokenizedPaymentV3Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } - - /** - * A representation of the attempted payment. - */ - - public Payment getPayment() { - return (Payment) get("payment"); - } - - public CheckoutCompleteWithTokenizedPaymentV3Payload setPayment(Payment arg) { - optimisticData.put(getKey("payment"), arg); - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - - public List getUserErrors() { - return (List) get("userErrors"); - } - - public CheckoutCompleteWithTokenizedPaymentV3Payload 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 "payment": return true; - - case "userErrors": return true; - - default: return false; - } - } - } - - public static class CheckoutCreateInput implements Serializable { - private Input email = Input.undefined(); - - private Input> lineItems = Input.undefined(); - - private Input shippingAddress = Input.undefined(); - - private Input note = Input.undefined(); - - private Input> customAttributes = Input.undefined(); - - private Input allowPartialAddresses = Input.undefined(); - - private Input presentmentCurrencyCode = Input.undefined(); - - private Input buyerIdentity = Input.undefined(); - - public String getEmail() { - return email.getValue(); - } - - public Input getEmailInput() { - return email; - } - - public CheckoutCreateInput setEmail(String email) { - this.email = Input.optional(email); - return this; - } - - public CheckoutCreateInput setEmailInput(Input email) { - if (email == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.email = email; - return this; - } - - public List getLineItems() { - return lineItems.getValue(); - } - - public Input> getLineItemsInput() { - return lineItems; - } - - 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"); - - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - @Deprecated - public CheckoutCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * Return type for `checkoutCreate` mutation. - */ - public static class CheckoutCreatePayload extends AbstractResponse { - public CheckoutCreatePayload() { - } - - public CheckoutCreatePayload(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 "queueToken": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - 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 getGraphQlTypeName() { - return "CheckoutCreatePayload"; - } - - /** - * The new checkout object. - */ - - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } - - public CheckoutCreatePayload 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 CheckoutCreatePayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } - - /** - * The checkout queue token. Available only to selected stores. - */ - - public String getQueueToken() { - return (String) get("queueToken"); - } - - public CheckoutCreatePayload setQueueToken(String arg) { - optimisticData.put(getKey("queueToken"), arg); - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - - public List getUserErrors() { - return (List) get("userErrors"); - } - - public CheckoutCreatePayload 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 "queueToken": return false; - - case "userErrors": return true; - - default: return false; - } - } - } - - public interface CheckoutCustomerAssociatePayloadQueryDefinition { - void define(CheckoutCustomerAssociatePayloadQuery _queryBuilder); - } - - /** - * Return type for `checkoutCustomerAssociate` mutation. - */ - public static class CheckoutCustomerAssociatePayloadQuery extends Query { - CheckoutCustomerAssociatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The updated checkout object. - */ - public CheckoutCustomerAssociatePayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The associated customer object. - */ - public CheckoutCustomerAssociatePayloadQuery 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. - */ - public CheckoutCustomerAssociatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * Return type for `checkoutCustomerAssociate` mutation. - */ - public static class CheckoutCustomerAssociatePayload extends AbstractResponse { - public CheckoutCustomerAssociatePayload() { - } - - public CheckoutCustomerAssociatePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - responseData.put(key, new Checkout(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 "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 getGraphQlTypeName() { - return "CheckoutCustomerAssociatePayload"; - } - - /** - * The updated checkout object. - */ - - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } - - public CheckoutCustomerAssociatePayload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; - } - - /** - * The associated customer object. - */ - - public Customer getCustomer() { - return (Customer) get("customer"); - } - - public CheckoutCustomerAssociatePayload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - */ - - public List getUserErrors() { - return (List) get("userErrors"); - } - - public CheckoutCustomerAssociatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; - - case "customer": return true; - - case "userErrors": return true; - - default: return false; - } - } - } - - public interface CheckoutCustomerAssociateV2PayloadQueryDefinition { - void define(CheckoutCustomerAssociateV2PayloadQuery _queryBuilder); - } - - /** - * Return type for `checkoutCustomerAssociateV2` mutation. - */ - public static class CheckoutCustomerAssociateV2PayloadQuery extends Query { - CheckoutCustomerAssociateV2PayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The updated checkout object. - */ - public CheckoutCustomerAssociateV2PayloadQuery 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 CheckoutCustomerAssociateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The associated customer object. - */ - public CheckoutCustomerAssociateV2PayloadQuery 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. - * - * @deprecated Use `checkoutUserErrors` instead - */ - @Deprecated - public CheckoutCustomerAssociateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * Return type for `checkoutCustomerAssociateV2` mutation. - */ - public static class CheckoutCustomerAssociateV2Payload extends AbstractResponse { - public CheckoutCustomerAssociateV2Payload() { - } - - public CheckoutCustomerAssociateV2Payload(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 "customer": { - Customer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Customer(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 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 getGraphQlTypeName() { - return "CheckoutCustomerAssociateV2Payload"; - } - - /** - * The updated checkout object. - */ - - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } - - public CheckoutCustomerAssociateV2Payload 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 CheckoutCustomerAssociateV2Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } - - /** - * The associated customer object. - */ - - public Customer getCustomer() { - return (Customer) get("customer"); - } - - public CheckoutCustomerAssociateV2Payload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - - public List getUserErrors() { - return (List) get("userErrors"); - } - - public CheckoutCustomerAssociateV2Payload 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 "customer": return true; - - case "userErrors": return true; - - default: return false; - } - } - } - - public interface CheckoutCustomerDisassociatePayloadQueryDefinition { - void define(CheckoutCustomerDisassociatePayloadQuery _queryBuilder); - } - - /** - * Return type for `checkoutCustomerDisassociate` mutation. - */ - public static class CheckoutCustomerDisassociatePayloadQuery extends Query { - CheckoutCustomerDisassociatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The updated checkout object. - */ - public CheckoutCustomerDisassociatePayloadQuery 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 CheckoutCustomerDisassociatePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - @Deprecated - public CheckoutCustomerDisassociatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * Return type for `checkoutCustomerDisassociate` mutation. - */ - public static class CheckoutCustomerDisassociatePayload extends AbstractResponse { - public CheckoutCustomerDisassociatePayload() { - } - - public CheckoutCustomerDisassociatePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - responseData.put(key, new Checkout(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); - - 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 getGraphQlTypeName() { - return "CheckoutCustomerDisassociatePayload"; + return "CheckoutCreatePayload"; } /** - * The updated checkout object. + * The new checkout object. */ public Checkout getCheckout() { return (Checkout) get("checkout"); } - public CheckoutCustomerDisassociatePayload setCheckout(Checkout arg) { + public CheckoutCreatePayload setCheckout(Checkout arg) { optimisticData.put(getKey("checkout"), arg); return this; } @@ -12595,11 +12024,24 @@ public List getCheckoutUserErrors() { return (List) get("checkoutUserErrors"); } - public CheckoutCustomerDisassociatePayload setCheckoutUserErrors(List arg) { + public CheckoutCreatePayload setCheckoutUserErrors(List arg) { optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } + /** + * The checkout queue token. Available only to selected stores. + */ + + public String getQueueToken() { + return (String) get("queueToken"); + } + + public CheckoutCreatePayload setQueueToken(String arg) { + optimisticData.put(getKey("queueToken"), arg); + return this; + } + /** * The list of errors that occurred from executing the mutation. * @@ -12610,7 +12052,7 @@ public List getUserErrors() { return (List) get("userErrors"); } - public CheckoutCustomerDisassociatePayload setUserErrors(List arg) { + public CheckoutCreatePayload setUserErrors(List arg) { optimisticData.put(getKey("userErrors"), arg); return this; } @@ -12621,6 +12063,8 @@ public boolean unwrapsToObject(String key) { case "checkoutUserErrors": return true; + case "queueToken": return false; + case "userErrors": return true; default: return false; @@ -12628,22 +12072,22 @@ public boolean unwrapsToObject(String key) { } } - public interface CheckoutCustomerDisassociateV2PayloadQueryDefinition { - void define(CheckoutCustomerDisassociateV2PayloadQuery _queryBuilder); + public interface CheckoutCustomerAssociateV2PayloadQueryDefinition { + void define(CheckoutCustomerAssociateV2PayloadQuery _queryBuilder); } /** - * Return type for `checkoutCustomerDisassociateV2` mutation. + * Return type for `checkoutCustomerAssociateV2` mutation. */ - public static class CheckoutCustomerDisassociateV2PayloadQuery extends Query { - CheckoutCustomerDisassociateV2PayloadQuery(StringBuilder _queryBuilder) { + public static class CheckoutCustomerAssociateV2PayloadQuery extends Query { + CheckoutCustomerAssociateV2PayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * The updated checkout object. */ - public CheckoutCustomerDisassociateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { + public CheckoutCustomerAssociateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { startField("checkout"); _queryBuilder.append('{'); @@ -12656,7 +12100,7 @@ public CheckoutCustomerDisassociateV2PayloadQuery checkout(CheckoutQueryDefiniti /** * The list of errors that occurred from executing the mutation. */ - public CheckoutCustomerDisassociateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + public CheckoutCustomerAssociateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { startField("checkoutUserErrors"); _queryBuilder.append('{'); @@ -12666,13 +12110,26 @@ public CheckoutCustomerDisassociateV2PayloadQuery checkoutUserErrors(CheckoutUse return this; } + /** + * The associated customer object. + */ + public CheckoutCustomerAssociateV2PayloadQuery 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. * * @deprecated Use `checkoutUserErrors` instead */ @Deprecated - public CheckoutCustomerDisassociateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + public CheckoutCustomerAssociateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { startField("userErrors"); _queryBuilder.append('{'); @@ -12684,13 +12141,13 @@ public CheckoutCustomerDisassociateV2PayloadQuery userErrors(UserErrorQueryDefin } /** - * Return type for `checkoutCustomerDisassociateV2` mutation. + * Return type for `checkoutCustomerAssociateV2` mutation. */ - public static class CheckoutCustomerDisassociateV2Payload extends AbstractResponse { - public CheckoutCustomerDisassociateV2Payload() { + public static class CheckoutCustomerAssociateV2Payload extends AbstractResponse { + public CheckoutCustomerAssociateV2Payload() { } - public CheckoutCustomerDisassociateV2Payload(JsonObject fields) throws SchemaViolationError { + public CheckoutCustomerAssociateV2Payload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -12717,6 +12174,17 @@ public CheckoutCustomerDisassociateV2Payload(JsonObject fields) throws SchemaVio break; } + case "customer": { + Customer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Customer(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + case "userErrors": { List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { @@ -12740,7 +12208,7 @@ public CheckoutCustomerDisassociateV2Payload(JsonObject fields) throws SchemaVio } public String getGraphQlTypeName() { - return "CheckoutCustomerDisassociateV2Payload"; + return "CheckoutCustomerAssociateV2Payload"; } /** @@ -12751,7 +12219,7 @@ public Checkout getCheckout() { return (Checkout) get("checkout"); } - public CheckoutCustomerDisassociateV2Payload setCheckout(Checkout arg) { + public CheckoutCustomerAssociateV2Payload setCheckout(Checkout arg) { optimisticData.put(getKey("checkout"), arg); return this; } @@ -12764,11 +12232,24 @@ public List getCheckoutUserErrors() { return (List) get("checkoutUserErrors"); } - public CheckoutCustomerDisassociateV2Payload setCheckoutUserErrors(List arg) { + public CheckoutCustomerAssociateV2Payload setCheckoutUserErrors(List arg) { optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } + /** + * The associated customer object. + */ + + public Customer getCustomer() { + return (Customer) get("customer"); + } + + public CheckoutCustomerAssociateV2Payload setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); + return this; + } + /** * The list of errors that occurred from executing the mutation. * @@ -12779,7 +12260,7 @@ public List getUserErrors() { return (List) get("userErrors"); } - public CheckoutCustomerDisassociateV2Payload setUserErrors(List arg) { + public CheckoutCustomerAssociateV2Payload setUserErrors(List arg) { optimisticData.put(getKey("userErrors"), arg); return this; } @@ -12790,6 +12271,8 @@ public boolean unwrapsToObject(String key) { case "checkoutUserErrors": return true; + case "customer": return true; + case "userErrors": return true; default: return false; @@ -12797,22 +12280,22 @@ public boolean unwrapsToObject(String key) { } } - public interface CheckoutDiscountCodeApplyPayloadQueryDefinition { - void define(CheckoutDiscountCodeApplyPayloadQuery _queryBuilder); + public interface CheckoutCustomerDisassociateV2PayloadQueryDefinition { + void define(CheckoutCustomerDisassociateV2PayloadQuery _queryBuilder); } /** - * Return type for `checkoutDiscountCodeApply` mutation. + * Return type for `checkoutCustomerDisassociateV2` mutation. */ - public static class CheckoutDiscountCodeApplyPayloadQuery extends Query { - CheckoutDiscountCodeApplyPayloadQuery(StringBuilder _queryBuilder) { + public static class CheckoutCustomerDisassociateV2PayloadQuery extends Query { + CheckoutCustomerDisassociateV2PayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * The updated checkout object. */ - public CheckoutDiscountCodeApplyPayloadQuery checkout(CheckoutQueryDefinition queryDef) { + public CheckoutCustomerDisassociateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { startField("checkout"); _queryBuilder.append('{'); @@ -12825,7 +12308,7 @@ public CheckoutDiscountCodeApplyPayloadQuery checkout(CheckoutQueryDefinition qu /** * The list of errors that occurred from executing the mutation. */ - public CheckoutDiscountCodeApplyPayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + public CheckoutCustomerDisassociateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { startField("checkoutUserErrors"); _queryBuilder.append('{'); @@ -12841,7 +12324,7 @@ public CheckoutDiscountCodeApplyPayloadQuery checkoutUserErrors(CheckoutUserErro * @deprecated Use `checkoutUserErrors` instead */ @Deprecated - public CheckoutDiscountCodeApplyPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + public CheckoutCustomerDisassociateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { startField("userErrors"); _queryBuilder.append('{'); @@ -12853,19 +12336,24 @@ public CheckoutDiscountCodeApplyPayloadQuery userErrors(UserErrorQueryDefinition } /** - * Return type for `checkoutDiscountCodeApply` mutation. + * Return type for `checkoutCustomerDisassociateV2` mutation. */ - public static class CheckoutDiscountCodeApplyPayload extends AbstractResponse { - public CheckoutDiscountCodeApplyPayload() { + public static class CheckoutCustomerDisassociateV2Payload extends AbstractResponse { + public CheckoutCustomerDisassociateV2Payload() { } - public CheckoutDiscountCodeApplyPayload(JsonObject fields) throws SchemaViolationError { + public CheckoutCustomerDisassociateV2Payload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { case "checkout": { - responseData.put(key, new Checkout(jsonAsObject(field.getValue(), key))); + Checkout optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } @@ -12904,7 +12392,7 @@ public CheckoutDiscountCodeApplyPayload(JsonObject fields) throws SchemaViolatio } public String getGraphQlTypeName() { - return "CheckoutDiscountCodeApplyPayload"; + return "CheckoutCustomerDisassociateV2Payload"; } /** @@ -12915,7 +12403,7 @@ public Checkout getCheckout() { return (Checkout) get("checkout"); } - public CheckoutDiscountCodeApplyPayload setCheckout(Checkout arg) { + public CheckoutCustomerDisassociateV2Payload setCheckout(Checkout arg) { optimisticData.put(getKey("checkout"), arg); return this; } @@ -12928,7 +12416,7 @@ public List getCheckoutUserErrors() { return (List) get("checkoutUserErrors"); } - public CheckoutDiscountCodeApplyPayload setCheckoutUserErrors(List arg) { + public CheckoutCustomerDisassociateV2Payload setCheckoutUserErrors(List arg) { optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } @@ -12943,7 +12431,7 @@ public List getUserErrors() { return (List) get("userErrors"); } - public CheckoutDiscountCodeApplyPayload setUserErrors(List arg) { + public CheckoutCustomerDisassociateV2Payload setUserErrors(List arg) { optimisticData.put(getKey("userErrors"), arg); return this; } @@ -13299,170 +12787,6 @@ public boolean unwrapsToObject(String key) { } } - public interface CheckoutEmailUpdatePayloadQueryDefinition { - void define(CheckoutEmailUpdatePayloadQuery _queryBuilder); - } - - /** - * Return type for `checkoutEmailUpdate` mutation. - */ - public static class CheckoutEmailUpdatePayloadQuery extends Query { - CheckoutEmailUpdatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The checkout object with the updated email. - */ - public CheckoutEmailUpdatePayloadQuery 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 CheckoutEmailUpdatePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - @Deprecated - public CheckoutEmailUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * Return type for `checkoutEmailUpdate` mutation. - */ - public static class CheckoutEmailUpdatePayload extends AbstractResponse { - public CheckoutEmailUpdatePayload() { - } - - public CheckoutEmailUpdatePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - responseData.put(key, new Checkout(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); - - 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 getGraphQlTypeName() { - return "CheckoutEmailUpdatePayload"; - } - - /** - * The checkout object with the updated email. - */ - - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } - - public CheckoutEmailUpdatePayload 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 CheckoutEmailUpdatePayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - - public List getUserErrors() { - return (List) get("userErrors"); - } - - public CheckoutEmailUpdatePayload 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 CheckoutEmailUpdateV2PayloadQueryDefinition { void define(CheckoutEmailUpdateV2PayloadQuery _queryBuilder); } @@ -14204,334 +13528,6 @@ public String toString() { } } - public interface CheckoutGiftCardApplyPayloadQueryDefinition { - void define(CheckoutGiftCardApplyPayloadQuery _queryBuilder); - } - - /** - * Return type for `checkoutGiftCardApply` mutation. - */ - public static class CheckoutGiftCardApplyPayloadQuery extends Query { - CheckoutGiftCardApplyPayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The updated checkout object. - */ - public CheckoutGiftCardApplyPayloadQuery 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 CheckoutGiftCardApplyPayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - @Deprecated - public CheckoutGiftCardApplyPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * Return type for `checkoutGiftCardApply` mutation. - */ - public static class CheckoutGiftCardApplyPayload extends AbstractResponse { - public CheckoutGiftCardApplyPayload() { - } - - public CheckoutGiftCardApplyPayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - responseData.put(key, new Checkout(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); - - 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 getGraphQlTypeName() { - return "CheckoutGiftCardApplyPayload"; - } - - /** - * The updated checkout object. - */ - - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } - - public CheckoutGiftCardApplyPayload 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 CheckoutGiftCardApplyPayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - - public List getUserErrors() { - return (List) get("userErrors"); - } - - public CheckoutGiftCardApplyPayload 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 CheckoutGiftCardRemovePayloadQueryDefinition { - void define(CheckoutGiftCardRemovePayloadQuery _queryBuilder); - } - - /** - * Return type for `checkoutGiftCardRemove` mutation. - */ - public static class CheckoutGiftCardRemovePayloadQuery extends Query { - CheckoutGiftCardRemovePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The updated checkout object. - */ - public CheckoutGiftCardRemovePayloadQuery 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 CheckoutGiftCardRemovePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - @Deprecated - public CheckoutGiftCardRemovePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * Return type for `checkoutGiftCardRemove` mutation. - */ - public static class CheckoutGiftCardRemovePayload extends AbstractResponse { - public CheckoutGiftCardRemovePayload() { - } - - public CheckoutGiftCardRemovePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - responseData.put(key, new Checkout(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); - - 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 getGraphQlTypeName() { - return "CheckoutGiftCardRemovePayload"; - } - - /** - * The updated checkout object. - */ - - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } - - public CheckoutGiftCardRemovePayload 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 CheckoutGiftCardRemovePayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - - public List getUserErrors() { - return (List) get("userErrors"); - } - - public CheckoutGiftCardRemovePayload 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 CheckoutGiftCardRemoveV2PayloadQueryDefinition { void define(CheckoutGiftCardRemoveV2PayloadQuery _queryBuilder); } @@ -15782,176 +14778,7 @@ public CheckoutLineItemsAddPayload(JsonObject fields) throws SchemaViolationErro } public String getGraphQlTypeName() { - return "CheckoutLineItemsAddPayload"; - } - - /** - * The updated checkout object. - */ - - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } - - public CheckoutLineItemsAddPayload 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 CheckoutLineItemsAddPayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - - public List getUserErrors() { - return (List) get("userErrors"); - } - - public CheckoutLineItemsAddPayload 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 CheckoutLineItemsRemovePayloadQueryDefinition { - void define(CheckoutLineItemsRemovePayloadQuery _queryBuilder); - } - - /** - * Return type for `checkoutLineItemsRemove` mutation. - */ - public static class CheckoutLineItemsRemovePayloadQuery extends Query { - CheckoutLineItemsRemovePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The updated checkout object. - */ - public CheckoutLineItemsRemovePayloadQuery 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 CheckoutLineItemsRemovePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - @Deprecated - public CheckoutLineItemsRemovePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * Return type for `checkoutLineItemsRemove` mutation. - */ - public static class CheckoutLineItemsRemovePayload extends AbstractResponse { - public CheckoutLineItemsRemovePayload() { - } - - 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)); - } - - 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; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "CheckoutLineItemsRemovePayload"; + return "CheckoutLineItemsAddPayload"; } /** @@ -15962,7 +14789,7 @@ public Checkout getCheckout() { return (Checkout) get("checkout"); } - public CheckoutLineItemsRemovePayload setCheckout(Checkout arg) { + public CheckoutLineItemsAddPayload setCheckout(Checkout arg) { optimisticData.put(getKey("checkout"), arg); return this; } @@ -15975,7 +14802,7 @@ public List getCheckoutUserErrors() { return (List) get("checkoutUserErrors"); } - public CheckoutLineItemsRemovePayload setCheckoutUserErrors(List arg) { + public CheckoutLineItemsAddPayload setCheckoutUserErrors(List arg) { optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } @@ -15990,7 +14817,7 @@ public List getUserErrors() { return (List) get("userErrors"); } - public CheckoutLineItemsRemovePayload setUserErrors(List arg) { + public CheckoutLineItemsAddPayload setUserErrors(List arg) { optimisticData.put(getKey("userErrors"), arg); return this; } @@ -16008,22 +14835,22 @@ public boolean unwrapsToObject(String key) { } } - public interface CheckoutLineItemsReplacePayloadQueryDefinition { - void define(CheckoutLineItemsReplacePayloadQuery _queryBuilder); + public interface CheckoutLineItemsRemovePayloadQueryDefinition { + void define(CheckoutLineItemsRemovePayloadQuery _queryBuilder); } /** - * Return type for `checkoutLineItemsReplace` mutation. + * Return type for `checkoutLineItemsRemove` mutation. */ - public static class CheckoutLineItemsReplacePayloadQuery extends Query { - CheckoutLineItemsReplacePayloadQuery(StringBuilder _queryBuilder) { + public static class CheckoutLineItemsRemovePayloadQuery extends Query { + CheckoutLineItemsRemovePayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * The updated checkout object. */ - public CheckoutLineItemsReplacePayloadQuery checkout(CheckoutQueryDefinition queryDef) { + public CheckoutLineItemsRemovePayloadQuery checkout(CheckoutQueryDefinition queryDef) { startField("checkout"); _queryBuilder.append('{'); @@ -16036,8 +14863,8 @@ public CheckoutLineItemsReplacePayloadQuery checkout(CheckoutQueryDefinition que /** * The list of errors that occurred from executing the mutation. */ - public CheckoutLineItemsReplacePayloadQuery userErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("userErrors"); + public CheckoutLineItemsRemovePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + startField("checkoutUserErrors"); _queryBuilder.append('{'); queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); @@ -16045,16 +14872,32 @@ public CheckoutLineItemsReplacePayloadQuery userErrors(CheckoutUserErrorQueryDef return this; } + + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead + */ + @Deprecated + public CheckoutLineItemsRemovePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); + + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } } /** - * Return type for `checkoutLineItemsReplace` mutation. + * Return type for `checkoutLineItemsRemove` mutation. */ - public static class CheckoutLineItemsReplacePayload extends AbstractResponse { - public CheckoutLineItemsReplacePayload() { + public static class CheckoutLineItemsRemovePayload extends AbstractResponse { + public CheckoutLineItemsRemovePayload() { } - public CheckoutLineItemsReplacePayload(JsonObject fields) throws SchemaViolationError { + public CheckoutLineItemsRemovePayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -16070,7 +14913,7 @@ public CheckoutLineItemsReplacePayload(JsonObject fields) throws SchemaViolation break; } - case "userErrors": { + case "checkoutUserErrors": { List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { list1.add(new CheckoutUserError(jsonAsObject(element1, key))); @@ -16081,6 +14924,17 @@ public CheckoutLineItemsReplacePayload(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))); + } + + responseData.put(key, list1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -16093,7 +14947,7 @@ public CheckoutLineItemsReplacePayload(JsonObject fields) throws SchemaViolation } public String getGraphQlTypeName() { - return "CheckoutLineItemsReplacePayload"; + return "CheckoutLineItemsRemovePayload"; } /** @@ -16104,7 +14958,7 @@ public Checkout getCheckout() { return (Checkout) get("checkout"); } - public CheckoutLineItemsReplacePayload setCheckout(Checkout arg) { + public CheckoutLineItemsRemovePayload setCheckout(Checkout arg) { optimisticData.put(getKey("checkout"), arg); return this; } @@ -16113,11 +14967,26 @@ public CheckoutLineItemsReplacePayload setCheckout(Checkout arg) { * The list of errors that occurred from executing the mutation. */ - public List getUserErrors() { - return (List) get("userErrors"); + public List getCheckoutUserErrors() { + return (List) get("checkoutUserErrors"); } - public CheckoutLineItemsReplacePayload setUserErrors(List arg) { + public CheckoutLineItemsRemovePayload setCheckoutUserErrors(List arg) { + optimisticData.put(getKey("checkoutUserErrors"), arg); + return this; + } + + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead + */ + + public List getUserErrors() { + return (List) get("userErrors"); + } + + public CheckoutLineItemsRemovePayload setUserErrors(List arg) { optimisticData.put(getKey("userErrors"), arg); return this; } @@ -16126,6 +14995,8 @@ public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "checkout": return true; + case "checkoutUserErrors": return true; + case "userErrors": return true; default: return false; @@ -16133,22 +15004,22 @@ public boolean unwrapsToObject(String key) { } } - public interface CheckoutLineItemsUpdatePayloadQueryDefinition { - void define(CheckoutLineItemsUpdatePayloadQuery _queryBuilder); + public interface CheckoutLineItemsReplacePayloadQueryDefinition { + void define(CheckoutLineItemsReplacePayloadQuery _queryBuilder); } /** - * Return type for `checkoutLineItemsUpdate` mutation. + * Return type for `checkoutLineItemsReplace` mutation. */ - public static class CheckoutLineItemsUpdatePayloadQuery extends Query { - CheckoutLineItemsUpdatePayloadQuery(StringBuilder _queryBuilder) { + public static class CheckoutLineItemsReplacePayloadQuery extends Query { + CheckoutLineItemsReplacePayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * The updated checkout object. */ - public CheckoutLineItemsUpdatePayloadQuery checkout(CheckoutQueryDefinition queryDef) { + public CheckoutLineItemsReplacePayloadQuery checkout(CheckoutQueryDefinition queryDef) { startField("checkout"); _queryBuilder.append('{'); @@ -16161,27 +15032,11 @@ public CheckoutLineItemsUpdatePayloadQuery checkout(CheckoutQueryDefinition quer /** * The list of errors that occurred from executing the mutation. */ - public CheckoutLineItemsUpdatePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - @Deprecated - public CheckoutLineItemsUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + public CheckoutLineItemsReplacePayloadQuery userErrors(CheckoutUserErrorQueryDefinition queryDef) { startField("userErrors"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -16189,13 +15044,13 @@ public CheckoutLineItemsUpdatePayloadQuery userErrors(UserErrorQueryDefinition q } /** - * Return type for `checkoutLineItemsUpdate` mutation. + * Return type for `checkoutLineItemsReplace` mutation. */ - public static class CheckoutLineItemsUpdatePayload extends AbstractResponse { - public CheckoutLineItemsUpdatePayload() { + public static class CheckoutLineItemsReplacePayload extends AbstractResponse { + public CheckoutLineItemsReplacePayload() { } - public CheckoutLineItemsUpdatePayload(JsonObject fields) throws SchemaViolationError { + public CheckoutLineItemsReplacePayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -16211,7 +15066,7 @@ public CheckoutLineItemsUpdatePayload(JsonObject fields) throws SchemaViolationE break; } - case "checkoutUserErrors": { + case "userErrors": { List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { list1.add(new CheckoutUserError(jsonAsObject(element1, key))); @@ -16222,17 +15077,6 @@ public CheckoutLineItemsUpdatePayload(JsonObject fields) throws SchemaViolationE 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; @@ -16245,7 +15089,7 @@ public CheckoutLineItemsUpdatePayload(JsonObject fields) throws SchemaViolationE } public String getGraphQlTypeName() { - return "CheckoutLineItemsUpdatePayload"; + return "CheckoutLineItemsReplacePayload"; } /** @@ -16256,7 +15100,7 @@ public Checkout getCheckout() { return (Checkout) get("checkout"); } - public CheckoutLineItemsUpdatePayload setCheckout(Checkout arg) { + public CheckoutLineItemsReplacePayload setCheckout(Checkout arg) { optimisticData.put(getKey("checkout"), arg); return this; } @@ -16265,26 +15109,11 @@ public CheckoutLineItemsUpdatePayload setCheckout(Checkout arg) { * The list of errors that occurred from executing the mutation. */ - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); - } - - public CheckoutLineItemsUpdatePayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead - */ - - public List getUserErrors() { - return (List) get("userErrors"); + public List getUserErrors() { + return (List) get("userErrors"); } - public CheckoutLineItemsUpdatePayload setUserErrors(List arg) { + public CheckoutLineItemsReplacePayload setUserErrors(List arg) { optimisticData.put(getKey("userErrors"), arg); return this; } @@ -16293,8 +15122,6 @@ public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "checkout": return true; - case "checkoutUserErrors": return true; - case "userErrors": return true; default: return false; @@ -16302,22 +15129,22 @@ public boolean unwrapsToObject(String key) { } } - public interface CheckoutShippingAddressUpdatePayloadQueryDefinition { - void define(CheckoutShippingAddressUpdatePayloadQuery _queryBuilder); + public interface CheckoutLineItemsUpdatePayloadQueryDefinition { + void define(CheckoutLineItemsUpdatePayloadQuery _queryBuilder); } /** - * Return type for `checkoutShippingAddressUpdate` mutation. + * Return type for `checkoutLineItemsUpdate` mutation. */ - public static class CheckoutShippingAddressUpdatePayloadQuery extends Query { - CheckoutShippingAddressUpdatePayloadQuery(StringBuilder _queryBuilder) { + public static class CheckoutLineItemsUpdatePayloadQuery extends Query { + CheckoutLineItemsUpdatePayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * The updated checkout object. */ - public CheckoutShippingAddressUpdatePayloadQuery checkout(CheckoutQueryDefinition queryDef) { + public CheckoutLineItemsUpdatePayloadQuery checkout(CheckoutQueryDefinition queryDef) { startField("checkout"); _queryBuilder.append('{'); @@ -16330,7 +15157,7 @@ public CheckoutShippingAddressUpdatePayloadQuery checkout(CheckoutQueryDefinitio /** * The list of errors that occurred from executing the mutation. */ - public CheckoutShippingAddressUpdatePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + public CheckoutLineItemsUpdatePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { startField("checkoutUserErrors"); _queryBuilder.append('{'); @@ -16346,7 +15173,7 @@ public CheckoutShippingAddressUpdatePayloadQuery checkoutUserErrors(CheckoutUser * @deprecated Use `checkoutUserErrors` instead */ @Deprecated - public CheckoutShippingAddressUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + public CheckoutLineItemsUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { startField("userErrors"); _queryBuilder.append('{'); @@ -16358,19 +15185,24 @@ public CheckoutShippingAddressUpdatePayloadQuery userErrors(UserErrorQueryDefini } /** - * Return type for `checkoutShippingAddressUpdate` mutation. + * Return type for `checkoutLineItemsUpdate` mutation. */ - public static class CheckoutShippingAddressUpdatePayload extends AbstractResponse { - public CheckoutShippingAddressUpdatePayload() { + public static class CheckoutLineItemsUpdatePayload extends AbstractResponse { + public CheckoutLineItemsUpdatePayload() { } - public CheckoutShippingAddressUpdatePayload(JsonObject fields) throws SchemaViolationError { + public CheckoutLineItemsUpdatePayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { case "checkout": { - responseData.put(key, new Checkout(jsonAsObject(field.getValue(), key))); + Checkout optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } @@ -16409,7 +15241,7 @@ public CheckoutShippingAddressUpdatePayload(JsonObject fields) throws SchemaViol } public String getGraphQlTypeName() { - return "CheckoutShippingAddressUpdatePayload"; + return "CheckoutLineItemsUpdatePayload"; } /** @@ -16420,7 +15252,7 @@ public Checkout getCheckout() { return (Checkout) get("checkout"); } - public CheckoutShippingAddressUpdatePayload setCheckout(Checkout arg) { + public CheckoutLineItemsUpdatePayload setCheckout(Checkout arg) { optimisticData.put(getKey("checkout"), arg); return this; } @@ -16433,7 +15265,7 @@ public List getCheckoutUserErrors() { return (List) get("checkoutUserErrors"); } - public CheckoutShippingAddressUpdatePayload setCheckoutUserErrors(List arg) { + public CheckoutLineItemsUpdatePayload setCheckoutUserErrors(List arg) { optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } @@ -16448,7 +15280,7 @@ public List getUserErrors() { return (List) get("userErrors"); } - public CheckoutShippingAddressUpdatePayload setUserErrors(List arg) { + public CheckoutLineItemsUpdatePayload setUserErrors(List arg) { optimisticData.put(getKey("userErrors"), arg); return this; } @@ -17065,108 +15897,28 @@ public CollectionQuery metafield(String namespace, String key, MetafieldQueryDef return this; } - public class MetafieldsArguments extends Arguments { - MetafieldsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Container for a set of metafields (maximum of 20 characters). - */ - public MetafieldsArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the first `n` elements from the list. - */ - public MetafieldsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public MetafieldsArguments 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 MetafieldsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public MetafieldsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Reverse the order of the underlying list. - */ - public MetafieldsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - } - - public interface MetafieldsArgumentsDefinition { - void define(MetafieldsArguments args); - } - - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - - */ - public CollectionQuery metafields(MetafieldConnectionQueryDefinition queryDef) { - return metafields(args -> {}, queryDef); - } - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - @Deprecated - public CollectionQuery metafields(MetafieldsArgumentsDefinition argsDef, MetafieldConnectionQueryDefinition queryDef) { + public CollectionQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { startField("metafields"); - MetafieldsArguments args = new MetafieldsArguments(_queryBuilder); - argsDef.define(args); - MetafieldsArguments.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 MetafieldConnectionQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -17394,7 +16146,17 @@ public Collection(JsonObject fields) throws SchemaViolationError { } case "metafields": { - responseData.put(key, new MetafieldConnection(jsonAsObject(field.getValue(), key))); + 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; } @@ -17529,17 +16291,14 @@ public Collection setMetafield(Metafield arg) { } /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public MetafieldConnection getMetafields() { - return (MetafieldConnection) get("metafields"); + public List getMetafields() { + return (List) get("metafields"); } - public Collection setMetafields(MetafieldConnection arg) { + public Collection setMetafields(List arg) { optimisticData.put(getKey("metafields"), arg); return this; } @@ -18774,7 +17533,13 @@ public boolean unwrapsToObject(String key) { } /** - * ISO 3166-1 alpha-2 country codes with some differences. + * 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 { /** @@ -22311,123 +21076,6 @@ public boolean unwrapsToObject(String key) { } } - public static class CreditCardPaymentInput implements Serializable { - private BigDecimal amount; - - private String idempotencyKey; - - private MailingAddressInput billingAddress; - - private String vaultId; - - private Input test = Input.undefined(); - - public CreditCardPaymentInput(BigDecimal amount, String idempotencyKey, MailingAddressInput billingAddress, String vaultId) { - this.amount = amount; - - this.idempotencyKey = idempotencyKey; - - this.billingAddress = billingAddress; - - this.vaultId = vaultId; - } - - public BigDecimal getAmount() { - return amount; - } - - public CreditCardPaymentInput setAmount(BigDecimal amount) { - this.amount = amount; - return this; - } - - public String getIdempotencyKey() { - return idempotencyKey; - } - - public CreditCardPaymentInput setIdempotencyKey(String idempotencyKey) { - this.idempotencyKey = idempotencyKey; - return this; - } - - public MailingAddressInput getBillingAddress() { - return billingAddress; - } - - public CreditCardPaymentInput setBillingAddress(MailingAddressInput billingAddress) { - this.billingAddress = billingAddress; - return this; - } - - public String getVaultId() { - return vaultId; - } - - public CreditCardPaymentInput setVaultId(String vaultId) { - this.vaultId = vaultId; - return this; - } - - public Boolean getTest() { - return test.getValue(); - } - - public Input getTestInput() { - return test; - } - - public CreditCardPaymentInput setTest(Boolean test) { - this.test = Input.optional(test); - return this; - } - - public CreditCardPaymentInput setTestInput(Input test) { - if (test == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.test = test; - return this; - } - - 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("idempotencyKey:"); - Query.appendQuotedString(_queryBuilder, idempotencyKey.toString()); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("billingAddress:"); - billingAddress.appendTo(_queryBuilder); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("vaultId:"); - Query.appendQuotedString(_queryBuilder, vaultId.toString()); - - if (this.test.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("test:"); - if (test.getValue() != null) { - _queryBuilder.append(test.getValue()); - } else { - _queryBuilder.append("null"); - } - } - - _queryBuilder.append('}'); - } - } - public static class CreditCardPaymentInputV2 implements Serializable { private MoneyInput paymentAmount; @@ -23429,9 +22077,17 @@ public enum CurrencyCode { /** * Sao Tome And Principe Dobra (STD). + * + * @deprecated `STD` is deprecated. Use `STN` available from version `2022-07` onwards instead. */ + @Deprecated STD, + /** + * Sao Tome And Principe Dobra (STN). + */ + STN, + /** * Syrian Pound (SYP). */ @@ -23512,6 +22168,11 @@ public enum CurrencyCode { */ UZS, + /** + * Venezuelan Bolivares (VED). + */ + VED, + /** * Venezuelan Bolivares (VEF). * @@ -24100,8 +22761,8 @@ public static CurrencyCode fromGraphQl(String value) { return SSP; } - case "STD": { - return STD; + case "STN": { + return STN; } case "SYP": { @@ -24168,6 +22829,10 @@ public static CurrencyCode fromGraphQl(String value) { return UZS; } + case "VED": { + return VED; + } + case "VES": { return VES; } @@ -24735,8 +23400,8 @@ public String toString() { return "SSP"; } - case STD: { - return "STD"; + case STN: { + return "STN"; } case SYP: { @@ -24803,6 +23468,10 @@ public String toString() { return "UZS"; } + case VED: { + return "VED"; + } + case VES: { return "VES"; } @@ -25070,108 +23739,28 @@ public CustomerQuery metafield(String namespace, String key, MetafieldQueryDefin return this; } - public class MetafieldsArguments extends Arguments { - MetafieldsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Container for a set of metafields (maximum of 20 characters). - */ - public MetafieldsArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the first `n` elements from the list. - */ - public MetafieldsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public MetafieldsArguments 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 MetafieldsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public MetafieldsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Reverse the order of the underlying list. - */ - public MetafieldsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - } - - public interface MetafieldsArgumentsDefinition { - void define(MetafieldsArguments args); - } - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public CustomerQuery metafields(MetafieldConnectionQueryDefinition queryDef) { - return metafields(args -> {}, queryDef); - } - - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - - */ - @Deprecated - public CustomerQuery metafields(MetafieldsArgumentsDefinition argsDef, MetafieldConnectionQueryDefinition queryDef) { + public CustomerQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { startField("metafields"); - MetafieldsArguments args = new MetafieldsArguments(_queryBuilder); - argsDef.define(args); - MetafieldsArguments.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 MetafieldConnectionQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -25430,7 +24019,17 @@ public Customer(JsonObject fields) throws SchemaViolationError { } case "metafields": { - responseData.put(key, new MetafieldConnection(jsonAsObject(field.getValue(), key))); + 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; } @@ -25628,17 +24227,14 @@ public Customer setMetafield(Metafield arg) { } /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public MetafieldConnection getMetafields() { - return (MetafieldConnection) get("metafields"); + public List getMetafields() { + return (List) get("metafields"); } - public Customer setMetafields(MetafieldConnection arg) { + public Customer setMetafields(List arg) { optimisticData.put(getKey("metafields"), arg); return this; } @@ -30168,8 +28764,12 @@ public boolean unwrapsToObject(String key) { } /** - * Which lines on the order that the discount is allocated over, of the type - * defined by the Discount Application's target_type. + * 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 { /** @@ -30178,7 +28778,7 @@ public enum DiscountApplicationTargetSelection { ALL, /** - * The discount is allocated onto only the lines it is entitled for. + * The discount is allocated onto only the lines that it's entitled for. */ ENTITLED, @@ -31312,7 +29912,9 @@ public boolean unwrapsToObject(String key) { } /** - * Denotes the type of data this filter group represents. + * 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/api/examples/filter-products). */ public enum FilterType { /** @@ -32648,108 +31250,28 @@ public HasMetafieldsQuery metafield(String namespace, String key, MetafieldQuery return this; } - public class MetafieldsArguments extends Arguments { - MetafieldsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Container for a set of metafields (maximum of 20 characters). - */ - public MetafieldsArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the first `n` elements from the list. - */ - public MetafieldsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public MetafieldsArguments 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 MetafieldsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public MetafieldsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Reverse the order of the underlying list. - */ - public MetafieldsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - } - - public interface MetafieldsArgumentsDefinition { - void define(MetafieldsArguments args); - } - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public HasMetafieldsQuery metafields(MetafieldConnectionQueryDefinition queryDef) { - return metafields(args -> {}, queryDef); - } - - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - - */ - @Deprecated - public HasMetafieldsQuery metafields(MetafieldsArgumentsDefinition argsDef, MetafieldConnectionQueryDefinition queryDef) { + public HasMetafieldsQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { startField("metafields"); - MetafieldsArguments args = new MetafieldsArguments(_queryBuilder); - argsDef.define(args); - MetafieldsArguments.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 MetafieldConnectionQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -32824,7 +31346,7 @@ public interface HasMetafields { Metafield getMetafield(); - MetafieldConnection getMetafields(); + List getMetafields(); } /** @@ -32851,7 +31373,17 @@ public UnknownHasMetafields(JsonObject fields) throws SchemaViolationError { } case "metafields": { - responseData.put(key, new MetafieldConnection(jsonAsObject(field.getValue(), key))); + 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; } @@ -32930,17 +31462,14 @@ public UnknownHasMetafields setMetafield(Metafield arg) { } /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public MetafieldConnection getMetafields() { - return (MetafieldConnection) get("metafields"); + public List getMetafields() { + return (List) get("metafields"); } - public UnknownHasMetafields setMetafields(MetafieldConnection arg) { + public UnknownHasMetafields setMetafields(List arg) { optimisticData.put(getKey("metafields"), arg); return this; } @@ -32956,6 +31485,53 @@ public boolean unwrapsToObject(String key) { } } + public static class HasMetafieldsIdentifier implements Serializable { + private String namespace; + + private String key; + + public HasMetafieldsIdentifier(String namespace, String key) { + this.namespace = namespace; + + this.key = key; + } + + public String getNamespace() { + return namespace; + } + + public HasMetafieldsIdentifier setNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + public String getKey() { + return key; + } + + public HasMetafieldsIdentifier setKey(String key) { + this.key = key; + 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('}'); + } + } + public interface ImageQueryDefinition { void define(ImageQuery _queryBuilder); } @@ -34074,7 +32650,7 @@ public boolean unwrapsToObject(String key) { } /** - * ISO 369 language codes supported by Shopify. + * ISO 639-1 language codes supported by Shopify. */ public enum LanguageCode { /** @@ -40543,276 +39119,6 @@ public boolean unwrapsToObject(String key) { } } - public interface MetafieldConnectionQueryDefinition { - void define(MetafieldConnectionQuery _queryBuilder); - } - - /** - * An auto-generated type for paginating through multiple Metafields. - */ - public static class MetafieldConnectionQuery extends Query { - MetafieldConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * A list of edges. - */ - public MetafieldConnectionQuery edges(MetafieldEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new MetafieldEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * A list of the nodes contained in MetafieldEdge. - */ - public MetafieldConnectionQuery nodes(MetafieldQueryDefinition queryDef) { - startField("nodes"); - - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * Information to aid in pagination. - */ - public MetafieldConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * An auto-generated type for paginating through multiple Metafields. - */ - public static class MetafieldConnection extends AbstractResponse { - public MetafieldConnection() { - } - - public MetafieldConnection(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 MetafieldEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Metafield(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 "MetafieldConnection"; - } - - /** - * A list of edges. - */ - - public List getEdges() { - return (List) get("edges"); - } - - public MetafieldConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; - } - - /** - * A list of the nodes contained in MetafieldEdge. - */ - - public List getNodes() { - return (List) get("nodes"); - } - - public MetafieldConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; - } - - /** - * Information to aid in pagination. - */ - - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } - - public MetafieldConnection 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 MetafieldEdgeQueryDefinition { - void define(MetafieldEdgeQuery _queryBuilder); - } - - /** - * An auto-generated type which holds one Metafield and a cursor during pagination. - */ - public static class MetafieldEdgeQuery extends Query { - MetafieldEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * A cursor for use in pagination. - */ - public MetafieldEdgeQuery cursor() { - startField("cursor"); - - return this; - } - - /** - * The item at the end of MetafieldEdge. - */ - public MetafieldEdgeQuery node(MetafieldQueryDefinition queryDef) { - startField("node"); - - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - } - - /** - * An auto-generated type which holds one Metafield and a cursor during pagination. - */ - public static class MetafieldEdge extends AbstractResponse { - public MetafieldEdge() { - } - - public MetafieldEdge(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 Metafield(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 "MetafieldEdge"; - } - - /** - * A cursor for use in pagination. - */ - - public String getCursor() { - return (String) get("cursor"); - } - - public MetafieldEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; - } - - /** - * The item at the end of MetafieldEdge. - */ - - public Metafield getNode() { - return (Metafield) get("node"); - } - - public MetafieldEdge setNode(Metafield 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 MetafieldFilter implements Serializable { private String namespace; @@ -41628,7 +39934,7 @@ public MoneyV2Query currencyCode() { /** * A monetary value with currency. */ - public static class MoneyV2 extends AbstractResponse implements PricingValue { + public static class MoneyV2 extends AbstractResponse implements PricingValue, SellingPlanCheckoutChargeValue { public MoneyV2() { } @@ -41819,7 +40125,7 @@ public class CartDiscountCodesUpdateArguments extends Arguments { } /** - * The discount codes to apply to the cart. + * The case-insensitive discount codes that the customer added at checkout. */ public CartDiscountCodesUpdateArguments discountCodes(List value) { if (value != null) { @@ -42008,30 +40314,6 @@ public MutationQuery cartNoteUpdate(ID cartId, CartNoteUpdateArgumentsDefinition return this; } - /** - * Updates the attributes of a checkout if `allowPartialAddresses` is `true`. - * - * @deprecated Use `checkoutAttributesUpdateV2` instead - */ - @Deprecated - public MutationQuery checkoutAttributesUpdate(ID checkoutId, CheckoutAttributesUpdateInput input, CheckoutAttributesUpdatePayloadQueryDefinition queryDef) { - startField("checkoutAttributesUpdate"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",input:"); - input.appendTo(_queryBuilder); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutAttributesUpdatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - /** * Updates the attributes of a checkout if `allowPartialAddresses` is `true`. */ @@ -42072,30 +40354,6 @@ public MutationQuery checkoutCompleteFree(ID checkoutId, CheckoutCompleteFreePay return this; } - /** - * Completes a checkout using a credit card token from Shopify's Vault. - * - * @deprecated Use `checkoutCompleteWithCreditCardV2` instead - */ - @Deprecated - public MutationQuery checkoutCompleteWithCreditCard(ID checkoutId, CreditCardPaymentInput payment, CheckoutCompleteWithCreditCardPayloadQueryDefinition queryDef) { - startField("checkoutCompleteWithCreditCard"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",payment:"); - payment.appendTo(_queryBuilder); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutCompleteWithCreditCardPayloadQuery(_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 @@ -42119,54 +40377,6 @@ public MutationQuery checkoutCompleteWithCreditCardV2(ID checkoutId, CreditCardP return this; } - /** - * Completes a checkout with a tokenized payment. - * - * @deprecated Use `checkoutCompleteWithTokenizedPaymentV2` instead - */ - @Deprecated - public MutationQuery checkoutCompleteWithTokenizedPayment(ID checkoutId, TokenizedPaymentInput payment, CheckoutCompleteWithTokenizedPaymentPayloadQueryDefinition queryDef) { - startField("checkoutCompleteWithTokenizedPayment"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",payment:"); - payment.appendTo(_queryBuilder); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutCompleteWithTokenizedPaymentPayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * Completes a checkout with a tokenized payment. - * - * @deprecated Use `checkoutCompleteWithTokenizedPaymentV3` instead - */ - @Deprecated - public MutationQuery checkoutCompleteWithTokenizedPaymentV2(ID checkoutId, TokenizedPaymentInputV2 payment, CheckoutCompleteWithTokenizedPaymentV2PayloadQueryDefinition queryDef) { - startField("checkoutCompleteWithTokenizedPaymentV2"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",payment:"); - payment.appendTo(_queryBuilder); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutCompleteWithTokenizedPaymentV2PayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - /** * Completes a checkout with a tokenized payment. */ @@ -42236,30 +40446,6 @@ public MutationQuery checkoutCreate(CheckoutCreateInput input, CheckoutCreateArg return this; } - /** - * Associates a customer to the checkout. - * - * @deprecated Use `checkoutCustomerAssociateV2` instead - */ - @Deprecated - public MutationQuery checkoutCustomerAssociate(ID checkoutId, String customerAccessToken, CheckoutCustomerAssociatePayloadQueryDefinition queryDef) { - startField("checkoutCustomerAssociate"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutCustomerAssociatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - /** * Associates a customer to the checkout. */ @@ -42281,27 +40467,6 @@ public MutationQuery checkoutCustomerAssociateV2(ID checkoutId, String customerA return this; } - /** - * Disassociates the current checkout customer from the checkout. - * - * @deprecated Use `checkoutCustomerDisassociateV2` instead - */ - @Deprecated - public MutationQuery checkoutCustomerDisassociate(ID checkoutId, CheckoutCustomerDisassociatePayloadQueryDefinition queryDef) { - startField("checkoutCustomerDisassociate"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutCustomerDisassociatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - /** * Disassociates the current checkout customer from the checkout. */ @@ -42320,30 +40485,6 @@ public MutationQuery checkoutCustomerDisassociateV2(ID checkoutId, CheckoutCusto return this; } - /** - * Applies a discount to an existing checkout using a discount code. - * - * @deprecated Use `checkoutDiscountCodeApplyV2` instead - */ - @Deprecated - public MutationQuery checkoutDiscountCodeApply(String discountCode, ID checkoutId, CheckoutDiscountCodeApplyPayloadQueryDefinition queryDef) { - startField("checkoutDiscountCodeApply"); - - _queryBuilder.append("(discountCode:"); - Query.appendQuotedString(_queryBuilder, discountCode.toString()); - - _queryBuilder.append(",checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutDiscountCodeApplyPayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - /** * Applies a discount to an existing checkout using a discount code. */ @@ -42366,7 +40507,7 @@ public MutationQuery checkoutDiscountCodeApplyV2(String discountCode, ID checkou } /** - * Removes the applied discount from an existing checkout. + * Removes the applied discounts from an existing checkout. */ public MutationQuery checkoutDiscountCodeRemove(ID checkoutId, CheckoutDiscountCodeRemovePayloadQueryDefinition queryDef) { startField("checkoutDiscountCodeRemove"); @@ -42383,30 +40524,6 @@ public MutationQuery checkoutDiscountCodeRemove(ID checkoutId, CheckoutDiscountC return this; } - /** - * Updates the email on an existing checkout. - * - * @deprecated Use `checkoutEmailUpdateV2` instead - */ - @Deprecated - public MutationQuery checkoutEmailUpdate(ID checkoutId, String email, CheckoutEmailUpdatePayloadQueryDefinition queryDef) { - startField("checkoutEmailUpdate"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",email:"); - Query.appendQuotedString(_queryBuilder, email.toString()); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutEmailUpdatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - /** * Updates the email on an existing checkout. */ @@ -42428,55 +40545,6 @@ public MutationQuery checkoutEmailUpdateV2(ID checkoutId, String email, Checkout return this; } - /** - * Applies a gift card to an existing checkout using a gift card code. This will replace all currently - * applied gift cards. - * - * @deprecated Use `checkoutGiftCardsAppend` instead - */ - @Deprecated - public MutationQuery checkoutGiftCardApply(String giftCardCode, ID checkoutId, CheckoutGiftCardApplyPayloadQueryDefinition queryDef) { - startField("checkoutGiftCardApply"); - - _queryBuilder.append("(giftCardCode:"); - Query.appendQuotedString(_queryBuilder, giftCardCode.toString()); - - _queryBuilder.append(",checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutGiftCardApplyPayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * Removes an applied gift card from the checkout. - * - * @deprecated Use `checkoutGiftCardRemoveV2` instead - */ - @Deprecated - public MutationQuery checkoutGiftCardRemove(ID appliedGiftCardId, ID checkoutId, CheckoutGiftCardRemovePayloadQueryDefinition queryDef) { - startField("checkoutGiftCardRemove"); - - _queryBuilder.append("(appliedGiftCardId:"); - Query.appendQuotedString(_queryBuilder, appliedGiftCardId.toString()); - - _queryBuilder.append(",checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutGiftCardRemovePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - /** * Removes an applied gift card from the checkout. */ @@ -42648,30 +40716,6 @@ public MutationQuery checkoutLineItemsUpdate(ID checkoutId, List {}, queryDef); - } - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - @Deprecated - public OrderQuery metafields(MetafieldsArgumentsDefinition argsDef, MetafieldConnectionQueryDefinition queryDef) { + public OrderQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { startField("metafields"); - MetafieldsArguments args = new MetafieldsArguments(_queryBuilder); - argsDef.define(args); - MetafieldsArguments.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 MetafieldConnectionQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -45886,7 +43552,17 @@ public Order(JsonObject fields) throws SchemaViolationError { } case "metafields": { - responseData.put(key, new MetafieldConnection(jsonAsObject(field.getValue(), key))); + 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; } @@ -46301,17 +43977,14 @@ public Order setMetafield(Metafield arg) { } /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public MetafieldConnection getMetafields() { - return (MetafieldConnection) get("metafields"); + public List getMetafields() { + return (List) get("metafields"); } - public Order setMetafields(MetafieldConnection arg) { + public Order setMetafields(List arg) { optimisticData.put(getKey("metafields"), arg); return this; } @@ -48045,108 +45718,28 @@ public PageQuery metafield(String namespace, String key, MetafieldQueryDefinitio return this; } - public class MetafieldsArguments extends Arguments { - MetafieldsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Container for a set of metafields (maximum of 20 characters). - */ - public MetafieldsArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the first `n` elements from the list. - */ - public MetafieldsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public MetafieldsArguments 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 MetafieldsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public MetafieldsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Reverse the order of the underlying list. - */ - public MetafieldsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - } - - public interface MetafieldsArgumentsDefinition { - void define(MetafieldsArguments args); - } - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public PageQuery metafields(MetafieldConnectionQueryDefinition queryDef) { - return metafields(args -> {}, queryDef); - } - - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - - */ - @Deprecated - public PageQuery metafields(MetafieldsArgumentsDefinition argsDef, MetafieldConnectionQueryDefinition queryDef) { + public PageQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { startField("metafields"); - MetafieldsArguments args = new MetafieldsArguments(_queryBuilder); - argsDef.define(args); - MetafieldsArguments.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 MetafieldConnectionQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -48249,7 +45842,17 @@ public Page(JsonObject fields) throws SchemaViolationError { } case "metafields": { - responseData.put(key, new MetafieldConnection(jsonAsObject(field.getValue(), key))); + 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; } @@ -48382,17 +45985,14 @@ public Page setMetafield(Metafield arg) { } /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public MetafieldConnection getMetafields() { - return (MetafieldConnection) get("metafields"); + public List getMetafields() { + return (List) get("metafields"); } - public Page setMetafields(MetafieldConnection arg) { + public Page setMetafields(List arg) { optimisticData.put(getKey("metafields"), arg); return this; } @@ -49115,7 +46715,7 @@ public PaymentQuery nextActionUrl() { } /** - * Whether or not the payment is still processing asynchronously. + * Whether the payment is still processing asynchronously. */ public PaymentQuery ready() { startField("ready"); @@ -49397,7 +46997,7 @@ public Payment setNextActionUrl(String arg) { } /** - * Whether or not the payment is still processing asynchronously. + * Whether the payment is still processing asynchronously. */ public Boolean getReady() { @@ -50507,108 +48107,28 @@ public ProductQuery metafield(String namespace, String key, MetafieldQueryDefini return this; } - public class MetafieldsArguments extends Arguments { - MetafieldsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Container for a set of metafields (maximum of 20 characters). - */ - public MetafieldsArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the first `n` elements from the list. - */ - public MetafieldsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public MetafieldsArguments 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 MetafieldsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public MetafieldsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Reverse the order of the underlying list. - */ - public MetafieldsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - } - - public interface MetafieldsArgumentsDefinition { - void define(MetafieldsArguments args); - } - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public ProductQuery metafields(MetafieldConnectionQueryDefinition queryDef) { - return metafields(args -> {}, queryDef); - } - - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - - */ - @Deprecated - public ProductQuery metafields(MetafieldsArgumentsDefinition argsDef, MetafieldConnectionQueryDefinition queryDef) { + public ProductQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { startField("metafields"); - MetafieldsArguments args = new MetafieldsArguments(_queryBuilder); - argsDef.define(args); - MetafieldsArguments.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 MetafieldConnectionQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -51093,7 +48613,17 @@ public Product(JsonObject fields) throws SchemaViolationError { } case "metafields": { - responseData.put(key, new MetafieldConnection(jsonAsObject(field.getValue(), key))); + 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; } @@ -51387,17 +48917,14 @@ public Product setMetafield(Metafield arg) { } /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public MetafieldConnection getMetafields() { - return (MetafieldConnection) get("metafields"); + public List getMetafields() { + return (List) get("metafields"); } - public Product setMetafields(MetafieldConnection arg) { + public Product setMetafields(List arg) { optimisticData.put(getKey("metafields"), arg); return this; } @@ -53003,108 +50530,28 @@ public ProductVariantQuery metafield(String namespace, String key, MetafieldQuer return this; } - public class MetafieldsArguments extends Arguments { - MetafieldsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Container for a set of metafields (maximum of 20 characters). - */ - public MetafieldsArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the first `n` elements from the list. - */ - public MetafieldsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public MetafieldsArguments 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 MetafieldsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public MetafieldsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Reverse the order of the underlying list. - */ - public MetafieldsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - } - - public interface MetafieldsArgumentsDefinition { - void define(MetafieldsArguments args); - } - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - - */ - public ProductVariantQuery metafields(MetafieldConnectionQueryDefinition queryDef) { - return metafields(args -> {}, queryDef); - } - - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - @Deprecated - public ProductVariantQuery metafields(MetafieldsArgumentsDefinition argsDef, MetafieldConnectionQueryDefinition queryDef) { + public ProductVariantQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { startField("metafields"); - MetafieldsArguments args = new MetafieldsArguments(_queryBuilder); - argsDef.define(args); - MetafieldsArguments.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 MetafieldConnectionQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -53510,7 +50957,17 @@ public ProductVariant(JsonObject fields) throws SchemaViolationError { } case "metafields": { - responseData.put(key, new MetafieldConnection(jsonAsObject(field.getValue(), key))); + 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; } @@ -53754,17 +51211,14 @@ public ProductVariant setMetafield(Metafield arg) { } /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public MetafieldConnection getMetafields() { - return (MetafieldConnection) get("metafields"); + public List getMetafields() { + return (List) get("metafields"); } - public ProductVariant setMetafields(MetafieldConnection arg) { + public ProductVariant setMetafields(List arg) { optimisticData.put(getKey("metafields"), arg); return this; } @@ -55592,6 +53046,95 @@ public QueryRootQuery shop(ShopQueryDefinition queryDef) { return this; } + public class UrlRedirectsArguments extends Arguments { + UrlRedirectsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * 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; + } + + /** + * Reverse the order of the underlying list. + */ + public UrlRedirectsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } + } + + public interface UrlRedirectsArgumentsDefinition { + void define(UrlRedirectsArguments args); + } + + /** + * A list of redirects for a shop. + */ + public QueryRootQuery urlRedirects(UrlRedirectConnectionQueryDefinition queryDef) { + return urlRedirects(args -> {}, queryDef); + } + + /** + * A list of redirects for a shop. + */ + 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 UrlRedirectConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + public String toString() { return _queryBuilder.toString(); } @@ -55845,6 +53388,12 @@ public QueryRoot(JsonObject fields) throws SchemaViolationError { break; } + case "urlRedirects": { + responseData.put(key, new UrlRedirectConnection(jsonAsObject(field.getValue(), key))); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -56199,6 +53748,19 @@ public QueryRoot setShop(Shop arg) { return this; } + /** + * A list of redirects for a shop. + */ + + 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 "articles": return true; @@ -56251,6 +53813,8 @@ public boolean unwrapsToObject(String key) { case "shop": return true; + case "urlRedirects": return true; + default: return false; } } @@ -56744,6 +54308,19 @@ public static class SellingPlanQuery extends Query { super(_queryBuilder); } + /** + * The initial payment due for the purchase. + */ + public SellingPlanQuery checkoutCharge(SellingPlanCheckoutChargeQueryDefinition queryDef) { + startField("checkoutCharge"); + + _queryBuilder.append('{'); + queryDef.define(new SellingPlanCheckoutChargeQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + /** * The description of the selling plan. */ @@ -56820,6 +54397,12 @@ public SellingPlan(JsonObject fields) throws SchemaViolationError { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { + case "checkoutCharge": { + responseData.put(key, new SellingPlanCheckoutCharge(jsonAsObject(field.getValue(), key))); + + break; + } + case "description": { String optional1 = null; if (!field.getValue().isJsonNull()) { @@ -56886,6 +54469,19 @@ public String getGraphQlTypeName() { return "SellingPlan"; } + /** + * The initial payment due for the purchase. + */ + + public SellingPlanCheckoutCharge getCheckoutCharge() { + return (SellingPlanCheckoutCharge) get("checkoutCharge"); + } + + public SellingPlan setCheckoutCharge(SellingPlanCheckoutCharge arg) { + optimisticData.put(getKey("checkoutCharge"), arg); + return this; + } + /** * The description of the selling plan. */ @@ -56967,6 +54563,8 @@ public SellingPlan setRecurringDeliveries(Boolean arg) { public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { + case "checkoutCharge": return true; + case "description": return false; case "id": return false; @@ -56998,6 +54596,19 @@ public static class SellingPlanAllocationQuery extends Query list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { @@ -57054,6 +54684,12 @@ public SellingPlanAllocation(JsonObject fields) throws SchemaViolationError { break; } + case "remainingBalanceChargeAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + case "sellingPlan": { responseData.put(key, new SellingPlan(jsonAsObject(field.getValue(), key))); @@ -57075,6 +54711,19 @@ public String getGraphQlTypeName() { return "SellingPlanAllocation"; } + /** + * The checkout charge amount due for the purchase. + */ + + 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 @@ -57091,6 +54740,19 @@ public SellingPlanAllocation setPriceAdjustments(List { + SellingPlanCheckoutChargeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The charge type for the checkout charge. + */ + public SellingPlanCheckoutChargeQuery type() { + startField("type"); + + return this; + } + + /** + * The charge value for the checkout charge. + */ + public SellingPlanCheckoutChargeQuery value(SellingPlanCheckoutChargeValueQueryDefinition queryDef) { + startField("value"); + + _queryBuilder.append('{'); + queryDef.define(new SellingPlanCheckoutChargeValueQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * The initial payment due for the purchase. + */ + public static class SellingPlanCheckoutCharge extends AbstractResponse { + public SellingPlanCheckoutCharge() { + } + + 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))); + + break; + } + + 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; + } + + /** + * The charge value for the checkout charge. + */ + + public SellingPlanCheckoutChargeValue getValue() { + return (SellingPlanCheckoutChargeValue) get("value"); + } + + public SellingPlanCheckoutCharge setValue(SellingPlanCheckoutChargeValue arg) { + optimisticData.put(getKey("value"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "type": return false; + + case "value": return false; + + default: return false; + } + } + } + + public interface SellingPlanCheckoutChargePercentageValueQueryDefinition { + void define(SellingPlanCheckoutChargePercentageValueQuery _queryBuilder); + } + + /** + * The percentage value of the price used for checkout charge. + */ + public static class SellingPlanCheckoutChargePercentageValueQuery extends Query { + SellingPlanCheckoutChargePercentageValueQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The percentage value of the price used for checkout charge. + */ + public SellingPlanCheckoutChargePercentageValueQuery percentage() { + startField("percentage"); + + return this; + } + } + + /** + * 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()); + } + } + } + } + + public String getGraphQlTypeName() { + return "SellingPlanCheckoutChargePercentageValue"; + } + + /** + * The percentage value of the price used for checkout charge. + */ + + public Double getPercentage() { + return (Double) get("percentage"); + } + + public SellingPlanCheckoutChargePercentageValue setPercentage(Double arg) { + optimisticData.put(getKey("percentage"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "percentage": return false; + + default: return false; + } + } + } + + /** + * The checkout charge when the full amount isn't charged at checkout. + */ + public enum SellingPlanCheckoutChargeType { + /** + * The checkout charge is a percentage of the product or variant price. + */ + PERCENTAGE, + + /** + * The checkout charge is a fixed price amount. + */ + PRICE, + + UNKNOWN_VALUE; + + public static SellingPlanCheckoutChargeType fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "PERCENTAGE": { + return PERCENTAGE; + } + + case "PRICE": { + return PRICE; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case PERCENTAGE: { + return "PERCENTAGE"; + } + + case PRICE: { + return "PRICE"; + } + + default: { + return ""; + } + } + } + } + + public interface SellingPlanCheckoutChargeValueQueryDefinition { + void define(SellingPlanCheckoutChargeValueQuery _queryBuilder); + } + + /** + * The portion of the price to be charged at checkout. + */ + public static class SellingPlanCheckoutChargeValueQuery extends Query { + SellingPlanCheckoutChargeValueQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("__typename"); + } + + public SellingPlanCheckoutChargeValueQuery onMoneyV2(MoneyV2QueryDefinition queryDef) { + startInlineFragment("MoneyV2"); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public SellingPlanCheckoutChargeValueQuery onSellingPlanCheckoutChargePercentageValue(SellingPlanCheckoutChargePercentageValueQueryDefinition queryDef) { + startInlineFragment("SellingPlanCheckoutChargePercentageValue"); + queryDef.define(new SellingPlanCheckoutChargePercentageValueQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + } + + public interface SellingPlanCheckoutChargeValue { + String getGraphQlTypeName(); + } + + /** + * The portion of the price to be charged at checkout. + */ + public static class UnknownSellingPlanCheckoutChargeValue extends AbstractResponse implements SellingPlanCheckoutChargeValue { + public UnknownSellingPlanCheckoutChargeValue() { + } + + 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()); + } + } + } + } + + 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); } @@ -59310,108 +57300,28 @@ public ShopQuery metafield(String namespace, String key, MetafieldQueryDefinitio return this; } - public class MetafieldsArguments extends Arguments { - MetafieldsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Container for a set of metafields (maximum of 20 characters). - */ - public MetafieldsArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the first `n` elements from the list. - */ - public MetafieldsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public MetafieldsArguments 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 MetafieldsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public MetafieldsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Reverse the order of the underlying list. - */ - public MetafieldsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - } - - public interface MetafieldsArgumentsDefinition { - void define(MetafieldsArguments args); - } - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public ShopQuery metafields(MetafieldConnectionQueryDefinition queryDef) { - return metafields(args -> {}, queryDef); - } - - /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - - */ - @Deprecated - public ShopQuery metafields(MetafieldsArgumentsDefinition argsDef, MetafieldConnectionQueryDefinition queryDef) { + public ShopQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { startField("metafields"); - MetafieldsArguments args = new MetafieldsArguments(_queryBuilder); - argsDef.define(args); - MetafieldsArguments.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 MetafieldConnectionQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -59577,7 +57487,17 @@ public Shop(JsonObject fields) throws SchemaViolationError { } case "metafields": { - responseData.put(key, new MetafieldConnection(jsonAsObject(field.getValue(), key))); + 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; } @@ -59727,17 +57647,14 @@ public Shop setMetafield(Metafield arg) { } /** - * A paginated list of metafields associated with the resource. - * - * @deprecated The `metafields` field will be removed in the future in favor of using [aliases](https://graphql.org/learn/queries/#aliases) with the `metafield` field. - + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public MetafieldConnection getMetafields() { - return (MetafieldConnection) get("metafields"); + public List getMetafields() { + return (List) get("metafields"); } - public Shop setMetafields(MetafieldConnection arg) { + public Shop setMetafields(List arg) { optimisticData.put(getKey("metafields"), arg); return this; } @@ -60320,7 +58237,7 @@ public static class StoreAvailabilityQuery extends Query } /** - * Whether or not this product variant is in-stock at this location. + * Whether the product variant is in-stock at this location. */ public StoreAvailabilityQuery available() { startField("available"); @@ -60400,7 +58317,7 @@ public String getGraphQlTypeName() { } /** - * Whether or not this product variant is in-stock at this location. + * Whether the product variant is in-stock at this location. */ public Boolean getAvailable() { @@ -60949,344 +58866,6 @@ public boolean unwrapsToObject(String key) { } } - public static class TokenizedPaymentInput implements Serializable { - private BigDecimal amount; - - private String idempotencyKey; - - private MailingAddressInput billingAddress; - - private String type; - - private String paymentData; - - private Input test = Input.undefined(); - - private Input identifier = Input.undefined(); - - public TokenizedPaymentInput(BigDecimal amount, String idempotencyKey, MailingAddressInput billingAddress, String type, String paymentData) { - this.amount = amount; - - this.idempotencyKey = idempotencyKey; - - this.billingAddress = billingAddress; - - this.type = type; - - this.paymentData = paymentData; - } - - public BigDecimal getAmount() { - return amount; - } - - public TokenizedPaymentInput setAmount(BigDecimal amount) { - this.amount = amount; - return this; - } - - public String getIdempotencyKey() { - return idempotencyKey; - } - - public TokenizedPaymentInput setIdempotencyKey(String idempotencyKey) { - this.idempotencyKey = idempotencyKey; - return this; - } - - public MailingAddressInput getBillingAddress() { - return billingAddress; - } - - public TokenizedPaymentInput setBillingAddress(MailingAddressInput billingAddress) { - this.billingAddress = billingAddress; - return this; - } - - public String getType() { - return type; - } - - public TokenizedPaymentInput setType(String type) { - this.type = type; - return this; - } - - public String getPaymentData() { - return paymentData; - } - - public TokenizedPaymentInput setPaymentData(String paymentData) { - this.paymentData = paymentData; - return this; - } - - public Boolean getTest() { - return test.getValue(); - } - - public Input getTestInput() { - return test; - } - - public TokenizedPaymentInput setTest(Boolean test) { - this.test = Input.optional(test); - return this; - } - - public TokenizedPaymentInput 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 TokenizedPaymentInput setIdentifier(String identifier) { - this.identifier = Input.optional(identifier); - return this; - } - - public TokenizedPaymentInput 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("amount:"); - Query.appendQuotedString(_queryBuilder, amount.toString()); - - _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("type:"); - Query.appendQuotedString(_queryBuilder, type.toString()); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("paymentData:"); - Query.appendQuotedString(_queryBuilder, paymentData.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 static class TokenizedPaymentInputV2 implements Serializable { - private MoneyInput paymentAmount; - - private String idempotencyKey; - - private MailingAddressInput billingAddress; - - private String paymentData; - - private String type; - - private Input test = Input.undefined(); - - private Input identifier = Input.undefined(); - - public TokenizedPaymentInputV2(MoneyInput paymentAmount, String idempotencyKey, MailingAddressInput billingAddress, String paymentData, String type) { - this.paymentAmount = paymentAmount; - - this.idempotencyKey = idempotencyKey; - - this.billingAddress = billingAddress; - - this.paymentData = paymentData; - - this.type = type; - } - - public MoneyInput getPaymentAmount() { - return paymentAmount; - } - - public TokenizedPaymentInputV2 setPaymentAmount(MoneyInput paymentAmount) { - this.paymentAmount = paymentAmount; - return this; - } - - public String getIdempotencyKey() { - return idempotencyKey; - } - - public TokenizedPaymentInputV2 setIdempotencyKey(String idempotencyKey) { - this.idempotencyKey = idempotencyKey; - return this; - } - - public MailingAddressInput getBillingAddress() { - return billingAddress; - } - - public TokenizedPaymentInputV2 setBillingAddress(MailingAddressInput billingAddress) { - this.billingAddress = billingAddress; - return this; - } - - public String getPaymentData() { - return paymentData; - } - - public TokenizedPaymentInputV2 setPaymentData(String paymentData) { - this.paymentData = paymentData; - return this; - } - - public String getType() { - return type; - } - - public TokenizedPaymentInputV2 setType(String type) { - this.type = type; - return this; - } - - public Boolean getTest() { - return test.getValue(); - } - - public Input getTestInput() { - return test; - } - - public TokenizedPaymentInputV2 setTest(Boolean test) { - this.test = Input.optional(test); - return this; - } - - public TokenizedPaymentInputV2 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 TokenizedPaymentInputV2 setIdentifier(String identifier) { - this.identifier = Input.optional(identifier); - return this; - } - - public TokenizedPaymentInputV2 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:"); - Query.appendQuotedString(_queryBuilder, 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 static class TokenizedPaymentInputV3 implements Serializable { private MoneyInput paymentAmount; @@ -62383,6 +59962,408 @@ public String toString() { } } + public interface UrlRedirectQueryDefinition { + void define(UrlRedirectQuery _queryBuilder); + } + + /** + * A redirect on the online store. + */ + public static class UrlRedirectQuery extends Query { + UrlRedirectQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); + } + + /** + * The old path to be redirected from. When the user visits this path, they'll be redirected to the + * target location. + */ + public UrlRedirectQuery path() { + startField("path"); + + return this; + } + + /** + * The target location where the user will be redirected to. + */ + public UrlRedirectQuery target() { + startField("target"); + + return this; + } + } + + /** + * A redirect on the online store. + */ + public static class UrlRedirect extends AbstractResponse implements Node { + public UrlRedirect() { + } + + public UrlRedirect(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))); + + break; + } + + case "path": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "target": { + 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 UrlRedirect(ID id) { + this(); + optimisticData.put("id", id); + } + + public String getGraphQlTypeName() { + return "UrlRedirect"; + } + + /** + * The ID of the URL redirect. + */ + + public ID getId() { + return (ID) get("id"); + } + + /** + * The old path to be redirected from. When the user visits this path, they'll be redirected to the + * target location. + */ + + public String getPath() { + return (String) get("path"); + } + + public UrlRedirect setPath(String arg) { + optimisticData.put(getKey("path"), arg); + return this; + } + + /** + * The target location where the user will be redirected to. + */ + + public String getTarget() { + return (String) get("target"); + } + + public UrlRedirect setTarget(String arg) { + optimisticData.put(getKey("target"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "id": return false; + + case "path": return false; + + case "target": return false; + + default: return false; + } + } + } + + public interface UrlRedirectConnectionQueryDefinition { + void define(UrlRedirectConnectionQuery _queryBuilder); + } + + /** + * An auto-generated type for paginating through multiple UrlRedirects. + */ + public static class UrlRedirectConnectionQuery extends Query { + UrlRedirectConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * A list of edges. + */ + public UrlRedirectConnectionQuery edges(UrlRedirectEdgeQueryDefinition queryDef) { + startField("edges"); + + _queryBuilder.append('{'); + queryDef.define(new UrlRedirectEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * A list of the nodes contained in UrlRedirectEdge. + */ + public UrlRedirectConnectionQuery nodes(UrlRedirectQueryDefinition queryDef) { + startField("nodes"); + + _queryBuilder.append('{'); + queryDef.define(new UrlRedirectQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * Information to aid in pagination. + */ + public UrlRedirectConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); + + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * An auto-generated type for paginating through multiple UrlRedirects. + */ + public static class UrlRedirectConnection extends AbstractResponse { + public UrlRedirectConnection() { + } + + public UrlRedirectConnection(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 UrlRedirectEdge(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UrlRedirect(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 "UrlRedirectConnection"; + } + + /** + * A list of edges. + */ + + public List getEdges() { + return (List) get("edges"); + } + + public UrlRedirectConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; + } + + /** + * A list of the nodes contained in UrlRedirectEdge. + */ + + public List getNodes() { + return (List) get("nodes"); + } + + public UrlRedirectConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; + } + + /** + * Information to aid in pagination. + */ + + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } + + public UrlRedirectConnection 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 UrlRedirectEdgeQueryDefinition { + void define(UrlRedirectEdgeQuery _queryBuilder); + } + + /** + * An auto-generated type which holds one UrlRedirect and a cursor during pagination. + */ + public static class UrlRedirectEdgeQuery extends Query { + UrlRedirectEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * A cursor for use in pagination. + */ + public UrlRedirectEdgeQuery cursor() { + startField("cursor"); + + return this; + } + + /** + * The item at the end of UrlRedirectEdge. + */ + public UrlRedirectEdgeQuery node(UrlRedirectQueryDefinition queryDef) { + startField("node"); + + _queryBuilder.append('{'); + queryDef.define(new UrlRedirectQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * An auto-generated type which holds one UrlRedirect and a cursor during pagination. + */ + public static class UrlRedirectEdge extends AbstractResponse { + public UrlRedirectEdge() { + } + + public UrlRedirectEdge(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 UrlRedirect(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 "UrlRedirectEdge"; + } + + /** + * A cursor for use in pagination. + */ + + public String getCursor() { + return (String) get("cursor"); + } + + public UrlRedirectEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); + return this; + } + + /** + * The item at the end of UrlRedirectEdge. + */ + + public UrlRedirect getNode() { + return (UrlRedirect) get("node"); + } + + public UrlRedirectEdge setNode(UrlRedirect 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 UserErrorQueryDefinition { void define(UserErrorQuery _queryBuilder); }