diff --git a/MobileBuy/buy3/gradle.properties b/MobileBuy/buy3/gradle.properties index 5352b1a8..f09ace53 100644 --- a/MobileBuy/buy3/gradle.properties +++ b/MobileBuy/buy3/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=15.1.0 +VERSION_NAME=16.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 7d8a855e..4b6920d9 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 = "2023-01"; + public static final String API_VERSION = "2023-04"; public static QueryRootQuery query(QueryRootQueryDefinition queryDef) { return query(Collections.emptyList(), queryDef); @@ -316,6 +316,240 @@ public boolean unwrapsToObject(String key) { } } + public static class ApplePayWalletContentInput implements Serializable { + private MailingAddressInput billingAddress; + + private String data; + + private ApplePayWalletHeaderInput header; + + private String signature; + + private String version; + + private Input lastDigits = Input.undefined(); + + public ApplePayWalletContentInput(MailingAddressInput billingAddress, String data, ApplePayWalletHeaderInput header, String signature, String version) { + this.billingAddress = billingAddress; + + this.data = data; + + this.header = header; + + this.signature = signature; + + this.version = version; + } + + public MailingAddressInput getBillingAddress() { + return billingAddress; + } + + public ApplePayWalletContentInput setBillingAddress(MailingAddressInput billingAddress) { + this.billingAddress = billingAddress; + return this; + } + + public String getData() { + return data; + } + + public ApplePayWalletContentInput setData(String data) { + this.data = data; + return this; + } + + public ApplePayWalletHeaderInput getHeader() { + return header; + } + + public ApplePayWalletContentInput setHeader(ApplePayWalletHeaderInput header) { + this.header = header; + return this; + } + + public String getSignature() { + return signature; + } + + public ApplePayWalletContentInput setSignature(String signature) { + this.signature = signature; + return this; + } + + public String getVersion() { + return version; + } + + public ApplePayWalletContentInput setVersion(String version) { + this.version = version; + return this; + } + + public String getLastDigits() { + return lastDigits.getValue(); + } + + public Input getLastDigitsInput() { + return lastDigits; + } + + public ApplePayWalletContentInput setLastDigits(String lastDigits) { + this.lastDigits = Input.optional(lastDigits); + return this; + } + + public ApplePayWalletContentInput setLastDigitsInput(Input lastDigits) { + if (lastDigits == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.lastDigits = lastDigits; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("billingAddress:"); + billingAddress.appendTo(_queryBuilder); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("data:"); + Query.appendQuotedString(_queryBuilder, data.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("header:"); + header.appendTo(_queryBuilder); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("signature:"); + Query.appendQuotedString(_queryBuilder, signature.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("version:"); + Query.appendQuotedString(_queryBuilder, version.toString()); + + if (this.lastDigits.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("lastDigits:"); + if (lastDigits.getValue() != null) { + Query.appendQuotedString(_queryBuilder, lastDigits.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + _queryBuilder.append('}'); + } + } + + public static class ApplePayWalletHeaderInput implements Serializable { + private String ephemeralPublicKey; + + private String publicKeyHash; + + private String transactionId; + + private Input applicationData = Input.undefined(); + + public ApplePayWalletHeaderInput(String ephemeralPublicKey, String publicKeyHash, String transactionId) { + this.ephemeralPublicKey = ephemeralPublicKey; + + this.publicKeyHash = publicKeyHash; + + this.transactionId = transactionId; + } + + public String getEphemeralPublicKey() { + return ephemeralPublicKey; + } + + public ApplePayWalletHeaderInput setEphemeralPublicKey(String ephemeralPublicKey) { + this.ephemeralPublicKey = ephemeralPublicKey; + return this; + } + + public String getPublicKeyHash() { + return publicKeyHash; + } + + public ApplePayWalletHeaderInput setPublicKeyHash(String publicKeyHash) { + this.publicKeyHash = publicKeyHash; + return this; + } + + public String getTransactionId() { + return transactionId; + } + + public ApplePayWalletHeaderInput setTransactionId(String transactionId) { + this.transactionId = transactionId; + return this; + } + + public String getApplicationData() { + return applicationData.getValue(); + } + + public Input getApplicationDataInput() { + return applicationData; + } + + public ApplePayWalletHeaderInput setApplicationData(String applicationData) { + this.applicationData = Input.optional(applicationData); + return this; + } + + public ApplePayWalletHeaderInput setApplicationDataInput(Input applicationData) { + if (applicationData == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.applicationData = applicationData; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("ephemeralPublicKey:"); + Query.appendQuotedString(_queryBuilder, ephemeralPublicKey.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("publicKeyHash:"); + Query.appendQuotedString(_queryBuilder, publicKeyHash.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("transactionId:"); + Query.appendQuotedString(_queryBuilder, transactionId.toString()); + + if (this.applicationData.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("applicationData:"); + if (applicationData.getValue() != null) { + Query.appendQuotedString(_queryBuilder, applicationData.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + _queryBuilder.append('}'); + } + } + public interface AppliedGiftCardQueryDefinition { void define(AppliedGiftCardQuery _queryBuilder); } @@ -2502,276 +2736,186 @@ public boolean unwrapsToObject(String key) { } } - public interface BlogQueryDefinition { - void define(BlogQuery _queryBuilder); + public interface BaseCartLineQueryDefinition { + void define(BaseCartLineQuery _queryBuilder); } /** - * An online store blog. + * Represents a cart line common fields. */ - public static class BlogQuery extends Query { - BlogQuery(StringBuilder _queryBuilder) { + public static class BaseCartLineQuery extends Query { + BaseCartLineQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - startField("id"); + startField("__typename"); } /** - * Find an article by its handle. + * An attribute associated with the cart line. */ - public BlogQuery articleByHandle(String handle, ArticleQueryDefinition queryDef) { - startField("articleByHandle"); + public BaseCartLineQuery attribute(String key, AttributeQueryDefinition queryDef) { + startField("attribute"); - _queryBuilder.append("(handle:"); - Query.appendQuotedString(_queryBuilder, handle.toString()); + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new ArticleQuery(_queryBuilder)); + queryDef.define(new AttributeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - public class ArticlesArguments extends Arguments { - ArticlesArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public ArticlesArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public ArticlesArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the last `n` elements from the list. - */ - public ArticlesArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public ArticlesArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Reverse the order of the underlying list. - */ - public ArticlesArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Sort the underlying list by the given key. - */ - public ArticlesArguments sortKey(ArticleSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; - } - - /** - * Supported filter parameters: - * - `author` - * - `blog_title` - * - `created_at` - * - `tag` - * - `tag_not` - * - `updated_at` - * See the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) - * for more information about using filters. - */ - public ArticlesArguments query(String value) { - if (value != null) { - startArgument("query"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - } - - public interface ArticlesArgumentsDefinition { - void define(ArticlesArguments args); - } - - /** - * List of the blog's articles. - */ - public BlogQuery articles(ArticleConnectionQueryDefinition queryDef) { - return articles(args -> {}, queryDef); - } - /** - * List of the blog's articles. + * The attributes associated with the cart line. Attributes are represented as key-value pairs. */ - public BlogQuery articles(ArticlesArgumentsDefinition argsDef, ArticleConnectionQueryDefinition queryDef) { - startField("articles"); - - ArticlesArguments args = new ArticlesArguments(_queryBuilder); - argsDef.define(args); - ArticlesArguments.end(args); + public BaseCartLineQuery attributes(AttributeQueryDefinition queryDef) { + startField("attributes"); _queryBuilder.append('{'); - queryDef.define(new ArticleConnectionQuery(_queryBuilder)); + queryDef.define(new AttributeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The authors who have contributed to the blog. + * 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 BlogQuery authors(ArticleAuthorQueryDefinition queryDef) { - startField("authors"); + public BaseCartLineQuery cost(CartLineCostQueryDefinition queryDef) { + startField("cost"); _queryBuilder.append('{'); - queryDef.define(new ArticleAuthorQuery(_queryBuilder)); + queryDef.define(new CartLineCostQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A human-friendly unique string for the Blog automatically generated from its title. + * The discounts that have been applied to the cart line. */ - public BlogQuery handle() { - startField("handle"); + public BaseCartLineQuery discountAllocations(CartDiscountAllocationQueryDefinition queryDef) { + startField("discountAllocations"); + + _queryBuilder.append('{'); + queryDef.define(new CartDiscountAllocationQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * Returns a metafield found by namespace and key. + * 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 BlogQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { - startField("metafield"); - - _queryBuilder.append("(namespace:"); - Query.appendQuotedString(_queryBuilder, namespace.toString()); - - _queryBuilder.append(",key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); - - _queryBuilder.append(')'); + @Deprecated + public BaseCartLineQuery estimatedCost(CartLineEstimatedCostQueryDefinition queryDef) { + startField("estimatedCost"); _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); + queryDef.define(new CartLineEstimatedCostQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * A globally-unique identifier. */ - public BlogQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); + public BaseCartLineQuery id() { + startField("id"); - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); + return this; + } - _queryBuilder.append(')'); + /** + * The merchandise that the buyer intends to purchase. + */ + public BaseCartLineQuery merchandise(MerchandiseQueryDefinition queryDef) { + startField("merchandise"); _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); + queryDef.define(new MerchandiseQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. + * The quantity of the merchandise that the customer intends to purchase. */ - public BlogQuery onlineStoreUrl() { - startField("onlineStoreUrl"); + public BaseCartLineQuery quantity() { + startField("quantity"); return this; } /** - * The blog's SEO information. + * The selling plan associated with the cart line and the effect that each selling plan has on variants + * when they're purchased. */ - public BlogQuery seo(SEOQueryDefinition queryDef) { - startField("seo"); + public BaseCartLineQuery sellingPlanAllocation(SellingPlanAllocationQueryDefinition queryDef) { + startField("sellingPlanAllocation"); _queryBuilder.append('{'); - queryDef.define(new SEOQuery(_queryBuilder)); + queryDef.define(new SellingPlanAllocationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - /** - * The blogs’s title. - */ - public BlogQuery title() { - startField("title"); - + public BaseCartLineQuery onCartLine(CartLineQueryDefinition queryDef) { + startInlineFragment("CartLine"); + queryDef.define(new CartLineQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } + public interface BaseCartLine { + String getGraphQlTypeName(); + + Attribute getAttribute(); + + List getAttributes(); + + CartLineCost getCost(); + + List getDiscountAllocations(); + + CartLineEstimatedCost getEstimatedCost(); + + ID getId(); + + Merchandise getMerchandise(); + + Integer getQuantity(); + + SellingPlanAllocation getSellingPlanAllocation(); + } + /** - * An online store blog. + * Represents a cart line common fields. */ - public static class Blog extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node, OnlineStorePublishable { - public Blog() { + public static class UnknownBaseCartLine extends AbstractResponse implements BaseCartLine { + public UnknownBaseCartLine() { } - public Blog(JsonObject fields) throws SchemaViolationError { + public UnknownBaseCartLine(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "articleByHandle": { - Article optional1 = null; + case "attribute": { + Attribute optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Article(jsonAsObject(field.getValue(), key)); + optional1 = new Attribute(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -2779,16 +2923,10 @@ public Blog(JsonObject fields) throws SchemaViolationError { break; } - case "articles": { - responseData.put(key, new ArticleConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "authors": { - List list1 = new ArrayList<>(); + case "attributes": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ArticleAuthor(jsonAsObject(element1, key))); + list1.add(new Attribute(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -2796,60 +2934,51 @@ public Blog(JsonObject fields) throws SchemaViolationError { break; } - case "handle": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "cost": { + responseData.put(key, new CartLineCost(jsonAsObject(field.getValue(), key))); break; } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + 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 "metafield": { - Metafield optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "estimatedCost": { + responseData.put(key, new CartLineEstimatedCost(jsonAsObject(field.getValue(), key))); break; } - case "metafields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - list1.add(optional2); - } + break; + } - responseData.put(key, list1); + case "merchandise": { + responseData.put(key, UnknownMerchandise.create(jsonAsObject(field.getValue(), key))); break; } - case "onlineStoreUrl": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "quantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); break; } - case "seo": { - SEO optional1 = null; + case "sellingPlanAllocation": { + SellingPlanAllocation optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new SEO(jsonAsObject(field.getValue(), key)); + optional1 = new SellingPlanAllocation(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -2857,12 +2986,6 @@ public Blog(JsonObject fields) throws SchemaViolationError { break; } - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -2874,201 +2997,203 @@ public Blog(JsonObject fields) throws SchemaViolationError { } } - public Blog(ID id) { - this(); - optimisticData.put("id", id); + public static BaseCartLine create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "CartLine": { + return new CartLine(fields); + } + + default: { + return new UnknownBaseCartLine(fields); + } + } } public String getGraphQlTypeName() { - return "Blog"; + return (String) get("__typename"); } /** - * Find an article by its handle. + * An attribute associated with the cart line. */ - public Article getArticleByHandle() { - return (Article) get("articleByHandle"); + public Attribute getAttribute() { + return (Attribute) get("attribute"); } - public Blog setArticleByHandle(Article arg) { - optimisticData.put(getKey("articleByHandle"), arg); + public UnknownBaseCartLine setAttribute(Attribute arg) { + optimisticData.put(getKey("attribute"), arg); return this; } /** - * List of the blog's articles. + * The attributes associated with the cart line. Attributes are represented as key-value pairs. */ - public ArticleConnection getArticles() { - return (ArticleConnection) get("articles"); + public List getAttributes() { + return (List) get("attributes"); } - public Blog setArticles(ArticleConnection arg) { - optimisticData.put(getKey("articles"), arg); + public UnknownBaseCartLine setAttributes(List arg) { + optimisticData.put(getKey("attributes"), arg); return this; } /** - * The authors who have contributed to the blog. + * The cost of the merchandise that the buyer will pay for at checkout. The costs are subject to change + * and changes will be reflected at checkout. */ - public List getAuthors() { - return (List) get("authors"); + public CartLineCost getCost() { + return (CartLineCost) get("cost"); } - public Blog setAuthors(List arg) { - optimisticData.put(getKey("authors"), arg); + public UnknownBaseCartLine setCost(CartLineCost arg) { + optimisticData.put(getKey("cost"), arg); return this; } /** - * A human-friendly unique string for the Blog automatically generated from its title. + * The discounts that have been applied to the cart line. */ - public String getHandle() { - return (String) get("handle"); + public List getDiscountAllocations() { + return (List) get("discountAllocations"); } - public Blog setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); + public UnknownBaseCartLine setDiscountAllocations(List arg) { + optimisticData.put(getKey("discountAllocations"), arg); return this; } /** - * A globally-unique identifier. + * 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 ID getId() { - return (ID) get("id"); - } - - /** - * Returns a metafield found by namespace and key. - */ - - public Metafield getMetafield() { - return (Metafield) get("metafield"); + public CartLineEstimatedCost getEstimatedCost() { + return (CartLineEstimatedCost) get("estimatedCost"); } - public Blog setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); + public UnknownBaseCartLine setEstimatedCost(CartLineEstimatedCost arg) { + optimisticData.put(getKey("estimatedCost"), arg); return this; } /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * A globally-unique identifier. */ - public List getMetafields() { - return (List) get("metafields"); + public ID getId() { + return (ID) get("id"); } - public Blog setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); + public UnknownBaseCartLine setId(ID arg) { + optimisticData.put(getKey("id"), arg); return this; } /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. + * The merchandise that the buyer intends to purchase. */ - public String getOnlineStoreUrl() { - return (String) get("onlineStoreUrl"); + public Merchandise getMerchandise() { + return (Merchandise) get("merchandise"); } - public Blog setOnlineStoreUrl(String arg) { - optimisticData.put(getKey("onlineStoreUrl"), arg); + public UnknownBaseCartLine setMerchandise(Merchandise arg) { + optimisticData.put(getKey("merchandise"), arg); return this; } /** - * The blog's SEO information. + * The quantity of the merchandise that the customer intends to purchase. */ - public SEO getSeo() { - return (SEO) get("seo"); + public Integer getQuantity() { + return (Integer) get("quantity"); } - public Blog setSeo(SEO arg) { - optimisticData.put(getKey("seo"), arg); + public UnknownBaseCartLine setQuantity(Integer arg) { + optimisticData.put(getKey("quantity"), arg); return this; } /** - * The blogs’s title. + * The selling plan associated with the cart line and the effect that each selling plan has on variants + * when they're purchased. */ - public String getTitle() { - return (String) get("title"); + public SellingPlanAllocation getSellingPlanAllocation() { + return (SellingPlanAllocation) get("sellingPlanAllocation"); } - public Blog setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public UnknownBaseCartLine setSellingPlanAllocation(SellingPlanAllocation arg) { + optimisticData.put(getKey("sellingPlanAllocation"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "articleByHandle": return true; - - case "articles": return true; + case "attribute": return true; - case "authors": return true; + case "attributes": return true; - case "handle": return false; + case "cost": return true; - case "id": return false; + case "discountAllocations": return false; - case "metafield": return true; + case "estimatedCost": return true; - case "metafields": return true; + case "id": return false; - case "onlineStoreUrl": return false; + case "merchandise": return false; - case "seo": return true; + case "quantity": return false; - case "title": return false; + case "sellingPlanAllocation": return true; default: return false; } } } - public interface BlogConnectionQueryDefinition { - void define(BlogConnectionQuery _queryBuilder); + public interface BaseCartLineConnectionQueryDefinition { + void define(BaseCartLineConnectionQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple Blogs. + * An auto-generated type for paginating through multiple BaseCartLines. */ - public static class BlogConnectionQuery extends Query { - BlogConnectionQuery(StringBuilder _queryBuilder) { + public static class BaseCartLineConnectionQuery extends Query { + BaseCartLineConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A list of edges. */ - public BlogConnectionQuery edges(BlogEdgeQueryDefinition queryDef) { + public BaseCartLineConnectionQuery edges(BaseCartLineEdgeQueryDefinition queryDef) { startField("edges"); _queryBuilder.append('{'); - queryDef.define(new BlogEdgeQuery(_queryBuilder)); + queryDef.define(new BaseCartLineEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in BlogEdge. + * A list of the nodes contained in BaseCartLineEdge. */ - public BlogConnectionQuery nodes(BlogQueryDefinition queryDef) { + public BaseCartLineConnectionQuery nodes(BaseCartLineQueryDefinition queryDef) { startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new BlogQuery(_queryBuilder)); + queryDef.define(new BaseCartLineQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -3077,7 +3202,7 @@ public BlogConnectionQuery nodes(BlogQueryDefinition queryDef) { /** * Information to aid in pagination. */ - public BlogConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + public BaseCartLineConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { startField("pageInfo"); _queryBuilder.append('{'); @@ -3089,21 +3214,21 @@ public BlogConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { } /** - * An auto-generated type for paginating through multiple Blogs. + * An auto-generated type for paginating through multiple BaseCartLines. */ - public static class BlogConnection extends AbstractResponse { - public BlogConnection() { + public static class BaseCartLineConnection extends AbstractResponse { + public BaseCartLineConnection() { } - public BlogConnection(JsonObject fields) throws SchemaViolationError { + public BaseCartLineConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { case "edges": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new BlogEdge(jsonAsObject(element1, key))); + list1.add(new BaseCartLineEdge(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -3112,9 +3237,9 @@ public BlogConnection(JsonObject fields) throws SchemaViolationError { } case "nodes": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Blog(jsonAsObject(element1, key))); + list1.add(UnknownBaseCartLine.create(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -3140,31 +3265,31 @@ public BlogConnection(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "BlogConnection"; + return "BaseCartLineConnection"; } /** * A list of edges. */ - public List getEdges() { - return (List) get("edges"); + public List getEdges() { + return (List) get("edges"); } - public BlogConnection setEdges(List arg) { + public BaseCartLineConnection setEdges(List arg) { optimisticData.put(getKey("edges"), arg); return this; } /** - * A list of the nodes contained in BlogEdge. + * A list of the nodes contained in BaseCartLineEdge. */ - public List getNodes() { - return (List) get("nodes"); + public List getNodes() { + return (List) get("nodes"); } - public BlogConnection setNodes(List arg) { + public BaseCartLineConnection setNodes(List arg) { optimisticData.put(getKey("nodes"), arg); return this; } @@ -3177,7 +3302,7 @@ public PageInfo getPageInfo() { return (PageInfo) get("pageInfo"); } - public BlogConnection setPageInfo(PageInfo arg) { + public BaseCartLineConnection setPageInfo(PageInfo arg) { optimisticData.put(getKey("pageInfo"), arg); return this; } @@ -3186,7 +3311,7 @@ public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "edges": return true; - case "nodes": return true; + case "nodes": return false; case "pageInfo": return true; @@ -3195,35 +3320,35 @@ public boolean unwrapsToObject(String key) { } } - public interface BlogEdgeQueryDefinition { - void define(BlogEdgeQuery _queryBuilder); + public interface BaseCartLineEdgeQueryDefinition { + void define(BaseCartLineEdgeQuery _queryBuilder); } /** - * An auto-generated type which holds one Blog and a cursor during pagination. + * An auto-generated type which holds one BaseCartLine and a cursor during pagination. */ - public static class BlogEdgeQuery extends Query { - BlogEdgeQuery(StringBuilder _queryBuilder) { + public static class BaseCartLineEdgeQuery extends Query { + BaseCartLineEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A cursor for use in pagination. */ - public BlogEdgeQuery cursor() { + public BaseCartLineEdgeQuery cursor() { startField("cursor"); return this; } /** - * The item at the end of BlogEdge. + * The item at the end of BaseCartLineEdge. */ - public BlogEdgeQuery node(BlogQueryDefinition queryDef) { + public BaseCartLineEdgeQuery node(BaseCartLineQueryDefinition queryDef) { startField("node"); _queryBuilder.append('{'); - queryDef.define(new BlogQuery(_queryBuilder)); + queryDef.define(new BaseCartLineQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -3231,13 +3356,13 @@ public BlogEdgeQuery node(BlogQueryDefinition queryDef) { } /** - * An auto-generated type which holds one Blog and a cursor during pagination. + * An auto-generated type which holds one BaseCartLine and a cursor during pagination. */ - public static class BlogEdge extends AbstractResponse { - public BlogEdge() { + public static class BaseCartLineEdge extends AbstractResponse { + public BaseCartLineEdge() { } - public BlogEdge(JsonObject fields) throws SchemaViolationError { + public BaseCartLineEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -3249,7 +3374,7 @@ public BlogEdge(JsonObject fields) throws SchemaViolationError { } case "node": { - responseData.put(key, new Blog(jsonAsObject(field.getValue(), key))); + responseData.put(key, UnknownBaseCartLine.create(jsonAsObject(field.getValue(), key))); break; } @@ -3266,7 +3391,7 @@ public BlogEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "BlogEdge"; + return "BaseCartLineEdge"; } /** @@ -3277,20 +3402,20 @@ public String getCursor() { return (String) get("cursor"); } - public BlogEdge setCursor(String arg) { + public BaseCartLineEdge setCursor(String arg) { optimisticData.put(getKey("cursor"), arg); return this; } /** - * The item at the end of BlogEdge. + * The item at the end of BaseCartLineEdge. */ - public Blog getNode() { - return (Blog) get("node"); + public BaseCartLine getNode() { + return (BaseCartLine) get("node"); } - public BlogEdge setNode(Blog arg) { + public BaseCartLineEdge setNode(BaseCartLine arg) { optimisticData.put(getKey("node"), arg); return this; } @@ -3299,208 +3424,323 @@ public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "cursor": return false; - case "node": return true; + case "node": return false; default: return false; } } } + public interface BlogQueryDefinition { + void define(BlogQuery _queryBuilder); + } + /** - * The set of valid sort keys for the Blog query. + * An online store blog. */ - public enum BlogSortKeys { - /** - * Sort by the `handle` value. - */ - HANDLE, + public static class BlogQuery extends Query { + BlogQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - /** - * Sort by the `id` value. - */ - ID, + startField("id"); + } /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. + * Find an article by its handle. */ - RELEVANCE, + public BlogQuery articleByHandle(String handle, ArticleQueryDefinition queryDef) { + startField("articleByHandle"); - /** - * Sort by the `title` value. - */ - TITLE, + _queryBuilder.append("(handle:"); + Query.appendQuotedString(_queryBuilder, handle.toString()); - UNKNOWN_VALUE; + _queryBuilder.append(')'); - public static BlogSortKeys fromGraphQl(String value) { - if (value == null) { - return null; - } + _queryBuilder.append('{'); + queryDef.define(new ArticleQuery(_queryBuilder)); + _queryBuilder.append('}'); - switch (value) { - case "HANDLE": { - return HANDLE; - } + return this; + } - case "ID": { - return ID; - } + public class ArticlesArguments extends Arguments { + ArticlesArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "RELEVANCE": { - return RELEVANCE; + /** + * Returns up to the first `n` elements from the list. + */ + public ArticlesArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); } + return this; + } - case "TITLE": { - return TITLE; + /** + * Returns the elements that come after the specified cursor. + */ + public ArticlesArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - default: { - return UNKNOWN_VALUE; + /** + * Returns up to the last `n` elements from the list. + */ + public ArticlesArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); } + return this; } - } - public String toString() { - switch (this) { - case HANDLE: { - return "HANDLE"; - } - case ID: { - return "ID"; + /** + * Returns the elements that come before the specified cursor. + */ + public ArticlesArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - case RELEVANCE: { - return "RELEVANCE"; + /** + * Reverse the order of the underlying list. + */ + public ArticlesArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; + } - case TITLE: { - return "TITLE"; + /** + * Sort the underlying list by the given key. + */ + public ArticlesArguments sortKey(ArticleSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); } + return this; + } - default: { - return ""; + /** + * Supported filter parameters: + * - `author` + * - `blog_title` + * - `created_at` + * - `tag` + * - `tag_not` + * - `updated_at` + * See the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) + * for more information about using filters. + */ + public ArticlesArguments query(String value) { + if (value != null) { + startArgument("query"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } } - } - public interface BrandQueryDefinition { - void define(BrandQuery _queryBuilder); - } + public interface ArticlesArgumentsDefinition { + void define(ArticlesArguments args); + } - /** - * The store's branding configuration. - */ - public static class BrandQuery extends Query { - BrandQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + /** + * List of the blog's articles. + */ + public BlogQuery articles(ArticleConnectionQueryDefinition queryDef) { + return articles(args -> {}, queryDef); } /** - * The colors of the store's brand. + * List of the blog's articles. */ - public BrandQuery colors(BrandColorsQueryDefinition queryDef) { - startField("colors"); + public BlogQuery articles(ArticlesArgumentsDefinition argsDef, ArticleConnectionQueryDefinition queryDef) { + startField("articles"); + + ArticlesArguments args = new ArticlesArguments(_queryBuilder); + argsDef.define(args); + ArticlesArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new BrandColorsQuery(_queryBuilder)); + queryDef.define(new ArticleConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The store's cover image. + * The authors who have contributed to the blog. */ - public BrandQuery coverImage(MediaImageQueryDefinition queryDef) { - startField("coverImage"); + public BlogQuery authors(ArticleAuthorQueryDefinition queryDef) { + startField("authors"); _queryBuilder.append('{'); - queryDef.define(new MediaImageQuery(_queryBuilder)); + queryDef.define(new ArticleAuthorQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The store's default logo. + * A human-friendly unique string for the Blog automatically generated from its title. */ - public BrandQuery logo(MediaImageQueryDefinition queryDef) { - startField("logo"); + public BlogQuery handle() { + startField("handle"); + + return this; + } + + /** + * Returns a metafield found by namespace and key. + */ + public BlogQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { + startField("metafield"); + + _queryBuilder.append("(namespace:"); + Query.appendQuotedString(_queryBuilder, namespace.toString()); + + _queryBuilder.append(",key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new MediaImageQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The store's short description. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public BrandQuery shortDescription() { - startField("shortDescription"); + public BlogQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); + + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The store's slogan. + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. */ - public BrandQuery slogan() { - startField("slogan"); + public BlogQuery onlineStoreUrl() { + startField("onlineStoreUrl"); return this; } /** - * The store's preferred logo for square UI elements. + * The blog's SEO information. */ - public BrandQuery squareLogo(MediaImageQueryDefinition queryDef) { - startField("squareLogo"); + public BlogQuery seo(SEOQueryDefinition queryDef) { + startField("seo"); _queryBuilder.append('{'); - queryDef.define(new MediaImageQuery(_queryBuilder)); + queryDef.define(new SEOQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + + /** + * The blogs’s title. + */ + public BlogQuery title() { + startField("title"); + + return this; + } } /** - * The store's branding configuration. + * An online store blog. */ - public static class Brand extends AbstractResponse { - public Brand() { + public static class Blog extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node, OnlineStorePublishable { + public Blog() { } - public Brand(JsonObject fields) throws SchemaViolationError { + public Blog(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "colors": { - responseData.put(key, new BrandColors(jsonAsObject(field.getValue(), key))); + case "articleByHandle": { + Article optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Article(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "coverImage": { - MediaImage optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MediaImage(jsonAsObject(field.getValue(), key)); + case "articles": { + responseData.put(key, new ArticleConnection(jsonAsObject(field.getValue(), key))); + + break; + } + + case "authors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ArticleAuthor(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "logo": { - MediaImage optional1 = null; + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "metafield": { + Metafield optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MediaImage(jsonAsObject(field.getValue(), key)); + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -3508,18 +3748,23 @@ public Brand(JsonObject fields) throws SchemaViolationError { break; } - case "shortDescription": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } + + list1.add(optional2); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "slogan": { + case "onlineStoreUrl": { String optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = jsonAsString(field.getValue(), key); @@ -3530,10 +3775,10 @@ public Brand(JsonObject fields) throws SchemaViolationError { break; } - case "squareLogo": { - MediaImage optional1 = null; + case "seo": { + SEO optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MediaImage(jsonAsObject(field.getValue(), key)); + optional1 = new SEO(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -3541,6 +3786,12 @@ public Brand(JsonObject fields) throws SchemaViolationError { break; } + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -3552,168 +3803,256 @@ public Brand(JsonObject fields) throws SchemaViolationError { } } + public Blog(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "Brand"; + return "Blog"; } /** - * The colors of the store's brand. + * Find an article by its handle. */ - public BrandColors getColors() { - return (BrandColors) get("colors"); + public Article getArticleByHandle() { + return (Article) get("articleByHandle"); } - public Brand setColors(BrandColors arg) { - optimisticData.put(getKey("colors"), arg); + public Blog setArticleByHandle(Article arg) { + optimisticData.put(getKey("articleByHandle"), arg); return this; } /** - * The store's cover image. + * List of the blog's articles. */ - public MediaImage getCoverImage() { - return (MediaImage) get("coverImage"); + public ArticleConnection getArticles() { + return (ArticleConnection) get("articles"); } - public Brand setCoverImage(MediaImage arg) { - optimisticData.put(getKey("coverImage"), arg); + public Blog setArticles(ArticleConnection arg) { + optimisticData.put(getKey("articles"), arg); return this; } /** - * The store's default logo. + * The authors who have contributed to the blog. */ - public MediaImage getLogo() { - return (MediaImage) get("logo"); + public List getAuthors() { + return (List) get("authors"); } - public Brand setLogo(MediaImage arg) { - optimisticData.put(getKey("logo"), arg); + public Blog setAuthors(List arg) { + optimisticData.put(getKey("authors"), arg); return this; } /** - * The store's short description. + * A human-friendly unique string for the Blog automatically generated from its title. */ - public String getShortDescription() { - return (String) get("shortDescription"); + public String getHandle() { + return (String) get("handle"); } - public Brand setShortDescription(String arg) { - optimisticData.put(getKey("shortDescription"), arg); + public Blog setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); return this; } /** - * The store's slogan. + * A globally-unique identifier. */ - public String getSlogan() { - return (String) get("slogan"); + public ID getId() { + return (ID) get("id"); } - public Brand setSlogan(String arg) { - optimisticData.put(getKey("slogan"), arg); + /** + * Returns a metafield found by namespace and key. + */ + + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } + + public Blog setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); return this; } /** - * The store's preferred logo for square UI elements. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public MediaImage getSquareLogo() { - return (MediaImage) get("squareLogo"); + public List getMetafields() { + return (List) get("metafields"); } - public Brand setSquareLogo(MediaImage arg) { - optimisticData.put(getKey("squareLogo"), arg); + public Blog setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); + return this; + } + + /** + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. + */ + + public String getOnlineStoreUrl() { + return (String) get("onlineStoreUrl"); + } + + public Blog setOnlineStoreUrl(String arg) { + optimisticData.put(getKey("onlineStoreUrl"), arg); + return this; + } + + /** + * The blog's SEO information. + */ + + public SEO getSeo() { + return (SEO) get("seo"); + } + + public Blog setSeo(SEO arg) { + optimisticData.put(getKey("seo"), arg); + return this; + } + + /** + * The blogs’s title. + */ + + public String getTitle() { + return (String) get("title"); + } + + public Blog setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "colors": return true; + case "articleByHandle": return true; - case "coverImage": return true; + case "articles": return true; - case "logo": return true; + case "authors": return true; - case "shortDescription": return false; + case "handle": return false; - case "slogan": return false; + case "id": return false; - case "squareLogo": return true; + case "metafield": return true; + + case "metafields": return true; + + case "onlineStoreUrl": return false; + + case "seo": return true; + + case "title": return false; default: return false; } } } - public interface BrandColorGroupQueryDefinition { - void define(BrandColorGroupQuery _queryBuilder); + public interface BlogConnectionQueryDefinition { + void define(BlogConnectionQuery _queryBuilder); } /** - * A group of related colors for the shop's brand. + * An auto-generated type for paginating through multiple Blogs. */ - public static class BrandColorGroupQuery extends Query { - BrandColorGroupQuery(StringBuilder _queryBuilder) { + public static class BlogConnectionQuery extends Query { + BlogConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The background color. + * A list of edges. */ - public BrandColorGroupQuery background() { - startField("background"); + public BlogConnectionQuery edges(BlogEdgeQueryDefinition queryDef) { + startField("edges"); + + _queryBuilder.append('{'); + queryDef.define(new BlogEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The foreground color. + * A list of the nodes contained in BlogEdge. */ - public BrandColorGroupQuery foreground() { - startField("foreground"); + public BlogConnectionQuery nodes(BlogQueryDefinition queryDef) { + startField("nodes"); + + _queryBuilder.append('{'); + queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * Information to aid in pagination. + */ + public BlogConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); + + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * A group of related colors for the shop's brand. + * An auto-generated type for paginating through multiple Blogs. */ - public static class BrandColorGroup extends AbstractResponse { - public BrandColorGroup() { + public static class BlogConnection extends AbstractResponse { + public BlogConnection() { } - public BrandColorGroup(JsonObject fields) throws SchemaViolationError { + public BlogConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "background": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new BlogEdge(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "foreground": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Blog(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); + + break; + } + + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } @@ -3730,79 +4069,90 @@ public BrandColorGroup(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "BrandColorGroup"; + return "BlogConnection"; } /** - * The background color. + * A list of edges. */ - public String getBackground() { - return (String) get("background"); + public List getEdges() { + return (List) get("edges"); } - public BrandColorGroup setBackground(String arg) { - optimisticData.put(getKey("background"), arg); + public BlogConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * The foreground color. + * A list of the nodes contained in BlogEdge. */ - public String getForeground() { - return (String) get("foreground"); + public List getNodes() { + return (List) get("nodes"); } - public BrandColorGroup setForeground(String arg) { - optimisticData.put(getKey("foreground"), arg); + public BlogConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; + } + + /** + * Information to aid in pagination. + */ + + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } + + public BlogConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "background": return false; + case "edges": return true; - case "foreground": return false; + case "nodes": return true; + + case "pageInfo": return true; default: return false; } } } - public interface BrandColorsQueryDefinition { - void define(BrandColorsQuery _queryBuilder); + public interface BlogEdgeQueryDefinition { + void define(BlogEdgeQuery _queryBuilder); } /** - * The colors of the shop's brand. + * An auto-generated type which holds one Blog and a cursor during pagination. */ - public static class BrandColorsQuery extends Query { - BrandColorsQuery(StringBuilder _queryBuilder) { + public static class BlogEdgeQuery extends Query { + BlogEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The shop's primary brand colors. + * A cursor for use in pagination. */ - public BrandColorsQuery primary(BrandColorGroupQueryDefinition queryDef) { - startField("primary"); - - _queryBuilder.append('{'); - queryDef.define(new BrandColorGroupQuery(_queryBuilder)); - _queryBuilder.append('}'); + public BlogEdgeQuery cursor() { + startField("cursor"); return this; } /** - * The shop's secondary brand colors. + * The item at the end of BlogEdge. */ - public BrandColorsQuery secondary(BrandColorGroupQueryDefinition queryDef) { - startField("secondary"); + public BlogEdgeQuery node(BlogQueryDefinition queryDef) { + startField("node"); _queryBuilder.append('{'); - queryDef.define(new BrandColorGroupQuery(_queryBuilder)); + queryDef.define(new BlogQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -3810,35 +4160,25 @@ public BrandColorsQuery secondary(BrandColorGroupQueryDefinition queryDef) { } /** - * The colors of the shop's brand. + * An auto-generated type which holds one Blog and a cursor during pagination. */ - public static class BrandColors extends AbstractResponse { - public BrandColors() { + public static class BlogEdge extends AbstractResponse { + public BlogEdge() { } - public BrandColors(JsonObject fields) throws SchemaViolationError { + public BlogEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "primary": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new BrandColorGroup(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "secondary": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new BrandColorGroup(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "node": { + responseData.put(key, new Blog(jsonAsObject(field.getValue(), key))); break; } @@ -3855,40 +4195,40 @@ public BrandColors(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "BrandColors"; + return "BlogEdge"; } /** - * The shop's primary brand colors. + * A cursor for use in pagination. */ - public List getPrimary() { - return (List) get("primary"); + public String getCursor() { + return (String) get("cursor"); } - public BrandColors setPrimary(List arg) { - optimisticData.put(getKey("primary"), arg); + public BlogEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * The shop's secondary brand colors. + * The item at the end of BlogEdge. */ - public List getSecondary() { - return (List) get("secondary"); + public Blog getNode() { + return (Blog) get("node"); } - public BrandColors setSecondary(List arg) { - optimisticData.put(getKey("secondary"), arg); + public BlogEdge setNode(Blog arg) { + optimisticData.put(getKey("node"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "primary": return true; + case "cursor": return false; - case "secondary": return true; + case "node": return true; default: return false; } @@ -3896,69 +4236,52 @@ public boolean unwrapsToObject(String key) { } /** - * Card brand, such as Visa or Mastercard, which can be used for payments. + * The set of valid sort keys for the Blog query. */ - public enum CardBrand { - /** - * American Express. - */ - AMERICAN_EXPRESS, - - /** - * Diners Club. - */ - DINERS_CLUB, - + public enum BlogSortKeys { /** - * Discover. + * Sort by the `handle` value. */ - DISCOVER, + HANDLE, /** - * JCB. + * Sort by the `id` value. */ - JCB, + ID, /** - * Mastercard. + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. */ - MASTERCARD, + RELEVANCE, /** - * Visa. + * Sort by the `title` value. */ - VISA, + TITLE, UNKNOWN_VALUE; - public static CardBrand fromGraphQl(String value) { + public static BlogSortKeys fromGraphQl(String value) { if (value == null) { return null; } switch (value) { - case "AMERICAN_EXPRESS": { - return AMERICAN_EXPRESS; - } - - case "DINERS_CLUB": { - return DINERS_CLUB; - } - - case "DISCOVER": { - return DISCOVER; + case "HANDLE": { + return HANDLE; } - case "JCB": { - return JCB; + case "ID": { + return ID; } - case "MASTERCARD": { - return MASTERCARD; + case "RELEVANCE": { + return RELEVANCE; } - case "VISA": { - return VISA; + case "TITLE": { + return TITLE; } default: { @@ -3968,28 +4291,20 @@ public static CardBrand fromGraphQl(String value) { } public String toString() { switch (this) { - case AMERICAN_EXPRESS: { - return "AMERICAN_EXPRESS"; - } - - case DINERS_CLUB: { - return "DINERS_CLUB"; - } - - case DISCOVER: { - return "DISCOVER"; + case HANDLE: { + return "HANDLE"; } - case JCB: { - return "JCB"; + case ID: { + return "ID"; } - case MASTERCARD: { - return "MASTERCARD"; + case RELEVANCE: { + return "RELEVANCE"; } - case VISA: { - return "VISA"; + case TITLE: { + return "TITLE"; } default: { @@ -3999,377 +4314,321 @@ public String toString() { } } - public interface CartQueryDefinition { - void define(CartQuery _queryBuilder); + public interface BrandQueryDefinition { + void define(BrandQuery _queryBuilder); } /** - * A cart represents the merchandise that a buyer intends to purchase, - * and the estimated cost associated with the cart. Learn how to - * [interact with a - * cart](https://shopify.dev/custom-storefronts/internationalization/international-pricing) - * during a customer's session. + * The store's branding configuration. */ - public static class CartQuery extends Query { - CartQuery(StringBuilder _queryBuilder) { + public static class BrandQuery extends Query { + BrandQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("id"); } /** - * An attribute associated with the cart. + * The colors of the store's brand. */ - public CartQuery attribute(String key, AttributeQueryDefinition queryDef) { - startField("attribute"); - - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); - - _queryBuilder.append(')'); + public BrandQuery colors(BrandColorsQueryDefinition queryDef) { + startField("colors"); _queryBuilder.append('{'); - queryDef.define(new AttributeQuery(_queryBuilder)); + queryDef.define(new BrandColorsQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The attributes associated with the cart. Attributes are represented as key-value pairs. + * The store's cover image. */ - public CartQuery attributes(AttributeQueryDefinition queryDef) { - startField("attributes"); + public BrandQuery coverImage(MediaImageQueryDefinition queryDef) { + startField("coverImage"); _queryBuilder.append('{'); - queryDef.define(new AttributeQuery(_queryBuilder)); + queryDef.define(new MediaImageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Information about the buyer that is interacting with the cart. + * The store's default logo. */ - public CartQuery buyerIdentity(CartBuyerIdentityQueryDefinition queryDef) { - startField("buyerIdentity"); + public BrandQuery logo(MediaImageQueryDefinition queryDef) { + startField("logo"); _queryBuilder.append('{'); - queryDef.define(new CartBuyerIdentityQuery(_queryBuilder)); + queryDef.define(new MediaImageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The URL of the checkout for the cart. + * The store's short description. */ - public CartQuery checkoutUrl() { - startField("checkoutUrl"); + public BrandQuery shortDescription() { + startField("shortDescription"); 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/custom-storefronts/internationalization/international-pricing). + * The store's slogan. */ - public CartQuery cost(CartCostQueryDefinition queryDef) { - startField("cost"); - - _queryBuilder.append('{'); - queryDef.define(new CartCostQuery(_queryBuilder)); - _queryBuilder.append('}'); + public BrandQuery slogan() { + startField("slogan"); return this; } /** - * The date and time when the cart was created. + * The store's preferred logo for square UI elements. */ - public CartQuery createdAt() { - startField("createdAt"); + public BrandQuery squareLogo(MediaImageQueryDefinition queryDef) { + startField("squareLogo"); + + _queryBuilder.append('{'); + queryDef.define(new MediaImageQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } + } - public class DeliveryGroupsArguments extends Arguments { - DeliveryGroupsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * The store's branding configuration. + */ + public static class Brand extends AbstractResponse { + public Brand() { + } - /** - * Returns up to the first `n` elements from the list. - */ - public DeliveryGroupsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public Brand(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "colors": { + responseData.put(key, new BrandColors(jsonAsObject(field.getValue(), key))); - /** - * Returns the elements that come after the specified cursor. - */ - public DeliveryGroupsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + break; + } - /** - * Returns up to the last `n` elements from the list. - */ - public DeliveryGroupsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + case "coverImage": { + MediaImage optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MediaImage(jsonAsObject(field.getValue(), key)); + } - /** - * Returns the elements that come before the specified cursor. - */ - public DeliveryGroupsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + responseData.put(key, optional1); - /** - * Reverse the order of the underlying list. - */ - public DeliveryGroupsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - } + break; + } - public interface DeliveryGroupsArgumentsDefinition { - void define(DeliveryGroupsArguments args); + case "logo": { + MediaImage optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MediaImage(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "shortDescription": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "slogan": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "squareLogo": { + MediaImage optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MediaImage(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - /** - * The delivery groups available for the cart, based on the buyer identity default - * delivery address preference or the default address of the logged-in customer. - */ - public CartQuery deliveryGroups(CartDeliveryGroupConnectionQueryDefinition queryDef) { - return deliveryGroups(args -> {}, queryDef); + public String getGraphQlTypeName() { + return "Brand"; } /** - * The delivery groups available for the cart, based on the buyer identity default - * delivery address preference or the default address of the logged-in customer. + * The colors of the store's brand. */ - public CartQuery deliveryGroups(DeliveryGroupsArgumentsDefinition argsDef, CartDeliveryGroupConnectionQueryDefinition queryDef) { - startField("deliveryGroups"); - - DeliveryGroupsArguments args = new DeliveryGroupsArguments(_queryBuilder); - argsDef.define(args); - DeliveryGroupsArguments.end(args); - _queryBuilder.append('{'); - queryDef.define(new CartDeliveryGroupConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public BrandColors getColors() { + return (BrandColors) get("colors"); + } + public Brand setColors(BrandColors arg) { + optimisticData.put(getKey("colors"), arg); return this; } /** - * The discounts that have been applied to the entire cart. + * The store's cover image. */ - public CartQuery discountAllocations(CartDiscountAllocationQueryDefinition queryDef) { - startField("discountAllocations"); - _queryBuilder.append('{'); - queryDef.define(new CartDiscountAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MediaImage getCoverImage() { + return (MediaImage) get("coverImage"); + } + public Brand setCoverImage(MediaImage arg) { + optimisticData.put(getKey("coverImage"), arg); return this; } /** - * The case-insensitive discount codes that the customer added at checkout. + * The store's default logo. */ - public CartQuery discountCodes(CartDiscountCodeQueryDefinition queryDef) { - startField("discountCodes"); - _queryBuilder.append('{'); - queryDef.define(new CartDiscountCodeQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MediaImage getLogo() { + return (MediaImage) get("logo"); + } + public Brand setLogo(MediaImage arg) { + optimisticData.put(getKey("logo"), arg); return this; } /** - * The estimated costs that the buyer will pay at checkout. - * The estimated costs are subject to change and changes will be reflected at checkout. - * The `estimatedCost` field uses the `buyerIdentity` field to determine - * [international - * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing). - * - * @deprecated Use `cost` instead. + * The store's short description. */ - @Deprecated - public CartQuery estimatedCost(CartEstimatedCostQueryDefinition queryDef) { - startField("estimatedCost"); - _queryBuilder.append('{'); - queryDef.define(new CartEstimatedCostQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getShortDescription() { + return (String) get("shortDescription"); + } + public Brand setShortDescription(String arg) { + optimisticData.put(getKey("shortDescription"), arg); return this; } - public class LinesArguments extends Arguments { - LinesArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public LinesArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public LinesArguments 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 LinesArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public LinesArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + /** + * The store's slogan. + */ - /** - * Reverse the order of the underlying list. - */ - public LinesArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + public String getSlogan() { + return (String) get("slogan"); } - public interface LinesArgumentsDefinition { - void define(LinesArguments args); + public Brand setSlogan(String arg) { + optimisticData.put(getKey("slogan"), arg); + return this; } /** - * A list of lines containing information about the items the customer intends to purchase. + * The store's preferred logo for square UI elements. */ - public CartQuery lines(CartLineConnectionQueryDefinition queryDef) { - return lines(args -> {}, queryDef); + + public MediaImage getSquareLogo() { + return (MediaImage) get("squareLogo"); } - /** - * A list of lines containing information about the items the customer intends to purchase. - */ - public CartQuery lines(LinesArgumentsDefinition argsDef, CartLineConnectionQueryDefinition queryDef) { - startField("lines"); + public Brand setSquareLogo(MediaImage arg) { + optimisticData.put(getKey("squareLogo"), arg); + return this; + } - LinesArguments args = new LinesArguments(_queryBuilder); - argsDef.define(args); - LinesArguments.end(args); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "colors": return true; - _queryBuilder.append('{'); - queryDef.define(new CartLineConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "coverImage": return true; - return this; + case "logo": return true; + + case "shortDescription": return false; + + case "slogan": return false; + + case "squareLogo": return true; + + default: return false; + } } + } - /** - * A note that is associated with the cart. For example, the note can be a personalized message to the - * buyer. - */ - public CartQuery note() { - startField("note"); + public interface BrandColorGroupQueryDefinition { + void define(BrandColorGroupQuery _queryBuilder); + } - return this; + /** + * A group of related colors for the shop's brand. + */ + public static class BrandColorGroupQuery extends Query { + BrandColorGroupQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The total number of items in the cart. + * The background color. */ - public CartQuery totalQuantity() { - startField("totalQuantity"); + public BrandColorGroupQuery background() { + startField("background"); return this; } /** - * The date and time when the cart was updated. + * The foreground color. */ - public CartQuery updatedAt() { - startField("updatedAt"); + public BrandColorGroupQuery foreground() { + startField("foreground"); return this; } } /** - * A cart represents the merchandise that a buyer intends to purchase, - * and the estimated cost associated with the cart. Learn how to - * [interact with a - * cart](https://shopify.dev/custom-storefronts/internationalization/international-pricing) - * during a customer's session. + * A group of related colors for the shop's brand. */ - public static class Cart extends AbstractResponse implements Node { - public Cart() { + public static class BrandColorGroup extends AbstractResponse { + public BrandColorGroup() { } - public Cart(JsonObject fields) throws SchemaViolationError { + public BrandColorGroup(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "attribute": { - Attribute optional1 = null; + case "background": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Attribute(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -4377,106 +4636,138 @@ public Cart(JsonObject fields) throws SchemaViolationError { break; } - case "attributes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Attribute(jsonAsObject(element1, key))); + case "foreground": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); - - break; - } - - case "buyerIdentity": { - responseData.put(key, new CartBuyerIdentity(jsonAsObject(field.getValue(), key))); + responseData.put(key, optional1); break; } - case "checkoutUrl": { + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); - break; } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - case "cost": { - responseData.put(key, new CartCost(jsonAsObject(field.getValue(), key))); + public String getGraphQlTypeName() { + return "BrandColorGroup"; + } - break; - } + /** + * The background color. + */ - case "createdAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + public String getBackground() { + return (String) get("background"); + } - break; - } + public BrandColorGroup setBackground(String arg) { + optimisticData.put(getKey("background"), arg); + return this; + } - case "deliveryGroups": { - responseData.put(key, new CartDeliveryGroupConnection(jsonAsObject(field.getValue(), key))); + /** + * The foreground color. + */ - break; - } + public String getForeground() { + return (String) get("foreground"); + } - case "discountAllocations": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(UnknownCartDiscountAllocation.create(jsonAsObject(element1, key))); - } + public BrandColorGroup setForeground(String arg) { + optimisticData.put(getKey("foreground"), arg); + return this; + } - responseData.put(key, list1); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "background": return false; - break; - } + case "foreground": return false; - case "discountCodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CartDiscountCode(jsonAsObject(element1, key))); - } + default: return false; + } + } + } - responseData.put(key, list1); + public interface BrandColorsQueryDefinition { + void define(BrandColorsQuery _queryBuilder); + } - break; - } + /** + * The colors of the shop's brand. + */ + public static class BrandColorsQuery extends Query { + BrandColorsQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "estimatedCost": { - responseData.put(key, new CartEstimatedCost(jsonAsObject(field.getValue(), key))); + /** + * The shop's primary brand colors. + */ + public BrandColorsQuery primary(BrandColorGroupQueryDefinition queryDef) { + startField("primary"); - break; - } + _queryBuilder.append('{'); + queryDef.define(new BrandColorGroupQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + return this; + } - break; - } + /** + * The shop's secondary brand colors. + */ + public BrandColorsQuery secondary(BrandColorGroupQueryDefinition queryDef) { + startField("secondary"); - case "lines": { - responseData.put(key, new CartLineConnection(jsonAsObject(field.getValue(), key))); + _queryBuilder.append('{'); + queryDef.define(new BrandColorGroupQuery(_queryBuilder)); + _queryBuilder.append('}'); - break; - } + return this; + } + } - case "note": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + /** + * The colors of the shop's brand. + */ + public static class BrandColors extends AbstractResponse { + public BrandColors() { + } + + public BrandColors(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "primary": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new BrandColorGroup(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "totalQuantity": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); - - break; - } + case "secondary": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new BrandColorGroup(jsonAsObject(element1, key))); + } - case "updatedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + responseData.put(key, list1); break; } @@ -4492,308 +4783,570 @@ public Cart(JsonObject fields) throws SchemaViolationError { } } - public Cart(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "Cart"; + return "BrandColors"; } /** - * An attribute associated with the cart. + * The shop's primary brand colors. */ - public Attribute getAttribute() { - return (Attribute) get("attribute"); + public List getPrimary() { + return (List) get("primary"); } - public Cart setAttribute(Attribute arg) { - optimisticData.put(getKey("attribute"), arg); + public BrandColors setPrimary(List arg) { + optimisticData.put(getKey("primary"), arg); return this; } /** - * The attributes associated with the cart. Attributes are represented as key-value pairs. + * The shop's secondary brand colors. */ - public List getAttributes() { - return (List) get("attributes"); + public List getSecondary() { + return (List) get("secondary"); } - public Cart setAttributes(List arg) { - optimisticData.put(getKey("attributes"), arg); + public BrandColors setSecondary(List arg) { + optimisticData.put(getKey("secondary"), arg); return this; } - /** - * Information about the buyer that is interacting with the cart. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "primary": return true; - public CartBuyerIdentity getBuyerIdentity() { - return (CartBuyerIdentity) get("buyerIdentity"); - } + case "secondary": return true; - public Cart setBuyerIdentity(CartBuyerIdentity arg) { - optimisticData.put(getKey("buyerIdentity"), arg); - return this; + default: return false; + } } + } + /** + * Card brand, such as Visa or Mastercard, which can be used for payments. + */ + public enum CardBrand { /** - * The URL of the checkout for the cart. + * American Express. */ - - public String getCheckoutUrl() { - return (String) get("checkoutUrl"); - } - - public Cart setCheckoutUrl(String arg) { - optimisticData.put(getKey("checkoutUrl"), arg); - return this; - } + AMERICAN_EXPRESS, /** - * 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/custom-storefronts/internationalization/international-pricing). + * Diners Club. */ - - public CartCost getCost() { - return (CartCost) get("cost"); - } - - public Cart setCost(CartCost arg) { - optimisticData.put(getKey("cost"), arg); - return this; - } + DINERS_CLUB, /** - * The date and time when the cart was created. + * Discover. */ + DISCOVER, - public DateTime getCreatedAt() { - return (DateTime) get("createdAt"); + /** + * JCB. + */ + JCB, + + /** + * Mastercard. + */ + MASTERCARD, + + /** + * Visa. + */ + VISA, + + UNKNOWN_VALUE; + + public static CardBrand fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "AMERICAN_EXPRESS": { + return AMERICAN_EXPRESS; + } + + case "DINERS_CLUB": { + return DINERS_CLUB; + } + + case "DISCOVER": { + return DISCOVER; + } + + case "JCB": { + return JCB; + } + + case "MASTERCARD": { + return MASTERCARD; + } + + case "VISA": { + return VISA; + } + + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case AMERICAN_EXPRESS: { + return "AMERICAN_EXPRESS"; + } - public Cart setCreatedAt(DateTime arg) { - optimisticData.put(getKey("createdAt"), arg); - return this; + case DINERS_CLUB: { + return "DINERS_CLUB"; + } + + case DISCOVER: { + return "DISCOVER"; + } + + case JCB: { + return "JCB"; + } + + case MASTERCARD: { + return "MASTERCARD"; + } + + case VISA: { + return "VISA"; + } + + default: { + return ""; + } + } + } + } + + public interface CartQueryDefinition { + void define(CartQuery _queryBuilder); + } + + /** + * A cart represents the merchandise that a buyer intends to purchase, + * and the estimated cost associated with the cart. Learn how to + * [interact with a + * cart](https://shopify.dev/custom-storefronts/internationalization/international-pricing) + * during a customer's session. + */ + public static class CartQuery extends Query { + CartQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); } /** - * The delivery groups available for the cart, based on the buyer identity default - * delivery address preference or the default address of the logged-in customer. + * An attribute associated with the cart. */ + public CartQuery attribute(String key, AttributeQueryDefinition queryDef) { + startField("attribute"); - public CartDeliveryGroupConnection getDeliveryGroups() { - return (CartDeliveryGroupConnection) get("deliveryGroups"); - } + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new AttributeQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Cart setDeliveryGroups(CartDeliveryGroupConnection arg) { - optimisticData.put(getKey("deliveryGroups"), arg); return this; } /** - * The discounts that have been applied to the entire cart. + * The attributes associated with the cart. Attributes are represented as key-value pairs. */ + public CartQuery attributes(AttributeQueryDefinition queryDef) { + startField("attributes"); - public List getDiscountAllocations() { - return (List) get("discountAllocations"); - } + _queryBuilder.append('{'); + queryDef.define(new AttributeQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Cart setDiscountAllocations(List arg) { - optimisticData.put(getKey("discountAllocations"), arg); return this; } /** - * The case-insensitive discount codes that the customer added at checkout. + * Information about the buyer that is interacting with the cart. */ + public CartQuery buyerIdentity(CartBuyerIdentityQueryDefinition queryDef) { + startField("buyerIdentity"); - public List getDiscountCodes() { - return (List) get("discountCodes"); + _queryBuilder.append('{'); + queryDef.define(new CartBuyerIdentityQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } - public Cart setDiscountCodes(List arg) { - optimisticData.put(getKey("discountCodes"), arg); + /** + * The URL of the checkout for the cart. + */ + public CartQuery checkoutUrl() { + startField("checkoutUrl"); + return this; } /** - * The estimated costs that the buyer will pay at checkout. - * The estimated costs are subject to change and changes will be reflected at checkout. - * The `estimatedCost` field uses the `buyerIdentity` field to determine + * 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/custom-storefronts/internationalization/international-pricing). - * - * @deprecated Use `cost` instead. */ + public CartQuery cost(CartCostQueryDefinition queryDef) { + startField("cost"); - public CartEstimatedCost getEstimatedCost() { - return (CartEstimatedCost) get("estimatedCost"); - } + _queryBuilder.append('{'); + queryDef.define(new CartCostQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Cart setEstimatedCost(CartEstimatedCost arg) { - optimisticData.put(getKey("estimatedCost"), arg); return this; } /** - * A globally-unique identifier. + * The date and time when the cart was created. */ + public CartQuery createdAt() { + startField("createdAt"); - public ID getId() { - return (ID) get("id"); + return this; + } + + public class DeliveryGroupsArguments extends Arguments { + DeliveryGroupsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * Returns up to the first `n` elements from the list. + */ + public DeliveryGroupsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come after the specified cursor. + */ + public DeliveryGroupsArguments 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 DeliveryGroupsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come before the specified cursor. + */ + public DeliveryGroupsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Reverse the order of the underlying list. + */ + public DeliveryGroupsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } + } + + public interface DeliveryGroupsArgumentsDefinition { + void define(DeliveryGroupsArguments args); } /** - * A list of lines containing information about the items the customer intends to purchase. + * The delivery groups available for the cart, based on the buyer identity default + * delivery address preference or the default address of the logged-in customer. */ - - public CartLineConnection getLines() { - return (CartLineConnection) get("lines"); + public CartQuery deliveryGroups(CartDeliveryGroupConnectionQueryDefinition queryDef) { + return deliveryGroups(args -> {}, queryDef); } - public Cart setLines(CartLineConnection arg) { - optimisticData.put(getKey("lines"), arg); + /** + * The delivery groups available for the cart, based on the buyer identity default + * delivery address preference or the default address of the logged-in customer. + */ + public CartQuery deliveryGroups(DeliveryGroupsArgumentsDefinition argsDef, CartDeliveryGroupConnectionQueryDefinition queryDef) { + startField("deliveryGroups"); + + DeliveryGroupsArguments args = new DeliveryGroupsArguments(_queryBuilder); + argsDef.define(args); + DeliveryGroupsArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new CartDeliveryGroupConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } /** - * A note that is associated with the cart. For example, the note can be a personalized message to the - * buyer. + * The discounts that have been applied to the entire cart. */ + public CartQuery discountAllocations(CartDiscountAllocationQueryDefinition queryDef) { + startField("discountAllocations"); - public String getNote() { - return (String) get("note"); - } + _queryBuilder.append('{'); + queryDef.define(new CartDiscountAllocationQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Cart setNote(String arg) { - optimisticData.put(getKey("note"), arg); return this; } /** - * The total number of items in the cart. + * The case-insensitive discount codes that the customer added at checkout. */ + public CartQuery discountCodes(CartDiscountCodeQueryDefinition queryDef) { + startField("discountCodes"); - public Integer getTotalQuantity() { - return (Integer) get("totalQuantity"); - } + _queryBuilder.append('{'); + queryDef.define(new CartDiscountCodeQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Cart setTotalQuantity(Integer arg) { - optimisticData.put(getKey("totalQuantity"), arg); return this; } /** - * The date and time when the cart was updated. + * The estimated costs that the buyer will pay at checkout. + * The estimated costs are subject to change and changes will be reflected at checkout. + * The `estimatedCost` field uses the `buyerIdentity` field to determine + * [international + * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing). + * + * @deprecated Use `cost` instead. */ + @Deprecated + public CartQuery estimatedCost(CartEstimatedCostQueryDefinition queryDef) { + startField("estimatedCost"); - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); - } + _queryBuilder.append('{'); + queryDef.define(new CartEstimatedCostQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Cart setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "attribute": return true; + public class LinesArguments extends Arguments { + LinesArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "attributes": return true; + /** + * Returns up to the first `n` elements from the list. + */ + public LinesArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - case "buyerIdentity": return true; + /** + * Returns the elements that come after the specified cursor. + */ + public LinesArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "checkoutUrl": return false; + /** + * Returns up to the last `n` elements from the list. + */ + public LinesArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - case "cost": return true; + /** + * Returns the elements that come before the specified cursor. + */ + public LinesArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "createdAt": return false; + /** + * Reverse the order of the underlying list. + */ + public LinesArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } + } - case "deliveryGroups": return true; + public interface LinesArgumentsDefinition { + void define(LinesArguments args); + } - case "discountAllocations": return false; + /** + * A list of lines containing information about the items the customer intends to purchase. + */ + public CartQuery lines(BaseCartLineConnectionQueryDefinition queryDef) { + return lines(args -> {}, queryDef); + } - case "discountCodes": return true; + /** + * A list of lines containing information about the items the customer intends to purchase. + */ + public CartQuery lines(LinesArgumentsDefinition argsDef, BaseCartLineConnectionQueryDefinition queryDef) { + startField("lines"); - case "estimatedCost": return true; + LinesArguments args = new LinesArguments(_queryBuilder); + argsDef.define(args); + LinesArguments.end(args); - case "id": return false; + _queryBuilder.append('{'); + queryDef.define(new BaseCartLineConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "lines": return true; + return this; + } - case "note": return false; + /** + * Returns a metafield found by namespace and key. + */ + public CartQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { + startField("metafield"); - case "totalQuantity": return false; + _queryBuilder.append("(namespace:"); + Query.appendQuotedString(_queryBuilder, namespace.toString()); - case "updatedAt": return false; + _queryBuilder.append(",key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); - default: return false; - } - } - } + _queryBuilder.append(')'); - public interface CartAttributesUpdatePayloadQueryDefinition { - void define(CartAttributesUpdatePayloadQuery _queryBuilder); - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Return type for `cartAttributesUpdate` mutation. - */ - public static class CartAttributesUpdatePayloadQuery extends Query { - CartAttributesUpdatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * The updated cart. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public CartAttributesUpdatePayloadQuery cart(CartQueryDefinition queryDef) { - startField("cart"); + public CartQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); + + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new CartQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. + * A note that is associated with the cart. For example, the note can be a personalized message to the + * buyer. */ - public CartAttributesUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { - startField("userErrors"); + public CartQuery note() { + startField("note"); - _queryBuilder.append('{'); - queryDef.define(new CartUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + 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. + */ + public CartQuery updatedAt() { + startField("updatedAt"); return this; } } /** - * Return type for `cartAttributesUpdate` mutation. + * A cart represents the merchandise that a buyer intends to purchase, + * and the estimated cost associated with the cart. Learn how to + * [interact with a + * cart](https://shopify.dev/custom-storefronts/internationalization/international-pricing) + * during a customer's session. */ - public static class CartAttributesUpdatePayload extends AbstractResponse { - public CartAttributesUpdatePayload() { + public static class Cart extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { + public Cart() { } - public CartAttributesUpdatePayload(JsonObject fields) throws SchemaViolationError { + public Cart(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cart": { - Cart optional1 = null; + case "attribute": { + Attribute optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Cart(jsonAsObject(field.getValue(), key)); + optional1 = new Attribute(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -4801,10 +5354,10 @@ public CartAttributesUpdatePayload(JsonObject fields) throws SchemaViolationErro break; } - case "userErrors": { - List list1 = new ArrayList<>(); + case "attributes": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CartUserError(jsonAsObject(element1, key))); + list1.add(new Attribute(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -4812,22 +5365,503 @@ public CartAttributesUpdatePayload(JsonObject fields) throws SchemaViolationErro break; } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "buyerIdentity": { + responseData.put(key, new CartBuyerIdentity(jsonAsObject(field.getValue(), key))); + break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - public String getGraphQlTypeName() { - return "CartAttributesUpdatePayload"; - } + case "checkoutUrl": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** + break; + } + + case "cost": { + responseData.put(key, new CartCost(jsonAsObject(field.getValue(), key))); + + break; + } + + case "createdAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + + case "deliveryGroups": { + responseData.put(key, new CartDeliveryGroupConnection(jsonAsObject(field.getValue(), key))); + + break; + } + + case "discountAllocations": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(UnknownCartDiscountAllocation.create(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "discountCodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartDiscountCode(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "estimatedCost": { + responseData.put(key, new CartEstimatedCost(jsonAsObject(field.getValue(), key))); + + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "lines": { + responseData.put(key, new BaseCartLineConnection(jsonAsObject(field.getValue(), key))); + + break; + } + + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } + + list1.add(optional2); + } + + responseData.put(key, list1); + + break; + } + + case "note": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "totalQuantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); + + break; + } + + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public Cart(ID id) { + this(); + optimisticData.put("id", id); + } + + 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. + */ + + public List getAttributes() { + return (List) get("attributes"); + } + + public Cart setAttributes(List arg) { + optimisticData.put(getKey("attributes"), arg); + return this; + } + + /** + * Information about the buyer that is interacting with the cart. + */ + + public CartBuyerIdentity getBuyerIdentity() { + return (CartBuyerIdentity) get("buyerIdentity"); + } + + public Cart setBuyerIdentity(CartBuyerIdentity arg) { + optimisticData.put(getKey("buyerIdentity"), arg); + return this; + } + + /** + * The URL of the checkout for the cart. + */ + + public String getCheckoutUrl() { + return (String) get("checkoutUrl"); + } + + public Cart setCheckoutUrl(String arg) { + optimisticData.put(getKey("checkoutUrl"), 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/custom-storefronts/internationalization/international-pricing). + */ + + 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. + */ + + public DateTime getCreatedAt() { + return (DateTime) get("createdAt"); + } + + public Cart setCreatedAt(DateTime arg) { + optimisticData.put(getKey("createdAt"), arg); + return this; + } + + /** + * The delivery groups available for the cart, based on the buyer identity default + * delivery address preference or the default address of the logged-in customer. + */ + + public CartDeliveryGroupConnection getDeliveryGroups() { + return (CartDeliveryGroupConnection) get("deliveryGroups"); + } + + public Cart setDeliveryGroups(CartDeliveryGroupConnection arg) { + optimisticData.put(getKey("deliveryGroups"), arg); + return this; + } + + /** + * 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() { + return (List) get("discountCodes"); + } + + public Cart setDiscountCodes(List arg) { + optimisticData.put(getKey("discountCodes"), arg); + return this; + } + + /** + * The estimated costs that the buyer will pay at checkout. + * The estimated costs are subject to change and changes will be reflected at checkout. + * The `estimatedCost` field uses the `buyerIdentity` field to determine + * [international + * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing). + * + * @deprecated Use `cost` instead. + */ + + public CartEstimatedCost getEstimatedCost() { + return (CartEstimatedCost) get("estimatedCost"); + } + + public Cart setEstimatedCost(CartEstimatedCost arg) { + optimisticData.put(getKey("estimatedCost"), arg); + return this; + } + + /** + * A globally-unique identifier. + */ + + public ID getId() { + return (ID) get("id"); + } + + /** + * A list of lines containing information about the items the customer intends to purchase. + */ + + public BaseCartLineConnection getLines() { + return (BaseCartLineConnection) get("lines"); + } + + public Cart setLines(BaseCartLineConnection arg) { + optimisticData.put(getKey("lines"), arg); + return this; + } + + /** + * Returns a metafield found by namespace and key. + */ + + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } + + public Cart setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); + return this; + } + + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ + + public List getMetafields() { + return (List) get("metafields"); + } + + public Cart setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); + return this; + } + + /** + * A note that is associated with the cart. For example, the note can be a personalized message to the + * buyer. + */ + + public String getNote() { + return (String) get("note"); + } + + public Cart setNote(String arg) { + optimisticData.put(getKey("note"), 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. + */ + + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); + } + + public Cart setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); + return this; + } + + 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; + + case "id": return false; + + case "lines": return true; + + case "metafield": return true; + + case "metafields": return true; + + case "note": return false; + + case "totalQuantity": return false; + + case "updatedAt": return false; + + default: return false; + } + } + } + + public interface CartAttributesUpdatePayloadQueryDefinition { + void define(CartAttributesUpdatePayloadQuery _queryBuilder); + } + + /** + * Return type for `cartAttributesUpdate` mutation. + */ + public static class CartAttributesUpdatePayloadQuery extends Query { + CartAttributesUpdatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The updated cart. + */ + public CartAttributesUpdatePayloadQuery cart(CartQueryDefinition queryDef) { + startField("cart"); + + _queryBuilder.append('{'); + queryDef.define(new CartQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The list of errors that occurred from executing the mutation. + */ + public CartAttributesUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { + startField("userErrors"); + + _queryBuilder.append('{'); + queryDef.define(new CartUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * Return type for `cartAttributesUpdate` mutation. + */ + public static class CartAttributesUpdatePayload extends AbstractResponse { + public CartAttributesUpdatePayload() { + } + + public CartAttributesUpdatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cart": { + Cart optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Cart(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartUserError(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "CartAttributesUpdatePayload"; + } + + /** * The updated cart. */ @@ -5041,6 +6075,16 @@ public CartBuyerIdentityQuery phone() { return this; } + + /** + * A set of wallet preferences tied to the buyer that is interacting with the cart. + * Preferences can be used to populate relevant payment fields in the checkout flow. + */ + public CartBuyerIdentityQuery walletPreferences() { + startField("walletPreferences"); + + return this; + } } /** @@ -5110,6 +6154,17 @@ public CartBuyerIdentity(JsonObject fields) throws SchemaViolationError { break; } + case "walletPreferences": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + responseData.put(key, list1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -5192,6 +6247,20 @@ public CartBuyerIdentity setPhone(String arg) { return this; } + /** + * A set of wallet preferences tied to the buyer that is interacting with the cart. + * Preferences can be used to populate relevant payment fields in the checkout flow. + */ + + public List getWalletPreferences() { + return (List) get("walletPreferences"); + } + + public CartBuyerIdentity setWalletPreferences(List arg) { + optimisticData.put(getKey("walletPreferences"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "countryCode": return false; @@ -5204,6 +6273,8 @@ public boolean unwrapsToObject(String key) { case "phone": return false; + case "walletPreferences": return false; + default: return false; } } @@ -5220,6 +6291,8 @@ public static class CartBuyerIdentityInput implements Serializable { private Input> deliveryAddressPreferences = Input.undefined(); + private Input> walletPreferences = Input.undefined(); + public String getEmail() { return email.getValue(); } @@ -5325,9 +6398,30 @@ public CartBuyerIdentityInput setDeliveryAddressPreferencesInput(Input getWalletPreferences() { + return walletPreferences.getValue(); + } + + public Input> getWalletPreferencesInput() { + return walletPreferences; + } + + public CartBuyerIdentityInput setWalletPreferences(List walletPreferences) { + this.walletPreferences = Input.optional(walletPreferences); + return this; + } + + public CartBuyerIdentityInput setWalletPreferencesInput(Input> walletPreferences) { + if (walletPreferences == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.walletPreferences = walletPreferences; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); if (this.email.isDefined()) { _queryBuilder.append(separator); @@ -5393,6 +6487,26 @@ public void appendTo(StringBuilder _queryBuilder) { } } + if (this.walletPreferences.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("walletPreferences:"); + if (walletPreferences.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (String item1 : walletPreferences.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + Query.appendQuotedString(_queryBuilder, item1.toString()); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } + _queryBuilder.append('}'); } } @@ -5633,195 +6747,130 @@ public boolean unwrapsToObject(String key) { } } - public interface CartCostQueryDefinition { - void define(CartCostQuery _queryBuilder); + public interface CartCompletionActionQueryDefinition { + void define(CartCompletionActionQuery _queryBuilder); } /** - * The costs that the buyer will pay at checkout. - * The cart cost uses - * [`CartBuyerIdentity`](https://shopify.dev/api/storefront/reference/cart/cartbuyeridentity) to - * determine - * [international - * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing). + * The completion action to checkout a cart. */ - public static class CartCostQuery extends Query { - CartCostQuery(StringBuilder _queryBuilder) { + public static class CartCompletionActionQuery extends Query { + CartCompletionActionQuery(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, then 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; + startField("__typename"); } - /** - * 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)); + public CartCompletionActionQuery onCompletePaymentChallenge(CompletePaymentChallengeQueryDefinition queryDef) { + startInlineFragment("CompletePaymentChallenge"); + queryDef.define(new CompletePaymentChallengeQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; } + } - /** - * Whether the subtotal amount is estimated. - */ - public CartCostQuery subtotalAmountEstimated() { - startField("subtotalAmountEstimated"); + public interface CartCompletionAction { + String getGraphQlTypeName(); + } - return this; + /** + * The completion action to checkout a cart. + */ + public static class UnknownCartCompletionAction extends AbstractResponse implements CartCompletionAction { + public UnknownCartCompletionAction() { } - /** - * 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; + public UnknownCartCompletionAction(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()); + } + } + } } - /** - * Whether the total amount is estimated. - */ - public CartCostQuery totalAmountEstimated() { - startField("totalAmountEstimated"); + public static CartCompletionAction create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "CompletePaymentChallenge": { + return new CompletePaymentChallenge(fields); + } - return this; + default: { + return new UnknownCartCompletionAction(fields); + } + } } - /** - * 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('}'); + public String getGraphQlTypeName() { + return (String) get("__typename"); + } - return this; + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + default: return false; + } } + } - /** - * Whether the total duty amount is estimated. - */ - public CartCostQuery totalDutyAmountEstimated() { - startField("totalDutyAmountEstimated"); + public interface CartCompletionActionRequiredQueryDefinition { + void define(CartCompletionActionRequiredQuery _queryBuilder); + } - return this; + /** + * The required completion action to checkout a cart. + */ + public static class CartCompletionActionRequiredQuery extends Query { + CartCompletionActionRequiredQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The tax amount for the customer to pay at checkout. + * The action required to complete the cart completion attempt. */ - public CartCostQuery totalTaxAmount(MoneyV2QueryDefinition queryDef) { - startField("totalTaxAmount"); + public CartCompletionActionRequiredQuery action(CartCompletionActionQueryDefinition queryDef) { + startField("action"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new CartCompletionActionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Whether the total tax amount is estimated. + * The ID of the cart completion attempt. */ - public CartCostQuery totalTaxAmountEstimated() { - startField("totalTaxAmountEstimated"); + public CartCompletionActionRequiredQuery id() { + startField("id"); return this; } } /** - * The costs that the buyer will pay at checkout. - * The cart cost uses - * [`CartBuyerIdentity`](https://shopify.dev/api/storefront/reference/cart/cartbuyeridentity) to - * determine - * [international - * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing). + * The required completion action to checkout a cart. */ - public static class CartCost extends AbstractResponse { - public CartCost() { + public static class CartCompletionActionRequired extends AbstractResponse implements CartCompletionAttemptResult { + public CartCompletionActionRequired() { } - public CartCost(JsonObject fields) throws SchemaViolationError { + public CartCompletionActionRequired(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; + case "action": { + CartCompletionAction optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + optional1 = UnknownCartCompletionAction.create(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -5829,8 +6878,8 @@ public CartCost(JsonObject fields) throws SchemaViolationError { break; } - case "totalTaxAmountEstimated": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + case "id": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -5847,222 +6896,212 @@ public CartCost(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CartCost"; + return "CartCompletionActionRequired"; } /** - * 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 `subtotalAmount`. + * The action required to complete the cart completion attempt. */ - public MoneyV2 getCheckoutChargeAmount() { - return (MoneyV2) get("checkoutChargeAmount"); + public CartCompletionAction getAction() { + return (CartCompletionAction) get("action"); } - public CartCost setCheckoutChargeAmount(MoneyV2 arg) { - optimisticData.put(getKey("checkoutChargeAmount"), arg); + public CartCompletionActionRequired setAction(CartCompletionAction arg) { + optimisticData.put(getKey("action"), arg); return this; } /** - * The amount, before taxes and cart-level discounts, for the customer to pay. + * The ID of the cart completion attempt. */ - public MoneyV2 getSubtotalAmount() { - return (MoneyV2) get("subtotalAmount"); + public String getId() { + return (String) get("id"); } - public CartCost setSubtotalAmount(MoneyV2 arg) { - optimisticData.put(getKey("subtotalAmount"), arg); + public CartCompletionActionRequired setId(String arg) { + optimisticData.put(getKey("id"), arg); return this; } - /** - * Whether the subtotal amount is estimated. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "action": return false; - public Boolean getSubtotalAmountEstimated() { - return (Boolean) get("subtotalAmountEstimated"); - } + case "id": return false; - public CartCost setSubtotalAmountEstimated(Boolean arg) { - optimisticData.put(getKey("subtotalAmountEstimated"), arg); - return this; + default: return false; + } } + } - /** - * The total amount for the customer to pay. - */ + public interface CartCompletionAttemptResultQueryDefinition { + void define(CartCompletionAttemptResultQuery _queryBuilder); + } - public MoneyV2 getTotalAmount() { - return (MoneyV2) get("totalAmount"); - } + /** + * The result of a cart completion attempt. + */ + public static class CartCompletionAttemptResultQuery extends Query { + CartCompletionAttemptResultQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - public CartCost setTotalAmount(MoneyV2 arg) { - optimisticData.put(getKey("totalAmount"), arg); - return this; + startField("__typename"); } - /** - * Whether the total amount is estimated. - */ - - public Boolean getTotalAmountEstimated() { - return (Boolean) get("totalAmountEstimated"); + public CartCompletionAttemptResultQuery onCartCompletionActionRequired(CartCompletionActionRequiredQueryDefinition queryDef) { + startInlineFragment("CartCompletionActionRequired"); + queryDef.define(new CartCompletionActionRequiredQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public CartCost setTotalAmountEstimated(Boolean arg) { - optimisticData.put(getKey("totalAmountEstimated"), arg); + public CartCompletionAttemptResultQuery onCartCompletionFailed(CartCompletionFailedQueryDefinition queryDef) { + startInlineFragment("CartCompletionFailed"); + queryDef.define(new CartCompletionFailedQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The duty amount for the customer to pay at checkout. - */ - - public MoneyV2 getTotalDutyAmount() { - return (MoneyV2) get("totalDutyAmount"); + public CartCompletionAttemptResultQuery onCartCompletionProcessing(CartCompletionProcessingQueryDefinition queryDef) { + startInlineFragment("CartCompletionProcessing"); + queryDef.define(new CartCompletionProcessingQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public CartCost setTotalDutyAmount(MoneyV2 arg) { - optimisticData.put(getKey("totalDutyAmount"), arg); + public CartCompletionAttemptResultQuery onCartCompletionSuccess(CartCompletionSuccessQueryDefinition queryDef) { + startInlineFragment("CartCompletionSuccess"); + queryDef.define(new CartCompletionSuccessQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } + } - /** - * Whether the total duty amount is estimated. - */ + public interface CartCompletionAttemptResult { + String getGraphQlTypeName(); + } - public Boolean getTotalDutyAmountEstimated() { - return (Boolean) get("totalDutyAmountEstimated"); + /** + * The result of a cart completion attempt. + */ + public static class UnknownCartCompletionAttemptResult extends AbstractResponse implements CartCompletionAttemptResult { + public UnknownCartCompletionAttemptResult() { } - public CartCost setTotalDutyAmountEstimated(Boolean arg) { - optimisticData.put(getKey("totalDutyAmountEstimated"), arg); - return this; + public UnknownCartCompletionAttemptResult(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - /** - * The tax amount for the customer to pay at checkout. - */ + public static CartCompletionAttemptResult create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "CartCompletionActionRequired": { + return new CartCompletionActionRequired(fields); + } - public MoneyV2 getTotalTaxAmount() { - return (MoneyV2) get("totalTaxAmount"); - } + case "CartCompletionFailed": { + return new CartCompletionFailed(fields); + } - public CartCost setTotalTaxAmount(MoneyV2 arg) { - optimisticData.put(getKey("totalTaxAmount"), arg); - return this; - } + case "CartCompletionProcessing": { + return new CartCompletionProcessing(fields); + } - /** - * Whether the total tax amount is estimated. - */ + case "CartCompletionSuccess": { + return new CartCompletionSuccess(fields); + } - public Boolean getTotalTaxAmountEstimated() { - return (Boolean) get("totalTaxAmountEstimated"); + default: { + return new UnknownCartCompletionAttemptResult(fields); + } + } } - public CartCost setTotalTaxAmountEstimated(Boolean arg) { - optimisticData.put(getKey("totalTaxAmountEstimated"), arg); - return this; + public String getGraphQlTypeName() { + return (String) get("__typename"); } 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); + public interface CartCompletionFailedQueryDefinition { + void define(CartCompletionFailedQuery _queryBuilder); } /** - * Return type for `cartCreate` mutation. + * A failed completion to checkout a cart. */ - public static class CartCreatePayloadQuery extends Query { - CartCreatePayloadQuery(StringBuilder _queryBuilder) { + public static class CartCompletionFailedQuery extends Query { + CartCompletionFailedQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The new cart. + * The errors that caused the checkout to fail. */ - public CartCreatePayloadQuery cart(CartQueryDefinition queryDef) { - startField("cart"); + public CartCompletionFailedQuery errors(CompletionErrorQueryDefinition queryDef) { + startField("errors"); _queryBuilder.append('{'); - queryDef.define(new CartQuery(_queryBuilder)); + queryDef.define(new CompletionErrorQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. + * The ID of the cart completion attempt. */ - public CartCreatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CartUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CartCompletionFailedQuery id() { + startField("id"); return this; } } /** - * Return type for `cartCreate` mutation. + * A failed completion to checkout a cart. */ - public static class CartCreatePayload extends AbstractResponse { - public CartCreatePayload() { + public static class CartCompletionFailed extends AbstractResponse implements CartCompletionAttemptResult { + public CartCompletionFailed() { } - public CartCreatePayload(JsonObject fields) throws SchemaViolationError { + public CartCompletionFailed(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cart": { - Cart optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Cart(jsonAsObject(field.getValue(), key)); + case "errors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CompletionError(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CartUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "id": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -6079,101 +7118,97 @@ public CartCreatePayload(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CartCreatePayload"; + return "CartCompletionFailed"; } /** - * The new cart. + * The errors that caused the checkout to fail. */ - public Cart getCart() { - return (Cart) get("cart"); + public List getErrors() { + return (List) get("errors"); } - public CartCreatePayload setCart(Cart arg) { - optimisticData.put(getKey("cart"), arg); + public CartCompletionFailed setErrors(List arg) { + optimisticData.put(getKey("errors"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The ID of the cart completion attempt. */ - public List getUserErrors() { - return (List) get("userErrors"); + public String getId() { + return (String) get("id"); } - public CartCreatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public CartCompletionFailed setId(String arg) { + optimisticData.put(getKey("id"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cart": return true; + case "errors": return true; - case "userErrors": return true; + case "id": return false; default: return false; } } } - public interface CartCustomDiscountAllocationQueryDefinition { - void define(CartCustomDiscountAllocationQuery _queryBuilder); + public interface CartCompletionProcessingQueryDefinition { + void define(CartCompletionProcessingQuery _queryBuilder); } /** - * The discounts automatically applied to the cart line based on prerequisites that have been met. + * A cart checkout completion that's still processing. */ - public static class CartCustomDiscountAllocationQuery extends Query { - CartCustomDiscountAllocationQuery(StringBuilder _queryBuilder) { + public static class CartCompletionProcessingQuery extends Query { + CartCompletionProcessingQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The discounted amount that has been applied to the cart line. + * The ID of the cart completion attempt. */ - public CartCustomDiscountAllocationQuery discountedAmount(MoneyV2QueryDefinition queryDef) { - startField("discountedAmount"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public CartCompletionProcessingQuery id() { + startField("id"); return this; } /** - * The title of the allocated discount. + * The number of milliseconds to wait before polling again. */ - public CartCustomDiscountAllocationQuery title() { - startField("title"); + public CartCompletionProcessingQuery pollDelay() { + startField("pollDelay"); return this; } } /** - * The discounts automatically applied to the cart line based on prerequisites that have been met. + * A cart checkout completion that's still processing. */ - public static class CartCustomDiscountAllocation extends AbstractResponse implements CartDiscountAllocation { - public CartCustomDiscountAllocation() { + public static class CartCompletionProcessing extends AbstractResponse implements CartCompletionAttemptResult { + public CartCompletionProcessing() { } - public CartCustomDiscountAllocation(JsonObject fields) throws SchemaViolationError { + public CartCompletionProcessing(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))); + case "id": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "pollDelay": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); break; } @@ -6190,246 +7225,132 @@ public CartCustomDiscountAllocation(JsonObject fields) throws SchemaViolationErr } public String getGraphQlTypeName() { - return "CartCustomDiscountAllocation"; + return "CartCompletionProcessing"; } /** - * The discounted amount that has been applied to the cart line. + * The ID of the cart completion attempt. */ - public MoneyV2 getDiscountedAmount() { - return (MoneyV2) get("discountedAmount"); + public String getId() { + return (String) get("id"); } - public CartCustomDiscountAllocation setDiscountedAmount(MoneyV2 arg) { - optimisticData.put(getKey("discountedAmount"), arg); + public CartCompletionProcessing setId(String arg) { + optimisticData.put(getKey("id"), arg); return this; } /** - * The title of the allocated discount. + * The number of milliseconds to wait before polling again. */ - public String getTitle() { - return (String) get("title"); + public Integer getPollDelay() { + return (Integer) get("pollDelay"); } - public CartCustomDiscountAllocation setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public CartCompletionProcessing setPollDelay(Integer arg) { + optimisticData.put(getKey("pollDelay"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "discountedAmount": return true; + case "id": return false; - case "title": return false; + case "pollDelay": return false; default: return false; } } } - public interface CartDeliveryGroupQueryDefinition { - void define(CartDeliveryGroupQuery _queryBuilder); + public interface CartCompletionSuccessQueryDefinition { + void define(CartCompletionSuccessQuery _queryBuilder); } /** - * Information about the options available for one or more line items to be delivered to a specific - * address. + * A successful completion to checkout a cart and a created order. */ - public static class CartDeliveryGroupQuery extends Query { - CartDeliveryGroupQuery(StringBuilder _queryBuilder) { + public static class CartCompletionSuccessQuery extends Query { + CartCompletionSuccessQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } - public class CartLinesArguments extends Arguments { - CartLinesArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * The date and time when the job completed. + */ + public CartCompletionSuccessQuery completedAt() { + startField("completedAt"); - /** - * Returns up to the first `n` elements from the list. - */ - public CartLinesArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + return this; + } - /** - * Returns the elements that come after the specified cursor. - */ - public CartLinesArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + /** + * The ID of the cart completion attempt. + */ + public CartCompletionSuccessQuery id() { + startField("id"); - /** - * Returns up to the last `n` elements from the list. - */ - public CartLinesArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + return this; + } - /** - * Returns the elements that come before the specified cursor. - */ - public CartLinesArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Reverse the order of the underlying list. - */ - public CartLinesArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - } - - public interface CartLinesArgumentsDefinition { - void define(CartLinesArguments args); - } - - /** - * A list of cart lines for the delivery group. - */ - public CartDeliveryGroupQuery cartLines(CartLineConnectionQueryDefinition queryDef) { - return cartLines(args -> {}, queryDef); - } - - /** - * A list of cart lines for the delivery group. - */ - public CartDeliveryGroupQuery cartLines(CartLinesArgumentsDefinition argsDef, CartLineConnectionQueryDefinition queryDef) { - startField("cartLines"); - - CartLinesArguments args = new CartLinesArguments(_queryBuilder); - argsDef.define(args); - CartLinesArguments.end(args); - - _queryBuilder.append('{'); - queryDef.define(new CartLineConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The destination address for the delivery group. - */ - public CartDeliveryGroupQuery deliveryAddress(MailingAddressQueryDefinition queryDef) { - startField("deliveryAddress"); - - _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The delivery options available for the delivery group. - */ - public CartDeliveryGroupQuery deliveryOptions(CartDeliveryOptionQueryDefinition queryDef) { - startField("deliveryOptions"); - - _queryBuilder.append('{'); - queryDef.define(new CartDeliveryOptionQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The ID for the delivery group. - */ - public CartDeliveryGroupQuery id() { - startField("id"); + /** + * The ID of the order that's created in Shopify. + */ + public CartCompletionSuccessQuery orderId() { + startField("orderId"); return this; } /** - * The selected delivery option for the delivery group. + * The URL of the order confirmation in Shopify. */ - public CartDeliveryGroupQuery selectedDeliveryOption(CartDeliveryOptionQueryDefinition queryDef) { - startField("selectedDeliveryOption"); - - _queryBuilder.append('{'); - queryDef.define(new CartDeliveryOptionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CartCompletionSuccessQuery orderUrl() { + startField("orderUrl"); return this; } } /** - * Information about the options available for one or more line items to be delivered to a specific - * address. + * A successful completion to checkout a cart and a created order. */ - public static class CartDeliveryGroup extends AbstractResponse { - public CartDeliveryGroup() { + public static class CartCompletionSuccess extends AbstractResponse implements CartCompletionAttemptResult { + public CartCompletionSuccess() { } - public CartDeliveryGroup(JsonObject fields) throws SchemaViolationError { + public CartCompletionSuccess(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cartLines": { - responseData.put(key, new CartLineConnection(jsonAsObject(field.getValue(), key))); - - break; - } + case "completedAt": { + DateTime optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = Utils.parseDateTime(jsonAsString(field.getValue(), key)); + } - case "deliveryAddress": { - responseData.put(key, new MailingAddress(jsonAsObject(field.getValue(), key))); + responseData.put(key, optional1); break; } - case "deliveryOptions": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CartDeliveryOption(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "id": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "id": { + case "orderId": { responseData.put(key, new ID(jsonAsString(field.getValue(), key))); break; } - case "selectedDeliveryOption": { - CartDeliveryOption optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartDeliveryOption(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "orderUrl": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -6446,179 +7367,274 @@ public CartDeliveryGroup(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CartDeliveryGroup"; - } - - /** - * A list of cart lines for the delivery group. - */ - - public CartLineConnection getCartLines() { - return (CartLineConnection) get("cartLines"); - } - - public CartDeliveryGroup setCartLines(CartLineConnection arg) { - optimisticData.put(getKey("cartLines"), arg); - return this; + return "CartCompletionSuccess"; } /** - * The destination address for the delivery group. + * The date and time when the job completed. */ - public MailingAddress getDeliveryAddress() { - return (MailingAddress) get("deliveryAddress"); + public DateTime getCompletedAt() { + return (DateTime) get("completedAt"); } - public CartDeliveryGroup setDeliveryAddress(MailingAddress arg) { - optimisticData.put(getKey("deliveryAddress"), arg); + public CartCompletionSuccess setCompletedAt(DateTime arg) { + optimisticData.put(getKey("completedAt"), arg); return this; } /** - * The delivery options available for the delivery group. + * The ID of the cart completion attempt. */ - public List getDeliveryOptions() { - return (List) get("deliveryOptions"); + public String getId() { + return (String) get("id"); } - public CartDeliveryGroup setDeliveryOptions(List arg) { - optimisticData.put(getKey("deliveryOptions"), arg); + public CartCompletionSuccess setId(String arg) { + optimisticData.put(getKey("id"), arg); return this; } /** - * The ID for the delivery group. + * The ID of the order that's created in Shopify. */ - public ID getId() { - return (ID) get("id"); + public ID getOrderId() { + return (ID) get("orderId"); } - public CartDeliveryGroup setId(ID arg) { - optimisticData.put(getKey("id"), arg); + public CartCompletionSuccess setOrderId(ID arg) { + optimisticData.put(getKey("orderId"), arg); return this; } /** - * The selected delivery option for the delivery group. + * The URL of the order confirmation in Shopify. */ - public CartDeliveryOption getSelectedDeliveryOption() { - return (CartDeliveryOption) get("selectedDeliveryOption"); + public String getOrderUrl() { + return (String) get("orderUrl"); } - public CartDeliveryGroup setSelectedDeliveryOption(CartDeliveryOption arg) { - optimisticData.put(getKey("selectedDeliveryOption"), arg); + public CartCompletionSuccess setOrderUrl(String arg) { + optimisticData.put(getKey("orderUrl"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cartLines": return true; - - case "deliveryAddress": return true; - - case "deliveryOptions": return true; + case "completedAt": return false; case "id": return false; - case "selectedDeliveryOption": return true; + case "orderId": return false; + + case "orderUrl": return false; default: return false; } } } - public interface CartDeliveryGroupConnectionQueryDefinition { - void define(CartDeliveryGroupConnectionQuery _queryBuilder); + public interface CartCostQueryDefinition { + void define(CartCostQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple CartDeliveryGroups. + * The costs that the buyer will pay at checkout. + * The cart cost uses + * [`CartBuyerIdentity`](https://shopify.dev/api/storefront/reference/cart/cartbuyeridentity) to + * determine + * [international + * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing). */ - public static class CartDeliveryGroupConnectionQuery extends Query { - CartDeliveryGroupConnectionQuery(StringBuilder _queryBuilder) { + public static class CartCostQuery extends Query { + CartCostQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A list of edges. + * 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 `subtotalAmount`. */ - public CartDeliveryGroupConnectionQuery edges(CartDeliveryGroupEdgeQueryDefinition queryDef) { - startField("edges"); + public CartCostQuery checkoutChargeAmount(MoneyV2QueryDefinition queryDef) { + startField("checkoutChargeAmount"); _queryBuilder.append('{'); - queryDef.define(new CartDeliveryGroupEdgeQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in CartDeliveryGroupEdge. + * The amount, before taxes and cart-level discounts, for the customer to pay. */ - public CartDeliveryGroupConnectionQuery nodes(CartDeliveryGroupQueryDefinition queryDef) { - startField("nodes"); + public CartCostQuery subtotalAmount(MoneyV2QueryDefinition queryDef) { + startField("subtotalAmount"); _queryBuilder.append('{'); - queryDef.define(new CartDeliveryGroupQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Information to aid in pagination. + * Whether the subtotal amount is estimated. */ - public CartDeliveryGroupConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + 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 PageInfoQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * Whether 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 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 the total tax amount is estimated. + */ + public CartCostQuery totalTaxAmountEstimated() { + startField("totalTaxAmountEstimated"); + + return this; + } } /** - * An auto-generated type for paginating through multiple CartDeliveryGroups. + * The costs that the buyer will pay at checkout. + * The cart cost uses + * [`CartBuyerIdentity`](https://shopify.dev/api/storefront/reference/cart/cartbuyeridentity) to + * determine + * [international + * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing). */ - public static class CartDeliveryGroupConnection extends AbstractResponse { - public CartDeliveryGroupConnection() { + public static class CartCost extends AbstractResponse { + public CartCost() { } - public CartDeliveryGroupConnection(JsonObject fields) throws SchemaViolationError { + public CartCost(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 CartDeliveryGroupEdge(jsonAsObject(element1, key))); + 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, list1); + responseData.put(key, optional1); break; } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CartDeliveryGroup(jsonAsObject(element1, key))); + 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, list1); + responseData.put(key, optional1); break; } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "totalTaxAmountEstimated": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } @@ -6635,276 +7651,208 @@ public CartDeliveryGroupConnection(JsonObject fields) throws SchemaViolationErro } public String getGraphQlTypeName() { - return "CartDeliveryGroupConnection"; + return "CartCost"; } /** - * A list of edges. + * 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 `subtotalAmount`. */ - public List getEdges() { - return (List) get("edges"); + public MoneyV2 getCheckoutChargeAmount() { + return (MoneyV2) get("checkoutChargeAmount"); } - public CartDeliveryGroupConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); + public CartCost setCheckoutChargeAmount(MoneyV2 arg) { + optimisticData.put(getKey("checkoutChargeAmount"), arg); return this; } /** - * A list of the nodes contained in CartDeliveryGroupEdge. + * The amount, before taxes and cart-level discounts, for the customer to pay. */ - public List getNodes() { - return (List) get("nodes"); + public MoneyV2 getSubtotalAmount() { + return (MoneyV2) get("subtotalAmount"); } - public CartDeliveryGroupConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + public CartCost setSubtotalAmount(MoneyV2 arg) { + optimisticData.put(getKey("subtotalAmount"), arg); return this; } /** - * Information to aid in pagination. + * Whether the subtotal amount is estimated. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public Boolean getSubtotalAmountEstimated() { + return (Boolean) get("subtotalAmountEstimated"); } - public CartDeliveryGroupConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public CartCost setSubtotalAmountEstimated(Boolean arg) { + optimisticData.put(getKey("subtotalAmountEstimated"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return true; - - case "pageInfo": return true; + /** + * The total amount for the customer to pay. + */ - default: return false; - } + public MoneyV2 getTotalAmount() { + return (MoneyV2) get("totalAmount"); } - } - - public interface CartDeliveryGroupEdgeQueryDefinition { - void define(CartDeliveryGroupEdgeQuery _queryBuilder); - } - /** - * An auto-generated type which holds one CartDeliveryGroup and a cursor during pagination. - */ - public static class CartDeliveryGroupEdgeQuery extends Query { - CartDeliveryGroupEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public CartCost setTotalAmount(MoneyV2 arg) { + optimisticData.put(getKey("totalAmount"), arg); + return this; } /** - * A cursor for use in pagination. + * Whether the total amount is estimated. */ - public CartDeliveryGroupEdgeQuery cursor() { - startField("cursor"); + public Boolean getTotalAmountEstimated() { + return (Boolean) get("totalAmountEstimated"); + } + + public CartCost setTotalAmountEstimated(Boolean arg) { + optimisticData.put(getKey("totalAmountEstimated"), arg); return this; } /** - * The item at the end of CartDeliveryGroupEdge. + * The duty amount for the customer to pay at checkout. */ - public CartDeliveryGroupEdgeQuery node(CartDeliveryGroupQueryDefinition queryDef) { - startField("node"); - - _queryBuilder.append('{'); - queryDef.define(new CartDeliveryGroupQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public MoneyV2 getTotalDutyAmount() { + return (MoneyV2) get("totalDutyAmount"); } - } - /** - * An auto-generated type which holds one CartDeliveryGroup and a cursor during pagination. - */ - public static class CartDeliveryGroupEdge extends AbstractResponse { - public CartDeliveryGroupEdge() { + public CartCost setTotalDutyAmount(MoneyV2 arg) { + optimisticData.put(getKey("totalDutyAmount"), arg); + return this; } - public CartDeliveryGroupEdge(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 CartDeliveryGroup(jsonAsObject(field.getValue(), key))); - - break; - } + /** + * Whether the total duty amount is estimated. + */ - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public Boolean getTotalDutyAmountEstimated() { + return (Boolean) get("totalDutyAmountEstimated"); } - public String getGraphQlTypeName() { - return "CartDeliveryGroupEdge"; + public CartCost setTotalDutyAmountEstimated(Boolean arg) { + optimisticData.put(getKey("totalDutyAmountEstimated"), arg); + return this; } /** - * A cursor for use in pagination. + * The tax amount for the customer to pay at checkout. */ - public String getCursor() { - return (String) get("cursor"); + public MoneyV2 getTotalTaxAmount() { + return (MoneyV2) get("totalTaxAmount"); } - public CartDeliveryGroupEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public CartCost setTotalTaxAmount(MoneyV2 arg) { + optimisticData.put(getKey("totalTaxAmount"), arg); return this; } /** - * The item at the end of CartDeliveryGroupEdge. + * Whether the total tax amount is estimated. */ - public CartDeliveryGroup getNode() { - return (CartDeliveryGroup) get("node"); + public Boolean getTotalTaxAmountEstimated() { + return (Boolean) get("totalTaxAmountEstimated"); } - public CartDeliveryGroupEdge setNode(CartDeliveryGroup arg) { - optimisticData.put(getKey("node"), arg); + public CartCost setTotalTaxAmountEstimated(Boolean arg) { + optimisticData.put(getKey("totalTaxAmountEstimated"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cursor": return false; + case "checkoutChargeAmount": return true; - case "node": 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 CartDeliveryOptionQueryDefinition { - void define(CartDeliveryOptionQuery _queryBuilder); + public interface CartCreatePayloadQueryDefinition { + void define(CartCreatePayloadQuery _queryBuilder); } /** - * Information about a delivery option. + * Return type for `cartCreate` mutation. */ - public static class CartDeliveryOptionQuery extends Query { - CartDeliveryOptionQuery(StringBuilder _queryBuilder) { + public static class CartCreatePayloadQuery extends Query { + CartCreatePayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The code of the delivery option. + * The new cart. */ - public CartDeliveryOptionQuery code() { - startField("code"); - - return this; - } - - /** - * The method for the delivery option. - */ - public CartDeliveryOptionQuery deliveryMethodType() { - startField("deliveryMethodType"); - - return this; - } - - /** - * The description of the delivery option. - */ - public CartDeliveryOptionQuery description() { - startField("description"); - - return this; - } - - /** - * The estimated cost for the delivery option. - */ - public CartDeliveryOptionQuery estimatedCost(MoneyV2QueryDefinition queryDef) { - startField("estimatedCost"); + public CartCreatePayloadQuery cart(CartQueryDefinition queryDef) { + startField("cart"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new CartQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The unique identifier of the delivery option. + * The list of errors that occurred from executing the mutation. */ - public CartDeliveryOptionQuery handle() { - startField("handle"); - - return this; - } + public CartCreatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { + startField("userErrors"); - /** - * The title of the delivery option. - */ - public CartDeliveryOptionQuery title() { - startField("title"); + _queryBuilder.append('{'); + queryDef.define(new CartUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * Information about a delivery option. + * Return type for `cartCreate` mutation. */ - public static class CartDeliveryOption extends AbstractResponse { - public CartDeliveryOption() { + public static class CartCreatePayload extends AbstractResponse { + public CartCreatePayload() { } - public CartDeliveryOption(JsonObject fields) throws SchemaViolationError { + public CartCreatePayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "code": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "deliveryMethodType": { - responseData.put(key, DeliveryMethodType.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "description": { - String optional1 = null; + case "cart": { + Cart optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new Cart(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -6912,25 +7860,13 @@ public CartDeliveryOption(JsonObject fields) throws SchemaViolationError { break; } - case "estimatedCost": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "handle": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "title": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartUserError(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } @@ -6947,124 +7883,62 @@ public CartDeliveryOption(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CartDeliveryOption"; - } - - /** - * The code of the delivery option. - */ - - public String getCode() { - return (String) get("code"); - } - - public CartDeliveryOption setCode(String arg) { - optimisticData.put(getKey("code"), arg); - return this; - } - - /** - * The method for the delivery option. - */ - - public DeliveryMethodType getDeliveryMethodType() { - return (DeliveryMethodType) get("deliveryMethodType"); - } - - public CartDeliveryOption setDeliveryMethodType(DeliveryMethodType arg) { - optimisticData.put(getKey("deliveryMethodType"), arg); - return this; - } - - /** - * The description of the delivery option. - */ - - public String getDescription() { - return (String) get("description"); - } - - public CartDeliveryOption setDescription(String arg) { - optimisticData.put(getKey("description"), arg); - return this; - } - - /** - * The estimated cost for the delivery option. - */ - - public MoneyV2 getEstimatedCost() { - return (MoneyV2) get("estimatedCost"); - } - - public CartDeliveryOption setEstimatedCost(MoneyV2 arg) { - optimisticData.put(getKey("estimatedCost"), arg); - return this; + return "CartCreatePayload"; } /** - * The unique identifier of the delivery option. + * The new cart. */ - public String getHandle() { - return (String) get("handle"); + public Cart getCart() { + return (Cart) get("cart"); } - public CartDeliveryOption setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); + public CartCreatePayload setCart(Cart arg) { + optimisticData.put(getKey("cart"), arg); return this; } /** - * The title of the delivery option. + * The list of errors that occurred from executing the mutation. */ - public String getTitle() { - return (String) get("title"); + public List getUserErrors() { + return (List) get("userErrors"); } - public CartDeliveryOption setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public CartCreatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "code": return false; - - case "deliveryMethodType": return false; - - case "description": return false; - - case "estimatedCost": return true; - - case "handle": return false; + case "cart": return true; - case "title": return false; + case "userErrors": return true; default: return false; } } } - public interface CartDiscountAllocationQueryDefinition { - void define(CartDiscountAllocationQuery _queryBuilder); + public interface CartCustomDiscountAllocationQueryDefinition { + void define(CartCustomDiscountAllocationQuery _queryBuilder); } /** - * The discounts that have been applied to the cart line. + * The discounts automatically applied to the cart line based on prerequisites that have been met. */ - public static class CartDiscountAllocationQuery extends Query { - CartDiscountAllocationQuery(StringBuilder _queryBuilder) { + public static class CartCustomDiscountAllocationQuery extends Query { + CartCustomDiscountAllocationQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("__typename"); } /** * The discounted amount that has been applied to the cart line. */ - public CartDiscountAllocationQuery discountedAmount(MoneyV2QueryDefinition queryDef) { + public CartCustomDiscountAllocationQuery discountedAmount(MoneyV2QueryDefinition queryDef) { startField("discountedAmount"); _queryBuilder.append('{'); @@ -7074,42 +7948,24 @@ public CartDiscountAllocationQuery discountedAmount(MoneyV2QueryDefinition query return this; } - public CartDiscountAllocationQuery onCartAutomaticDiscountAllocation(CartAutomaticDiscountAllocationQueryDefinition queryDef) { - startInlineFragment("CartAutomaticDiscountAllocation"); - queryDef.define(new CartAutomaticDiscountAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public CartDiscountAllocationQuery onCartCodeDiscountAllocation(CartCodeDiscountAllocationQueryDefinition queryDef) { - startInlineFragment("CartCodeDiscountAllocation"); - queryDef.define(new CartCodeDiscountAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * The title of the allocated discount. + */ + public CartCustomDiscountAllocationQuery title() { + startField("title"); - public CartDiscountAllocationQuery onCartCustomDiscountAllocation(CartCustomDiscountAllocationQueryDefinition queryDef) { - startInlineFragment("CartCustomDiscountAllocation"); - queryDef.define(new CartCustomDiscountAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } } - public interface CartDiscountAllocation { - String getGraphQlTypeName(); - - MoneyV2 getDiscountedAmount(); - } - /** - * The discounts that have been applied to the cart line. + * The discounts automatically applied to the cart line based on prerequisites that have been met. */ - public static class UnknownCartDiscountAllocation extends AbstractResponse implements CartDiscountAllocation { - public UnknownCartDiscountAllocation() { + public static class CartCustomDiscountAllocation extends AbstractResponse implements CartDiscountAllocation { + public CartCustomDiscountAllocation() { } - public UnknownCartDiscountAllocation(JsonObject fields) throws SchemaViolationError { + public CartCustomDiscountAllocation(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -7120,6 +7976,12 @@ public UnknownCartDiscountAllocation(JsonObject fields) throws SchemaViolationEr break; } + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -7131,29 +7993,8 @@ public UnknownCartDiscountAllocation(JsonObject fields) throws SchemaViolationEr } } - public static CartDiscountAllocation create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "CartAutomaticDiscountAllocation": { - return new CartAutomaticDiscountAllocation(fields); - } - - case "CartCodeDiscountAllocation": { - return new CartCodeDiscountAllocation(fields); - } - - case "CartCustomDiscountAllocation": { - return new CartCustomDiscountAllocation(fields); - } - - default: { - return new UnknownCartDiscountAllocation(fields); - } - } - } - public String getGraphQlTypeName() { - return (String) get("__typename"); + return "CartCustomDiscountAllocation"; } /** @@ -7164,160 +8005,180 @@ public MoneyV2 getDiscountedAmount() { return (MoneyV2) get("discountedAmount"); } - public UnknownCartDiscountAllocation setDiscountedAmount(MoneyV2 arg) { + 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 CartDiscountCodeQueryDefinition { - void define(CartDiscountCodeQuery _queryBuilder); + public interface CartDeliveryGroupQueryDefinition { + void define(CartDeliveryGroupQuery _queryBuilder); } /** - * The discount codes applied to the cart. + * Information about the options available for one or more line items to be delivered to a specific + * address. */ - public static class CartDiscountCodeQuery extends Query { - CartDiscountCodeQuery(StringBuilder _queryBuilder) { + public static class CartDeliveryGroupQuery extends Query { + CartDeliveryGroupQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } - /** - * Whether the discount code is applicable to the cart's current contents. - */ - public CartDiscountCodeQuery applicable() { - startField("applicable"); - - return this; - } - - /** - * The code for the discount. - */ - public CartDiscountCodeQuery code() { - startField("code"); - - return this; - } - } - - /** - * The discount codes applied to the cart. - */ - public static class CartDiscountCode extends AbstractResponse { - public CartDiscountCode() { - } + public class CartLinesArguments extends Arguments { + CartLinesArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - public CartDiscountCode(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "applicable": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + /** + * Returns up to the first `n` elements from the list. + */ + public CartLinesArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - break; - } + /** + * Returns the elements that come after the specified cursor. + */ + public CartLinesArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "code": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Returns up to the last `n` elements from the list. + */ + public CartLinesArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - break; - } + /** + * Returns the elements that come before the specified cursor. + */ + public CartLinesArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + /** + * Reverse the order of the underlying list. + */ + public CartLinesArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; } } - public String getGraphQlTypeName() { - return "CartDiscountCode"; + public interface CartLinesArgumentsDefinition { + void define(CartLinesArguments args); } /** - * Whether the discount code is applicable to the cart's current contents. + * A list of cart lines for the delivery group. */ - - public Boolean getApplicable() { - return (Boolean) get("applicable"); - } - - public CartDiscountCode setApplicable(Boolean arg) { - optimisticData.put(getKey("applicable"), arg); - return this; + public CartDeliveryGroupQuery cartLines(BaseCartLineConnectionQueryDefinition queryDef) { + return cartLines(args -> {}, queryDef); } /** - * The code for the discount. + * A list of cart lines for the delivery group. */ + public CartDeliveryGroupQuery cartLines(CartLinesArgumentsDefinition argsDef, BaseCartLineConnectionQueryDefinition queryDef) { + startField("cartLines"); - public String getCode() { - return (String) get("code"); - } + CartLinesArguments args = new CartLinesArguments(_queryBuilder); + argsDef.define(args); + CartLinesArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new BaseCartLineConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public CartDiscountCode setCode(String arg) { - optimisticData.put(getKey("code"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "applicable": return false; - - case "code": return false; - - default: return false; - } - } - } + /** + * The destination address for the delivery group. + */ + public CartDeliveryGroupQuery deliveryAddress(MailingAddressQueryDefinition queryDef) { + startField("deliveryAddress"); - public interface CartDiscountCodesUpdatePayloadQueryDefinition { - void define(CartDiscountCodesUpdatePayloadQuery _queryBuilder); - } + _queryBuilder.append('{'); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Return type for `cartDiscountCodesUpdate` mutation. - */ - public static class CartDiscountCodesUpdatePayloadQuery extends Query { - CartDiscountCodesUpdatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * The updated cart. + * The delivery options available for the delivery group. */ - public CartDiscountCodesUpdatePayloadQuery cart(CartQueryDefinition queryDef) { - startField("cart"); + public CartDeliveryGroupQuery deliveryOptions(CartDeliveryOptionQueryDefinition queryDef) { + startField("deliveryOptions"); _queryBuilder.append('{'); - queryDef.define(new CartQuery(_queryBuilder)); + queryDef.define(new CartDeliveryOptionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. + * The ID for the delivery group. */ - public CartDiscountCodesUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { - startField("userErrors"); + public CartDeliveryGroupQuery id() { + startField("id"); + + return this; + } + + /** + * The selected delivery option for the delivery group. + */ + public CartDeliveryGroupQuery selectedDeliveryOption(CartDeliveryOptionQueryDefinition queryDef) { + startField("selectedDeliveryOption"); _queryBuilder.append('{'); - queryDef.define(new CartUserErrorQuery(_queryBuilder)); + queryDef.define(new CartDeliveryOptionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -7325,32 +8186,34 @@ public CartDiscountCodesUpdatePayloadQuery userErrors(CartUserErrorQueryDefiniti } /** - * Return type for `cartDiscountCodesUpdate` mutation. + * Information about the options available for one or more line items to be delivered to a specific + * address. */ - public static class CartDiscountCodesUpdatePayload extends AbstractResponse { - public CartDiscountCodesUpdatePayload() { + public static class CartDeliveryGroup extends AbstractResponse { + public CartDeliveryGroup() { } - public CartDiscountCodesUpdatePayload(JsonObject fields) throws SchemaViolationError { + public CartDeliveryGroup(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cart": { - Cart optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Cart(jsonAsObject(field.getValue(), key)); - } + case "cartLines": { + responseData.put(key, new BaseCartLineConnection(jsonAsObject(field.getValue(), key))); - responseData.put(key, optional1); + break; + } + + case "deliveryAddress": { + responseData.put(key, new MailingAddress(jsonAsObject(field.getValue(), key))); break; } - case "userErrors": { - List list1 = new ArrayList<>(); + case "deliveryOptions": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CartUserError(jsonAsObject(element1, key))); + list1.add(new CartDeliveryOption(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -7358,228 +8221,166 @@ public CartDiscountCodesUpdatePayload(JsonObject fields) throws SchemaViolationE break; } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "CartDiscountCodesUpdatePayload"; - } - /** - * The updated cart. - */ + case "selectedDeliveryOption": { + CartDeliveryOption optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartDeliveryOption(jsonAsObject(field.getValue(), key)); + } - public Cart getCart() { - return (Cart) get("cart"); + responseData.put(key, optional1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public CartDiscountCodesUpdatePayload setCart(Cart arg) { - optimisticData.put(getKey("cart"), arg); - return this; + public String getGraphQlTypeName() { + return "CartDeliveryGroup"; } /** - * The list of errors that occurred from executing the mutation. + * A list of cart lines for the delivery group. */ - public List getUserErrors() { - return (List) get("userErrors"); + public BaseCartLineConnection getCartLines() { + return (BaseCartLineConnection) get("cartLines"); } - public CartDiscountCodesUpdatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public CartDeliveryGroup setCartLines(BaseCartLineConnection arg) { + optimisticData.put(getKey("cartLines"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cart": return true; - - case "userErrors": return true; + /** + * The destination address for the delivery group. + */ - default: return false; - } + public MailingAddress getDeliveryAddress() { + return (MailingAddress) get("deliveryAddress"); } - } - /** - * Possible error codes that can be returned by `CartUserError`. - */ - public enum CartErrorCode { - /** - * The input value is invalid. - */ - INVALID, + public CartDeliveryGroup setDeliveryAddress(MailingAddress arg) { + optimisticData.put(getKey("deliveryAddress"), arg); + return this; + } /** - * Merchandise line was not found in cart. + * The delivery options available for the delivery group. */ - INVALID_MERCHANDISE_LINE, - /** - * The input value should be less than the maximum value allowed. - */ - LESS_THAN, + public List getDeliveryOptions() { + return (List) get("deliveryOptions"); + } - /** - * Missing discount code. - */ - MISSING_DISCOUNT_CODE, + public CartDeliveryGroup setDeliveryOptions(List arg) { + optimisticData.put(getKey("deliveryOptions"), arg); + return this; + } /** - * Missing note. + * The ID for the delivery group. */ - MISSING_NOTE, - - UNKNOWN_VALUE; - - public static CartErrorCode fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "INVALID": { - return INVALID; - } - case "INVALID_MERCHANDISE_LINE": { - return INVALID_MERCHANDISE_LINE; - } + public ID getId() { + return (ID) get("id"); + } - case "LESS_THAN": { - return LESS_THAN; - } + public CartDeliveryGroup setId(ID arg) { + optimisticData.put(getKey("id"), arg); + return this; + } - case "MISSING_DISCOUNT_CODE": { - return MISSING_DISCOUNT_CODE; - } + /** + * The selected delivery option for the delivery group. + */ - case "MISSING_NOTE": { - return MISSING_NOTE; - } + public CartDeliveryOption getSelectedDeliveryOption() { + return (CartDeliveryOption) get("selectedDeliveryOption"); + } - default: { - return UNKNOWN_VALUE; - } - } + public CartDeliveryGroup setSelectedDeliveryOption(CartDeliveryOption arg) { + optimisticData.put(getKey("selectedDeliveryOption"), arg); + return this; } - public String toString() { - switch (this) { - case INVALID: { - return "INVALID"; - } - case INVALID_MERCHANDISE_LINE: { - return "INVALID_MERCHANDISE_LINE"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cartLines": return true; - case LESS_THAN: { - return "LESS_THAN"; - } + case "deliveryAddress": return true; - case MISSING_DISCOUNT_CODE: { - return "MISSING_DISCOUNT_CODE"; - } + case "deliveryOptions": return true; - case MISSING_NOTE: { - return "MISSING_NOTE"; - } + case "id": return false; - default: { - return ""; - } + case "selectedDeliveryOption": return true; + + default: return false; } } } - public interface CartEstimatedCostQueryDefinition { - void define(CartEstimatedCostQuery _queryBuilder); + public interface CartDeliveryGroupConnectionQueryDefinition { + void define(CartDeliveryGroupConnectionQuery _queryBuilder); } /** - * The estimated costs that the buyer will pay at checkout. - * The estimated cost uses - * [`CartBuyerIdentity`](https://shopify.dev/api/storefront/reference/cart/cartbuyeridentity) - * to determine - * [international - * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing). + * An auto-generated type for paginating through multiple CartDeliveryGroups. */ - public static class CartEstimatedCostQuery extends Query { - CartEstimatedCostQuery(StringBuilder _queryBuilder) { + public static class CartDeliveryGroupConnectionQuery extends Query { + CartDeliveryGroupConnectionQuery(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, 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"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The estimated total amount for the customer to pay. + * A list of edges. */ - public CartEstimatedCostQuery totalAmount(MoneyV2QueryDefinition queryDef) { - startField("totalAmount"); + public CartDeliveryGroupConnectionQuery edges(CartDeliveryGroupEdgeQueryDefinition queryDef) { + startField("edges"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new CartDeliveryGroupEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The estimated duty amount for the customer to pay at checkout. + * A list of the nodes contained in CartDeliveryGroupEdge. */ - public CartEstimatedCostQuery totalDutyAmount(MoneyV2QueryDefinition queryDef) { - startField("totalDutyAmount"); + public CartDeliveryGroupConnectionQuery nodes(CartDeliveryGroupQueryDefinition queryDef) { + startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new CartDeliveryGroupQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The estimated tax amount for the customer to pay at checkout. + * Information to aid in pagination. */ - public CartEstimatedCostQuery totalTaxAmount(MoneyV2QueryDefinition queryDef) { - startField("totalTaxAmount"); + public CartDeliveryGroupConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new PageInfoQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -7587,58 +8388,41 @@ public CartEstimatedCostQuery totalTaxAmount(MoneyV2QueryDefinition queryDef) { } /** - * The estimated costs that the buyer will pay at checkout. - * The estimated cost uses - * [`CartBuyerIdentity`](https://shopify.dev/api/storefront/reference/cart/cartbuyeridentity) - * to determine - * [international - * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing). + * An auto-generated type for paginating through multiple CartDeliveryGroups. */ - public static class CartEstimatedCost extends AbstractResponse { - public CartEstimatedCost() { + public static class CartDeliveryGroupConnection extends AbstractResponse { + public CartDeliveryGroupConnection() { } - public CartEstimatedCost(JsonObject fields) throws SchemaViolationError { + public CartDeliveryGroupConnection(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 "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartDeliveryGroupEdge(jsonAsObject(element1, key))); + } - case "totalAmount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + responseData.put(key, list1); break; } - case "totalDutyAmount": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartDeliveryGroup(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "totalTaxAmount": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } @@ -7655,441 +8439,259 @@ public CartEstimatedCost(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CartEstimatedCost"; + return "CartDeliveryGroupConnection"; } /** - * 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`. + * A list of edges. */ - public MoneyV2 getCheckoutChargeAmount() { - return (MoneyV2) get("checkoutChargeAmount"); + public List getEdges() { + return (List) get("edges"); } - public CartEstimatedCost setCheckoutChargeAmount(MoneyV2 arg) { - optimisticData.put(getKey("checkoutChargeAmount"), arg); + public CartDeliveryGroupConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * The estimated amount, before taxes and discounts, for the customer to pay. + * A list of the nodes contained in CartDeliveryGroupEdge. */ - public MoneyV2 getSubtotalAmount() { - return (MoneyV2) get("subtotalAmount"); + public List getNodes() { + return (List) get("nodes"); } - public CartEstimatedCost setSubtotalAmount(MoneyV2 arg) { - optimisticData.put(getKey("subtotalAmount"), arg); + public CartDeliveryGroupConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * The estimated total amount for the customer to pay. + * Information to aid in pagination. */ - public MoneyV2 getTotalAmount() { - return (MoneyV2) get("totalAmount"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public CartEstimatedCost setTotalAmount(MoneyV2 arg) { - optimisticData.put(getKey("totalAmount"), arg); + public CartDeliveryGroupConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } - /** - * The estimated duty amount for the customer to pay at checkout. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - public MoneyV2 getTotalDutyAmount() { - return (MoneyV2) get("totalDutyAmount"); + case "nodes": return true; + + case "pageInfo": return true; + + default: return false; + } } + } - public CartEstimatedCost setTotalDutyAmount(MoneyV2 arg) { - optimisticData.put(getKey("totalDutyAmount"), arg); - return this; + public interface CartDeliveryGroupEdgeQueryDefinition { + void define(CartDeliveryGroupEdgeQuery _queryBuilder); + } + + /** + * An auto-generated type which holds one CartDeliveryGroup and a cursor during pagination. + */ + public static class CartDeliveryGroupEdgeQuery extends Query { + CartDeliveryGroupEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The estimated tax amount for the customer to pay at checkout. + * A cursor for use in pagination. */ + public CartDeliveryGroupEdgeQuery cursor() { + startField("cursor"); - public MoneyV2 getTotalTaxAmount() { - return (MoneyV2) get("totalTaxAmount"); - } - - public CartEstimatedCost setTotalTaxAmount(MoneyV2 arg) { - optimisticData.put(getKey("totalTaxAmount"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkoutChargeAmount": return true; - - case "subtotalAmount": return true; - - case "totalAmount": return true; - - case "totalDutyAmount": return true; + /** + * The item at the end of CartDeliveryGroupEdge. + */ + public CartDeliveryGroupEdgeQuery node(CartDeliveryGroupQueryDefinition queryDef) { + startField("node"); - case "totalTaxAmount": return true; + _queryBuilder.append('{'); + queryDef.define(new CartDeliveryGroupQuery(_queryBuilder)); + _queryBuilder.append('}'); - default: return false; - } + return this; } } - public static class CartInput implements Serializable { - private Input> attributes = Input.undefined(); + /** + * An auto-generated type which holds one CartDeliveryGroup and a cursor during pagination. + */ + public static class CartDeliveryGroupEdge extends AbstractResponse { + public CartDeliveryGroupEdge() { + } - private Input> lines = Input.undefined(); + public CartDeliveryGroupEdge(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)); - private Input> discountCodes = Input.undefined(); + break; + } - private Input note = Input.undefined(); + case "node": { + responseData.put(key, new CartDeliveryGroup(jsonAsObject(field.getValue(), key))); - private Input buyerIdentity = Input.undefined(); + break; + } - public List getAttributes() { - return attributes.getValue(); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public Input> getAttributesInput() { - return attributes; + public String getGraphQlTypeName() { + return "CartDeliveryGroupEdge"; } - public CartInput setAttributes(List attributes) { - this.attributes = Input.optional(attributes); - return this; + /** + * A cursor for use in pagination. + */ + + public String getCursor() { + return (String) get("cursor"); } - public CartInput setAttributesInput(Input> attributes) { - if (attributes == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.attributes = attributes; + public CartDeliveryGroupEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } - public List getLines() { - return lines.getValue(); - } + /** + * The item at the end of CartDeliveryGroupEdge. + */ - public Input> getLinesInput() { - return lines; + public CartDeliveryGroup getNode() { + return (CartDeliveryGroup) get("node"); } - public CartInput setLines(List lines) { - this.lines = Input.optional(lines); + public CartDeliveryGroupEdge setNode(CartDeliveryGroup arg) { + optimisticData.put(getKey("node"), arg); return this; } - public CartInput setLinesInput(Input> lines) { - if (lines == null) { - throw new IllegalArgumentException("Input can not be null"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; + + case "node": return true; + + default: return false; } - this.lines = lines; - return this; } + } - public List getDiscountCodes() { - return discountCodes.getValue(); - } + public interface CartDeliveryOptionQueryDefinition { + void define(CartDeliveryOptionQuery _queryBuilder); + } - public Input> getDiscountCodesInput() { - return discountCodes; + /** + * Information about a delivery option. + */ + public static class CartDeliveryOptionQuery extends Query { + CartDeliveryOptionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } - public CartInput setDiscountCodes(List discountCodes) { - this.discountCodes = Input.optional(discountCodes); - return this; - } + /** + * The code of the delivery option. + */ + public CartDeliveryOptionQuery code() { + startField("code"); - public CartInput setDiscountCodesInput(Input> discountCodes) { - if (discountCodes == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.discountCodes = discountCodes; return this; } - public String getNote() { - return note.getValue(); - } + /** + * The method for the delivery option. + */ + public CartDeliveryOptionQuery deliveryMethodType() { + startField("deliveryMethodType"); - public Input getNoteInput() { - return note; + return this; } - public CartInput setNote(String note) { - this.note = Input.optional(note); + /** + * The description of the delivery option. + */ + public CartDeliveryOptionQuery description() { + startField("description"); + return this; } - public CartInput setNoteInput(Input note) { - if (note == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.note = note; - return this; - } - - public CartBuyerIdentityInput getBuyerIdentity() { - return buyerIdentity.getValue(); - } - - public Input getBuyerIdentityInput() { - return buyerIdentity; - } - - public CartInput setBuyerIdentity(CartBuyerIdentityInput buyerIdentity) { - this.buyerIdentity = Input.optional(buyerIdentity); - return this; - } - - public CartInput 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.attributes.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("attributes:"); - if (attributes.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (AttributeInput item1 : attributes.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - } else { - _queryBuilder.append("null"); - } - } - - if (this.lines.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("lines:"); - if (lines.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (CartLineInput item1 : lines.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - } else { - _queryBuilder.append("null"); - } - } - - if (this.discountCodes.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("discountCodes:"); - if (discountCodes.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (String item1 : discountCodes.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - Query.appendQuotedString(_queryBuilder, item1.toString()); - } - } - _queryBuilder.append(']'); - } else { - _queryBuilder.append("null"); - } - } - - 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.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 CartLineQueryDefinition { - void define(CartLineQuery _queryBuilder); - } - - /** - * Represents information about the merchandise in the cart. - */ - public static class CartLineQuery extends Query { - CartLineQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - - 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. - */ - public CartLineQuery attributes(AttributeQueryDefinition queryDef) { - startField("attributes"); - - _queryBuilder.append('{'); - queryDef.define(new AttributeQuery(_queryBuilder)); - _queryBuilder.append('}'); - - 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. - */ - public CartLineQuery discountAllocations(CartDiscountAllocationQueryDefinition queryDef) { - startField("discountAllocations"); - - _queryBuilder.append('{'); - queryDef.define(new CartDiscountAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * 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"); - - _queryBuilder.append('{'); - queryDef.define(new CartLineEstimatedCostQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The merchandise that the buyer intends to purchase. - */ - public CartLineQuery merchandise(MerchandiseQueryDefinition queryDef) { - startField("merchandise"); - - _queryBuilder.append('{'); - queryDef.define(new MerchandiseQuery(_queryBuilder)); - _queryBuilder.append('}'); - + /** + * The estimated cost for the delivery option. + */ + public CartDeliveryOptionQuery estimatedCost(MoneyV2QueryDefinition queryDef) { + startField("estimatedCost"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + return this; } /** - * The quantity of the merchandise that the customer intends to purchase. + * The unique identifier of the delivery option. */ - public CartLineQuery quantity() { - startField("quantity"); + public CartDeliveryOptionQuery handle() { + startField("handle"); return this; } /** - * The selling plan associated with the cart line and the effect that each selling plan has on variants - * when they're purchased. + * The title of the delivery option. */ - public CartLineQuery sellingPlanAllocation(SellingPlanAllocationQueryDefinition queryDef) { - startField("sellingPlanAllocation"); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CartDeliveryOptionQuery title() { + startField("title"); return this; } } /** - * Represents information about the merchandise in the cart. + * Information about a delivery option. */ - public static class CartLine extends AbstractResponse implements Node { - public CartLine() { + public static class CartDeliveryOption extends AbstractResponse { + public CartDeliveryOption() { } - public CartLine(JsonObject fields) throws SchemaViolationError { + public CartDeliveryOption(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "attribute": { - Attribute optional1 = null; + case "code": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Attribute(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -8097,62 +8699,39 @@ public CartLine(JsonObject fields) throws SchemaViolationError { break; } - case "attributes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Attribute(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "cost": { - responseData.put(key, new CartLineCost(jsonAsObject(field.getValue(), key))); + case "deliveryMethodType": { + responseData.put(key, DeliveryMethodType.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "discountAllocations": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(UnknownCartDiscountAllocation.create(jsonAsObject(element1, key))); + case "description": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } case "estimatedCost": { - responseData.put(key, new CartLineEstimatedCost(jsonAsObject(field.getValue(), key))); - - break; - } - - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - - break; - } - - case "merchandise": { - responseData.put(key, UnknownMerchandise.create(jsonAsObject(field.getValue(), key))); + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "quantity": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "sellingPlanAllocation": { - SellingPlanAllocation optional1 = null; + case "title": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new SellingPlanAllocation(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -8171,245 +8750,223 @@ public CartLine(JsonObject fields) throws SchemaViolationError { } } - public CartLine(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "CartLine"; + return "CartDeliveryOption"; } /** - * An attribute associated with the cart line. + * The code of the delivery option. */ - public Attribute getAttribute() { - return (Attribute) get("attribute"); + public String getCode() { + return (String) get("code"); } - public CartLine setAttribute(Attribute arg) { - optimisticData.put(getKey("attribute"), arg); + public CartDeliveryOption setCode(String arg) { + optimisticData.put(getKey("code"), arg); return this; } /** - * The attributes associated with the cart line. Attributes are represented as key-value pairs. + * The method for the delivery option. */ - public List getAttributes() { - return (List) get("attributes"); + public DeliveryMethodType getDeliveryMethodType() { + return (DeliveryMethodType) get("deliveryMethodType"); } - public CartLine setAttributes(List arg) { - optimisticData.put(getKey("attributes"), arg); + public CartDeliveryOption setDeliveryMethodType(DeliveryMethodType arg) { + optimisticData.put(getKey("deliveryMethodType"), 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. + * The description of the delivery option. */ - public CartLineCost getCost() { - return (CartLineCost) get("cost"); + public String getDescription() { + return (String) get("description"); } - public CartLine setCost(CartLineCost arg) { - optimisticData.put(getKey("cost"), arg); + public CartDeliveryOption setDescription(String arg) { + optimisticData.put(getKey("description"), arg); return this; } /** - * The discounts that have been applied to the cart line. + * The estimated cost for the delivery option. */ - public List getDiscountAllocations() { - return (List) get("discountAllocations"); + public MoneyV2 getEstimatedCost() { + return (MoneyV2) get("estimatedCost"); } - public CartLine setDiscountAllocations(List arg) { - optimisticData.put(getKey("discountAllocations"), arg); + public CartDeliveryOption setEstimatedCost(MoneyV2 arg) { + optimisticData.put(getKey("estimatedCost"), arg); return this; } /** - * 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. + * The unique identifier of the delivery option. */ - public CartLineEstimatedCost getEstimatedCost() { - return (CartLineEstimatedCost) get("estimatedCost"); + public String getHandle() { + return (String) get("handle"); } - public CartLine setEstimatedCost(CartLineEstimatedCost arg) { - optimisticData.put(getKey("estimatedCost"), arg); + public CartDeliveryOption setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); return this; } /** - * A globally-unique identifier. - */ - - public ID getId() { - return (ID) get("id"); - } - - /** - * The merchandise that the buyer intends to purchase. + * The title of the delivery option. */ - public Merchandise getMerchandise() { - return (Merchandise) get("merchandise"); + public String getTitle() { + return (String) get("title"); } - public CartLine setMerchandise(Merchandise arg) { - optimisticData.put(getKey("merchandise"), arg); + public CartDeliveryOption setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } - /** - * The quantity of the merchandise that the customer intends to purchase. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "code": return false; - public Integer getQuantity() { - return (Integer) get("quantity"); - } + case "deliveryMethodType": return false; - public CartLine setQuantity(Integer arg) { - optimisticData.put(getKey("quantity"), arg); - return this; - } + case "description": return false; - /** - * The selling plan associated with the cart line and the effect that each selling plan has on variants - * when they're purchased. - */ + case "estimatedCost": return true; - public SellingPlanAllocation getSellingPlanAllocation() { - return (SellingPlanAllocation) get("sellingPlanAllocation"); - } + case "handle": return false; - public CartLine setSellingPlanAllocation(SellingPlanAllocation arg) { - optimisticData.put(getKey("sellingPlanAllocation"), arg); - return this; + case "title": return false; + + default: return false; + } } + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "attribute": return true; + public static class CartDirectPaymentMethodInput implements Serializable { + private MailingAddressInput billingAddress; - case "attributes": return true; + private String sessionId; - case "cost": return true; + public CartDirectPaymentMethodInput(MailingAddressInput billingAddress, String sessionId) { + this.billingAddress = billingAddress; - case "discountAllocations": return false; + this.sessionId = sessionId; + } - case "estimatedCost": return true; + public MailingAddressInput getBillingAddress() { + return billingAddress; + } - case "id": return false; + public CartDirectPaymentMethodInput setBillingAddress(MailingAddressInput billingAddress) { + this.billingAddress = billingAddress; + return this; + } - case "merchandise": return false; + public String getSessionId() { + return sessionId; + } - case "quantity": return false; + public CartDirectPaymentMethodInput setSessionId(String sessionId) { + this.sessionId = sessionId; + return this; + } - case "sellingPlanAllocation": return true; + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - default: return false; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("billingAddress:"); + billingAddress.appendTo(_queryBuilder); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("sessionId:"); + Query.appendQuotedString(_queryBuilder, sessionId.toString()); + + _queryBuilder.append('}'); } } - public interface CartLineConnectionQueryDefinition { - void define(CartLineConnectionQuery _queryBuilder); + public interface CartDiscountAllocationQueryDefinition { + void define(CartDiscountAllocationQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple CartLines. + * The discounts that have been applied to the cart line. */ - public static class CartLineConnectionQuery extends Query { - CartLineConnectionQuery(StringBuilder _queryBuilder) { + public static class CartDiscountAllocationQuery extends Query { + CartDiscountAllocationQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("__typename"); } /** - * A list of edges. + * The discounted amount that has been applied to the cart line. */ - public CartLineConnectionQuery edges(CartLineEdgeQueryDefinition queryDef) { - startField("edges"); + public CartDiscountAllocationQuery discountedAmount(MoneyV2QueryDefinition queryDef) { + startField("discountedAmount"); _queryBuilder.append('{'); - queryDef.define(new CartLineEdgeQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } - /** - * A list of the nodes contained in CartLineEdge. - */ - public CartLineConnectionQuery nodes(CartLineQueryDefinition queryDef) { - startField("nodes"); - - _queryBuilder.append('{'); - queryDef.define(new CartLineQuery(_queryBuilder)); + public CartDiscountAllocationQuery onCartAutomaticDiscountAllocation(CartAutomaticDiscountAllocationQueryDefinition queryDef) { + startInlineFragment("CartAutomaticDiscountAllocation"); + queryDef.define(new CartAutomaticDiscountAllocationQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; } - /** - * Information to aid in pagination. - */ - public CartLineConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); + public CartDiscountAllocationQuery onCartCodeDiscountAllocation(CartCodeDiscountAllocationQueryDefinition queryDef) { + startInlineFragment("CartCodeDiscountAllocation"); + queryDef.define(new CartCodeDiscountAllocationQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; + } + public CartDiscountAllocationQuery onCartCustomDiscountAllocation(CartCustomDiscountAllocationQueryDefinition queryDef) { + startInlineFragment("CartCustomDiscountAllocation"); + queryDef.define(new CartCustomDiscountAllocationQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } + public interface CartDiscountAllocation { + String getGraphQlTypeName(); + + MoneyV2 getDiscountedAmount(); + } + /** - * An auto-generated type for paginating through multiple CartLines. + * The discounts that have been applied to the cart line. */ - public static class CartLineConnection extends AbstractResponse { - public CartLineConnection() { + public static class UnknownCartDiscountAllocation extends AbstractResponse implements CartDiscountAllocation { + public UnknownCartDiscountAllocation() { } - public CartLineConnection(JsonObject fields) throws SchemaViolationError { + public UnknownCartDiscountAllocation(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 CartLineEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CartLine(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "discountedAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } @@ -8425,164 +8982,104 @@ public CartLineConnection(JsonObject fields) throws SchemaViolationError { } } - public String getGraphQlTypeName() { - return "CartLineConnection"; - } - - /** - * A list of edges. - */ - - public List getEdges() { - return (List) get("edges"); - } + public static CartDiscountAllocation create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "CartAutomaticDiscountAllocation": { + return new CartAutomaticDiscountAllocation(fields); + } - public CartLineConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; - } + case "CartCodeDiscountAllocation": { + return new CartCodeDiscountAllocation(fields); + } - /** - * A list of the nodes contained in CartLineEdge. - */ + case "CartCustomDiscountAllocation": { + return new CartCustomDiscountAllocation(fields); + } - public List getNodes() { - return (List) get("nodes"); + default: { + return new UnknownCartDiscountAllocation(fields); + } + } } - public CartLineConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; + public String getGraphQlTypeName() { + return (String) get("__typename"); } /** - * Information to aid in pagination. + * The discounted amount that has been applied to the cart line. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public MoneyV2 getDiscountedAmount() { + return (MoneyV2) get("discountedAmount"); } - public CartLineConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public UnknownCartDiscountAllocation setDiscountedAmount(MoneyV2 arg) { + optimisticData.put(getKey("discountedAmount"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return true; - - case "pageInfo": return true; + case "discountedAmount": return true; default: return false; } } } - public interface CartLineCostQueryDefinition { - void define(CartLineCostQuery _queryBuilder); + public interface CartDiscountCodeQueryDefinition { + void define(CartDiscountCodeQuery _queryBuilder); } /** - * The cost of the merchandise line that the buyer will pay at checkout. + * The discount codes applied to the cart. */ - public static class CartLineCostQuery extends Query { - CartLineCostQuery(StringBuilder _queryBuilder) { + public static class CartDiscountCodeQuery extends Query { + CartDiscountCodeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The amount of the merchandise line. - */ - public CartLineCostQuery amountPerQuantity(MoneyV2QueryDefinition queryDef) { - startField("amountPerQuantity"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The compare at amount of the merchandise line. - */ - public CartLineCostQuery compareAtAmountPerQuantity(MoneyV2QueryDefinition queryDef) { - startField("compareAtAmountPerQuantity"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The cost of the merchandise line before line-level discounts. + * Whether the discount code is applicable to the cart's current contents. */ - public CartLineCostQuery subtotalAmount(MoneyV2QueryDefinition queryDef) { - startField("subtotalAmount"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public CartDiscountCodeQuery applicable() { + startField("applicable"); return this; } /** - * The total cost of the merchandise line. + * The code for the discount. */ - public CartLineCostQuery totalAmount(MoneyV2QueryDefinition queryDef) { - startField("totalAmount"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public CartDiscountCodeQuery code() { + startField("code"); return this; } } /** - * The cost of the merchandise line that the buyer will pay at checkout. + * The discount codes applied to the cart. */ - public static class CartLineCost extends AbstractResponse { - public CartLineCost() { + public static class CartDiscountCode extends AbstractResponse { + public CartDiscountCode() { } - public CartLineCost(JsonObject fields) throws SchemaViolationError { + public CartDiscountCode(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))); + case "applicable": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } - case "totalAmount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "code": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -8599,105 +9096,79 @@ public CartLineCost(JsonObject fields) throws SchemaViolationError { } 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; + return "CartDiscountCode"; } /** - * The cost of the merchandise line before line-level discounts. + * Whether the discount code is applicable to the cart's current contents. */ - public MoneyV2 getSubtotalAmount() { - return (MoneyV2) get("subtotalAmount"); + public Boolean getApplicable() { + return (Boolean) get("applicable"); } - public CartLineCost setSubtotalAmount(MoneyV2 arg) { - optimisticData.put(getKey("subtotalAmount"), arg); + public CartDiscountCode setApplicable(Boolean arg) { + optimisticData.put(getKey("applicable"), arg); return this; } /** - * The total cost of the merchandise line. + * The code for the discount. */ - public MoneyV2 getTotalAmount() { - return (MoneyV2) get("totalAmount"); + public String getCode() { + return (String) get("code"); } - public CartLineCost setTotalAmount(MoneyV2 arg) { - optimisticData.put(getKey("totalAmount"), arg); + public CartDiscountCode setCode(String arg) { + optimisticData.put(getKey("code"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "amountPerQuantity": return true; - - case "compareAtAmountPerQuantity": return true; - - case "subtotalAmount": return true; + case "applicable": return false; - case "totalAmount": return true; + case "code": return false; default: return false; } } } - public interface CartLineEdgeQueryDefinition { - void define(CartLineEdgeQuery _queryBuilder); + public interface CartDiscountCodesUpdatePayloadQueryDefinition { + void define(CartDiscountCodesUpdatePayloadQuery _queryBuilder); } /** - * An auto-generated type which holds one CartLine and a cursor during pagination. + * Return type for `cartDiscountCodesUpdate` mutation. */ - public static class CartLineEdgeQuery extends Query { - CartLineEdgeQuery(StringBuilder _queryBuilder) { + public static class CartDiscountCodesUpdatePayloadQuery extends Query { + CartDiscountCodesUpdatePayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A cursor for use in pagination. + * The updated cart. */ - public CartLineEdgeQuery cursor() { - startField("cursor"); + public CartDiscountCodesUpdatePayloadQuery cart(CartQueryDefinition queryDef) { + startField("cart"); + + _queryBuilder.append('{'); + queryDef.define(new CartQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The item at the end of CartLineEdge. + * The list of errors that occurred from executing the mutation. */ - public CartLineEdgeQuery node(CartLineQueryDefinition queryDef) { - startField("node"); + public CartDiscountCodesUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { + startField("userErrors"); _queryBuilder.append('{'); - queryDef.define(new CartLineQuery(_queryBuilder)); + queryDef.define(new CartUserErrorQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -8705,25 +9176,35 @@ public CartLineEdgeQuery node(CartLineQueryDefinition queryDef) { } /** - * An auto-generated type which holds one CartLine and a cursor during pagination. + * Return type for `cartDiscountCodesUpdate` mutation. */ - public static class CartLineEdge extends AbstractResponse { - public CartLineEdge() { + public static class CartDiscountCodesUpdatePayload extends AbstractResponse { + public CartDiscountCodesUpdatePayload() { } - public CartLineEdge(JsonObject fields) throws SchemaViolationError { + public CartDiscountCodesUpdatePayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "cart": { + Cart optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Cart(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "node": { - responseData.put(key, new CartLine(jsonAsObject(field.getValue(), key))); + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartUserError(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } @@ -8740,63 +9221,239 @@ public CartLineEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CartLineEdge"; + return "CartDiscountCodesUpdatePayload"; } /** - * A cursor for use in pagination. + * The updated cart. */ - public String getCursor() { - return (String) get("cursor"); + public Cart getCart() { + return (Cart) get("cart"); } - public CartLineEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public CartDiscountCodesUpdatePayload setCart(Cart arg) { + optimisticData.put(getKey("cart"), arg); return this; } /** - * The item at the end of CartLineEdge. + * The list of errors that occurred from executing the mutation. */ - public CartLine getNode() { - return (CartLine) get("node"); + public List getUserErrors() { + return (List) get("userErrors"); } - public CartLineEdge setNode(CartLine arg) { - optimisticData.put(getKey("node"), arg); + public CartDiscountCodesUpdatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cursor": return false; + case "cart": return true; - case "node": return true; + case "userErrors": return true; default: return false; } } } - public interface CartLineEstimatedCostQueryDefinition { - void define(CartLineEstimatedCostQuery _queryBuilder); + /** + * Possible error codes that can be returned by `CartUserError`. + */ + public enum CartErrorCode { + /** + * The input value is invalid. + */ + INVALID, + + /** + * Delivery group was not found in cart. + */ + INVALID_DELIVERY_GROUP, + + /** + * Delivery option was not valid. + */ + INVALID_DELIVERY_OPTION, + + /** + * Merchandise line was not found in cart. + */ + INVALID_MERCHANDISE_LINE, + + /** + * The metafields were not valid. + */ + INVALID_METAFIELDS, + + /** + * The payment wasn't valid. + */ + INVALID_PAYMENT, + + /** + * Cannot update payment on an empty cart + */ + INVALID_PAYMENT_EMPTY_CART, + + /** + * The input value should be less than the maximum value allowed. + */ + LESS_THAN, + + /** + * Missing discount code. + */ + MISSING_DISCOUNT_CODE, + + /** + * Missing note. + */ + MISSING_NOTE, + + /** + * The payment method is not supported. + */ + PAYMENT_METHOD_NOT_SUPPORTED, + + UNKNOWN_VALUE; + + public static CartErrorCode fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "INVALID": { + return INVALID; + } + + case "INVALID_DELIVERY_GROUP": { + return INVALID_DELIVERY_GROUP; + } + + case "INVALID_DELIVERY_OPTION": { + return INVALID_DELIVERY_OPTION; + } + + case "INVALID_MERCHANDISE_LINE": { + return INVALID_MERCHANDISE_LINE; + } + + case "INVALID_METAFIELDS": { + return INVALID_METAFIELDS; + } + + case "INVALID_PAYMENT": { + return INVALID_PAYMENT; + } + + case "INVALID_PAYMENT_EMPTY_CART": { + return INVALID_PAYMENT_EMPTY_CART; + } + + case "LESS_THAN": { + return LESS_THAN; + } + + case "MISSING_DISCOUNT_CODE": { + return MISSING_DISCOUNT_CODE; + } + + case "MISSING_NOTE": { + return MISSING_NOTE; + } + + case "PAYMENT_METHOD_NOT_SUPPORTED": { + return PAYMENT_METHOD_NOT_SUPPORTED; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case INVALID: { + return "INVALID"; + } + + case INVALID_DELIVERY_GROUP: { + return "INVALID_DELIVERY_GROUP"; + } + + case INVALID_DELIVERY_OPTION: { + return "INVALID_DELIVERY_OPTION"; + } + + case INVALID_MERCHANDISE_LINE: { + return "INVALID_MERCHANDISE_LINE"; + } + + case INVALID_METAFIELDS: { + return "INVALID_METAFIELDS"; + } + + case INVALID_PAYMENT: { + return "INVALID_PAYMENT"; + } + + case INVALID_PAYMENT_EMPTY_CART: { + return "INVALID_PAYMENT_EMPTY_CART"; + } + + case LESS_THAN: { + return "LESS_THAN"; + } + + case MISSING_DISCOUNT_CODE: { + return "MISSING_DISCOUNT_CODE"; + } + + case MISSING_NOTE: { + return "MISSING_NOTE"; + } + + case PAYMENT_METHOD_NOT_SUPPORTED: { + return "PAYMENT_METHOD_NOT_SUPPORTED"; + } + + default: { + return ""; + } + } + } + } + + public interface CartEstimatedCostQueryDefinition { + void define(CartEstimatedCostQuery _queryBuilder); } /** - * The estimated cost of the merchandise line that the buyer will pay at checkout. + * The estimated costs that the buyer will pay at checkout. + * The estimated cost uses + * [`CartBuyerIdentity`](https://shopify.dev/api/storefront/reference/cart/cartbuyeridentity) + * to determine + * [international + * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing). */ - public static class CartLineEstimatedCostQuery extends Query { - CartLineEstimatedCostQuery(StringBuilder _queryBuilder) { + public static class CartEstimatedCostQuery extends Query { + CartEstimatedCostQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The amount of the merchandise line. + * 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 CartLineEstimatedCostQuery amount(MoneyV2QueryDefinition queryDef) { - startField("amount"); + public CartEstimatedCostQuery checkoutChargeAmount(MoneyV2QueryDefinition queryDef) { + startField("checkoutChargeAmount"); _queryBuilder.append('{'); queryDef.define(new MoneyV2Query(_queryBuilder)); @@ -8806,10 +9463,10 @@ public CartLineEstimatedCostQuery amount(MoneyV2QueryDefinition queryDef) { } /** - * The compare at amount of the merchandise line. + * The estimated amount, before taxes and discounts, for the customer to pay. */ - public CartLineEstimatedCostQuery compareAtAmount(MoneyV2QueryDefinition queryDef) { - startField("compareAtAmount"); + public CartEstimatedCostQuery subtotalAmount(MoneyV2QueryDefinition queryDef) { + startField("subtotalAmount"); _queryBuilder.append('{'); queryDef.define(new MoneyV2Query(_queryBuilder)); @@ -8819,10 +9476,10 @@ public CartLineEstimatedCostQuery compareAtAmount(MoneyV2QueryDefinition queryDe } /** - * The estimated cost of the merchandise line before discounts. + * The estimated total amount for the customer to pay. */ - public CartLineEstimatedCostQuery subtotalAmount(MoneyV2QueryDefinition queryDef) { - startField("subtotalAmount"); + public CartEstimatedCostQuery totalAmount(MoneyV2QueryDefinition queryDef) { + startField("totalAmount"); _queryBuilder.append('{'); queryDef.define(new MoneyV2Query(_queryBuilder)); @@ -8832,10 +9489,23 @@ public CartLineEstimatedCostQuery subtotalAmount(MoneyV2QueryDefinition queryDef } /** - * The estimated total cost of the merchandise line. + * The estimated duty amount for the customer to pay at checkout. */ - public CartLineEstimatedCostQuery totalAmount(MoneyV2QueryDefinition queryDef) { - startField("totalAmount"); + public CartEstimatedCostQuery totalDutyAmount(MoneyV2QueryDefinition queryDef) { + startField("totalDutyAmount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The estimated tax amount for the customer to pay at checkout. + */ + public CartEstimatedCostQuery totalTaxAmount(MoneyV2QueryDefinition queryDef) { + startField("totalTaxAmount"); _queryBuilder.append('{'); queryDef.define(new MoneyV2Query(_queryBuilder)); @@ -8846,24 +9516,41 @@ public CartLineEstimatedCostQuery totalAmount(MoneyV2QueryDefinition queryDef) { } /** - * The estimated cost of the merchandise line that the buyer will pay at checkout. + * The estimated costs that the buyer will pay at checkout. + * The estimated cost uses + * [`CartBuyerIdentity`](https://shopify.dev/api/storefront/reference/cart/cartbuyeridentity) + * to determine + * [international + * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing). */ - public static class CartLineEstimatedCost extends AbstractResponse { - public CartLineEstimatedCost() { + public static class CartEstimatedCost extends AbstractResponse { + public CartEstimatedCost() { } - public CartLineEstimatedCost(JsonObject fields) throws SchemaViolationError { + public CartEstimatedCost(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "amount": { + case "checkoutChargeAmount": { responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "compareAtAmount": { + 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 "totalDutyAmount": { MoneyV2 optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); @@ -8874,14 +9561,13 @@ public CartLineEstimatedCost(JsonObject fields) throws SchemaViolationError { break; } - case "subtotalAmount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } + case "totalTaxAmount": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } - case "totalAmount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + responseData.put(key, optional1); break; } @@ -8898,98 +9584,135 @@ public CartLineEstimatedCost(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CartLineEstimatedCost"; + return "CartEstimatedCost"; } /** - * The amount of the merchandise line. + * 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 getAmount() { - return (MoneyV2) get("amount"); + public MoneyV2 getCheckoutChargeAmount() { + return (MoneyV2) get("checkoutChargeAmount"); } - public CartLineEstimatedCost setAmount(MoneyV2 arg) { - optimisticData.put(getKey("amount"), arg); + public CartEstimatedCost setCheckoutChargeAmount(MoneyV2 arg) { + optimisticData.put(getKey("checkoutChargeAmount"), arg); return this; } /** - * The compare at amount of the merchandise line. + * The estimated amount, before taxes and discounts, for the customer to pay. */ - public MoneyV2 getCompareAtAmount() { - return (MoneyV2) get("compareAtAmount"); + public MoneyV2 getSubtotalAmount() { + return (MoneyV2) get("subtotalAmount"); } - public CartLineEstimatedCost setCompareAtAmount(MoneyV2 arg) { - optimisticData.put(getKey("compareAtAmount"), arg); + public CartEstimatedCost setSubtotalAmount(MoneyV2 arg) { + optimisticData.put(getKey("subtotalAmount"), arg); return this; } /** - * The estimated cost of the merchandise line before discounts. + * The estimated total amount for the customer to pay. */ - public MoneyV2 getSubtotalAmount() { - return (MoneyV2) get("subtotalAmount"); + public MoneyV2 getTotalAmount() { + return (MoneyV2) get("totalAmount"); } - public CartLineEstimatedCost setSubtotalAmount(MoneyV2 arg) { - optimisticData.put(getKey("subtotalAmount"), arg); + public CartEstimatedCost setTotalAmount(MoneyV2 arg) { + optimisticData.put(getKey("totalAmount"), arg); return this; } /** - * The estimated total cost of the merchandise line. + * The estimated duty amount for the customer to pay at checkout. */ - public MoneyV2 getTotalAmount() { - return (MoneyV2) get("totalAmount"); + public MoneyV2 getTotalDutyAmount() { + return (MoneyV2) get("totalDutyAmount"); } - public CartLineEstimatedCost setTotalAmount(MoneyV2 arg) { - optimisticData.put(getKey("totalAmount"), arg); + public CartEstimatedCost setTotalDutyAmount(MoneyV2 arg) { + optimisticData.put(getKey("totalDutyAmount"), arg); + return this; + } + + /** + * The estimated tax amount for the customer to pay at checkout. + */ + + public MoneyV2 getTotalTaxAmount() { + return (MoneyV2) get("totalTaxAmount"); + } + + public CartEstimatedCost setTotalTaxAmount(MoneyV2 arg) { + optimisticData.put(getKey("totalTaxAmount"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "amount": return true; - - case "compareAtAmount": return true; + case "checkoutChargeAmount": return true; case "subtotalAmount": return true; case "totalAmount": return true; + case "totalDutyAmount": return true; + + case "totalTaxAmount": return true; + default: return false; } } } - public static class CartLineInput implements Serializable { - private ID merchandiseId; - - private Input> attributes = Input.undefined(); - - private Input quantity = Input.undefined(); - - private Input sellingPlanId = Input.undefined(); + public static class CartFreePaymentMethodInput implements Serializable { + private MailingAddressInput billingAddress; - public CartLineInput(ID merchandiseId) { - this.merchandiseId = merchandiseId; + public CartFreePaymentMethodInput(MailingAddressInput billingAddress) { + this.billingAddress = billingAddress; } - public ID getMerchandiseId() { - return merchandiseId; + public MailingAddressInput getBillingAddress() { + return billingAddress; } - public CartLineInput setMerchandiseId(ID merchandiseId) { - this.merchandiseId = merchandiseId; + public CartFreePaymentMethodInput setBillingAddress(MailingAddressInput billingAddress) { + this.billingAddress = billingAddress; return this; } + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("billingAddress:"); + billingAddress.appendTo(_queryBuilder); + + _queryBuilder.append('}'); + } + } + + public static class CartInput implements Serializable { + private Input> attributes = Input.undefined(); + + private Input> lines = Input.undefined(); + + private Input> discountCodes = Input.undefined(); + + private Input note = Input.undefined(); + + private Input buyerIdentity = Input.undefined(); + + private Input> metafields = Input.undefined(); + public List getAttributes() { return attributes.getValue(); } @@ -8998,12 +9721,12 @@ public Input> getAttributesInput() { return attributes; } - public CartLineInput setAttributes(List attributes) { + public CartInput setAttributes(List attributes) { this.attributes = Input.optional(attributes); return this; } - public CartLineInput setAttributesInput(Input> attributes) { + public CartInput setAttributesInput(Input> attributes) { if (attributes == null) { throw new IllegalArgumentException("Input can not be null"); } @@ -9011,208 +9734,108 @@ public CartLineInput setAttributesInput(Input> attributes) return this; } - public Integer getQuantity() { - return quantity.getValue(); - } - - public Input getQuantityInput() { - return quantity; - } - - public CartLineInput setQuantity(Integer quantity) { - this.quantity = Input.optional(quantity); - return this; - } - - public CartLineInput setQuantityInput(Input quantity) { - if (quantity == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.quantity = quantity; - return this; - } - - public ID getSellingPlanId() { - return sellingPlanId.getValue(); + public List getLines() { + return lines.getValue(); } - public Input getSellingPlanIdInput() { - return sellingPlanId; + public Input> getLinesInput() { + return lines; } - public CartLineInput setSellingPlanId(ID sellingPlanId) { - this.sellingPlanId = Input.optional(sellingPlanId); + public CartInput setLines(List lines) { + this.lines = Input.optional(lines); return this; } - public CartLineInput setSellingPlanIdInput(Input sellingPlanId) { - if (sellingPlanId == null) { + public CartInput setLinesInput(Input> lines) { + if (lines == null) { throw new IllegalArgumentException("Input can not be null"); } - this.sellingPlanId = sellingPlanId; - return this; - } - - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("merchandiseId:"); - Query.appendQuotedString(_queryBuilder, merchandiseId.toString()); - - if (this.attributes.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("attributes:"); - if (attributes.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (AttributeInput item1 : attributes.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - } else { - _queryBuilder.append("null"); - } - } - - if (this.quantity.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("quantity:"); - if (quantity.getValue() != null) { - _queryBuilder.append(quantity.getValue()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.sellingPlanId.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("sellingPlanId:"); - if (sellingPlanId.getValue() != null) { - Query.appendQuotedString(_queryBuilder, sellingPlanId.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - _queryBuilder.append('}'); - } - } - - public static class CartLineUpdateInput implements Serializable { - private ID id; - - private Input quantity = Input.undefined(); - - private Input merchandiseId = Input.undefined(); - - private Input> attributes = Input.undefined(); - - private Input sellingPlanId = Input.undefined(); - - public CartLineUpdateInput(ID id) { - this.id = id; - } - - public ID getId() { - return id; - } - - public CartLineUpdateInput setId(ID id) { - this.id = id; + this.lines = lines; return this; } - public Integer getQuantity() { - return quantity.getValue(); + public List getDiscountCodes() { + return discountCodes.getValue(); } - public Input getQuantityInput() { - return quantity; + public Input> getDiscountCodesInput() { + return discountCodes; } - public CartLineUpdateInput setQuantity(Integer quantity) { - this.quantity = Input.optional(quantity); + public CartInput setDiscountCodes(List discountCodes) { + this.discountCodes = Input.optional(discountCodes); return this; } - public CartLineUpdateInput setQuantityInput(Input quantity) { - if (quantity == null) { + public CartInput setDiscountCodesInput(Input> discountCodes) { + if (discountCodes == null) { throw new IllegalArgumentException("Input can not be null"); } - this.quantity = quantity; + this.discountCodes = discountCodes; return this; } - public ID getMerchandiseId() { - return merchandiseId.getValue(); + public String getNote() { + return note.getValue(); } - public Input getMerchandiseIdInput() { - return merchandiseId; + public Input getNoteInput() { + return note; } - public CartLineUpdateInput setMerchandiseId(ID merchandiseId) { - this.merchandiseId = Input.optional(merchandiseId); + public CartInput setNote(String note) { + this.note = Input.optional(note); return this; } - public CartLineUpdateInput setMerchandiseIdInput(Input merchandiseId) { - if (merchandiseId == null) { + public CartInput setNoteInput(Input note) { + if (note == null) { throw new IllegalArgumentException("Input can not be null"); } - this.merchandiseId = merchandiseId; + this.note = note; return this; } - public List getAttributes() { - return attributes.getValue(); + public CartBuyerIdentityInput getBuyerIdentity() { + return buyerIdentity.getValue(); } - public Input> getAttributesInput() { - return attributes; + public Input getBuyerIdentityInput() { + return buyerIdentity; } - public CartLineUpdateInput setAttributes(List attributes) { - this.attributes = Input.optional(attributes); + public CartInput setBuyerIdentity(CartBuyerIdentityInput buyerIdentity) { + this.buyerIdentity = Input.optional(buyerIdentity); return this; } - public CartLineUpdateInput setAttributesInput(Input> attributes) { - if (attributes == null) { + public CartInput setBuyerIdentityInput(Input buyerIdentity) { + if (buyerIdentity == null) { throw new IllegalArgumentException("Input can not be null"); } - this.attributes = attributes; + this.buyerIdentity = buyerIdentity; return this; } - public ID getSellingPlanId() { - return sellingPlanId.getValue(); + public List getMetafields() { + return metafields.getValue(); } - public Input getSellingPlanIdInput() { - return sellingPlanId; + public Input> getMetafieldsInput() { + return metafields; } - public CartLineUpdateInput setSellingPlanId(ID sellingPlanId) { - this.sellingPlanId = Input.optional(sellingPlanId); + public CartInput setMetafields(List metafields) { + this.metafields = Input.optional(metafields); return this; } - public CartLineUpdateInput setSellingPlanIdInput(Input sellingPlanId) { - if (sellingPlanId == null) { + public CartInput setMetafieldsInput(Input> metafields) { + if (metafields == null) { throw new IllegalArgumentException("Input can not be null"); } - this.sellingPlanId = sellingPlanId; + this.metafields = metafields; return this; } @@ -9220,45 +9843,58 @@ public void appendTo(StringBuilder _queryBuilder) { String separator = ""; _queryBuilder.append('{'); - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("id:"); - Query.appendQuotedString(_queryBuilder, id.toString()); - - if (this.quantity.isDefined()) { + if (this.attributes.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("quantity:"); - if (quantity.getValue() != null) { - _queryBuilder.append(quantity.getValue()); + _queryBuilder.append("attributes:"); + if (attributes.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (AttributeInput item1 : attributes.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); } else { _queryBuilder.append("null"); } } - if (this.merchandiseId.isDefined()) { + if (this.lines.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("merchandiseId:"); - if (merchandiseId.getValue() != null) { - Query.appendQuotedString(_queryBuilder, merchandiseId.getValue().toString()); + _queryBuilder.append("lines:"); + if (lines.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (CartLineInput item1 : lines.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); } else { _queryBuilder.append("null"); } } - if (this.attributes.isDefined()) { + if (this.discountCodes.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("attributes:"); - if (attributes.getValue() != null) { + _queryBuilder.append("discountCodes:"); + if (discountCodes.getValue() != null) { _queryBuilder.append('['); { String listSeperator1 = ""; - for (AttributeInput item1 : attributes.getValue()) { + for (String item1 : discountCodes.getValue()) { _queryBuilder.append(listSeperator1); listSeperator1 = ","; - item1.appendTo(_queryBuilder); + Query.appendQuotedString(_queryBuilder, item1.toString()); } } _queryBuilder.append(']'); @@ -9267,304 +9903,237 @@ public void appendTo(StringBuilder _queryBuilder) { } } - if (this.sellingPlanId.isDefined()) { + if (this.note.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("sellingPlanId:"); - if (sellingPlanId.getValue() != null) { - Query.appendQuotedString(_queryBuilder, sellingPlanId.getValue().toString()); + _queryBuilder.append("note:"); + if (note.getValue() != null) { + Query.appendQuotedString(_queryBuilder, note.getValue().toString()); } else { _queryBuilder.append("null"); } } - _queryBuilder.append('}'); - } - } - - public interface CartLinesAddPayloadQueryDefinition { - void define(CartLinesAddPayloadQuery _queryBuilder); - } - - /** - * Return type for `cartLinesAdd` mutation. - */ - public static class CartLinesAddPayloadQuery extends Query { - CartLinesAddPayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The updated cart. - */ - public CartLinesAddPayloadQuery cart(CartQueryDefinition queryDef) { - startField("cart"); - - _queryBuilder.append('{'); - queryDef.define(new CartQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } + if (this.buyerIdentity.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("buyerIdentity:"); + if (buyerIdentity.getValue() != null) { + buyerIdentity.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } - /** - * The list of errors that occurred from executing the mutation. - */ - public CartLinesAddPayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { - startField("userErrors"); + if (this.metafields.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("metafields:"); + if (metafields.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (CartInputMetafieldInput item1 : metafields.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } - _queryBuilder.append('{'); - queryDef.define(new CartUserErrorQuery(_queryBuilder)); _queryBuilder.append('}'); - - return this; } } - /** - * Return type for `cartLinesAdd` mutation. - */ - public static class CartLinesAddPayload extends AbstractResponse { - public CartLinesAddPayload() { - } - - public CartLinesAddPayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cart": { - Cart optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Cart(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + public static class CartInputMetafieldInput implements Serializable { + private String key; - break; - } + private String value; - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CartUserError(jsonAsObject(element1, key))); - } + private String type; - responseData.put(key, list1); + public CartInputMetafieldInput(String key, String value, String type) { + this.key = key; - break; - } + this.value = value; - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + this.type = type; } - public String getGraphQlTypeName() { - return "CartLinesAddPayload"; + public String getKey() { + return key; } - /** - * The updated cart. - */ + public CartInputMetafieldInput setKey(String key) { + this.key = key; + return this; + } - public Cart getCart() { - return (Cart) get("cart"); + public String getValue() { + return value; } - public CartLinesAddPayload setCart(Cart arg) { - optimisticData.put(getKey("cart"), arg); + public CartInputMetafieldInput setValue(String value) { + this.value = value; return this; } - /** - * The list of errors that occurred from executing the mutation. - */ - - public List getUserErrors() { - return (List) get("userErrors"); + public String getType() { + return type; } - public CartLinesAddPayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public CartInputMetafieldInput setType(String type) { + this.type = type; return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cart": return true; + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - case "userErrors": return true; + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); - default: return false; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("value:"); + Query.appendQuotedString(_queryBuilder, value.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("type:"); + Query.appendQuotedString(_queryBuilder, type.toString()); + + _queryBuilder.append('}'); } } - public interface CartLinesRemovePayloadQueryDefinition { - void define(CartLinesRemovePayloadQuery _queryBuilder); + public interface CartLineQueryDefinition { + void define(CartLineQuery _queryBuilder); } /** - * Return type for `cartLinesRemove` mutation. + * Represents information about the merchandise in the cart. */ - public static class CartLinesRemovePayloadQuery extends Query { - CartLinesRemovePayloadQuery(StringBuilder _queryBuilder) { + public static class CartLineQuery extends Query { + CartLineQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * The updated cart. + * An attribute associated with the cart line. */ - public CartLinesRemovePayloadQuery cart(CartQueryDefinition queryDef) { - startField("cart"); + public CartLineQuery attribute(String key, AttributeQueryDefinition queryDef) { + startField("attribute"); + + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new CartQuery(_queryBuilder)); + queryDef.define(new AttributeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. + * The attributes associated with the cart line. Attributes are represented as key-value pairs. */ - public CartLinesRemovePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { - startField("userErrors"); + public CartLineQuery attributes(AttributeQueryDefinition queryDef) { + startField("attributes"); _queryBuilder.append('{'); - queryDef.define(new CartUserErrorQuery(_queryBuilder)); + queryDef.define(new AttributeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - } - /** - * Return type for `cartLinesRemove` mutation. - */ - public static class CartLinesRemovePayload extends AbstractResponse { - public CartLinesRemovePayload() { - } - - public CartLinesRemovePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cart": { - Cart optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Cart(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CartUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } + /** + * 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"); - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + _queryBuilder.append('{'); + queryDef.define(new CartLineCostQuery(_queryBuilder)); + _queryBuilder.append('}'); - public String getGraphQlTypeName() { - return "CartLinesRemovePayload"; + return this; } /** - * The updated cart. + * The discounts that have been applied to the cart line. */ + public CartLineQuery discountAllocations(CartDiscountAllocationQueryDefinition queryDef) { + startField("discountAllocations"); - public Cart getCart() { - return (Cart) get("cart"); - } + _queryBuilder.append('{'); + queryDef.define(new CartDiscountAllocationQuery(_queryBuilder)); + _queryBuilder.append('}'); - public CartLinesRemovePayload setCart(Cart arg) { - optimisticData.put(getKey("cart"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * 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"); - public List getUserErrors() { - return (List) get("userErrors"); - } + _queryBuilder.append('{'); + queryDef.define(new CartLineEstimatedCostQuery(_queryBuilder)); + _queryBuilder.append('}'); - public CartLinesRemovePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cart": return true; - - case "userErrors": return true; - - default: return false; - } - } - } + /** + * The merchandise that the buyer intends to purchase. + */ + public CartLineQuery merchandise(MerchandiseQueryDefinition queryDef) { + startField("merchandise"); - public interface CartLinesUpdatePayloadQueryDefinition { - void define(CartLinesUpdatePayloadQuery _queryBuilder); - } + _queryBuilder.append('{'); + queryDef.define(new MerchandiseQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Return type for `cartLinesUpdate` mutation. - */ - public static class CartLinesUpdatePayloadQuery extends Query { - CartLinesUpdatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * The updated cart. + * The quantity of the merchandise that the customer intends to purchase. */ - public CartLinesUpdatePayloadQuery cart(CartQueryDefinition queryDef) { - startField("cart"); - - _queryBuilder.append('{'); - queryDef.define(new CartQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CartLineQuery quantity() { + startField("quantity"); return this; } /** - * The list of errors that occurred from executing the mutation. + * The selling plan associated with the cart line and the effect that each selling plan has on variants + * when they're purchased. */ - public CartLinesUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { - startField("userErrors"); + public CartLineQuery sellingPlanAllocation(SellingPlanAllocationQueryDefinition queryDef) { + startField("sellingPlanAllocation"); _queryBuilder.append('{'); - queryDef.define(new CartUserErrorQuery(_queryBuilder)); + queryDef.define(new SellingPlanAllocationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -9572,21 +10141,21 @@ public CartLinesUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition query } /** - * Return type for `cartLinesUpdate` mutation. + * Represents information about the merchandise in the cart. */ - public static class CartLinesUpdatePayload extends AbstractResponse { - public CartLinesUpdatePayload() { + public static class CartLine extends AbstractResponse implements BaseCartLine, Node { + public CartLine() { } - public CartLinesUpdatePayload(JsonObject fields) throws SchemaViolationError { + public CartLine(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cart": { - Cart optional1 = null; + case "attribute": { + Attribute optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Cart(jsonAsObject(field.getValue(), key)); + optional1 = new Attribute(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -9594,10 +10163,27 @@ public CartLinesUpdatePayload(JsonObject fields) throws SchemaViolationError { break; } - case "userErrors": { - List list1 = new ArrayList<>(); + case "attributes": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CartUserError(jsonAsObject(element1, key))); + list1.add(new Attribute(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "cost": { + responseData.put(key, new CartLineCost(jsonAsObject(field.getValue(), key))); + + break; + } + + case "discountAllocations": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(UnknownCartDiscountAllocation.create(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -9605,6 +10191,41 @@ public CartLinesUpdatePayload(JsonObject fields) throws SchemaViolationError { break; } + case "estimatedCost": { + responseData.put(key, new CartLineEstimatedCost(jsonAsObject(field.getValue(), key))); + + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "merchandise": { + responseData.put(key, UnknownMerchandise.create(jsonAsObject(field.getValue(), key))); + + break; + } + + case "quantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); + + break; + } + + case "sellingPlanAllocation": { + SellingPlanAllocation optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new SellingPlanAllocation(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -9616,252 +10237,216 @@ public CartLinesUpdatePayload(JsonObject fields) throws SchemaViolationError { } } + public CartLine(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "CartLinesUpdatePayload"; + return "CartLine"; } /** - * The updated cart. + * An attribute associated with the cart line. */ - public Cart getCart() { - return (Cart) get("cart"); + public Attribute getAttribute() { + return (Attribute) get("attribute"); } - public CartLinesUpdatePayload setCart(Cart arg) { - optimisticData.put(getKey("cart"), arg); + public CartLine setAttribute(Attribute arg) { + optimisticData.put(getKey("attribute"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The attributes associated with the cart line. Attributes are represented as key-value pairs. */ - public List getUserErrors() { - return (List) get("userErrors"); + public List getAttributes() { + return (List) get("attributes"); } - public CartLinesUpdatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public CartLine setAttributes(List arg) { + optimisticData.put(getKey("attributes"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cart": return true; - - case "userErrors": return true; + /** + * 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. + */ - default: return false; - } + public CartLineCost getCost() { + return (CartLineCost) get("cost"); } - } - - public interface CartNoteUpdatePayloadQueryDefinition { - void define(CartNoteUpdatePayloadQuery _queryBuilder); - } - /** - * Return type for `cartNoteUpdate` mutation. - */ - public static class CartNoteUpdatePayloadQuery extends Query { - CartNoteUpdatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public CartLine setCost(CartLineCost arg) { + optimisticData.put(getKey("cost"), arg); + return this; } /** - * The updated cart. + * The discounts that have been applied to the cart line. */ - public CartNoteUpdatePayloadQuery cart(CartQueryDefinition queryDef) { - startField("cart"); - _queryBuilder.append('{'); - queryDef.define(new CartQuery(_queryBuilder)); - _queryBuilder.append('}'); + public List getDiscountAllocations() { + return (List) get("discountAllocations"); + } + public CartLine setDiscountAllocations(List arg) { + optimisticData.put(getKey("discountAllocations"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * 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 CartNoteUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CartUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public CartLineEstimatedCost getEstimatedCost() { + return (CartLineEstimatedCost) get("estimatedCost"); } - } - /** - * Return type for `cartNoteUpdate` mutation. - */ - public static class CartNoteUpdatePayload extends AbstractResponse { - public CartNoteUpdatePayload() { + public CartLine setEstimatedCost(CartLineEstimatedCost arg) { + optimisticData.put(getKey("estimatedCost"), arg); + return this; } - public CartNoteUpdatePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cart": { - Cart optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Cart(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CartUserError(jsonAsObject(element1, key))); - } + /** + * A globally-unique identifier. + */ - responseData.put(key, list1); + public ID getId() { + return (ID) get("id"); + } - break; - } + /** + * The merchandise that the buyer intends to purchase. + */ - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public Merchandise getMerchandise() { + return (Merchandise) get("merchandise"); } - public String getGraphQlTypeName() { - return "CartNoteUpdatePayload"; + public CartLine setMerchandise(Merchandise arg) { + optimisticData.put(getKey("merchandise"), arg); + return this; } /** - * The updated cart. + * The quantity of the merchandise that the customer intends to purchase. */ - public Cart getCart() { - return (Cart) get("cart"); + public Integer getQuantity() { + return (Integer) get("quantity"); } - public CartNoteUpdatePayload setCart(Cart arg) { - optimisticData.put(getKey("cart"), arg); + public CartLine setQuantity(Integer arg) { + optimisticData.put(getKey("quantity"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The selling plan associated with the cart line and the effect that each selling plan has on variants + * when they're purchased. */ - public List getUserErrors() { - return (List) get("userErrors"); + public SellingPlanAllocation getSellingPlanAllocation() { + return (SellingPlanAllocation) get("sellingPlanAllocation"); } - public CartNoteUpdatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public CartLine setSellingPlanAllocation(SellingPlanAllocation arg) { + optimisticData.put(getKey("sellingPlanAllocation"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cart": return true; + case "attribute": return true; - case "userErrors": return true; + case "attributes": return true; - default: return false; - } - } - } + case "cost": return true; - public static class CartSelectedDeliveryOptionInput implements Serializable { - private ID deliveryGroupId; + case "discountAllocations": return false; - private String deliveryOptionHandle; + case "estimatedCost": return true; - public CartSelectedDeliveryOptionInput(ID deliveryGroupId, String deliveryOptionHandle) { - this.deliveryGroupId = deliveryGroupId; + case "id": return false; - this.deliveryOptionHandle = deliveryOptionHandle; - } + case "merchandise": return false; - public ID getDeliveryGroupId() { - return deliveryGroupId; - } + case "quantity": return false; - public CartSelectedDeliveryOptionInput setDeliveryGroupId(ID deliveryGroupId) { - this.deliveryGroupId = deliveryGroupId; - return this; - } + case "sellingPlanAllocation": return true; - public String getDeliveryOptionHandle() { - return deliveryOptionHandle; + default: return false; + } } + } - public CartSelectedDeliveryOptionInput setDeliveryOptionHandle(String deliveryOptionHandle) { - this.deliveryOptionHandle = deliveryOptionHandle; - return this; + public interface CartLineCostQueryDefinition { + void define(CartLineCostQuery _queryBuilder); + } + + /** + * The cost of the merchandise line that the buyer will pay at checkout. + */ + public static class CartLineCostQuery extends Query { + CartLineCostQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; + /** + * The amount of the merchandise line. + */ + public CartLineCostQuery amountPerQuantity(MoneyV2QueryDefinition queryDef) { + startField("amountPerQuantity"); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("deliveryGroupId:"); - Query.appendQuotedString(_queryBuilder, deliveryGroupId.toString()); + return this; + } - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("deliveryOptionHandle:"); - Query.appendQuotedString(_queryBuilder, deliveryOptionHandle.toString()); + /** + * The compare at amount of the merchandise line. + */ + public CartLineCostQuery compareAtAmountPerQuantity(MoneyV2QueryDefinition queryDef) { + startField("compareAtAmountPerQuantity"); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); - } - } - - public interface CartSelectedDeliveryOptionsUpdatePayloadQueryDefinition { - void define(CartSelectedDeliveryOptionsUpdatePayloadQuery _queryBuilder); - } - /** - * Return type for `cartSelectedDeliveryOptionsUpdate` mutation. - */ - public static class CartSelectedDeliveryOptionsUpdatePayloadQuery extends Query { - CartSelectedDeliveryOptionsUpdatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * The updated cart. + * The cost of the merchandise line before line-level discounts. */ - public CartSelectedDeliveryOptionsUpdatePayloadQuery cart(CartQueryDefinition queryDef) { - startField("cart"); + public CartLineCostQuery subtotalAmount(MoneyV2QueryDefinition queryDef) { + startField("subtotalAmount"); _queryBuilder.append('{'); - queryDef.define(new CartQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. + * The total cost of the merchandise line. */ - public CartSelectedDeliveryOptionsUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { - startField("userErrors"); + public CartLineCostQuery totalAmount(MoneyV2QueryDefinition queryDef) { + startField("totalAmount"); _queryBuilder.append('{'); - queryDef.define(new CartUserErrorQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -9869,21 +10454,27 @@ public CartSelectedDeliveryOptionsUpdatePayloadQuery userErrors(CartUserErrorQue } /** - * Return type for `cartSelectedDeliveryOptionsUpdate` mutation. + * The cost of the merchandise line that the buyer will pay at checkout. */ - public static class CartSelectedDeliveryOptionsUpdatePayload extends AbstractResponse { - public CartSelectedDeliveryOptionsUpdatePayload() { + public static class CartLineCost extends AbstractResponse { + public CartLineCost() { } - public CartSelectedDeliveryOptionsUpdatePayload(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 "cart": { - Cart optional1 = null; + case "amountPerQuantity": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "compareAtAmountPerQuantity": { + MoneyV2 optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Cart(jsonAsObject(field.getValue(), key)); + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -9891,13 +10482,14 @@ public CartSelectedDeliveryOptionsUpdatePayload(JsonObject fields) throws Schema break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CartUserError(jsonAsObject(element1, key))); - } + case "subtotalAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - responseData.put(key, list1); + break; + } + + case "totalAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } @@ -9914,118 +10506,163 @@ public CartSelectedDeliveryOptionsUpdatePayload(JsonObject fields) throws Schema } public String getGraphQlTypeName() { - return "CartSelectedDeliveryOptionsUpdatePayload"; + return "CartLineCost"; } /** - * The updated cart. + * The amount of the merchandise line. */ - public Cart getCart() { - return (Cart) get("cart"); + public MoneyV2 getAmountPerQuantity() { + return (MoneyV2) get("amountPerQuantity"); } - public CartSelectedDeliveryOptionsUpdatePayload setCart(Cart arg) { - optimisticData.put(getKey("cart"), arg); + public CartLineCost setAmountPerQuantity(MoneyV2 arg) { + optimisticData.put(getKey("amountPerQuantity"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The compare at amount of the merchandise line. */ - public List getUserErrors() { - return (List) get("userErrors"); + public MoneyV2 getCompareAtAmountPerQuantity() { + return (MoneyV2) get("compareAtAmountPerQuantity"); } - public CartSelectedDeliveryOptionsUpdatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + 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 "cart": return true; + case "amountPerQuantity": return true; - case "userErrors": return true; + case "compareAtAmountPerQuantity": return true; + + case "subtotalAmount": return true; + + case "totalAmount": return true; default: return false; } } } - public interface CartUserErrorQueryDefinition { - void define(CartUserErrorQuery _queryBuilder); + public interface CartLineEstimatedCostQueryDefinition { + void define(CartLineEstimatedCostQuery _queryBuilder); } /** - * Represents an error that happens during execution of a cart mutation. + * The estimated cost of the merchandise line that the buyer will pay at checkout. */ - public static class CartUserErrorQuery extends Query { - CartUserErrorQuery(StringBuilder _queryBuilder) { + public static class CartLineEstimatedCostQuery extends Query { + CartLineEstimatedCostQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The error code. + * The amount of the merchandise line. */ - public CartUserErrorQuery code() { - startField("code"); + public CartLineEstimatedCostQuery amount(MoneyV2QueryDefinition queryDef) { + startField("amount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The path to the input field that caused the error. + * The compare at amount of the merchandise line. */ - public CartUserErrorQuery field() { - startField("field"); + public CartLineEstimatedCostQuery compareAtAmount(MoneyV2QueryDefinition queryDef) { + startField("compareAtAmount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The error message. + * The estimated cost of the merchandise line before discounts. */ - public CartUserErrorQuery message() { - startField("message"); + 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; } } /** - * Represents an error that happens during execution of a cart mutation. + * The estimated cost of the merchandise line that the buyer will pay at checkout. */ - public static class CartUserError extends AbstractResponse implements DisplayableError { - public CartUserError() { + public static class CartLineEstimatedCost extends AbstractResponse { + public CartLineEstimatedCost() { } - public CartUserError(JsonObject fields) throws SchemaViolationError { + public CartLineEstimatedCost(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "code": { - CartErrorCode optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = CartErrorCode.fromGraphQl(jsonAsString(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "amount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "field": { - List optional1 = null; + case "compareAtAmount": { + MoneyV2 optional1 = null; if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } - - optional1 = list1; + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -10033,8 +10670,14 @@ public CartUserError(JsonObject fields) throws SchemaViolationError { break; } - case "message": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "subtotalAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "totalAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } @@ -10051,643 +10694,695 @@ public CartUserError(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CartUserError"; + return "CartLineEstimatedCost"; } /** - * The error code. + * The amount of the merchandise line. */ - public CartErrorCode getCode() { - return (CartErrorCode) get("code"); + public MoneyV2 getAmount() { + return (MoneyV2) get("amount"); } - public CartUserError setCode(CartErrorCode arg) { - optimisticData.put(getKey("code"), arg); + public CartLineEstimatedCost setAmount(MoneyV2 arg) { + optimisticData.put(getKey("amount"), arg); return this; } /** - * The path to the input field that caused the error. + * The compare at amount of the merchandise line. */ - public List getField() { - return (List) get("field"); + public MoneyV2 getCompareAtAmount() { + return (MoneyV2) get("compareAtAmount"); } - public CartUserError setField(List arg) { - optimisticData.put(getKey("field"), arg); + public CartLineEstimatedCost setCompareAtAmount(MoneyV2 arg) { + optimisticData.put(getKey("compareAtAmount"), arg); return this; } /** - * The error message. + * The estimated cost of the merchandise line before discounts. */ - public String getMessage() { - return (String) get("message"); + public MoneyV2 getSubtotalAmount() { + return (MoneyV2) get("subtotalAmount"); } - public CartUserError setMessage(String arg) { - optimisticData.put(getKey("message"), arg); + public CartLineEstimatedCost setSubtotalAmount(MoneyV2 arg) { + optimisticData.put(getKey("subtotalAmount"), arg); + return this; + } + + /** + * The estimated total cost of the merchandise line. + */ + + public MoneyV2 getTotalAmount() { + return (MoneyV2) get("totalAmount"); + } + + public CartLineEstimatedCost setTotalAmount(MoneyV2 arg) { + optimisticData.put(getKey("totalAmount"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "code": return false; + case "amount": return true; - case "field": return false; + case "compareAtAmount": return true; - case "message": return false; + case "subtotalAmount": return true; + + case "totalAmount": return true; default: return false; } } } - public interface CheckoutQueryDefinition { - void define(CheckoutQuery _queryBuilder); - } - - /** - * A container for all the information required to checkout items and pay. - */ - public static class CheckoutQuery extends Query { - CheckoutQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public static class CartLineInput implements Serializable { + private ID merchandiseId; - startField("id"); - } + private Input> attributes = Input.undefined(); - /** - * The gift cards used on the checkout. - */ - public CheckoutQuery appliedGiftCards(AppliedGiftCardQueryDefinition queryDef) { - startField("appliedGiftCards"); + private Input quantity = Input.undefined(); - _queryBuilder.append('{'); - queryDef.define(new AppliedGiftCardQuery(_queryBuilder)); - _queryBuilder.append('}'); + private Input sellingPlanId = Input.undefined(); - return this; + public CartLineInput(ID merchandiseId) { + this.merchandiseId = merchandiseId; } - /** - * The available shipping rates for this Checkout. - * Should only be used when checkout `requiresShipping` is `true` and - * the shipping address is valid. - */ - public CheckoutQuery availableShippingRates(AvailableShippingRatesQueryDefinition queryDef) { - startField("availableShippingRates"); - - _queryBuilder.append('{'); - queryDef.define(new AvailableShippingRatesQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ID getMerchandiseId() { + return merchandiseId; + } + public CartLineInput setMerchandiseId(ID merchandiseId) { + this.merchandiseId = merchandiseId; return this; } - /** - * The identity of the customer associated with the checkout. - */ - public CheckoutQuery buyerIdentity(CheckoutBuyerIdentityQueryDefinition queryDef) { - startField("buyerIdentity"); + public List getAttributes() { + return attributes.getValue(); + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutBuyerIdentityQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Input> getAttributesInput() { + return attributes; + } + public CartLineInput setAttributes(List attributes) { + this.attributes = Input.optional(attributes); return this; } - /** - * The date and time when the checkout was completed. - */ - public CheckoutQuery completedAt() { - startField("completedAt"); - + public CartLineInput setAttributesInput(Input> attributes) { + if (attributes == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.attributes = attributes; return this; } - /** - * The date and time when the checkout was created. - */ - public CheckoutQuery createdAt() { - startField("createdAt"); + public Integer getQuantity() { + return quantity.getValue(); + } - return this; + public Input getQuantityInput() { + return quantity; } - /** - * The currency code for the checkout. - */ - public CheckoutQuery currencyCode() { - startField("currencyCode"); + public CartLineInput setQuantity(Integer quantity) { + this.quantity = Input.optional(quantity); + return this; + } + public CartLineInput setQuantityInput(Input quantity) { + if (quantity == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.quantity = quantity; return this; } - /** - * A list of extra information that is added to the checkout. - */ - public CheckoutQuery customAttributes(AttributeQueryDefinition queryDef) { - startField("customAttributes"); + public ID getSellingPlanId() { + return sellingPlanId.getValue(); + } - _queryBuilder.append('{'); - queryDef.define(new AttributeQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Input getSellingPlanIdInput() { + return sellingPlanId; + } + public CartLineInput setSellingPlanId(ID sellingPlanId) { + this.sellingPlanId = Input.optional(sellingPlanId); return this; } - public class DiscountApplicationsArguments extends Arguments { - DiscountApplicationsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); + public CartLineInput setSellingPlanIdInput(Input sellingPlanId) { + if (sellingPlanId == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.sellingPlanId = sellingPlanId; + return this; + } - /** - * Returns up to the first `n` elements from the list. - */ - public DiscountApplicationsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - /** - * Returns the elements that come after the specified cursor. - */ - public DiscountApplicationsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("merchandiseId:"); + Query.appendQuotedString(_queryBuilder, merchandiseId.toString()); - /** - * Returns up to the last `n` elements from the list. - */ - public DiscountApplicationsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); + if (this.attributes.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("attributes:"); + if (attributes.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (AttributeInput item1 : attributes.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); } - return this; } - /** - * Returns the elements that come before the specified cursor. - */ - public DiscountApplicationsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); + if (this.quantity.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("quantity:"); + if (quantity.getValue() != null) { + _queryBuilder.append(quantity.getValue()); + } else { + _queryBuilder.append("null"); } - return this; } - /** - * Reverse the order of the underlying list. - */ - public DiscountApplicationsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); + if (this.sellingPlanId.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("sellingPlanId:"); + if (sellingPlanId.getValue() != null) { + Query.appendQuotedString(_queryBuilder, sellingPlanId.getValue().toString()); + } else { + _queryBuilder.append("null"); } - return this; } - } - public interface DiscountApplicationsArgumentsDefinition { - void define(DiscountApplicationsArguments args); + _queryBuilder.append('}'); } + } - /** - * Discounts that have been applied on the checkout. - */ - public CheckoutQuery discountApplications(DiscountApplicationConnectionQueryDefinition queryDef) { - return discountApplications(args -> {}, queryDef); - } + public static class CartLineUpdateInput implements Serializable { + private ID id; - /** - * Discounts that have been applied on the checkout. - */ - public CheckoutQuery discountApplications(DiscountApplicationsArgumentsDefinition argsDef, DiscountApplicationConnectionQueryDefinition queryDef) { - startField("discountApplications"); + private Input quantity = Input.undefined(); - DiscountApplicationsArguments args = new DiscountApplicationsArguments(_queryBuilder); - argsDef.define(args); - DiscountApplicationsArguments.end(args); + private Input merchandiseId = Input.undefined(); - _queryBuilder.append('{'); - queryDef.define(new DiscountApplicationConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + private Input> attributes = Input.undefined(); - return this; + private Input sellingPlanId = Input.undefined(); + + public CartLineUpdateInput(ID id) { + this.id = id; } - /** - * The email attached to this checkout. - */ - public CheckoutQuery email() { - startField("email"); + public ID getId() { + return id; + } + public CartLineUpdateInput setId(ID id) { + this.id = id; return this; } - public class LineItemsArguments extends Arguments { - LineItemsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public LineItemsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public LineItemsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public Integer getQuantity() { + return quantity.getValue(); + } - /** - * Returns up to the last `n` elements from the list. - */ - public LineItemsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + public Input getQuantityInput() { + return quantity; + } - /** - * Returns the elements that come before the specified cursor. - */ - public LineItemsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public CartLineUpdateInput setQuantity(Integer quantity) { + this.quantity = Input.optional(quantity); + return this; + } - /** - * Reverse the order of the underlying list. - */ - public LineItemsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; + public CartLineUpdateInput setQuantityInput(Input quantity) { + if (quantity == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.quantity = quantity; + return this; } - public interface LineItemsArgumentsDefinition { - void define(LineItemsArguments args); + public ID getMerchandiseId() { + return merchandiseId.getValue(); } - /** - * A list of line item objects, each one containing information about an item in the checkout. - */ - public CheckoutQuery lineItems(CheckoutLineItemConnectionQueryDefinition queryDef) { - return lineItems(args -> {}, queryDef); + public Input getMerchandiseIdInput() { + return merchandiseId; } - /** - * A list of line item objects, each one containing information about an item in the checkout. - */ - public CheckoutQuery lineItems(LineItemsArgumentsDefinition argsDef, CheckoutLineItemConnectionQueryDefinition queryDef) { - startField("lineItems"); - - LineItemsArguments args = new LineItemsArguments(_queryBuilder); - argsDef.define(args); - LineItemsArguments.end(args); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutLineItemConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CartLineUpdateInput setMerchandiseId(ID merchandiseId) { + this.merchandiseId = Input.optional(merchandiseId); + return this; + } + public CartLineUpdateInput setMerchandiseIdInput(Input merchandiseId) { + if (merchandiseId == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.merchandiseId = merchandiseId; return this; } - /** - * The sum of all the prices of all the items in the checkout. Duties, taxes, shipping and discounts - * excluded. - */ - public CheckoutQuery lineItemsSubtotalPrice(MoneyV2QueryDefinition queryDef) { - startField("lineItemsSubtotalPrice"); + public List getAttributes() { + return attributes.getValue(); + } - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public Input> getAttributesInput() { + return attributes; + } + public CartLineUpdateInput setAttributes(List attributes) { + this.attributes = Input.optional(attributes); return this; } - /** - * The note associated with the checkout. - */ - public CheckoutQuery note() { - startField("note"); - + public CartLineUpdateInput setAttributesInput(Input> attributes) { + if (attributes == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.attributes = attributes; return this; } - /** - * The resulting order from a paid checkout. - */ - public CheckoutQuery order(OrderQueryDefinition queryDef) { - startField("order"); + public ID getSellingPlanId() { + return sellingPlanId.getValue(); + } - _queryBuilder.append('{'); - queryDef.define(new OrderQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Input getSellingPlanIdInput() { + return sellingPlanId; + } + public CartLineUpdateInput setSellingPlanId(ID sellingPlanId) { + this.sellingPlanId = Input.optional(sellingPlanId); return this; } - /** - * The Order Status Page for this Checkout, null when checkout is not completed. - */ - public CheckoutQuery orderStatusUrl() { - startField("orderStatusUrl"); - + public CartLineUpdateInput setSellingPlanIdInput(Input sellingPlanId) { + if (sellingPlanId == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.sellingPlanId = sellingPlanId; return this; } - /** - * The amount left to be paid. This is equal to the cost of the line items, taxes, and shipping, minus - * discounts and gift cards. - */ - public CheckoutQuery paymentDue(MoneyV2QueryDefinition queryDef) { - startField("paymentDue"); - + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("id:"); + Query.appendQuotedString(_queryBuilder, id.toString()); - /** - * The amount left to be paid. This is equal to the cost of the line items, duties, taxes, and - * shipping, minus discounts and gift cards. - * - * @deprecated Use `paymentDue` instead. - */ - @Deprecated - public CheckoutQuery paymentDueV2(MoneyV2QueryDefinition queryDef) { - startField("paymentDueV2"); + if (this.quantity.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("quantity:"); + if (quantity.getValue() != null) { + _queryBuilder.append(quantity.getValue()); + } else { + _queryBuilder.append("null"); + } + } - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + if (this.merchandiseId.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("merchandiseId:"); + if (merchandiseId.getValue() != null) { + Query.appendQuotedString(_queryBuilder, merchandiseId.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - return this; - } + if (this.attributes.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("attributes:"); + if (attributes.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (AttributeInput item1 : attributes.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } - /** - * Whether or not the Checkout is ready and can be completed. Checkouts may - * have asynchronous operations that can take time to finish. If you want - * to complete a checkout or ensure all the fields are populated and up to - * date, polling is required until the value is true. - */ - public CheckoutQuery ready() { - startField("ready"); + if (this.sellingPlanId.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("sellingPlanId:"); + if (sellingPlanId.getValue() != null) { + Query.appendQuotedString(_queryBuilder, sellingPlanId.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - return this; + _queryBuilder.append('}'); } + } - /** - * States whether or not the fulfillment requires shipping. - */ - public CheckoutQuery requiresShipping() { - startField("requiresShipping"); + public interface CartLinesAddPayloadQueryDefinition { + void define(CartLinesAddPayloadQuery _queryBuilder); + } - return this; + /** + * Return type for `cartLinesAdd` mutation. + */ + public static class CartLinesAddPayloadQuery extends Query { + CartLinesAddPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The shipping address to where the line items will be shipped. + * The updated cart. */ - public CheckoutQuery shippingAddress(MailingAddressQueryDefinition queryDef) { - startField("shippingAddress"); + public CartLinesAddPayloadQuery cart(CartQueryDefinition queryDef) { + startField("cart"); _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); + queryDef.define(new CartQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The discounts that have been allocated onto the shipping line by discount applications. + * The list of errors that occurred from executing the mutation. */ - public CheckoutQuery shippingDiscountAllocations(DiscountAllocationQueryDefinition queryDef) { - startField("shippingDiscountAllocations"); + public CartLinesAddPayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { + startField("userErrors"); _queryBuilder.append('{'); - queryDef.define(new DiscountAllocationQuery(_queryBuilder)); + queryDef.define(new CartUserErrorQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - /** - * Once a shipping rate is selected by the customer it is transitioned to a `shipping_line` object. - */ - public CheckoutQuery shippingLine(ShippingRateQueryDefinition queryDef) { - startField("shippingLine"); + /** + * Return type for `cartLinesAdd` mutation. + */ + public static class CartLinesAddPayload extends AbstractResponse { + public CartLinesAddPayload() { + } - _queryBuilder.append('{'); - queryDef.define(new ShippingRateQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CartLinesAddPayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cart": { + Cart optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Cart(jsonAsObject(field.getValue(), key)); + } - return this; + responseData.put(key, optional1); + + break; + } + + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartUserError(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "CartLinesAddPayload"; } /** - * The price at checkout before shipping and taxes. + * The updated cart. */ - public CheckoutQuery subtotalPrice(MoneyV2QueryDefinition queryDef) { - startField("subtotalPrice"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public Cart getCart() { + return (Cart) get("cart"); + } + public CartLinesAddPayload setCart(Cart arg) { + optimisticData.put(getKey("cart"), arg); return this; } /** - * The price at checkout before duties, shipping, and taxes. - * - * @deprecated Use `subtotalPrice` instead. + * The list of errors that occurred from executing the mutation. */ - @Deprecated - public CheckoutQuery subtotalPriceV2(MoneyV2QueryDefinition queryDef) { - startField("subtotalPriceV2"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public List getUserErrors() { + return (List) get("userErrors"); + } + public CartLinesAddPayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } - /** - * Whether the checkout is tax exempt. - */ - public CheckoutQuery taxExempt() { - startField("taxExempt"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cart": return true; - return this; + case "userErrors": return true; + + default: return false; + } } + } - /** - * Whether taxes are included in the line item and shipping line prices. - */ - public CheckoutQuery taxesIncluded() { - startField("taxesIncluded"); + public interface CartLinesRemovePayloadQueryDefinition { + void define(CartLinesRemovePayloadQuery _queryBuilder); + } - return this; + /** + * Return type for `cartLinesRemove` mutation. + */ + public static class CartLinesRemovePayloadQuery extends Query { + CartLinesRemovePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The sum of all the duties applied to the line items in the checkout. + * The updated cart. */ - public CheckoutQuery totalDuties(MoneyV2QueryDefinition queryDef) { - startField("totalDuties"); + public CartLinesRemovePayloadQuery cart(CartQueryDefinition queryDef) { + startField("cart"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new CartQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The sum of all the prices of all the items in the checkout, including taxes and duties. + * The list of errors that occurred from executing the mutation. */ - public CheckoutQuery totalPrice(MoneyV2QueryDefinition queryDef) { - startField("totalPrice"); + public CartLinesRemovePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { + startField("userErrors"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new CartUserErrorQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - /** - * The sum of all the prices of all the items in the checkout, including taxes and duties. - * - * @deprecated Use `totalPrice` instead. - */ - @Deprecated - public CheckoutQuery totalPriceV2(MoneyV2QueryDefinition queryDef) { - startField("totalPriceV2"); + /** + * Return type for `cartLinesRemove` mutation. + */ + public static class CartLinesRemovePayload extends AbstractResponse { + public CartLinesRemovePayload() { + } - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public CartLinesRemovePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cart": { + Cart optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Cart(jsonAsObject(field.getValue(), key)); + } - return this; + responseData.put(key, optional1); + + break; + } + + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartUserError(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "CartLinesRemovePayload"; } /** - * The sum of all the taxes applied to the line items and shipping lines in the checkout. + * The updated cart. */ - public CheckoutQuery totalTax(MoneyV2QueryDefinition queryDef) { - startField("totalTax"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public Cart getCart() { + return (Cart) get("cart"); + } + public CartLinesRemovePayload setCart(Cart arg) { + optimisticData.put(getKey("cart"), arg); return this; } /** - * The sum of all the taxes applied to the line items and shipping lines in the checkout. - * - * @deprecated Use `totalTax` instead. + * The list of errors that occurred from executing the mutation. */ - @Deprecated - public CheckoutQuery totalTaxV2(MoneyV2QueryDefinition queryDef) { - startField("totalTaxV2"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public List getUserErrors() { + return (List) get("userErrors"); + } + public CartLinesRemovePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cart": return true; + + case "userErrors": return true; + + default: return false; + } + } + } + + public interface CartLinesUpdatePayloadQueryDefinition { + void define(CartLinesUpdatePayloadQuery _queryBuilder); + } + + /** + * Return type for `cartLinesUpdate` mutation. + */ + public static class CartLinesUpdatePayloadQuery extends Query { + CartLinesUpdatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + /** - * The date and time when the checkout was last updated. + * The updated cart. */ - public CheckoutQuery updatedAt() { - startField("updatedAt"); + public CartLinesUpdatePayloadQuery cart(CartQueryDefinition queryDef) { + startField("cart"); + + _queryBuilder.append('{'); + queryDef.define(new CartQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The url pointing to the checkout accessible from the web. + * The list of errors that occurred from executing the mutation. */ - public CheckoutQuery webUrl() { - startField("webUrl"); + public CartLinesUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { + startField("userErrors"); + + _queryBuilder.append('{'); + queryDef.define(new CartUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * A container for all the information required to checkout items and pay. + * Return type for `cartLinesUpdate` mutation. */ - public static class Checkout extends AbstractResponse implements Node { - public Checkout() { + public static class CartLinesUpdatePayload extends AbstractResponse { + public CartLinesUpdatePayload() { } - public Checkout(JsonObject fields) throws SchemaViolationError { + public CartLinesUpdatePayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "appliedGiftCards": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new AppliedGiftCard(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "availableShippingRates": { - AvailableShippingRates optional1 = null; + case "cart": { + Cart optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new AvailableShippingRates(jsonAsObject(field.getValue(), key)); + optional1 = new Cart(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -10695,142 +11390,167 @@ public Checkout(JsonObject fields) throws SchemaViolationError { break; } - case "buyerIdentity": { - responseData.put(key, new CheckoutBuyerIdentity(jsonAsObject(field.getValue(), key))); - - break; - } - - case "completedAt": { - DateTime optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = Utils.parseDateTime(jsonAsString(field.getValue(), key)); + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartUserError(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "createdAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - - case "currencyCode": { - responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; + default: { + throw new SchemaViolationError(this, key, field.getValue()); } + } + } + } - case "customAttributes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Attribute(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + public String getGraphQlTypeName() { + return "CartLinesUpdatePayload"; + } - break; - } + /** + * The updated cart. + */ - case "discountApplications": { - responseData.put(key, new DiscountApplicationConnection(jsonAsObject(field.getValue(), key))); + public Cart getCart() { + return (Cart) get("cart"); + } - break; - } + public CartLinesUpdatePayload setCart(Cart arg) { + optimisticData.put(getKey("cart"), arg); + return this; + } - case "email": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + /** + * The list of errors that occurred from executing the mutation. + */ - responseData.put(key, optional1); + public List getUserErrors() { + return (List) get("userErrors"); + } - break; - } + public CartLinesUpdatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cart": return true; - break; - } + case "userErrors": return true; - case "lineItems": { - responseData.put(key, new CheckoutLineItemConnection(jsonAsObject(field.getValue(), key))); + default: return false; + } + } + } - break; - } + public static class CartMetafieldDeleteInput implements Serializable { + private ID ownerId; - case "lineItemsSubtotalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + private String key; - break; - } + public CartMetafieldDeleteInput(ID ownerId, String key) { + this.ownerId = ownerId; - case "note": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + this.key = key; + } - responseData.put(key, optional1); + public ID getOwnerId() { + return ownerId; + } - break; - } + public CartMetafieldDeleteInput setOwnerId(ID ownerId) { + this.ownerId = ownerId; + return this; + } - case "order": { - Order optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Order(jsonAsObject(field.getValue(), key)); - } + public String getKey() { + return key; + } - responseData.put(key, optional1); + public CartMetafieldDeleteInput setKey(String key) { + this.key = key; + return this; + } - break; - } + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - case "orderStatusUrl": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("ownerId:"); + Query.appendQuotedString(_queryBuilder, ownerId.toString()); - responseData.put(key, optional1); + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); - break; - } + _queryBuilder.append('}'); + } + } - case "paymentDue": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + public interface CartMetafieldDeletePayloadQueryDefinition { + void define(CartMetafieldDeletePayloadQuery _queryBuilder); + } - break; - } + /** + * Return type for `cartMetafieldDelete` mutation. + */ + public static class CartMetafieldDeletePayloadQuery extends Query { + CartMetafieldDeletePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "paymentDueV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + /** + * The ID of the deleted cart metafield. + */ + public CartMetafieldDeletePayloadQuery deletedId() { + startField("deletedId"); - break; - } + return this; + } - case "ready": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + /** + * The list of errors that occurred from executing the mutation. + */ + public CartMetafieldDeletePayloadQuery userErrors(MetafieldDeleteUserErrorQueryDefinition queryDef) { + startField("userErrors"); - break; - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldDeleteUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "requiresShipping": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + return this; + } + } - break; - } + /** + * Return type for `cartMetafieldDelete` mutation. + */ + public static class CartMetafieldDeletePayload extends AbstractResponse { + public CartMetafieldDeletePayload() { + } - case "shippingAddress": { - MailingAddress optional1 = null; + public CartMetafieldDeletePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "deletedId": { + ID optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); + optional1 = new ID(jsonAsString(field.getValue(), key)); } responseData.put(key, optional1); @@ -10838,10 +11558,10 @@ public Checkout(JsonObject fields) throws SchemaViolationError { break; } - case "shippingDiscountAllocations": { - List list1 = new ArrayList<>(); + case "userErrors": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new DiscountAllocation(jsonAsObject(element1, key))); + list1.add(new MetafieldDeleteUserError(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -10849,88 +11569,6 @@ public Checkout(JsonObject fields) throws SchemaViolationError { break; } - case "shippingLine": { - ShippingRate optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ShippingRate(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "subtotalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "subtotalPriceV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "taxExempt": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "taxesIncluded": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "totalDuties": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "totalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "totalPriceV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "totalTax": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "totalTaxV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "updatedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - - break; - } - - case "webUrl": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -10942,595 +11580,490 @@ public Checkout(JsonObject fields) throws SchemaViolationError { } } - public Checkout(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "Checkout"; + return "CartMetafieldDeletePayload"; } /** - * The gift cards used on the checkout. + * The ID of the deleted cart metafield. */ - public List getAppliedGiftCards() { - return (List) get("appliedGiftCards"); + public ID getDeletedId() { + return (ID) get("deletedId"); } - public Checkout setAppliedGiftCards(List arg) { - optimisticData.put(getKey("appliedGiftCards"), arg); + public CartMetafieldDeletePayload setDeletedId(ID arg) { + optimisticData.put(getKey("deletedId"), arg); return this; } /** - * The available shipping rates for this Checkout. - * Should only be used when checkout `requiresShipping` is `true` and - * the shipping address is valid. + * The list of errors that occurred from executing the mutation. */ - public AvailableShippingRates getAvailableShippingRates() { - return (AvailableShippingRates) get("availableShippingRates"); + public List getUserErrors() { + return (List) get("userErrors"); } - public Checkout setAvailableShippingRates(AvailableShippingRates arg) { - optimisticData.put(getKey("availableShippingRates"), arg); + public CartMetafieldDeletePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } - /** - * The identity of the customer associated with the checkout. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "deletedId": return false; - public CheckoutBuyerIdentity getBuyerIdentity() { - return (CheckoutBuyerIdentity) get("buyerIdentity"); - } + case "userErrors": return true; - public Checkout setBuyerIdentity(CheckoutBuyerIdentity arg) { - optimisticData.put(getKey("buyerIdentity"), arg); - return this; + default: return false; + } } + } - /** - * The date and time when the checkout was completed. - */ + public static class CartMetafieldsSetInput implements Serializable { + private ID ownerId; - public DateTime getCompletedAt() { - return (DateTime) get("completedAt"); - } + private String key; - public Checkout setCompletedAt(DateTime arg) { - optimisticData.put(getKey("completedAt"), arg); - return this; - } + private String value; - /** - * The date and time when the checkout was created. - */ + private String type; - public DateTime getCreatedAt() { - return (DateTime) get("createdAt"); + public CartMetafieldsSetInput(ID ownerId, String key, String value, String type) { + this.ownerId = ownerId; + + this.key = key; + + this.value = value; + + this.type = type; } - public Checkout setCreatedAt(DateTime arg) { - optimisticData.put(getKey("createdAt"), arg); - return this; + public ID getOwnerId() { + return ownerId; } - /** - * The currency code for the checkout. - */ + public CartMetafieldsSetInput setOwnerId(ID ownerId) { + this.ownerId = ownerId; + return this; + } - public CurrencyCode getCurrencyCode() { - return (CurrencyCode) get("currencyCode"); + public String getKey() { + return key; } - public Checkout setCurrencyCode(CurrencyCode arg) { - optimisticData.put(getKey("currencyCode"), arg); + public CartMetafieldsSetInput setKey(String key) { + this.key = key; return this; } - /** - * A list of extra information that is added to the checkout. - */ - - public List getCustomAttributes() { - return (List) get("customAttributes"); + public String getValue() { + return value; } - public Checkout setCustomAttributes(List arg) { - optimisticData.put(getKey("customAttributes"), arg); + public CartMetafieldsSetInput setValue(String value) { + this.value = value; return this; } - /** - * Discounts that have been applied on the checkout. - */ - - public DiscountApplicationConnection getDiscountApplications() { - return (DiscountApplicationConnection) get("discountApplications"); + public String getType() { + return type; } - public Checkout setDiscountApplications(DiscountApplicationConnection arg) { - optimisticData.put(getKey("discountApplications"), arg); + public CartMetafieldsSetInput setType(String type) { + this.type = type; return this; } - /** - * The email attached to this checkout. - */ + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - public String getEmail() { - return (String) get("email"); - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("ownerId:"); + Query.appendQuotedString(_queryBuilder, ownerId.toString()); - public Checkout setEmail(String arg) { - optimisticData.put(getKey("email"), arg); - return this; + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("value:"); + Query.appendQuotedString(_queryBuilder, value.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("type:"); + Query.appendQuotedString(_queryBuilder, type.toString()); + + _queryBuilder.append('}'); } + } - /** - * A globally-unique identifier. - */ + public interface CartMetafieldsSetPayloadQueryDefinition { + void define(CartMetafieldsSetPayloadQuery _queryBuilder); + } - public ID getId() { - return (ID) get("id"); + /** + * Return type for `cartMetafieldsSet` mutation. + */ + public static class CartMetafieldsSetPayloadQuery extends Query { + CartMetafieldsSetPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * A list of line item objects, each one containing information about an item in the checkout. + * The list of cart metafields that were set. */ + public CartMetafieldsSetPayloadQuery metafields(MetafieldQueryDefinition queryDef) { + startField("metafields"); - public CheckoutLineItemConnection getLineItems() { - return (CheckoutLineItemConnection) get("lineItems"); - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Checkout setLineItems(CheckoutLineItemConnection arg) { - optimisticData.put(getKey("lineItems"), arg); return this; } /** - * The sum of all the prices of all the items in the checkout. Duties, taxes, shipping and discounts - * excluded. + * The list of errors that occurred from executing the mutation. */ + public CartMetafieldsSetPayloadQuery userErrors(MetafieldsSetUserErrorQueryDefinition queryDef) { + startField("userErrors"); - public MoneyV2 getLineItemsSubtotalPrice() { - return (MoneyV2) get("lineItemsSubtotalPrice"); - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldsSetUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Checkout setLineItemsSubtotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("lineItemsSubtotalPrice"), arg); return this; } + } - /** - * The note associated with the checkout. - */ + /** + * Return type for `cartMetafieldsSet` mutation. + */ + public static class CartMetafieldsSetPayload extends AbstractResponse { + public CartMetafieldsSetPayload() { + } - public String getNote() { - return (String) get("note"); + public CartMetafieldsSetPayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "metafields": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Metafield(jsonAsObject(element1, key))); + } + + optional1 = list1; + } + + responseData.put(key, optional1); + + break; + } + + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new MetafieldsSetUserError(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 Checkout setNote(String arg) { - optimisticData.put(getKey("note"), arg); - return this; + public String getGraphQlTypeName() { + return "CartMetafieldsSetPayload"; } /** - * The resulting order from a paid checkout. + * The list of cart metafields that were set. */ - public Order getOrder() { - return (Order) get("order"); + public List getMetafields() { + return (List) get("metafields"); } - public Checkout setOrder(Order arg) { - optimisticData.put(getKey("order"), arg); + public CartMetafieldsSetPayload setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); return this; } /** - * The Order Status Page for this Checkout, null when checkout is not completed. + * The list of errors that occurred from executing the mutation. */ - public String getOrderStatusUrl() { - return (String) get("orderStatusUrl"); + public List getUserErrors() { + return (List) get("userErrors"); } - public Checkout setOrderStatusUrl(String arg) { - optimisticData.put(getKey("orderStatusUrl"), arg); + public CartMetafieldsSetPayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } - /** - * The amount left to be paid. This is equal to the cost of the line items, taxes, and shipping, minus - * discounts and gift cards. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "metafields": return true; - public MoneyV2 getPaymentDue() { - return (MoneyV2) get("paymentDue"); + case "userErrors": return true; + + default: return false; + } } + } - public Checkout setPaymentDue(MoneyV2 arg) { - optimisticData.put(getKey("paymentDue"), arg); - return this; + public interface CartNoteUpdatePayloadQueryDefinition { + void define(CartNoteUpdatePayloadQuery _queryBuilder); + } + + /** + * Return type for `cartNoteUpdate` mutation. + */ + public static class CartNoteUpdatePayloadQuery extends Query { + CartNoteUpdatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The amount left to be paid. This is equal to the cost of the line items, duties, taxes, and - * shipping, minus discounts and gift cards. - * - * @deprecated Use `paymentDue` instead. + * The updated cart. */ + public CartNoteUpdatePayloadQuery cart(CartQueryDefinition queryDef) { + startField("cart"); - public MoneyV2 getPaymentDueV2() { - return (MoneyV2) get("paymentDueV2"); - } + _queryBuilder.append('{'); + queryDef.define(new CartQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Checkout setPaymentDueV2(MoneyV2 arg) { - optimisticData.put(getKey("paymentDueV2"), arg); return this; } /** - * Whether or not the Checkout is ready and can be completed. Checkouts may - * have asynchronous operations that can take time to finish. If you want - * to complete a checkout or ensure all the fields are populated and up to - * date, polling is required until the value is true. + * The list of errors that occurred from executing the mutation. */ + public CartNoteUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { + startField("userErrors"); - public Boolean getReady() { - return (Boolean) get("ready"); - } - - public Checkout setReady(Boolean arg) { - optimisticData.put(getKey("ready"), arg); - return this; - } - - /** - * States whether or not the fulfillment requires shipping. - */ - - public Boolean getRequiresShipping() { - return (Boolean) get("requiresShipping"); - } - - public Checkout setRequiresShipping(Boolean arg) { - optimisticData.put(getKey("requiresShipping"), arg); - return this; - } - - /** - * The shipping address to where the line items will be shipped. - */ - - public MailingAddress getShippingAddress() { - return (MailingAddress) get("shippingAddress"); - } - - public Checkout setShippingAddress(MailingAddress arg) { - optimisticData.put(getKey("shippingAddress"), arg); - return this; - } - - /** - * The discounts that have been allocated onto the shipping line by discount applications. - */ - - public List getShippingDiscountAllocations() { - return (List) get("shippingDiscountAllocations"); - } + _queryBuilder.append('{'); + queryDef.define(new CartUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Checkout setShippingDiscountAllocations(List arg) { - optimisticData.put(getKey("shippingDiscountAllocations"), arg); return this; } + } - /** - * Once a shipping rate is selected by the customer it is transitioned to a `shipping_line` object. - */ - - public ShippingRate getShippingLine() { - return (ShippingRate) get("shippingLine"); - } - - public Checkout setShippingLine(ShippingRate arg) { - optimisticData.put(getKey("shippingLine"), arg); - return this; + /** + * Return type for `cartNoteUpdate` mutation. + */ + public static class CartNoteUpdatePayload extends AbstractResponse { + public CartNoteUpdatePayload() { } - /** - * The price at checkout before shipping and taxes. - */ - - public MoneyV2 getSubtotalPrice() { - return (MoneyV2) get("subtotalPrice"); - } + public CartNoteUpdatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cart": { + Cart optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Cart(jsonAsObject(field.getValue(), key)); + } - public Checkout setSubtotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("subtotalPrice"), arg); - return this; - } + responseData.put(key, optional1); - /** - * The price at checkout before duties, shipping, and taxes. - * - * @deprecated Use `subtotalPrice` instead. - */ + break; + } - public MoneyV2 getSubtotalPriceV2() { - return (MoneyV2) get("subtotalPriceV2"); - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartUserError(jsonAsObject(element1, key))); + } - public Checkout setSubtotalPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("subtotalPriceV2"), arg); - return this; - } + responseData.put(key, list1); - /** - * Whether the checkout is tax exempt. - */ + break; + } - public Boolean getTaxExempt() { - return (Boolean) get("taxExempt"); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public Checkout setTaxExempt(Boolean arg) { - optimisticData.put(getKey("taxExempt"), arg); - return this; + public String getGraphQlTypeName() { + return "CartNoteUpdatePayload"; } /** - * Whether taxes are included in the line item and shipping line prices. + * The updated cart. */ - public Boolean getTaxesIncluded() { - return (Boolean) get("taxesIncluded"); + public Cart getCart() { + return (Cart) get("cart"); } - public Checkout setTaxesIncluded(Boolean arg) { - optimisticData.put(getKey("taxesIncluded"), arg); + public CartNoteUpdatePayload setCart(Cart arg) { + optimisticData.put(getKey("cart"), arg); return this; } /** - * The sum of all the duties applied to the line items in the checkout. + * The list of errors that occurred from executing the mutation. */ - public MoneyV2 getTotalDuties() { - return (MoneyV2) get("totalDuties"); + public List getUserErrors() { + return (List) get("userErrors"); } - public Checkout setTotalDuties(MoneyV2 arg) { - optimisticData.put(getKey("totalDuties"), arg); + public CartNoteUpdatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } - /** - * The sum of all the prices of all the items in the checkout, including taxes and duties. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cart": return true; - public MoneyV2 getTotalPrice() { - return (MoneyV2) get("totalPrice"); - } + case "userErrors": return true; - public Checkout setTotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("totalPrice"), arg); - return this; + default: return false; + } } + } - /** - * The sum of all the prices of all the items in the checkout, including taxes and duties. - * - * @deprecated Use `totalPrice` instead. - */ + public static class CartPaymentInput implements Serializable { + private MoneyInput amount; - public MoneyV2 getTotalPriceV2() { - return (MoneyV2) get("totalPriceV2"); - } + private Input sourceIdentifier = Input.undefined(); - public Checkout setTotalPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("totalPriceV2"), arg); - return this; - } + private Input freePaymentMethod = Input.undefined(); - /** - * The sum of all the taxes applied to the line items and shipping lines in the checkout. - */ + private Input directPaymentMethod = Input.undefined(); - public MoneyV2 getTotalTax() { - return (MoneyV2) get("totalTax"); - } + private Input walletPaymentMethod = Input.undefined(); - public Checkout setTotalTax(MoneyV2 arg) { - optimisticData.put(getKey("totalTax"), arg); - return this; + public CartPaymentInput(MoneyInput amount) { + this.amount = amount; } - /** - * The sum of all the taxes applied to the line items and shipping lines in the checkout. - * - * @deprecated Use `totalTax` instead. - */ - - public MoneyV2 getTotalTaxV2() { - return (MoneyV2) get("totalTaxV2"); + public MoneyInput getAmount() { + return amount; } - public Checkout setTotalTaxV2(MoneyV2 arg) { - optimisticData.put(getKey("totalTaxV2"), arg); + public CartPaymentInput setAmount(MoneyInput amount) { + this.amount = amount; return this; } - /** - * The date and time when the checkout was last updated. - */ - - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); - } - - public Checkout setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); - return this; + public String getSourceIdentifier() { + return sourceIdentifier.getValue(); } - /** - * The url pointing to the checkout accessible from the web. - */ - - public String getWebUrl() { - return (String) get("webUrl"); + public Input getSourceIdentifierInput() { + return sourceIdentifier; } - public Checkout setWebUrl(String arg) { - optimisticData.put(getKey("webUrl"), arg); + public CartPaymentInput setSourceIdentifier(String sourceIdentifier) { + this.sourceIdentifier = Input.optional(sourceIdentifier); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "appliedGiftCards": return true; - - case "availableShippingRates": return true; - - case "buyerIdentity": return true; - - case "completedAt": return false; - - case "createdAt": return false; - - case "currencyCode": return false; - - case "customAttributes": return true; - - case "discountApplications": return true; - - case "email": return false; - - case "id": return false; - - case "lineItems": return true; - - case "lineItemsSubtotalPrice": return true; - - case "note": return false; - - case "order": return true; - - case "orderStatusUrl": return false; - - case "paymentDue": return true; - - case "paymentDueV2": return true; - - case "ready": return false; - - case "requiresShipping": return false; - - case "shippingAddress": return true; - - case "shippingDiscountAllocations": return true; - - case "shippingLine": return true; - - case "subtotalPrice": return true; - - case "subtotalPriceV2": return true; - - case "taxExempt": return false; - - case "taxesIncluded": return false; - - case "totalDuties": return true; - - case "totalPrice": return true; - - case "totalPriceV2": return true; - - case "totalTax": return true; - - case "totalTaxV2": return true; - - case "updatedAt": return false; - - case "webUrl": return false; - - default: return false; + public CartPaymentInput setSourceIdentifierInput(Input sourceIdentifier) { + if (sourceIdentifier == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.sourceIdentifier = sourceIdentifier; + return this; } - } - - public static class CheckoutAttributesUpdateV2Input implements Serializable { - private Input note = Input.undefined(); - - private Input> customAttributes = Input.undefined(); - private Input allowPartialAddresses = Input.undefined(); - - public String getNote() { - return note.getValue(); + public CartFreePaymentMethodInput getFreePaymentMethod() { + return freePaymentMethod.getValue(); } - public Input getNoteInput() { - return note; + public Input getFreePaymentMethodInput() { + return freePaymentMethod; } - public CheckoutAttributesUpdateV2Input setNote(String note) { - this.note = Input.optional(note); + public CartPaymentInput setFreePaymentMethod(CartFreePaymentMethodInput freePaymentMethod) { + this.freePaymentMethod = Input.optional(freePaymentMethod); return this; } - public CheckoutAttributesUpdateV2Input setNoteInput(Input note) { - if (note == null) { + public CartPaymentInput setFreePaymentMethodInput(Input freePaymentMethod) { + if (freePaymentMethod == null) { throw new IllegalArgumentException("Input can not be null"); } - this.note = note; + this.freePaymentMethod = freePaymentMethod; return this; } - public List getCustomAttributes() { - return customAttributes.getValue(); + public CartDirectPaymentMethodInput getDirectPaymentMethod() { + return directPaymentMethod.getValue(); } - public Input> getCustomAttributesInput() { - return customAttributes; + public Input getDirectPaymentMethodInput() { + return directPaymentMethod; } - public CheckoutAttributesUpdateV2Input setCustomAttributes(List customAttributes) { - this.customAttributes = Input.optional(customAttributes); + public CartPaymentInput setDirectPaymentMethod(CartDirectPaymentMethodInput directPaymentMethod) { + this.directPaymentMethod = Input.optional(directPaymentMethod); return this; } - public CheckoutAttributesUpdateV2Input setCustomAttributesInput(Input> customAttributes) { - if (customAttributes == null) { + public CartPaymentInput setDirectPaymentMethodInput(Input directPaymentMethod) { + if (directPaymentMethod == null) { throw new IllegalArgumentException("Input can not be null"); } - this.customAttributes = customAttributes; + this.directPaymentMethod = directPaymentMethod; return this; } - public Boolean getAllowPartialAddresses() { - return allowPartialAddresses.getValue(); + public CartWalletPaymentMethodInput getWalletPaymentMethod() { + return walletPaymentMethod.getValue(); } - public Input getAllowPartialAddressesInput() { - return allowPartialAddresses; + public Input getWalletPaymentMethodInput() { + return walletPaymentMethod; } - public CheckoutAttributesUpdateV2Input setAllowPartialAddresses(Boolean allowPartialAddresses) { - this.allowPartialAddresses = Input.optional(allowPartialAddresses); + public CartPaymentInput setWalletPaymentMethod(CartWalletPaymentMethodInput walletPaymentMethod) { + this.walletPaymentMethod = Input.optional(walletPaymentMethod); return this; } - public CheckoutAttributesUpdateV2Input setAllowPartialAddressesInput(Input allowPartialAddresses) { - if (allowPartialAddresses == null) { + public CartPaymentInput setWalletPaymentMethodInput(Input walletPaymentMethod) { + if (walletPaymentMethod == null) { throw new IllegalArgumentException("Input can not be null"); } - this.allowPartialAddresses = allowPartialAddresses; + this.walletPaymentMethod = walletPaymentMethod; return this; } @@ -11538,43 +12071,50 @@ public void appendTo(StringBuilder _queryBuilder) { String separator = ""; _queryBuilder.append('{'); - if (this.note.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("amount:"); + amount.appendTo(_queryBuilder); + + if (this.sourceIdentifier.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("note:"); - if (note.getValue() != null) { - Query.appendQuotedString(_queryBuilder, note.getValue().toString()); + _queryBuilder.append("sourceIdentifier:"); + if (sourceIdentifier.getValue() != null) { + Query.appendQuotedString(_queryBuilder, sourceIdentifier.getValue().toString()); } else { _queryBuilder.append("null"); } } - if (this.customAttributes.isDefined()) { + if (this.freePaymentMethod.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(']'); + _queryBuilder.append("freePaymentMethod:"); + if (freePaymentMethod.getValue() != null) { + freePaymentMethod.getValue().appendTo(_queryBuilder); } else { _queryBuilder.append("null"); } } - if (this.allowPartialAddresses.isDefined()) { + if (this.directPaymentMethod.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("allowPartialAddresses:"); - if (allowPartialAddresses.getValue() != null) { - _queryBuilder.append(allowPartialAddresses.getValue()); + _queryBuilder.append("directPaymentMethod:"); + if (directPaymentMethod.getValue() != null) { + directPaymentMethod.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + if (this.walletPaymentMethod.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("walletPaymentMethod:"); + if (walletPaymentMethod.getValue() != null) { + walletPaymentMethod.getValue().appendTo(_queryBuilder); } else { _queryBuilder.append("null"); } @@ -11584,39 +12124,26 @@ public void appendTo(StringBuilder _queryBuilder) { } } - public interface CheckoutAttributesUpdateV2PayloadQueryDefinition { - void define(CheckoutAttributesUpdateV2PayloadQuery _queryBuilder); + public interface CartPaymentUpdatePayloadQueryDefinition { + void define(CartPaymentUpdatePayloadQuery _queryBuilder); } /** - * Return type for `checkoutAttributesUpdateV2` mutation. + * Return type for `cartPaymentUpdate` mutation. */ - public static class CheckoutAttributesUpdateV2PayloadQuery extends Query { - CheckoutAttributesUpdateV2PayloadQuery(StringBuilder _queryBuilder) { + public static class CartPaymentUpdatePayloadQuery extends Query { + CartPaymentUpdatePayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The updated checkout object. - */ - public CheckoutAttributesUpdateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The list of errors that occurred from executing the mutation. + * The updated cart. */ - public CheckoutAttributesUpdateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + public CartPaymentUpdatePayloadQuery cart(CartQueryDefinition queryDef) { + startField("cart"); _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + queryDef.define(new CartQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -11624,15 +12151,12 @@ public CheckoutAttributesUpdateV2PayloadQuery checkoutUserErrors(CheckoutUserErr /** * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. */ - @Deprecated - public CheckoutAttributesUpdateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + public CartPaymentUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { startField("userErrors"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new CartUserErrorQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -11640,21 +12164,21 @@ public CheckoutAttributesUpdateV2PayloadQuery userErrors(UserErrorQueryDefinitio } /** - * Return type for `checkoutAttributesUpdateV2` mutation. + * Return type for `cartPaymentUpdate` mutation. */ - public static class CheckoutAttributesUpdateV2Payload extends AbstractResponse { - public CheckoutAttributesUpdateV2Payload() { + public static class CartPaymentUpdatePayload extends AbstractResponse { + public CartPaymentUpdatePayload() { } - public CheckoutAttributesUpdateV2Payload(JsonObject fields) throws SchemaViolationError { + public CartPaymentUpdatePayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "checkout": { - Checkout optional1 = null; + case "cart": { + Cart optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + optional1 = new Cart(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -11662,21 +12186,10 @@ public CheckoutAttributesUpdateV2Payload(JsonObject fields) throws SchemaViolati 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<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); + list1.add(new CartUserError(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -11696,19 +12209,19 @@ public CheckoutAttributesUpdateV2Payload(JsonObject fields) throws SchemaViolati } public String getGraphQlTypeName() { - return "CheckoutAttributesUpdateV2Payload"; + return "CartPaymentUpdatePayload"; } /** - * The updated checkout object. + * The updated cart. */ - public Checkout getCheckout() { - return (Checkout) get("checkout"); + public Cart getCart() { + return (Cart) get("cart"); } - public CheckoutAttributesUpdateV2Payload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); + public CartPaymentUpdatePayload setCart(Cart arg) { + optimisticData.put(getKey("cart"), arg); return this; } @@ -11716,81 +12229,128 @@ public CheckoutAttributesUpdateV2Payload setCheckout(Checkout arg) { * The list of errors that occurred from executing the mutation. */ - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); + public List getUserErrors() { + return (List) get("userErrors"); } - public CheckoutAttributesUpdateV2Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); + public CartPaymentUpdatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cart": return true; - public List getUserErrors() { - return (List) get("userErrors"); + case "userErrors": return true; + + default: return false; + } } + } - public CheckoutAttributesUpdateV2Payload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public static class CartSelectedDeliveryOptionInput implements Serializable { + private ID deliveryGroupId; + + private String deliveryOptionHandle; + + public CartSelectedDeliveryOptionInput(ID deliveryGroupId, String deliveryOptionHandle) { + this.deliveryGroupId = deliveryGroupId; + + this.deliveryOptionHandle = deliveryOptionHandle; + } + + public ID getDeliveryGroupId() { + return deliveryGroupId; + } + + public CartSelectedDeliveryOptionInput setDeliveryGroupId(ID deliveryGroupId) { + this.deliveryGroupId = deliveryGroupId; return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + public String getDeliveryOptionHandle() { + return deliveryOptionHandle; + } - case "checkoutUserErrors": return true; + public CartSelectedDeliveryOptionInput setDeliveryOptionHandle(String deliveryOptionHandle) { + this.deliveryOptionHandle = deliveryOptionHandle; + return this; + } - case "userErrors": return true; + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - default: return false; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("deliveryGroupId:"); + Query.appendQuotedString(_queryBuilder, deliveryGroupId.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("deliveryOptionHandle:"); + Query.appendQuotedString(_queryBuilder, deliveryOptionHandle.toString()); + + _queryBuilder.append('}'); } } - public interface CheckoutBuyerIdentityQueryDefinition { - void define(CheckoutBuyerIdentityQuery _queryBuilder); + public interface CartSelectedDeliveryOptionsUpdatePayloadQueryDefinition { + void define(CartSelectedDeliveryOptionsUpdatePayloadQuery _queryBuilder); } /** - * The identity of the customer associated with the checkout. + * Return type for `cartSelectedDeliveryOptionsUpdate` mutation. */ - public static class CheckoutBuyerIdentityQuery extends Query { - CheckoutBuyerIdentityQuery(StringBuilder _queryBuilder) { + public static class CartSelectedDeliveryOptionsUpdatePayloadQuery extends Query { + CartSelectedDeliveryOptionsUpdatePayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The country code for the checkout. For example, `CA`. + * The updated cart. */ - public CheckoutBuyerIdentityQuery countryCode() { - startField("countryCode"); + public CartSelectedDeliveryOptionsUpdatePayloadQuery cart(CartQueryDefinition queryDef) { + startField("cart"); + + _queryBuilder.append('{'); + queryDef.define(new CartQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - } - /** - * The identity of the customer associated with the checkout. - */ - public static class CheckoutBuyerIdentity extends AbstractResponse { - public CheckoutBuyerIdentity() { + /** + * The list of errors that occurred from executing the mutation. + */ + public CartSelectedDeliveryOptionsUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { + startField("userErrors"); + + _queryBuilder.append('{'); + queryDef.define(new CartUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } + } - public CheckoutBuyerIdentity(JsonObject fields) throws SchemaViolationError { + /** + * Return type for `cartSelectedDeliveryOptionsUpdate` mutation. + */ + public static class CartSelectedDeliveryOptionsUpdatePayload extends AbstractResponse { + public CartSelectedDeliveryOptionsUpdatePayload() { + } + + public CartSelectedDeliveryOptionsUpdatePayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "countryCode": { - CountryCode optional1 = null; + case "cart": { + Cart optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = CountryCode.fromGraphQl(jsonAsString(field.getValue(), key)); + optional1 = new Cart(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -11798,6 +12358,17 @@ public CheckoutBuyerIdentity(JsonObject fields) throws SchemaViolationError { break; } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartUserError(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -11810,93 +12381,66 @@ public CheckoutBuyerIdentity(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CheckoutBuyerIdentity"; + return "CartSelectedDeliveryOptionsUpdatePayload"; } /** - * The country code for the checkout. For example, `CA`. + * The updated cart. */ - public CountryCode getCountryCode() { - return (CountryCode) get("countryCode"); + public Cart getCart() { + return (Cart) get("cart"); } - public CheckoutBuyerIdentity setCountryCode(CountryCode arg) { - optimisticData.put(getKey("countryCode"), arg); + public CartSelectedDeliveryOptionsUpdatePayload setCart(Cart arg) { + optimisticData.put(getKey("cart"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "countryCode": return false; - - default: return false; - } - } - } - - public static class CheckoutBuyerIdentityInput implements Serializable { - private CountryCode countryCode; - - public CheckoutBuyerIdentityInput(CountryCode countryCode) { - this.countryCode = countryCode; - } + /** + * The list of errors that occurred from executing the mutation. + */ - public CountryCode getCountryCode() { - return countryCode; + public List getUserErrors() { + return (List) get("userErrors"); } - public CheckoutBuyerIdentityInput setCountryCode(CountryCode countryCode) { - this.countryCode = countryCode; + public CartSelectedDeliveryOptionsUpdatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cart": return true; - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("countryCode:"); - _queryBuilder.append(countryCode.toString()); + case "userErrors": return true; - _queryBuilder.append('}'); + default: return false; + } } } - public interface CheckoutCompleteFreePayloadQueryDefinition { - void define(CheckoutCompleteFreePayloadQuery _queryBuilder); + public interface CartSubmitForCompletionPayloadQueryDefinition { + void define(CartSubmitForCompletionPayloadQuery _queryBuilder); } /** - * Return type for `checkoutCompleteFree` mutation. + * Return type for `cartSubmitForCompletion` mutation. */ - public static class CheckoutCompleteFreePayloadQuery extends Query { - CheckoutCompleteFreePayloadQuery(StringBuilder _queryBuilder) { + public static class CartSubmitForCompletionPayloadQuery extends Query { + CartSubmitForCompletionPayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The updated checkout object. - */ - public CheckoutCompleteFreePayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The list of errors that occurred from executing the mutation. + * The result of cart submission for completion. */ - public CheckoutCompleteFreePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + public CartSubmitForCompletionPayloadQuery result(CartSubmitForCompletionResultQueryDefinition queryDef) { + startField("result"); _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + queryDef.define(new CartSubmitForCompletionResultQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -11904,15 +12448,12 @@ public CheckoutCompleteFreePayloadQuery checkoutUserErrors(CheckoutUserErrorQuer /** * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. */ - @Deprecated - public CheckoutCompleteFreePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + public CartSubmitForCompletionPayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) { startField("userErrors"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new CartUserErrorQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -11920,21 +12461,21 @@ public CheckoutCompleteFreePayloadQuery userErrors(UserErrorQueryDefinition quer } /** - * Return type for `checkoutCompleteFree` mutation. + * Return type for `cartSubmitForCompletion` mutation. */ - public static class CheckoutCompleteFreePayload extends AbstractResponse { - public CheckoutCompleteFreePayload() { + public static class CartSubmitForCompletionPayload extends AbstractResponse { + public CartSubmitForCompletionPayload() { } - public CheckoutCompleteFreePayload(JsonObject fields) throws SchemaViolationError { + public CartSubmitForCompletionPayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "checkout": { - Checkout optional1 = null; + case "result": { + CartSubmitForCompletionResult optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + optional1 = UnknownCartSubmitForCompletionResult.create(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -11942,21 +12483,10 @@ public CheckoutCompleteFreePayload(JsonObject fields) throws SchemaViolationErro 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<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); + list1.add(new CartUserError(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -11976,55 +12506,38 @@ public CheckoutCompleteFreePayload(JsonObject fields) throws SchemaViolationErro } public String getGraphQlTypeName() { - return "CheckoutCompleteFreePayload"; - } - - /** - * The updated checkout object. - */ - - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } - - public CheckoutCompleteFreePayload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; + return "CartSubmitForCompletionPayload"; } /** - * The list of errors that occurred from executing the mutation. + * The result of cart submission for completion. */ - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); + public CartSubmitForCompletionResult getResult() { + return (CartSubmitForCompletionResult) get("result"); } - public CheckoutCompleteFreePayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); + public CartSubmitForCompletionPayload setResult(CartSubmitForCompletionResult arg) { + optimisticData.put(getKey("result"), 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 CheckoutCompleteFreePayload setUserErrors(List arg) { + public CartSubmitForCompletionPayload 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 "result": return false; case "userErrors": return true; @@ -12033,130 +12546,65 @@ public boolean unwrapsToObject(String key) { } } - public interface CheckoutCompleteWithCreditCardV2PayloadQueryDefinition { - void define(CheckoutCompleteWithCreditCardV2PayloadQuery _queryBuilder); + public interface CartSubmitForCompletionResultQueryDefinition { + void define(CartSubmitForCompletionResultQuery _queryBuilder); } /** - * Return type for `checkoutCompleteWithCreditCardV2` mutation. + * The result of cart submit completion. */ - public static class CheckoutCompleteWithCreditCardV2PayloadQuery extends Query { - CheckoutCompleteWithCreditCardV2PayloadQuery(StringBuilder _queryBuilder) { + public static class CartSubmitForCompletionResultQuery extends Query { + CartSubmitForCompletionResultQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - } - /** - * The checkout on which the payment was applied. - */ - public CheckoutCompleteWithCreditCardV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + startField("__typename"); + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); + public CartSubmitForCompletionResultQuery onSubmitAlreadyAccepted(SubmitAlreadyAcceptedQueryDefinition queryDef) { + startInlineFragment("SubmitAlreadyAccepted"); + queryDef.define(new SubmitAlreadyAcceptedQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; } - /** - * The list of errors that occurred from executing the mutation. - */ - public CheckoutCompleteWithCreditCardV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + public CartSubmitForCompletionResultQuery onSubmitFailed(SubmitFailedQueryDefinition queryDef) { + startInlineFragment("SubmitFailed"); + queryDef.define(new SubmitFailedQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; } - /** - * A representation of the attempted payment. - */ - public CheckoutCompleteWithCreditCardV2PayloadQuery payment(PaymentQueryDefinition queryDef) { - startField("payment"); - - _queryBuilder.append('{'); - queryDef.define(new PaymentQuery(_queryBuilder)); + public CartSubmitForCompletionResultQuery onSubmitSuccess(SubmitSuccessQueryDefinition queryDef) { + startInlineFragment("SubmitSuccess"); + queryDef.define(new SubmitSuccessQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ - @Deprecated - public CheckoutCompleteWithCreditCardV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + public CartSubmitForCompletionResultQuery onSubmitThrottled(SubmitThrottledQueryDefinition queryDef) { + startInlineFragment("SubmitThrottled"); + queryDef.define(new SubmitThrottledQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; } } + public interface CartSubmitForCompletionResult { + String getGraphQlTypeName(); + } + /** - * Return type for `checkoutCompleteWithCreditCardV2` mutation. + * The result of cart submit completion. */ - public static class CheckoutCompleteWithCreditCardV2Payload extends AbstractResponse { - public CheckoutCompleteWithCreditCardV2Payload() { + public static class UnknownCartSubmitForCompletionResult extends AbstractResponse implements CartSubmitForCompletionResult { + public UnknownCartSubmitForCompletionResult() { } - public CheckoutCompleteWithCreditCardV2Payload(JsonObject fields) throws SchemaViolationError { + public UnknownCartSubmitForCompletionResult(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; @@ -12168,163 +12616,98 @@ public CheckoutCompleteWithCreditCardV2Payload(JsonObject fields) throws SchemaV } } - public String getGraphQlTypeName() { - return "CheckoutCompleteWithCreditCardV2Payload"; - } - - /** - * The checkout on which the payment was applied. - */ - - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } - - public CheckoutCompleteWithCreditCardV2Payload 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 CheckoutCompleteWithCreditCardV2Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } - - /** - * A representation of the attempted payment. - */ + public static CartSubmitForCompletionResult create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "SubmitAlreadyAccepted": { + return new SubmitAlreadyAccepted(fields); + } - public Payment getPayment() { - return (Payment) get("payment"); - } + case "SubmitFailed": { + return new SubmitFailed(fields); + } - public CheckoutCompleteWithCreditCardV2Payload setPayment(Payment arg) { - optimisticData.put(getKey("payment"), arg); - return this; - } + case "SubmitSuccess": { + return new SubmitSuccess(fields); + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ + case "SubmitThrottled": { + return new SubmitThrottled(fields); + } - public List getUserErrors() { - return (List) get("userErrors"); + default: { + return new UnknownCartSubmitForCompletionResult(fields); + } + } } - public CheckoutCompleteWithCreditCardV2Payload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; + public String getGraphQlTypeName() { + return (String) get("__typename"); } 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); + public interface CartUserErrorQueryDefinition { + void define(CartUserErrorQuery _queryBuilder); } /** - * Return type for `checkoutCompleteWithTokenizedPaymentV3` mutation. + * Represents an error that happens during execution of a cart mutation. */ - public static class CheckoutCompleteWithTokenizedPaymentV3PayloadQuery extends Query { - CheckoutCompleteWithTokenizedPaymentV3PayloadQuery(StringBuilder _queryBuilder) { + public static class CartUserErrorQuery extends Query { + CartUserErrorQuery(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. + * The error code. */ - public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CartUserErrorQuery code() { + startField("code"); return this; } /** - * A representation of the attempted payment. + * The path to the input field that caused the error. */ - public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery payment(PaymentQueryDefinition queryDef) { - startField("payment"); - - _queryBuilder.append('{'); - queryDef.define(new PaymentQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CartUserErrorQuery field() { + startField("field"); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The error message. */ - @Deprecated - public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CartUserErrorQuery message() { + startField("message"); return this; } } /** - * Return type for `checkoutCompleteWithTokenizedPaymentV3` mutation. + * Represents an error that happens during execution of a cart mutation. */ - public static class CheckoutCompleteWithTokenizedPaymentV3Payload extends AbstractResponse { - public CheckoutCompleteWithTokenizedPaymentV3Payload() { + public static class CartUserError extends AbstractResponse implements DisplayableError { + public CartUserError() { } - public CheckoutCompleteWithTokenizedPaymentV3Payload(JsonObject fields) throws SchemaViolationError { + public CartUserError(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "checkout": { - Checkout optional1 = null; + case "code": { + CartErrorCode optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + optional1 = CartErrorCode.fromGraphQl(jsonAsString(field.getValue(), key)); } responseData.put(key, optional1); @@ -12332,21 +12715,15 @@ public CheckoutCompleteWithTokenizedPaymentV3Payload(JsonObject fields) throws S break; } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "payment": { - Payment optional1 = null; + case "field": { + List optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Payment(jsonAsObject(field.getValue(), key)); + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + optional1 = list1; } responseData.put(key, optional1); @@ -12354,13 +12731,8 @@ public CheckoutCompleteWithTokenizedPaymentV3Payload(JsonObject fields) throws S break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "message": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -12377,687 +12749,737 @@ public CheckoutCompleteWithTokenizedPaymentV3Payload(JsonObject fields) throws S } 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; + return "CartUserError"; } /** - * The list of errors that occurred from executing the mutation. + * The error code. */ - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); + public CartErrorCode getCode() { + return (CartErrorCode) get("code"); } - public CheckoutCompleteWithTokenizedPaymentV3Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); + public CartUserError setCode(CartErrorCode arg) { + optimisticData.put(getKey("code"), arg); return this; } /** - * A representation of the attempted payment. + * The path to the input field that caused the error. */ - public Payment getPayment() { - return (Payment) get("payment"); + public List getField() { + return (List) get("field"); } - public CheckoutCompleteWithTokenizedPaymentV3Payload setPayment(Payment arg) { - optimisticData.put(getKey("payment"), arg); + public CartUserError setField(List arg) { + optimisticData.put(getKey("field"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The error message. */ - public List getUserErrors() { - return (List) get("userErrors"); + public String getMessage() { + return (String) get("message"); } - public CheckoutCompleteWithTokenizedPaymentV3Payload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public CartUserError setMessage(String arg) { + optimisticData.put(getKey("message"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "checkout": return true; - - case "checkoutUserErrors": return true; + case "code": return false; - case "payment": return true; + case "field": return false; - case "userErrors": return true; + case "message": return false; default: return false; } } } - public static class CheckoutCreateInput implements Serializable { - private Input email = Input.undefined(); + public static class CartWalletPaymentMethodInput implements Serializable { + private Input applePayWalletContent = Input.undefined(); - private Input> lineItems = Input.undefined(); + private Input shopPayWalletContent = Input.undefined(); - private Input shippingAddress = Input.undefined(); + public ApplePayWalletContentInput getApplePayWalletContent() { + return applePayWalletContent.getValue(); + } - private Input note = Input.undefined(); + public Input getApplePayWalletContentInput() { + return applePayWalletContent; + } - private Input> customAttributes = Input.undefined(); + public CartWalletPaymentMethodInput setApplePayWalletContent(ApplePayWalletContentInput applePayWalletContent) { + this.applePayWalletContent = Input.optional(applePayWalletContent); + return this; + } - private Input allowPartialAddresses = Input.undefined(); + public CartWalletPaymentMethodInput setApplePayWalletContentInput(Input applePayWalletContent) { + if (applePayWalletContent == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.applePayWalletContent = applePayWalletContent; + return this; + } - private Input presentmentCurrencyCode = Input.undefined(); + public ShopPayWalletContentInput getShopPayWalletContent() { + return shopPayWalletContent.getValue(); + } - private Input buyerIdentity = Input.undefined(); + public Input getShopPayWalletContentInput() { + return shopPayWalletContent; + } - public String getEmail() { - return email.getValue(); - } - - public Input getEmailInput() { - return email; - } - - public CheckoutCreateInput setEmail(String email) { - this.email = Input.optional(email); + public CartWalletPaymentMethodInput setShopPayWalletContent(ShopPayWalletContentInput shopPayWalletContent) { + this.shopPayWalletContent = Input.optional(shopPayWalletContent); return this; } - public CheckoutCreateInput setEmailInput(Input email) { - if (email == null) { + public CartWalletPaymentMethodInput setShopPayWalletContentInput(Input shopPayWalletContent) { + if (shopPayWalletContent == null) { throw new IllegalArgumentException("Input can not be null"); } - this.email = email; + this.shopPayWalletContent = shopPayWalletContent; return this; } - public List getLineItems() { - return lineItems.getValue(); - } - - public Input> getLineItemsInput() { - return lineItems; - } + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - public CheckoutCreateInput setLineItems(List lineItems) { - this.lineItems = Input.optional(lineItems); - return this; - } + if (this.applePayWalletContent.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("applePayWalletContent:"); + if (applePayWalletContent.getValue() != null) { + applePayWalletContent.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } - public CheckoutCreateInput setLineItemsInput(Input> lineItems) { - if (lineItems == null) { - throw new IllegalArgumentException("Input can not be null"); + if (this.shopPayWalletContent.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("shopPayWalletContent:"); + if (shopPayWalletContent.getValue() != null) { + shopPayWalletContent.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } } - this.lineItems = lineItems; - return this; - } - public MailingAddressInput getShippingAddress() { - return shippingAddress.getValue(); + _queryBuilder.append('}'); } + } - public Input getShippingAddressInput() { - return shippingAddress; - } + public interface CheckoutQueryDefinition { + void define(CheckoutQuery _queryBuilder); + } - public CheckoutCreateInput setShippingAddress(MailingAddressInput shippingAddress) { - this.shippingAddress = Input.optional(shippingAddress); - return this; + /** + * A container for all the information required to checkout items and pay. + */ + public static class CheckoutQuery extends Query { + CheckoutQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); } - public CheckoutCreateInput setShippingAddressInput(Input shippingAddress) { - if (shippingAddress == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.shippingAddress = shippingAddress; + /** + * The gift cards used on the checkout. + */ + public CheckoutQuery appliedGiftCards(AppliedGiftCardQueryDefinition queryDef) { + startField("appliedGiftCards"); + + _queryBuilder.append('{'); + queryDef.define(new AppliedGiftCardQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public String getNote() { - return note.getValue(); - } + /** + * The available shipping rates for this Checkout. + * Should only be used when checkout `requiresShipping` is `true` and + * the shipping address is valid. + */ + public CheckoutQuery availableShippingRates(AvailableShippingRatesQueryDefinition queryDef) { + startField("availableShippingRates"); - public Input getNoteInput() { - return note; - } + _queryBuilder.append('{'); + queryDef.define(new AvailableShippingRatesQuery(_queryBuilder)); + _queryBuilder.append('}'); - 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; + /** + * The identity of the customer associated with the checkout. + */ + public CheckoutQuery buyerIdentity(CheckoutBuyerIdentityQueryDefinition queryDef) { + startField("buyerIdentity"); + + _queryBuilder.append('{'); + queryDef.define(new CheckoutBuyerIdentityQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public List getCustomAttributes() { - return customAttributes.getValue(); - } + /** + * The date and time when the checkout was completed. + */ + public CheckoutQuery completedAt() { + startField("completedAt"); - public Input> getCustomAttributesInput() { - return customAttributes; + return this; } - public CheckoutCreateInput setCustomAttributes(List customAttributes) { - this.customAttributes = Input.optional(customAttributes); + /** + * The date and time when the checkout was created. + */ + public CheckoutQuery createdAt() { + startField("createdAt"); + return this; } - public CheckoutCreateInput setCustomAttributesInput(Input> customAttributes) { - if (customAttributes == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.customAttributes = customAttributes; + /** + * The currency code for the checkout. + */ + public CheckoutQuery currencyCode() { + startField("currencyCode"); + return this; } - public Boolean getAllowPartialAddresses() { - return allowPartialAddresses.getValue(); - } + /** + * A list of extra information that is added to the checkout. + */ + public CheckoutQuery customAttributes(AttributeQueryDefinition queryDef) { + startField("customAttributes"); - public Input getAllowPartialAddressesInput() { - return allowPartialAddresses; - } + _queryBuilder.append('{'); + queryDef.define(new AttributeQuery(_queryBuilder)); + _queryBuilder.append('}'); - 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"); + public class DiscountApplicationsArguments extends Arguments { + DiscountApplicationsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); } - this.allowPartialAddresses = allowPartialAddresses; - return this; - } - public CurrencyCode getPresentmentCurrencyCode() { - return presentmentCurrencyCode.getValue(); - } + /** + * Returns up to the first `n` elements from the list. + */ + public DiscountApplicationsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - public Input getPresentmentCurrencyCodeInput() { - return presentmentCurrencyCode; - } + /** + * Returns the elements that come after the specified cursor. + */ + public DiscountApplicationsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - public CheckoutCreateInput setPresentmentCurrencyCode(CurrencyCode presentmentCurrencyCode) { - this.presentmentCurrencyCode = Input.optional(presentmentCurrencyCode); - return this; - } + /** + * Returns up to the last `n` elements from the list. + */ + public DiscountApplicationsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - public CheckoutCreateInput setPresentmentCurrencyCodeInput(Input presentmentCurrencyCode) { - if (presentmentCurrencyCode == null) { - throw new IllegalArgumentException("Input can not be null"); + /** + * Returns the elements that come before the specified cursor. + */ + public DiscountApplicationsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; } - this.presentmentCurrencyCode = presentmentCurrencyCode; - return this; - } - public CheckoutBuyerIdentityInput getBuyerIdentity() { - return buyerIdentity.getValue(); + /** + * Reverse the order of the underlying list. + */ + public DiscountApplicationsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } } - public Input getBuyerIdentityInput() { - return buyerIdentity; + public interface DiscountApplicationsArgumentsDefinition { + void define(DiscountApplicationsArguments args); } - public CheckoutCreateInput setBuyerIdentity(CheckoutBuyerIdentityInput buyerIdentity) { - this.buyerIdentity = Input.optional(buyerIdentity); - return this; + /** + * Discounts that have been applied on the checkout. + */ + public CheckoutQuery discountApplications(DiscountApplicationConnectionQueryDefinition queryDef) { + return discountApplications(args -> {}, queryDef); } - public CheckoutCreateInput setBuyerIdentityInput(Input buyerIdentity) { - if (buyerIdentity == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.buyerIdentity = buyerIdentity; - return this; - } + /** + * Discounts that have been applied on the checkout. + */ + public CheckoutQuery discountApplications(DiscountApplicationsArgumentsDefinition argsDef, DiscountApplicationConnectionQueryDefinition queryDef) { + startField("discountApplications"); + + DiscountApplicationsArguments args = new DiscountApplicationsArguments(_queryBuilder); + argsDef.define(args); + DiscountApplicationsArguments.end(args); - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; _queryBuilder.append('{'); + queryDef.define(new DiscountApplicationConnectionQuery(_queryBuilder)); + _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"); - } - } + return this; + } - 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"); - } - } + /** + * The email attached to this checkout. + */ + public CheckoutQuery email() { + startField("email"); - if (this.shippingAddress.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("shippingAddress:"); - if (shippingAddress.getValue() != null) { - shippingAddress.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); - } + return this; + } + + public class LineItemsArguments extends Arguments { + LineItemsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); } - 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"); + /** + * Returns up to the first `n` elements from the list. + */ + public LineItemsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); } + return this; } - 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"); + /** + * Returns the elements that come after the specified cursor. + */ + public LineItemsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } - if (this.allowPartialAddresses.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("allowPartialAddresses:"); - if (allowPartialAddresses.getValue() != null) { - _queryBuilder.append(allowPartialAddresses.getValue()); - } else { - _queryBuilder.append("null"); + /** + * Returns up to the last `n` elements from the list. + */ + public LineItemsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); } + return this; } - if (this.presentmentCurrencyCode.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("presentmentCurrencyCode:"); - if (presentmentCurrencyCode.getValue() != null) { - _queryBuilder.append(presentmentCurrencyCode.getValue().toString()); - } else { - _queryBuilder.append("null"); + /** + * Returns the elements that come before the specified cursor. + */ + public LineItemsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } - if (this.buyerIdentity.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("buyerIdentity:"); - if (buyerIdentity.getValue() != null) { - buyerIdentity.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); + /** + * Reverse the order of the underlying list. + */ + public LineItemsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; } - - _queryBuilder.append('}'); } - } - public interface CheckoutCreatePayloadQueryDefinition { - void define(CheckoutCreatePayloadQuery _queryBuilder); - } + public interface LineItemsArgumentsDefinition { + void define(LineItemsArguments args); + } - /** - * Return type for `checkoutCreate` mutation. - */ - public static class CheckoutCreatePayloadQuery extends Query { - CheckoutCreatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + /** + * A list of line item objects, each one containing information about an item in the checkout. + */ + public CheckoutQuery lineItems(CheckoutLineItemConnectionQueryDefinition queryDef) { + return lineItems(args -> {}, queryDef); } /** - * The new checkout object. + * A list of line item objects, each one containing information about an item in the checkout. */ - public CheckoutCreatePayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + public CheckoutQuery lineItems(LineItemsArgumentsDefinition argsDef, CheckoutLineItemConnectionQueryDefinition queryDef) { + startField("lineItems"); + + LineItemsArguments args = new LineItemsArguments(_queryBuilder); + argsDef.define(args); + LineItemsArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); + queryDef.define(new CheckoutLineItemConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. + * The sum of all the prices of all the items in the checkout. Duties, taxes, shipping and discounts + * excluded. */ - public CheckoutCreatePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + public CheckoutQuery lineItemsSubtotalPrice(MoneyV2QueryDefinition queryDef) { + startField("lineItemsSubtotalPrice"); _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The checkout queue token. Available only to selected stores. + * The note associated with the checkout. */ - public CheckoutCreatePayloadQuery queueToken() { - startField("queueToken"); + public CheckoutQuery note() { + startField("note"); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The resulting order from a paid checkout. */ - @Deprecated - public CheckoutCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public CheckoutQuery order(OrderQueryDefinition queryDef) { + startField("order"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new OrderQuery(_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)); - } + /** + * The Order Status Page for this Checkout, null when checkout is not completed. + */ + public CheckoutQuery orderStatusUrl() { + startField("orderStatusUrl"); - responseData.put(key, optional1); + return this; + } - break; - } + /** + * The amount left to be paid. This is equal to the cost of the line items, taxes, and shipping, minus + * discounts and gift cards. + */ + public CheckoutQuery paymentDue(MoneyV2QueryDefinition queryDef) { + startField("paymentDue"); - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - responseData.put(key, list1); + return this; + } - break; - } - - case "queueToken": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + /** + * The amount left to be paid. This is equal to the cost of the line items, duties, taxes, and + * shipping, minus discounts and gift cards. + * + * @deprecated Use `paymentDue` instead. + */ + @Deprecated + public CheckoutQuery paymentDueV2(MoneyV2QueryDefinition queryDef) { + startField("paymentDueV2"); - responseData.put(key, optional1); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - break; - } + return this; + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + /** + * Whether or not the Checkout is ready and can be completed. Checkouts may + * have asynchronous operations that can take time to finish. If you want + * to complete a checkout or ensure all the fields are populated and up to + * date, polling is required until the value is true. + */ + public CheckoutQuery ready() { + startField("ready"); - responseData.put(key, list1); + return this; + } - break; - } + /** + * States whether or not the fulfillment requires shipping. + */ + public CheckoutQuery requiresShipping() { + startField("requiresShipping"); - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + return this; } - public String getGraphQlTypeName() { - return "CheckoutCreatePayload"; + /** + * The shipping address to where the line items will be shipped. + */ + public CheckoutQuery shippingAddress(MailingAddressQueryDefinition queryDef) { + startField("shippingAddress"); + + _queryBuilder.append('{'); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * The new checkout object. + * The discounts that have been allocated onto the shipping line by discount applications. */ + public CheckoutQuery shippingDiscountAllocations(DiscountAllocationQueryDefinition queryDef) { + startField("shippingDiscountAllocations"); - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } + _queryBuilder.append('{'); + queryDef.define(new DiscountAllocationQuery(_queryBuilder)); + _queryBuilder.append('}'); - public CheckoutCreatePayload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * Once a shipping rate is selected by the customer it is transitioned to a `shipping_line` object. */ + public CheckoutQuery shippingLine(ShippingRateQueryDefinition queryDef) { + startField("shippingLine"); - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); - } + _queryBuilder.append('{'); + queryDef.define(new ShippingRateQuery(_queryBuilder)); + _queryBuilder.append('}'); - public CheckoutCreatePayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } /** - * The checkout queue token. Available only to selected stores. + * The price at checkout before shipping and taxes. */ + public CheckoutQuery subtotalPrice(MoneyV2QueryDefinition queryDef) { + startField("subtotalPrice"); - public String getQueueToken() { - return (String) get("queueToken"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public CheckoutCreatePayload setQueueToken(String arg) { - optimisticData.put(getKey("queueToken"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The price at checkout before duties, shipping, and taxes. * - * @deprecated Use `checkoutUserErrors` instead. + * @deprecated Use `subtotalPrice` instead. */ + @Deprecated + public CheckoutQuery subtotalPriceV2(MoneyV2QueryDefinition queryDef) { + startField("subtotalPriceV2"); - public List getUserErrors() { - return (List) get("userErrors"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - 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; + /** + * Whether the checkout is tax exempt. + */ + public CheckoutQuery taxExempt() { + startField("taxExempt"); - case "queueToken": return false; + return this; + } - case "userErrors": return true; + /** + * Whether taxes are included in the line item and shipping line prices. + */ + public CheckoutQuery taxesIncluded() { + startField("taxesIncluded"); - default: return false; - } + return this; } - } - public interface CheckoutCustomerAssociateV2PayloadQueryDefinition { - void define(CheckoutCustomerAssociateV2PayloadQuery _queryBuilder); - } + /** + * The sum of all the duties applied to the line items in the checkout. + */ + public CheckoutQuery totalDuties(MoneyV2QueryDefinition queryDef) { + startField("totalDuties"); - /** - * Return type for `checkoutCustomerAssociateV2` mutation. - */ - public static class CheckoutCustomerAssociateV2PayloadQuery extends Query { - CheckoutCustomerAssociateV2PayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * The updated checkout object. + * The sum of all the prices of all the items in the checkout, including taxes and duties. */ - public CheckoutCustomerAssociateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + public CheckoutQuery totalPrice(MoneyV2QueryDefinition queryDef) { + startField("totalPrice"); _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. + * The sum of all the prices of all the items in the checkout, including taxes and duties. + * + * @deprecated Use `totalPrice` instead. */ - public CheckoutCustomerAssociateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + @Deprecated + public CheckoutQuery totalPriceV2(MoneyV2QueryDefinition queryDef) { + startField("totalPriceV2"); _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The associated customer object. + * The sum of all the taxes applied to the line items and shipping lines in the checkout. */ - public CheckoutCustomerAssociateV2PayloadQuery customer(CustomerQueryDefinition queryDef) { - startField("customer"); + public CheckoutQuery totalTax(MoneyV2QueryDefinition queryDef) { + startField("totalTax"); _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. + * The sum of all the taxes applied to the line items and shipping lines in the checkout. * - * @deprecated Use `checkoutUserErrors` instead. + * @deprecated Use `totalTax` instead. */ @Deprecated - public CheckoutCustomerAssociateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public CheckoutQuery totalTaxV2(MoneyV2QueryDefinition queryDef) { + startField("totalTaxV2"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } + + /** + * The date and time when the checkout was last updated. + */ + public CheckoutQuery updatedAt() { + startField("updatedAt"); + + return this; + } + + /** + * The url pointing to the checkout accessible from the web. + */ + public CheckoutQuery webUrl() { + startField("webUrl"); + + return this; + } } /** - * Return type for `checkoutCustomerAssociateV2` mutation. + * A container for all the information required to checkout items and pay. */ - public static class CheckoutCustomerAssociateV2Payload extends AbstractResponse { - public CheckoutCustomerAssociateV2Payload() { + public static class Checkout extends AbstractResponse implements Node { + public Checkout() { } - public CheckoutCustomerAssociateV2Payload(JsonObject fields) throws SchemaViolationError { + public Checkout(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + case "appliedGiftCards": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new AppliedGiftCard(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); + case "availableShippingRates": { + AvailableShippingRates optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new AvailableShippingRates(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "customer": { - Customer optional1 = null; + case "buyerIdentity": { + responseData.put(key, new CheckoutBuyerIdentity(jsonAsObject(field.getValue(), key))); + + break; + } + + case "completedAt": { + DateTime optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); + optional1 = Utils.parseDateTime(jsonAsString(field.getValue(), key)); } responseData.put(key, optional1); @@ -13065,172 +13487,125 @@ public CheckoutCustomerAssociateV2Payload(JsonObject fields) throws SchemaViolat break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "createdAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); break; } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "currencyCode": { + responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); + break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - public String getGraphQlTypeName() { - return "CheckoutCustomerAssociateV2Payload"; - } + case "customAttributes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Attribute(jsonAsObject(element1, key))); + } - /** - * The updated checkout object. - */ + responseData.put(key, list1); - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } + break; + } - public CheckoutCustomerAssociateV2Payload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; - } + case "discountApplications": { + responseData.put(key, new DiscountApplicationConnection(jsonAsObject(field.getValue(), key))); - /** - * The list of errors that occurred from executing the mutation. - */ + break; + } - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); - } + case "email": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - public CheckoutCustomerAssociateV2Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } + responseData.put(key, optional1); - /** - * The associated customer object. - */ + break; + } - public Customer getCustomer() { - return (Customer) get("customer"); - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - public CheckoutCustomerAssociateV2Payload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); - return this; - } + break; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ + case "lineItems": { + responseData.put(key, new CheckoutLineItemConnection(jsonAsObject(field.getValue(), key))); - public List getUserErrors() { - return (List) get("userErrors"); - } + break; + } - public CheckoutCustomerAssociateV2Payload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } + case "lineItemsSubtotalPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + break; + } - case "checkoutUserErrors": return true; + case "note": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "customer": return true; + responseData.put(key, optional1); - case "userErrors": return true; + break; + } - default: return false; - } - } - } + case "order": { + Order optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Order(jsonAsObject(field.getValue(), key)); + } - public interface CheckoutCustomerDisassociateV2PayloadQueryDefinition { - void define(CheckoutCustomerDisassociateV2PayloadQuery _queryBuilder); - } + responseData.put(key, optional1); - /** - * Return type for `checkoutCustomerDisassociateV2` mutation. - */ - public static class CheckoutCustomerDisassociateV2PayloadQuery extends Query { - CheckoutCustomerDisassociateV2PayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + break; + } - /** - * The updated checkout object. - */ - public CheckoutCustomerDisassociateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + case "orderStatusUrl": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + responseData.put(key, optional1); - return this; - } + break; + } - /** - * The list of errors that occurred from executing the mutation. - */ - public CheckoutCustomerDisassociateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + case "paymentDue": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; - } + case "paymentDueV2": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ - @Deprecated - public CheckoutCustomerDisassociateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + break; + } - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "ready": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - return this; - } - } + break; + } - /** - * Return type for `checkoutCustomerDisassociateV2` mutation. - */ - public static class CheckoutCustomerDisassociateV2Payload extends AbstractResponse { - public CheckoutCustomerDisassociateV2Payload() { - } + case "requiresShipping": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - public CheckoutCustomerDisassociateV2Payload(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; + break; + } + + case "shippingAddress": { + MailingAddress optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -13238,10 +13613,10 @@ public CheckoutCustomerDisassociateV2Payload(JsonObject fields) throws SchemaVio break; } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); + case "shippingDiscountAllocations": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); + list1.add(new DiscountAllocation(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -13249,487 +13624,804 @@ public CheckoutCustomerDisassociateV2Payload(JsonObject fields) throws SchemaVio break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); + case "shippingLine": { + ShippingRate optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShippingRate(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "subtotalPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); + + case "subtotalPriceV2": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; } - } - } - } - public String getGraphQlTypeName() { - return "CheckoutCustomerDisassociateV2Payload"; - } + case "taxExempt": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - /** - * The updated checkout object. - */ + break; + } - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } + case "taxesIncluded": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - public CheckoutCustomerDisassociateV2Payload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; - } + break; + } - /** - * The list of errors that occurred from executing the mutation. - */ + case "totalDuties": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); - } + responseData.put(key, optional1); - public CheckoutCustomerDisassociateV2Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } + break; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ + case "totalPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - public List getUserErrors() { - return (List) get("userErrors"); - } + break; + } - public CheckoutCustomerDisassociateV2Payload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } + case "totalPriceV2": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + break; + } - case "checkoutUserErrors": return true; + case "totalTax": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - case "userErrors": return true; + break; + } - default: return false; + case "totalTaxV2": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + + case "webUrl": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } } } - } - public interface CheckoutDiscountCodeApplyV2PayloadQueryDefinition { - void define(CheckoutDiscountCodeApplyV2PayloadQuery _queryBuilder); - } + public Checkout(ID id) { + this(); + optimisticData.put("id", id); + } - /** - * Return type for `checkoutDiscountCodeApplyV2` mutation. - */ - public static class CheckoutDiscountCodeApplyV2PayloadQuery extends Query { - CheckoutDiscountCodeApplyV2PayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public String getGraphQlTypeName() { + return "Checkout"; } /** - * The updated checkout object. + * The gift cards used on the checkout. */ - public CheckoutDiscountCodeApplyV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + public List getAppliedGiftCards() { + return (List) get("appliedGiftCards"); + } + public Checkout setAppliedGiftCards(List arg) { + optimisticData.put(getKey("appliedGiftCards"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The available shipping rates for this Checkout. + * Should only be used when checkout `requiresShipping` is `true` and + * the shipping address is valid. */ - public CheckoutDiscountCodeApplyV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public AvailableShippingRates getAvailableShippingRates() { + return (AvailableShippingRates) get("availableShippingRates"); + } + public Checkout setAvailableShippingRates(AvailableShippingRates arg) { + optimisticData.put(getKey("availableShippingRates"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The identity of the customer associated with the checkout. */ - @Deprecated - public CheckoutDiscountCodeApplyV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public CheckoutBuyerIdentity getBuyerIdentity() { + return (CheckoutBuyerIdentity) get("buyerIdentity"); } - } - /** - * Return type for `checkoutDiscountCodeApplyV2` mutation. - */ - public static class CheckoutDiscountCodeApplyV2Payload extends AbstractResponse { - public CheckoutDiscountCodeApplyV2Payload() { + public Checkout setBuyerIdentity(CheckoutBuyerIdentity arg) { + optimisticData.put(getKey("buyerIdentity"), arg); + return this; } - public CheckoutDiscountCodeApplyV2Payload(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; - } + /** + * The date and time when the checkout was completed. + */ - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } + public DateTime getCompletedAt() { + return (DateTime) get("completedAt"); + } - responseData.put(key, list1); + public Checkout setCompletedAt(DateTime arg) { + optimisticData.put(getKey("completedAt"), arg); + return this; + } - break; - } + /** + * The date and time when the checkout was created. + */ - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + public DateTime getCreatedAt() { + return (DateTime) get("createdAt"); + } - responseData.put(key, list1); + public Checkout setCreatedAt(DateTime arg) { + optimisticData.put(getKey("createdAt"), arg); + return this; + } - break; - } + /** + * The currency code for the checkout. + */ - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public CurrencyCode getCurrencyCode() { + return (CurrencyCode) get("currencyCode"); } - public String getGraphQlTypeName() { - return "CheckoutDiscountCodeApplyV2Payload"; + public Checkout setCurrencyCode(CurrencyCode arg) { + optimisticData.put(getKey("currencyCode"), arg); + return this; } /** - * The updated checkout object. + * A list of extra information that is added to the checkout. */ - public Checkout getCheckout() { - return (Checkout) get("checkout"); + public List getCustomAttributes() { + return (List) get("customAttributes"); } - public CheckoutDiscountCodeApplyV2Payload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); + public Checkout setCustomAttributes(List arg) { + optimisticData.put(getKey("customAttributes"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * Discounts that have been applied on the checkout. */ - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); + public DiscountApplicationConnection getDiscountApplications() { + return (DiscountApplicationConnection) get("discountApplications"); } - public CheckoutDiscountCodeApplyV2Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); + public Checkout setDiscountApplications(DiscountApplicationConnection arg) { + optimisticData.put(getKey("discountApplications"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The email attached to this checkout. */ - public List getUserErrors() { - return (List) get("userErrors"); + public String getEmail() { + return (String) get("email"); } - public CheckoutDiscountCodeApplyV2Payload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public Checkout setEmail(String arg) { + optimisticData.put(getKey("email"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + /** + * A globally-unique identifier. + */ - case "checkoutUserErrors": return true; + public ID getId() { + return (ID) get("id"); + } - case "userErrors": return true; + /** + * A list of line item objects, each one containing information about an item in the checkout. + */ - default: return false; - } + public CheckoutLineItemConnection getLineItems() { + return (CheckoutLineItemConnection) get("lineItems"); } - } - - public interface CheckoutDiscountCodeRemovePayloadQueryDefinition { - void define(CheckoutDiscountCodeRemovePayloadQuery _queryBuilder); - } - /** - * Return type for `checkoutDiscountCodeRemove` mutation. - */ - public static class CheckoutDiscountCodeRemovePayloadQuery extends Query { - CheckoutDiscountCodeRemovePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public Checkout setLineItems(CheckoutLineItemConnection arg) { + optimisticData.put(getKey("lineItems"), arg); + return this; } /** - * The updated checkout object. + * The sum of all the prices of all the items in the checkout. Duties, taxes, shipping and discounts + * excluded. */ - public CheckoutDiscountCodeRemovePayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getLineItemsSubtotalPrice() { + return (MoneyV2) get("lineItemsSubtotalPrice"); + } + public Checkout setLineItemsSubtotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("lineItemsSubtotalPrice"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The note associated with the checkout. */ - public CheckoutDiscountCodeRemovePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getNote() { + return (String) get("note"); + } + public Checkout setNote(String arg) { + optimisticData.put(getKey("note"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The resulting order from a paid checkout. */ - @Deprecated - public CheckoutDiscountCodeRemovePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Order getOrder() { + return (Order) get("order"); + } + public Checkout setOrder(Order arg) { + optimisticData.put(getKey("order"), arg); return this; } - } - /** - * Return type for `checkoutDiscountCodeRemove` mutation. - */ - public static class CheckoutDiscountCodeRemovePayload extends AbstractResponse { - public CheckoutDiscountCodeRemovePayload() { - } + /** + * The Order Status Page for this Checkout, null when checkout is not completed. + */ - public CheckoutDiscountCodeRemovePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } + public String getOrderStatusUrl() { + return (String) get("orderStatusUrl"); + } - responseData.put(key, optional1); + public Checkout setOrderStatusUrl(String arg) { + optimisticData.put(getKey("orderStatusUrl"), arg); + return this; + } - break; - } + /** + * The amount left to be paid. This is equal to the cost of the line items, taxes, and shipping, minus + * discounts and gift cards. + */ - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } + public MoneyV2 getPaymentDue() { + return (MoneyV2) get("paymentDue"); + } - responseData.put(key, list1); + public Checkout setPaymentDue(MoneyV2 arg) { + optimisticData.put(getKey("paymentDue"), arg); + return this; + } - break; - } + /** + * The amount left to be paid. This is equal to the cost of the line items, duties, taxes, and + * shipping, minus discounts and gift cards. + * + * @deprecated Use `paymentDue` instead. + */ - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + public MoneyV2 getPaymentDueV2() { + return (MoneyV2) get("paymentDueV2"); + } - responseData.put(key, list1); + public Checkout setPaymentDueV2(MoneyV2 arg) { + optimisticData.put(getKey("paymentDueV2"), arg); + return this; + } - break; - } + /** + * Whether or not the Checkout is ready and can be completed. Checkouts may + * have asynchronous operations that can take time to finish. If you want + * to complete a checkout or ensure all the fields are populated and up to + * date, polling is required until the value is true. + */ - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public Boolean getReady() { + return (Boolean) get("ready"); } - public String getGraphQlTypeName() { - return "CheckoutDiscountCodeRemovePayload"; + public Checkout setReady(Boolean arg) { + optimisticData.put(getKey("ready"), arg); + return this; } /** - * The updated checkout object. + * States whether or not the fulfillment requires shipping. */ - public Checkout getCheckout() { - return (Checkout) get("checkout"); + public Boolean getRequiresShipping() { + return (Boolean) get("requiresShipping"); } - public CheckoutDiscountCodeRemovePayload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); + public Checkout setRequiresShipping(Boolean arg) { + optimisticData.put(getKey("requiresShipping"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The shipping address to where the line items will be shipped. */ - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); + public MailingAddress getShippingAddress() { + return (MailingAddress) get("shippingAddress"); } - public CheckoutDiscountCodeRemovePayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); + public Checkout setShippingAddress(MailingAddress arg) { + optimisticData.put(getKey("shippingAddress"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * The discounts that have been allocated onto the shipping line by discount applications. */ - public List getUserErrors() { - return (List) get("userErrors"); + public List getShippingDiscountAllocations() { + return (List) get("shippingDiscountAllocations"); } - public CheckoutDiscountCodeRemovePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public Checkout setShippingDiscountAllocations(List arg) { + optimisticData.put(getKey("shippingDiscountAllocations"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; - - case "checkoutUserErrors": return true; - - case "userErrors": return true; + /** + * Once a shipping rate is selected by the customer it is transitioned to a `shipping_line` object. + */ - default: return false; - } + public ShippingRate getShippingLine() { + return (ShippingRate) get("shippingLine"); } - } - - public interface CheckoutEmailUpdateV2PayloadQueryDefinition { - void define(CheckoutEmailUpdateV2PayloadQuery _queryBuilder); - } - /** - * Return type for `checkoutEmailUpdateV2` mutation. - */ - public static class CheckoutEmailUpdateV2PayloadQuery extends Query { - CheckoutEmailUpdateV2PayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public Checkout setShippingLine(ShippingRate arg) { + optimisticData.put(getKey("shippingLine"), arg); + return this; } /** - * The checkout object with the updated email. + * The price at checkout before shipping and taxes. */ - public CheckoutEmailUpdateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getSubtotalPrice() { + return (MoneyV2) get("subtotalPrice"); + } + public Checkout setSubtotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("subtotalPrice"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The price at checkout before duties, shipping, and taxes. + * + * @deprecated Use `subtotalPrice` instead. */ - public CheckoutEmailUpdateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getSubtotalPriceV2() { + return (MoneyV2) get("subtotalPriceV2"); + } + public Checkout setSubtotalPriceV2(MoneyV2 arg) { + optimisticData.put(getKey("subtotalPriceV2"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * Whether the checkout is tax exempt. */ - @Deprecated - public CheckoutEmailUpdateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Boolean getTaxExempt() { + return (Boolean) get("taxExempt"); + } + public Checkout setTaxExempt(Boolean arg) { + optimisticData.put(getKey("taxExempt"), arg); return this; } + + /** + * Whether taxes are included in the line item and shipping line prices. + */ + + public Boolean getTaxesIncluded() { + return (Boolean) get("taxesIncluded"); + } + + public Checkout setTaxesIncluded(Boolean arg) { + optimisticData.put(getKey("taxesIncluded"), arg); + return this; + } + + /** + * The sum of all the duties applied to the line items in the checkout. + */ + + public MoneyV2 getTotalDuties() { + return (MoneyV2) get("totalDuties"); + } + + public Checkout setTotalDuties(MoneyV2 arg) { + optimisticData.put(getKey("totalDuties"), arg); + return this; + } + + /** + * The sum of all the prices of all the items in the checkout, including taxes and duties. + */ + + public MoneyV2 getTotalPrice() { + return (MoneyV2) get("totalPrice"); + } + + public Checkout setTotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("totalPrice"), arg); + return this; + } + + /** + * The sum of all the prices of all the items in the checkout, including taxes and duties. + * + * @deprecated Use `totalPrice` instead. + */ + + public MoneyV2 getTotalPriceV2() { + return (MoneyV2) get("totalPriceV2"); + } + + public Checkout setTotalPriceV2(MoneyV2 arg) { + optimisticData.put(getKey("totalPriceV2"), arg); + return this; + } + + /** + * The sum of all the taxes applied to the line items and shipping lines in the checkout. + */ + + public MoneyV2 getTotalTax() { + return (MoneyV2) get("totalTax"); + } + + public Checkout setTotalTax(MoneyV2 arg) { + optimisticData.put(getKey("totalTax"), arg); + return this; + } + + /** + * The sum of all the taxes applied to the line items and shipping lines in the checkout. + * + * @deprecated Use `totalTax` instead. + */ + + public MoneyV2 getTotalTaxV2() { + return (MoneyV2) get("totalTaxV2"); + } + + public Checkout setTotalTaxV2(MoneyV2 arg) { + optimisticData.put(getKey("totalTaxV2"), arg); + return this; + } + + /** + * The date and time when the checkout was last updated. + */ + + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); + } + + public Checkout setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); + return this; + } + + /** + * The url pointing to the checkout accessible from the web. + */ + + public String getWebUrl() { + return (String) get("webUrl"); + } + + public Checkout setWebUrl(String arg) { + optimisticData.put(getKey("webUrl"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "appliedGiftCards": return true; + + case "availableShippingRates": return true; + + case "buyerIdentity": return true; + + case "completedAt": return false; + + case "createdAt": return false; + + case "currencyCode": return false; + + case "customAttributes": return true; + + case "discountApplications": return true; + + case "email": return false; + + case "id": return false; + + case "lineItems": return true; + + case "lineItemsSubtotalPrice": return true; + + case "note": return false; + + case "order": return true; + + case "orderStatusUrl": return false; + + case "paymentDue": return true; + + case "paymentDueV2": return true; + + case "ready": return false; + + case "requiresShipping": return false; + + case "shippingAddress": return true; + + case "shippingDiscountAllocations": return true; + + case "shippingLine": return true; + + case "subtotalPrice": return true; + + case "subtotalPriceV2": return true; + + case "taxExempt": return false; + + case "taxesIncluded": return false; + + case "totalDuties": return true; + + case "totalPrice": return true; + + case "totalPriceV2": return true; + + case "totalTax": return true; + + case "totalTaxV2": return true; + + case "updatedAt": return false; + + case "webUrl": return false; + + default: return false; + } + } + } + + public static class CheckoutAttributesUpdateV2Input 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 CheckoutAttributesUpdateV2Input setNote(String note) { + this.note = Input.optional(note); + return this; + } + + public CheckoutAttributesUpdateV2Input 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 CheckoutAttributesUpdateV2Input setCustomAttributes(List customAttributes) { + this.customAttributes = Input.optional(customAttributes); + return this; + } + + public CheckoutAttributesUpdateV2Input setCustomAttributesInput(Input> customAttributes) { + if (customAttributes == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.customAttributes = customAttributes; + return this; + } + + public Boolean getAllowPartialAddresses() { + return allowPartialAddresses.getValue(); + } + + public Input getAllowPartialAddressesInput() { + return allowPartialAddresses; + } + + public CheckoutAttributesUpdateV2Input setAllowPartialAddresses(Boolean allowPartialAddresses) { + this.allowPartialAddresses = Input.optional(allowPartialAddresses); + return this; + } + + public CheckoutAttributesUpdateV2Input 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 CheckoutAttributesUpdateV2PayloadQueryDefinition { + void define(CheckoutAttributesUpdateV2PayloadQuery _queryBuilder); } /** - * Return type for `checkoutEmailUpdateV2` mutation. + * Return type for `checkoutAttributesUpdateV2` mutation. */ - public static class CheckoutEmailUpdateV2Payload extends AbstractResponse { - public CheckoutEmailUpdateV2Payload() { + public static class CheckoutAttributesUpdateV2PayloadQuery extends Query { + CheckoutAttributesUpdateV2PayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } - public CheckoutEmailUpdateV2Payload(JsonObject fields) throws SchemaViolationError { + /** + * The updated checkout object. + */ + public CheckoutAttributesUpdateV2PayloadQuery 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 CheckoutAttributesUpdateV2PayloadQuery 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 CheckoutAttributesUpdateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); + + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * Return type for `checkoutAttributesUpdateV2` mutation. + */ + public static class CheckoutAttributesUpdateV2Payload extends AbstractResponse { + public CheckoutAttributesUpdateV2Payload() { + } + + public CheckoutAttributesUpdateV2Payload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -13779,18 +14471,18 @@ public CheckoutEmailUpdateV2Payload(JsonObject fields) throws SchemaViolationErr } public String getGraphQlTypeName() { - return "CheckoutEmailUpdateV2Payload"; + return "CheckoutAttributesUpdateV2Payload"; } /** - * The checkout object with the updated email. + * The updated checkout object. */ public Checkout getCheckout() { return (Checkout) get("checkout"); } - public CheckoutEmailUpdateV2Payload setCheckout(Checkout arg) { + public CheckoutAttributesUpdateV2Payload setCheckout(Checkout arg) { optimisticData.put(getKey("checkout"), arg); return this; } @@ -13803,7 +14495,7 @@ public List getCheckoutUserErrors() { return (List) get("checkoutUserErrors"); } - public CheckoutEmailUpdateV2Payload setCheckoutUserErrors(List arg) { + public CheckoutAttributesUpdateV2Payload setCheckoutUserErrors(List arg) { optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } @@ -13818,7 +14510,7 @@ public List getUserErrors() { return (List) get("userErrors"); } - public CheckoutEmailUpdateV2Payload setUserErrors(List arg) { + public CheckoutAttributesUpdateV2Payload setUserErrors(List arg) { optimisticData.put(getKey("userErrors"), arg); return this; } @@ -13836,633 +14528,510 @@ public boolean unwrapsToObject(String key) { } } + public interface CheckoutBuyerIdentityQueryDefinition { + void define(CheckoutBuyerIdentityQuery _queryBuilder); + } + /** - * Possible error codes that can be returned by `CheckoutUserError`. + * The identity of the customer associated with the checkout. */ - public enum CheckoutErrorCode { - /** - * Checkout is already completed. - */ - ALREADY_COMPLETED, + public static class CheckoutBuyerIdentityQuery extends Query { + CheckoutBuyerIdentityQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Input email contains an invalid domain name. + * The country code for the checkout. For example, `CA`. */ - BAD_DOMAIN, + public CheckoutBuyerIdentityQuery countryCode() { + startField("countryCode"); - /** - * The input value is blank. - */ - BLANK, + return this; + } + } - /** - * Cart does not meet discount requirements notice. - */ - CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE, + /** + * The identity of the customer associated with the checkout. + */ + public static class CheckoutBuyerIdentity extends AbstractResponse { + public CheckoutBuyerIdentity() { + } - /** - * Customer already used once per customer discount notice. - */ - CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE, + public CheckoutBuyerIdentity(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "countryCode": { + CountryCode optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = CountryCode.fromGraphQl(jsonAsString(field.getValue(), key)); + } - /** - * Discount already applied. - */ - DISCOUNT_ALREADY_APPLIED, + responseData.put(key, optional1); - /** - * Discount code isn't working right now. Please contact us for help. - */ - DISCOUNT_CODE_APPLICATION_FAILED, + break; + } - /** - * Discount disabled. - */ - DISCOUNT_DISABLED, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * Discount expired. - */ - DISCOUNT_EXPIRED, + public String getGraphQlTypeName() { + return "CheckoutBuyerIdentity"; + } /** - * Discount limit reached. + * The country code for the checkout. For example, `CA`. */ - DISCOUNT_LIMIT_REACHED, - /** - * Discount not found. - */ - DISCOUNT_NOT_FOUND, + public CountryCode getCountryCode() { + return (CountryCode) get("countryCode"); + } - /** - * Checkout is already completed. - */ - EMPTY, + public CheckoutBuyerIdentity setCountryCode(CountryCode arg) { + optimisticData.put(getKey("countryCode"), arg); + return this; + } - /** - * Queue token has expired. - */ - EXPIRED_QUEUE_TOKEN, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "countryCode": return false; - /** - * Gift card has already been applied. - */ - GIFT_CARD_ALREADY_APPLIED, + default: return false; + } + } + } - /** - * Gift card code is invalid. - */ - GIFT_CARD_CODE_INVALID, + public static class CheckoutBuyerIdentityInput implements Serializable { + private CountryCode countryCode; - /** - * Gift card currency does not match checkout currency. - */ - GIFT_CARD_CURRENCY_MISMATCH, + public CheckoutBuyerIdentityInput(CountryCode countryCode) { + this.countryCode = countryCode; + } - /** - * Gift card has no funds left. - */ - GIFT_CARD_DEPLETED, + public CountryCode getCountryCode() { + return countryCode; + } - /** - * Gift card is disabled. - */ - GIFT_CARD_DISABLED, + public CheckoutBuyerIdentityInput setCountryCode(CountryCode countryCode) { + this.countryCode = countryCode; + return this; + } - /** - * Gift card is expired. - */ - GIFT_CARD_EXPIRED, + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - /** - * Gift card was not found. - */ - GIFT_CARD_NOT_FOUND, + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("countryCode:"); + _queryBuilder.append(countryCode.toString()); - /** - * Gift card cannot be applied to a checkout that contains a gift card. - */ - GIFT_CARD_UNUSABLE, + _queryBuilder.append('}'); + } + } - /** - * The input value should be greater than or equal to the minimum value allowed. - */ - GREATER_THAN_OR_EQUAL_TO, + public interface CheckoutCompleteFreePayloadQueryDefinition { + void define(CheckoutCompleteFreePayloadQuery _queryBuilder); + } - /** - * Higher value discount applied. - */ - HIGHER_VALUE_DISCOUNT_APPLIED, + /** + * Return type for `checkoutCompleteFree` mutation. + */ + public static class CheckoutCompleteFreePayloadQuery extends Query { + CheckoutCompleteFreePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * The input value is invalid. + * The updated checkout object. */ - INVALID, + public CheckoutCompleteFreePayloadQuery checkout(CheckoutQueryDefinition queryDef) { + startField("checkout"); - /** - * Cannot specify country and presentment currency code. - */ - INVALID_COUNTRY_AND_CURRENCY, + _queryBuilder.append('{'); + queryDef.define(new CheckoutQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Input Zip is invalid for country provided. - */ - INVALID_FOR_COUNTRY, + return this; + } /** - * Input Zip is invalid for country and province provided. + * The list of errors that occurred from executing the mutation. */ - INVALID_FOR_COUNTRY_AND_PROVINCE, + public CheckoutCompleteFreePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + startField("checkoutUserErrors"); - /** - * Invalid province in country. - */ - INVALID_PROVINCE_IN_COUNTRY, + _queryBuilder.append('{'); + queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Queue token is invalid. - */ - INVALID_QUEUE_TOKEN, + return this; + } /** - * Invalid region in country. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead. */ - INVALID_REGION_IN_COUNTRY, + @Deprecated + public CheckoutCompleteFreePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - /** - * Invalid state in country. - */ - INVALID_STATE_IN_COUNTRY, + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * The input value should be less than the maximum value allowed. - */ - LESS_THAN, + return this; + } + } - /** - * The input value should be less than or equal to the maximum value allowed. - */ - LESS_THAN_OR_EQUAL_TO, + /** + * Return type for `checkoutCompleteFree` mutation. + */ + public static class CheckoutCompleteFreePayload extends AbstractResponse { + public CheckoutCompleteFreePayload() { + } - /** - * Line item was not found in checkout. - */ - LINE_ITEM_NOT_FOUND, + public CheckoutCompleteFreePayload(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)); + } - /** - * Checkout is locked. - */ - LOCKED, + responseData.put(key, optional1); - /** - * Maximum number of discount codes limit reached. - */ - MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED, + break; + } - /** - * Missing payment input. - */ - MISSING_PAYMENT_INPUT, + case "checkoutUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CheckoutUserError(jsonAsObject(element1, key))); + } - /** - * Not enough in stock. - */ - NOT_ENOUGH_IN_STOCK, + responseData.put(key, list1); - /** - * Input value is not supported. - */ - NOT_SUPPORTED, + break; + } - /** - * The input value needs to be blank. - */ - PRESENT, + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - /** - * Shipping rate expired. - */ - SHIPPING_RATE_EXPIRED, + responseData.put(key, list1); - /** - * Throttled during checkout. - */ - THROTTLED_DURING_CHECKOUT, + break; + } - /** - * The input value is too long. - */ - TOO_LONG, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "CheckoutCompleteFreePayload"; + } /** - * The amount of the payment does not match the value to be paid. + * The updated checkout object. */ - TOTAL_PRICE_MISMATCH, + + public Checkout getCheckout() { + return (Checkout) get("checkout"); + } + + public CheckoutCompleteFreePayload setCheckout(Checkout arg) { + optimisticData.put(getKey("checkout"), arg); + return this; + } /** - * Unable to apply discount. + * The list of errors that occurred from executing the mutation. */ - UNABLE_TO_APPLY, - UNKNOWN_VALUE; + public List getCheckoutUserErrors() { + return (List) get("checkoutUserErrors"); + } - public static CheckoutErrorCode fromGraphQl(String value) { - if (value == null) { - return null; - } + public CheckoutCompleteFreePayload setCheckoutUserErrors(List arg) { + optimisticData.put(getKey("checkoutUserErrors"), arg); + return this; + } - switch (value) { - case "ALREADY_COMPLETED": { - return ALREADY_COMPLETED; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead. + */ - case "BAD_DOMAIN": { - return BAD_DOMAIN; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case "BLANK": { - return BLANK; - } + public CheckoutCompleteFreePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case "CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE": { - return CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "checkout": return true; - case "CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE": { - return CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE; - } + case "checkoutUserErrors": return true; - case "DISCOUNT_ALREADY_APPLIED": { - return DISCOUNT_ALREADY_APPLIED; - } + case "userErrors": return true; - case "DISCOUNT_CODE_APPLICATION_FAILED": { - return DISCOUNT_CODE_APPLICATION_FAILED; - } + default: return false; + } + } + } - case "DISCOUNT_DISABLED": { - return DISCOUNT_DISABLED; - } + public interface CheckoutCompleteWithCreditCardV2PayloadQueryDefinition { + void define(CheckoutCompleteWithCreditCardV2PayloadQuery _queryBuilder); + } - case "DISCOUNT_EXPIRED": { - return DISCOUNT_EXPIRED; - } + /** + * Return type for `checkoutCompleteWithCreditCardV2` mutation. + */ + public static class CheckoutCompleteWithCreditCardV2PayloadQuery extends Query { + CheckoutCompleteWithCreditCardV2PayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "DISCOUNT_LIMIT_REACHED": { - return DISCOUNT_LIMIT_REACHED; - } + /** + * The checkout on which the payment was applied. + */ + public CheckoutCompleteWithCreditCardV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { + startField("checkout"); - case "DISCOUNT_NOT_FOUND": { - return DISCOUNT_NOT_FOUND; - } + _queryBuilder.append('{'); + queryDef.define(new CheckoutQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "EMPTY": { - return EMPTY; - } + return this; + } - case "EXPIRED_QUEUE_TOKEN": { - return EXPIRED_QUEUE_TOKEN; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CheckoutCompleteWithCreditCardV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + startField("checkoutUserErrors"); - case "GIFT_CARD_ALREADY_APPLIED": { - return GIFT_CARD_ALREADY_APPLIED; - } + _queryBuilder.append('{'); + queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "GIFT_CARD_CODE_INVALID": { - return GIFT_CARD_CODE_INVALID; - } + return this; + } - case "GIFT_CARD_CURRENCY_MISMATCH": { - return GIFT_CARD_CURRENCY_MISMATCH; - } + /** + * A representation of the attempted payment. + */ + public CheckoutCompleteWithCreditCardV2PayloadQuery payment(PaymentQueryDefinition queryDef) { + startField("payment"); - case "GIFT_CARD_DEPLETED": { - return GIFT_CARD_DEPLETED; - } + _queryBuilder.append('{'); + queryDef.define(new PaymentQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "GIFT_CARD_DISABLED": { - return GIFT_CARD_DISABLED; - } + return this; + } - case "GIFT_CARD_EXPIRED": { - return GIFT_CARD_EXPIRED; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead. + */ + @Deprecated + public CheckoutCompleteWithCreditCardV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case "GIFT_CARD_NOT_FOUND": { - return GIFT_CARD_NOT_FOUND; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "GIFT_CARD_UNUSABLE": { - return GIFT_CARD_UNUSABLE; - } + return this; + } + } - case "GREATER_THAN_OR_EQUAL_TO": { - return GREATER_THAN_OR_EQUAL_TO; - } + /** + * Return type for `checkoutCompleteWithCreditCardV2` mutation. + */ + public static class CheckoutCompleteWithCreditCardV2Payload extends AbstractResponse { + public CheckoutCompleteWithCreditCardV2Payload() { + } - case "HIGHER_VALUE_DISCOUNT_APPLIED": { - return HIGHER_VALUE_DISCOUNT_APPLIED; - } + public CheckoutCompleteWithCreditCardV2Payload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "checkout": { + Checkout optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + } - case "INVALID": { - return INVALID; - } + responseData.put(key, optional1); - case "INVALID_COUNTRY_AND_CURRENCY": { - return INVALID_COUNTRY_AND_CURRENCY; - } + break; + } - case "INVALID_FOR_COUNTRY": { - return INVALID_FOR_COUNTRY; - } + case "checkoutUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CheckoutUserError(jsonAsObject(element1, key))); + } - case "INVALID_FOR_COUNTRY_AND_PROVINCE": { - return INVALID_FOR_COUNTRY_AND_PROVINCE; - } + responseData.put(key, list1); - case "INVALID_PROVINCE_IN_COUNTRY": { - return INVALID_PROVINCE_IN_COUNTRY; - } + break; + } - case "INVALID_QUEUE_TOKEN": { - return INVALID_QUEUE_TOKEN; - } + case "payment": { + Payment optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Payment(jsonAsObject(field.getValue(), key)); + } - case "INVALID_REGION_IN_COUNTRY": { - return INVALID_REGION_IN_COUNTRY; - } + responseData.put(key, optional1); - case "INVALID_STATE_IN_COUNTRY": { - return INVALID_STATE_IN_COUNTRY; - } + break; + } - case "LESS_THAN": { - return LESS_THAN; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case "LESS_THAN_OR_EQUAL_TO": { - return LESS_THAN_OR_EQUAL_TO; - } + responseData.put(key, list1); - case "LINE_ITEM_NOT_FOUND": { - return LINE_ITEM_NOT_FOUND; - } + break; + } - case "LOCKED": { - return LOCKED; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED": { - return MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED; - } + public String getGraphQlTypeName() { + return "CheckoutCompleteWithCreditCardV2Payload"; + } - case "MISSING_PAYMENT_INPUT": { - return MISSING_PAYMENT_INPUT; - } + /** + * The checkout on which the payment was applied. + */ - case "NOT_ENOUGH_IN_STOCK": { - return NOT_ENOUGH_IN_STOCK; - } + public Checkout getCheckout() { + return (Checkout) get("checkout"); + } - case "NOT_SUPPORTED": { - return NOT_SUPPORTED; - } + public CheckoutCompleteWithCreditCardV2Payload setCheckout(Checkout arg) { + optimisticData.put(getKey("checkout"), arg); + return this; + } - case "PRESENT": { - return PRESENT; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case "SHIPPING_RATE_EXPIRED": { - return SHIPPING_RATE_EXPIRED; - } + public List getCheckoutUserErrors() { + return (List) get("checkoutUserErrors"); + } - case "THROTTLED_DURING_CHECKOUT": { - return THROTTLED_DURING_CHECKOUT; - } + public CheckoutCompleteWithCreditCardV2Payload setCheckoutUserErrors(List arg) { + optimisticData.put(getKey("checkoutUserErrors"), arg); + return this; + } - case "TOO_LONG": { - return TOO_LONG; - } + /** + * A representation of the attempted payment. + */ - case "TOTAL_PRICE_MISMATCH": { - return TOTAL_PRICE_MISMATCH; - } + public Payment getPayment() { + return (Payment) get("payment"); + } - case "UNABLE_TO_APPLY": { - return UNABLE_TO_APPLY; - } - - default: { - return UNKNOWN_VALUE; - } - } + public CheckoutCompleteWithCreditCardV2Payload setPayment(Payment arg) { + optimisticData.put(getKey("payment"), arg); + return this; } - public String toString() { - switch (this) { - case ALREADY_COMPLETED: { - return "ALREADY_COMPLETED"; - } - - case BAD_DOMAIN: { - return "BAD_DOMAIN"; - } - - case BLANK: { - return "BLANK"; - } - - case CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE: { - return "CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE"; - } - - case CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE: { - return "CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE"; - } - - case DISCOUNT_ALREADY_APPLIED: { - return "DISCOUNT_ALREADY_APPLIED"; - } - - case DISCOUNT_CODE_APPLICATION_FAILED: { - return "DISCOUNT_CODE_APPLICATION_FAILED"; - } - - case DISCOUNT_DISABLED: { - return "DISCOUNT_DISABLED"; - } - - case DISCOUNT_EXPIRED: { - return "DISCOUNT_EXPIRED"; - } - - case DISCOUNT_LIMIT_REACHED: { - return "DISCOUNT_LIMIT_REACHED"; - } - - case DISCOUNT_NOT_FOUND: { - return "DISCOUNT_NOT_FOUND"; - } - - case EMPTY: { - return "EMPTY"; - } - - case EXPIRED_QUEUE_TOKEN: { - return "EXPIRED_QUEUE_TOKEN"; - } - - case GIFT_CARD_ALREADY_APPLIED: { - return "GIFT_CARD_ALREADY_APPLIED"; - } - - case GIFT_CARD_CODE_INVALID: { - return "GIFT_CARD_CODE_INVALID"; - } - - case GIFT_CARD_CURRENCY_MISMATCH: { - return "GIFT_CARD_CURRENCY_MISMATCH"; - } - - case GIFT_CARD_DEPLETED: { - return "GIFT_CARD_DEPLETED"; - } - - case GIFT_CARD_DISABLED: { - return "GIFT_CARD_DISABLED"; - } - - case GIFT_CARD_EXPIRED: { - return "GIFT_CARD_EXPIRED"; - } - - case GIFT_CARD_NOT_FOUND: { - return "GIFT_CARD_NOT_FOUND"; - } - - case GIFT_CARD_UNUSABLE: { - return "GIFT_CARD_UNUSABLE"; - } - - case GREATER_THAN_OR_EQUAL_TO: { - return "GREATER_THAN_OR_EQUAL_TO"; - } - - case HIGHER_VALUE_DISCOUNT_APPLIED: { - return "HIGHER_VALUE_DISCOUNT_APPLIED"; - } - - case INVALID: { - return "INVALID"; - } - - case INVALID_COUNTRY_AND_CURRENCY: { - return "INVALID_COUNTRY_AND_CURRENCY"; - } - - case INVALID_FOR_COUNTRY: { - return "INVALID_FOR_COUNTRY"; - } - - case INVALID_FOR_COUNTRY_AND_PROVINCE: { - return "INVALID_FOR_COUNTRY_AND_PROVINCE"; - } - - case INVALID_PROVINCE_IN_COUNTRY: { - return "INVALID_PROVINCE_IN_COUNTRY"; - } - - case INVALID_QUEUE_TOKEN: { - return "INVALID_QUEUE_TOKEN"; - } - - case INVALID_REGION_IN_COUNTRY: { - return "INVALID_REGION_IN_COUNTRY"; - } - - case INVALID_STATE_IN_COUNTRY: { - return "INVALID_STATE_IN_COUNTRY"; - } - - case LESS_THAN: { - return "LESS_THAN"; - } - - case LESS_THAN_OR_EQUAL_TO: { - return "LESS_THAN_OR_EQUAL_TO"; - } - - case LINE_ITEM_NOT_FOUND: { - return "LINE_ITEM_NOT_FOUND"; - } - - case LOCKED: { - return "LOCKED"; - } - - case MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED: { - return "MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED"; - } - - case MISSING_PAYMENT_INPUT: { - return "MISSING_PAYMENT_INPUT"; - } - - case NOT_ENOUGH_IN_STOCK: { - return "NOT_ENOUGH_IN_STOCK"; - } - case NOT_SUPPORTED: { - return "NOT_SUPPORTED"; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead. + */ - case PRESENT: { - return "PRESENT"; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case SHIPPING_RATE_EXPIRED: { - return "SHIPPING_RATE_EXPIRED"; - } + public CheckoutCompleteWithCreditCardV2Payload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case THROTTLED_DURING_CHECKOUT: { - return "THROTTLED_DURING_CHECKOUT"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "checkout": return true; - case TOO_LONG: { - return "TOO_LONG"; - } + case "checkoutUserErrors": return true; - case TOTAL_PRICE_MISMATCH: { - return "TOTAL_PRICE_MISMATCH"; - } + case "payment": return true; - case UNABLE_TO_APPLY: { - return "UNABLE_TO_APPLY"; - } + case "userErrors": return true; - default: { - return ""; - } + default: return false; } } } - public interface CheckoutGiftCardRemoveV2PayloadQueryDefinition { - void define(CheckoutGiftCardRemoveV2PayloadQuery _queryBuilder); + public interface CheckoutCompleteWithTokenizedPaymentV3PayloadQueryDefinition { + void define(CheckoutCompleteWithTokenizedPaymentV3PayloadQuery _queryBuilder); } /** - * Return type for `checkoutGiftCardRemoveV2` mutation. + * Return type for `checkoutCompleteWithTokenizedPaymentV3` mutation. */ - public static class CheckoutGiftCardRemoveV2PayloadQuery extends Query { - CheckoutGiftCardRemoveV2PayloadQuery(StringBuilder _queryBuilder) { + public static class CheckoutCompleteWithTokenizedPaymentV3PayloadQuery extends Query { + CheckoutCompleteWithTokenizedPaymentV3PayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The updated checkout object. + * The checkout on which the payment was applied. */ - public CheckoutGiftCardRemoveV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { + public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery checkout(CheckoutQueryDefinition queryDef) { startField("checkout"); _queryBuilder.append('{'); @@ -14475,7 +15044,7 @@ public CheckoutGiftCardRemoveV2PayloadQuery checkout(CheckoutQueryDefinition que /** * The list of errors that occurred from executing the mutation. */ - public CheckoutGiftCardRemoveV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { startField("checkoutUserErrors"); _queryBuilder.append('{'); @@ -14485,13 +15054,26 @@ public CheckoutGiftCardRemoveV2PayloadQuery checkoutUserErrors(CheckoutUserError 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 CheckoutGiftCardRemoveV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + public CheckoutCompleteWithTokenizedPaymentV3PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { startField("userErrors"); _queryBuilder.append('{'); @@ -14503,13 +15085,13 @@ public CheckoutGiftCardRemoveV2PayloadQuery userErrors(UserErrorQueryDefinition } /** - * Return type for `checkoutGiftCardRemoveV2` mutation. + * Return type for `checkoutCompleteWithTokenizedPaymentV3` mutation. */ - public static class CheckoutGiftCardRemoveV2Payload extends AbstractResponse { - public CheckoutGiftCardRemoveV2Payload() { + public static class CheckoutCompleteWithTokenizedPaymentV3Payload extends AbstractResponse { + public CheckoutCompleteWithTokenizedPaymentV3Payload() { } - public CheckoutGiftCardRemoveV2Payload(JsonObject fields) throws SchemaViolationError { + public CheckoutCompleteWithTokenizedPaymentV3Payload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -14536,6 +15118,17 @@ public CheckoutGiftCardRemoveV2Payload(JsonObject fields) throws SchemaViolation 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)) { @@ -14559,18 +15152,18 @@ public CheckoutGiftCardRemoveV2Payload(JsonObject fields) throws SchemaViolation } public String getGraphQlTypeName() { - return "CheckoutGiftCardRemoveV2Payload"; + return "CheckoutCompleteWithTokenizedPaymentV3Payload"; } /** - * The updated checkout object. + * The checkout on which the payment was applied. */ public Checkout getCheckout() { return (Checkout) get("checkout"); } - public CheckoutGiftCardRemoveV2Payload setCheckout(Checkout arg) { + public CheckoutCompleteWithTokenizedPaymentV3Payload setCheckout(Checkout arg) { optimisticData.put(getKey("checkout"), arg); return this; } @@ -14583,11 +15176,24 @@ public List getCheckoutUserErrors() { return (List) get("checkoutUserErrors"); } - public CheckoutGiftCardRemoveV2Payload setCheckoutUserErrors(List arg) { + 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. * @@ -14598,7 +15204,7 @@ public List getUserErrors() { return (List) get("userErrors"); } - public CheckoutGiftCardRemoveV2Payload setUserErrors(List arg) { + public CheckoutCompleteWithTokenizedPaymentV3Payload setUserErrors(List arg) { optimisticData.put(getKey("userErrors"), arg); return this; } @@ -14609,6 +15215,8 @@ public boolean unwrapsToObject(String key) { case "checkoutUserErrors": return true; + case "payment": return true; + case "userErrors": return true; default: return false; @@ -14616,254 +15224,363 @@ public boolean unwrapsToObject(String key) { } } - public interface CheckoutGiftCardsAppendPayloadQueryDefinition { - void define(CheckoutGiftCardsAppendPayloadQuery _queryBuilder); - } + public static class CheckoutCreateInput implements Serializable { + private Input email = Input.undefined(); - /** - * Return type for `checkoutGiftCardsAppend` mutation. - */ - public static class CheckoutGiftCardsAppendPayloadQuery extends Query { - CheckoutGiftCardsAppendPayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + private Input> lineItems = Input.undefined(); - /** - * The updated checkout object. - */ - public CheckoutGiftCardsAppendPayloadQuery 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 CheckoutGiftCardsAppendPayloadQuery 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(); - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ - @Deprecated - public CheckoutGiftCardsAppendPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public String getEmail() { + return email.getValue(); + } - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Input getEmailInput() { + return email; + } + public CheckoutCreateInput setEmail(String email) { + this.email = Input.optional(email); return this; } - } - /** - * Return type for `checkoutGiftCardsAppend` mutation. - */ - public static class CheckoutGiftCardsAppendPayload extends AbstractResponse { - public CheckoutGiftCardsAppendPayload() { + public CheckoutCreateInput setEmailInput(Input email) { + if (email == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.email = email; + return this; } - public CheckoutGiftCardsAppendPayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } + public List getLineItems() { + return lineItems.getValue(); + } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } + public Input> getLineItemsInput() { + return lineItems; + } - responseData.put(key, list1); + public CheckoutCreateInput setLineItems(List lineItems) { + this.lineItems = Input.optional(lineItems); + return this; + } - break; - } + public CheckoutCreateInput setLineItemsInput(Input> lineItems) { + if (lineItems == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.lineItems = lineItems; + return this; + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + public MailingAddressInput getShippingAddress() { + return shippingAddress.getValue(); + } - responseData.put(key, list1); + public Input getShippingAddressInput() { + return shippingAddress; + } - break; - } + public CheckoutCreateInput setShippingAddress(MailingAddressInput shippingAddress) { + this.shippingAddress = Input.optional(shippingAddress); + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } + public CheckoutCreateInput setShippingAddressInput(Input shippingAddress) { + if (shippingAddress == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.shippingAddress = shippingAddress; + return this; } - public String getGraphQlTypeName() { - return "CheckoutGiftCardsAppendPayload"; + public String getNote() { + return note.getValue(); } - /** - * The updated checkout object. - */ + public Input getNoteInput() { + return note; + } - public Checkout getCheckout() { - return (Checkout) get("checkout"); + public CheckoutCreateInput setNote(String note) { + this.note = Input.optional(note); + return this; } - public CheckoutGiftCardsAppendPayload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); + public CheckoutCreateInput setNoteInput(Input note) { + if (note == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.note = note; return this; } - /** - * The list of errors that occurred from executing the mutation. - */ + public List getCustomAttributes() { + return customAttributes.getValue(); + } - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); + public Input> getCustomAttributesInput() { + return customAttributes; } - public CheckoutGiftCardsAppendPayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); + public CheckoutCreateInput setCustomAttributes(List customAttributes) { + this.customAttributes = Input.optional(customAttributes); return this; } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ + public CheckoutCreateInput setCustomAttributesInput(Input> customAttributes) { + if (customAttributes == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.customAttributes = customAttributes; + return this; + } - public List getUserErrors() { - return (List) get("userErrors"); + public Boolean getAllowPartialAddresses() { + return allowPartialAddresses.getValue(); } - public CheckoutGiftCardsAppendPayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public Input getAllowPartialAddressesInput() { + return allowPartialAddresses; + } + + public CheckoutCreateInput setAllowPartialAddresses(Boolean allowPartialAddresses) { + this.allowPartialAddresses = Input.optional(allowPartialAddresses); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + public CheckoutCreateInput setAllowPartialAddressesInput(Input allowPartialAddresses) { + if (allowPartialAddresses == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.allowPartialAddresses = allowPartialAddresses; + return this; + } - case "checkoutUserErrors": return true; + public CurrencyCode getPresentmentCurrencyCode() { + return presentmentCurrencyCode.getValue(); + } - case "userErrors": return true; + public Input getPresentmentCurrencyCodeInput() { + return presentmentCurrencyCode; + } - default: return false; + 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 interface CheckoutLineItemQueryDefinition { - void define(CheckoutLineItemQuery _queryBuilder); - } + public CheckoutBuyerIdentityInput getBuyerIdentity() { + return buyerIdentity.getValue(); + } - /** - * A single line item in the checkout, grouped by variant and attributes. - */ - public static class CheckoutLineItemQuery extends Query { - CheckoutLineItemQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public Input getBuyerIdentityInput() { + return buyerIdentity; + } - startField("id"); + public CheckoutCreateInput setBuyerIdentity(CheckoutBuyerIdentityInput buyerIdentity) { + this.buyerIdentity = Input.optional(buyerIdentity); + return this; } - /** - * Extra information in the form of an array of Key-Value pairs about the line item. - */ - public CheckoutLineItemQuery customAttributes(AttributeQueryDefinition queryDef) { - startField("customAttributes"); + 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('{'); - queryDef.define(new AttributeQuery(_queryBuilder)); + + if (this.email.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("email:"); + if (email.getValue() != null) { + Query.appendQuotedString(_queryBuilder, email.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + 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('}'); + } + } - return this; + public interface CheckoutCreatePayloadQueryDefinition { + void define(CheckoutCreatePayloadQuery _queryBuilder); + } + + /** + * Return type for `checkoutCreate` mutation. + */ + public static class CheckoutCreatePayloadQuery extends Query { + CheckoutCreatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The discounts that have been allocated onto the checkout line item by discount applications. + * The new checkout object. */ - public CheckoutLineItemQuery discountAllocations(DiscountAllocationQueryDefinition queryDef) { - startField("discountAllocations"); + public CheckoutCreatePayloadQuery checkout(CheckoutQueryDefinition queryDef) { + startField("checkout"); _queryBuilder.append('{'); - queryDef.define(new DiscountAllocationQuery(_queryBuilder)); + queryDef.define(new CheckoutQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The quantity of the line item. + * The list of errors that occurred from executing the mutation. */ - public CheckoutLineItemQuery quantity() { - startField("quantity"); - - return this; - } + public CheckoutCreatePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + startField("checkoutUserErrors"); - /** - * Title of the line item. Defaults to the product's title. - */ - public CheckoutLineItemQuery title() { - startField("title"); + _queryBuilder.append('{'); + queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * Unit price of the line item. + * The checkout queue token. Available only to selected stores. */ - public CheckoutLineItemQuery unitPrice(MoneyV2QueryDefinition queryDef) { - startField("unitPrice"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public CheckoutCreatePayloadQuery queueToken() { + startField("queueToken"); return this; } /** - * Product variant of the line item. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead. */ - public CheckoutLineItemQuery variant(ProductVariantQueryDefinition queryDef) { - startField("variant"); + @Deprecated + public CheckoutCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); _queryBuilder.append('{'); - queryDef.define(new ProductVariantQuery(_queryBuilder)); + queryDef.define(new UserErrorQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -14871,32 +15588,32 @@ public CheckoutLineItemQuery variant(ProductVariantQueryDefinition queryDef) { } /** - * A single line item in the checkout, grouped by variant and attributes. + * Return type for `checkoutCreate` mutation. */ - public static class CheckoutLineItem extends AbstractResponse implements Node { - public CheckoutLineItem() { + public static class CheckoutCreatePayload extends AbstractResponse { + public CheckoutCreatePayload() { } - public CheckoutLineItem(JsonObject fields) throws SchemaViolationError { + public CheckoutCreatePayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customAttributes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Attribute(jsonAsObject(element1, key))); + case "checkout": { + Checkout optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Checkout(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "discountAllocations": { - List list1 = new ArrayList<>(); + case "checkoutUserErrors": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new DiscountAllocation(jsonAsObject(element1, key))); + list1.add(new CheckoutUserError(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -14904,28 +15621,10 @@ public CheckoutLineItem(JsonObject fields) throws SchemaViolationError { break; } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - - break; - } - - case "quantity": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); - - break; - } - - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "unitPrice": { - MoneyV2 optional1 = null; + case "queueToken": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -14933,13 +15632,13 @@ public CheckoutLineItem(JsonObject fields) throws SchemaViolationError { break; } - case "variant": { - ProductVariant optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ProductVariant(jsonAsObject(field.getValue(), key)); + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } @@ -14955,168 +15654,141 @@ public CheckoutLineItem(JsonObject fields) throws SchemaViolationError { } } - public CheckoutLineItem(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "CheckoutLineItem"; - } - - /** - * Extra information in the form of an array of Key-Value pairs about the line item. - */ - - public List getCustomAttributes() { - return (List) get("customAttributes"); - } - - public CheckoutLineItem setCustomAttributes(List arg) { - optimisticData.put(getKey("customAttributes"), arg); - return this; - } - - /** - * The discounts that have been allocated onto the checkout line item by discount applications. - */ - - public List getDiscountAllocations() { - return (List) get("discountAllocations"); - } - - public CheckoutLineItem setDiscountAllocations(List arg) { - optimisticData.put(getKey("discountAllocations"), arg); - return this; - } - - /** - * A globally-unique identifier. - */ - - public ID getId() { - return (ID) get("id"); + return "CheckoutCreatePayload"; } /** - * The quantity of the line item. + * The new checkout object. */ - public Integer getQuantity() { - return (Integer) get("quantity"); + public Checkout getCheckout() { + return (Checkout) get("checkout"); } - public CheckoutLineItem setQuantity(Integer arg) { - optimisticData.put(getKey("quantity"), arg); + public CheckoutCreatePayload setCheckout(Checkout arg) { + optimisticData.put(getKey("checkout"), arg); return this; } /** - * Title of the line item. Defaults to the product's title. + * The list of errors that occurred from executing the mutation. */ - public String getTitle() { - return (String) get("title"); + public List getCheckoutUserErrors() { + return (List) get("checkoutUserErrors"); } - public CheckoutLineItem setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public CheckoutCreatePayload setCheckoutUserErrors(List arg) { + optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } /** - * Unit price of the line item. + * The checkout queue token. Available only to selected stores. */ - public MoneyV2 getUnitPrice() { - return (MoneyV2) get("unitPrice"); + public String getQueueToken() { + return (String) get("queueToken"); } - public CheckoutLineItem setUnitPrice(MoneyV2 arg) { - optimisticData.put(getKey("unitPrice"), arg); + public CheckoutCreatePayload setQueueToken(String arg) { + optimisticData.put(getKey("queueToken"), arg); return this; } /** - * Product variant of the line item. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead. */ - public ProductVariant getVariant() { - return (ProductVariant) get("variant"); + public List getUserErrors() { + return (List) get("userErrors"); } - public CheckoutLineItem setVariant(ProductVariant arg) { - optimisticData.put(getKey("variant"), arg); + public CheckoutCreatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "customAttributes": return true; - - case "discountAllocations": return true; - - case "id": return false; - - case "quantity": return false; + case "checkout": return true; - case "title": return false; + case "checkoutUserErrors": return true; - case "unitPrice": return true; + case "queueToken": return false; - case "variant": return true; + case "userErrors": return true; default: return false; } } } - public interface CheckoutLineItemConnectionQueryDefinition { - void define(CheckoutLineItemConnectionQuery _queryBuilder); + public interface CheckoutCustomerAssociateV2PayloadQueryDefinition { + void define(CheckoutCustomerAssociateV2PayloadQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple CheckoutLineItems. + * Return type for `checkoutCustomerAssociateV2` mutation. */ - public static class CheckoutLineItemConnectionQuery extends Query { - CheckoutLineItemConnectionQuery(StringBuilder _queryBuilder) { + public static class CheckoutCustomerAssociateV2PayloadQuery extends Query { + CheckoutCustomerAssociateV2PayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A list of edges. + * The updated checkout object. */ - public CheckoutLineItemConnectionQuery edges(CheckoutLineItemEdgeQueryDefinition queryDef) { - startField("edges"); + public CheckoutCustomerAssociateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { + startField("checkout"); _queryBuilder.append('{'); - queryDef.define(new CheckoutLineItemEdgeQuery(_queryBuilder)); + queryDef.define(new CheckoutQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in CheckoutLineItemEdge. + * The list of errors that occurred from executing the mutation. */ - public CheckoutLineItemConnectionQuery nodes(CheckoutLineItemQueryDefinition queryDef) { - startField("nodes"); + public CheckoutCustomerAssociateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + startField("checkoutUserErrors"); _queryBuilder.append('{'); - queryDef.define(new CheckoutLineItemQuery(_queryBuilder)); + queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Information to aid in pagination. + * The associated customer object. */ - public CheckoutLineItemConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + public CheckoutCustomerAssociateV2PayloadQuery customer(CustomerQueryDefinition queryDef) { + startField("customer"); _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); + 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; @@ -15124,32 +15796,32 @@ public CheckoutLineItemConnectionQuery pageInfo(PageInfoQueryDefinition queryDef } /** - * An auto-generated type for paginating through multiple CheckoutLineItems. + * Return type for `checkoutCustomerAssociateV2` mutation. */ - public static class CheckoutLineItemConnection extends AbstractResponse { - public CheckoutLineItemConnection() { + public static class CheckoutCustomerAssociateV2Payload extends AbstractResponse { + public CheckoutCustomerAssociateV2Payload() { } - public CheckoutLineItemConnection(JsonObject fields) throws SchemaViolationError { + public CheckoutCustomerAssociateV2Payload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutLineItemEdge(jsonAsObject(element1, key))); + case "checkout": { + Checkout optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Checkout(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "nodes": { - List list1 = new ArrayList<>(); + case "checkoutUserErrors": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutLineItem(jsonAsObject(element1, key))); + list1.add(new CheckoutUserError(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -15157,8 +15829,24 @@ public CheckoutLineItemConnection(JsonObject fields) throws SchemaViolationError break; } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + 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; } @@ -15175,90 +15863,127 @@ public CheckoutLineItemConnection(JsonObject fields) throws SchemaViolationError } public String getGraphQlTypeName() { - return "CheckoutLineItemConnection"; + return "CheckoutCustomerAssociateV2Payload"; } /** - * A list of edges. + * The updated checkout object. */ - public List getEdges() { - return (List) get("edges"); + public Checkout getCheckout() { + return (Checkout) get("checkout"); } - public CheckoutLineItemConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); + public CheckoutCustomerAssociateV2Payload setCheckout(Checkout arg) { + optimisticData.put(getKey("checkout"), arg); return this; } /** - * A list of the nodes contained in CheckoutLineItemEdge. + * The list of errors that occurred from executing the mutation. */ - public List getNodes() { - return (List) get("nodes"); + public List getCheckoutUserErrors() { + return (List) get("checkoutUserErrors"); } - public CheckoutLineItemConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + public CheckoutCustomerAssociateV2Payload setCheckoutUserErrors(List arg) { + optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } /** - * Information to aid in pagination. + * The associated customer object. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public Customer getCustomer() { + return (Customer) get("customer"); } - public CheckoutLineItemConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + 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 "edges": return true; + case "checkout": return true; - case "nodes": return true; + case "checkoutUserErrors": return true; - case "pageInfo": return true; + case "customer": return true; + + case "userErrors": return true; default: return false; } } } - public interface CheckoutLineItemEdgeQueryDefinition { - void define(CheckoutLineItemEdgeQuery _queryBuilder); + public interface CheckoutCustomerDisassociateV2PayloadQueryDefinition { + void define(CheckoutCustomerDisassociateV2PayloadQuery _queryBuilder); } /** - * An auto-generated type which holds one CheckoutLineItem and a cursor during pagination. + * Return type for `checkoutCustomerDisassociateV2` mutation. */ - public static class CheckoutLineItemEdgeQuery extends Query { - CheckoutLineItemEdgeQuery(StringBuilder _queryBuilder) { + public static class CheckoutCustomerDisassociateV2PayloadQuery extends Query { + CheckoutCustomerDisassociateV2PayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A cursor for use in pagination. + * The updated checkout object. */ - public CheckoutLineItemEdgeQuery cursor() { - startField("cursor"); + public CheckoutCustomerDisassociateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { + startField("checkout"); + + _queryBuilder.append('{'); + queryDef.define(new CheckoutQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The item at the end of CheckoutLineItemEdge. + * The list of errors that occurred from executing the mutation. */ - public CheckoutLineItemEdgeQuery node(CheckoutLineItemQueryDefinition queryDef) { - startField("node"); + public CheckoutCustomerDisassociateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + startField("checkoutUserErrors"); _queryBuilder.append('{'); - queryDef.define(new CheckoutLineItemQuery(_queryBuilder)); + 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 CheckoutCustomerDisassociateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); + + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -15266,25 +15991,46 @@ public CheckoutLineItemEdgeQuery node(CheckoutLineItemQueryDefinition queryDef) } /** - * An auto-generated type which holds one CheckoutLineItem and a cursor during pagination. + * Return type for `checkoutCustomerDisassociateV2` mutation. */ - public static class CheckoutLineItemEdge extends AbstractResponse { - public CheckoutLineItemEdge() { + public static class CheckoutCustomerDisassociateV2Payload extends AbstractResponse { + public CheckoutCustomerDisassociateV2Payload() { } - public CheckoutLineItemEdge(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 "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "checkout": { + Checkout optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "node": { - responseData.put(key, new CheckoutLineItem(jsonAsObject(field.getValue(), key))); + 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; } @@ -15301,306 +16047,79 @@ public CheckoutLineItemEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CheckoutLineItemEdge"; + return "CheckoutCustomerDisassociateV2Payload"; } /** - * A cursor for use in pagination. + * The updated checkout object. */ - public String getCursor() { - return (String) get("cursor"); + public Checkout getCheckout() { + return (Checkout) get("checkout"); } - public CheckoutLineItemEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public CheckoutCustomerDisassociateV2Payload setCheckout(Checkout arg) { + optimisticData.put(getKey("checkout"), arg); return this; } /** - * The item at the end of CheckoutLineItemEdge. + * The list of errors that occurred from executing the mutation. */ - public CheckoutLineItem getNode() { - return (CheckoutLineItem) get("node"); - } - - public CheckoutLineItemEdge setNode(CheckoutLineItem 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 CheckoutLineItemInput implements Serializable { - private int quantity; - - private ID variantId; - - private Input> customAttributes = Input.undefined(); - - public CheckoutLineItemInput(int quantity, ID variantId) { - this.quantity = quantity; - - this.variantId = variantId; - } - - public int getQuantity() { - return quantity; - } - - public CheckoutLineItemInput setQuantity(int quantity) { - this.quantity = quantity; - return this; - } - - public ID getVariantId() { - return variantId; - } - - public CheckoutLineItemInput setVariantId(ID variantId) { - this.variantId = variantId; - return this; - } - - public List getCustomAttributes() { - return customAttributes.getValue(); - } - - public Input> getCustomAttributesInput() { - return customAttributes; - } - - public CheckoutLineItemInput setCustomAttributes(List customAttributes) { - this.customAttributes = Input.optional(customAttributes); - return this; - } - - public CheckoutLineItemInput setCustomAttributesInput(Input> customAttributes) { - if (customAttributes == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.customAttributes = customAttributes; - return this; - } - - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("quantity:"); - _queryBuilder.append(quantity); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("variantId:"); - Query.appendQuotedString(_queryBuilder, variantId.toString()); - - 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"); - } - } - - _queryBuilder.append('}'); - } - } - - public static class CheckoutLineItemUpdateInput implements Serializable { - private Input id = Input.undefined(); - - private Input variantId = Input.undefined(); - - private Input quantity = Input.undefined(); - - private Input> customAttributes = Input.undefined(); - - public ID getId() { - return id.getValue(); - } - - public Input getIdInput() { - return id; - } - - public CheckoutLineItemUpdateInput setId(ID id) { - this.id = Input.optional(id); - return this; - } - - public CheckoutLineItemUpdateInput setIdInput(Input id) { - if (id == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.id = id; - return this; - } - - public ID getVariantId() { - return variantId.getValue(); - } - - public Input getVariantIdInput() { - return variantId; - } - - public CheckoutLineItemUpdateInput setVariantId(ID variantId) { - this.variantId = Input.optional(variantId); - return this; - } - - public CheckoutLineItemUpdateInput setVariantIdInput(Input variantId) { - if (variantId == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.variantId = variantId; - return this; - } - - public Integer getQuantity() { - return quantity.getValue(); - } - - public Input getQuantityInput() { - return quantity; - } - - public CheckoutLineItemUpdateInput setQuantity(Integer quantity) { - this.quantity = Input.optional(quantity); - return this; + public List getCheckoutUserErrors() { + return (List) get("checkoutUserErrors"); } - public CheckoutLineItemUpdateInput setQuantityInput(Input quantity) { - if (quantity == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.quantity = quantity; + public CheckoutCustomerDisassociateV2Payload setCheckoutUserErrors(List arg) { + optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } - public List getCustomAttributes() { - return customAttributes.getValue(); - } - - public Input> getCustomAttributesInput() { - return customAttributes; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead. + */ - public CheckoutLineItemUpdateInput setCustomAttributes(List customAttributes) { - this.customAttributes = Input.optional(customAttributes); - return this; + public List getUserErrors() { + return (List) get("userErrors"); } - public CheckoutLineItemUpdateInput setCustomAttributesInput(Input> customAttributes) { - if (customAttributes == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.customAttributes = customAttributes; + public CheckoutCustomerDisassociateV2Payload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - if (this.id.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("id:"); - if (id.getValue() != null) { - Query.appendQuotedString(_queryBuilder, id.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "checkout": return true; - if (this.variantId.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("variantId:"); - if (variantId.getValue() != null) { - Query.appendQuotedString(_queryBuilder, variantId.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + case "checkoutUserErrors": return true; - if (this.quantity.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("quantity:"); - if (quantity.getValue() != null) { - _queryBuilder.append(quantity.getValue()); - } else { - _queryBuilder.append("null"); - } - } + case "userErrors": return true; - 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"); - } + default: return false; } - - _queryBuilder.append('}'); } } - public interface CheckoutLineItemsAddPayloadQueryDefinition { - void define(CheckoutLineItemsAddPayloadQuery _queryBuilder); + public interface CheckoutDiscountCodeApplyV2PayloadQueryDefinition { + void define(CheckoutDiscountCodeApplyV2PayloadQuery _queryBuilder); } /** - * Return type for `checkoutLineItemsAdd` mutation. + * Return type for `checkoutDiscountCodeApplyV2` mutation. */ - public static class CheckoutLineItemsAddPayloadQuery extends Query { - CheckoutLineItemsAddPayloadQuery(StringBuilder _queryBuilder) { + public static class CheckoutDiscountCodeApplyV2PayloadQuery extends Query { + CheckoutDiscountCodeApplyV2PayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * The updated checkout object. */ - public CheckoutLineItemsAddPayloadQuery checkout(CheckoutQueryDefinition queryDef) { + public CheckoutDiscountCodeApplyV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { startField("checkout"); _queryBuilder.append('{'); @@ -15613,7 +16132,7 @@ public CheckoutLineItemsAddPayloadQuery checkout(CheckoutQueryDefinition queryDe /** * The list of errors that occurred from executing the mutation. */ - public CheckoutLineItemsAddPayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + public CheckoutDiscountCodeApplyV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { startField("checkoutUserErrors"); _queryBuilder.append('{'); @@ -15629,7 +16148,7 @@ public CheckoutLineItemsAddPayloadQuery checkoutUserErrors(CheckoutUserErrorQuer * @deprecated Use `checkoutUserErrors` instead. */ @Deprecated - public CheckoutLineItemsAddPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + public CheckoutDiscountCodeApplyV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { startField("userErrors"); _queryBuilder.append('{'); @@ -15641,13 +16160,13 @@ public CheckoutLineItemsAddPayloadQuery userErrors(UserErrorQueryDefinition quer } /** - * Return type for `checkoutLineItemsAdd` mutation. + * Return type for `checkoutDiscountCodeApplyV2` mutation. */ - public static class CheckoutLineItemsAddPayload extends AbstractResponse { - public CheckoutLineItemsAddPayload() { + public static class CheckoutDiscountCodeApplyV2Payload extends AbstractResponse { + public CheckoutDiscountCodeApplyV2Payload() { } - public CheckoutLineItemsAddPayload(JsonObject fields) throws SchemaViolationError { + public CheckoutDiscountCodeApplyV2Payload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -15697,7 +16216,7 @@ public CheckoutLineItemsAddPayload(JsonObject fields) throws SchemaViolationErro } public String getGraphQlTypeName() { - return "CheckoutLineItemsAddPayload"; + return "CheckoutDiscountCodeApplyV2Payload"; } /** @@ -15708,7 +16227,7 @@ public Checkout getCheckout() { return (Checkout) get("checkout"); } - public CheckoutLineItemsAddPayload setCheckout(Checkout arg) { + public CheckoutDiscountCodeApplyV2Payload setCheckout(Checkout arg) { optimisticData.put(getKey("checkout"), arg); return this; } @@ -15721,7 +16240,7 @@ public List getCheckoutUserErrors() { return (List) get("checkoutUserErrors"); } - public CheckoutLineItemsAddPayload setCheckoutUserErrors(List arg) { + public CheckoutDiscountCodeApplyV2Payload setCheckoutUserErrors(List arg) { optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } @@ -15736,7 +16255,7 @@ public List getUserErrors() { return (List) get("userErrors"); } - public CheckoutLineItemsAddPayload setUserErrors(List arg) { + public CheckoutDiscountCodeApplyV2Payload setUserErrors(List arg) { optimisticData.put(getKey("userErrors"), arg); return this; } @@ -15754,22 +16273,22 @@ public boolean unwrapsToObject(String key) { } } - public interface CheckoutLineItemsRemovePayloadQueryDefinition { - void define(CheckoutLineItemsRemovePayloadQuery _queryBuilder); + public interface CheckoutDiscountCodeRemovePayloadQueryDefinition { + void define(CheckoutDiscountCodeRemovePayloadQuery _queryBuilder); } /** - * Return type for `checkoutLineItemsRemove` mutation. + * Return type for `checkoutDiscountCodeRemove` mutation. */ - public static class CheckoutLineItemsRemovePayloadQuery extends Query { - CheckoutLineItemsRemovePayloadQuery(StringBuilder _queryBuilder) { + public static class CheckoutDiscountCodeRemovePayloadQuery extends Query { + CheckoutDiscountCodeRemovePayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * The updated checkout object. */ - public CheckoutLineItemsRemovePayloadQuery checkout(CheckoutQueryDefinition queryDef) { + public CheckoutDiscountCodeRemovePayloadQuery checkout(CheckoutQueryDefinition queryDef) { startField("checkout"); _queryBuilder.append('{'); @@ -15782,7 +16301,7 @@ public CheckoutLineItemsRemovePayloadQuery checkout(CheckoutQueryDefinition quer /** * The list of errors that occurred from executing the mutation. */ - public CheckoutLineItemsRemovePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + public CheckoutDiscountCodeRemovePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { startField("checkoutUserErrors"); _queryBuilder.append('{'); @@ -15798,7 +16317,7 @@ public CheckoutLineItemsRemovePayloadQuery checkoutUserErrors(CheckoutUserErrorQ * @deprecated Use `checkoutUserErrors` instead. */ @Deprecated - public CheckoutLineItemsRemovePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + public CheckoutDiscountCodeRemovePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { startField("userErrors"); _queryBuilder.append('{'); @@ -15810,13 +16329,13 @@ public CheckoutLineItemsRemovePayloadQuery userErrors(UserErrorQueryDefinition q } /** - * Return type for `checkoutLineItemsRemove` mutation. + * Return type for `checkoutDiscountCodeRemove` mutation. */ - public static class CheckoutLineItemsRemovePayload extends AbstractResponse { - public CheckoutLineItemsRemovePayload() { + public static class CheckoutDiscountCodeRemovePayload extends AbstractResponse { + public CheckoutDiscountCodeRemovePayload() { } - public CheckoutLineItemsRemovePayload(JsonObject fields) throws SchemaViolationError { + public CheckoutDiscountCodeRemovePayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -15866,7 +16385,7 @@ public CheckoutLineItemsRemovePayload(JsonObject fields) throws SchemaViolationE } public String getGraphQlTypeName() { - return "CheckoutLineItemsRemovePayload"; + return "CheckoutDiscountCodeRemovePayload"; } /** @@ -15877,7 +16396,7 @@ public Checkout getCheckout() { return (Checkout) get("checkout"); } - public CheckoutLineItemsRemovePayload setCheckout(Checkout arg) { + public CheckoutDiscountCodeRemovePayload setCheckout(Checkout arg) { optimisticData.put(getKey("checkout"), arg); return this; } @@ -15890,7 +16409,7 @@ public List getCheckoutUserErrors() { return (List) get("checkoutUserErrors"); } - public CheckoutLineItemsRemovePayload setCheckoutUserErrors(List arg) { + public CheckoutDiscountCodeRemovePayload setCheckoutUserErrors(List arg) { optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } @@ -15905,7 +16424,7 @@ public List getUserErrors() { return (List) get("userErrors"); } - public CheckoutLineItemsRemovePayload setUserErrors(List arg) { + public CheckoutDiscountCodeRemovePayload setUserErrors(List arg) { optimisticData.put(getKey("userErrors"), arg); return this; } @@ -15923,22 +16442,22 @@ public boolean unwrapsToObject(String key) { } } - public interface CheckoutLineItemsReplacePayloadQueryDefinition { - void define(CheckoutLineItemsReplacePayloadQuery _queryBuilder); + public interface CheckoutEmailUpdateV2PayloadQueryDefinition { + void define(CheckoutEmailUpdateV2PayloadQuery _queryBuilder); } /** - * Return type for `checkoutLineItemsReplace` mutation. + * Return type for `checkoutEmailUpdateV2` mutation. */ - public static class CheckoutLineItemsReplacePayloadQuery extends Query { - CheckoutLineItemsReplacePayloadQuery(StringBuilder _queryBuilder) { + public static class CheckoutEmailUpdateV2PayloadQuery extends Query { + CheckoutEmailUpdateV2PayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The updated checkout object. + * The checkout object with the updated email. */ - public CheckoutLineItemsReplacePayloadQuery checkout(CheckoutQueryDefinition queryDef) { + public CheckoutEmailUpdateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { startField("checkout"); _queryBuilder.append('{'); @@ -15951,8 +16470,8 @@ public CheckoutLineItemsReplacePayloadQuery checkout(CheckoutQueryDefinition que /** * The list of errors that occurred from executing the mutation. */ - public CheckoutLineItemsReplacePayloadQuery userErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("userErrors"); + public CheckoutEmailUpdateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + startField("checkoutUserErrors"); _queryBuilder.append('{'); queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); @@ -15960,16 +16479,32 @@ public CheckoutLineItemsReplacePayloadQuery userErrors(CheckoutUserErrorQueryDef return this; } + + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead. + */ + @Deprecated + public CheckoutEmailUpdateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); + + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } } /** - * Return type for `checkoutLineItemsReplace` mutation. + * Return type for `checkoutEmailUpdateV2` mutation. */ - public static class CheckoutLineItemsReplacePayload extends AbstractResponse { - public CheckoutLineItemsReplacePayload() { + public static class CheckoutEmailUpdateV2Payload extends AbstractResponse { + public CheckoutEmailUpdateV2Payload() { } - public CheckoutLineItemsReplacePayload(JsonObject fields) throws SchemaViolationError { + public CheckoutEmailUpdateV2Payload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -15985,7 +16520,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))); @@ -15996,6 +16531,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; @@ -16008,18 +16554,18 @@ public CheckoutLineItemsReplacePayload(JsonObject fields) throws SchemaViolation } public String getGraphQlTypeName() { - return "CheckoutLineItemsReplacePayload"; + return "CheckoutEmailUpdateV2Payload"; } /** - * The updated checkout object. + * The checkout object with the updated email. */ public Checkout getCheckout() { return (Checkout) get("checkout"); } - public CheckoutLineItemsReplacePayload setCheckout(Checkout arg) { + public CheckoutEmailUpdateV2Payload setCheckout(Checkout arg) { optimisticData.put(getKey("checkout"), arg); return this; } @@ -16028,11 +16574,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 CheckoutEmailUpdateV2Payload 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 CheckoutEmailUpdateV2Payload setUserErrors(List arg) { optimisticData.put(getKey("userErrors"), arg); return this; } @@ -16041,6 +16602,8 @@ public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "checkout": return true; + case "checkoutUserErrors": return true; + case "userErrors": return true; default: return false; @@ -16048,374 +16611,660 @@ public boolean unwrapsToObject(String key) { } } - public interface CheckoutLineItemsUpdatePayloadQueryDefinition { - void define(CheckoutLineItemsUpdatePayloadQuery _queryBuilder); - } - /** - * Return type for `checkoutLineItemsUpdate` mutation. + * Possible error codes that can be returned by `CheckoutUserError`. */ - public static class CheckoutLineItemsUpdatePayloadQuery extends Query { - CheckoutLineItemsUpdatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - + public enum CheckoutErrorCode { /** - * The updated checkout object. + * Checkout is already completed. */ - public CheckoutLineItemsUpdatePayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + ALREADY_COMPLETED, - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Input email contains an invalid domain name. + */ + BAD_DOMAIN, - return this; - } + /** + * The input value is blank. + */ + BLANK, /** - * The list of errors that occurred from executing the mutation. + * Cart does not meet discount requirements notice. */ - public CheckoutLineItemsUpdatePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE, - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Customer already used once per customer discount notice. + */ + CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE, - return this; - } + /** + * Discount already applied. + */ + DISCOUNT_ALREADY_APPLIED, /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * Discount code isn't working right now. Please contact us for help. */ - @Deprecated - public CheckoutLineItemsUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + DISCOUNT_CODE_APPLICATION_FAILED, - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Discount disabled. + */ + DISCOUNT_DISABLED, - return this; - } - } + /** + * Discount expired. + */ + DISCOUNT_EXPIRED, - /** - * Return type for `checkoutLineItemsUpdate` mutation. - */ - public static class CheckoutLineItemsUpdatePayload extends AbstractResponse { - public CheckoutLineItemsUpdatePayload() { - } + /** + * Discount limit reached. + */ + DISCOUNT_LIMIT_REACHED, - public CheckoutLineItemsUpdatePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } + /** + * Discount not found. + */ + DISCOUNT_NOT_FOUND, - responseData.put(key, optional1); + /** + * Checkout is already completed. + */ + EMPTY, - break; - } + /** + * Queue token has expired. + */ + EXPIRED_QUEUE_TOKEN, - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } + /** + * Gift card has already been applied. + */ + GIFT_CARD_ALREADY_APPLIED, - responseData.put(key, list1); + /** + * Gift card code is invalid. + */ + GIFT_CARD_CODE_INVALID, - break; - } + /** + * Gift card currency does not match checkout currency. + */ + GIFT_CARD_CURRENCY_MISMATCH, - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + /** + * Gift card has no funds left. + */ + GIFT_CARD_DEPLETED, - responseData.put(key, list1); + /** + * Gift card is disabled. + */ + GIFT_CARD_DISABLED, - break; - } + /** + * Gift card is expired. + */ + GIFT_CARD_EXPIRED, - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + /** + * Gift card was not found. + */ + GIFT_CARD_NOT_FOUND, - public String getGraphQlTypeName() { - return "CheckoutLineItemsUpdatePayload"; - } + /** + * Gift card cannot be applied to a checkout that contains a gift card. + */ + GIFT_CARD_UNUSABLE, /** - * The updated checkout object. + * The input value should be greater than or equal to the minimum value allowed. */ + GREATER_THAN_OR_EQUAL_TO, - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } + /** + * Higher value discount applied. + */ + HIGHER_VALUE_DISCOUNT_APPLIED, - public CheckoutLineItemsUpdatePayload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; - } + /** + * The input value is invalid. + */ + INVALID, /** - * The list of errors that occurred from executing the mutation. + * Cannot specify country and presentment currency code. */ + INVALID_COUNTRY_AND_CURRENCY, - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); - } + /** + * Input Zip is invalid for country provided. + */ + INVALID_FOR_COUNTRY, - public CheckoutLineItemsUpdatePayload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } + /** + * Input Zip is invalid for country and province provided. + */ + INVALID_FOR_COUNTRY_AND_PROVINCE, /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * Invalid province in country. */ + INVALID_PROVINCE_IN_COUNTRY, - public List getUserErrors() { - return (List) get("userErrors"); - } + /** + * Queue token is invalid. + */ + INVALID_QUEUE_TOKEN, - public CheckoutLineItemsUpdatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } + /** + * Invalid region in country. + */ + INVALID_REGION_IN_COUNTRY, - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + /** + * Invalid state in country. + */ + INVALID_STATE_IN_COUNTRY, - case "checkoutUserErrors": return true; + /** + * The input value should be less than the maximum value allowed. + */ + LESS_THAN, - case "userErrors": return true; + /** + * The input value should be less than or equal to the maximum value allowed. + */ + LESS_THAN_OR_EQUAL_TO, - default: return false; - } - } - } + /** + * Line item was not found in checkout. + */ + LINE_ITEM_NOT_FOUND, - public interface CheckoutShippingAddressUpdateV2PayloadQueryDefinition { - void define(CheckoutShippingAddressUpdateV2PayloadQuery _queryBuilder); - } + /** + * Checkout is locked. + */ + LOCKED, - /** - * Return type for `checkoutShippingAddressUpdateV2` mutation. - */ - public static class CheckoutShippingAddressUpdateV2PayloadQuery extends Query { - CheckoutShippingAddressUpdateV2PayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + /** + * Maximum number of discount codes limit reached. + */ + MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED, /** - * The updated checkout object. + * Missing payment input. */ - public CheckoutShippingAddressUpdateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + MISSING_PAYMENT_INPUT, - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Not enough in stock. + */ + NOT_ENOUGH_IN_STOCK, - return this; - } + /** + * Input value is not supported. + */ + NOT_SUPPORTED, /** - * The list of errors that occurred from executing the mutation. + * The input value needs to be blank. */ - public CheckoutShippingAddressUpdateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + PRESENT, - _queryBuilder.append('{'); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Product is not published for this customer. + */ + PRODUCT_NOT_AVAILABLE, - return this; - } + /** + * Shipping rate expired. + */ + SHIPPING_RATE_EXPIRED, /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. + * Throttled during checkout. */ - @Deprecated - public CheckoutShippingAddressUpdateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + THROTTLED_DURING_CHECKOUT, - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The input value is too long. + */ + TOO_LONG, - return this; - } - } + /** + * The amount of the payment does not match the value to be paid. + */ + TOTAL_PRICE_MISMATCH, - /** - * Return type for `checkoutShippingAddressUpdateV2` mutation. - */ - public static class CheckoutShippingAddressUpdateV2Payload extends AbstractResponse { - public CheckoutShippingAddressUpdateV2Payload() { - } + /** + * Unable to apply discount. + */ + UNABLE_TO_APPLY, - public CheckoutShippingAddressUpdateV2Payload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "checkout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } + UNKNOWN_VALUE; - responseData.put(key, optional1); + public static CheckoutErrorCode fromGraphQl(String value) { + if (value == null) { + return null; + } - break; - } + switch (value) { + case "ALREADY_COMPLETED": { + return ALREADY_COMPLETED; + } - case "checkoutUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CheckoutUserError(jsonAsObject(element1, key))); - } + case "BAD_DOMAIN": { + return BAD_DOMAIN; + } - responseData.put(key, list1); + case "BLANK": { + return BLANK; + } - break; - } + case "CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE": { + return CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE; + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + case "CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE": { + return CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE; + } - responseData.put(key, list1); + case "DISCOUNT_ALREADY_APPLIED": { + return DISCOUNT_ALREADY_APPLIED; + } - break; - } + case "DISCOUNT_CODE_APPLICATION_FAILED": { + return DISCOUNT_CODE_APPLICATION_FAILED; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "DISCOUNT_DISABLED": { + return DISCOUNT_DISABLED; } - } - } - public String getGraphQlTypeName() { - return "CheckoutShippingAddressUpdateV2Payload"; - } + case "DISCOUNT_EXPIRED": { + return DISCOUNT_EXPIRED; + } - /** - * The updated checkout object. - */ + case "DISCOUNT_LIMIT_REACHED": { + return DISCOUNT_LIMIT_REACHED; + } - public Checkout getCheckout() { - return (Checkout) get("checkout"); - } + case "DISCOUNT_NOT_FOUND": { + return DISCOUNT_NOT_FOUND; + } - public CheckoutShippingAddressUpdateV2Payload setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); - return this; - } + case "EMPTY": { + return EMPTY; + } - /** - * The list of errors that occurred from executing the mutation. - */ + case "EXPIRED_QUEUE_TOKEN": { + return EXPIRED_QUEUE_TOKEN; + } - public List getCheckoutUserErrors() { - return (List) get("checkoutUserErrors"); - } + case "GIFT_CARD_ALREADY_APPLIED": { + return GIFT_CARD_ALREADY_APPLIED; + } - public CheckoutShippingAddressUpdateV2Payload setCheckoutUserErrors(List arg) { - optimisticData.put(getKey("checkoutUserErrors"), arg); - return this; - } + case "GIFT_CARD_CODE_INVALID": { + return GIFT_CARD_CODE_INVALID; + } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `checkoutUserErrors` instead. - */ + case "GIFT_CARD_CURRENCY_MISMATCH": { + return GIFT_CARD_CURRENCY_MISMATCH; + } - public List getUserErrors() { - return (List) get("userErrors"); - } + case "GIFT_CARD_DEPLETED": { + return GIFT_CARD_DEPLETED; + } - public CheckoutShippingAddressUpdateV2Payload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } + case "GIFT_CARD_DISABLED": { + return GIFT_CARD_DISABLED; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "checkout": return true; + case "GIFT_CARD_EXPIRED": { + return GIFT_CARD_EXPIRED; + } - case "checkoutUserErrors": return true; + case "GIFT_CARD_NOT_FOUND": { + return GIFT_CARD_NOT_FOUND; + } - case "userErrors": return true; + case "GIFT_CARD_UNUSABLE": { + return GIFT_CARD_UNUSABLE; + } - default: return false; - } - } - } + case "GREATER_THAN_OR_EQUAL_TO": { + return GREATER_THAN_OR_EQUAL_TO; + } - public interface CheckoutShippingLineUpdatePayloadQueryDefinition { - void define(CheckoutShippingLineUpdatePayloadQuery _queryBuilder); - } + case "HIGHER_VALUE_DISCOUNT_APPLIED": { + return HIGHER_VALUE_DISCOUNT_APPLIED; + } - /** - * Return type for `checkoutShippingLineUpdate` mutation. - */ - public static class CheckoutShippingLineUpdatePayloadQuery extends Query { - CheckoutShippingLineUpdatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "INVALID": { + return INVALID; + } - /** - * The updated checkout object. - */ - public CheckoutShippingLineUpdatePayloadQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); + case "INVALID_COUNTRY_AND_CURRENCY": { + return INVALID_COUNTRY_AND_CURRENCY; + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "INVALID_FOR_COUNTRY": { + return INVALID_FOR_COUNTRY; + } - return this; - } + case "INVALID_FOR_COUNTRY_AND_PROVINCE": { + return INVALID_FOR_COUNTRY_AND_PROVINCE; + } - /** - * The list of errors that occurred from executing the mutation. - */ - public CheckoutShippingLineUpdatePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { - startField("checkoutUserErrors"); + case "INVALID_PROVINCE_IN_COUNTRY": { + return INVALID_PROVINCE_IN_COUNTRY; + } + + case "INVALID_QUEUE_TOKEN": { + return INVALID_QUEUE_TOKEN; + } + + case "INVALID_REGION_IN_COUNTRY": { + return INVALID_REGION_IN_COUNTRY; + } + + case "INVALID_STATE_IN_COUNTRY": { + return INVALID_STATE_IN_COUNTRY; + } + + case "LESS_THAN": { + return LESS_THAN; + } + + case "LESS_THAN_OR_EQUAL_TO": { + return LESS_THAN_OR_EQUAL_TO; + } + + case "LINE_ITEM_NOT_FOUND": { + return LINE_ITEM_NOT_FOUND; + } + + case "LOCKED": { + return LOCKED; + } + + case "MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED": { + return MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED; + } + + case "MISSING_PAYMENT_INPUT": { + return MISSING_PAYMENT_INPUT; + } + + case "NOT_ENOUGH_IN_STOCK": { + return NOT_ENOUGH_IN_STOCK; + } + + case "NOT_SUPPORTED": { + return NOT_SUPPORTED; + } + + case "PRESENT": { + return PRESENT; + } + + case "PRODUCT_NOT_AVAILABLE": { + return PRODUCT_NOT_AVAILABLE; + } + + case "SHIPPING_RATE_EXPIRED": { + return SHIPPING_RATE_EXPIRED; + } + + case "THROTTLED_DURING_CHECKOUT": { + return THROTTLED_DURING_CHECKOUT; + } + + case "TOO_LONG": { + return TOO_LONG; + } + + case "TOTAL_PRICE_MISMATCH": { + return TOTAL_PRICE_MISMATCH; + } + + case "UNABLE_TO_APPLY": { + return UNABLE_TO_APPLY; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case ALREADY_COMPLETED: { + return "ALREADY_COMPLETED"; + } + + case BAD_DOMAIN: { + return "BAD_DOMAIN"; + } + + case BLANK: { + return "BLANK"; + } + + case CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE: { + return "CART_DOES_NOT_MEET_DISCOUNT_REQUIREMENTS_NOTICE"; + } + + case CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE: { + return "CUSTOMER_ALREADY_USED_ONCE_PER_CUSTOMER_DISCOUNT_NOTICE"; + } + + case DISCOUNT_ALREADY_APPLIED: { + return "DISCOUNT_ALREADY_APPLIED"; + } + + case DISCOUNT_CODE_APPLICATION_FAILED: { + return "DISCOUNT_CODE_APPLICATION_FAILED"; + } + + case DISCOUNT_DISABLED: { + return "DISCOUNT_DISABLED"; + } + + case DISCOUNT_EXPIRED: { + return "DISCOUNT_EXPIRED"; + } + + case DISCOUNT_LIMIT_REACHED: { + return "DISCOUNT_LIMIT_REACHED"; + } + + case DISCOUNT_NOT_FOUND: { + return "DISCOUNT_NOT_FOUND"; + } + + case EMPTY: { + return "EMPTY"; + } + + case EXPIRED_QUEUE_TOKEN: { + return "EXPIRED_QUEUE_TOKEN"; + } + + case GIFT_CARD_ALREADY_APPLIED: { + return "GIFT_CARD_ALREADY_APPLIED"; + } + + case GIFT_CARD_CODE_INVALID: { + return "GIFT_CARD_CODE_INVALID"; + } + + case GIFT_CARD_CURRENCY_MISMATCH: { + return "GIFT_CARD_CURRENCY_MISMATCH"; + } + + case GIFT_CARD_DEPLETED: { + return "GIFT_CARD_DEPLETED"; + } + + case GIFT_CARD_DISABLED: { + return "GIFT_CARD_DISABLED"; + } + + case GIFT_CARD_EXPIRED: { + return "GIFT_CARD_EXPIRED"; + } + + case GIFT_CARD_NOT_FOUND: { + return "GIFT_CARD_NOT_FOUND"; + } + + case GIFT_CARD_UNUSABLE: { + return "GIFT_CARD_UNUSABLE"; + } + + case GREATER_THAN_OR_EQUAL_TO: { + return "GREATER_THAN_OR_EQUAL_TO"; + } + + case HIGHER_VALUE_DISCOUNT_APPLIED: { + return "HIGHER_VALUE_DISCOUNT_APPLIED"; + } + + case INVALID: { + return "INVALID"; + } + + case INVALID_COUNTRY_AND_CURRENCY: { + return "INVALID_COUNTRY_AND_CURRENCY"; + } + + case INVALID_FOR_COUNTRY: { + return "INVALID_FOR_COUNTRY"; + } + + case INVALID_FOR_COUNTRY_AND_PROVINCE: { + return "INVALID_FOR_COUNTRY_AND_PROVINCE"; + } + + case INVALID_PROVINCE_IN_COUNTRY: { + return "INVALID_PROVINCE_IN_COUNTRY"; + } + + case INVALID_QUEUE_TOKEN: { + return "INVALID_QUEUE_TOKEN"; + } + + case INVALID_REGION_IN_COUNTRY: { + return "INVALID_REGION_IN_COUNTRY"; + } + + case INVALID_STATE_IN_COUNTRY: { + return "INVALID_STATE_IN_COUNTRY"; + } + + case LESS_THAN: { + return "LESS_THAN"; + } + + case LESS_THAN_OR_EQUAL_TO: { + return "LESS_THAN_OR_EQUAL_TO"; + } + + case LINE_ITEM_NOT_FOUND: { + return "LINE_ITEM_NOT_FOUND"; + } + + case LOCKED: { + return "LOCKED"; + } + + case MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED: { + return "MAXIMUM_DISCOUNT_CODE_LIMIT_REACHED"; + } + + case MISSING_PAYMENT_INPUT: { + return "MISSING_PAYMENT_INPUT"; + } + + case NOT_ENOUGH_IN_STOCK: { + return "NOT_ENOUGH_IN_STOCK"; + } + + case NOT_SUPPORTED: { + return "NOT_SUPPORTED"; + } + + case PRESENT: { + return "PRESENT"; + } + + case PRODUCT_NOT_AVAILABLE: { + return "PRODUCT_NOT_AVAILABLE"; + } + + case SHIPPING_RATE_EXPIRED: { + return "SHIPPING_RATE_EXPIRED"; + } + + case THROTTLED_DURING_CHECKOUT: { + return "THROTTLED_DURING_CHECKOUT"; + } + + case TOO_LONG: { + return "TOO_LONG"; + } + + case TOTAL_PRICE_MISMATCH: { + return "TOTAL_PRICE_MISMATCH"; + } + + case UNABLE_TO_APPLY: { + return "UNABLE_TO_APPLY"; + } + + default: { + return ""; + } + } + } + } + + public interface CheckoutGiftCardRemoveV2PayloadQueryDefinition { + void define(CheckoutGiftCardRemoveV2PayloadQuery _queryBuilder); + } + + /** + * Return type for `checkoutGiftCardRemoveV2` mutation. + */ + public static class CheckoutGiftCardRemoveV2PayloadQuery extends Query { + CheckoutGiftCardRemoveV2PayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The updated checkout object. + */ + public CheckoutGiftCardRemoveV2PayloadQuery 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 CheckoutGiftCardRemoveV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + startField("checkoutUserErrors"); _queryBuilder.append('{'); queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); @@ -16430,7 +17279,7 @@ public CheckoutShippingLineUpdatePayloadQuery checkoutUserErrors(CheckoutUserErr * @deprecated Use `checkoutUserErrors` instead. */ @Deprecated - public CheckoutShippingLineUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + public CheckoutGiftCardRemoveV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { startField("userErrors"); _queryBuilder.append('{'); @@ -16442,13 +17291,13 @@ public CheckoutShippingLineUpdatePayloadQuery userErrors(UserErrorQueryDefinitio } /** - * Return type for `checkoutShippingLineUpdate` mutation. + * Return type for `checkoutGiftCardRemoveV2` mutation. */ - public static class CheckoutShippingLineUpdatePayload extends AbstractResponse { - public CheckoutShippingLineUpdatePayload() { + public static class CheckoutGiftCardRemoveV2Payload extends AbstractResponse { + public CheckoutGiftCardRemoveV2Payload() { } - public CheckoutShippingLineUpdatePayload(JsonObject fields) throws SchemaViolationError { + public CheckoutGiftCardRemoveV2Payload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -16498,7 +17347,7 @@ public CheckoutShippingLineUpdatePayload(JsonObject fields) throws SchemaViolati } public String getGraphQlTypeName() { - return "CheckoutShippingLineUpdatePayload"; + return "CheckoutGiftCardRemoveV2Payload"; } /** @@ -16509,7 +17358,7 @@ public Checkout getCheckout() { return (Checkout) get("checkout"); } - public CheckoutShippingLineUpdatePayload setCheckout(Checkout arg) { + public CheckoutGiftCardRemoveV2Payload setCheckout(Checkout arg) { optimisticData.put(getKey("checkout"), arg); return this; } @@ -16522,7 +17371,7 @@ public List getCheckoutUserErrors() { return (List) get("checkoutUserErrors"); } - public CheckoutShippingLineUpdatePayload setCheckoutUserErrors(List arg) { + public CheckoutGiftCardRemoveV2Payload setCheckoutUserErrors(List arg) { optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } @@ -16537,7 +17386,7 @@ public List getUserErrors() { return (List) get("userErrors"); } - public CheckoutShippingLineUpdatePayload setUserErrors(List arg) { + public CheckoutGiftCardRemoveV2Payload setUserErrors(List arg) { optimisticData.put(getKey("userErrors"), arg); return this; } @@ -16555,62 +17404,77 @@ public boolean unwrapsToObject(String key) { } } - public interface CheckoutUserErrorQueryDefinition { - void define(CheckoutUserErrorQuery _queryBuilder); + public interface CheckoutGiftCardsAppendPayloadQueryDefinition { + void define(CheckoutGiftCardsAppendPayloadQuery _queryBuilder); } /** - * Represents an error that happens during execution of a checkout mutation. + * Return type for `checkoutGiftCardsAppend` mutation. */ - public static class CheckoutUserErrorQuery extends Query { - CheckoutUserErrorQuery(StringBuilder _queryBuilder) { + public static class CheckoutGiftCardsAppendPayloadQuery extends Query { + CheckoutGiftCardsAppendPayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The error code. + * The updated checkout object. */ - public CheckoutUserErrorQuery code() { - startField("code"); + public CheckoutGiftCardsAppendPayloadQuery checkout(CheckoutQueryDefinition queryDef) { + startField("checkout"); + + _queryBuilder.append('{'); + queryDef.define(new CheckoutQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The path to the input field that caused the error. + * The list of errors that occurred from executing the mutation. */ - public CheckoutUserErrorQuery field() { - startField("field"); + public CheckoutGiftCardsAppendPayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + startField("checkoutUserErrors"); + + _queryBuilder.append('{'); + queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The error message. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead. */ - public CheckoutUserErrorQuery message() { - startField("message"); + @Deprecated + public CheckoutGiftCardsAppendPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); + + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * Represents an error that happens during execution of a checkout mutation. + * Return type for `checkoutGiftCardsAppend` mutation. */ - public static class CheckoutUserError extends AbstractResponse implements DisplayableError { - public CheckoutUserError() { + public static class CheckoutGiftCardsAppendPayload extends AbstractResponse { + public CheckoutGiftCardsAppendPayload() { } - public CheckoutUserError(JsonObject fields) throws SchemaViolationError { + public CheckoutGiftCardsAppendPayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "code": { - CheckoutErrorCode optional1 = null; + case "checkout": { + Checkout optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = CheckoutErrorCode.fromGraphQl(jsonAsString(field.getValue(), key)); + optional1 = new Checkout(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -16618,24 +17482,24 @@ public CheckoutUserError(JsonObject fields) throws SchemaViolationError { break; } - case "field": { - List optional1 = null; - if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } - - optional1 = list1; + case "checkoutUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CheckoutUserError(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "message": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } @@ -16652,386 +17516,178 @@ public CheckoutUserError(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CheckoutUserError"; + return "CheckoutGiftCardsAppendPayload"; } /** - * The error code. + * The updated checkout object. */ - public CheckoutErrorCode getCode() { - return (CheckoutErrorCode) get("code"); + public Checkout getCheckout() { + return (Checkout) get("checkout"); } - public CheckoutUserError setCode(CheckoutErrorCode arg) { - optimisticData.put(getKey("code"), arg); + public CheckoutGiftCardsAppendPayload setCheckout(Checkout arg) { + optimisticData.put(getKey("checkout"), arg); return this; } /** - * The path to the input field that caused the error. + * The list of errors that occurred from executing the mutation. */ - public List getField() { - return (List) get("field"); + public List getCheckoutUserErrors() { + return (List) get("checkoutUserErrors"); } - public CheckoutUserError setField(List arg) { - optimisticData.put(getKey("field"), arg); + public CheckoutGiftCardsAppendPayload setCheckoutUserErrors(List arg) { + optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } /** - * The error message. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead. */ - public String getMessage() { - return (String) get("message"); + public List getUserErrors() { + return (List) get("userErrors"); } - public CheckoutUserError setMessage(String arg) { - optimisticData.put(getKey("message"), arg); + public CheckoutGiftCardsAppendPayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "code": return false; + case "checkout": return true; - case "field": return false; + case "checkoutUserErrors": return true; - case "message": return false; + case "userErrors": return true; default: return false; } } } - public interface CollectionQueryDefinition { - void define(CollectionQuery _queryBuilder); + public interface CheckoutLineItemQueryDefinition { + void define(CheckoutLineItemQuery _queryBuilder); } /** - * A collection represents a grouping of products that a shop owner can create to organize them or make - * their shops easier to browse. + * A single line item in the checkout, grouped by variant and attributes. */ - public static class CollectionQuery extends Query { - CollectionQuery(StringBuilder _queryBuilder) { + public static class CheckoutLineItemQuery extends Query { + CheckoutLineItemQuery(StringBuilder _queryBuilder) { super(_queryBuilder); startField("id"); } - public class DescriptionArguments extends Arguments { - DescriptionArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Truncates string after the given length. - */ - public DescriptionArguments truncateAt(Integer value) { - if (value != null) { - startArgument("truncateAt"); - _queryBuilder.append(value); - } - return this; - } - } - - public interface DescriptionArgumentsDefinition { - void define(DescriptionArguments args); - } - /** - * Stripped description of the collection, single line with HTML tags removed. + * Extra information in the form of an array of Key-Value pairs about the line item. */ - public CollectionQuery description() { - return description(args -> {}); + public CheckoutLineItemQuery customAttributes(AttributeQueryDefinition queryDef) { + startField("customAttributes"); + + _queryBuilder.append('{'); + queryDef.define(new AttributeQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * Stripped description of the collection, single line with HTML tags removed. + * The discounts that have been allocated onto the checkout line item by discount applications. */ - public CollectionQuery description(DescriptionArgumentsDefinition argsDef) { - startField("description"); + public CheckoutLineItemQuery discountAllocations(DiscountAllocationQueryDefinition queryDef) { + startField("discountAllocations"); - DescriptionArguments args = new DescriptionArguments(_queryBuilder); - argsDef.define(args); - DescriptionArguments.end(args); + _queryBuilder.append('{'); + queryDef.define(new DiscountAllocationQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The description of the collection, complete with HTML formatting. + * The quantity of the line item. */ - public CollectionQuery descriptionHtml() { - startField("descriptionHtml"); + public CheckoutLineItemQuery quantity() { + startField("quantity"); return this; } /** - * A human-friendly unique string for the collection automatically generated from its title. - * Limit of 255 characters. + * Title of the line item. Defaults to the product's title. */ - public CollectionQuery handle() { - startField("handle"); + public CheckoutLineItemQuery title() { + startField("title"); return this; } /** - * Image associated with the collection. + * Unit price of the line item. */ - public CollectionQuery image(ImageQueryDefinition queryDef) { - startField("image"); - - _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * Returns a metafield found by namespace and key. - */ - public CollectionQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { - startField("metafield"); - - _queryBuilder.append("(namespace:"); - Query.appendQuotedString(_queryBuilder, namespace.toString()); - - _queryBuilder.append(",key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ - public CollectionQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); - - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. - */ - public CollectionQuery onlineStoreUrl() { - startField("onlineStoreUrl"); - - return this; - } - - public class ProductsArguments extends Arguments { - ProductsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public ProductsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public ProductsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the last `n` elements from the list. - */ - public ProductsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public ProductsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Reverse the order of the underlying list. - */ - public ProductsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Sort the underlying list by the given key. - */ - public ProductsArguments sortKey(ProductCollectionSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; - } - - /** - * Returns a subset of products matching all product filters. - */ - public ProductsArguments filters(List value) { - if (value != null) { - startArgument("filters"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (ProductFilter item1 : value) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - } - return this; - } - } - - public interface ProductsArgumentsDefinition { - void define(ProductsArguments args); - } - - /** - * List of products in the collection. - */ - public CollectionQuery products(ProductConnectionQueryDefinition queryDef) { - return products(args -> {}, queryDef); - } - - /** - * List of products in the collection. - */ - public CollectionQuery products(ProductsArgumentsDefinition argsDef, ProductConnectionQueryDefinition queryDef) { - startField("products"); - - ProductsArguments args = new ProductsArguments(_queryBuilder); - argsDef.define(args); - ProductsArguments.end(args); + public CheckoutLineItemQuery unitPrice(MoneyV2QueryDefinition queryDef) { + startField("unitPrice"); _queryBuilder.append('{'); - queryDef.define(new ProductConnectionQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The collection's SEO information. + * Product variant of the line item. */ - public CollectionQuery seo(SEOQueryDefinition queryDef) { - startField("seo"); + public CheckoutLineItemQuery variant(ProductVariantQueryDefinition queryDef) { + startField("variant"); _queryBuilder.append('{'); - queryDef.define(new SEOQuery(_queryBuilder)); + queryDef.define(new ProductVariantQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - - /** - * The collection’s name. Limit of 255 characters. - */ - public CollectionQuery title() { - startField("title"); - - return this; - } - - /** - * The date and time when the collection was last modified. - */ - public CollectionQuery updatedAt() { - startField("updatedAt"); - - return this; - } } /** - * A collection represents a grouping of products that a shop owner can create to organize them or make - * their shops easier to browse. + * A single line item in the checkout, grouped by variant and attributes. */ - public static class Collection extends AbstractResponse implements HasMetafields, MetafieldParentResource, MetafieldReference, Node, OnlineStorePublishable { - public Collection() { + public static class CheckoutLineItem extends AbstractResponse implements Node { + public CheckoutLineItem() { } - public Collection(JsonObject fields) throws SchemaViolationError { + public CheckoutLineItem(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "description": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } + case "customAttributes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Attribute(jsonAsObject(element1, key))); + } - case "descriptionHtml": { - responseData.put(key, jsonAsString(field.getValue(), key)); + responseData.put(key, list1); break; } - case "handle": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "discountAllocations": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new DiscountAllocation(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } @@ -17042,48 +17698,33 @@ public Collection(JsonObject fields) throws SchemaViolationError { break; } - case "image": { - Image optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "quantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); break; } - case "metafield": { - Metafield optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "metafields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } - - list1.add(optional2); + case "unitPrice": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "onlineStoreUrl": { - String optional1 = null; + case "variant": { + ProductVariant optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new ProductVariant(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -17091,30 +17732,6 @@ public Collection(JsonObject fields) throws SchemaViolationError { break; } - case "products": { - responseData.put(key, new ProductConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "seo": { - responseData.put(key, new SEO(jsonAsObject(field.getValue(), key))); - - break; - } - - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "updatedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - - break; - } - case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -17126,52 +17743,38 @@ public Collection(JsonObject fields) throws SchemaViolationError { } } - public Collection(ID id) { + public CheckoutLineItem(ID id) { this(); optimisticData.put("id", id); } public String getGraphQlTypeName() { - return "Collection"; - } - - /** - * Stripped description of the collection, single line with HTML tags removed. - */ - - public String getDescription() { - return (String) get("description"); - } - - public Collection setDescription(String arg) { - optimisticData.put(getKey("description"), arg); - return this; + return "CheckoutLineItem"; } /** - * The description of the collection, complete with HTML formatting. + * Extra information in the form of an array of Key-Value pairs about the line item. */ - public String getDescriptionHtml() { - return (String) get("descriptionHtml"); + public List getCustomAttributes() { + return (List) get("customAttributes"); } - public Collection setDescriptionHtml(String arg) { - optimisticData.put(getKey("descriptionHtml"), arg); + public CheckoutLineItem setCustomAttributes(List arg) { + optimisticData.put(getKey("customAttributes"), arg); return this; } /** - * A human-friendly unique string for the collection automatically generated from its title. - * Limit of 255 characters. + * The discounts that have been allocated onto the checkout line item by discount applications. */ - public String getHandle() { - return (String) get("handle"); + public List getDiscountAllocations() { + return (List) get("discountAllocations"); } - public Collection setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); + public CheckoutLineItem setDiscountAllocations(List arg) { + optimisticData.put(getKey("discountAllocations"), arg); return this; } @@ -17184,174 +17787,111 @@ public ID getId() { } /** - * Image associated with the collection. - */ - - public Image getImage() { - return (Image) get("image"); - } - - public Collection setImage(Image arg) { - optimisticData.put(getKey("image"), arg); - return this; - } - - /** - * Returns a metafield found by namespace and key. - */ - - public Metafield getMetafield() { - return (Metafield) get("metafield"); - } - - public Collection setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); - return this; - } - - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ - - public List getMetafields() { - return (List) get("metafields"); - } - - public Collection setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); - return this; - } - - /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. - */ - - public String getOnlineStoreUrl() { - return (String) get("onlineStoreUrl"); - } - - public Collection setOnlineStoreUrl(String arg) { - optimisticData.put(getKey("onlineStoreUrl"), arg); - return this; - } - - /** - * List of products in the collection. + * The quantity of the line item. */ - public ProductConnection getProducts() { - return (ProductConnection) get("products"); + public Integer getQuantity() { + return (Integer) get("quantity"); } - public Collection setProducts(ProductConnection arg) { - optimisticData.put(getKey("products"), arg); + public CheckoutLineItem setQuantity(Integer arg) { + optimisticData.put(getKey("quantity"), arg); return this; } /** - * The collection's SEO information. + * Title of the line item. Defaults to the product's title. */ - public SEO getSeo() { - return (SEO) get("seo"); + public String getTitle() { + return (String) get("title"); } - public Collection setSeo(SEO arg) { - optimisticData.put(getKey("seo"), arg); + public CheckoutLineItem setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } /** - * The collection’s name. Limit of 255 characters. + * Unit price of the line item. */ - public String getTitle() { - return (String) get("title"); + public MoneyV2 getUnitPrice() { + return (MoneyV2) get("unitPrice"); } - public Collection setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public CheckoutLineItem setUnitPrice(MoneyV2 arg) { + optimisticData.put(getKey("unitPrice"), arg); return this; } /** - * The date and time when the collection was last modified. + * Product variant of the line item. */ - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); + public ProductVariant getVariant() { + return (ProductVariant) get("variant"); } - public Collection setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); + public CheckoutLineItem setVariant(ProductVariant arg) { + optimisticData.put(getKey("variant"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "description": return false; - - case "descriptionHtml": return false; + case "customAttributes": return true; - case "handle": return false; + case "discountAllocations": return true; case "id": return false; - case "image": return true; - - case "metafield": return true; - - case "metafields": return true; - - case "onlineStoreUrl": return false; - - case "products": return true; - - case "seo": return true; + case "quantity": return false; case "title": return false; - case "updatedAt": return false; + case "unitPrice": return true; + + case "variant": return true; default: return false; } } } - public interface CollectionConnectionQueryDefinition { - void define(CollectionConnectionQuery _queryBuilder); + public interface CheckoutLineItemConnectionQueryDefinition { + void define(CheckoutLineItemConnectionQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple Collections. + * An auto-generated type for paginating through multiple CheckoutLineItems. */ - public static class CollectionConnectionQuery extends Query { - CollectionConnectionQuery(StringBuilder _queryBuilder) { + public static class CheckoutLineItemConnectionQuery extends Query { + CheckoutLineItemConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A list of edges. */ - public CollectionConnectionQuery edges(CollectionEdgeQueryDefinition queryDef) { + public CheckoutLineItemConnectionQuery edges(CheckoutLineItemEdgeQueryDefinition queryDef) { startField("edges"); _queryBuilder.append('{'); - queryDef.define(new CollectionEdgeQuery(_queryBuilder)); + queryDef.define(new CheckoutLineItemEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in CollectionEdge. + * A list of the nodes contained in CheckoutLineItemEdge. */ - public CollectionConnectionQuery nodes(CollectionQueryDefinition queryDef) { + public CheckoutLineItemConnectionQuery nodes(CheckoutLineItemQueryDefinition queryDef) { startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new CollectionQuery(_queryBuilder)); + queryDef.define(new CheckoutLineItemQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -17360,7 +17900,7 @@ public CollectionConnectionQuery nodes(CollectionQueryDefinition queryDef) { /** * Information to aid in pagination. */ - public CollectionConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + public CheckoutLineItemConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { startField("pageInfo"); _queryBuilder.append('{'); @@ -17372,21 +17912,21 @@ public CollectionConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { } /** - * An auto-generated type for paginating through multiple Collections. + * An auto-generated type for paginating through multiple CheckoutLineItems. */ - public static class CollectionConnection extends AbstractResponse { - public CollectionConnection() { + public static class CheckoutLineItemConnection extends AbstractResponse { + public CheckoutLineItemConnection() { } - public CollectionConnection(JsonObject fields) throws SchemaViolationError { + public CheckoutLineItemConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { case "edges": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CollectionEdge(jsonAsObject(element1, key))); + list1.add(new CheckoutLineItemEdge(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -17395,9 +17935,9 @@ public CollectionConnection(JsonObject fields) throws SchemaViolationError { } case "nodes": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Collection(jsonAsObject(element1, key))); + list1.add(new CheckoutLineItem(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -17423,31 +17963,31 @@ public CollectionConnection(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CollectionConnection"; + return "CheckoutLineItemConnection"; } /** * A list of edges. */ - public List getEdges() { - return (List) get("edges"); + public List getEdges() { + return (List) get("edges"); } - public CollectionConnection setEdges(List arg) { + public CheckoutLineItemConnection setEdges(List arg) { optimisticData.put(getKey("edges"), arg); return this; } /** - * A list of the nodes contained in CollectionEdge. + * A list of the nodes contained in CheckoutLineItemEdge. */ - public List getNodes() { - return (List) get("nodes"); + public List getNodes() { + return (List) get("nodes"); } - public CollectionConnection setNodes(List arg) { + public CheckoutLineItemConnection setNodes(List arg) { optimisticData.put(getKey("nodes"), arg); return this; } @@ -17460,7 +18000,7 @@ public PageInfo getPageInfo() { return (PageInfo) get("pageInfo"); } - public CollectionConnection setPageInfo(PageInfo arg) { + public CheckoutLineItemConnection setPageInfo(PageInfo arg) { optimisticData.put(getKey("pageInfo"), arg); return this; } @@ -17478,35 +18018,35 @@ public boolean unwrapsToObject(String key) { } } - public interface CollectionEdgeQueryDefinition { - void define(CollectionEdgeQuery _queryBuilder); + public interface CheckoutLineItemEdgeQueryDefinition { + void define(CheckoutLineItemEdgeQuery _queryBuilder); } /** - * An auto-generated type which holds one Collection and a cursor during pagination. + * An auto-generated type which holds one CheckoutLineItem and a cursor during pagination. */ - public static class CollectionEdgeQuery extends Query { - CollectionEdgeQuery(StringBuilder _queryBuilder) { + public static class CheckoutLineItemEdgeQuery extends Query { + CheckoutLineItemEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A cursor for use in pagination. */ - public CollectionEdgeQuery cursor() { + public CheckoutLineItemEdgeQuery cursor() { startField("cursor"); return this; } /** - * The item at the end of CollectionEdge. + * The item at the end of CheckoutLineItemEdge. */ - public CollectionEdgeQuery node(CollectionQueryDefinition queryDef) { + public CheckoutLineItemEdgeQuery node(CheckoutLineItemQueryDefinition queryDef) { startField("node"); _queryBuilder.append('{'); - queryDef.define(new CollectionQuery(_queryBuilder)); + queryDef.define(new CheckoutLineItemQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -17514,13 +18054,13 @@ public CollectionEdgeQuery node(CollectionQueryDefinition queryDef) { } /** - * An auto-generated type which holds one Collection and a cursor during pagination. + * An auto-generated type which holds one CheckoutLineItem and a cursor during pagination. */ - public static class CollectionEdge extends AbstractResponse { - public CollectionEdge() { + public static class CheckoutLineItemEdge extends AbstractResponse { + public CheckoutLineItemEdge() { } - public CollectionEdge(JsonObject fields) throws SchemaViolationError { + public CheckoutLineItemEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -17532,7 +18072,7 @@ public CollectionEdge(JsonObject fields) throws SchemaViolationError { } case "node": { - responseData.put(key, new Collection(jsonAsObject(field.getValue(), key))); + responseData.put(key, new CheckoutLineItem(jsonAsObject(field.getValue(), key))); break; } @@ -17549,7 +18089,7 @@ public CollectionEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CollectionEdge"; + return "CheckoutLineItemEdge"; } /** @@ -17560,20 +18100,20 @@ public String getCursor() { return (String) get("cursor"); } - public CollectionEdge setCursor(String arg) { + public CheckoutLineItemEdge setCursor(String arg) { optimisticData.put(getKey("cursor"), arg); return this; } /** - * The item at the end of CollectionEdge. + * The item at the end of CheckoutLineItemEdge. */ - public Collection getNode() { - return (Collection) get("node"); + public CheckoutLineItem getNode() { + return (CheckoutLineItem) get("node"); } - public CollectionEdge setNode(Collection arg) { + public CheckoutLineItemEdge setNode(CheckoutLineItem arg) { optimisticData.put(getKey("node"), arg); return this; } @@ -17589,195 +18129,346 @@ public boolean unwrapsToObject(String key) { } } - /** - * The set of valid sort keys for the Collection query. - */ - public enum CollectionSortKeys { - /** - * Sort by the `id` value. - */ - ID, + public static class CheckoutLineItemInput implements Serializable { + private int quantity; - /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. - */ - RELEVANCE, + private ID variantId; - /** - * Sort by the `title` value. - */ - TITLE, + private Input> customAttributes = Input.undefined(); - /** - * Sort by the `updated_at` value. - */ - UPDATED_AT, + public CheckoutLineItemInput(int quantity, ID variantId) { + this.quantity = quantity; - UNKNOWN_VALUE; + this.variantId = variantId; + } - public static CollectionSortKeys fromGraphQl(String value) { - if (value == null) { - return null; - } + public int getQuantity() { + return quantity; + } - switch (value) { - case "ID": { - return ID; - } + public CheckoutLineItemInput setQuantity(int quantity) { + this.quantity = quantity; + return this; + } - case "RELEVANCE": { - return RELEVANCE; - } + public ID getVariantId() { + return variantId; + } - case "TITLE": { - return TITLE; - } + public CheckoutLineItemInput setVariantId(ID variantId) { + this.variantId = variantId; + return this; + } - case "UPDATED_AT": { - return UPDATED_AT; - } + public List getCustomAttributes() { + return customAttributes.getValue(); + } - default: { - return UNKNOWN_VALUE; - } + public Input> getCustomAttributesInput() { + return customAttributes; + } + + public CheckoutLineItemInput setCustomAttributes(List customAttributes) { + this.customAttributes = Input.optional(customAttributes); + return this; + } + + public CheckoutLineItemInput setCustomAttributesInput(Input> customAttributes) { + if (customAttributes == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.customAttributes = customAttributes; + return this; } - public String toString() { - switch (this) { - case ID: { - return "ID"; - } - case RELEVANCE: { - return "RELEVANCE"; - } + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - case TITLE: { - return "TITLE"; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("quantity:"); + _queryBuilder.append(quantity); - case UPDATED_AT: { - return "UPDATED_AT"; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("variantId:"); + Query.appendQuotedString(_queryBuilder, variantId.toString()); - default: { - return ""; + 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"); } } + + _queryBuilder.append('}'); } } - public interface CommentQueryDefinition { - void define(CommentQuery _queryBuilder); - } + public static class CheckoutLineItemUpdateInput implements Serializable { + private Input id = Input.undefined(); - /** - * A comment on an article. - */ - public static class CommentQuery extends Query { - CommentQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + private Input variantId = Input.undefined(); - startField("id"); + private Input quantity = Input.undefined(); + + private Input> customAttributes = Input.undefined(); + + public ID getId() { + return id.getValue(); } - /** - * The comment’s author. - */ - public CommentQuery author(CommentAuthorQueryDefinition queryDef) { - startField("author"); + public Input getIdInput() { + return id; + } - _queryBuilder.append('{'); - queryDef.define(new CommentAuthorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CheckoutLineItemUpdateInput setId(ID id) { + this.id = Input.optional(id); + return this; + } + public CheckoutLineItemUpdateInput setIdInput(Input id) { + if (id == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.id = id; return this; } - public class ContentArguments extends Arguments { - ContentArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); + public ID getVariantId() { + return variantId.getValue(); + } + + public Input getVariantIdInput() { + return variantId; + } + + public CheckoutLineItemUpdateInput setVariantId(ID variantId) { + this.variantId = Input.optional(variantId); + return this; + } + + public CheckoutLineItemUpdateInput setVariantIdInput(Input variantId) { + if (variantId == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.variantId = variantId; + return this; + } - /** - * Truncates string after the given length. - */ - public ContentArguments truncateAt(Integer value) { - if (value != null) { - startArgument("truncateAt"); - _queryBuilder.append(value); + public Integer getQuantity() { + return quantity.getValue(); + } + + public Input getQuantityInput() { + return quantity; + } + + public CheckoutLineItemUpdateInput setQuantity(Integer quantity) { + this.quantity = Input.optional(quantity); + return this; + } + + public CheckoutLineItemUpdateInput setQuantityInput(Input quantity) { + if (quantity == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.quantity = quantity; + return this; + } + + public List getCustomAttributes() { + return customAttributes.getValue(); + } + + public Input> getCustomAttributesInput() { + return customAttributes; + } + + public CheckoutLineItemUpdateInput setCustomAttributes(List customAttributes) { + this.customAttributes = Input.optional(customAttributes); + return this; + } + + public CheckoutLineItemUpdateInput setCustomAttributesInput(Input> customAttributes) { + if (customAttributes == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.customAttributes = customAttributes; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + if (this.id.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("id:"); + if (id.getValue() != null) { + Query.appendQuotedString(_queryBuilder, id.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.variantId.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("variantId:"); + if (variantId.getValue() != null) { + Query.appendQuotedString(_queryBuilder, variantId.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.quantity.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("quantity:"); + if (quantity.getValue() != null) { + _queryBuilder.append(quantity.getValue()); + } 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"); } - return this; } + + _queryBuilder.append('}'); } + } - public interface ContentArgumentsDefinition { - void define(ContentArguments args); + public interface CheckoutLineItemsAddPayloadQueryDefinition { + void define(CheckoutLineItemsAddPayloadQuery _queryBuilder); + } + + /** + * Return type for `checkoutLineItemsAdd` mutation. + */ + public static class CheckoutLineItemsAddPayloadQuery extends Query { + CheckoutLineItemsAddPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * Stripped content of the comment, single line with HTML tags removed. + * The updated checkout object. */ - public CommentQuery content() { - return content(args -> {}); + public CheckoutLineItemsAddPayloadQuery checkout(CheckoutQueryDefinition queryDef) { + startField("checkout"); + + _queryBuilder.append('{'); + queryDef.define(new CheckoutQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * Stripped content of the comment, single line with HTML tags removed. + * The list of errors that occurred from executing the mutation. */ - public CommentQuery content(ContentArgumentsDefinition argsDef) { - startField("content"); + public CheckoutLineItemsAddPayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + startField("checkoutUserErrors"); - ContentArguments args = new ContentArguments(_queryBuilder); - argsDef.define(args); - ContentArguments.end(args); + _queryBuilder.append('{'); + queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The content of the comment, complete with HTML formatting. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead. */ - public CommentQuery contentHtml() { - startField("contentHtml"); + @Deprecated + public CheckoutLineItemsAddPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); + + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * A comment on an article. + * Return type for `checkoutLineItemsAdd` mutation. */ - public static class Comment extends AbstractResponse implements Node { - public Comment() { + public static class CheckoutLineItemsAddPayload extends AbstractResponse { + public CheckoutLineItemsAddPayload() { } - public Comment(JsonObject fields) throws SchemaViolationError { + public CheckoutLineItemsAddPayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "author": { - responseData.put(key, new CommentAuthor(jsonAsObject(field.getValue(), key))); - - break; - } + case "checkout": { + Checkout optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + } - case "content": { - responseData.put(key, jsonAsString(field.getValue(), key)); + responseData.put(key, optional1); break; } - case "contentHtml": { - responseData.put(key, jsonAsString(field.getValue(), key)); + 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 "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } @@ -17793,128 +18484,160 @@ public Comment(JsonObject fields) throws SchemaViolationError { } } - public Comment(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "Comment"; + return "CheckoutLineItemsAddPayload"; } /** - * The comment’s author. + * The updated checkout object. */ - public CommentAuthor getAuthor() { - return (CommentAuthor) get("author"); + public Checkout getCheckout() { + return (Checkout) get("checkout"); } - public Comment setAuthor(CommentAuthor arg) { - optimisticData.put(getKey("author"), arg); + public CheckoutLineItemsAddPayload setCheckout(Checkout arg) { + optimisticData.put(getKey("checkout"), arg); return this; } /** - * Stripped content of the comment, single line with HTML tags removed. + * The list of errors that occurred from executing the mutation. */ - public String getContent() { - return (String) get("content"); + public List getCheckoutUserErrors() { + return (List) get("checkoutUserErrors"); } - public Comment setContent(String arg) { - optimisticData.put(getKey("content"), arg); + public CheckoutLineItemsAddPayload setCheckoutUserErrors(List arg) { + optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } /** - * The content of the comment, complete with HTML formatting. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead. */ - public String getContentHtml() { - return (String) get("contentHtml"); + public List getUserErrors() { + return (List) get("userErrors"); } - public Comment setContentHtml(String arg) { - optimisticData.put(getKey("contentHtml"), arg); + public CheckoutLineItemsAddPayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } - /** - * A globally-unique identifier. - */ - - public ID getId() { - return (ID) get("id"); - } - public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "author": return true; - - case "content": return false; + case "checkout": return true; - case "contentHtml": return false; + case "checkoutUserErrors": return true; - case "id": return false; + case "userErrors": return true; default: return false; } } } - public interface CommentAuthorQueryDefinition { - void define(CommentAuthorQuery _queryBuilder); + public interface CheckoutLineItemsRemovePayloadQueryDefinition { + void define(CheckoutLineItemsRemovePayloadQuery _queryBuilder); } /** - * The author of a comment. + * Return type for `checkoutLineItemsRemove` mutation. */ - public static class CommentAuthorQuery extends Query { - CommentAuthorQuery(StringBuilder _queryBuilder) { + public static class CheckoutLineItemsRemovePayloadQuery extends Query { + CheckoutLineItemsRemovePayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The author's email. + * The updated checkout object. */ - public CommentAuthorQuery email() { - startField("email"); + public CheckoutLineItemsRemovePayloadQuery checkout(CheckoutQueryDefinition queryDef) { + startField("checkout"); + + _queryBuilder.append('{'); + queryDef.define(new CheckoutQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The author’s name. + * The list of errors that occurred from executing the mutation. */ - public CommentAuthorQuery name() { - startField("name"); + public CheckoutLineItemsRemovePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + startField("checkoutUserErrors"); + + _queryBuilder.append('{'); + queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - } - /** - * The author of a comment. - */ - public static class CommentAuthor extends AbstractResponse { - public CommentAuthor() { + /** + * 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 CommentAuthor(JsonObject fields) throws SchemaViolationError { + public CheckoutLineItemsRemovePayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "email": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "checkout": { + Checkout optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + 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; } @@ -17931,92 +18654,96 @@ public CommentAuthor(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CommentAuthor"; + return "CheckoutLineItemsRemovePayload"; } /** - * The author's email. + * The updated checkout object. */ - public String getEmail() { - return (String) get("email"); + public Checkout getCheckout() { + return (Checkout) get("checkout"); } - public CommentAuthor setEmail(String arg) { - optimisticData.put(getKey("email"), arg); + public CheckoutLineItemsRemovePayload setCheckout(Checkout arg) { + optimisticData.put(getKey("checkout"), arg); return this; } /** - * The author’s name. + * The list of errors that occurred from executing the mutation. */ - public String getName() { - return (String) get("name"); + public List getCheckoutUserErrors() { + return (List) get("checkoutUserErrors"); } - public CommentAuthor setName(String arg) { - optimisticData.put(getKey("name"), 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; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "email": return false; + case "checkout": return true; - case "name": return false; + case "checkoutUserErrors": return true; + + case "userErrors": return true; default: return false; } } } - public interface CommentConnectionQueryDefinition { - void define(CommentConnectionQuery _queryBuilder); + public interface CheckoutLineItemsReplacePayloadQueryDefinition { + void define(CheckoutLineItemsReplacePayloadQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple Comments. + * Return type for `checkoutLineItemsReplace` mutation. */ - public static class CommentConnectionQuery extends Query { - CommentConnectionQuery(StringBuilder _queryBuilder) { + public static class CheckoutLineItemsReplacePayloadQuery extends Query { + CheckoutLineItemsReplacePayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A list of edges. - */ - public CommentConnectionQuery edges(CommentEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new CommentEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * A list of the nodes contained in CommentEdge. + * The updated checkout object. */ - public CommentConnectionQuery nodes(CommentQueryDefinition queryDef) { - startField("nodes"); + public CheckoutLineItemsReplacePayloadQuery checkout(CheckoutQueryDefinition queryDef) { + startField("checkout"); _queryBuilder.append('{'); - queryDef.define(new CommentQuery(_queryBuilder)); + queryDef.define(new CheckoutQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Information to aid in pagination. + * The list of errors that occurred from executing the mutation. */ - public CommentConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + public CheckoutLineItemsReplacePayloadQuery userErrors(CheckoutUserErrorQueryDefinition queryDef) { + startField("userErrors"); _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); + queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -18024,32 +18751,32 @@ public CommentConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { } /** - * An auto-generated type for paginating through multiple Comments. + * Return type for `checkoutLineItemsReplace` mutation. */ - public static class CommentConnection extends AbstractResponse { - public CommentConnection() { + public static class CheckoutLineItemsReplacePayload extends AbstractResponse { + public CheckoutLineItemsReplacePayload() { } - public CommentConnection(JsonObject fields) throws SchemaViolationError { + public CheckoutLineItemsReplacePayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CommentEdge(jsonAsObject(element1, key))); + case "checkout": { + Checkout optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Checkout(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "nodes": { - List list1 = new ArrayList<>(); + case "userErrors": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Comment(jsonAsObject(element1, key))); + list1.add(new CheckoutUserError(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -18057,12 +18784,6 @@ public CommentConnection(JsonObject fields) throws SchemaViolationError { break; } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - - break; - } - case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -18075,90 +18796,95 @@ public CommentConnection(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CommentConnection"; - } - - /** - * A list of edges. - */ - - public List getEdges() { - return (List) get("edges"); - } - - public CommentConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; + return "CheckoutLineItemsReplacePayload"; } /** - * A list of the nodes contained in CommentEdge. + * The updated checkout object. */ - public List getNodes() { - return (List) get("nodes"); + public Checkout getCheckout() { + return (Checkout) get("checkout"); } - public CommentConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + public CheckoutLineItemsReplacePayload setCheckout(Checkout arg) { + optimisticData.put(getKey("checkout"), arg); return this; } /** - * Information to aid in pagination. + * The list of errors that occurred from executing the mutation. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public List getUserErrors() { + return (List) get("userErrors"); } - public CommentConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public CheckoutLineItemsReplacePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return true; + case "checkout": return true; - case "pageInfo": return true; + case "userErrors": return true; default: return false; } } } - public interface CommentEdgeQueryDefinition { - void define(CommentEdgeQuery _queryBuilder); + public interface CheckoutLineItemsUpdatePayloadQueryDefinition { + void define(CheckoutLineItemsUpdatePayloadQuery _queryBuilder); } /** - * An auto-generated type which holds one Comment and a cursor during pagination. + * Return type for `checkoutLineItemsUpdate` mutation. */ - public static class CommentEdgeQuery extends Query { - CommentEdgeQuery(StringBuilder _queryBuilder) { + public static class CheckoutLineItemsUpdatePayloadQuery extends Query { + CheckoutLineItemsUpdatePayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A cursor for use in pagination. + * The updated checkout object. */ - public CommentEdgeQuery cursor() { - startField("cursor"); + public CheckoutLineItemsUpdatePayloadQuery checkout(CheckoutQueryDefinition queryDef) { + startField("checkout"); + + _queryBuilder.append('{'); + queryDef.define(new CheckoutQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The item at the end of CommentEdge. + * The list of errors that occurred from executing the mutation. */ - public CommentEdgeQuery node(CommentQueryDefinition queryDef) { - startField("node"); + public CheckoutLineItemsUpdatePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + startField("checkoutUserErrors"); _queryBuilder.append('{'); - queryDef.define(new CommentQuery(_queryBuilder)); + 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) { + startField("userErrors"); + + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -18166,25 +18892,46 @@ public CommentEdgeQuery node(CommentQueryDefinition queryDef) { } /** - * An auto-generated type which holds one Comment and a cursor during pagination. + * Return type for `checkoutLineItemsUpdate` mutation. */ - public static class CommentEdge extends AbstractResponse { - public CommentEdge() { + public static class CheckoutLineItemsUpdatePayload extends AbstractResponse { + public CheckoutLineItemsUpdatePayload() { } - public CommentEdge(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 "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "checkout": { + Checkout optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "node": { - responseData.put(key, new Comment(jsonAsObject(field.getValue(), key))); + 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; } @@ -18201,155 +18948,159 @@ public CommentEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CommentEdge"; + return "CheckoutLineItemsUpdatePayload"; } /** - * A cursor for use in pagination. + * The updated checkout object. */ - public String getCursor() { - return (String) get("cursor"); + public Checkout getCheckout() { + return (Checkout) get("checkout"); } - public CommentEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public CheckoutLineItemsUpdatePayload setCheckout(Checkout arg) { + optimisticData.put(getKey("checkout"), arg); return this; } /** - * The item at the end of CommentEdge. + * The list of errors that occurred from executing the mutation. */ - public Comment getNode() { - return (Comment) get("node"); + public List getCheckoutUserErrors() { + return (List) get("checkoutUserErrors"); } - public CommentEdge setNode(Comment arg) { - optimisticData.put(getKey("node"), arg); + 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 CheckoutLineItemsUpdatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cursor": return false; + case "checkout": return true; - case "node": return true; + case "checkoutUserErrors": return true; + + case "userErrors": return true; default: return false; } } } - public interface CountryQueryDefinition { - void define(CountryQuery _queryBuilder); + public interface CheckoutShippingAddressUpdateV2PayloadQueryDefinition { + void define(CheckoutShippingAddressUpdateV2PayloadQuery _queryBuilder); } /** - * A country. + * Return type for `checkoutShippingAddressUpdateV2` mutation. */ - public static class CountryQuery extends Query { - CountryQuery(StringBuilder _queryBuilder) { + public static class CheckoutShippingAddressUpdateV2PayloadQuery extends Query { + CheckoutShippingAddressUpdateV2PayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The languages available for the country. + * The updated checkout object. */ - public CountryQuery availableLanguages(LanguageQueryDefinition queryDef) { - startField("availableLanguages"); + public CheckoutShippingAddressUpdateV2PayloadQuery checkout(CheckoutQueryDefinition queryDef) { + startField("checkout"); _queryBuilder.append('{'); - queryDef.define(new LanguageQuery(_queryBuilder)); + queryDef.define(new CheckoutQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The currency of the country. + * The list of errors that occurred from executing the mutation. */ - public CountryQuery currency(CurrencyQueryDefinition queryDef) { - startField("currency"); + public CheckoutShippingAddressUpdateV2PayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + startField("checkoutUserErrors"); _queryBuilder.append('{'); - queryDef.define(new CurrencyQuery(_queryBuilder)); + queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The ISO code of the country. - */ - public CountryQuery isoCode() { - startField("isoCode"); - - return this; - } - - /** - * The name of the country. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead. */ - public CountryQuery name() { - startField("name"); - - return this; - } + @Deprecated + public CheckoutShippingAddressUpdateV2PayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - /** - * The unit system used in the country. - */ - public CountryQuery unitSystem() { - startField("unitSystem"); + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * A country. + * Return type for `checkoutShippingAddressUpdateV2` mutation. */ - public static class Country extends AbstractResponse { - public Country() { + public static class CheckoutShippingAddressUpdateV2Payload extends AbstractResponse { + public CheckoutShippingAddressUpdateV2Payload() { } - public Country(JsonObject fields) throws SchemaViolationError { + public CheckoutShippingAddressUpdateV2Payload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "availableLanguages": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Language(jsonAsObject(element1, key))); + case "checkout": { + Checkout optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Checkout(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "currency": { - responseData.put(key, new Currency(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))); + } - case "isoCode": { - responseData.put(key, CountryCode.fromGraphQl(jsonAsString(field.getValue(), key))); + responseData.put(key, list1); break; } - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case "unitSystem": { - responseData.put(key, UnitSystem.fromGraphQl(jsonAsString(field.getValue(), key))); + responseData.put(key, list1); break; } @@ -18366,3299 +19117,8503 @@ public Country(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "Country"; + return "CheckoutShippingAddressUpdateV2Payload"; } /** - * The languages available for the country. + * The updated checkout object. */ - public List getAvailableLanguages() { - return (List) get("availableLanguages"); + public Checkout getCheckout() { + return (Checkout) get("checkout"); } - public Country setAvailableLanguages(List arg) { - optimisticData.put(getKey("availableLanguages"), arg); + public CheckoutShippingAddressUpdateV2Payload setCheckout(Checkout arg) { + optimisticData.put(getKey("checkout"), arg); return this; } /** - * The currency of the country. + * The list of errors that occurred from executing the mutation. */ - public Currency getCurrency() { - return (Currency) get("currency"); + public List getCheckoutUserErrors() { + return (List) get("checkoutUserErrors"); } - public Country setCurrency(Currency arg) { - optimisticData.put(getKey("currency"), arg); + public CheckoutShippingAddressUpdateV2Payload setCheckoutUserErrors(List arg) { + optimisticData.put(getKey("checkoutUserErrors"), arg); return this; } /** - * The ISO code of the country. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead. */ - public CountryCode getIsoCode() { - return (CountryCode) get("isoCode"); + public List getUserErrors() { + return (List) get("userErrors"); } - public Country setIsoCode(CountryCode arg) { - optimisticData.put(getKey("isoCode"), arg); + public CheckoutShippingAddressUpdateV2Payload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } - /** - * The name of the country. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "checkout": return true; - public String getName() { - return (String) get("name"); + case "checkoutUserErrors": return true; + + case "userErrors": return true; + + default: return false; + } } + } - public Country setName(String arg) { - optimisticData.put(getKey("name"), arg); - return this; + public interface CheckoutShippingLineUpdatePayloadQueryDefinition { + void define(CheckoutShippingLineUpdatePayloadQuery _queryBuilder); + } + + /** + * Return type for `checkoutShippingLineUpdate` mutation. + */ + public static class CheckoutShippingLineUpdatePayloadQuery extends Query { + CheckoutShippingLineUpdatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The unit system used in the country. + * The updated checkout object. */ + public CheckoutShippingLineUpdatePayloadQuery checkout(CheckoutQueryDefinition queryDef) { + startField("checkout"); - public UnitSystem getUnitSystem() { - return (UnitSystem) get("unitSystem"); - } + _queryBuilder.append('{'); + queryDef.define(new CheckoutQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Country setUnitSystem(UnitSystem arg) { - optimisticData.put(getKey("unitSystem"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "availableLanguages": return true; + /** + * The list of errors that occurred from executing the mutation. + */ + public CheckoutShippingLineUpdatePayloadQuery checkoutUserErrors(CheckoutUserErrorQueryDefinition queryDef) { + startField("checkoutUserErrors"); - case "currency": return true; + _queryBuilder.append('{'); + queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "isoCode": return false; + return this; + } - case "name": return false; + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead. + */ + @Deprecated + public CheckoutShippingLineUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case "unitSystem": return false; + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - default: return false; - } + return this; } } /** - * The code designating a country/region, which generally follows ISO 3166-1 alpha-2 guidelines. - * If a territory doesn't have a country code value in the `CountryCode` enum, then it might be - * considered a subdivision - * of another country. For example, the territories associated with Spain are represented by the - * country code `ES`, - * and the territories associated with the United States of America are represented by the country code - * `US`. + * Return type for `checkoutShippingLineUpdate` mutation. */ - public enum CountryCode { - /** - * Ascension Island. - */ - AC, + public static class CheckoutShippingLineUpdatePayload extends AbstractResponse { + public CheckoutShippingLineUpdatePayload() { + } - /** - * Andorra. - */ - AD, + public CheckoutShippingLineUpdatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "checkout": { + Checkout optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + } - /** - * United Arab Emirates. - */ - AE, + responseData.put(key, optional1); - /** - * Afghanistan. - */ - AF, + break; + } - /** - * Antigua & Barbuda. - */ - AG, + case "checkoutUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CheckoutUserError(jsonAsObject(element1, key))); + } - /** - * Anguilla. - */ - AI, + responseData.put(key, list1); - /** - * Albania. - */ - AL, + break; + } - /** - * Armenia. - */ - AM, + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - /** - * Netherlands Antilles. - */ - AN, + responseData.put(key, list1); - /** - * Angola. - */ - AO, + break; + } - /** - * Argentina. - */ - AR, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * Austria. - */ - AT, + public String getGraphQlTypeName() { + return "CheckoutShippingLineUpdatePayload"; + } /** - * Australia. + * The updated checkout object. */ - AU, - /** - * Aruba. - */ - AW, + public Checkout getCheckout() { + return (Checkout) get("checkout"); + } - /** - * Åland Islands. - */ - AX, + public CheckoutShippingLineUpdatePayload setCheckout(Checkout arg) { + optimisticData.put(getKey("checkout"), arg); + return this; + } /** - * Azerbaijan. + * The list of errors that occurred from executing the mutation. */ - AZ, - /** - * Bosnia & Herzegovina. - */ - BA, + public List getCheckoutUserErrors() { + return (List) get("checkoutUserErrors"); + } - /** - * Barbados. - */ - BB, + public CheckoutShippingLineUpdatePayload setCheckoutUserErrors(List arg) { + optimisticData.put(getKey("checkoutUserErrors"), arg); + return this; + } /** - * Bangladesh. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `checkoutUserErrors` instead. */ - BD, - /** - * Belgium. - */ - BE, + public List getUserErrors() { + return (List) get("userErrors"); + } - /** - * Burkina Faso. - */ - BF, + public CheckoutShippingLineUpdatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - /** - * Bulgaria. - */ - BG, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "checkout": return true; - /** - * Bahrain. - */ - BH, + case "checkoutUserErrors": return true; - /** - * Burundi. - */ - BI, + case "userErrors": return true; - /** - * Benin. - */ - BJ, + default: return false; + } + } + } - /** - * St. Barthélemy. - */ - BL, + public interface CheckoutUserErrorQueryDefinition { + void define(CheckoutUserErrorQuery _queryBuilder); + } - /** - * Bermuda. - */ - BM, + /** + * Represents an error that happens during execution of a checkout mutation. + */ + public static class CheckoutUserErrorQuery extends Query { + CheckoutUserErrorQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Brunei. + * The error code. */ - BN, + public CheckoutUserErrorQuery code() { + startField("code"); - /** - * Bolivia. - */ - BO, + return this; + } /** - * Caribbean Netherlands. + * The path to the input field that caused the error. */ - BQ, + public CheckoutUserErrorQuery field() { + startField("field"); - /** - * Brazil. - */ - BR, + return this; + } /** - * Bahamas. + * The error message. */ - BS, + public CheckoutUserErrorQuery message() { + startField("message"); - /** - * Bhutan. - */ - BT, + return this; + } + } - /** - * Bouvet Island. - */ - BV, + /** + * Represents an error that happens during execution of a checkout mutation. + */ + public static class CheckoutUserError extends AbstractResponse implements DisplayableError { + public CheckoutUserError() { + } - /** - * Botswana. - */ - BW, + public CheckoutUserError(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "code": { + CheckoutErrorCode optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = CheckoutErrorCode.fromGraphQl(jsonAsString(field.getValue(), key)); + } - /** - * Belarus. - */ - BY, + responseData.put(key, optional1); - /** - * Belize. - */ - BZ, + break; + } - /** - * Canada. - */ - CA, + case "field": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } - /** - * Cocos (Keeling) Islands. - */ - CC, + optional1 = list1; + } - /** - * Congo - Kinshasa. - */ - CD, + responseData.put(key, optional1); - /** - * Central African Republic. - */ - CF, + break; + } - /** - * Congo - Brazzaville. - */ - CG, + case "message": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * Switzerland. - */ - CH, + break; + } - /** - * Côte d’Ivoire. - */ - CI, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * Cook Islands. - */ - CK, + public String getGraphQlTypeName() { + return "CheckoutUserError"; + } /** - * Chile. + * The error code. */ - CL, - /** - * Cameroon. - */ - CM, + public CheckoutErrorCode getCode() { + return (CheckoutErrorCode) get("code"); + } - /** - * China. - */ - CN, + public CheckoutUserError setCode(CheckoutErrorCode arg) { + optimisticData.put(getKey("code"), arg); + return this; + } /** - * Colombia. + * The path to the input field that caused the error. */ - CO, - /** - * Costa Rica. - */ - CR, + public List getField() { + return (List) get("field"); + } - /** - * Cuba. - */ - CU, + public CheckoutUserError setField(List arg) { + optimisticData.put(getKey("field"), arg); + return this; + } /** - * Cape Verde. + * The error message. */ - CV, - /** - * Curaçao. - */ - CW, + public String getMessage() { + return (String) get("message"); + } - /** - * Christmas Island. - */ - CX, + public CheckoutUserError setMessage(String arg) { + optimisticData.put(getKey("message"), arg); + return this; + } - /** - * Cyprus. - */ - CY, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "code": return false; - /** - * Czechia. - */ - CZ, + case "field": return false; - /** - * Germany. - */ - DE, + case "message": return false; - /** - * Djibouti. - */ - DJ, + default: return false; + } + } + } - /** - * Denmark. - */ - DK, + public interface CollectionQueryDefinition { + void define(CollectionQuery _queryBuilder); + } - /** - * Dominica. - */ - DM, + /** + * A collection represents a grouping of products that a shop owner can create to organize them or make + * their shops easier to browse. + */ + public static class CollectionQuery extends Query { + CollectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); + } + + public class DescriptionArguments extends Arguments { + DescriptionArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * Truncates string after the given length. + */ + public DescriptionArguments truncateAt(Integer value) { + if (value != null) { + startArgument("truncateAt"); + _queryBuilder.append(value); + } + return this; + } + } + + public interface DescriptionArgumentsDefinition { + void define(DescriptionArguments args); + } /** - * Dominican Republic. + * Stripped description of the collection, single line with HTML tags removed. */ - DO, + public CollectionQuery description() { + return description(args -> {}); + } /** - * Algeria. + * Stripped description of the collection, single line with HTML tags removed. */ - DZ, + public CollectionQuery description(DescriptionArgumentsDefinition argsDef) { + startField("description"); + + DescriptionArguments args = new DescriptionArguments(_queryBuilder); + argsDef.define(args); + DescriptionArguments.end(args); + + return this; + } /** - * Ecuador. + * The description of the collection, complete with HTML formatting. */ - EC, + public CollectionQuery descriptionHtml() { + startField("descriptionHtml"); + + return this; + } /** - * Estonia. + * A human-friendly unique string for the collection automatically generated from its title. + * Limit of 255 characters. */ - EE, + public CollectionQuery handle() { + startField("handle"); + + return this; + } /** - * Egypt. + * Image associated with the collection. */ - EG, + public CollectionQuery image(ImageQueryDefinition queryDef) { + startField("image"); - /** - * Western Sahara. - */ - EH, + _queryBuilder.append('{'); + queryDef.define(new ImageQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Eritrea. - */ - ER, + return this; + } /** - * Spain. + * Returns a metafield found by namespace and key. */ - ES, + public CollectionQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { + startField("metafield"); - /** - * Ethiopia. - */ - ET, + _queryBuilder.append("(namespace:"); + Query.appendQuotedString(_queryBuilder, namespace.toString()); - /** - * Finland. - */ - FI, + _queryBuilder.append(",key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); - /** - * Fiji. - */ - FJ, + _queryBuilder.append(')'); - /** - * Falkland Islands. - */ - FK, + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Faroe Islands. - */ - FO, + return this; + } /** - * France. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - FR, + public CollectionQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); - /** - * Gabon. - */ - GA, + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); - /** - * United Kingdom. - */ - GB, + _queryBuilder.append(')'); - /** - * Grenada. - */ - GD, + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Georgia. - */ - GE, + return this; + } /** - * French Guiana. + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. */ - GF, + public CollectionQuery onlineStoreUrl() { + startField("onlineStoreUrl"); - /** - * Guernsey. - */ - GG, + return this; + } - /** - * Ghana. - */ - GH, + public class ProductsArguments extends Arguments { + ProductsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - /** - * Gibraltar. - */ - GI, + /** + * Returns up to the first `n` elements from the list. + */ + public ProductsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - /** - * Greenland. - */ - GL, + /** + * Returns the elements that come after the specified cursor. + */ + public ProductsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - /** - * Gambia. - */ - GM, + /** + * Returns up to the last `n` elements from the list. + */ + public ProductsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - /** - * Guinea. - */ - GN, + /** + * Returns the elements that come before the specified cursor. + */ + public ProductsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - /** - * Guadeloupe. - */ - GP, + /** + * Reverse the order of the underlying list. + */ + public ProductsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } - /** - * Equatorial Guinea. - */ - GQ, + /** + * Sort the underlying list by the given key. + */ + public ProductsArguments sortKey(ProductCollectionSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; + } - /** - * Greece. - */ - GR, + /** + * Returns a subset of products matching all product filters. + */ + public ProductsArguments filters(List value) { + if (value != null) { + startArgument("filters"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ProductFilter item1 : value) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } + return this; + } + } - /** - * South Georgia & South Sandwich Islands. - */ - GS, + public interface ProductsArgumentsDefinition { + void define(ProductsArguments args); + } /** - * Guatemala. + * List of products in the collection. */ - GT, + public CollectionQuery products(ProductConnectionQueryDefinition queryDef) { + return products(args -> {}, queryDef); + } /** - * Guinea-Bissau. + * List of products in the collection. */ - GW, + public CollectionQuery products(ProductsArgumentsDefinition argsDef, ProductConnectionQueryDefinition queryDef) { + startField("products"); - /** - * Guyana. - */ - GY, + ProductsArguments args = new ProductsArguments(_queryBuilder); + argsDef.define(args); + ProductsArguments.end(args); - /** - * Hong Kong SAR. - */ - HK, + _queryBuilder.append('{'); + queryDef.define(new ProductConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Heard & McDonald Islands. - */ - HM, + return this; + } /** - * Honduras. + * The collection's SEO information. */ - HN, + public CollectionQuery seo(SEOQueryDefinition queryDef) { + startField("seo"); - /** - * Croatia. - */ - HR, + _queryBuilder.append('{'); + queryDef.define(new SEOQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Haiti. - */ - HT, + return this; + } /** - * Hungary. + * The collection’s name. Limit of 255 characters. */ - HU, + public CollectionQuery title() { + startField("title"); - /** - * Indonesia. - */ - ID, + return this; + } /** - * Ireland. + * The date and time when the collection was last modified. */ - IE, + public CollectionQuery updatedAt() { + startField("updatedAt"); - /** - * Israel. - */ - IL, + return this; + } + } - /** - * Isle of Man. - */ - IM, + /** + * A collection represents a grouping of products that a shop owner can create to organize them or make + * their shops easier to browse. + */ + public static class Collection extends AbstractResponse implements HasMetafields, MetafieldParentResource, MetafieldReference, Node, OnlineStorePublishable { + public Collection() { + } - /** - * India. - */ - IN, + public Collection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "description": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * British Indian Ocean Territory. - */ - IO, + break; + } - /** - * Iraq. - */ - IQ, + case "descriptionHtml": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * Iran. - */ - IR, + break; + } - /** - * Iceland. - */ - IS, + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * Italy. - */ - IT, + break; + } - /** - * Jersey. - */ - JE, + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - /** - * Jamaica. - */ - JM, + break; + } - /** - * Jordan. - */ - JO, + case "image": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); + } - /** - * Japan. - */ - JP, + responseData.put(key, optional1); - /** - * Kenya. - */ - KE, + break; + } - /** - * Kyrgyzstan. - */ - KG, + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } - /** - * Cambodia. - */ - KH, + responseData.put(key, optional1); - /** - * Kiribati. - */ - KI, + break; + } - /** - * Comoros. - */ - KM, + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } - /** - * St. Kitts & Nevis. - */ - KN, + list1.add(optional2); + } - /** - * North Korea. - */ - KP, + responseData.put(key, list1); - /** - * South Korea. - */ - KR, + break; + } - /** - * Kuwait. - */ - KW, + case "onlineStoreUrl": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - /** - * Cayman Islands. - */ - KY, + responseData.put(key, optional1); - /** - * Kazakhstan. - */ - KZ, + break; + } - /** - * Laos. - */ - LA, + case "products": { + responseData.put(key, new ProductConnection(jsonAsObject(field.getValue(), key))); - /** - * Lebanon. - */ - LB, + break; + } - /** - * St. Lucia. - */ - LC, + case "seo": { + responseData.put(key, new SEO(jsonAsObject(field.getValue(), key))); - /** - * Liechtenstein. - */ - LI, + break; + } - /** - * Sri Lanka. - */ - LK, + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * Liberia. - */ - LR, + break; + } - /** - * Lesotho. - */ - LS, + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - /** - * Lithuania. - */ - LT, + break; + } - /** - * Luxembourg. - */ - LU, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * Latvia. - */ - LV, + public Collection(ID id) { + this(); + optimisticData.put("id", id); + } - /** - * Libya. - */ - LY, + public String getGraphQlTypeName() { + return "Collection"; + } /** - * Morocco. + * Stripped description of the collection, single line with HTML tags removed. */ - MA, - /** - * Monaco. - */ - MC, + public String getDescription() { + return (String) get("description"); + } - /** - * Moldova. - */ - MD, + public Collection setDescription(String arg) { + optimisticData.put(getKey("description"), arg); + return this; + } /** - * Montenegro. + * The description of the collection, complete with HTML formatting. */ - ME, - /** - * St. Martin. - */ - MF, + public String getDescriptionHtml() { + return (String) get("descriptionHtml"); + } - /** - * Madagascar. - */ - MG, + public Collection setDescriptionHtml(String arg) { + optimisticData.put(getKey("descriptionHtml"), arg); + return this; + } /** - * North Macedonia. + * A human-friendly unique string for the collection automatically generated from its title. + * Limit of 255 characters. */ - MK, - /** - * Mali. - */ - ML, + public String getHandle() { + return (String) get("handle"); + } - /** - * Myanmar (Burma). - */ - MM, + public Collection setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); + return this; + } /** - * Mongolia. + * A globally-unique identifier. */ - MN, - /** - * Macao SAR. - */ - MO, + public ID getId() { + return (ID) get("id"); + } /** - * Martinique. + * Image associated with the collection. */ - MQ, - /** - * Mauritania. - */ - MR, + public Image getImage() { + return (Image) get("image"); + } - /** - * Montserrat. - */ - MS, + public Collection setImage(Image arg) { + optimisticData.put(getKey("image"), arg); + return this; + } /** - * Malta. + * Returns a metafield found by namespace and key. */ - MT, - /** - * Mauritius. - */ - MU, + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } - /** - * Maldives. - */ - MV, + public Collection setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); + return this; + } /** - * Malawi. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - MW, - /** - * Mexico. - */ - MX, + public List getMetafields() { + return (List) get("metafields"); + } - /** - * Malaysia. - */ - MY, + public Collection setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); + return this; + } /** - * Mozambique. + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. */ - MZ, - /** - * Namibia. - */ - NA, + public String getOnlineStoreUrl() { + return (String) get("onlineStoreUrl"); + } - /** - * New Caledonia. - */ - NC, + public Collection setOnlineStoreUrl(String arg) { + optimisticData.put(getKey("onlineStoreUrl"), arg); + return this; + } /** - * Niger. + * List of products in the collection. */ - NE, - /** - * Norfolk Island. - */ - NF, + public ProductConnection getProducts() { + return (ProductConnection) get("products"); + } - /** - * Nigeria. - */ - NG, + public Collection setProducts(ProductConnection arg) { + optimisticData.put(getKey("products"), arg); + return this; + } /** - * Nicaragua. + * The collection's SEO information. */ - NI, - /** - * Netherlands. - */ - NL, + public SEO getSeo() { + return (SEO) get("seo"); + } - /** - * Norway. - */ - NO, + public Collection setSeo(SEO arg) { + optimisticData.put(getKey("seo"), arg); + return this; + } /** - * Nepal. + * The collection’s name. Limit of 255 characters. */ - NP, - /** - * Nauru. - */ - NR, + public String getTitle() { + return (String) get("title"); + } - /** - * Niue. - */ - NU, + public Collection setTitle(String arg) { + optimisticData.put(getKey("title"), arg); + return this; + } /** - * New Zealand. + * The date and time when the collection was last modified. */ - NZ, - /** - * Oman. - */ - OM, + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); + } - /** - * Panama. - */ - PA, + public Collection setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); + return this; + } - /** - * Peru. - */ - PE, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "description": return false; - /** - * French Polynesia. - */ - PF, + case "descriptionHtml": return false; - /** - * Papua New Guinea. - */ - PG, + case "handle": return false; - /** - * Philippines. - */ - PH, + case "id": return false; - /** - * Pakistan. - */ - PK, + case "image": return true; - /** - * Poland. - */ - PL, + case "metafield": return true; - /** - * St. Pierre & Miquelon. - */ - PM, + case "metafields": return true; - /** - * Pitcairn Islands. - */ - PN, + case "onlineStoreUrl": return false; - /** - * Palestinian Territories. - */ - PS, + case "products": return true; - /** - * Portugal. - */ - PT, + case "seo": return true; - /** - * Paraguay. - */ - PY, + case "title": return false; - /** - * Qatar. - */ - QA, + case "updatedAt": return false; - /** - * Réunion. - */ - RE, + default: return false; + } + } + } - /** - * Romania. - */ - RO, + public interface CollectionConnectionQueryDefinition { + void define(CollectionConnectionQuery _queryBuilder); + } - /** - * Serbia. - */ - RS, + /** + * An auto-generated type for paginating through multiple Collections. + */ + public static class CollectionConnectionQuery extends Query { + CollectionConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Russia. + * A list of edges. */ - RU, + public CollectionConnectionQuery edges(CollectionEdgeQueryDefinition queryDef) { + startField("edges"); - /** - * Rwanda. - */ - RW, + _queryBuilder.append('{'); + queryDef.define(new CollectionEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Saudi Arabia. - */ - SA, + return this; + } /** - * Solomon Islands. + * A list of the nodes contained in CollectionEdge. */ - SB, + public CollectionConnectionQuery nodes(CollectionQueryDefinition queryDef) { + startField("nodes"); - /** - * Seychelles. - */ - SC, + _queryBuilder.append('{'); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Sudan. - */ - SD, + return this; + } /** - * Sweden. + * Information to aid in pagination. */ - SE, + public CollectionConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - /** - * Singapore. - */ - SG, + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * St. Helena. - */ - SH, + return this; + } + } - /** - * Slovenia. - */ - SI, + /** + * An auto-generated type for paginating through multiple Collections. + */ + public static class CollectionConnection extends AbstractResponse { + public CollectionConnection() { + } - /** - * Svalbard & Jan Mayen. - */ - SJ, + public CollectionConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CollectionEdge(jsonAsObject(element1, key))); + } - /** - * Slovakia. - */ - SK, + responseData.put(key, list1); - /** - * Sierra Leone. - */ - SL, + break; + } - /** - * San Marino. - */ - SM, + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Collection(jsonAsObject(element1, key))); + } - /** - * Senegal. - */ - SN, + responseData.put(key, list1); - /** - * Somalia. - */ - SO, + break; + } - /** - * Suriname. - */ - SR, + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - /** - * South Sudan. - */ - SS, + break; + } - /** - * São Tomé & Príncipe. - */ - ST, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * El Salvador. - */ - SV, + public String getGraphQlTypeName() { + return "CollectionConnection"; + } /** - * Sint Maarten. + * A list of edges. */ - SX, - /** - * Syria. - */ - SY, + public List getEdges() { + return (List) get("edges"); + } - /** - * Eswatini. - */ - SZ, + public CollectionConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; + } /** - * Tristan da Cunha. + * A list of the nodes contained in CollectionEdge. */ - TA, - /** - * Turks & Caicos Islands. - */ - TC, + public List getNodes() { + return (List) get("nodes"); + } - /** - * Chad. - */ - TD, + public CollectionConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; + } /** - * French Southern Territories. + * Information to aid in pagination. */ - TF, - /** - * Togo. - */ - TG, + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } - /** - * Thailand. - */ - TH, + public CollectionConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); + return this; + } - /** - * Tajikistan. - */ - TJ, - - /** - * Tokelau. - */ - TK, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - /** - * Timor-Leste. - */ - TL, + case "nodes": return true; - /** - * Turkmenistan. - */ - TM, + case "pageInfo": return true; - /** - * Tunisia. - */ - TN, + default: return false; + } + } + } - /** - * Tonga. - */ - TO, + public interface CollectionEdgeQueryDefinition { + void define(CollectionEdgeQuery _queryBuilder); + } - /** - * Turkey. - */ - TR, + /** + * An auto-generated type which holds one Collection and a cursor during pagination. + */ + public static class CollectionEdgeQuery extends Query { + CollectionEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Trinidad & Tobago. + * A cursor for use in pagination. */ - TT, + public CollectionEdgeQuery cursor() { + startField("cursor"); - /** - * Tuvalu. - */ - TV, + return this; + } /** - * Taiwan. + * The item at the end of CollectionEdge. */ - TW, + public CollectionEdgeQuery node(CollectionQueryDefinition queryDef) { + startField("node"); - /** - * Tanzania. - */ - TZ, + _queryBuilder.append('{'); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Ukraine. - */ - UA, + return this; + } + } - /** - * Uganda. - */ - UG, + /** + * An auto-generated type which holds one Collection and a cursor during pagination. + */ + public static class CollectionEdge extends AbstractResponse { + public CollectionEdge() { + } - /** - * U.S. Outlying Islands. - */ - UM, + public CollectionEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * United States. - */ - US, + break; + } - /** - * Uruguay. - */ - UY, + case "node": { + responseData.put(key, new Collection(jsonAsObject(field.getValue(), key))); - /** - * Uzbekistan. - */ - UZ, + break; + } - /** - * Vatican City. - */ - VA, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * St. Vincent & Grenadines. - */ - VC, + public String getGraphQlTypeName() { + return "CollectionEdge"; + } /** - * Venezuela. + * A cursor for use in pagination. */ - VE, - /** - * British Virgin Islands. - */ - VG, + public String getCursor() { + return (String) get("cursor"); + } - /** - * Vietnam. - */ - VN, + public CollectionEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); + return this; + } /** - * Vanuatu. + * The item at the end of CollectionEdge. */ - VU, - /** - * Wallis & Futuna. - */ - WF, + public Collection getNode() { + return (Collection) get("node"); + } - /** - * Samoa. - */ - WS, + public CollectionEdge setNode(Collection arg) { + optimisticData.put(getKey("node"), arg); + return this; + } - /** - * Kosovo. - */ - XK, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - /** - * Yemen. - */ - YE, + case "node": return true; - /** - * Mayotte. - */ - YT, + default: return false; + } + } + } + /** + * The set of valid sort keys for the Collection query. + */ + public enum CollectionSortKeys { /** - * South Africa. + * Sort by the `id` value. */ - ZA, + ID, /** - * Zambia. + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. */ - ZM, + RELEVANCE, /** - * Zimbabwe. + * Sort by the `title` value. */ - ZW, + TITLE, /** - * Unknown Region. + * Sort by the `updated_at` value. */ - ZZ, + UPDATED_AT, UNKNOWN_VALUE; - public static CountryCode fromGraphQl(String value) { + public static CollectionSortKeys fromGraphQl(String value) { if (value == null) { return null; } switch (value) { - case "AC": { - return AC; - } - - case "AD": { - return AD; + case "ID": { + return ID; } - case "AE": { - return AE; + case "RELEVANCE": { + return RELEVANCE; } - case "AF": { - return AF; + case "TITLE": { + return TITLE; } - case "AG": { - return AG; + case "UPDATED_AT": { + return UPDATED_AT; } - case "AI": { - return AI; + default: { + return UNKNOWN_VALUE; } - - case "AL": { - return AL; + } + } + public String toString() { + switch (this) { + case ID: { + return "ID"; } - case "AM": { - return AM; + case RELEVANCE: { + return "RELEVANCE"; } - case "AN": { - return AN; + case TITLE: { + return "TITLE"; } - case "AO": { - return AO; + case UPDATED_AT: { + return "UPDATED_AT"; } - case "AR": { - return AR; + default: { + return ""; } + } + } + } - case "AT": { - return AT; - } + public interface CommentQueryDefinition { + void define(CommentQuery _queryBuilder); + } - case "AU": { - return AU; - } + /** + * A comment on an article. + */ + public static class CommentQuery extends Query { + CommentQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - case "AW": { - return AW; - } + startField("id"); + } - case "AX": { - return AX; - } + /** + * The comment’s author. + */ + public CommentQuery author(CommentAuthorQueryDefinition queryDef) { + startField("author"); - case "AZ": { - return AZ; - } + _queryBuilder.append('{'); + queryDef.define(new CommentAuthorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "BA": { - return BA; - } + return this; + } - case "BB": { - return BB; - } + public class ContentArguments extends Arguments { + ContentArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "BD": { - return BD; + /** + * Truncates string after the given length. + */ + public ContentArguments truncateAt(Integer value) { + if (value != null) { + startArgument("truncateAt"); + _queryBuilder.append(value); } + return this; + } + } - case "BE": { - return BE; - } + public interface ContentArgumentsDefinition { + void define(ContentArguments args); + } - case "BF": { - return BF; - } + /** + * Stripped content of the comment, single line with HTML tags removed. + */ + public CommentQuery content() { + return content(args -> {}); + } - case "BG": { - return BG; - } + /** + * Stripped content of the comment, single line with HTML tags removed. + */ + public CommentQuery content(ContentArgumentsDefinition argsDef) { + startField("content"); - case "BH": { - return BH; - } + ContentArguments args = new ContentArguments(_queryBuilder); + argsDef.define(args); + ContentArguments.end(args); - case "BI": { - return BI; - } + return this; + } - case "BJ": { - return BJ; - } + /** + * The content of the comment, complete with HTML formatting. + */ + public CommentQuery contentHtml() { + startField("contentHtml"); - case "BL": { - return BL; - } + return this; + } + } - case "BM": { - return BM; - } + /** + * A comment on an article. + */ + public static class Comment extends AbstractResponse implements Node { + public Comment() { + } - case "BN": { - return BN; - } + public Comment(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "author": { + responseData.put(key, new CommentAuthor(jsonAsObject(field.getValue(), key))); - case "BO": { - return BO; - } + break; + } - case "BQ": { - return BQ; - } + case "content": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case "BR": { - return BR; - } + break; + } - case "BS": { - return BS; - } + case "contentHtml": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case "BT": { - return BT; - } + break; + } - case "BV": { - return BV; - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - case "BW": { - return BW; - } + break; + } - case "BY": { - return BY; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "BZ": { - return BZ; - } + public Comment(ID id) { + this(); + optimisticData.put("id", id); + } - case "CA": { - return CA; - } + public String getGraphQlTypeName() { + return "Comment"; + } - case "CC": { - return CC; - } + /** + * The comment’s author. + */ - case "CD": { - return CD; - } + public CommentAuthor getAuthor() { + return (CommentAuthor) get("author"); + } - case "CF": { - return CF; - } + public Comment setAuthor(CommentAuthor arg) { + optimisticData.put(getKey("author"), arg); + return this; + } - case "CG": { - return CG; - } + /** + * Stripped content of the comment, single line with HTML tags removed. + */ - case "CH": { - return CH; - } + public String getContent() { + return (String) get("content"); + } - case "CI": { - return CI; - } + public Comment setContent(String arg) { + optimisticData.put(getKey("content"), arg); + return this; + } - case "CK": { - return CK; - } + /** + * The content of the comment, complete with HTML formatting. + */ - case "CL": { - return CL; - } + public String getContentHtml() { + return (String) get("contentHtml"); + } - case "CM": { - return CM; - } + public Comment setContentHtml(String arg) { + optimisticData.put(getKey("contentHtml"), arg); + return this; + } - case "CN": { - return CN; - } + /** + * A globally-unique identifier. + */ - case "CO": { - return CO; - } - - case "CR": { - return CR; - } + public ID getId() { + return (ID) get("id"); + } - case "CU": { - return CU; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "author": return true; - case "CV": { - return CV; - } + case "content": return false; - case "CW": { - return CW; - } + case "contentHtml": return false; - case "CX": { - return CX; - } + case "id": return false; - case "CY": { - return CY; - } + default: return false; + } + } + } - case "CZ": { - return CZ; - } + public interface CommentAuthorQueryDefinition { + void define(CommentAuthorQuery _queryBuilder); + } - case "DE": { - return DE; - } + /** + * The author of a comment. + */ + public static class CommentAuthorQuery extends Query { + CommentAuthorQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "DJ": { - return DJ; - } + /** + * The author's email. + */ + public CommentAuthorQuery email() { + startField("email"); - case "DK": { - return DK; - } + return this; + } - case "DM": { - return DM; - } + /** + * The author’s name. + */ + public CommentAuthorQuery name() { + startField("name"); - case "DO": { - return DO; - } + return this; + } + } - case "DZ": { - return DZ; - } + /** + * The author of a comment. + */ + public static class CommentAuthor extends AbstractResponse { + public CommentAuthor() { + } - case "EC": { - return EC; - } + public CommentAuthor(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "email": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case "EE": { - return EE; - } + break; + } - case "EG": { - return EG; - } + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case "EH": { - return EH; - } + break; + } - case "ER": { - return ER; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "ES": { - return ES; - } + public String getGraphQlTypeName() { + return "CommentAuthor"; + } - case "ET": { - return ET; - } + /** + * The author's email. + */ - case "FI": { - return FI; - } + public String getEmail() { + return (String) get("email"); + } - case "FJ": { - return FJ; - } + public CommentAuthor setEmail(String arg) { + optimisticData.put(getKey("email"), arg); + return this; + } - case "FK": { - return FK; - } + /** + * The author’s name. + */ - case "FO": { - return FO; - } + public String getName() { + return (String) get("name"); + } - case "FR": { - return FR; - } + public CommentAuthor setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } - case "GA": { - return GA; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "email": return false; - case "GB": { - return GB; - } + case "name": return false; - case "GD": { - return GD; - } + default: return false; + } + } + } - case "GE": { - return GE; - } + public interface CommentConnectionQueryDefinition { + void define(CommentConnectionQuery _queryBuilder); + } - case "GF": { - return GF; - } + /** + * An auto-generated type for paginating through multiple Comments. + */ + public static class CommentConnectionQuery extends Query { + CommentConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "GG": { - return GG; - } + /** + * A list of edges. + */ + public CommentConnectionQuery edges(CommentEdgeQueryDefinition queryDef) { + startField("edges"); - case "GH": { - return GH; - } + _queryBuilder.append('{'); + queryDef.define(new CommentEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "GI": { - return GI; - } + return this; + } - case "GL": { - return GL; - } + /** + * A list of the nodes contained in CommentEdge. + */ + public CommentConnectionQuery nodes(CommentQueryDefinition queryDef) { + startField("nodes"); - case "GM": { - return GM; - } + _queryBuilder.append('{'); + queryDef.define(new CommentQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "GN": { - return GN; - } + return this; + } - case "GP": { - return GP; - } + /** + * Information to aid in pagination. + */ + public CommentConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - case "GQ": { - return GQ; - } + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "GR": { - return GR; - } + return this; + } + } - case "GS": { - return GS; - } + /** + * An auto-generated type for paginating through multiple Comments. + */ + public static class CommentConnection extends AbstractResponse { + public CommentConnection() { + } - case "GT": { - return GT; - } + public CommentConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CommentEdge(jsonAsObject(element1, key))); + } - case "GW": { - return GW; - } + responseData.put(key, list1); - case "GY": { - return GY; - } + break; + } - case "HK": { - return HK; - } + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Comment(jsonAsObject(element1, key))); + } - case "HM": { - return HM; - } + responseData.put(key, list1); - case "HN": { - return HN; - } + break; + } - case "HR": { - return HR; - } + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - case "HT": { - return HT; - } + break; + } - case "HU": { - return HU; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "ID": { - return ID; - } + public String getGraphQlTypeName() { + return "CommentConnection"; + } - case "IE": { - return IE; - } + /** + * A list of edges. + */ - case "IL": { - return IL; - } + public List getEdges() { + return (List) get("edges"); + } - case "IM": { - return IM; - } + public CommentConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; + } - case "IN": { - return IN; - } + /** + * A list of the nodes contained in CommentEdge. + */ - case "IO": { - return IO; - } + public List getNodes() { + return (List) get("nodes"); + } - case "IQ": { - return IQ; - } + public CommentConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; + } - case "IR": { - return IR; - } + /** + * Information to aid in pagination. + */ - case "IS": { - return IS; - } + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } - case "IT": { - return IT; - } + public CommentConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); + return this; + } - case "JE": { - return JE; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - case "JM": { - return JM; - } + case "nodes": return true; - case "JO": { - return JO; - } + case "pageInfo": return true; - case "JP": { - return JP; - } + default: return false; + } + } + } - case "KE": { - return KE; - } + public interface CommentEdgeQueryDefinition { + void define(CommentEdgeQuery _queryBuilder); + } - case "KG": { - return KG; - } + /** + * An auto-generated type which holds one Comment and a cursor during pagination. + */ + public static class CommentEdgeQuery extends Query { + CommentEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "KH": { - return KH; - } + /** + * A cursor for use in pagination. + */ + public CommentEdgeQuery cursor() { + startField("cursor"); - case "KI": { - return KI; - } + return this; + } - case "KM": { - return KM; - } + /** + * The item at the end of CommentEdge. + */ + public CommentEdgeQuery node(CommentQueryDefinition queryDef) { + startField("node"); - case "KN": { - return KN; - } + _queryBuilder.append('{'); + queryDef.define(new CommentQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "KP": { - return KP; - } + return this; + } + } - case "KR": { - return KR; - } + /** + * An auto-generated type which holds one Comment and a cursor during pagination. + */ + public static class CommentEdge extends AbstractResponse { + public CommentEdge() { + } - case "KW": { - return KW; - } + public CommentEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case "KY": { - return KY; - } + break; + } - case "KZ": { - return KZ; - } + case "node": { + responseData.put(key, new Comment(jsonAsObject(field.getValue(), key))); - case "LA": { - return LA; - } + break; + } - case "LB": { - return LB; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "LC": { - return LC; - } + public String getGraphQlTypeName() { + return "CommentEdge"; + } - case "LI": { - return LI; - } + /** + * A cursor for use in pagination. + */ - case "LK": { - return LK; - } + public String getCursor() { + return (String) get("cursor"); + } - case "LR": { - return LR; - } + public CommentEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); + return this; + } - case "LS": { - return LS; - } + /** + * The item at the end of CommentEdge. + */ - case "LT": { - return LT; - } + public Comment getNode() { + return (Comment) get("node"); + } - case "LU": { - return LU; - } + public CommentEdge setNode(Comment arg) { + optimisticData.put(getKey("node"), arg); + return this; + } - case "LV": { - return LV; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - case "LY": { - return LY; - } + case "node": return true; - case "MA": { - return MA; - } + default: return false; + } + } + } - case "MC": { - return MC; - } + public interface CompletePaymentChallengeQueryDefinition { + void define(CompletePaymentChallengeQuery _queryBuilder); + } - case "MD": { - return MD; - } + /** + * The action for the 3DS payment redirect. + */ + public static class CompletePaymentChallengeQuery extends Query { + CompletePaymentChallengeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "ME": { - return ME; - } + /** + * The URL for the 3DS payment redirect. + */ + public CompletePaymentChallengeQuery redirectUrl() { + startField("redirectUrl"); - case "MF": { - return MF; - } + return this; + } + } - case "MG": { - return MG; - } + /** + * The action for the 3DS payment redirect. + */ + public static class CompletePaymentChallenge extends AbstractResponse implements CartCompletionAction { + public CompletePaymentChallenge() { + } - case "MK": { - return MK; - } + public CompletePaymentChallenge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "redirectUrl": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "ML": { - return ML; - } + responseData.put(key, optional1); - case "MM": { - return MM; - } + break; + } - case "MN": { - return MN; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "MO": { - return MO; - } + public String getGraphQlTypeName() { + return "CompletePaymentChallenge"; + } - case "MQ": { - return MQ; - } + /** + * The URL for the 3DS payment redirect. + */ - case "MR": { - return MR; - } + public String getRedirectUrl() { + return (String) get("redirectUrl"); + } - case "MS": { - return MS; - } + public CompletePaymentChallenge setRedirectUrl(String arg) { + optimisticData.put(getKey("redirectUrl"), arg); + return this; + } - case "MT": { - return MT; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "redirectUrl": return false; - case "MU": { - return MU; - } + default: return false; + } + } + } - case "MV": { - return MV; - } + public interface CompletionErrorQueryDefinition { + void define(CompletionErrorQuery _queryBuilder); + } - case "MW": { - return MW; - } + /** + * An error that occurred during a cart completion attempt. + */ + public static class CompletionErrorQuery extends Query { + CompletionErrorQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "MX": { - return MX; - } + /** + * The error code. + */ + public CompletionErrorQuery code() { + startField("code"); - case "MY": { - return MY; - } + return this; + } - case "MZ": { - return MZ; - } + /** + * The error message. + */ + public CompletionErrorQuery message() { + startField("message"); - case "NA": { - return NA; - } + return this; + } + } - case "NC": { - return NC; - } + /** + * An error that occurred during a cart completion attempt. + */ + public static class CompletionError extends AbstractResponse { + public CompletionError() { + } - case "NE": { - return NE; - } + public CompletionError(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "code": { + responseData.put(key, CompletionErrorCode.fromGraphQl(jsonAsString(field.getValue(), key))); - case "NF": { - return NF; - } + break; + } - case "NG": { - return NG; - } + case "message": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "NI": { - return NI; - } + responseData.put(key, optional1); - case "NL": { - return NL; - } + break; + } - case "NO": { - return NO; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "NP": { - return NP; - } + public String getGraphQlTypeName() { + return "CompletionError"; + } - case "NR": { - return NR; - } + /** + * The error code. + */ - case "NU": { - return NU; - } + public CompletionErrorCode getCode() { + return (CompletionErrorCode) get("code"); + } - case "NZ": { - return NZ; - } + public CompletionError setCode(CompletionErrorCode arg) { + optimisticData.put(getKey("code"), arg); + return this; + } - case "OM": { - return OM; - } + /** + * The error message. + */ - case "PA": { - return PA; - } + public String getMessage() { + return (String) get("message"); + } - case "PE": { - return PE; - } + public CompletionError setMessage(String arg) { + optimisticData.put(getKey("message"), arg); + return this; + } - case "PF": { - return PF; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "code": return false; - case "PG": { - return PG; - } + case "message": return false; - case "PH": { - return PH; - } + default: return false; + } + } + } - case "PK": { - return PK; - } + /** + * The code of the error that occurred during a cart completion attempt. + */ + public enum CompletionErrorCode { + ERROR, - case "PL": { - return PL; - } + INVENTORY_RESERVATION_ERROR, - case "PM": { - return PM; - } + PAYMENT_AMOUNT_TOO_SMALL, - case "PN": { - return PN; - } + PAYMENT_CALL_ISSUER, - case "PS": { - return PS; - } + PAYMENT_CARD_DECLINED, - case "PT": { - return PT; - } + PAYMENT_ERROR, - case "PY": { - return PY; - } + PAYMENT_GATEWAY_NOT_ENABLED_ERROR, - case "QA": { - return QA; - } + PAYMENT_INSUFFICIENT_FUNDS, - case "RE": { - return RE; - } + PAYMENT_INVALID_BILLING_ADDRESS, - case "RO": { - return RO; - } + PAYMENT_INVALID_CREDIT_CARD, - case "RS": { - return RS; - } + PAYMENT_INVALID_CURRENCY, - case "RU": { - return RU; - } + PAYMENT_INVALID_PAYMENT_METHOD, - case "RW": { - return RW; - } + PAYMENT_TRANSIENT_ERROR, - case "SA": { - return SA; - } + UNKNOWN_VALUE; - case "SB": { - return SB; - } + public static CompletionErrorCode fromGraphQl(String value) { + if (value == null) { + return null; + } - case "SC": { - return SC; + switch (value) { + case "ERROR": { + return ERROR; } - case "SD": { - return SD; + case "INVENTORY_RESERVATION_ERROR": { + return INVENTORY_RESERVATION_ERROR; } - case "SE": { - return SE; + case "PAYMENT_AMOUNT_TOO_SMALL": { + return PAYMENT_AMOUNT_TOO_SMALL; } - case "SG": { - return SG; + case "PAYMENT_CALL_ISSUER": { + return PAYMENT_CALL_ISSUER; } - case "SH": { - return SH; + case "PAYMENT_CARD_DECLINED": { + return PAYMENT_CARD_DECLINED; } - case "SI": { - return SI; + case "PAYMENT_ERROR": { + return PAYMENT_ERROR; } - case "SJ": { - return SJ; + case "PAYMENT_GATEWAY_NOT_ENABLED_ERROR": { + return PAYMENT_GATEWAY_NOT_ENABLED_ERROR; } - case "SK": { - return SK; + case "PAYMENT_INSUFFICIENT_FUNDS": { + return PAYMENT_INSUFFICIENT_FUNDS; } - case "SL": { - return SL; + case "PAYMENT_INVALID_BILLING_ADDRESS": { + return PAYMENT_INVALID_BILLING_ADDRESS; } - case "SM": { - return SM; + case "PAYMENT_INVALID_CREDIT_CARD": { + return PAYMENT_INVALID_CREDIT_CARD; } - case "SN": { - return SN; + case "PAYMENT_INVALID_CURRENCY": { + return PAYMENT_INVALID_CURRENCY; } - case "SO": { - return SO; + case "PAYMENT_INVALID_PAYMENT_METHOD": { + return PAYMENT_INVALID_PAYMENT_METHOD; } - case "SR": { - return SR; + case "PAYMENT_TRANSIENT_ERROR": { + return PAYMENT_TRANSIENT_ERROR; } - case "SS": { - return SS; + default: { + return UNKNOWN_VALUE; } - - case "ST": { - return ST; + } + } + public String toString() { + switch (this) { + case ERROR: { + return "ERROR"; } - case "SV": { - return SV; + case INVENTORY_RESERVATION_ERROR: { + return "INVENTORY_RESERVATION_ERROR"; } - case "SX": { - return SX; + case PAYMENT_AMOUNT_TOO_SMALL: { + return "PAYMENT_AMOUNT_TOO_SMALL"; } - case "SY": { - return SY; + case PAYMENT_CALL_ISSUER: { + return "PAYMENT_CALL_ISSUER"; } - case "SZ": { - return SZ; + case PAYMENT_CARD_DECLINED: { + return "PAYMENT_CARD_DECLINED"; } - case "TA": { - return TA; + case PAYMENT_ERROR: { + return "PAYMENT_ERROR"; } - case "TC": { - return TC; + case PAYMENT_GATEWAY_NOT_ENABLED_ERROR: { + return "PAYMENT_GATEWAY_NOT_ENABLED_ERROR"; } - case "TD": { - return TD; + case PAYMENT_INSUFFICIENT_FUNDS: { + return "PAYMENT_INSUFFICIENT_FUNDS"; } - case "TF": { - return TF; + case PAYMENT_INVALID_BILLING_ADDRESS: { + return "PAYMENT_INVALID_BILLING_ADDRESS"; } - case "TG": { - return TG; + case PAYMENT_INVALID_CREDIT_CARD: { + return "PAYMENT_INVALID_CREDIT_CARD"; } - case "TH": { - return TH; + case PAYMENT_INVALID_CURRENCY: { + return "PAYMENT_INVALID_CURRENCY"; } - case "TJ": { - return TJ; + case PAYMENT_INVALID_PAYMENT_METHOD: { + return "PAYMENT_INVALID_PAYMENT_METHOD"; } - case "TK": { - return TK; + case PAYMENT_TRANSIENT_ERROR: { + return "PAYMENT_TRANSIENT_ERROR"; } - case "TL": { - return TL; + default: { + return ""; } + } + } + } - case "TM": { - return TM; - } + public interface CountryQueryDefinition { + void define(CountryQuery _queryBuilder); + } - case "TN": { - return TN; - } + /** + * A country. + */ + public static class CountryQuery extends Query { + CountryQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "TO": { - return TO; - } + /** + * The languages available for the country. + */ + public CountryQuery availableLanguages(LanguageQueryDefinition queryDef) { + startField("availableLanguages"); - case "TR": { - return TR; - } + _queryBuilder.append('{'); + queryDef.define(new LanguageQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "TT": { - return TT; - } + return this; + } - case "TV": { - return TV; - } + /** + * The currency of the country. + */ + public CountryQuery currency(CurrencyQueryDefinition queryDef) { + startField("currency"); - case "TW": { - return TW; - } + _queryBuilder.append('{'); + queryDef.define(new CurrencyQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "TZ": { - return TZ; - } + return this; + } - case "UA": { - return UA; - } + /** + * The ISO code of the country. + */ + public CountryQuery isoCode() { + startField("isoCode"); - case "UG": { - return UG; - } + return this; + } - case "UM": { - return UM; - } + /** + * The market that includes this country. + */ + public CountryQuery market(MarketQueryDefinition queryDef) { + startField("market"); - case "US": { - return US; - } + _queryBuilder.append('{'); + queryDef.define(new MarketQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "UY": { - return UY; - } + return this; + } - case "UZ": { - return UZ; - } + /** + * The name of the country. + */ + public CountryQuery name() { + startField("name"); - case "VA": { - return VA; - } + return this; + } - case "VC": { - return VC; - } + /** + * The unit system used in the country. + */ + public CountryQuery unitSystem() { + startField("unitSystem"); - case "VE": { + return this; + } + } + + /** + * A country. + */ + public static class Country extends AbstractResponse { + public Country() { + } + + public Country(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "availableLanguages": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Language(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "currency": { + responseData.put(key, new Currency(jsonAsObject(field.getValue(), key))); + + break; + } + + case "isoCode": { + responseData.put(key, CountryCode.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "market": { + Market optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Market(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "unitSystem": { + responseData.put(key, UnitSystem.fromGraphQl(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 "Country"; + } + + /** + * The languages available for the country. + */ + + public List getAvailableLanguages() { + return (List) get("availableLanguages"); + } + + public Country setAvailableLanguages(List arg) { + optimisticData.put(getKey("availableLanguages"), arg); + return this; + } + + /** + * The currency of the country. + */ + + public Currency getCurrency() { + return (Currency) get("currency"); + } + + public Country setCurrency(Currency arg) { + optimisticData.put(getKey("currency"), arg); + return this; + } + + /** + * The ISO code of the country. + */ + + public CountryCode getIsoCode() { + return (CountryCode) get("isoCode"); + } + + public Country setIsoCode(CountryCode arg) { + optimisticData.put(getKey("isoCode"), arg); + return this; + } + + /** + * The market that includes this country. + */ + + public Market getMarket() { + return (Market) get("market"); + } + + public Country setMarket(Market arg) { + optimisticData.put(getKey("market"), arg); + return this; + } + + /** + * The name of the country. + */ + + public String getName() { + return (String) get("name"); + } + + public Country setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } + + /** + * The unit system used in the country. + */ + + public UnitSystem getUnitSystem() { + return (UnitSystem) get("unitSystem"); + } + + public Country setUnitSystem(UnitSystem arg) { + optimisticData.put(getKey("unitSystem"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "availableLanguages": return true; + + case "currency": return true; + + case "isoCode": return false; + + case "market": return true; + + case "name": return false; + + case "unitSystem": return false; + + default: return false; + } + } + } + + /** + * The code designating a country/region, which generally follows ISO 3166-1 alpha-2 guidelines. + * If a territory doesn't have a country code value in the `CountryCode` enum, then it might be + * considered a subdivision + * of another country. For example, the territories associated with Spain are represented by the + * country code `ES`, + * and the territories associated with the United States of America are represented by the country code + * `US`. + */ + public enum CountryCode { + /** + * Ascension Island. + */ + AC, + + /** + * Andorra. + */ + AD, + + /** + * United Arab Emirates. + */ + AE, + + /** + * Afghanistan. + */ + AF, + + /** + * Antigua & Barbuda. + */ + AG, + + /** + * Anguilla. + */ + AI, + + /** + * Albania. + */ + AL, + + /** + * Armenia. + */ + AM, + + /** + * Netherlands Antilles. + */ + AN, + + /** + * Angola. + */ + AO, + + /** + * Argentina. + */ + AR, + + /** + * Austria. + */ + AT, + + /** + * Australia. + */ + AU, + + /** + * Aruba. + */ + AW, + + /** + * Åland Islands. + */ + AX, + + /** + * Azerbaijan. + */ + AZ, + + /** + * Bosnia & Herzegovina. + */ + BA, + + /** + * Barbados. + */ + BB, + + /** + * Bangladesh. + */ + BD, + + /** + * Belgium. + */ + BE, + + /** + * Burkina Faso. + */ + BF, + + /** + * Bulgaria. + */ + BG, + + /** + * Bahrain. + */ + BH, + + /** + * Burundi. + */ + BI, + + /** + * Benin. + */ + BJ, + + /** + * St. Barthélemy. + */ + BL, + + /** + * Bermuda. + */ + BM, + + /** + * Brunei. + */ + BN, + + /** + * Bolivia. + */ + BO, + + /** + * Caribbean Netherlands. + */ + BQ, + + /** + * Brazil. + */ + BR, + + /** + * Bahamas. + */ + BS, + + /** + * Bhutan. + */ + BT, + + /** + * Bouvet Island. + */ + BV, + + /** + * Botswana. + */ + BW, + + /** + * Belarus. + */ + BY, + + /** + * Belize. + */ + BZ, + + /** + * Canada. + */ + CA, + + /** + * Cocos (Keeling) Islands. + */ + CC, + + /** + * Congo - Kinshasa. + */ + CD, + + /** + * Central African Republic. + */ + CF, + + /** + * Congo - Brazzaville. + */ + CG, + + /** + * Switzerland. + */ + CH, + + /** + * Côte d’Ivoire. + */ + CI, + + /** + * Cook Islands. + */ + CK, + + /** + * Chile. + */ + CL, + + /** + * Cameroon. + */ + CM, + + /** + * China. + */ + CN, + + /** + * Colombia. + */ + CO, + + /** + * Costa Rica. + */ + CR, + + /** + * Cuba. + */ + CU, + + /** + * Cape Verde. + */ + CV, + + /** + * Curaçao. + */ + CW, + + /** + * Christmas Island. + */ + CX, + + /** + * Cyprus. + */ + CY, + + /** + * Czechia. + */ + CZ, + + /** + * Germany. + */ + DE, + + /** + * Djibouti. + */ + DJ, + + /** + * Denmark. + */ + DK, + + /** + * Dominica. + */ + DM, + + /** + * Dominican Republic. + */ + DO, + + /** + * Algeria. + */ + DZ, + + /** + * Ecuador. + */ + EC, + + /** + * Estonia. + */ + EE, + + /** + * Egypt. + */ + EG, + + /** + * Western Sahara. + */ + EH, + + /** + * Eritrea. + */ + ER, + + /** + * Spain. + */ + ES, + + /** + * Ethiopia. + */ + ET, + + /** + * Finland. + */ + FI, + + /** + * Fiji. + */ + FJ, + + /** + * Falkland Islands. + */ + FK, + + /** + * Faroe Islands. + */ + FO, + + /** + * France. + */ + FR, + + /** + * Gabon. + */ + GA, + + /** + * United Kingdom. + */ + GB, + + /** + * Grenada. + */ + GD, + + /** + * Georgia. + */ + GE, + + /** + * French Guiana. + */ + GF, + + /** + * Guernsey. + */ + GG, + + /** + * Ghana. + */ + GH, + + /** + * Gibraltar. + */ + GI, + + /** + * Greenland. + */ + GL, + + /** + * Gambia. + */ + GM, + + /** + * Guinea. + */ + GN, + + /** + * Guadeloupe. + */ + GP, + + /** + * Equatorial Guinea. + */ + GQ, + + /** + * Greece. + */ + GR, + + /** + * South Georgia & South Sandwich Islands. + */ + GS, + + /** + * Guatemala. + */ + GT, + + /** + * Guinea-Bissau. + */ + GW, + + /** + * Guyana. + */ + GY, + + /** + * Hong Kong SAR. + */ + HK, + + /** + * Heard & McDonald Islands. + */ + HM, + + /** + * Honduras. + */ + HN, + + /** + * Croatia. + */ + HR, + + /** + * Haiti. + */ + HT, + + /** + * Hungary. + */ + HU, + + /** + * Indonesia. + */ + ID, + + /** + * Ireland. + */ + IE, + + /** + * Israel. + */ + IL, + + /** + * Isle of Man. + */ + IM, + + /** + * India. + */ + IN, + + /** + * British Indian Ocean Territory. + */ + IO, + + /** + * Iraq. + */ + IQ, + + /** + * Iran. + */ + IR, + + /** + * Iceland. + */ + IS, + + /** + * Italy. + */ + IT, + + /** + * Jersey. + */ + JE, + + /** + * Jamaica. + */ + JM, + + /** + * Jordan. + */ + JO, + + /** + * Japan. + */ + JP, + + /** + * Kenya. + */ + KE, + + /** + * Kyrgyzstan. + */ + KG, + + /** + * Cambodia. + */ + KH, + + /** + * Kiribati. + */ + KI, + + /** + * Comoros. + */ + KM, + + /** + * St. Kitts & Nevis. + */ + KN, + + /** + * North Korea. + */ + KP, + + /** + * South Korea. + */ + KR, + + /** + * Kuwait. + */ + KW, + + /** + * Cayman Islands. + */ + KY, + + /** + * Kazakhstan. + */ + KZ, + + /** + * Laos. + */ + LA, + + /** + * Lebanon. + */ + LB, + + /** + * St. Lucia. + */ + LC, + + /** + * Liechtenstein. + */ + LI, + + /** + * Sri Lanka. + */ + LK, + + /** + * Liberia. + */ + LR, + + /** + * Lesotho. + */ + LS, + + /** + * Lithuania. + */ + LT, + + /** + * Luxembourg. + */ + LU, + + /** + * Latvia. + */ + LV, + + /** + * Libya. + */ + LY, + + /** + * Morocco. + */ + MA, + + /** + * Monaco. + */ + MC, + + /** + * Moldova. + */ + MD, + + /** + * Montenegro. + */ + ME, + + /** + * St. Martin. + */ + MF, + + /** + * Madagascar. + */ + MG, + + /** + * North Macedonia. + */ + MK, + + /** + * Mali. + */ + ML, + + /** + * Myanmar (Burma). + */ + MM, + + /** + * Mongolia. + */ + MN, + + /** + * Macao SAR. + */ + MO, + + /** + * Martinique. + */ + MQ, + + /** + * Mauritania. + */ + MR, + + /** + * Montserrat. + */ + MS, + + /** + * Malta. + */ + MT, + + /** + * Mauritius. + */ + MU, + + /** + * Maldives. + */ + MV, + + /** + * Malawi. + */ + MW, + + /** + * Mexico. + */ + MX, + + /** + * Malaysia. + */ + MY, + + /** + * Mozambique. + */ + MZ, + + /** + * Namibia. + */ + NA, + + /** + * New Caledonia. + */ + NC, + + /** + * Niger. + */ + NE, + + /** + * Norfolk Island. + */ + NF, + + /** + * Nigeria. + */ + NG, + + /** + * Nicaragua. + */ + NI, + + /** + * Netherlands. + */ + NL, + + /** + * Norway. + */ + NO, + + /** + * Nepal. + */ + NP, + + /** + * Nauru. + */ + NR, + + /** + * Niue. + */ + NU, + + /** + * New Zealand. + */ + NZ, + + /** + * Oman. + */ + OM, + + /** + * Panama. + */ + PA, + + /** + * Peru. + */ + PE, + + /** + * French Polynesia. + */ + PF, + + /** + * Papua New Guinea. + */ + PG, + + /** + * Philippines. + */ + PH, + + /** + * Pakistan. + */ + PK, + + /** + * Poland. + */ + PL, + + /** + * St. Pierre & Miquelon. + */ + PM, + + /** + * Pitcairn Islands. + */ + PN, + + /** + * Palestinian Territories. + */ + PS, + + /** + * Portugal. + */ + PT, + + /** + * Paraguay. + */ + PY, + + /** + * Qatar. + */ + QA, + + /** + * Réunion. + */ + RE, + + /** + * Romania. + */ + RO, + + /** + * Serbia. + */ + RS, + + /** + * Russia. + */ + RU, + + /** + * Rwanda. + */ + RW, + + /** + * Saudi Arabia. + */ + SA, + + /** + * Solomon Islands. + */ + SB, + + /** + * Seychelles. + */ + SC, + + /** + * Sudan. + */ + SD, + + /** + * Sweden. + */ + SE, + + /** + * Singapore. + */ + SG, + + /** + * St. Helena. + */ + SH, + + /** + * Slovenia. + */ + SI, + + /** + * Svalbard & Jan Mayen. + */ + SJ, + + /** + * Slovakia. + */ + SK, + + /** + * Sierra Leone. + */ + SL, + + /** + * San Marino. + */ + SM, + + /** + * Senegal. + */ + SN, + + /** + * Somalia. + */ + SO, + + /** + * Suriname. + */ + SR, + + /** + * South Sudan. + */ + SS, + + /** + * São Tomé & Príncipe. + */ + ST, + + /** + * El Salvador. + */ + SV, + + /** + * Sint Maarten. + */ + SX, + + /** + * Syria. + */ + SY, + + /** + * Eswatini. + */ + SZ, + + /** + * Tristan da Cunha. + */ + TA, + + /** + * Turks & Caicos Islands. + */ + TC, + + /** + * Chad. + */ + TD, + + /** + * French Southern Territories. + */ + TF, + + /** + * Togo. + */ + TG, + + /** + * Thailand. + */ + TH, + + /** + * Tajikistan. + */ + TJ, + + /** + * Tokelau. + */ + TK, + + /** + * Timor-Leste. + */ + TL, + + /** + * Turkmenistan. + */ + TM, + + /** + * Tunisia. + */ + TN, + + /** + * Tonga. + */ + TO, + + /** + * Turkey. + */ + TR, + + /** + * Trinidad & Tobago. + */ + TT, + + /** + * Tuvalu. + */ + TV, + + /** + * Taiwan. + */ + TW, + + /** + * Tanzania. + */ + TZ, + + /** + * Ukraine. + */ + UA, + + /** + * Uganda. + */ + UG, + + /** + * U.S. Outlying Islands. + */ + UM, + + /** + * United States. + */ + US, + + /** + * Uruguay. + */ + UY, + + /** + * Uzbekistan. + */ + UZ, + + /** + * Vatican City. + */ + VA, + + /** + * St. Vincent & Grenadines. + */ + VC, + + /** + * Venezuela. + */ + VE, + + /** + * British Virgin Islands. + */ + VG, + + /** + * Vietnam. + */ + VN, + + /** + * Vanuatu. + */ + VU, + + /** + * Wallis & Futuna. + */ + WF, + + /** + * Samoa. + */ + WS, + + /** + * Kosovo. + */ + XK, + + /** + * Yemen. + */ + YE, + + /** + * Mayotte. + */ + YT, + + /** + * South Africa. + */ + ZA, + + /** + * Zambia. + */ + ZM, + + /** + * Zimbabwe. + */ + ZW, + + /** + * Unknown Region. + */ + ZZ, + + UNKNOWN_VALUE; + + public static CountryCode fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "AC": { + return AC; + } + + case "AD": { + return AD; + } + + case "AE": { + return AE; + } + + case "AF": { + return AF; + } + + case "AG": { + return AG; + } + + case "AI": { + return AI; + } + + case "AL": { + return AL; + } + + case "AM": { + return AM; + } + + case "AN": { + return AN; + } + + case "AO": { + return AO; + } + + case "AR": { + return AR; + } + + case "AT": { + return AT; + } + + case "AU": { + return AU; + } + + case "AW": { + return AW; + } + + case "AX": { + return AX; + } + + case "AZ": { + return AZ; + } + + case "BA": { + return BA; + } + + case "BB": { + return BB; + } + + case "BD": { + return BD; + } + + case "BE": { + return BE; + } + + case "BF": { + return BF; + } + + case "BG": { + return BG; + } + + case "BH": { + return BH; + } + + case "BI": { + return BI; + } + + case "BJ": { + return BJ; + } + + case "BL": { + return BL; + } + + case "BM": { + return BM; + } + + case "BN": { + return BN; + } + + case "BO": { + return BO; + } + + case "BQ": { + return BQ; + } + + case "BR": { + return BR; + } + + case "BS": { + return BS; + } + + case "BT": { + return BT; + } + + case "BV": { + return BV; + } + + case "BW": { + return BW; + } + + case "BY": { + return BY; + } + + case "BZ": { + return BZ; + } + + case "CA": { + return CA; + } + + case "CC": { + return CC; + } + + case "CD": { + return CD; + } + + case "CF": { + return CF; + } + + case "CG": { + return CG; + } + + case "CH": { + return CH; + } + + case "CI": { + return CI; + } + + case "CK": { + return CK; + } + + case "CL": { + return CL; + } + + case "CM": { + return CM; + } + + case "CN": { + return CN; + } + + case "CO": { + return CO; + } + + case "CR": { + return CR; + } + + case "CU": { + return CU; + } + + case "CV": { + return CV; + } + + case "CW": { + return CW; + } + + case "CX": { + return CX; + } + + case "CY": { + return CY; + } + + case "CZ": { + return CZ; + } + + case "DE": { + return DE; + } + + case "DJ": { + return DJ; + } + + case "DK": { + return DK; + } + + case "DM": { + return DM; + } + + case "DO": { + return DO; + } + + case "DZ": { + return DZ; + } + + case "EC": { + return EC; + } + + case "EE": { + return EE; + } + + case "EG": { + return EG; + } + + case "EH": { + return EH; + } + + case "ER": { + return ER; + } + + case "ES": { + return ES; + } + + case "ET": { + return ET; + } + + case "FI": { + return FI; + } + + case "FJ": { + return FJ; + } + + case "FK": { + return FK; + } + + case "FO": { + return FO; + } + + case "FR": { + return FR; + } + + case "GA": { + return GA; + } + + case "GB": { + return GB; + } + + case "GD": { + return GD; + } + + case "GE": { + return GE; + } + + case "GF": { + return GF; + } + + case "GG": { + return GG; + } + + case "GH": { + return GH; + } + + case "GI": { + return GI; + } + + case "GL": { + return GL; + } + + case "GM": { + return GM; + } + + case "GN": { + return GN; + } + + case "GP": { + return GP; + } + + case "GQ": { + return GQ; + } + + case "GR": { + return GR; + } + + case "GS": { + return GS; + } + + case "GT": { + return GT; + } + + case "GW": { + return GW; + } + + case "GY": { + return GY; + } + + case "HK": { + return HK; + } + + case "HM": { + return HM; + } + + case "HN": { + return HN; + } + + case "HR": { + return HR; + } + + case "HT": { + return HT; + } + + case "HU": { + return HU; + } + + case "ID": { + return ID; + } + + case "IE": { + return IE; + } + + case "IL": { + return IL; + } + + case "IM": { + return IM; + } + + case "IN": { + return IN; + } + + case "IO": { + return IO; + } + + case "IQ": { + return IQ; + } + + case "IR": { + return IR; + } + + case "IS": { + return IS; + } + + case "IT": { + return IT; + } + + case "JE": { + return JE; + } + + case "JM": { + return JM; + } + + case "JO": { + return JO; + } + + case "JP": { + return JP; + } + + case "KE": { + return KE; + } + + case "KG": { + return KG; + } + + case "KH": { + return KH; + } + + case "KI": { + return KI; + } + + case "KM": { + return KM; + } + + case "KN": { + return KN; + } + + case "KP": { + return KP; + } + + case "KR": { + return KR; + } + + case "KW": { + return KW; + } + + case "KY": { + return KY; + } + + case "KZ": { + return KZ; + } + + case "LA": { + return LA; + } + + case "LB": { + return LB; + } + + case "LC": { + return LC; + } + + case "LI": { + return LI; + } + + case "LK": { + return LK; + } + + case "LR": { + return LR; + } + + case "LS": { + return LS; + } + + case "LT": { + return LT; + } + + case "LU": { + return LU; + } + + case "LV": { + return LV; + } + + case "LY": { + return LY; + } + + case "MA": { + return MA; + } + + case "MC": { + return MC; + } + + case "MD": { + return MD; + } + + case "ME": { + return ME; + } + + case "MF": { + return MF; + } + + case "MG": { + return MG; + } + + case "MK": { + return MK; + } + + case "ML": { + return ML; + } + + case "MM": { + return MM; + } + + case "MN": { + return MN; + } + + case "MO": { + return MO; + } + + case "MQ": { + return MQ; + } + + case "MR": { + return MR; + } + + case "MS": { + return MS; + } + + case "MT": { + return MT; + } + + case "MU": { + return MU; + } + + case "MV": { + return MV; + } + + case "MW": { + return MW; + } + + case "MX": { + return MX; + } + + case "MY": { + return MY; + } + + case "MZ": { + return MZ; + } + + case "NA": { + return NA; + } + + case "NC": { + return NC; + } + + case "NE": { + return NE; + } + + case "NF": { + return NF; + } + + case "NG": { + return NG; + } + + case "NI": { + return NI; + } + + case "NL": { + return NL; + } + + case "NO": { + return NO; + } + + case "NP": { + return NP; + } + + case "NR": { + return NR; + } + + case "NU": { + return NU; + } + + case "NZ": { + return NZ; + } + + case "OM": { + return OM; + } + + case "PA": { + return PA; + } + + case "PE": { + return PE; + } + + case "PF": { + return PF; + } + + case "PG": { + return PG; + } + + case "PH": { + return PH; + } + + case "PK": { + return PK; + } + + case "PL": { + return PL; + } + + case "PM": { + return PM; + } + + case "PN": { + return PN; + } + + case "PS": { + return PS; + } + + case "PT": { + return PT; + } + + case "PY": { + return PY; + } + + case "QA": { + return QA; + } + + case "RE": { + return RE; + } + + case "RO": { + return RO; + } + + case "RS": { + return RS; + } + + case "RU": { + return RU; + } + + case "RW": { + return RW; + } + + case "SA": { + return SA; + } + + case "SB": { + return SB; + } + + case "SC": { + return SC; + } + + case "SD": { + return SD; + } + + case "SE": { + return SE; + } + + case "SG": { + return SG; + } + + case "SH": { + return SH; + } + + case "SI": { + return SI; + } + + case "SJ": { + return SJ; + } + + case "SK": { + return SK; + } + + case "SL": { + return SL; + } + + case "SM": { + return SM; + } + + case "SN": { + return SN; + } + + case "SO": { + return SO; + } + + case "SR": { + return SR; + } + + case "SS": { + return SS; + } + + case "ST": { + return ST; + } + + case "SV": { + return SV; + } + + case "SX": { + return SX; + } + + case "SY": { + return SY; + } + + case "SZ": { + return SZ; + } + + case "TA": { + return TA; + } + + case "TC": { + return TC; + } + + case "TD": { + return TD; + } + + case "TF": { + return TF; + } + + case "TG": { + return TG; + } + + case "TH": { + return TH; + } + + case "TJ": { + return TJ; + } + + case "TK": { + return TK; + } + + case "TL": { + return TL; + } + + case "TM": { + return TM; + } + + case "TN": { + return TN; + } + + case "TO": { + return TO; + } + + case "TR": { + return TR; + } + + case "TT": { + return TT; + } + + case "TV": { + return TV; + } + + case "TW": { + return TW; + } + + case "TZ": { + return TZ; + } + + case "UA": { + return UA; + } + + case "UG": { + return UG; + } + + case "UM": { + return UM; + } + + case "US": { + return US; + } + + case "UY": { + return UY; + } + + case "UZ": { + return UZ; + } + + case "VA": { + return VA; + } + + case "VC": { + return VC; + } + + case "VE": { return VE; } - case "VG": { - return VG; + case "VG": { + return VG; + } + + case "VN": { + return VN; + } + + case "VU": { + return VU; + } + + case "WF": { + return WF; + } + + case "WS": { + return WS; + } + + case "XK": { + return XK; + } + + case "YE": { + return YE; + } + + case "YT": { + return YT; + } + + case "ZA": { + return ZA; + } + + case "ZM": { + return ZM; + } + + case "ZW": { + return ZW; + } + + case "ZZ": { + return ZZ; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case AC: { + return "AC"; + } + + case AD: { + return "AD"; + } + + case AE: { + return "AE"; + } + + case AF: { + return "AF"; + } + + case AG: { + return "AG"; + } + + case AI: { + return "AI"; + } + + case AL: { + return "AL"; + } + + case AM: { + return "AM"; + } + + case AN: { + return "AN"; + } + + case AO: { + return "AO"; + } + + case AR: { + return "AR"; + } + + case AT: { + return "AT"; + } + + case AU: { + return "AU"; + } + + case AW: { + return "AW"; + } + + case AX: { + return "AX"; + } + + case AZ: { + return "AZ"; + } + + case BA: { + return "BA"; + } + + case BB: { + return "BB"; + } + + case BD: { + return "BD"; + } + + case BE: { + return "BE"; + } + + case BF: { + return "BF"; + } + + case BG: { + return "BG"; + } + + case BH: { + return "BH"; + } + + case BI: { + return "BI"; + } + + case BJ: { + return "BJ"; + } + + case BL: { + return "BL"; + } + + case BM: { + return "BM"; + } + + case BN: { + return "BN"; + } + + case BO: { + return "BO"; + } + + case BQ: { + return "BQ"; + } + + case BR: { + return "BR"; + } + + case BS: { + return "BS"; + } + + case BT: { + return "BT"; + } + + case BV: { + return "BV"; + } + + case BW: { + return "BW"; + } + + case BY: { + return "BY"; + } + + case BZ: { + return "BZ"; + } + + case CA: { + return "CA"; + } + + case CC: { + return "CC"; + } + + case CD: { + return "CD"; + } + + case CF: { + return "CF"; + } + + case CG: { + return "CG"; + } + + case CH: { + return "CH"; + } + + case CI: { + return "CI"; + } + + case CK: { + return "CK"; + } + + case CL: { + return "CL"; + } + + case CM: { + return "CM"; + } + + case CN: { + return "CN"; + } + + case CO: { + return "CO"; + } + + case CR: { + return "CR"; + } + + case CU: { + return "CU"; + } + + case CV: { + return "CV"; + } + + case CW: { + return "CW"; + } + + case CX: { + return "CX"; + } + + case CY: { + return "CY"; + } + + case CZ: { + return "CZ"; + } + + case DE: { + return "DE"; + } + + case DJ: { + return "DJ"; + } + + case DK: { + return "DK"; + } + + case DM: { + return "DM"; + } + + case DO: { + return "DO"; + } + + case DZ: { + return "DZ"; + } + + case EC: { + return "EC"; + } + + case EE: { + return "EE"; + } + + case EG: { + return "EG"; + } + + case EH: { + return "EH"; + } + + case ER: { + return "ER"; + } + + case ES: { + return "ES"; + } + + case ET: { + return "ET"; + } + + case FI: { + return "FI"; + } + + case FJ: { + return "FJ"; + } + + case FK: { + return "FK"; + } + + case FO: { + return "FO"; + } + + case FR: { + return "FR"; + } + + case GA: { + return "GA"; + } + + case GB: { + return "GB"; + } + + case GD: { + return "GD"; + } + + case GE: { + return "GE"; + } + + case GF: { + return "GF"; + } + + case GG: { + return "GG"; + } + + case GH: { + return "GH"; + } + + case GI: { + return "GI"; + } + + case GL: { + return "GL"; + } + + case GM: { + return "GM"; + } + + case GN: { + return "GN"; + } + + case GP: { + return "GP"; + } + + case GQ: { + return "GQ"; + } + + case GR: { + return "GR"; + } + + case GS: { + return "GS"; + } + + case GT: { + return "GT"; + } + + case GW: { + return "GW"; + } + + case GY: { + return "GY"; + } + + case HK: { + return "HK"; + } + + case HM: { + return "HM"; + } + + case HN: { + return "HN"; + } + + case HR: { + return "HR"; + } + + case HT: { + return "HT"; + } + + case HU: { + return "HU"; + } + + case ID: { + return "ID"; + } + + case IE: { + return "IE"; + } + + case IL: { + return "IL"; + } + + case IM: { + return "IM"; + } + + case IN: { + return "IN"; + } + + case IO: { + return "IO"; + } + + case IQ: { + return "IQ"; + } + + case IR: { + return "IR"; + } + + case IS: { + return "IS"; + } + + case IT: { + return "IT"; + } + + case JE: { + return "JE"; + } + + case JM: { + return "JM"; + } + + case JO: { + return "JO"; + } + + case JP: { + return "JP"; + } + + case KE: { + return "KE"; + } + + case KG: { + return "KG"; + } + + case KH: { + return "KH"; + } + + case KI: { + return "KI"; + } + + case KM: { + return "KM"; + } + + case KN: { + return "KN"; + } + + case KP: { + return "KP"; + } + + case KR: { + return "KR"; + } + + case KW: { + return "KW"; + } + + case KY: { + return "KY"; + } + + case KZ: { + return "KZ"; + } + + case LA: { + return "LA"; + } + + case LB: { + return "LB"; + } + + case LC: { + return "LC"; + } + + case LI: { + return "LI"; + } + + case LK: { + return "LK"; + } + + case LR: { + return "LR"; + } + + case LS: { + return "LS"; + } + + case LT: { + return "LT"; + } + + case LU: { + return "LU"; + } + + case LV: { + return "LV"; + } + + case LY: { + return "LY"; + } + + case MA: { + return "MA"; + } + + case MC: { + return "MC"; + } + + case MD: { + return "MD"; + } + + case ME: { + return "ME"; + } + + case MF: { + return "MF"; + } + + case MG: { + return "MG"; + } + + case MK: { + return "MK"; + } + + case ML: { + return "ML"; + } + + case MM: { + return "MM"; + } + + case MN: { + return "MN"; + } + + case MO: { + return "MO"; + } + + case MQ: { + return "MQ"; + } + + case MR: { + return "MR"; + } + + case MS: { + return "MS"; + } + + case MT: { + return "MT"; + } + + case MU: { + return "MU"; + } + + case MV: { + return "MV"; + } + + case MW: { + return "MW"; + } + + case MX: { + return "MX"; + } + + case MY: { + return "MY"; + } + + case MZ: { + return "MZ"; + } + + case NA: { + return "NA"; + } + + case NC: { + return "NC"; + } + + case NE: { + return "NE"; + } + + case NF: { + return "NF"; + } + + case NG: { + return "NG"; + } + + case NI: { + return "NI"; + } + + case NL: { + return "NL"; + } + + case NO: { + return "NO"; + } + + case NP: { + return "NP"; + } + + case NR: { + return "NR"; + } + + case NU: { + return "NU"; + } + + case NZ: { + return "NZ"; + } + + case OM: { + return "OM"; + } + + case PA: { + return "PA"; + } + + case PE: { + return "PE"; + } + + case PF: { + return "PF"; + } + + case PG: { + return "PG"; + } + + case PH: { + return "PH"; + } + + case PK: { + return "PK"; + } + + case PL: { + return "PL"; + } + + case PM: { + return "PM"; + } + + case PN: { + return "PN"; + } + + case PS: { + return "PS"; + } + + case PT: { + return "PT"; + } + + case PY: { + return "PY"; + } + + case QA: { + return "QA"; + } + + case RE: { + return "RE"; + } + + case RO: { + return "RO"; + } + + case RS: { + return "RS"; + } + + case RU: { + return "RU"; + } + + case RW: { + return "RW"; + } + + case SA: { + return "SA"; + } + + case SB: { + return "SB"; + } + + case SC: { + return "SC"; + } + + case SD: { + return "SD"; + } + + case SE: { + return "SE"; + } + + case SG: { + return "SG"; + } + + case SH: { + return "SH"; + } + + case SI: { + return "SI"; + } + + case SJ: { + return "SJ"; + } + + case SK: { + return "SK"; + } + + case SL: { + return "SL"; + } + + case SM: { + return "SM"; + } + + case SN: { + return "SN"; + } + + case SO: { + return "SO"; + } + + case SR: { + return "SR"; + } + + case SS: { + return "SS"; + } + + case ST: { + return "ST"; + } + + case SV: { + return "SV"; + } + + case SX: { + return "SX"; + } + + case SY: { + return "SY"; + } + + case SZ: { + return "SZ"; + } + + case TA: { + return "TA"; + } + + case TC: { + return "TC"; + } + + case TD: { + return "TD"; + } + + case TF: { + return "TF"; + } + + case TG: { + return "TG"; + } + + case TH: { + return "TH"; + } + + case TJ: { + return "TJ"; + } + + case TK: { + return "TK"; + } + + case TL: { + return "TL"; + } + + case TM: { + return "TM"; + } + + case TN: { + return "TN"; + } + + case TO: { + return "TO"; + } + + case TR: { + return "TR"; + } + + case TT: { + return "TT"; + } + + case TV: { + return "TV"; + } + + case TW: { + return "TW"; + } + + case TZ: { + return "TZ"; + } + + case UA: { + return "UA"; + } + + case UG: { + return "UG"; + } + + case UM: { + return "UM"; + } + + case US: { + return "US"; + } + + case UY: { + return "UY"; + } + + case UZ: { + return "UZ"; + } + + case VA: { + return "VA"; + } + + case VC: { + return "VC"; + } + + case VE: { + return "VE"; + } + + case VG: { + return "VG"; + } + + case VN: { + return "VN"; + } + + case VU: { + return "VU"; + } + + case WF: { + return "WF"; + } + + case WS: { + return "WS"; + } + + case XK: { + return "XK"; + } + + case YE: { + return "YE"; + } + + case YT: { + return "YT"; + } + + case ZA: { + return "ZA"; + } + + case ZM: { + return "ZM"; + } + + case ZW: { + return "ZW"; + } + + case ZZ: { + return "ZZ"; + } + + default: { + return ""; + } + } + } + } + + public interface CreditCardQueryDefinition { + void define(CreditCardQuery _queryBuilder); + } + + /** + * Credit card information used for a payment. + */ + public static class CreditCardQuery extends Query { + CreditCardQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The brand of the credit card. + */ + public CreditCardQuery brand() { + startField("brand"); + + return this; + } + + /** + * The expiry month of the credit card. + */ + public CreditCardQuery expiryMonth() { + startField("expiryMonth"); + + return this; + } + + /** + * The expiry year of the credit card. + */ + public CreditCardQuery expiryYear() { + startField("expiryYear"); + + return this; + } + + /** + * The credit card's BIN number. + */ + public CreditCardQuery firstDigits() { + startField("firstDigits"); + + return this; + } + + /** + * The first name of the card holder. + */ + public CreditCardQuery firstName() { + startField("firstName"); + + return this; + } + + /** + * The last 4 digits of the credit card. + */ + public CreditCardQuery lastDigits() { + startField("lastDigits"); + + return this; + } + + /** + * The last name of the card holder. + */ + public CreditCardQuery lastName() { + startField("lastName"); + + return this; + } + + /** + * The masked credit card number with only the last 4 digits displayed. + */ + public CreditCardQuery maskedNumber() { + startField("maskedNumber"); + + return this; + } + } + + /** + * Credit card information used for a payment. + */ + public static class CreditCard extends AbstractResponse { + public CreditCard() { + } + + public CreditCard(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "brand": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "expiryMonth": { + Integer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsInteger(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "expiryYear": { + Integer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsInteger(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "firstDigits": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "firstName": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "lastDigits": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "lastName": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "maskedNumber": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "CreditCard"; + } + + /** + * The brand of the credit card. + */ + + public String getBrand() { + return (String) get("brand"); + } + + public CreditCard setBrand(String arg) { + optimisticData.put(getKey("brand"), arg); + return this; + } + + /** + * The expiry month of the credit card. + */ + + public Integer getExpiryMonth() { + return (Integer) get("expiryMonth"); + } + + public CreditCard setExpiryMonth(Integer arg) { + optimisticData.put(getKey("expiryMonth"), arg); + return this; + } + + /** + * The expiry year of the credit card. + */ + + public Integer getExpiryYear() { + return (Integer) get("expiryYear"); + } + + public CreditCard setExpiryYear(Integer arg) { + optimisticData.put(getKey("expiryYear"), arg); + return this; + } + + /** + * The credit card's BIN number. + */ + + public String getFirstDigits() { + return (String) get("firstDigits"); + } + + public CreditCard setFirstDigits(String arg) { + optimisticData.put(getKey("firstDigits"), arg); + return this; + } + + /** + * The first name of the card holder. + */ + + public String getFirstName() { + return (String) get("firstName"); + } + + public CreditCard setFirstName(String arg) { + optimisticData.put(getKey("firstName"), arg); + return this; + } + + /** + * The last 4 digits of the credit card. + */ + + public String getLastDigits() { + return (String) get("lastDigits"); + } + + public CreditCard setLastDigits(String arg) { + optimisticData.put(getKey("lastDigits"), arg); + return this; + } + + /** + * The last name of the card holder. + */ + + public String getLastName() { + return (String) get("lastName"); + } + + public CreditCard setLastName(String arg) { + optimisticData.put(getKey("lastName"), arg); + return this; + } + + /** + * The masked credit card number with only the last 4 digits displayed. + */ + + public String getMaskedNumber() { + return (String) get("maskedNumber"); + } + + public CreditCard setMaskedNumber(String arg) { + optimisticData.put(getKey("maskedNumber"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "brand": return false; + + case "expiryMonth": return false; + + case "expiryYear": return false; + + case "firstDigits": return false; + + case "firstName": return false; + + case "lastDigits": return false; + + case "lastName": return false; + + case "maskedNumber": return false; + + default: return false; + } + } + } + + public static class CreditCardPaymentInputV2 implements Serializable { + private MoneyInput paymentAmount; + + private String idempotencyKey; + + private MailingAddressInput billingAddress; + + private String vaultId; + + private Input test = Input.undefined(); + + public CreditCardPaymentInputV2(MoneyInput paymentAmount, String idempotencyKey, MailingAddressInput billingAddress, String vaultId) { + this.paymentAmount = paymentAmount; + + this.idempotencyKey = idempotencyKey; + + this.billingAddress = billingAddress; + + this.vaultId = vaultId; + } + + public MoneyInput getPaymentAmount() { + return paymentAmount; + } + + public CreditCardPaymentInputV2 setPaymentAmount(MoneyInput paymentAmount) { + this.paymentAmount = paymentAmount; + return this; + } + + public String getIdempotencyKey() { + return idempotencyKey; + } + + public CreditCardPaymentInputV2 setIdempotencyKey(String idempotencyKey) { + this.idempotencyKey = idempotencyKey; + return this; + } + + public MailingAddressInput getBillingAddress() { + return billingAddress; + } + + public CreditCardPaymentInputV2 setBillingAddress(MailingAddressInput billingAddress) { + this.billingAddress = billingAddress; + return this; + } + + public String getVaultId() { + return vaultId; + } + + public CreditCardPaymentInputV2 setVaultId(String vaultId) { + this.vaultId = vaultId; + return this; + } + + public Boolean getTest() { + return test.getValue(); + } + + public Input getTestInput() { + return test; + } + + public CreditCardPaymentInputV2 setTest(Boolean test) { + this.test = Input.optional(test); + return this; + } + + public CreditCardPaymentInputV2 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("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("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('}'); + } + } + + /** + * The part of the image that should remain after cropping. + */ + public enum CropRegion { + /** + * Keep the bottom of the image. + */ + BOTTOM, + + /** + * Keep the center of the image. + */ + CENTER, + + /** + * Keep the left of the image. + */ + LEFT, + + /** + * Keep the right of the image. + */ + RIGHT, + + /** + * Keep the top of the image. + */ + TOP, + + UNKNOWN_VALUE; + + public static CropRegion fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "BOTTOM": { + return BOTTOM; + } + + case "CENTER": { + return CENTER; + } + + case "LEFT": { + return LEFT; + } + + case "RIGHT": { + return RIGHT; + } + + case "TOP": { + return TOP; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case BOTTOM: { + return "BOTTOM"; + } + + case CENTER: { + return "CENTER"; + } + + case LEFT: { + return "LEFT"; + } + + case RIGHT: { + return "RIGHT"; + } + + case TOP: { + return "TOP"; + } + + default: { + return ""; + } + } + } + } + + public interface CurrencyQueryDefinition { + void define(CurrencyQuery _queryBuilder); + } + + /** + * A currency. + */ + public static class CurrencyQuery extends Query { + CurrencyQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The ISO code of the currency. + */ + public CurrencyQuery isoCode() { + startField("isoCode"); + + return this; + } + + /** + * The name of the currency. + */ + public CurrencyQuery name() { + startField("name"); + + return this; + } + + /** + * The symbol of the currency. + */ + public CurrencyQuery symbol() { + startField("symbol"); + + return this; + } + } + + /** + * A currency. + */ + public static class Currency extends AbstractResponse { + public Currency() { + } + + public Currency(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "isoCode": { + responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "symbol": { + 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 "Currency"; + } + + /** + * The ISO code of the currency. + */ + + public CurrencyCode getIsoCode() { + return (CurrencyCode) get("isoCode"); + } + + public Currency setIsoCode(CurrencyCode arg) { + optimisticData.put(getKey("isoCode"), arg); + return this; + } + + /** + * The name of the currency. + */ + + public String getName() { + return (String) get("name"); + } + + public Currency setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } + + /** + * The symbol of the currency. + */ + + public String getSymbol() { + return (String) get("symbol"); + } + + public Currency setSymbol(String arg) { + optimisticData.put(getKey("symbol"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "isoCode": return false; + + case "name": return false; + + case "symbol": return false; + + default: return false; + } + } + } + + /** + * The three-letter currency codes that represent the world currencies used in stores. These include + * standard ISO 4217 codes, legacy codes, + * and non-standard codes. + */ + public enum CurrencyCode { + /** + * United Arab Emirates Dirham (AED). + */ + AED, + + /** + * Afghan Afghani (AFN). + */ + AFN, + + /** + * Albanian Lek (ALL). + */ + ALL, + + /** + * Armenian Dram (AMD). + */ + AMD, + + /** + * Netherlands Antillean Guilder. + */ + ANG, + + /** + * Angolan Kwanza (AOA). + */ + AOA, + + /** + * Argentine Pesos (ARS). + */ + ARS, + + /** + * Australian Dollars (AUD). + */ + AUD, + + /** + * Aruban Florin (AWG). + */ + AWG, + + /** + * Azerbaijani Manat (AZN). + */ + AZN, + + /** + * Bosnia and Herzegovina Convertible Mark (BAM). + */ + BAM, + + /** + * Barbadian Dollar (BBD). + */ + BBD, + + /** + * Bangladesh Taka (BDT). + */ + BDT, + + /** + * Bulgarian Lev (BGN). + */ + BGN, + + /** + * Bahraini Dinar (BHD). + */ + BHD, + + /** + * Burundian Franc (BIF). + */ + BIF, + + /** + * Bermudian Dollar (BMD). + */ + BMD, + + /** + * Brunei Dollar (BND). + */ + BND, + + /** + * Bolivian Boliviano (BOB). + */ + BOB, + + /** + * Brazilian Real (BRL). + */ + BRL, + + /** + * Bahamian Dollar (BSD). + */ + BSD, + + /** + * Bhutanese Ngultrum (BTN). + */ + BTN, + + /** + * Botswana Pula (BWP). + */ + BWP, + + /** + * Belarusian Ruble (BYN). + */ + BYN, + + /** + * Belarusian Ruble (BYR). + * + * @deprecated `BYR` is deprecated. Use `BYN` available from version `2021-01` onwards instead. + */ + @Deprecated + BYR, + + /** + * Belize Dollar (BZD). + */ + BZD, + + /** + * Canadian Dollars (CAD). + */ + CAD, + + /** + * Congolese franc (CDF). + */ + CDF, + + /** + * Swiss Francs (CHF). + */ + CHF, + + /** + * Chilean Peso (CLP). + */ + CLP, + + /** + * Chinese Yuan Renminbi (CNY). + */ + CNY, + + /** + * Colombian Peso (COP). + */ + COP, + + /** + * Costa Rican Colones (CRC). + */ + CRC, + + /** + * Cape Verdean escudo (CVE). + */ + CVE, + + /** + * Czech Koruny (CZK). + */ + CZK, + + /** + * Djiboutian Franc (DJF). + */ + DJF, + + /** + * Danish Kroner (DKK). + */ + DKK, + + /** + * Dominican Peso (DOP). + */ + DOP, + + /** + * Algerian Dinar (DZD). + */ + DZD, + + /** + * Egyptian Pound (EGP). + */ + EGP, + + /** + * Eritrean Nakfa (ERN). + */ + ERN, + + /** + * Ethiopian Birr (ETB). + */ + ETB, + + /** + * Euro (EUR). + */ + EUR, + + /** + * Fijian Dollars (FJD). + */ + FJD, + + /** + * Falkland Islands Pounds (FKP). + */ + FKP, + + /** + * United Kingdom Pounds (GBP). + */ + GBP, + + /** + * Georgian Lari (GEL). + */ + GEL, + + /** + * Ghanaian Cedi (GHS). + */ + GHS, + + /** + * Gibraltar Pounds (GIP). + */ + GIP, + + /** + * Gambian Dalasi (GMD). + */ + GMD, + + /** + * Guinean Franc (GNF). + */ + GNF, + + /** + * Guatemalan Quetzal (GTQ). + */ + GTQ, + + /** + * Guyanese Dollar (GYD). + */ + GYD, + + /** + * Hong Kong Dollars (HKD). + */ + HKD, + + /** + * Honduran Lempira (HNL). + */ + HNL, + + /** + * Croatian Kuna (HRK). + */ + HRK, + + /** + * Haitian Gourde (HTG). + */ + HTG, + + /** + * Hungarian Forint (HUF). + */ + HUF, + + /** + * Indonesian Rupiah (IDR). + */ + IDR, + + /** + * Israeli New Shekel (NIS). + */ + ILS, + + /** + * Indian Rupees (INR). + */ + INR, + + /** + * Iraqi Dinar (IQD). + */ + IQD, + + /** + * Iranian Rial (IRR). + */ + IRR, + + /** + * Icelandic Kronur (ISK). + */ + ISK, + + /** + * Jersey Pound. + */ + JEP, + + /** + * Jamaican Dollars (JMD). + */ + JMD, + + /** + * Jordanian Dinar (JOD). + */ + JOD, + + /** + * Japanese Yen (JPY). + */ + JPY, + + /** + * Kenyan Shilling (KES). + */ + KES, + + /** + * Kyrgyzstani Som (KGS). + */ + KGS, + + /** + * Cambodian Riel. + */ + KHR, + + /** + * Kiribati Dollar (KID). + */ + KID, + + /** + * Comorian Franc (KMF). + */ + KMF, + + /** + * South Korean Won (KRW). + */ + KRW, + + /** + * Kuwaiti Dinar (KWD). + */ + KWD, + + /** + * Cayman Dollars (KYD). + */ + KYD, + + /** + * Kazakhstani Tenge (KZT). + */ + KZT, + + /** + * Laotian Kip (LAK). + */ + LAK, + + /** + * Lebanese Pounds (LBP). + */ + LBP, + + /** + * Sri Lankan Rupees (LKR). + */ + LKR, + + /** + * Liberian Dollar (LRD). + */ + LRD, + + /** + * Lesotho Loti (LSL). + */ + LSL, + + /** + * Lithuanian Litai (LTL). + */ + LTL, + + /** + * Latvian Lati (LVL). + */ + LVL, + + /** + * Libyan Dinar (LYD). + */ + LYD, + + /** + * Moroccan Dirham. + */ + MAD, + + /** + * Moldovan Leu (MDL). + */ + MDL, + + /** + * Malagasy Ariary (MGA). + */ + MGA, + + /** + * Macedonia Denar (MKD). + */ + MKD, + + /** + * Burmese Kyat (MMK). + */ + MMK, + + /** + * Mongolian Tugrik. + */ + MNT, + + /** + * Macanese Pataca (MOP). + */ + MOP, + + /** + * Mauritanian Ouguiya (MRU). + */ + MRU, + + /** + * Mauritian Rupee (MUR). + */ + MUR, + + /** + * Maldivian Rufiyaa (MVR). + */ + MVR, + + /** + * Malawian Kwacha (MWK). + */ + MWK, + + /** + * Mexican Pesos (MXN). + */ + MXN, + + /** + * Malaysian Ringgits (MYR). + */ + MYR, + + /** + * Mozambican Metical. + */ + MZN, + + /** + * Namibian Dollar. + */ + NAD, + + /** + * Nigerian Naira (NGN). + */ + NGN, + + /** + * Nicaraguan Córdoba (NIO). + */ + NIO, + + /** + * Norwegian Kroner (NOK). + */ + NOK, + + /** + * Nepalese Rupee (NPR). + */ + NPR, + + /** + * New Zealand Dollars (NZD). + */ + NZD, + + /** + * Omani Rial (OMR). + */ + OMR, + + /** + * Panamian Balboa (PAB). + */ + PAB, + + /** + * Peruvian Nuevo Sol (PEN). + */ + PEN, + + /** + * Papua New Guinean Kina (PGK). + */ + PGK, + + /** + * Philippine Peso (PHP). + */ + PHP, + + /** + * Pakistani Rupee (PKR). + */ + PKR, + + /** + * Polish Zlotych (PLN). + */ + PLN, + + /** + * Paraguayan Guarani (PYG). + */ + PYG, + + /** + * Qatari Rial (QAR). + */ + QAR, + + /** + * Romanian Lei (RON). + */ + RON, + + /** + * Serbian dinar (RSD). + */ + RSD, + + /** + * Russian Rubles (RUB). + */ + RUB, + + /** + * Rwandan Franc (RWF). + */ + RWF, + + /** + * Saudi Riyal (SAR). + */ + SAR, + + /** + * Solomon Islands Dollar (SBD). + */ + SBD, + + /** + * Seychellois Rupee (SCR). + */ + SCR, + + /** + * Sudanese Pound (SDG). + */ + SDG, + + /** + * Swedish Kronor (SEK). + */ + SEK, + + /** + * Singapore Dollars (SGD). + */ + SGD, + + /** + * Saint Helena Pounds (SHP). + */ + SHP, + + /** + * Sierra Leonean Leone (SLL). + */ + SLL, + + /** + * Somali Shilling (SOS). + */ + SOS, + + /** + * Surinamese Dollar (SRD). + */ + SRD, + + /** + * South Sudanese Pound (SSP). + */ + SSP, + + /** + * 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). + */ + SYP, + + /** + * Swazi Lilangeni (SZL). + */ + SZL, + + /** + * Thai baht (THB). + */ + THB, + + /** + * Tajikistani Somoni (TJS). + */ + TJS, + + /** + * Turkmenistani Manat (TMT). + */ + TMT, + + /** + * Tunisian Dinar (TND). + */ + TND, + + /** + * Tongan Pa'anga (TOP). + */ + TOP, + + /** + * Turkish Lira (TRY). + */ + TRY, + + /** + * Trinidad and Tobago Dollars (TTD). + */ + TTD, + + /** + * Taiwan Dollars (TWD). + */ + TWD, + + /** + * Tanzanian Shilling (TZS). + */ + TZS, + + /** + * Ukrainian Hryvnia (UAH). + */ + UAH, + + /** + * Ugandan Shilling (UGX). + */ + UGX, + + /** + * United States Dollars (USD). + */ + USD, + + /** + * Uruguayan Pesos (UYU). + */ + UYU, + + /** + * Uzbekistan som (UZS). + */ + UZS, + + /** + * Venezuelan Bolivares (VED). + */ + VED, + + /** + * Venezuelan Bolivares (VEF). + * + * @deprecated `VEF` is deprecated. Use `VES` available from version `2020-10` onwards instead. + */ + @Deprecated + VEF, + + /** + * Venezuelan Bolivares (VES). + */ + VES, + + /** + * Vietnamese đồng (VND). + */ + VND, + + /** + * Vanuatu Vatu (VUV). + */ + VUV, + + /** + * Samoan Tala (WST). + */ + WST, + + /** + * Central African CFA Franc (XAF). + */ + XAF, + + /** + * East Caribbean Dollar (XCD). + */ + XCD, + + /** + * West African CFA franc (XOF). + */ + XOF, + + /** + * CFP Franc (XPF). + */ + XPF, + + /** + * Unrecognized currency. + */ + XXX, + + /** + * Yemeni Rial (YER). + */ + YER, + + /** + * South African Rand (ZAR). + */ + ZAR, + + /** + * Zambian Kwacha (ZMW). + */ + ZMW, + + UNKNOWN_VALUE; + + public static CurrencyCode fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "AED": { + return AED; + } + + case "AFN": { + return AFN; } - case "VN": { - return VN; + case "ALL": { + return ALL; } - case "VU": { - return VU; + case "AMD": { + return AMD; } - case "WF": { - return WF; + case "ANG": { + return ANG; } - case "WS": { - return WS; + case "AOA": { + return AOA; } - case "XK": { - return XK; + case "ARS": { + return ARS; } - case "YE": { - return YE; + case "AUD": { + return AUD; } - case "YT": { - return YT; + case "AWG": { + return AWG; } - case "ZA": { - return ZA; + case "AZN": { + return AZN; } - case "ZM": { - return ZM; + case "BAM": { + return BAM; } - case "ZW": { - return ZW; + case "BBD": { + return BBD; } - case "ZZ": { - return ZZ; + case "BDT": { + return BDT; } - default: { - return UNKNOWN_VALUE; + case "BGN": { + return BGN; } - } - } - public String toString() { - switch (this) { - case AC: { - return "AC"; + + case "BHD": { + return BHD; } - case AD: { - return "AD"; + case "BIF": { + return BIF; } - case AE: { - return "AE"; + case "BMD": { + return BMD; } - case AF: { - return "AF"; + case "BND": { + return BND; } - case AG: { - return "AG"; + case "BOB": { + return BOB; } - case AI: { - return "AI"; + case "BRL": { + return BRL; } - case AL: { - return "AL"; + case "BSD": { + return BSD; } - case AM: { - return "AM"; + case "BTN": { + return BTN; } - case AN: { - return "AN"; + case "BWP": { + return BWP; } - case AO: { - return "AO"; + case "BYN": { + return BYN; } - case AR: { - return "AR"; + case "BZD": { + return BZD; } - case AT: { - return "AT"; + case "CAD": { + return CAD; } - case AU: { - return "AU"; + case "CDF": { + return CDF; } - case AW: { - return "AW"; + case "CHF": { + return CHF; } - case AX: { - return "AX"; + case "CLP": { + return CLP; } - case AZ: { - return "AZ"; + case "CNY": { + return CNY; } - case BA: { - return "BA"; + case "COP": { + return COP; } - case BB: { - return "BB"; + case "CRC": { + return CRC; } - case BD: { - return "BD"; + case "CVE": { + return CVE; } - case BE: { - return "BE"; + case "CZK": { + return CZK; } - case BF: { - return "BF"; + case "DJF": { + return DJF; } - case BG: { - return "BG"; + case "DKK": { + return DKK; } - case BH: { - return "BH"; + case "DOP": { + return DOP; } - case BI: { - return "BI"; + case "DZD": { + return DZD; } - case BJ: { - return "BJ"; + case "EGP": { + return EGP; } - case BL: { - return "BL"; + case "ERN": { + return ERN; } - case BM: { - return "BM"; + case "ETB": { + return ETB; } - case BN: { - return "BN"; + case "EUR": { + return EUR; } - case BO: { - return "BO"; + case "FJD": { + return FJD; } - case BQ: { - return "BQ"; + case "FKP": { + return FKP; } - case BR: { - return "BR"; + case "GBP": { + return GBP; } - case BS: { - return "BS"; + case "GEL": { + return GEL; } - case BT: { - return "BT"; + case "GHS": { + return GHS; } - case BV: { - return "BV"; + case "GIP": { + return GIP; } - case BW: { - return "BW"; + case "GMD": { + return GMD; } - case BY: { - return "BY"; + case "GNF": { + return GNF; } - case BZ: { - return "BZ"; + case "GTQ": { + return GTQ; } - case CA: { - return "CA"; + case "GYD": { + return GYD; } - case CC: { - return "CC"; + case "HKD": { + return HKD; } - case CD: { - return "CD"; + case "HNL": { + return HNL; } - case CF: { - return "CF"; + case "HRK": { + return HRK; } - case CG: { - return "CG"; + case "HTG": { + return HTG; + } + + case "HUF": { + return HUF; + } + + case "IDR": { + return IDR; + } + + case "ILS": { + return ILS; + } + + case "INR": { + return INR; + } + + case "IQD": { + return IQD; + } + + case "IRR": { + return IRR; + } + + case "ISK": { + return ISK; + } + + case "JEP": { + return JEP; + } + + case "JMD": { + return JMD; + } + + case "JOD": { + return JOD; + } + + case "JPY": { + return JPY; + } + + case "KES": { + return KES; + } + + case "KGS": { + return KGS; + } + + case "KHR": { + return KHR; + } + + case "KID": { + return KID; + } + + case "KMF": { + return KMF; + } + + case "KRW": { + return KRW; + } + + case "KWD": { + return KWD; + } + + case "KYD": { + return KYD; + } + + case "KZT": { + return KZT; + } + + case "LAK": { + return LAK; + } + + case "LBP": { + return LBP; + } + + case "LKR": { + return LKR; + } + + case "LRD": { + return LRD; + } + + case "LSL": { + return LSL; + } + + case "LTL": { + return LTL; + } + + case "LVL": { + return LVL; + } + + case "LYD": { + return LYD; + } + + case "MAD": { + return MAD; + } + + case "MDL": { + return MDL; + } + + case "MGA": { + return MGA; + } + + case "MKD": { + return MKD; + } + + case "MMK": { + return MMK; + } + + case "MNT": { + return MNT; + } + + case "MOP": { + return MOP; + } + + case "MRU": { + return MRU; + } + + case "MUR": { + return MUR; + } + + case "MVR": { + return MVR; + } + + case "MWK": { + return MWK; + } + + case "MXN": { + return MXN; + } + + case "MYR": { + return MYR; + } + + case "MZN": { + return MZN; + } + + case "NAD": { + return NAD; + } + + case "NGN": { + return NGN; + } + + case "NIO": { + return NIO; + } + + case "NOK": { + return NOK; + } + + case "NPR": { + return NPR; + } + + case "NZD": { + return NZD; + } + + case "OMR": { + return OMR; + } + + case "PAB": { + return PAB; + } + + case "PEN": { + return PEN; + } + + case "PGK": { + return PGK; + } + + case "PHP": { + return PHP; + } + + case "PKR": { + return PKR; + } + + case "PLN": { + return PLN; + } + + case "PYG": { + return PYG; + } + + case "QAR": { + return QAR; + } + + case "RON": { + return RON; } - case CH: { - return "CH"; + case "RSD": { + return RSD; } - case CI: { - return "CI"; + case "RUB": { + return RUB; } - case CK: { - return "CK"; + case "RWF": { + return RWF; } - case CL: { - return "CL"; + case "SAR": { + return SAR; } - case CM: { - return "CM"; + case "SBD": { + return SBD; } - case CN: { - return "CN"; + case "SCR": { + return SCR; } - case CO: { - return "CO"; + case "SDG": { + return SDG; } - case CR: { - return "CR"; + case "SEK": { + return SEK; } - case CU: { - return "CU"; + case "SGD": { + return SGD; } - case CV: { - return "CV"; + case "SHP": { + return SHP; } - case CW: { - return "CW"; + case "SLL": { + return SLL; } - case CX: { - return "CX"; + case "SOS": { + return SOS; } - case CY: { - return "CY"; + case "SRD": { + return SRD; } - case CZ: { - return "CZ"; + case "SSP": { + return SSP; } - case DE: { - return "DE"; + case "STN": { + return STN; } - case DJ: { - return "DJ"; + case "SYP": { + return SYP; } - case DK: { - return "DK"; + case "SZL": { + return SZL; } - case DM: { - return "DM"; + case "THB": { + return THB; } - case DO: { - return "DO"; + case "TJS": { + return TJS; } - case DZ: { - return "DZ"; + case "TMT": { + return TMT; } - case EC: { - return "EC"; + case "TND": { + return TND; } - case EE: { - return "EE"; + case "TOP": { + return TOP; } - case EG: { - return "EG"; + case "TRY": { + return TRY; } - case EH: { - return "EH"; + case "TTD": { + return TTD; } - case ER: { - return "ER"; + case "TWD": { + return TWD; } - case ES: { - return "ES"; + case "TZS": { + return TZS; } - case ET: { - return "ET"; + case "UAH": { + return UAH; } - case FI: { - return "FI"; + case "UGX": { + return UGX; } - case FJ: { - return "FJ"; + case "USD": { + return USD; } - case FK: { - return "FK"; + case "UYU": { + return UYU; } - case FO: { - return "FO"; + case "UZS": { + return UZS; } - case FR: { - return "FR"; + case "VED": { + return VED; } - case GA: { - return "GA"; + case "VES": { + return VES; } - case GB: { - return "GB"; + case "VND": { + return VND; } - case GD: { - return "GD"; + case "VUV": { + return VUV; } - case GE: { - return "GE"; + case "WST": { + return WST; } - case GF: { - return "GF"; + case "XAF": { + return XAF; } - case GG: { - return "GG"; + case "XCD": { + return XCD; } - case GH: { - return "GH"; + case "XOF": { + return XOF; } - case GI: { - return "GI"; + case "XPF": { + return XPF; } - case GL: { - return "GL"; + case "XXX": { + return XXX; } - case GM: { - return "GM"; + case "YER": { + return YER; } - case GN: { - return "GN"; + case "ZAR": { + return ZAR; } - case GP: { - return "GP"; + case "ZMW": { + return ZMW; } - case GQ: { - return "GQ"; + default: { + return UNKNOWN_VALUE; } - - case GR: { - return "GR"; + } + } + public String toString() { + switch (this) { + case AED: { + return "AED"; } - case GS: { - return "GS"; + case AFN: { + return "AFN"; } - case GT: { - return "GT"; + case ALL: { + return "ALL"; } - case GW: { - return "GW"; + case AMD: { + return "AMD"; } - case GY: { - return "GY"; + case ANG: { + return "ANG"; } - case HK: { - return "HK"; + case AOA: { + return "AOA"; } - case HM: { - return "HM"; + case ARS: { + return "ARS"; } - case HN: { - return "HN"; + case AUD: { + return "AUD"; } - case HR: { - return "HR"; + case AWG: { + return "AWG"; } - case HT: { - return "HT"; + case AZN: { + return "AZN"; } - case HU: { - return "HU"; + case BAM: { + return "BAM"; } - case ID: { - return "ID"; + case BBD: { + return "BBD"; } - case IE: { - return "IE"; + case BDT: { + return "BDT"; } - case IL: { - return "IL"; + case BGN: { + return "BGN"; } - case IM: { - return "IM"; + case BHD: { + return "BHD"; } - case IN: { - return "IN"; + case BIF: { + return "BIF"; } - case IO: { - return "IO"; + case BMD: { + return "BMD"; } - case IQ: { - return "IQ"; + case BND: { + return "BND"; } - case IR: { - return "IR"; + case BOB: { + return "BOB"; } - case IS: { - return "IS"; + case BRL: { + return "BRL"; } - case IT: { - return "IT"; + case BSD: { + return "BSD"; } - case JE: { - return "JE"; + case BTN: { + return "BTN"; } - case JM: { - return "JM"; + case BWP: { + return "BWP"; } - case JO: { - return "JO"; + case BYN: { + return "BYN"; } - case JP: { - return "JP"; + case BZD: { + return "BZD"; } - case KE: { - return "KE"; + case CAD: { + return "CAD"; } - case KG: { - return "KG"; + case CDF: { + return "CDF"; } - case KH: { - return "KH"; + case CHF: { + return "CHF"; } - case KI: { - return "KI"; + case CLP: { + return "CLP"; } - case KM: { - return "KM"; + case CNY: { + return "CNY"; } - case KN: { - return "KN"; + case COP: { + return "COP"; } - case KP: { - return "KP"; + case CRC: { + return "CRC"; } - case KR: { - return "KR"; + case CVE: { + return "CVE"; } - case KW: { - return "KW"; + case CZK: { + return "CZK"; } - case KY: { - return "KY"; + case DJF: { + return "DJF"; } - case KZ: { - return "KZ"; + case DKK: { + return "DKK"; } - case LA: { - return "LA"; + case DOP: { + return "DOP"; } - case LB: { - return "LB"; + case DZD: { + return "DZD"; } - case LC: { - return "LC"; + case EGP: { + return "EGP"; } - case LI: { - return "LI"; + case ERN: { + return "ERN"; } - case LK: { - return "LK"; + case ETB: { + return "ETB"; } - case LR: { - return "LR"; + case EUR: { + return "EUR"; } - case LS: { - return "LS"; + case FJD: { + return "FJD"; } - case LT: { - return "LT"; + case FKP: { + return "FKP"; } - case LU: { - return "LU"; + case GBP: { + return "GBP"; } - case LV: { - return "LV"; + case GEL: { + return "GEL"; } - case LY: { - return "LY"; + case GHS: { + return "GHS"; } - case MA: { - return "MA"; + case GIP: { + return "GIP"; } - case MC: { - return "MC"; + case GMD: { + return "GMD"; } - case MD: { - return "MD"; + case GNF: { + return "GNF"; } - case ME: { - return "ME"; + case GTQ: { + return "GTQ"; } - case MF: { - return "MF"; + case GYD: { + return "GYD"; } - case MG: { - return "MG"; + case HKD: { + return "HKD"; } - case MK: { - return "MK"; + case HNL: { + return "HNL"; } - case ML: { - return "ML"; + case HRK: { + return "HRK"; } - case MM: { - return "MM"; + case HTG: { + return "HTG"; } - case MN: { - return "MN"; + case HUF: { + return "HUF"; } - case MO: { - return "MO"; + case IDR: { + return "IDR"; } - case MQ: { - return "MQ"; + case ILS: { + return "ILS"; } - case MR: { - return "MR"; + case INR: { + return "INR"; } - case MS: { - return "MS"; + case IQD: { + return "IQD"; } - case MT: { - return "MT"; + case IRR: { + return "IRR"; } - case MU: { - return "MU"; + case ISK: { + return "ISK"; } - case MV: { - return "MV"; + case JEP: { + return "JEP"; } - case MW: { - return "MW"; + case JMD: { + return "JMD"; } - case MX: { - return "MX"; + case JOD: { + return "JOD"; } - case MY: { - return "MY"; + case JPY: { + return "JPY"; } - case MZ: { - return "MZ"; + case KES: { + return "KES"; } - case NA: { - return "NA"; + case KGS: { + return "KGS"; } - case NC: { - return "NC"; + case KHR: { + return "KHR"; } - case NE: { - return "NE"; + case KID: { + return "KID"; } - case NF: { - return "NF"; + case KMF: { + return "KMF"; } - case NG: { - return "NG"; + case KRW: { + return "KRW"; } - case NI: { - return "NI"; + case KWD: { + return "KWD"; } - case NL: { - return "NL"; + case KYD: { + return "KYD"; } - case NO: { - return "NO"; + case KZT: { + return "KZT"; } - case NP: { - return "NP"; + case LAK: { + return "LAK"; } - case NR: { - return "NR"; + case LBP: { + return "LBP"; } - case NU: { - return "NU"; + case LKR: { + return "LKR"; } - case NZ: { - return "NZ"; + case LRD: { + return "LRD"; } - case OM: { - return "OM"; + case LSL: { + return "LSL"; } - case PA: { - return "PA"; + case LTL: { + return "LTL"; } - case PE: { - return "PE"; + case LVL: { + return "LVL"; } - case PF: { - return "PF"; + case LYD: { + return "LYD"; } - case PG: { - return "PG"; + case MAD: { + return "MAD"; } - case PH: { - return "PH"; + case MDL: { + return "MDL"; } - case PK: { - return "PK"; + case MGA: { + return "MGA"; } - case PL: { - return "PL"; + case MKD: { + return "MKD"; } - case PM: { - return "PM"; + case MMK: { + return "MMK"; } - case PN: { - return "PN"; + case MNT: { + return "MNT"; } - case PS: { - return "PS"; + case MOP: { + return "MOP"; } - case PT: { - return "PT"; + case MRU: { + return "MRU"; } - case PY: { - return "PY"; + case MUR: { + return "MUR"; } - case QA: { - return "QA"; + case MVR: { + return "MVR"; } - case RE: { - return "RE"; + case MWK: { + return "MWK"; } - case RO: { - return "RO"; + case MXN: { + return "MXN"; } - case RS: { - return "RS"; + case MYR: { + return "MYR"; } - case RU: { - return "RU"; + case MZN: { + return "MZN"; } - case RW: { - return "RW"; + case NAD: { + return "NAD"; } - case SA: { - return "SA"; + case NGN: { + return "NGN"; } - case SB: { - return "SB"; + case NIO: { + return "NIO"; } - case SC: { - return "SC"; + case NOK: { + return "NOK"; } - case SD: { - return "SD"; + case NPR: { + return "NPR"; } - case SE: { - return "SE"; + case NZD: { + return "NZD"; } - case SG: { - return "SG"; + case OMR: { + return "OMR"; } - case SH: { - return "SH"; + case PAB: { + return "PAB"; } - case SI: { - return "SI"; + case PEN: { + return "PEN"; } - case SJ: { - return "SJ"; + case PGK: { + return "PGK"; } - case SK: { - return "SK"; + case PHP: { + return "PHP"; } - case SL: { - return "SL"; + case PKR: { + return "PKR"; } - case SM: { - return "SM"; + case PLN: { + return "PLN"; } - case SN: { - return "SN"; + case PYG: { + return "PYG"; } - case SO: { - return "SO"; + case QAR: { + return "QAR"; } - case SR: { - return "SR"; + case RON: { + return "RON"; } - case SS: { - return "SS"; + case RSD: { + return "RSD"; } - case ST: { - return "ST"; + case RUB: { + return "RUB"; } - case SV: { - return "SV"; + case RWF: { + return "RWF"; } - case SX: { - return "SX"; + case SAR: { + return "SAR"; } - case SY: { - return "SY"; + case SBD: { + return "SBD"; } - case SZ: { - return "SZ"; + case SCR: { + return "SCR"; } - case TA: { - return "TA"; + case SDG: { + return "SDG"; } - case TC: { - return "TC"; + case SEK: { + return "SEK"; } - case TD: { - return "TD"; + case SGD: { + return "SGD"; } - case TF: { - return "TF"; + case SHP: { + return "SHP"; } - case TG: { - return "TG"; + case SLL: { + return "SLL"; } - case TH: { - return "TH"; + case SOS: { + return "SOS"; } - case TJ: { - return "TJ"; + case SRD: { + return "SRD"; } - case TK: { - return "TK"; + case SSP: { + return "SSP"; } - case TL: { - return "TL"; + case STN: { + return "STN"; } - case TM: { - return "TM"; + case SYP: { + return "SYP"; } - case TN: { - return "TN"; + case SZL: { + return "SZL"; } - case TO: { - return "TO"; + case THB: { + return "THB"; } - case TR: { - return "TR"; + case TJS: { + return "TJS"; } - case TT: { - return "TT"; + case TMT: { + return "TMT"; } - case TV: { - return "TV"; + case TND: { + return "TND"; } - case TW: { - return "TW"; + case TOP: { + return "TOP"; } - case TZ: { - return "TZ"; + case TRY: { + return "TRY"; } - case UA: { - return "UA"; + case TTD: { + return "TTD"; } - case UG: { - return "UG"; + case TWD: { + return "TWD"; } - case UM: { - return "UM"; + case TZS: { + return "TZS"; } - case US: { - return "US"; + case UAH: { + return "UAH"; } - case UY: { - return "UY"; + case UGX: { + return "UGX"; } - case UZ: { - return "UZ"; + case USD: { + return "USD"; } - case VA: { - return "VA"; + case UYU: { + return "UYU"; } - case VC: { - return "VC"; + case UZS: { + return "UZS"; } - case VE: { - return "VE"; + case VED: { + return "VED"; } - case VG: { - return "VG"; + case VES: { + return "VES"; } - case VN: { - return "VN"; + case VND: { + return "VND"; } - case VU: { - return "VU"; + case VUV: { + return "VUV"; } - case WF: { - return "WF"; + case WST: { + return "WST"; } - case WS: { - return "WS"; + case XAF: { + return "XAF"; } - case XK: { - return "XK"; + case XCD: { + return "XCD"; } - case YE: { - return "YE"; + case XOF: { + return "XOF"; } - case YT: { - return "YT"; + case XPF: { + return "XPF"; } - case ZA: { - return "ZA"; + case XXX: { + return "XXX"; } - case ZM: { - return "ZM"; + case YER: { + return "YER"; } - case ZW: { - return "ZW"; + case ZAR: { + return "ZAR"; } - case ZZ: { - return "ZZ"; + case ZMW: { + return "ZMW"; } default: { @@ -21668,607 +27623,558 @@ public String toString() { } } - public interface CreditCardQueryDefinition { - void define(CreditCardQuery _queryBuilder); + public interface CustomerQueryDefinition { + void define(CustomerQuery _queryBuilder); } /** - * Credit card information used for a payment. + * A customer represents a customer account with the shop. Customer accounts store contact information + * for the customer, saving logged-in customers the trouble of having to provide it at every checkout. */ - public static class CreditCardQuery extends Query { - CreditCardQuery(StringBuilder _queryBuilder) { + public static class CustomerQuery extends Query { + CustomerQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The brand of the credit card. - */ - public CreditCardQuery brand() { - startField("brand"); - - return this; - } - - /** - * The expiry month of the credit card. - */ - public CreditCardQuery expiryMonth() { - startField("expiryMonth"); - - return this; - } - - /** - * The expiry year of the credit card. - */ - public CreditCardQuery expiryYear() { - startField("expiryYear"); - - return this; - } - - /** - * The credit card's BIN number. - */ - public CreditCardQuery firstDigits() { - startField("firstDigits"); - - return this; - } - - /** - * The first name of the card holder. - */ - public CreditCardQuery firstName() { - startField("firstName"); - - return this; - } - - /** - * The last 4 digits of the credit card. - */ - public CreditCardQuery lastDigits() { - startField("lastDigits"); - - return this; - } - - /** - * The last name of the card holder. - */ - public CreditCardQuery lastName() { - startField("lastName"); - - return this; - } - - /** - * The masked credit card number with only the last 4 digits displayed. + * Indicates whether the customer has consented to be sent marketing material via email. */ - public CreditCardQuery maskedNumber() { - startField("maskedNumber"); + public CustomerQuery acceptsMarketing() { + startField("acceptsMarketing"); return this; } - } - - /** - * Credit card information used for a payment. - */ - public static class CreditCard extends AbstractResponse { - public CreditCard() { - } - - public CreditCard(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "brand": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "expiryMonth": { - Integer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "expiryYear": { - Integer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "firstDigits": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "firstName": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - responseData.put(key, optional1); - - break; - } - - case "lastDigits": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "lastName": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + public class AddressesArguments extends Arguments { + AddressesArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - break; - } + /** + * Returns up to the first `n` elements from the list. + */ + public AddressesArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - case "maskedNumber": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + /** + * Returns the elements that come after the specified cursor. + */ + public AddressesArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - responseData.put(key, optional1); + /** + * Returns up to the last `n` elements from the list. + */ + public AddressesArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - break; - } + /** + * Returns the elements that come before the specified cursor. + */ + public AddressesArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + /** + * Reverse the order of the underlying list. + */ + public AddressesArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; } } - public String getGraphQlTypeName() { - return "CreditCard"; + public interface AddressesArgumentsDefinition { + void define(AddressesArguments args); } /** - * The brand of the credit card. + * A list of addresses for the customer. */ - - public String getBrand() { - return (String) get("brand"); - } - - public CreditCard setBrand(String arg) { - optimisticData.put(getKey("brand"), arg); - return this; + public CustomerQuery addresses(MailingAddressConnectionQueryDefinition queryDef) { + return addresses(args -> {}, queryDef); } /** - * The expiry month of the credit card. + * A list of addresses for the customer. */ + public CustomerQuery addresses(AddressesArgumentsDefinition argsDef, MailingAddressConnectionQueryDefinition queryDef) { + startField("addresses"); - public Integer getExpiryMonth() { - return (Integer) get("expiryMonth"); - } + AddressesArguments args = new AddressesArguments(_queryBuilder); + argsDef.define(args); + AddressesArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new MailingAddressConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public CreditCard setExpiryMonth(Integer arg) { - optimisticData.put(getKey("expiryMonth"), arg); return this; } /** - * The expiry year of the credit card. + * The date and time when the customer was created. */ + public CustomerQuery createdAt() { + startField("createdAt"); - public Integer getExpiryYear() { - return (Integer) get("expiryYear"); - } - - public CreditCard setExpiryYear(Integer arg) { - optimisticData.put(getKey("expiryYear"), arg); return this; } /** - * The credit card's BIN number. + * The customer’s default address. */ + public CustomerQuery defaultAddress(MailingAddressQueryDefinition queryDef) { + startField("defaultAddress"); - public String getFirstDigits() { - return (String) get("firstDigits"); - } + _queryBuilder.append('{'); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); - public CreditCard setFirstDigits(String arg) { - optimisticData.put(getKey("firstDigits"), arg); return this; } /** - * The first name of the card holder. + * The customer’s name, email or phone number. */ + public CustomerQuery displayName() { + startField("displayName"); - public String getFirstName() { - return (String) get("firstName"); + return this; } - public CreditCard setFirstName(String arg) { - optimisticData.put(getKey("firstName"), arg); + /** + * The customer’s email address. + */ + public CustomerQuery email() { + startField("email"); + return this; } /** - * The last 4 digits of the credit card. + * The customer’s first name. */ + public CustomerQuery firstName() { + startField("firstName"); - public String getLastDigits() { - return (String) get("lastDigits"); + return this; } - public CreditCard setLastDigits(String arg) { - optimisticData.put(getKey("lastDigits"), arg); + /** + * A unique identifier for the customer. + */ + public CustomerQuery id() { + startField("id"); + return this; } /** - * The last name of the card holder. + * The customer's most recently updated, incomplete checkout. */ + public CustomerQuery lastIncompleteCheckout(CheckoutQueryDefinition queryDef) { + startField("lastIncompleteCheckout"); - public String getLastName() { - return (String) get("lastName"); - } + _queryBuilder.append('{'); + queryDef.define(new CheckoutQuery(_queryBuilder)); + _queryBuilder.append('}'); - public CreditCard setLastName(String arg) { - optimisticData.put(getKey("lastName"), arg); return this; } /** - * The masked credit card number with only the last 4 digits displayed. + * The customer’s last name. */ + public CustomerQuery lastName() { + startField("lastName"); - public String getMaskedNumber() { - return (String) get("maskedNumber"); - } - - public CreditCard setMaskedNumber(String arg) { - optimisticData.put(getKey("maskedNumber"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "brand": return false; - - case "expiryMonth": return false; + /** + * Returns a metafield found by namespace and key. + */ + public CustomerQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { + startField("metafield"); - case "expiryYear": return false; + _queryBuilder.append("(namespace:"); + Query.appendQuotedString(_queryBuilder, namespace.toString()); - case "firstDigits": return false; + _queryBuilder.append(",key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); - case "firstName": return false; + _queryBuilder.append(')'); - case "lastDigits": return false; + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "lastName": return false; + return this; + } - case "maskedNumber": return false; + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ + public CustomerQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); - default: return false; + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } } + _queryBuilder.append(']'); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } - } - public static class CreditCardPaymentInputV2 implements Serializable { - private MoneyInput paymentAmount; + /** + * The number of orders that the customer has made at the store in their lifetime. + */ + public CustomerQuery numberOfOrders() { + startField("numberOfOrders"); - private String idempotencyKey; + return this; + } - private MailingAddressInput billingAddress; + public class OrdersArguments extends Arguments { + OrdersArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - private String vaultId; + /** + * Returns up to the first `n` elements from the list. + */ + public OrdersArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - private Input test = Input.undefined(); + /** + * Returns the elements that come after the specified cursor. + */ + public OrdersArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - public CreditCardPaymentInputV2(MoneyInput paymentAmount, String idempotencyKey, MailingAddressInput billingAddress, String vaultId) { - this.paymentAmount = paymentAmount; + /** + * Returns up to the last `n` elements from the list. + */ + public OrdersArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - this.idempotencyKey = idempotencyKey; + /** + * Returns the elements that come before the specified cursor. + */ + public OrdersArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - this.billingAddress = billingAddress; + /** + * Reverse the order of the underlying list. + */ + public OrdersArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } - this.vaultId = vaultId; - } + /** + * Sort the underlying list by the given key. + */ + public OrdersArguments sortKey(OrderSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; + } - public MoneyInput getPaymentAmount() { - return paymentAmount; + /** + * Supported filter parameters: + * - `processed_at` + * See the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) + * for more information about using filters. + */ + public OrdersArguments query(String value) { + if (value != null) { + startArgument("query"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } } - public CreditCardPaymentInputV2 setPaymentAmount(MoneyInput paymentAmount) { - this.paymentAmount = paymentAmount; - return this; + public interface OrdersArgumentsDefinition { + void define(OrdersArguments args); } - public String getIdempotencyKey() { - return idempotencyKey; + /** + * The orders associated with the customer. + */ + public CustomerQuery orders(OrderConnectionQueryDefinition queryDef) { + return orders(args -> {}, queryDef); } - public CreditCardPaymentInputV2 setIdempotencyKey(String idempotencyKey) { - this.idempotencyKey = idempotencyKey; - return this; - } + /** + * The orders associated with the customer. + */ + public CustomerQuery orders(OrdersArgumentsDefinition argsDef, OrderConnectionQueryDefinition queryDef) { + startField("orders"); - public MailingAddressInput getBillingAddress() { - return billingAddress; - } + OrdersArguments args = new OrdersArguments(_queryBuilder); + argsDef.define(args); + OrdersArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new OrderConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public CreditCardPaymentInputV2 setBillingAddress(MailingAddressInput billingAddress) { - this.billingAddress = billingAddress; return this; } - public String getVaultId() { - return vaultId; - } + /** + * The customer’s phone number. + */ + public CustomerQuery phone() { + startField("phone"); - public CreditCardPaymentInputV2 setVaultId(String vaultId) { - this.vaultId = vaultId; return this; } - public Boolean getTest() { - return test.getValue(); - } + /** + * A comma separated list of tags that have been added to the customer. + * Additional access scope required: unauthenticated_read_customer_tags. + */ + public CustomerQuery tags() { + startField("tags"); - public Input getTestInput() { - return test; + return this; } - public CreditCardPaymentInputV2 setTest(Boolean test) { - this.test = Input.optional(test); + /** + * The date and time when the customer information was updated. + */ + public CustomerQuery updatedAt() { + startField("updatedAt"); + return this; } + } - public CreditCardPaymentInputV2 setTestInput(Input test) { - if (test == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.test = test; - return this; + /** + * A customer represents a customer account with the shop. Customer accounts store contact information + * for the customer, saving logged-in customers the trouble of having to provide it at every checkout. + */ + public static class Customer extends AbstractResponse implements HasMetafields, MetafieldParentResource { + public Customer() { } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + public Customer(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "acceptsMarketing": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("paymentAmount:"); - paymentAmount.appendTo(_queryBuilder); + break; + } - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("idempotencyKey:"); - Query.appendQuotedString(_queryBuilder, idempotencyKey.toString()); + case "addresses": { + responseData.put(key, new MailingAddressConnection(jsonAsObject(field.getValue(), key))); - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("billingAddress:"); - billingAddress.appendTo(_queryBuilder); + break; + } - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("vaultId:"); - Query.appendQuotedString(_queryBuilder, vaultId.toString()); + case "createdAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - if (this.test.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("test:"); - if (test.getValue() != null) { - _queryBuilder.append(test.getValue()); - } else { - _queryBuilder.append("null"); - } - } + break; + } - _queryBuilder.append('}'); - } - } + case "defaultAddress": { + MailingAddress optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); + } - /** - * The part of the image that should remain after cropping. - */ - public enum CropRegion { - /** - * Keep the bottom of the image. - */ - BOTTOM, + responseData.put(key, optional1); - /** - * Keep the center of the image. - */ - CENTER, + break; + } - /** - * Keep the left of the image. - */ - LEFT, + case "displayName": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * Keep the right of the image. - */ - RIGHT, + break; + } - /** - * Keep the top of the image. - */ - TOP, + case "email": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - UNKNOWN_VALUE; + responseData.put(key, optional1); - public static CropRegion fromGraphQl(String value) { - if (value == null) { - return null; - } + break; + } - switch (value) { - case "BOTTOM": { - return BOTTOM; - } + case "firstName": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "CENTER": { - return CENTER; - } + responseData.put(key, optional1); - case "LEFT": { - return LEFT; - } + break; + } - case "RIGHT": { - return RIGHT; - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - case "TOP": { - return TOP; - } + break; + } - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case BOTTOM: { - return "BOTTOM"; - } + case "lastIncompleteCheckout": { + Checkout optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Checkout(jsonAsObject(field.getValue(), key)); + } - case CENTER: { - return "CENTER"; - } + responseData.put(key, optional1); + + break; + } + + case "lastName": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case LEFT: { - return "LEFT"; - } + responseData.put(key, optional1); - case RIGHT: { - return "RIGHT"; - } + break; + } - case TOP: { - return "TOP"; - } + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } - default: { - return ""; - } - } - } - } + responseData.put(key, optional1); - public interface CurrencyQueryDefinition { - void define(CurrencyQuery _queryBuilder); - } + break; + } - /** - * A currency. - */ - public static class CurrencyQuery extends Query { - CurrencyQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } - /** - * The ISO code of the currency. - */ - public CurrencyQuery isoCode() { - startField("isoCode"); + list1.add(optional2); + } - return this; - } + responseData.put(key, list1); - /** - * The name of the currency. - */ - public CurrencyQuery name() { - startField("name"); + break; + } - return this; - } + case "numberOfOrders": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * The symbol of the currency. - */ - public CurrencyQuery symbol() { - startField("symbol"); + break; + } - return this; - } - } + case "orders": { + responseData.put(key, new OrderConnection(jsonAsObject(field.getValue(), key))); - /** - * A currency. - */ - public static class Currency extends AbstractResponse { - public Currency() { - } + break; + } - public Currency(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "isoCode": { - responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); + case "phone": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "tags": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + responseData.put(key, list1); break; } - case "symbol": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); break; } @@ -22285,2649 +28191,2881 @@ public Currency(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "Currency"; + return "Customer"; } /** - * The ISO code of the currency. + * Indicates whether the customer has consented to be sent marketing material via email. */ - public CurrencyCode getIsoCode() { - return (CurrencyCode) get("isoCode"); + public Boolean getAcceptsMarketing() { + return (Boolean) get("acceptsMarketing"); } - public Currency setIsoCode(CurrencyCode arg) { - optimisticData.put(getKey("isoCode"), arg); + public Customer setAcceptsMarketing(Boolean arg) { + optimisticData.put(getKey("acceptsMarketing"), arg); return this; } /** - * The name of the currency. + * A list of addresses for the customer. */ - public String getName() { - return (String) get("name"); + public MailingAddressConnection getAddresses() { + return (MailingAddressConnection) get("addresses"); } - public Currency setName(String arg) { - optimisticData.put(getKey("name"), arg); + public Customer setAddresses(MailingAddressConnection arg) { + optimisticData.put(getKey("addresses"), arg); return this; } /** - * The symbol of the currency. + * The date and time when the customer was created. */ - public String getSymbol() { - return (String) get("symbol"); + public DateTime getCreatedAt() { + return (DateTime) get("createdAt"); } - public Currency setSymbol(String arg) { - optimisticData.put(getKey("symbol"), arg); + public Customer setCreatedAt(DateTime arg) { + optimisticData.put(getKey("createdAt"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "isoCode": return false; - - case "name": return false; + /** + * The customer’s default address. + */ - case "symbol": return false; + public MailingAddress getDefaultAddress() { + return (MailingAddress) get("defaultAddress"); + } - default: return false; - } + public Customer setDefaultAddress(MailingAddress arg) { + optimisticData.put(getKey("defaultAddress"), arg); + return this; } - } - /** - * The three-letter currency codes that represent the world currencies used in stores. These include - * standard ISO 4217 codes, legacy codes, - * and non-standard codes. - */ - public enum CurrencyCode { /** - * United Arab Emirates Dirham (AED). + * The customer’s name, email or phone number. */ - AED, - /** - * Afghan Afghani (AFN). - */ - AFN, + public String getDisplayName() { + return (String) get("displayName"); + } - /** - * Albanian Lek (ALL). - */ - ALL, + public Customer setDisplayName(String arg) { + optimisticData.put(getKey("displayName"), arg); + return this; + } /** - * Armenian Dram (AMD). + * The customer’s email address. */ - AMD, - /** - * Netherlands Antillean Guilder. - */ - ANG, + public String getEmail() { + return (String) get("email"); + } - /** - * Angolan Kwanza (AOA). - */ - AOA, + public Customer setEmail(String arg) { + optimisticData.put(getKey("email"), arg); + return this; + } /** - * Argentine Pesos (ARS). + * The customer’s first name. */ - ARS, - /** - * Australian Dollars (AUD). - */ - AUD, + public String getFirstName() { + return (String) get("firstName"); + } - /** - * Aruban Florin (AWG). - */ - AWG, + public Customer setFirstName(String arg) { + optimisticData.put(getKey("firstName"), arg); + return this; + } /** - * Azerbaijani Manat (AZN). + * A unique identifier for the customer. */ - AZN, - /** - * Bosnia and Herzegovina Convertible Mark (BAM). - */ - BAM, + public ID getId() { + return (ID) get("id"); + } - /** - * Barbadian Dollar (BBD). - */ - BBD, + public Customer setId(ID arg) { + optimisticData.put(getKey("id"), arg); + return this; + } /** - * Bangladesh Taka (BDT). + * The customer's most recently updated, incomplete checkout. */ - BDT, - /** - * Bulgarian Lev (BGN). - */ - BGN, + public Checkout getLastIncompleteCheckout() { + return (Checkout) get("lastIncompleteCheckout"); + } - /** - * Bahraini Dinar (BHD). - */ - BHD, + public Customer setLastIncompleteCheckout(Checkout arg) { + optimisticData.put(getKey("lastIncompleteCheckout"), arg); + return this; + } /** - * Burundian Franc (BIF). + * The customer’s last name. */ - BIF, - /** - * Bermudian Dollar (BMD). - */ - BMD, + public String getLastName() { + return (String) get("lastName"); + } - /** - * Brunei Dollar (BND). - */ - BND, + public Customer setLastName(String arg) { + optimisticData.put(getKey("lastName"), arg); + return this; + } /** - * Bolivian Boliviano (BOB). + * Returns a metafield found by namespace and key. */ - BOB, - /** - * Brazilian Real (BRL). - */ - BRL, + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } - /** - * Bahamian Dollar (BSD). - */ - BSD, + public Customer setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); + return this; + } /** - * Bhutanese Ngultrum (BTN). + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - BTN, - /** - * Botswana Pula (BWP). - */ - BWP, + public List getMetafields() { + return (List) get("metafields"); + } - /** - * Belarusian Ruble (BYN). - */ - BYN, + public Customer setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); + return this; + } /** - * Belarusian Ruble (BYR). - * - * @deprecated `BYR` is deprecated. Use `BYN` available from version `2021-01` onwards instead. + * The number of orders that the customer has made at the store in their lifetime. */ - @Deprecated - BYR, - /** - * Belize Dollar (BZD). - */ - BZD, + public String getNumberOfOrders() { + return (String) get("numberOfOrders"); + } - /** - * Canadian Dollars (CAD). - */ - CAD, + public Customer setNumberOfOrders(String arg) { + optimisticData.put(getKey("numberOfOrders"), arg); + return this; + } /** - * Congolese franc (CDF). + * The orders associated with the customer. */ - CDF, - /** - * Swiss Francs (CHF). - */ - CHF, + public OrderConnection getOrders() { + return (OrderConnection) get("orders"); + } - /** - * Chilean Peso (CLP). - */ - CLP, + public Customer setOrders(OrderConnection arg) { + optimisticData.put(getKey("orders"), arg); + return this; + } /** - * Chinese Yuan Renminbi (CNY). + * The customer’s phone number. */ - CNY, - /** - * Colombian Peso (COP). - */ - COP, + public String getPhone() { + return (String) get("phone"); + } - /** - * Costa Rican Colones (CRC). - */ - CRC, + public Customer setPhone(String arg) { + optimisticData.put(getKey("phone"), arg); + return this; + } /** - * Cape Verdean escudo (CVE). + * A comma separated list of tags that have been added to the customer. + * Additional access scope required: unauthenticated_read_customer_tags. */ - CVE, - /** - * Czech Koruny (CZK). - */ - CZK, + public List getTags() { + return (List) get("tags"); + } - /** - * Djiboutian Franc (DJF). - */ - DJF, + public Customer setTags(List arg) { + optimisticData.put(getKey("tags"), arg); + return this; + } /** - * Danish Kroner (DKK). + * The date and time when the customer information was updated. */ - DKK, - /** - * Dominican Peso (DOP). - */ - DOP, + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); + } + + public Customer setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "acceptsMarketing": return false; + + case "addresses": return true; + + case "createdAt": return false; + + case "defaultAddress": return true; + + case "displayName": return false; + + case "email": return false; + + case "firstName": return false; + + case "id": return false; + + case "lastIncompleteCheckout": return true; + + case "lastName": return false; + + case "metafield": return true; + + case "metafields": return true; + + case "numberOfOrders": return false; + + case "orders": return true; + + case "phone": return false; + + case "tags": return false; + + case "updatedAt": return false; + + default: return false; + } + } + } + + public interface CustomerAccessTokenQueryDefinition { + void define(CustomerAccessTokenQuery _queryBuilder); + } + + /** + * A CustomerAccessToken represents the unique token required to make modifications to the customer + * object. + */ + public static class CustomerAccessTokenQuery extends Query { + CustomerAccessTokenQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Algerian Dinar (DZD). + * The customer’s access token. */ - DZD, + public CustomerAccessTokenQuery accessToken() { + startField("accessToken"); + + return this; + } /** - * Egyptian Pound (EGP). + * The date and time when the customer access token expires. */ - EGP, + public CustomerAccessTokenQuery expiresAt() { + startField("expiresAt"); + + return this; + } + } + + /** + * A CustomerAccessToken represents the unique token required to make modifications to the customer + * object. + */ + public static class CustomerAccessToken extends AbstractResponse { + public CustomerAccessToken() { + } + + public CustomerAccessToken(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "accessToken": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "expiresAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "CustomerAccessToken"; + } /** - * Eritrean Nakfa (ERN). + * The customer’s access token. */ - ERN, - /** - * Ethiopian Birr (ETB). - */ - ETB, + public String getAccessToken() { + return (String) get("accessToken"); + } - /** - * Euro (EUR). - */ - EUR, + public CustomerAccessToken setAccessToken(String arg) { + optimisticData.put(getKey("accessToken"), arg); + return this; + } /** - * Fijian Dollars (FJD). + * The date and time when the customer access token expires. */ - FJD, - /** - * Falkland Islands Pounds (FKP). - */ - FKP, + public DateTime getExpiresAt() { + return (DateTime) get("expiresAt"); + } - /** - * United Kingdom Pounds (GBP). - */ - GBP, + public CustomerAccessToken setExpiresAt(DateTime arg) { + optimisticData.put(getKey("expiresAt"), arg); + return this; + } - /** - * Georgian Lari (GEL). - */ - GEL, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "accessToken": return false; - /** - * Ghanaian Cedi (GHS). - */ - GHS, + case "expiresAt": return false; - /** - * Gibraltar Pounds (GIP). - */ - GIP, + default: return false; + } + } + } - /** - * Gambian Dalasi (GMD). - */ - GMD, + public static class CustomerAccessTokenCreateInput implements Serializable { + private String email; - /** - * Guinean Franc (GNF). - */ - GNF, + private String password; - /** - * Guatemalan Quetzal (GTQ). - */ - GTQ, + public CustomerAccessTokenCreateInput(String email, String password) { + this.email = email; - /** - * Guyanese Dollar (GYD). - */ - GYD, + this.password = password; + } - /** - * Hong Kong Dollars (HKD). - */ - HKD, + public String getEmail() { + return email; + } - /** - * Honduran Lempira (HNL). - */ - HNL, + public CustomerAccessTokenCreateInput setEmail(String email) { + this.email = email; + return this; + } - /** - * Croatian Kuna (HRK). - */ - HRK, + public String getPassword() { + return password; + } - /** - * Haitian Gourde (HTG). - */ - HTG, + public CustomerAccessTokenCreateInput setPassword(String password) { + this.password = password; + return this; + } - /** - * Hungarian Forint (HUF). - */ - HUF, + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - /** - * Indonesian Rupiah (IDR). - */ - IDR, + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("email:"); + Query.appendQuotedString(_queryBuilder, email.toString()); - /** - * Israeli New Shekel (NIS). - */ - ILS, + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("password:"); + Query.appendQuotedString(_queryBuilder, password.toString()); - /** - * Indian Rupees (INR). - */ - INR, + _queryBuilder.append('}'); + } + } - /** - * Iraqi Dinar (IQD). - */ - IQD, + public interface CustomerAccessTokenCreatePayloadQueryDefinition { + void define(CustomerAccessTokenCreatePayloadQuery _queryBuilder); + } - /** - * Iranian Rial (IRR). - */ - IRR, + /** + * Return type for `customerAccessTokenCreate` mutation. + */ + public static class CustomerAccessTokenCreatePayloadQuery extends Query { + CustomerAccessTokenCreatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Icelandic Kronur (ISK). + * The newly created customer access token object. */ - ISK, + public CustomerAccessTokenCreatePayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { + startField("customerAccessToken"); - /** - * Jersey Pound. - */ - JEP, + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Jamaican Dollars (JMD). - */ - JMD, + return this; + } /** - * Jordanian Dinar (JOD). + * The list of errors that occurred from executing the mutation. */ - JOD, + public CustomerAccessTokenCreatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - /** - * Japanese Yen (JPY). - */ - JPY, + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Kenyan Shilling (KES). - */ - KES, + return this; + } /** - * Kyrgyzstani Som (KGS). + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. */ - KGS, + @Deprecated + public CustomerAccessTokenCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - /** - * Cambodian Riel. - */ - KHR, + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Kiribati Dollar (KID). - */ - KID, + return this; + } + } - /** - * Comorian Franc (KMF). - */ - KMF, + /** + * Return type for `customerAccessTokenCreate` mutation. + */ + public static class CustomerAccessTokenCreatePayload extends AbstractResponse { + public CustomerAccessTokenCreatePayload() { + } - /** - * South Korean Won (KRW). - */ - KRW, + public CustomerAccessTokenCreatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customerAccessToken": { + CustomerAccessToken optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + } - /** - * Kuwaiti Dinar (KWD). - */ - KWD, + responseData.put(key, optional1); - /** - * Cayman Dollars (KYD). - */ - KYD, + break; + } - /** - * Kazakhstani Tenge (KZT). - */ - KZT, + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - /** - * Laotian Kip (LAK). - */ - LAK, + responseData.put(key, list1); - /** - * Lebanese Pounds (LBP). - */ - LBP, + break; + } - /** - * Sri Lankan Rupees (LKR). - */ - LKR, + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - /** - * Liberian Dollar (LRD). - */ - LRD, + responseData.put(key, list1); - /** - * Lesotho Loti (LSL). - */ - LSL, + break; + } - /** - * Lithuanian Litai (LTL). - */ - LTL, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * Latvian Lati (LVL). - */ - LVL, + public String getGraphQlTypeName() { + return "CustomerAccessTokenCreatePayload"; + } /** - * Libyan Dinar (LYD). + * The newly created customer access token object. */ - LYD, - /** - * Moroccan Dirham. - */ - MAD, + public CustomerAccessToken getCustomerAccessToken() { + return (CustomerAccessToken) get("customerAccessToken"); + } - /** - * Moldovan Leu (MDL). - */ - MDL, + public CustomerAccessTokenCreatePayload setCustomerAccessToken(CustomerAccessToken arg) { + optimisticData.put(getKey("customerAccessToken"), arg); + return this; + } /** - * Malagasy Ariary (MGA). + * The list of errors that occurred from executing the mutation. */ - MGA, - /** - * Macedonia Denar (MKD). - */ - MKD, + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - /** - * Burmese Kyat (MMK). - */ - MMK, + public CustomerAccessTokenCreatePayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } /** - * Mongolian Tugrik. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. */ - MNT, - /** - * Macanese Pataca (MOP). - */ - MOP, + public List getUserErrors() { + return (List) get("userErrors"); + } - /** - * Mauritanian Ouguiya (MRU). - */ - MRU, + public CustomerAccessTokenCreatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - /** - * Mauritian Rupee (MUR). - */ - MUR, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customerAccessToken": return true; - /** - * Maldivian Rufiyaa (MVR). - */ - MVR, + case "customerUserErrors": return true; - /** - * Malawian Kwacha (MWK). - */ - MWK, + case "userErrors": return true; - /** - * Mexican Pesos (MXN). - */ - MXN, + default: return false; + } + } + } - /** - * Malaysian Ringgits (MYR). - */ - MYR, + public interface CustomerAccessTokenCreateWithMultipassPayloadQueryDefinition { + void define(CustomerAccessTokenCreateWithMultipassPayloadQuery _queryBuilder); + } - /** - * Mozambican Metical. - */ - MZN, + /** + * Return type for `customerAccessTokenCreateWithMultipass` mutation. + */ + public static class CustomerAccessTokenCreateWithMultipassPayloadQuery extends Query { + CustomerAccessTokenCreateWithMultipassPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Namibian Dollar. + * An access token object associated with the customer. */ - NAD, + public CustomerAccessTokenCreateWithMultipassPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { + startField("customerAccessToken"); - /** - * Nigerian Naira (NGN). - */ - NGN, + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Nicaraguan Córdoba (NIO). - */ - NIO, + return this; + } /** - * Norwegian Kroner (NOK). + * The list of errors that occurred from executing the mutation. */ - NOK, + public CustomerAccessTokenCreateWithMultipassPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - /** - * Nepalese Rupee (NPR). - */ - NPR, + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * New Zealand Dollars (NZD). - */ - NZD, + return this; + } + } - /** - * Omani Rial (OMR). - */ - OMR, + /** + * Return type for `customerAccessTokenCreateWithMultipass` mutation. + */ + public static class CustomerAccessTokenCreateWithMultipassPayload extends AbstractResponse { + public CustomerAccessTokenCreateWithMultipassPayload() { + } - /** - * Panamian Balboa (PAB). - */ - PAB, + public CustomerAccessTokenCreateWithMultipassPayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customerAccessToken": { + CustomerAccessToken optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + } - /** - * Peruvian Nuevo Sol (PEN). - */ - PEN, + responseData.put(key, optional1); - /** - * Papua New Guinean Kina (PGK). - */ - PGK, + break; + } - /** - * Philippine Peso (PHP). - */ - PHP, + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - /** - * Pakistani Rupee (PKR). - */ - PKR, + responseData.put(key, list1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * Polish Zlotych (PLN). - */ - PLN, + public String getGraphQlTypeName() { + return "CustomerAccessTokenCreateWithMultipassPayload"; + } /** - * Paraguayan Guarani (PYG). + * An access token object associated with the customer. */ - PYG, - /** - * Qatari Rial (QAR). - */ - QAR, + public CustomerAccessToken getCustomerAccessToken() { + return (CustomerAccessToken) get("customerAccessToken"); + } - /** - * Romanian Lei (RON). - */ - RON, + public CustomerAccessTokenCreateWithMultipassPayload setCustomerAccessToken(CustomerAccessToken arg) { + optimisticData.put(getKey("customerAccessToken"), arg); + return this; + } /** - * Serbian dinar (RSD). + * The list of errors that occurred from executing the mutation. */ - RSD, - /** - * Russian Rubles (RUB). - */ - RUB, + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - /** - * Rwandan Franc (RWF). - */ - RWF, + public CustomerAccessTokenCreateWithMultipassPayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - /** - * Saudi Riyal (SAR). - */ - SAR, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customerAccessToken": return true; - /** - * Solomon Islands Dollar (SBD). - */ - SBD, + case "customerUserErrors": return true; - /** - * Seychellois Rupee (SCR). - */ - SCR, + default: return false; + } + } + } - /** - * Sudanese Pound (SDG). - */ - SDG, + public interface CustomerAccessTokenDeletePayloadQueryDefinition { + void define(CustomerAccessTokenDeletePayloadQuery _queryBuilder); + } - /** - * Swedish Kronor (SEK). - */ - SEK, + /** + * Return type for `customerAccessTokenDelete` mutation. + */ + public static class CustomerAccessTokenDeletePayloadQuery extends Query { + CustomerAccessTokenDeletePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Singapore Dollars (SGD). + * The destroyed access token. */ - SGD, + public CustomerAccessTokenDeletePayloadQuery deletedAccessToken() { + startField("deletedAccessToken"); - /** - * Saint Helena Pounds (SHP). - */ - SHP, + return this; + } /** - * Sierra Leonean Leone (SLL). + * ID of the destroyed customer access token. */ - SLL, + public CustomerAccessTokenDeletePayloadQuery deletedCustomerAccessTokenId() { + startField("deletedCustomerAccessTokenId"); - /** - * Somali Shilling (SOS). - */ - SOS, + return this; + } /** - * Surinamese Dollar (SRD). + * The list of errors that occurred from executing the mutation. */ - SRD, + public CustomerAccessTokenDeletePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - /** - * South Sudanese Pound (SSP). - */ - SSP, + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Sao Tome And Principe Dobra (STD). - * - * @deprecated `STD` is deprecated. Use `STN` available from version `2022-07` onwards instead. - */ - @Deprecated - STD, + return this; + } + } - /** - * Sao Tome And Principe Dobra (STN). - */ - STN, + /** + * Return type for `customerAccessTokenDelete` mutation. + */ + public static class CustomerAccessTokenDeletePayload extends AbstractResponse { + public CustomerAccessTokenDeletePayload() { + } - /** - * Syrian Pound (SYP). - */ - SYP, + public CustomerAccessTokenDeletePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "deletedAccessToken": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - /** - * Swazi Lilangeni (SZL). - */ - SZL, + responseData.put(key, optional1); - /** - * Thai baht (THB). - */ - THB, + break; + } - /** - * Tajikistani Somoni (TJS). - */ - TJS, + case "deletedCustomerAccessTokenId": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - /** - * Turkmenistani Manat (TMT). - */ - TMT, + responseData.put(key, optional1); - /** - * Tunisian Dinar (TND). - */ - TND, + break; + } - /** - * Tongan Pa'anga (TOP). - */ - TOP, + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - /** - * Turkish Lira (TRY). - */ - TRY, + responseData.put(key, list1); - /** - * Trinidad and Tobago Dollars (TTD). - */ - TTD, + break; + } - /** - * Taiwan Dollars (TWD). - */ - TWD, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * Tanzanian Shilling (TZS). - */ - TZS, + public String getGraphQlTypeName() { + return "CustomerAccessTokenDeletePayload"; + } /** - * Ukrainian Hryvnia (UAH). + * The destroyed access token. */ - UAH, - /** - * Ugandan Shilling (UGX). - */ - UGX, + public String getDeletedAccessToken() { + return (String) get("deletedAccessToken"); + } - /** - * United States Dollars (USD). - */ - USD, + public CustomerAccessTokenDeletePayload setDeletedAccessToken(String arg) { + optimisticData.put(getKey("deletedAccessToken"), arg); + return this; + } /** - * Uruguayan Pesos (UYU). + * ID of the destroyed customer access token. */ - UYU, - /** - * Uzbekistan som (UZS). - */ - UZS, + public String getDeletedCustomerAccessTokenId() { + return (String) get("deletedCustomerAccessTokenId"); + } - /** - * Venezuelan Bolivares (VED). - */ - VED, + public CustomerAccessTokenDeletePayload setDeletedCustomerAccessTokenId(String arg) { + optimisticData.put(getKey("deletedCustomerAccessTokenId"), arg); + return this; + } /** - * Venezuelan Bolivares (VEF). - * - * @deprecated `VEF` is deprecated. Use `VES` available from version `2020-10` onwards instead. + * The list of errors that occurred from executing the mutation. */ - @Deprecated - VEF, - /** - * Venezuelan Bolivares (VES). - */ - VES, + public List getUserErrors() { + return (List) get("userErrors"); + } - /** - * Vietnamese đồng (VND). - */ - VND, + public CustomerAccessTokenDeletePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - /** - * Vanuatu Vatu (VUV). - */ - VUV, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "deletedAccessToken": return false; - /** - * Samoan Tala (WST). - */ - WST, + case "deletedCustomerAccessTokenId": return false; - /** - * Central African CFA Franc (XAF). - */ - XAF, + case "userErrors": return true; - /** - * East Caribbean Dollar (XCD). - */ - XCD, + default: return false; + } + } + } - /** - * West African CFA franc (XOF). - */ - XOF, + public interface CustomerAccessTokenRenewPayloadQueryDefinition { + void define(CustomerAccessTokenRenewPayloadQuery _queryBuilder); + } - /** - * CFP Franc (XPF). - */ - XPF, + /** + * Return type for `customerAccessTokenRenew` mutation. + */ + public static class CustomerAccessTokenRenewPayloadQuery extends Query { + CustomerAccessTokenRenewPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Unrecognized currency. + * The renewed customer access token object. */ - XXX, + public CustomerAccessTokenRenewPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { + startField("customerAccessToken"); - /** - * Yemeni Rial (YER). - */ - YER, + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * South African Rand (ZAR). - */ - ZAR, + return this; + } /** - * Zambian Kwacha (ZMW). + * The list of errors that occurred from executing the mutation. */ - ZMW, - - UNKNOWN_VALUE; - - public static CurrencyCode fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "AED": { - return AED; - } - - case "AFN": { - return AFN; - } - - case "ALL": { - return ALL; - } + public CustomerAccessTokenRenewPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case "AMD": { - return AMD; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "ANG": { - return ANG; - } + return this; + } + } - case "AOA": { - return AOA; - } + /** + * Return type for `customerAccessTokenRenew` mutation. + */ + public static class CustomerAccessTokenRenewPayload extends AbstractResponse { + public CustomerAccessTokenRenewPayload() { + } - case "ARS": { - return ARS; - } + public CustomerAccessTokenRenewPayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customerAccessToken": { + CustomerAccessToken optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + } - case "AUD": { - return AUD; - } + responseData.put(key, optional1); - case "AWG": { - return AWG; - } + break; + } - case "AZN": { - return AZN; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case "BAM": { - return BAM; - } + responseData.put(key, list1); - case "BBD": { - return BBD; - } + break; + } - case "BDT": { - return BDT; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "BGN": { - return BGN; - } + public String getGraphQlTypeName() { + return "CustomerAccessTokenRenewPayload"; + } - case "BHD": { - return BHD; - } + /** + * The renewed customer access token object. + */ - case "BIF": { - return BIF; - } + public CustomerAccessToken getCustomerAccessToken() { + return (CustomerAccessToken) get("customerAccessToken"); + } - case "BMD": { - return BMD; - } + public CustomerAccessTokenRenewPayload setCustomerAccessToken(CustomerAccessToken arg) { + optimisticData.put(getKey("customerAccessToken"), arg); + return this; + } - case "BND": { - return BND; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case "BOB": { - return BOB; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case "BRL": { - return BRL; - } + public CustomerAccessTokenRenewPayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case "BSD": { - return BSD; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customerAccessToken": return true; - case "BTN": { - return BTN; - } + case "userErrors": return true; - case "BWP": { - return BWP; - } + default: return false; + } + } + } - case "BYN": { - return BYN; - } + public interface CustomerActivateByUrlPayloadQueryDefinition { + void define(CustomerActivateByUrlPayloadQuery _queryBuilder); + } - case "BZD": { - return BZD; - } + /** + * Return type for `customerActivateByUrl` mutation. + */ + public static class CustomerActivateByUrlPayloadQuery extends Query { + CustomerActivateByUrlPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "CAD": { - return CAD; - } + /** + * The customer that was activated. + */ + public CustomerActivateByUrlPayloadQuery customer(CustomerQueryDefinition queryDef) { + startField("customer"); - case "CDF": { - return CDF; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "CHF": { - return CHF; - } + return this; + } - case "CLP": { - return CLP; - } + /** + * A new customer access token for the customer. + */ + public CustomerActivateByUrlPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { + startField("customerAccessToken"); - case "CNY": { - return CNY; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "COP": { - return COP; - } + return this; + } - case "CRC": { - return CRC; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerActivateByUrlPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - case "CVE": { - return CVE; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "CZK": { - return CZK; - } + return this; + } + } - case "DJF": { - return DJF; - } + /** + * Return type for `customerActivateByUrl` mutation. + */ + public static class CustomerActivateByUrlPayload extends AbstractResponse { + public CustomerActivateByUrlPayload() { + } - case "DKK": { - return DKK; - } + public CustomerActivateByUrlPayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customer": { + Customer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Customer(jsonAsObject(field.getValue(), key)); + } - case "DOP": { - return DOP; - } + responseData.put(key, optional1); - case "DZD": { - return DZD; - } + break; + } - case "EGP": { - return EGP; - } + case "customerAccessToken": { + CustomerAccessToken optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + } - case "ERN": { - return ERN; - } + responseData.put(key, optional1); - case "ETB": { - return ETB; - } + break; + } - case "EUR": { - return EUR; - } + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - case "FJD": { - return FJD; - } + responseData.put(key, list1); - case "FKP": { - return FKP; - } + break; + } - case "GBP": { - return GBP; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "GEL": { - return GEL; - } + public String getGraphQlTypeName() { + return "CustomerActivateByUrlPayload"; + } - case "GHS": { - return GHS; - } + /** + * The customer that was activated. + */ - case "GIP": { - return GIP; - } + public Customer getCustomer() { + return (Customer) get("customer"); + } - case "GMD": { - return GMD; - } + public CustomerActivateByUrlPayload setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); + return this; + } - case "GNF": { - return GNF; - } + /** + * A new customer access token for the customer. + */ - case "GTQ": { - return GTQ; - } + public CustomerAccessToken getCustomerAccessToken() { + return (CustomerAccessToken) get("customerAccessToken"); + } - case "GYD": { - return GYD; - } + public CustomerActivateByUrlPayload setCustomerAccessToken(CustomerAccessToken arg) { + optimisticData.put(getKey("customerAccessToken"), arg); + return this; + } - case "HKD": { - return HKD; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case "HNL": { - return HNL; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - case "HRK": { - return HRK; - } + public CustomerActivateByUrlPayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - case "HTG": { - return HTG; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customer": return true; - case "HUF": { - return HUF; - } + case "customerAccessToken": return true; - case "IDR": { - return IDR; - } + case "customerUserErrors": return true; - case "ILS": { - return ILS; - } + default: return false; + } + } + } - case "INR": { - return INR; - } + public static class CustomerActivateInput implements Serializable { + private String activationToken; - case "IQD": { - return IQD; - } + private String password; - case "IRR": { - return IRR; - } + public CustomerActivateInput(String activationToken, String password) { + this.activationToken = activationToken; - case "ISK": { - return ISK; - } + this.password = password; + } - case "JEP": { - return JEP; - } + public String getActivationToken() { + return activationToken; + } - case "JMD": { - return JMD; - } + public CustomerActivateInput setActivationToken(String activationToken) { + this.activationToken = activationToken; + return this; + } - case "JOD": { - return JOD; - } + public String getPassword() { + return password; + } - case "JPY": { - return JPY; - } + public CustomerActivateInput setPassword(String password) { + this.password = password; + return this; + } - case "KES": { - return KES; - } + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - case "KGS": { - return KGS; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("activationToken:"); + Query.appendQuotedString(_queryBuilder, activationToken.toString()); - case "KHR": { - return KHR; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("password:"); + Query.appendQuotedString(_queryBuilder, password.toString()); - case "KID": { - return KID; - } + _queryBuilder.append('}'); + } + } - case "KMF": { - return KMF; - } + public interface CustomerActivatePayloadQueryDefinition { + void define(CustomerActivatePayloadQuery _queryBuilder); + } - case "KRW": { - return KRW; - } + /** + * Return type for `customerActivate` mutation. + */ + public static class CustomerActivatePayloadQuery extends Query { + CustomerActivatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "KWD": { - return KWD; - } + /** + * The customer object. + */ + public CustomerActivatePayloadQuery customer(CustomerQueryDefinition queryDef) { + startField("customer"); - case "KYD": { - return KYD; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "KZT": { - return KZT; - } + return this; + } - case "LAK": { - return LAK; - } + /** + * A newly created customer access token object for the customer. + */ + public CustomerActivatePayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { + startField("customerAccessToken"); - case "LBP": { - return LBP; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "LKR": { - return LKR; - } + return this; + } - case "LRD": { - return LRD; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerActivatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - case "LSL": { - return LSL; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "LTL": { - return LTL; - } + return this; + } - case "LVL": { - return LVL; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ + @Deprecated + public CustomerActivatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case "LYD": { - return LYD; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "MAD": { - return MAD; - } + return this; + } + } - case "MDL": { - return MDL; - } + /** + * Return type for `customerActivate` mutation. + */ + public static class CustomerActivatePayload extends AbstractResponse { + public CustomerActivatePayload() { + } - case "MGA": { - return MGA; - } + public CustomerActivatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customer": { + Customer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Customer(jsonAsObject(field.getValue(), key)); + } - case "MKD": { - return MKD; - } + responseData.put(key, optional1); - case "MMK": { - return MMK; - } + break; + } - case "MNT": { - return MNT; - } + case "customerAccessToken": { + CustomerAccessToken optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + } - case "MOP": { - return MOP; - } + responseData.put(key, optional1); - case "MRU": { - return MRU; - } + break; + } - case "MUR": { - return MUR; - } + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - case "MVR": { - return MVR; - } + responseData.put(key, list1); - case "MWK": { - return MWK; - } + break; + } - case "MXN": { - return MXN; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case "MYR": { - return MYR; - } + responseData.put(key, list1); - case "MZN": { - return MZN; - } + break; + } - case "NAD": { - return NAD; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "NGN": { - return NGN; - } + public String getGraphQlTypeName() { + return "CustomerActivatePayload"; + } - case "NIO": { - return NIO; - } + /** + * The customer object. + */ - case "NOK": { - return NOK; - } + public Customer getCustomer() { + return (Customer) get("customer"); + } - case "NPR": { - return NPR; - } + public CustomerActivatePayload setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); + return this; + } - case "NZD": { - return NZD; - } + /** + * A newly created customer access token object for the customer. + */ + + public CustomerAccessToken getCustomerAccessToken() { + return (CustomerAccessToken) get("customerAccessToken"); + } - case "OMR": { - return OMR; - } + public CustomerActivatePayload setCustomerAccessToken(CustomerAccessToken arg) { + optimisticData.put(getKey("customerAccessToken"), arg); + return this; + } - case "PAB": { - return PAB; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case "PEN": { - return PEN; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - case "PGK": { - return PGK; - } + public CustomerActivatePayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - case "PHP": { - return PHP; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ - case "PKR": { - return PKR; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case "PLN": { - return PLN; - } + public CustomerActivatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case "PYG": { - return PYG; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customer": return true; - case "QAR": { - return QAR; - } + case "customerAccessToken": return true; - case "RON": { - return RON; - } + case "customerUserErrors": return true; - case "RSD": { - return RSD; - } + case "userErrors": return true; - case "RUB": { - return RUB; - } + default: return false; + } + } + } - case "RWF": { - return RWF; - } + public interface CustomerAddressCreatePayloadQueryDefinition { + void define(CustomerAddressCreatePayloadQuery _queryBuilder); + } - case "SAR": { - return SAR; - } + /** + * Return type for `customerAddressCreate` mutation. + */ + public static class CustomerAddressCreatePayloadQuery extends Query { + CustomerAddressCreatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "SBD": { - return SBD; - } + /** + * The new customer address object. + */ + public CustomerAddressCreatePayloadQuery customerAddress(MailingAddressQueryDefinition queryDef) { + startField("customerAddress"); - case "SCR": { - return SCR; - } + _queryBuilder.append('{'); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "SDG": { - return SDG; - } + return this; + } - case "SEK": { - return SEK; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerAddressCreatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - case "SGD": { - return SGD; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "SHP": { - return SHP; - } + return this; + } - case "SLL": { - return SLL; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ + @Deprecated + public CustomerAddressCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case "SOS": { - return SOS; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "SRD": { - return SRD; - } + return this; + } + } - case "SSP": { - return SSP; - } + /** + * Return type for `customerAddressCreate` mutation. + */ + public static class CustomerAddressCreatePayload extends AbstractResponse { + public CustomerAddressCreatePayload() { + } - case "STN": { - return STN; - } + public CustomerAddressCreatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customerAddress": { + MailingAddress optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); + } - case "SYP": { - return SYP; - } + responseData.put(key, optional1); - case "SZL": { - return SZL; - } + break; + } - case "THB": { - return THB; - } + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - case "TJS": { - return TJS; - } + responseData.put(key, list1); - case "TMT": { - return TMT; - } + break; + } - case "TND": { - return TND; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case "TOP": { - return TOP; - } + responseData.put(key, list1); - case "TRY": { - return TRY; - } + break; + } - case "TTD": { - return TTD; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "TWD": { - return TWD; - } + public String getGraphQlTypeName() { + return "CustomerAddressCreatePayload"; + } - case "TZS": { - return TZS; - } + /** + * The new customer address object. + */ - case "UAH": { - return UAH; - } + public MailingAddress getCustomerAddress() { + return (MailingAddress) get("customerAddress"); + } - case "UGX": { - return UGX; - } + public CustomerAddressCreatePayload setCustomerAddress(MailingAddress arg) { + optimisticData.put(getKey("customerAddress"), arg); + return this; + } - case "USD": { - return USD; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case "UYU": { - return UYU; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - case "UZS": { - return UZS; - } + public CustomerAddressCreatePayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - case "VED": { - return VED; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ - case "VES": { - return VES; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case "VND": { - return VND; - } + public CustomerAddressCreatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case "VUV": { - return VUV; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customerAddress": return true; - case "WST": { - return WST; - } + case "customerUserErrors": return true; - case "XAF": { - return XAF; - } + case "userErrors": return true; - case "XCD": { - return XCD; - } + default: return false; + } + } + } - case "XOF": { - return XOF; - } + public interface CustomerAddressDeletePayloadQueryDefinition { + void define(CustomerAddressDeletePayloadQuery _queryBuilder); + } - case "XPF": { - return XPF; - } + /** + * Return type for `customerAddressDelete` mutation. + */ + public static class CustomerAddressDeletePayloadQuery extends Query { + CustomerAddressDeletePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "XXX": { - return XXX; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerAddressDeletePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - case "YER": { - return YER; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "ZAR": { - return ZAR; - } + return this; + } - case "ZMW": { - return ZMW; - } + /** + * ID of the deleted customer address. + */ + public CustomerAddressDeletePayloadQuery deletedCustomerAddressId() { + startField("deletedCustomerAddressId"); - default: { - return UNKNOWN_VALUE; - } - } + return this; } - public String toString() { - switch (this) { - case AED: { - return "AED"; - } - case AFN: { - return "AFN"; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ + @Deprecated + public CustomerAddressDeletePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case ALL: { - return "ALL"; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case AMD: { - return "AMD"; - } + return this; + } + } - case ANG: { - return "ANG"; - } + /** + * Return type for `customerAddressDelete` mutation. + */ + public static class CustomerAddressDeletePayload extends AbstractResponse { + public CustomerAddressDeletePayload() { + } - case AOA: { - return "AOA"; - } + public CustomerAddressDeletePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - case ARS: { - return "ARS"; - } + responseData.put(key, list1); - case AUD: { - return "AUD"; - } + break; + } - case AWG: { - return "AWG"; - } + case "deletedCustomerAddressId": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case AZN: { - return "AZN"; - } + responseData.put(key, optional1); - case BAM: { - return "BAM"; - } + break; + } - case BBD: { - return "BBD"; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case BDT: { - return "BDT"; - } + responseData.put(key, list1); - case BGN: { - return "BGN"; - } + break; + } - case BHD: { - return "BHD"; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case BIF: { - return "BIF"; - } + public String getGraphQlTypeName() { + return "CustomerAddressDeletePayload"; + } - case BMD: { - return "BMD"; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case BND: { - return "BND"; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - case BOB: { - return "BOB"; - } + public CustomerAddressDeletePayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - case BRL: { - return "BRL"; - } + /** + * ID of the deleted customer address. + */ - case BSD: { - return "BSD"; - } + public String getDeletedCustomerAddressId() { + return (String) get("deletedCustomerAddressId"); + } - case BTN: { - return "BTN"; - } + public CustomerAddressDeletePayload setDeletedCustomerAddressId(String arg) { + optimisticData.put(getKey("deletedCustomerAddressId"), arg); + return this; + } - case BWP: { - return "BWP"; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ - case BYN: { - return "BYN"; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case BZD: { - return "BZD"; - } + public CustomerAddressDeletePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case CAD: { - return "CAD"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customerUserErrors": return true; - case CDF: { - return "CDF"; - } + case "deletedCustomerAddressId": return false; - case CHF: { - return "CHF"; - } + case "userErrors": return true; - case CLP: { - return "CLP"; - } + default: return false; + } + } + } - case CNY: { - return "CNY"; - } + public interface CustomerAddressUpdatePayloadQueryDefinition { + void define(CustomerAddressUpdatePayloadQuery _queryBuilder); + } - case COP: { - return "COP"; - } + /** + * Return type for `customerAddressUpdate` mutation. + */ + public static class CustomerAddressUpdatePayloadQuery extends Query { + CustomerAddressUpdatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case CRC: { - return "CRC"; - } + /** + * The customer’s updated mailing address. + */ + public CustomerAddressUpdatePayloadQuery customerAddress(MailingAddressQueryDefinition queryDef) { + startField("customerAddress"); - case CVE: { - return "CVE"; - } + _queryBuilder.append('{'); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); - case CZK: { - return "CZK"; - } + return this; + } - case DJF: { - return "DJF"; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerAddressUpdatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - case DKK: { - return "DKK"; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case DOP: { - return "DOP"; - } + return this; + } - case DZD: { - return "DZD"; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ + @Deprecated + public CustomerAddressUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case EGP: { - return "EGP"; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case ERN: { - return "ERN"; - } + return this; + } + } - case ETB: { - return "ETB"; - } + /** + * Return type for `customerAddressUpdate` mutation. + */ + public static class CustomerAddressUpdatePayload extends AbstractResponse { + public CustomerAddressUpdatePayload() { + } - case EUR: { - return "EUR"; - } + public CustomerAddressUpdatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customerAddress": { + MailingAddress optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); + } - case FJD: { - return "FJD"; - } + responseData.put(key, optional1); - case FKP: { - return "FKP"; - } + break; + } - case GBP: { - return "GBP"; - } + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - case GEL: { - return "GEL"; - } + responseData.put(key, list1); - case GHS: { - return "GHS"; - } + break; + } - case GIP: { - return "GIP"; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case GMD: { - return "GMD"; - } + responseData.put(key, list1); - case GNF: { - return "GNF"; - } + break; + } - case GTQ: { - return "GTQ"; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case GYD: { - return "GYD"; - } + public String getGraphQlTypeName() { + return "CustomerAddressUpdatePayload"; + } - case HKD: { - return "HKD"; - } + /** + * The customer’s updated mailing address. + */ - case HNL: { - return "HNL"; - } + public MailingAddress getCustomerAddress() { + return (MailingAddress) get("customerAddress"); + } - case HRK: { - return "HRK"; - } + public CustomerAddressUpdatePayload setCustomerAddress(MailingAddress arg) { + optimisticData.put(getKey("customerAddress"), arg); + return this; + } - case HTG: { - return "HTG"; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case HUF: { - return "HUF"; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - case IDR: { - return "IDR"; - } + public CustomerAddressUpdatePayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - case ILS: { - return "ILS"; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ - case INR: { - return "INR"; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case IQD: { - return "IQD"; - } + public CustomerAddressUpdatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case IRR: { - return "IRR"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customerAddress": return true; - case ISK: { - return "ISK"; - } + case "customerUserErrors": return true; - case JEP: { - return "JEP"; - } + case "userErrors": return true; - case JMD: { - return "JMD"; - } + default: return false; + } + } + } - case JOD: { - return "JOD"; - } + public static class CustomerCreateInput implements Serializable { + private String email; - case JPY: { - return "JPY"; - } + private String password; - case KES: { - return "KES"; - } + private Input firstName = Input.undefined(); - case KGS: { - return "KGS"; - } + private Input lastName = Input.undefined(); - case KHR: { - return "KHR"; - } + private Input phone = Input.undefined(); - case KID: { - return "KID"; - } + private Input acceptsMarketing = Input.undefined(); - case KMF: { - return "KMF"; - } + public CustomerCreateInput(String email, String password) { + this.email = email; - case KRW: { - return "KRW"; - } + this.password = password; + } - case KWD: { - return "KWD"; - } + public String getEmail() { + return email; + } - case KYD: { - return "KYD"; - } + public CustomerCreateInput setEmail(String email) { + this.email = email; + return this; + } - case KZT: { - return "KZT"; - } + public String getPassword() { + return password; + } - case LAK: { - return "LAK"; - } + public CustomerCreateInput setPassword(String password) { + this.password = password; + return this; + } - case LBP: { - return "LBP"; - } + public String getFirstName() { + return firstName.getValue(); + } - case LKR: { - return "LKR"; - } + public Input getFirstNameInput() { + return firstName; + } - case LRD: { - return "LRD"; - } + public CustomerCreateInput setFirstName(String firstName) { + this.firstName = Input.optional(firstName); + return this; + } - case LSL: { - return "LSL"; - } + public CustomerCreateInput setFirstNameInput(Input firstName) { + if (firstName == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.firstName = firstName; + return this; + } - case LTL: { - return "LTL"; - } + public String getLastName() { + return lastName.getValue(); + } - case LVL: { - return "LVL"; - } + public Input getLastNameInput() { + return lastName; + } - case LYD: { - return "LYD"; - } + public CustomerCreateInput setLastName(String lastName) { + this.lastName = Input.optional(lastName); + return this; + } - case MAD: { - return "MAD"; - } + public CustomerCreateInput setLastNameInput(Input lastName) { + if (lastName == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.lastName = lastName; + return this; + } - case MDL: { - return "MDL"; - } + public String getPhone() { + return phone.getValue(); + } - case MGA: { - return "MGA"; - } + public Input getPhoneInput() { + return phone; + } - case MKD: { - return "MKD"; - } + public CustomerCreateInput setPhone(String phone) { + this.phone = Input.optional(phone); + return this; + } - case MMK: { - return "MMK"; - } + public CustomerCreateInput setPhoneInput(Input phone) { + if (phone == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.phone = phone; + return this; + } - case MNT: { - return "MNT"; - } + public Boolean getAcceptsMarketing() { + return acceptsMarketing.getValue(); + } - case MOP: { - return "MOP"; - } + public Input getAcceptsMarketingInput() { + return acceptsMarketing; + } - case MRU: { - return "MRU"; - } + public CustomerCreateInput setAcceptsMarketing(Boolean acceptsMarketing) { + this.acceptsMarketing = Input.optional(acceptsMarketing); + return this; + } - case MUR: { - return "MUR"; - } + public CustomerCreateInput setAcceptsMarketingInput(Input acceptsMarketing) { + if (acceptsMarketing == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.acceptsMarketing = acceptsMarketing; + return this; + } - case MVR: { - return "MVR"; - } + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - case MWK: { - return "MWK"; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("email:"); + Query.appendQuotedString(_queryBuilder, email.toString()); - case MXN: { - return "MXN"; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("password:"); + Query.appendQuotedString(_queryBuilder, password.toString()); - case MYR: { - return "MYR"; + if (this.firstName.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("firstName:"); + if (firstName.getValue() != null) { + Query.appendQuotedString(_queryBuilder, firstName.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - case MZN: { - return "MZN"; + if (this.lastName.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("lastName:"); + if (lastName.getValue() != null) { + Query.appendQuotedString(_queryBuilder, lastName.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - case NAD: { - return "NAD"; + if (this.phone.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("phone:"); + if (phone.getValue() != null) { + Query.appendQuotedString(_queryBuilder, phone.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - case NGN: { - return "NGN"; + if (this.acceptsMarketing.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("acceptsMarketing:"); + if (acceptsMarketing.getValue() != null) { + _queryBuilder.append(acceptsMarketing.getValue()); + } else { + _queryBuilder.append("null"); } + } - case NIO: { - return "NIO"; - } + _queryBuilder.append('}'); + } + } - case NOK: { - return "NOK"; - } + public interface CustomerCreatePayloadQueryDefinition { + void define(CustomerCreatePayloadQuery _queryBuilder); + } - case NPR: { - return "NPR"; - } + /** + * Return type for `customerCreate` mutation. + */ + public static class CustomerCreatePayloadQuery extends Query { + CustomerCreatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case NZD: { - return "NZD"; - } + /** + * The created customer object. + */ + public CustomerCreatePayloadQuery customer(CustomerQueryDefinition queryDef) { + startField("customer"); - case OMR: { - return "OMR"; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); - case PAB: { - return "PAB"; - } + return this; + } - case PEN: { - return "PEN"; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerCreatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - case PGK: { - return "PGK"; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case PHP: { - return "PHP"; - } + return this; + } - case PKR: { - return "PKR"; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ + @Deprecated + public CustomerCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case PLN: { - return "PLN"; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case PYG: { - return "PYG"; - } + return this; + } + } - case QAR: { - return "QAR"; - } + /** + * Return type for `customerCreate` mutation. + */ + public static class CustomerCreatePayload extends AbstractResponse { + public CustomerCreatePayload() { + } - case RON: { - return "RON"; - } + public CustomerCreatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customer": { + Customer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Customer(jsonAsObject(field.getValue(), key)); + } - case RSD: { - return "RSD"; - } + responseData.put(key, optional1); - case RUB: { - return "RUB"; - } + break; + } - case RWF: { - return "RWF"; - } + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - case SAR: { - return "SAR"; - } + responseData.put(key, list1); - case SBD: { - return "SBD"; - } + break; + } - case SCR: { - return "SCR"; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case SDG: { - return "SDG"; - } + responseData.put(key, list1); - case SEK: { - return "SEK"; - } + break; + } - case SGD: { - return "SGD"; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case SHP: { - return "SHP"; - } + public String getGraphQlTypeName() { + return "CustomerCreatePayload"; + } - case SLL: { - return "SLL"; - } + /** + * The created customer object. + */ - case SOS: { - return "SOS"; - } + public Customer getCustomer() { + return (Customer) get("customer"); + } - case SRD: { - return "SRD"; - } + public CustomerCreatePayload setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); + return this; + } - case SSP: { - return "SSP"; - } + /** + * The list of errors that occurred from executing the mutation. + */ - case STN: { - return "STN"; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - case SYP: { - return "SYP"; - } + public CustomerCreatePayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - case SZL: { - return "SZL"; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ - case THB: { - return "THB"; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - case TJS: { - return "TJS"; - } + public CustomerCreatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - case TMT: { - return "TMT"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customer": return true; - case TND: { - return "TND"; - } + case "customerUserErrors": return true; - case TOP: { - return "TOP"; - } + case "userErrors": return true; - case TRY: { - return "TRY"; - } + default: return false; + } + } + } - case TTD: { - return "TTD"; - } + public interface CustomerDefaultAddressUpdatePayloadQueryDefinition { + void define(CustomerDefaultAddressUpdatePayloadQuery _queryBuilder); + } - case TWD: { - return "TWD"; - } + /** + * Return type for `customerDefaultAddressUpdate` mutation. + */ + public static class CustomerDefaultAddressUpdatePayloadQuery extends Query { + CustomerDefaultAddressUpdatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case TZS: { - return "TZS"; - } + /** + * The updated customer object. + */ + public CustomerDefaultAddressUpdatePayloadQuery customer(CustomerQueryDefinition queryDef) { + startField("customer"); - case UAH: { - return "UAH"; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); - case UGX: { - return "UGX"; - } + return this; + } - case USD: { - return "USD"; - } + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerDefaultAddressUpdatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - case UYU: { - return "UYU"; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case UZS: { - return "UZS"; - } + return this; + } - case VED: { - return "VED"; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ + @Deprecated + public CustomerDefaultAddressUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case VES: { - return "VES"; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case VND: { - return "VND"; - } + return this; + } + } - case VUV: { - return "VUV"; - } + /** + * Return type for `customerDefaultAddressUpdate` mutation. + */ + public static class CustomerDefaultAddressUpdatePayload extends AbstractResponse { + public CustomerDefaultAddressUpdatePayload() { + } - case WST: { - return "WST"; - } + public CustomerDefaultAddressUpdatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customer": { + Customer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Customer(jsonAsObject(field.getValue(), key)); + } - case XAF: { - return "XAF"; - } + responseData.put(key, optional1); - case XCD: { - return "XCD"; - } + break; + } - case XOF: { - return "XOF"; - } + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } - case XPF: { - return "XPF"; - } + responseData.put(key, list1); - case XXX: { - return "XXX"; - } + break; + } - case YER: { - return "YER"; - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } - case ZAR: { - return "ZAR"; - } + responseData.put(key, list1); - case ZMW: { - return "ZMW"; - } + break; + } - default: { - return ""; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } } } - } - - public interface CustomerQueryDefinition { - void define(CustomerQuery _queryBuilder); - } - /** - * A customer represents a customer account with the shop. Customer accounts store contact information - * for the customer, saving logged-in customers the trouble of having to provide it at every checkout. - */ - public static class CustomerQuery extends Query { - CustomerQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public String getGraphQlTypeName() { + return "CustomerDefaultAddressUpdatePayload"; } /** - * Indicates whether the customer has consented to be sent marketing material via email. + * The updated customer object. */ - public CustomerQuery acceptsMarketing() { - startField("acceptsMarketing"); + public Customer getCustomer() { + return (Customer) get("customer"); + } + + public CustomerDefaultAddressUpdatePayload setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); return this; } - public class AddressesArguments extends Arguments { - AddressesArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * The list of errors that occurred from executing the mutation. + */ - /** - * Returns up to the first `n` elements from the list. - */ - public AddressesArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - /** - * Returns the elements that come after the specified cursor. - */ - public AddressesArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public CustomerDefaultAddressUpdatePayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - /** - * Returns up to the last `n` elements from the list. - */ - public AddressesArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ - /** - * Returns the elements that come before the specified cursor. - */ - public AddressesArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public List getUserErrors() { + return (List) get("userErrors"); + } - /** - * Reverse the order of the underlying list. - */ - public AddressesArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + public CustomerDefaultAddressUpdatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; } - public interface AddressesArgumentsDefinition { - void define(AddressesArguments args); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customer": return true; + + case "customerUserErrors": return true; + + case "userErrors": return true; + + default: return false; + } } + } + /** + * Possible error codes that can be returned by `CustomerUserError`. + */ + public enum CustomerErrorCode { /** - * A list of addresses for the customer. + * Customer already enabled. */ - public CustomerQuery addresses(MailingAddressConnectionQueryDefinition queryDef) { - return addresses(args -> {}, queryDef); - } + ALREADY_ENABLED, /** - * A list of addresses for the customer. + * Input email contains an invalid domain name. */ - public CustomerQuery addresses(AddressesArgumentsDefinition argsDef, MailingAddressConnectionQueryDefinition queryDef) { - startField("addresses"); - - AddressesArguments args = new AddressesArguments(_queryBuilder); - argsDef.define(args); - AddressesArguments.end(args); - - _queryBuilder.append('{'); - queryDef.define(new MailingAddressConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } + BAD_DOMAIN, /** - * The date and time when the customer was created. + * The input value is blank. */ - public CustomerQuery createdAt() { - startField("createdAt"); - - return this; - } + BLANK, /** - * The customer’s default address. + * Input contains HTML tags. */ - public CustomerQuery defaultAddress(MailingAddressQueryDefinition queryDef) { - startField("defaultAddress"); + CONTAINS_HTML_TAGS, - _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Input contains URL. + */ + CONTAINS_URL, - return this; - } + /** + * Customer is disabled. + */ + CUSTOMER_DISABLED, /** - * The customer’s name, email or phone number. + * The input value is invalid. */ - public CustomerQuery displayName() { - startField("displayName"); + INVALID, - return this; - } + /** + * Multipass token is not valid. + */ + INVALID_MULTIPASS_REQUEST, /** - * The customer’s email address. + * Address does not exist. */ - public CustomerQuery email() { - startField("email"); + NOT_FOUND, - return this; - } + /** + * Input password starts or ends with whitespace. + */ + PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE, /** - * The customer’s first name. + * The input value is already taken. */ - public CustomerQuery firstName() { - startField("firstName"); + TAKEN, - return this; - } + /** + * Invalid activation token. + */ + TOKEN_INVALID, /** - * A unique identifier for the customer. + * The input value is too long. */ - public CustomerQuery id() { - startField("id"); + TOO_LONG, - return this; - } + /** + * The input value is too short. + */ + TOO_SHORT, /** - * The customer's most recently updated, incomplete checkout. + * Unidentified customer. */ - public CustomerQuery lastIncompleteCheckout(CheckoutQueryDefinition queryDef) { - startField("lastIncompleteCheckout"); + UNIDENTIFIED_CUSTOMER, - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); + UNKNOWN_VALUE; - return this; - } + public static CustomerErrorCode fromGraphQl(String value) { + if (value == null) { + return null; + } - /** - * The customer’s last name. - */ - public CustomerQuery lastName() { - startField("lastName"); + switch (value) { + case "ALREADY_ENABLED": { + return ALREADY_ENABLED; + } - return this; - } + case "BAD_DOMAIN": { + return BAD_DOMAIN; + } - /** - * Returns a metafield found by namespace and key. - */ - public CustomerQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { - startField("metafield"); + case "BLANK": { + return BLANK; + } - _queryBuilder.append("(namespace:"); - Query.appendQuotedString(_queryBuilder, namespace.toString()); + case "CONTAINS_HTML_TAGS": { + return CONTAINS_HTML_TAGS; + } - _queryBuilder.append(",key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + case "CONTAINS_URL": { + return CONTAINS_URL; + } - _queryBuilder.append(')'); + case "CUSTOMER_DISABLED": { + return CUSTOMER_DISABLED; + } - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "INVALID": { + return INVALID; + } - return this; - } + case "INVALID_MULTIPASS_REQUEST": { + return INVALID_MULTIPASS_REQUEST; + } - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ - public CustomerQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); + case "NOT_FOUND": { + return NOT_FOUND; + } - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); + case "PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE": { + return PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE; } - } - _queryBuilder.append(']'); - _queryBuilder.append(')'); + case "TAKEN": { + return TAKEN; + } - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "TOKEN_INVALID": { + return TOKEN_INVALID; + } - return this; - } + case "TOO_LONG": { + return TOO_LONG; + } - /** - * The number of orders that the customer has made at the store in their lifetime. - */ - public CustomerQuery numberOfOrders() { - startField("numberOfOrders"); + case "TOO_SHORT": { + return TOO_SHORT; + } - return this; - } + case "UNIDENTIFIED_CUSTOMER": { + return UNIDENTIFIED_CUSTOMER; + } - public class OrdersArguments extends Arguments { - OrdersArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); + default: { + return UNKNOWN_VALUE; + } } + } + public String toString() { + switch (this) { + case ALREADY_ENABLED: { + return "ALREADY_ENABLED"; + } - /** - * Returns up to the first `n` elements from the list. - */ - public OrdersArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); + case BAD_DOMAIN: { + return "BAD_DOMAIN"; } - return this; - } - /** - * Returns the elements that come after the specified cursor. - */ - public OrdersArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case BLANK: { + return "BLANK"; } - return this; - } - /** - * Returns up to the last `n` elements from the list. - */ - public OrdersArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); + case CONTAINS_HTML_TAGS: { + return "CONTAINS_HTML_TAGS"; } - return this; - } - /** - * Returns the elements that come before the specified cursor. - */ - public OrdersArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case CONTAINS_URL: { + return "CONTAINS_URL"; } - return this; - } - /** - * Reverse the order of the underlying list. - */ - public OrdersArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); + case CUSTOMER_DISABLED: { + return "CUSTOMER_DISABLED"; } - return this; - } - /** - * Sort the underlying list by the given key. - */ - public OrdersArguments sortKey(OrderSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); + case INVALID: { + return "INVALID"; } - return this; - } - /** - * Supported filter parameters: - * - `processed_at` - * See the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) - * for more information about using filters. - */ - public OrdersArguments query(String value) { - if (value != null) { - startArgument("query"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case INVALID_MULTIPASS_REQUEST: { + return "INVALID_MULTIPASS_REQUEST"; } - return this; - } - } - public interface OrdersArgumentsDefinition { - void define(OrdersArguments args); - } + case NOT_FOUND: { + return "NOT_FOUND"; + } - /** - * The orders associated with the customer. - */ - public CustomerQuery orders(OrderConnectionQueryDefinition queryDef) { - return orders(args -> {}, queryDef); - } + case PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE: { + return "PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE"; + } - /** - * The orders associated with the customer. - */ - public CustomerQuery orders(OrdersArgumentsDefinition argsDef, OrderConnectionQueryDefinition queryDef) { - startField("orders"); + case TAKEN: { + return "TAKEN"; + } - OrdersArguments args = new OrdersArguments(_queryBuilder); - argsDef.define(args); - OrdersArguments.end(args); + case TOKEN_INVALID: { + return "TOKEN_INVALID"; + } - _queryBuilder.append('{'); - queryDef.define(new OrderConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + case TOO_LONG: { + return "TOO_LONG"; + } - return this; + case TOO_SHORT: { + return "TOO_SHORT"; + } + + case UNIDENTIFIED_CUSTOMER: { + return "UNIDENTIFIED_CUSTOMER"; + } + + default: { + return ""; + } + } } + } - /** - * The customer’s phone number. - */ - public CustomerQuery phone() { - startField("phone"); + public interface CustomerRecoverPayloadQueryDefinition { + void define(CustomerRecoverPayloadQuery _queryBuilder); + } - return this; + /** + * Return type for `customerRecover` mutation. + */ + public static class CustomerRecoverPayloadQuery extends Query { + CustomerRecoverPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * A comma separated list of tags that have been added to the customer. - * Additional access scope required: unauthenticated_read_customer_tags. + * The list of errors that occurred from executing the mutation. */ - public CustomerQuery tags() { - startField("tags"); + public CustomerRecoverPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); + + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The date and time when the customer information was updated. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. */ - public CustomerQuery updatedAt() { - startField("updatedAt"); + @Deprecated + public CustomerRecoverPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); + + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * A customer represents a customer account with the shop. Customer accounts store contact information - * for the customer, saving logged-in customers the trouble of having to provide it at every checkout. + * Return type for `customerRecover` mutation. */ - public static class Customer extends AbstractResponse implements HasMetafields, MetafieldParentResource { - public Customer() { + public static class CustomerRecoverPayload extends AbstractResponse { + public CustomerRecoverPayload() { } - public Customer(JsonObject fields) throws SchemaViolationError { + public CustomerRecoverPayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "acceptsMarketing": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } - case "addresses": { - responseData.put(key, new MailingAddressConnection(jsonAsObject(field.getValue(), key))); + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserError(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } - case "createdAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - case "defaultAddress": { - MailingAddress optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); - } + public String getGraphQlTypeName() { + return "CustomerRecoverPayload"; + } - responseData.put(key, optional1); + /** + * The list of errors that occurred from executing the mutation. + */ - break; - } + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); + } - case "displayName": { - responseData.put(key, jsonAsString(field.getValue(), key)); + public CustomerRecoverPayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); + return this; + } - break; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ - case "email": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + public List getUserErrors() { + return (List) get("userErrors"); + } - responseData.put(key, optional1); + public CustomerRecoverPayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customerUserErrors": return true; + + case "userErrors": return true; + + default: return false; + } + } + } + + public interface CustomerResetByUrlPayloadQueryDefinition { + void define(CustomerResetByUrlPayloadQuery _queryBuilder); + } + + /** + * Return type for `customerResetByUrl` mutation. + */ + public static class CustomerResetByUrlPayloadQuery extends Query { + CustomerResetByUrlPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The customer object which was reset. + */ + public CustomerResetByUrlPayloadQuery customer(CustomerQueryDefinition queryDef) { + startField("customer"); + + _queryBuilder.append('{'); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * A newly created customer access token object for the customer. + */ + public CustomerResetByUrlPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { + startField("customerAccessToken"); - break; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "firstName": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + return this; + } - responseData.put(key, optional1); + /** + * The list of errors that occurred from executing the mutation. + */ + public CustomerResetByUrlPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - break; - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + return this; + } - break; - } + /** + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. + */ + @Deprecated + public CustomerResetByUrlPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - case "lastIncompleteCheckout": { - Checkout optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Checkout(jsonAsObject(field.getValue(), key)); - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - responseData.put(key, optional1); + return this; + } + } - break; - } + /** + * Return type for `customerResetByUrl` mutation. + */ + public static class CustomerResetByUrlPayload extends AbstractResponse { + public CustomerResetByUrlPayload() { + } - case "lastName": { - String optional1 = null; + public CustomerResetByUrlPayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customer": { + Customer optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new Customer(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -24935,10 +31073,10 @@ public Customer(JsonObject fields) throws SchemaViolationError { break; } - case "metafield": { - Metafield optional1 = null; + case "customerAccessToken": { + CustomerAccessToken optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -24946,15 +31084,10 @@ public Customer(JsonObject fields) throws SchemaViolationError { break; } - case "metafields": { - List list1 = new ArrayList<>(); + case "customerUserErrors": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } - - list1.add(optional2); + list1.add(new CustomerUserError(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -24962,33 +31095,10 @@ public Customer(JsonObject fields) throws SchemaViolationError { break; } - case "numberOfOrders": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "orders": { - responseData.put(key, new OrderConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "phone": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "tags": { - List list1 = new ArrayList<>(); + case "userErrors": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); + list1.add(new UserError(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -24996,12 +31106,6 @@ public Customer(JsonObject fields) throws SchemaViolationError { break; } - case "updatedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - - break; - } - case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -25014,407 +31118,469 @@ public Customer(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "Customer"; + return "CustomerResetByUrlPayload"; } /** - * Indicates whether the customer has consented to be sent marketing material via email. + * The customer object which was reset. */ - public Boolean getAcceptsMarketing() { - return (Boolean) get("acceptsMarketing"); + public Customer getCustomer() { + return (Customer) get("customer"); } - public Customer setAcceptsMarketing(Boolean arg) { - optimisticData.put(getKey("acceptsMarketing"), arg); + public CustomerResetByUrlPayload setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); return this; } /** - * A list of addresses for the customer. + * A newly created customer access token object for the customer. */ - public MailingAddressConnection getAddresses() { - return (MailingAddressConnection) get("addresses"); + public CustomerAccessToken getCustomerAccessToken() { + return (CustomerAccessToken) get("customerAccessToken"); } - public Customer setAddresses(MailingAddressConnection arg) { - optimisticData.put(getKey("addresses"), arg); + public CustomerResetByUrlPayload setCustomerAccessToken(CustomerAccessToken arg) { + optimisticData.put(getKey("customerAccessToken"), arg); return this; } /** - * The date and time when the customer was created. + * The list of errors that occurred from executing the mutation. */ - public DateTime getCreatedAt() { - return (DateTime) get("createdAt"); + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); } - public Customer setCreatedAt(DateTime arg) { - optimisticData.put(getKey("createdAt"), arg); + public CustomerResetByUrlPayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); return this; } /** - * The customer’s default address. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. */ - public MailingAddress getDefaultAddress() { - return (MailingAddress) get("defaultAddress"); + public List getUserErrors() { + return (List) get("userErrors"); } - public Customer setDefaultAddress(MailingAddress arg) { - optimisticData.put(getKey("defaultAddress"), arg); + public CustomerResetByUrlPayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } - /** - * The customer’s name, email or phone number. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "customer": return true; - public String getDisplayName() { - return (String) get("displayName"); - } + case "customerAccessToken": return true; - public Customer setDisplayName(String arg) { - optimisticData.put(getKey("displayName"), arg); - return this; + case "customerUserErrors": return true; + + case "userErrors": return true; + + default: return false; + } } + } - /** - * The customer’s email address. - */ + public static class CustomerResetInput implements Serializable { + private String resetToken; - public String getEmail() { - return (String) get("email"); + private String password; + + public CustomerResetInput(String resetToken, String password) { + this.resetToken = resetToken; + + this.password = password; } - public Customer setEmail(String arg) { - optimisticData.put(getKey("email"), arg); - return this; + public String getResetToken() { + return resetToken; } - /** - * The customer’s first name. - */ + public CustomerResetInput setResetToken(String resetToken) { + this.resetToken = resetToken; + return this; + } - public String getFirstName() { - return (String) get("firstName"); + public String getPassword() { + return password; } - public Customer setFirstName(String arg) { - optimisticData.put(getKey("firstName"), arg); + public CustomerResetInput setPassword(String password) { + this.password = password; return this; } - /** - * A unique identifier for the customer. - */ + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - public ID getId() { - return (ID) get("id"); + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("resetToken:"); + Query.appendQuotedString(_queryBuilder, resetToken.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("password:"); + Query.appendQuotedString(_queryBuilder, password.toString()); + + _queryBuilder.append('}'); } + } - public Customer setId(ID arg) { - optimisticData.put(getKey("id"), arg); - return this; + public interface CustomerResetPayloadQueryDefinition { + void define(CustomerResetPayloadQuery _queryBuilder); + } + + /** + * Return type for `customerReset` mutation. + */ + public static class CustomerResetPayloadQuery extends Query { + CustomerResetPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The customer's most recently updated, incomplete checkout. + * The customer object which was reset. */ + public CustomerResetPayloadQuery customer(CustomerQueryDefinition queryDef) { + startField("customer"); - public Checkout getLastIncompleteCheckout() { - return (Checkout) get("lastIncompleteCheckout"); - } + _queryBuilder.append('{'); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Customer setLastIncompleteCheckout(Checkout arg) { - optimisticData.put(getKey("lastIncompleteCheckout"), arg); return this; } /** - * The customer’s last name. + * A newly created customer access token object for the customer. */ + public CustomerResetPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { + startField("customerAccessToken"); - public String getLastName() { - return (String) get("lastName"); - } + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Customer setLastName(String arg) { - optimisticData.put(getKey("lastName"), arg); return this; } /** - * Returns a metafield found by namespace and key. + * The list of errors that occurred from executing the mutation. */ + public CustomerResetPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + startField("customerUserErrors"); - public Metafield getMetafield() { - return (Metafield) get("metafield"); - } + _queryBuilder.append('{'); + queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Customer setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); return this; } /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. */ + @Deprecated + public CustomerResetPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + startField("userErrors"); - public List getMetafields() { - return (List) get("metafields"); - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Customer setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); return this; } + } - /** - * The number of orders that the customer has made at the store in their lifetime. - */ + /** + * Return type for `customerReset` mutation. + */ + public static class CustomerResetPayload extends AbstractResponse { + public CustomerResetPayload() { + } - public String getNumberOfOrders() { - return (String) get("numberOfOrders"); + public CustomerResetPayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "customer": { + Customer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Customer(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "customerAccessToken": { + CustomerAccessToken optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "customerUserErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CustomerUserError(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "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 Customer setNumberOfOrders(String arg) { - optimisticData.put(getKey("numberOfOrders"), arg); - return this; + public String getGraphQlTypeName() { + return "CustomerResetPayload"; } /** - * The orders associated with the customer. + * The customer object which was reset. */ - public OrderConnection getOrders() { - return (OrderConnection) get("orders"); + public Customer getCustomer() { + return (Customer) get("customer"); } - public Customer setOrders(OrderConnection arg) { - optimisticData.put(getKey("orders"), arg); + public CustomerResetPayload setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); return this; } /** - * The customer’s phone number. + * A newly created customer access token object for the customer. */ - public String getPhone() { - return (String) get("phone"); + public CustomerAccessToken getCustomerAccessToken() { + return (CustomerAccessToken) get("customerAccessToken"); } - public Customer setPhone(String arg) { - optimisticData.put(getKey("phone"), arg); + public CustomerResetPayload setCustomerAccessToken(CustomerAccessToken arg) { + optimisticData.put(getKey("customerAccessToken"), arg); return this; } /** - * A comma separated list of tags that have been added to the customer. - * Additional access scope required: unauthenticated_read_customer_tags. + * The list of errors that occurred from executing the mutation. */ - public List getTags() { - return (List) get("tags"); + public List getCustomerUserErrors() { + return (List) get("customerUserErrors"); } - public Customer setTags(List arg) { - optimisticData.put(getKey("tags"), arg); + public CustomerResetPayload setCustomerUserErrors(List arg) { + optimisticData.put(getKey("customerUserErrors"), arg); return this; } /** - * The date and time when the customer information was updated. + * The list of errors that occurred from executing the mutation. + * + * @deprecated Use `customerUserErrors` instead. */ - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); + public List getUserErrors() { + return (List) get("userErrors"); } - public Customer setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); + public CustomerResetPayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "acceptsMarketing": return false; - - case "addresses": return true; - - case "createdAt": return false; - - case "defaultAddress": return true; - - case "displayName": return false; - - case "email": return false; - - case "firstName": return false; - - case "id": return false; - - case "lastIncompleteCheckout": return true; - - case "lastName": return false; - - case "metafield": return true; - - case "metafields": return true; - - case "numberOfOrders": return false; - - case "orders": return true; + case "customer": return true; - case "phone": return false; + case "customerAccessToken": return true; - case "tags": return false; + case "customerUserErrors": return true; - case "updatedAt": return false; + case "userErrors": return true; default: return false; } } } - public interface CustomerAccessTokenQueryDefinition { - void define(CustomerAccessTokenQuery _queryBuilder); - } + public static class CustomerUpdateInput implements Serializable { + private Input firstName = Input.undefined(); - /** - * A CustomerAccessToken represents the unique token required to make modifications to the customer - * object. - */ - public static class CustomerAccessTokenQuery extends Query { - CustomerAccessTokenQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + private Input lastName = Input.undefined(); - /** - * The customer’s access token. - */ - public CustomerAccessTokenQuery accessToken() { - startField("accessToken"); + private Input email = Input.undefined(); - return this; - } + private Input phone = Input.undefined(); - /** - * The date and time when the customer access token expires. - */ - public CustomerAccessTokenQuery expiresAt() { - startField("expiresAt"); + private Input password = Input.undefined(); - return this; + private Input acceptsMarketing = Input.undefined(); + + public String getFirstName() { + return firstName.getValue(); } - } - /** - * A CustomerAccessToken represents the unique token required to make modifications to the customer - * object. - */ - public static class CustomerAccessToken extends AbstractResponse { - public CustomerAccessToken() { + public Input getFirstNameInput() { + return firstName; } - public CustomerAccessToken(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "accessToken": { - responseData.put(key, jsonAsString(field.getValue(), key)); + public CustomerUpdateInput setFirstName(String firstName) { + this.firstName = Input.optional(firstName); + return this; + } + + public CustomerUpdateInput setFirstNameInput(Input firstName) { + if (firstName == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.firstName = firstName; + return this; + } - break; - } + public String getLastName() { + return lastName.getValue(); + } - case "expiresAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + public Input getLastNameInput() { + return lastName; + } - break; - } + public CustomerUpdateInput setLastName(String lastName) { + this.lastName = Input.optional(lastName); + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } + public CustomerUpdateInput setLastNameInput(Input lastName) { + if (lastName == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.lastName = lastName; + return this; } - public String getGraphQlTypeName() { - return "CustomerAccessToken"; + public String getEmail() { + return email.getValue(); } - /** - * The customer’s access token. - */ + public Input getEmailInput() { + return email; + } - public String getAccessToken() { - return (String) get("accessToken"); + public CustomerUpdateInput setEmail(String email) { + this.email = Input.optional(email); + return this; } - public CustomerAccessToken setAccessToken(String arg) { - optimisticData.put(getKey("accessToken"), arg); + public CustomerUpdateInput setEmailInput(Input email) { + if (email == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.email = email; return this; } - /** - * The date and time when the customer access token expires. - */ + public String getPhone() { + return phone.getValue(); + } - public DateTime getExpiresAt() { - return (DateTime) get("expiresAt"); + public Input getPhoneInput() { + return phone; } - public CustomerAccessToken setExpiresAt(DateTime arg) { - optimisticData.put(getKey("expiresAt"), arg); + public CustomerUpdateInput setPhone(String phone) { + this.phone = Input.optional(phone); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "accessToken": return false; - - case "expiresAt": return false; - - default: return false; + public CustomerUpdateInput setPhoneInput(Input phone) { + if (phone == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.phone = phone; + return this; } - } - public static class CustomerAccessTokenCreateInput implements Serializable { - private String email; + public String getPassword() { + return password.getValue(); + } - private String password; + public Input getPasswordInput() { + return password; + } - public CustomerAccessTokenCreateInput(String email, String password) { - this.email = email; + public CustomerUpdateInput setPassword(String password) { + this.password = Input.optional(password); + return this; + } + public CustomerUpdateInput setPasswordInput(Input password) { + if (password == null) { + throw new IllegalArgumentException("Input can not be null"); + } this.password = password; + return this; } - public String getEmail() { - return email; + public Boolean getAcceptsMarketing() { + return acceptsMarketing.getValue(); } - public CustomerAccessTokenCreateInput setEmail(String email) { - this.email = email; - return this; + public Input getAcceptsMarketingInput() { + return acceptsMarketing; } - public String getPassword() { - return password; + public CustomerUpdateInput setAcceptsMarketing(Boolean acceptsMarketing) { + this.acceptsMarketing = Input.optional(acceptsMarketing); + return this; } - public CustomerAccessTokenCreateInput setPassword(String password) { - this.password = password; + public CustomerUpdateInput setAcceptsMarketingInput(Input acceptsMarketing) { + if (acceptsMarketing == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.acceptsMarketing = acceptsMarketing; return this; } @@ -25422,36 +31588,107 @@ public void appendTo(StringBuilder _queryBuilder) { String separator = ""; _queryBuilder.append('{'); - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("email:"); - Query.appendQuotedString(_queryBuilder, email.toString()); + if (this.firstName.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("firstName:"); + if (firstName.getValue() != null) { + Query.appendQuotedString(_queryBuilder, firstName.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("password:"); - Query.appendQuotedString(_queryBuilder, password.toString()); + if (this.lastName.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("lastName:"); + if (lastName.getValue() != null) { + Query.appendQuotedString(_queryBuilder, lastName.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + 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.phone.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("phone:"); + if (phone.getValue() != null) { + Query.appendQuotedString(_queryBuilder, phone.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.password.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("password:"); + if (password.getValue() != null) { + Query.appendQuotedString(_queryBuilder, password.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.acceptsMarketing.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("acceptsMarketing:"); + if (acceptsMarketing.getValue() != null) { + _queryBuilder.append(acceptsMarketing.getValue()); + } else { + _queryBuilder.append("null"); + } + } _queryBuilder.append('}'); } } - public interface CustomerAccessTokenCreatePayloadQueryDefinition { - void define(CustomerAccessTokenCreatePayloadQuery _queryBuilder); + public interface CustomerUpdatePayloadQueryDefinition { + void define(CustomerUpdatePayloadQuery _queryBuilder); } /** - * Return type for `customerAccessTokenCreate` mutation. + * Return type for `customerUpdate` mutation. */ - public static class CustomerAccessTokenCreatePayloadQuery extends Query { - CustomerAccessTokenCreatePayloadQuery(StringBuilder _queryBuilder) { + public static class CustomerUpdatePayloadQuery extends Query { + CustomerUpdatePayloadQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The newly created customer access token object. + * The updated customer object. */ - public CustomerAccessTokenCreatePayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { + public CustomerUpdatePayloadQuery customer(CustomerQueryDefinition queryDef) { + startField("customer"); + + _queryBuilder.append('{'); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The newly created customer access token. If the customer's password is updated, all previous access + * tokens + * (including the one used to perform this mutation) become invalid, and a new token is generated. + */ + public CustomerUpdatePayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { startField("customerAccessToken"); _queryBuilder.append('{'); @@ -25464,7 +31701,7 @@ public CustomerAccessTokenCreatePayloadQuery customerAccessToken(CustomerAccessT /** * The list of errors that occurred from executing the mutation. */ - public CustomerAccessTokenCreatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { + public CustomerUpdatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { startField("customerUserErrors"); _queryBuilder.append('{'); @@ -25480,7 +31717,7 @@ public CustomerAccessTokenCreatePayloadQuery customerUserErrors(CustomerUserErro * @deprecated Use `customerUserErrors` instead. */ @Deprecated - public CustomerAccessTokenCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { + public CustomerUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { startField("userErrors"); _queryBuilder.append('{'); @@ -25492,17 +31729,28 @@ public CustomerAccessTokenCreatePayloadQuery userErrors(UserErrorQueryDefinition } /** - * Return type for `customerAccessTokenCreate` mutation. + * Return type for `customerUpdate` mutation. */ - public static class CustomerAccessTokenCreatePayload extends AbstractResponse { - public CustomerAccessTokenCreatePayload() { + public static class CustomerUpdatePayload extends AbstractResponse { + public CustomerUpdatePayload() { } - public CustomerAccessTokenCreatePayload(JsonObject fields) throws SchemaViolationError { + public CustomerUpdatePayload(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { + case "customer": { + Customer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Customer(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + case "customerAccessToken": { CustomerAccessToken optional1 = null; if (!field.getValue().isJsonNull()) { @@ -25548,18 +31796,33 @@ public CustomerAccessTokenCreatePayload(JsonObject fields) throws SchemaViolatio } public String getGraphQlTypeName() { - return "CustomerAccessTokenCreatePayload"; + return "CustomerUpdatePayload"; } /** - * The newly created customer access token object. + * The updated customer object. + */ + + public Customer getCustomer() { + return (Customer) get("customer"); + } + + public CustomerUpdatePayload setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); + return this; + } + + /** + * The newly created customer access token. If the customer's password is updated, all previous access + * tokens + * (including the one used to perform this mutation) become invalid, and a new token is generated. */ public CustomerAccessToken getCustomerAccessToken() { return (CustomerAccessToken) get("customerAccessToken"); } - public CustomerAccessTokenCreatePayload setCustomerAccessToken(CustomerAccessToken arg) { + public CustomerUpdatePayload setCustomerAccessToken(CustomerAccessToken arg) { optimisticData.put(getKey("customerAccessToken"), arg); return this; } @@ -25572,7 +31835,7 @@ public List getCustomerUserErrors() { return (List) get("customerUserErrors"); } - public CustomerAccessTokenCreatePayload setCustomerUserErrors(List arg) { + public CustomerUpdatePayload setCustomerUserErrors(List arg) { optimisticData.put(getKey("customerUserErrors"), arg); return this; } @@ -25587,13 +31850,15 @@ public List getUserErrors() { return (List) get("userErrors"); } - public CustomerAccessTokenCreatePayload setUserErrors(List arg) { + public CustomerUpdatePayload setUserErrors(List arg) { optimisticData.put(getKey("userErrors"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { + case "customer": return true; + case "customerAccessToken": return true; case "customerUserErrors": return true; @@ -25605,61 +31870,62 @@ public boolean unwrapsToObject(String key) { } } - public interface CustomerAccessTokenCreateWithMultipassPayloadQueryDefinition { - void define(CustomerAccessTokenCreateWithMultipassPayloadQuery _queryBuilder); + public interface CustomerUserErrorQueryDefinition { + void define(CustomerUserErrorQuery _queryBuilder); } /** - * Return type for `customerAccessTokenCreateWithMultipass` mutation. + * Represents an error that happens during execution of a customer mutation. */ - public static class CustomerAccessTokenCreateWithMultipassPayloadQuery extends Query { - CustomerAccessTokenCreateWithMultipassPayloadQuery(StringBuilder _queryBuilder) { + public static class CustomerUserErrorQuery extends Query { + CustomerUserErrorQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * An access token object associated with the customer. + * The error code. */ - public CustomerAccessTokenCreateWithMultipassPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { - startField("customerAccessToken"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CustomerUserErrorQuery code() { + startField("code"); return this; } /** - * The list of errors that occurred from executing the mutation. + * The path to the input field that caused the error. */ - public CustomerAccessTokenCreateWithMultipassPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); + public CustomerUserErrorQuery field() { + startField("field"); - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * The error message. + */ + public CustomerUserErrorQuery message() { + startField("message"); return this; } } /** - * Return type for `customerAccessTokenCreateWithMultipass` mutation. + * Represents an error that happens during execution of a customer mutation. */ - public static class CustomerAccessTokenCreateWithMultipassPayload extends AbstractResponse { - public CustomerAccessTokenCreateWithMultipassPayload() { + public static class CustomerUserError extends AbstractResponse implements DisplayableError { + public CustomerUserError() { } - public CustomerAccessTokenCreateWithMultipassPayload(JsonObject fields) throws SchemaViolationError { + public CustomerUserError(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customerAccessToken": { - CustomerAccessToken optional1 = null; + case "code": { + CustomerErrorCode optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + optional1 = CustomerErrorCode.fromGraphQl(jsonAsString(field.getValue(), key)); } responseData.put(key, optional1); @@ -25667,13 +31933,24 @@ public CustomerAccessTokenCreateWithMultipassPayload(JsonObject fields) throws S break; } - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); + case "field": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + optional1 = list1; } - responseData.put(key, list1); + responseData.put(key, optional1); + + break; + } + + case "message": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -25690,235 +31967,426 @@ public CustomerAccessTokenCreateWithMultipassPayload(JsonObject fields) throws S } public String getGraphQlTypeName() { - return "CustomerAccessTokenCreateWithMultipassPayload"; + return "CustomerUserError"; } /** - * An access token object associated with the customer. + * The error code. */ - public CustomerAccessToken getCustomerAccessToken() { - return (CustomerAccessToken) get("customerAccessToken"); + public CustomerErrorCode getCode() { + return (CustomerErrorCode) get("code"); } - public CustomerAccessTokenCreateWithMultipassPayload setCustomerAccessToken(CustomerAccessToken arg) { - optimisticData.put(getKey("customerAccessToken"), arg); + public CustomerUserError setCode(CustomerErrorCode arg) { + optimisticData.put(getKey("code"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The path to the input field that caused the error. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public List getField() { + return (List) get("field"); } - public CustomerAccessTokenCreateWithMultipassPayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public CustomerUserError setField(List arg) { + optimisticData.put(getKey("field"), arg); + return this; + } + + /** + * The error message. + */ + + public String getMessage() { + return (String) get("message"); + } + + public CustomerUserError setMessage(String arg) { + optimisticData.put(getKey("message"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "customerAccessToken": return true; + case "code": return false; - case "customerUserErrors": return true; + case "field": return false; + + case "message": return false; + + default: return false; + } + } + } + + public interface DeliveryAddressQueryDefinition { + void define(DeliveryAddressQuery _queryBuilder); + } + + /** + * A delivery address of the buyer that is interacting with the cart. + */ + public static class DeliveryAddressQuery extends Query { + DeliveryAddressQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("__typename"); + } + + public DeliveryAddressQuery onMailingAddress(MailingAddressQueryDefinition queryDef) { + startInlineFragment("MailingAddress"); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + } + + public interface DeliveryAddress { + String getGraphQlTypeName(); + } + + /** + * A delivery address of the buyer that is interacting with the cart. + */ + public static class UnknownDeliveryAddress extends AbstractResponse implements DeliveryAddress { + public UnknownDeliveryAddress() { + } + + public UnknownDeliveryAddress(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public static DeliveryAddress create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "MailingAddress": { + return new MailingAddress(fields); + } + + default: { + return new UnknownDeliveryAddress(fields); + } + } + } + + public String getGraphQlTypeName() { + return (String) get("__typename"); + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + default: return false; + } + } + } + + public static class DeliveryAddressInput implements Serializable { + private Input deliveryAddress = Input.undefined(); + + private Input customerAddressId = Input.undefined(); + + public MailingAddressInput getDeliveryAddress() { + return deliveryAddress.getValue(); + } + + public Input getDeliveryAddressInput() { + return deliveryAddress; + } + + public DeliveryAddressInput setDeliveryAddress(MailingAddressInput deliveryAddress) { + this.deliveryAddress = Input.optional(deliveryAddress); + return this; + } + + public DeliveryAddressInput setDeliveryAddressInput(Input deliveryAddress) { + if (deliveryAddress == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.deliveryAddress = deliveryAddress; + return this; + } + + public ID getCustomerAddressId() { + return customerAddressId.getValue(); + } + + public Input getCustomerAddressIdInput() { + return customerAddressId; + } + + public DeliveryAddressInput setCustomerAddressId(ID customerAddressId) { + this.customerAddressId = Input.optional(customerAddressId); + return this; + } + + public DeliveryAddressInput setCustomerAddressIdInput(Input customerAddressId) { + if (customerAddressId == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.customerAddressId = customerAddressId; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + if (this.deliveryAddress.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("deliveryAddress:"); + if (deliveryAddress.getValue() != null) { + deliveryAddress.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } - default: return false; + if (this.customerAddressId.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("customerAddressId:"); + if (customerAddressId.getValue() != null) { + Query.appendQuotedString(_queryBuilder, customerAddressId.getValue().toString()); + } else { + _queryBuilder.append("null"); + } } - } - } - public interface CustomerAccessTokenDeletePayloadQueryDefinition { - void define(CustomerAccessTokenDeletePayloadQuery _queryBuilder); + _queryBuilder.append('}'); + } } /** - * Return type for `customerAccessTokenDelete` mutation. + * List of different delivery method types. */ - public static class CustomerAccessTokenDeletePayloadQuery extends Query { - CustomerAccessTokenDeletePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + public enum DeliveryMethodType { + /** + * Local Delivery. + */ + LOCAL, /** - * The destroyed access token. + * None. */ - public CustomerAccessTokenDeletePayloadQuery deletedAccessToken() { - startField("deletedAccessToken"); + NONE, - return this; - } + /** + * Shipping to a Pickup Point. + */ + PICKUP_POINT, /** - * ID of the destroyed customer access token. + * Local Pickup. */ - public CustomerAccessTokenDeletePayloadQuery deletedCustomerAccessTokenId() { - startField("deletedCustomerAccessTokenId"); + PICK_UP, - return this; - } + /** + * Retail. + */ + RETAIL, /** - * The list of errors that occurred from executing the mutation. + * Shipping. */ - public CustomerAccessTokenDeletePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + SHIPPING, - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + UNKNOWN_VALUE; - return this; - } - } + public static DeliveryMethodType fromGraphQl(String value) { + if (value == null) { + return null; + } - /** - * Return type for `customerAccessTokenDelete` mutation. - */ - public static class CustomerAccessTokenDeletePayload extends AbstractResponse { - public CustomerAccessTokenDeletePayload() { - } + switch (value) { + case "LOCAL": { + return LOCAL; + } - public CustomerAccessTokenDeletePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "deletedAccessToken": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case "NONE": { + return NONE; + } - responseData.put(key, optional1); + case "PICKUP_POINT": { + return PICKUP_POINT; + } - break; - } + case "PICK_UP": { + return PICK_UP; + } - case "deletedCustomerAccessTokenId": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case "RETAIL": { + return RETAIL; + } - responseData.put(key, optional1); + case "SHIPPING": { + return SHIPPING; + } - break; - } + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case LOCAL: { + return "LOCAL"; + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + case NONE: { + return "NONE"; + } - responseData.put(key, list1); + case PICKUP_POINT: { + return "PICKUP_POINT"; + } - break; - } + case PICK_UP: { + return "PICK_UP"; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case RETAIL: { + return "RETAIL"; } - } - } - public String getGraphQlTypeName() { - return "CustomerAccessTokenDeletePayload"; + case SHIPPING: { + return "SHIPPING"; + } + + default: { + return ""; + } + } } + } + /** + * Digital wallet, such as Apple Pay, which can be used for accelerated checkouts. + */ + public enum DigitalWallet { /** - * The destroyed access token. + * Android Pay. */ + ANDROID_PAY, - public String getDeletedAccessToken() { - return (String) get("deletedAccessToken"); - } + /** + * Apple Pay. + */ + APPLE_PAY, - public CustomerAccessTokenDeletePayload setDeletedAccessToken(String arg) { - optimisticData.put(getKey("deletedAccessToken"), arg); - return this; - } + /** + * Google Pay. + */ + GOOGLE_PAY, /** - * ID of the destroyed customer access token. + * Shopify Pay. */ + SHOPIFY_PAY, - public String getDeletedCustomerAccessTokenId() { - return (String) get("deletedCustomerAccessTokenId"); - } + UNKNOWN_VALUE; - public CustomerAccessTokenDeletePayload setDeletedCustomerAccessTokenId(String arg) { - optimisticData.put(getKey("deletedCustomerAccessTokenId"), arg); - return this; - } + public static DigitalWallet fromGraphQl(String value) { + if (value == null) { + return null; + } - /** - * The list of errors that occurred from executing the mutation. - */ + switch (value) { + case "ANDROID_PAY": { + return ANDROID_PAY; + } - public List getUserErrors() { - return (List) get("userErrors"); - } + case "APPLE_PAY": { + return APPLE_PAY; + } - public CustomerAccessTokenDeletePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; + case "GOOGLE_PAY": { + return GOOGLE_PAY; + } + + case "SHOPIFY_PAY": { + return SHOPIFY_PAY; + } + + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case ANDROID_PAY: { + return "ANDROID_PAY"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "deletedAccessToken": return false; + case APPLE_PAY: { + return "APPLE_PAY"; + } - case "deletedCustomerAccessTokenId": return false; + case GOOGLE_PAY: { + return "GOOGLE_PAY"; + } - case "userErrors": return true; + case SHOPIFY_PAY: { + return "SHOPIFY_PAY"; + } - default: return false; + default: { + return ""; + } } } } - public interface CustomerAccessTokenRenewPayloadQueryDefinition { - void define(CustomerAccessTokenRenewPayloadQuery _queryBuilder); + public interface DiscountAllocationQueryDefinition { + void define(DiscountAllocationQuery _queryBuilder); } /** - * Return type for `customerAccessTokenRenew` mutation. + * An amount discounting the line that has been allocated by a discount. */ - public static class CustomerAccessTokenRenewPayloadQuery extends Query { - CustomerAccessTokenRenewPayloadQuery(StringBuilder _queryBuilder) { + public static class DiscountAllocationQuery extends Query { + DiscountAllocationQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The renewed customer access token object. + * Amount of discount allocated. */ - public CustomerAccessTokenRenewPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { - startField("customerAccessToken"); + public DiscountAllocationQuery allocatedAmount(MoneyV2QueryDefinition queryDef) { + startField("allocatedAmount"); _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. + * The discount this allocated amount originated from. */ - public CustomerAccessTokenRenewPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public DiscountAllocationQuery discountApplication(DiscountApplicationQueryDefinition queryDef) { + startField("discountApplication"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new DiscountApplicationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -25926,35 +32394,25 @@ public CustomerAccessTokenRenewPayloadQuery userErrors(UserErrorQueryDefinition } /** - * Return type for `customerAccessTokenRenew` mutation. + * An amount discounting the line that has been allocated by a discount. */ - public static class CustomerAccessTokenRenewPayload extends AbstractResponse { - public CustomerAccessTokenRenewPayload() { + public static class DiscountAllocation extends AbstractResponse { + public DiscountAllocation() { } - public CustomerAccessTokenRenewPayload(JsonObject fields) throws SchemaViolationError { + public DiscountAllocation(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customerAccessToken": { - CustomerAccessToken optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "allocatedAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "discountApplication": { + responseData.put(key, UnknownDiscountApplication.create(jsonAsObject(field.getValue(), key))); break; } @@ -25971,139 +32429,175 @@ public CustomerAccessTokenRenewPayload(JsonObject fields) throws SchemaViolation } public String getGraphQlTypeName() { - return "CustomerAccessTokenRenewPayload"; + return "DiscountAllocation"; } /** - * The renewed customer access token object. + * Amount of discount allocated. */ - public CustomerAccessToken getCustomerAccessToken() { - return (CustomerAccessToken) get("customerAccessToken"); + public MoneyV2 getAllocatedAmount() { + return (MoneyV2) get("allocatedAmount"); } - public CustomerAccessTokenRenewPayload setCustomerAccessToken(CustomerAccessToken arg) { - optimisticData.put(getKey("customerAccessToken"), arg); + public DiscountAllocation setAllocatedAmount(MoneyV2 arg) { + optimisticData.put(getKey("allocatedAmount"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The discount this allocated amount originated from. */ - public List getUserErrors() { - return (List) get("userErrors"); + public DiscountApplication getDiscountApplication() { + return (DiscountApplication) get("discountApplication"); } - public CustomerAccessTokenRenewPayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public DiscountAllocation setDiscountApplication(DiscountApplication arg) { + optimisticData.put(getKey("discountApplication"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "customerAccessToken": return true; + case "allocatedAmount": return true; - case "userErrors": return true; + case "discountApplication": return false; default: return false; } } } - public interface CustomerActivateByUrlPayloadQueryDefinition { - void define(CustomerActivateByUrlPayloadQuery _queryBuilder); + public interface DiscountApplicationQueryDefinition { + void define(DiscountApplicationQuery _queryBuilder); } /** - * Return type for `customerActivateByUrl` mutation. + * Discount applications capture the intentions of a discount source at + * the time of application. */ - public static class CustomerActivateByUrlPayloadQuery extends Query { - CustomerActivateByUrlPayloadQuery(StringBuilder _queryBuilder) { + public static class DiscountApplicationQuery extends Query { + DiscountApplicationQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("__typename"); } /** - * The customer that was activated. + * The method by which the discount's value is allocated to its entitled items. */ - public CustomerActivateByUrlPayloadQuery customer(CustomerQueryDefinition queryDef) { - startField("customer"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); + public DiscountApplicationQuery allocationMethod() { + startField("allocationMethod"); return this; } /** - * A new customer access token for the customer. + * Which lines of targetType that the discount is allocated over. */ - public CustomerActivateByUrlPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { - startField("customerAccessToken"); + public DiscountApplicationQuery targetSelection() { + startField("targetSelection"); - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * The type of line that the discount is applicable towards. + */ + public DiscountApplicationQuery targetType() { + startField("targetType"); return this; } /** - * The list of errors that occurred from executing the mutation. + * The value of the discount application. */ - public CustomerActivateByUrlPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); + public DiscountApplicationQuery value(PricingValueQueryDefinition queryDef) { + startField("value"); _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + queryDef.define(new PricingValueQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + public DiscountApplicationQuery onAutomaticDiscountApplication(AutomaticDiscountApplicationQueryDefinition queryDef) { + startInlineFragment("AutomaticDiscountApplication"); + queryDef.define(new AutomaticDiscountApplicationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public DiscountApplicationQuery onDiscountCodeApplication(DiscountCodeApplicationQueryDefinition queryDef) { + startInlineFragment("DiscountCodeApplication"); + queryDef.define(new DiscountCodeApplicationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public DiscountApplicationQuery onManualDiscountApplication(ManualDiscountApplicationQueryDefinition queryDef) { + startInlineFragment("ManualDiscountApplication"); + queryDef.define(new ManualDiscountApplicationQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; + } + public DiscountApplicationQuery onScriptDiscountApplication(ScriptDiscountApplicationQueryDefinition queryDef) { + startInlineFragment("ScriptDiscountApplication"); + queryDef.define(new ScriptDiscountApplicationQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } + public interface DiscountApplication { + String getGraphQlTypeName(); + + DiscountApplicationAllocationMethod getAllocationMethod(); + + DiscountApplicationTargetSelection getTargetSelection(); + + DiscountApplicationTargetType getTargetType(); + + PricingValue getValue(); + } + /** - * Return type for `customerActivateByUrl` mutation. + * Discount applications capture the intentions of a discount source at + * the time of application. */ - public static class CustomerActivateByUrlPayload extends AbstractResponse { - public CustomerActivateByUrlPayload() { + public static class UnknownDiscountApplication extends AbstractResponse implements DiscountApplication { + public UnknownDiscountApplication() { } - public CustomerActivateByUrlPayload(JsonObject fields) throws SchemaViolationError { + public UnknownDiscountApplication(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customer": { - Customer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "allocationMethod": { + responseData.put(key, DiscountApplicationAllocationMethod.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "customerAccessToken": { - CustomerAccessToken optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "targetSelection": { + responseData.put(key, DiscountApplicationTargetSelection.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } + case "targetType": { + responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); - responseData.put(key, list1); + break; + } + + case "value": { + responseData.put(key, UnknownPricingValue.create(jsonAsObject(field.getValue(), key))); break; } @@ -26119,171 +32613,208 @@ public CustomerActivateByUrlPayload(JsonObject fields) throws SchemaViolationErr } } + public static DiscountApplication create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "AutomaticDiscountApplication": { + return new AutomaticDiscountApplication(fields); + } + + case "DiscountCodeApplication": { + return new DiscountCodeApplication(fields); + } + + case "ManualDiscountApplication": { + return new ManualDiscountApplication(fields); + } + + case "ScriptDiscountApplication": { + return new ScriptDiscountApplication(fields); + } + + default: { + return new UnknownDiscountApplication(fields); + } + } + } + public String getGraphQlTypeName() { - return "CustomerActivateByUrlPayload"; + return (String) get("__typename"); } /** - * The customer that was activated. + * The method by which the discount's value is allocated to its entitled items. */ - public Customer getCustomer() { - return (Customer) get("customer"); + public DiscountApplicationAllocationMethod getAllocationMethod() { + return (DiscountApplicationAllocationMethod) get("allocationMethod"); } - public CustomerActivateByUrlPayload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); + public UnknownDiscountApplication setAllocationMethod(DiscountApplicationAllocationMethod arg) { + optimisticData.put(getKey("allocationMethod"), arg); return this; } /** - * A new customer access token for the customer. + * Which lines of targetType that the discount is allocated over. */ - public CustomerAccessToken getCustomerAccessToken() { - return (CustomerAccessToken) get("customerAccessToken"); + public DiscountApplicationTargetSelection getTargetSelection() { + return (DiscountApplicationTargetSelection) get("targetSelection"); } - public CustomerActivateByUrlPayload setCustomerAccessToken(CustomerAccessToken arg) { - optimisticData.put(getKey("customerAccessToken"), arg); + public UnknownDiscountApplication setTargetSelection(DiscountApplicationTargetSelection arg) { + optimisticData.put(getKey("targetSelection"), arg); + return this; + } + + /** + * The type of line that the discount is applicable towards. + */ + + public DiscountApplicationTargetType getTargetType() { + return (DiscountApplicationTargetType) get("targetType"); + } + + public UnknownDiscountApplication setTargetType(DiscountApplicationTargetType arg) { + optimisticData.put(getKey("targetType"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The value of the discount application. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public PricingValue getValue() { + return (PricingValue) get("value"); } - public CustomerActivateByUrlPayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public UnknownDiscountApplication setValue(PricingValue arg) { + optimisticData.put(getKey("value"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "customer": return true; + case "allocationMethod": return false; - case "customerAccessToken": return true; + case "targetSelection": return false; - case "customerUserErrors": return true; + case "targetType": return false; + + case "value": return false; default: return false; } } } - public static class CustomerActivateInput implements Serializable { - private String activationToken; + /** + * The method by which the discount's value is allocated onto its entitled lines. + */ + public enum DiscountApplicationAllocationMethod { + /** + * The value is spread across all entitled lines. + */ + ACROSS, - private String password; + /** + * The value is applied onto every entitled line. + */ + EACH, - public CustomerActivateInput(String activationToken, String password) { - this.activationToken = activationToken; + /** + * The value is specifically applied onto a particular line. + * + * @deprecated Use ACROSS instead. + */ + @Deprecated + ONE, - this.password = password; - } + UNKNOWN_VALUE; - public String getActivationToken() { - return activationToken; - } + public static DiscountApplicationAllocationMethod fromGraphQl(String value) { + if (value == null) { + return null; + } - public CustomerActivateInput setActivationToken(String activationToken) { - this.activationToken = activationToken; - return this; - } + switch (value) { + case "ACROSS": { + return ACROSS; + } - public String getPassword() { - return password; - } + case "EACH": { + return EACH; + } - public CustomerActivateInput setPassword(String password) { - this.password = password; - return this; + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case ACROSS: { + return "ACROSS"; + } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("activationToken:"); - Query.appendQuotedString(_queryBuilder, activationToken.toString()); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("password:"); - Query.appendQuotedString(_queryBuilder, password.toString()); + case EACH: { + return "EACH"; + } - _queryBuilder.append('}'); + default: { + return ""; + } + } } } - public interface CustomerActivatePayloadQueryDefinition { - void define(CustomerActivatePayloadQuery _queryBuilder); + public interface DiscountApplicationConnectionQueryDefinition { + void define(DiscountApplicationConnectionQuery _queryBuilder); } /** - * Return type for `customerActivate` mutation. + * An auto-generated type for paginating through multiple DiscountApplications. */ - public static class CustomerActivatePayloadQuery extends Query { - CustomerActivatePayloadQuery(StringBuilder _queryBuilder) { + public static class DiscountApplicationConnectionQuery extends Query { + DiscountApplicationConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The customer object. - */ - public CustomerActivatePayloadQuery customer(CustomerQueryDefinition queryDef) { - startField("customer"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * A newly created customer access token object for the customer. + * A list of edges. */ - public CustomerActivatePayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { - startField("customerAccessToken"); + public DiscountApplicationConnectionQuery edges(DiscountApplicationEdgeQueryDefinition queryDef) { + startField("edges"); _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); + queryDef.define(new DiscountApplicationEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. + * A list of the nodes contained in DiscountApplicationEdge. */ - public CustomerActivatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); + public DiscountApplicationConnectionQuery nodes(DiscountApplicationQueryDefinition queryDef) { + startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + queryDef.define(new DiscountApplicationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * Information to aid in pagination. */ - @Deprecated - public CustomerActivatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public DiscountApplicationConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new PageInfoQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -26291,43 +32822,32 @@ public CustomerActivatePayloadQuery userErrors(UserErrorQueryDefinition queryDef } /** - * Return type for `customerActivate` mutation. + * An auto-generated type for paginating through multiple DiscountApplications. */ - public static class CustomerActivatePayload extends AbstractResponse { - public CustomerActivatePayload() { + public static class DiscountApplicationConnection extends AbstractResponse { + public DiscountApplicationConnection() { } - public CustomerActivatePayload(JsonObject fields) throws SchemaViolationError { + public DiscountApplicationConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customer": { - Customer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "customerAccessToken": { - CustomerAccessToken optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new DiscountApplicationEdge(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "customerUserErrors": { - List list1 = new ArrayList<>(); + case "nodes": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); + list1.add(UnknownDiscountApplication.create(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -26335,13 +32855,8 @@ public CustomerActivatePayload(JsonObject fields) throws SchemaViolationError { break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } @@ -26358,127 +32873,90 @@ public CustomerActivatePayload(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CustomerActivatePayload"; - } - - /** - * The customer object. - */ - - public Customer getCustomer() { - return (Customer) get("customer"); - } - - public CustomerActivatePayload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); - return this; + return "DiscountApplicationConnection"; } /** - * A newly created customer access token object for the customer. + * A list of edges. */ - public CustomerAccessToken getCustomerAccessToken() { - return (CustomerAccessToken) get("customerAccessToken"); + public List getEdges() { + return (List) get("edges"); } - public CustomerActivatePayload setCustomerAccessToken(CustomerAccessToken arg) { - optimisticData.put(getKey("customerAccessToken"), arg); + public DiscountApplicationConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * A list of the nodes contained in DiscountApplicationEdge. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public List getNodes() { + return (List) get("nodes"); } - public CustomerActivatePayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public DiscountApplicationConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * Information to aid in pagination. */ - public List getUserErrors() { - return (List) get("userErrors"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public CustomerActivatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public DiscountApplicationConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "customer": return true; - - case "customerAccessToken": return true; + case "edges": return true; - case "customerUserErrors": return true; + case "nodes": return false; - case "userErrors": return true; + case "pageInfo": return true; default: return false; } } } - public interface CustomerAddressCreatePayloadQueryDefinition { - void define(CustomerAddressCreatePayloadQuery _queryBuilder); + public interface DiscountApplicationEdgeQueryDefinition { + void define(DiscountApplicationEdgeQuery _queryBuilder); } /** - * Return type for `customerAddressCreate` mutation. + * An auto-generated type which holds one DiscountApplication and a cursor during pagination. */ - public static class CustomerAddressCreatePayloadQuery extends Query { - CustomerAddressCreatePayloadQuery(StringBuilder _queryBuilder) { + public static class DiscountApplicationEdgeQuery extends Query { + DiscountApplicationEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The new customer address object. - */ - public CustomerAddressCreatePayloadQuery customerAddress(MailingAddressQueryDefinition queryDef) { - startField("customerAddress"); - - _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The list of errors that occurred from executing the mutation. + * A cursor for use in pagination. */ - public CustomerAddressCreatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public DiscountApplicationEdgeQuery cursor() { + startField("cursor"); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * The item at the end of DiscountApplicationEdge. */ - @Deprecated - public CustomerAddressCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public DiscountApplicationEdgeQuery node(DiscountApplicationQueryDefinition queryDef) { + startField("node"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new DiscountApplicationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -26486,46 +32964,25 @@ public CustomerAddressCreatePayloadQuery userErrors(UserErrorQueryDefinition que } /** - * Return type for `customerAddressCreate` mutation. + * An auto-generated type which holds one DiscountApplication and a cursor during pagination. */ - public static class CustomerAddressCreatePayload extends AbstractResponse { - public CustomerAddressCreatePayload() { + public static class DiscountApplicationEdge extends AbstractResponse { + public DiscountApplicationEdge() { } - public CustomerAddressCreatePayload(JsonObject fields) throws SchemaViolationError { + public DiscountApplicationEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customerAddress": { - MailingAddress optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "node": { + responseData.put(key, UnknownDiscountApplication.create(jsonAsObject(field.getValue(), key))); break; } @@ -26542,108 +32999,235 @@ public CustomerAddressCreatePayload(JsonObject fields) throws SchemaViolationErr } public String getGraphQlTypeName() { - return "CustomerAddressCreatePayload"; + return "DiscountApplicationEdge"; } /** - * The new customer address object. + * A cursor for use in pagination. */ - public MailingAddress getCustomerAddress() { - return (MailingAddress) get("customerAddress"); + public String getCursor() { + return (String) get("cursor"); } - public CustomerAddressCreatePayload setCustomerAddress(MailingAddress arg) { - optimisticData.put(getKey("customerAddress"), arg); + public DiscountApplicationEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The item at the end of DiscountApplicationEdge. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public DiscountApplication getNode() { + return (DiscountApplication) get("node"); } - public CustomerAddressCreatePayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public DiscountApplicationEdge setNode(DiscountApplication arg) { + optimisticData.put(getKey("node"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; + + case "node": return false; + + default: return false; + } + } + } + + /** + * The lines on the order to which the discount is applied, of the type defined by + * the discount application's `targetType`. For example, the value `ENTITLED`, combined with a + * `targetType` of + * `LINE_ITEM`, applies the discount on all line items that are entitled to the discount. + * The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all + * shipping lines. + */ + public enum DiscountApplicationTargetSelection { /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * The discount is allocated onto all the lines. */ + ALL, - public List getUserErrors() { - return (List) get("userErrors"); + /** + * The discount is allocated onto only the lines that it's entitled for. + */ + ENTITLED, + + /** + * The discount is allocated onto explicitly chosen lines. + */ + EXPLICIT, + + UNKNOWN_VALUE; + + public static DiscountApplicationTargetSelection fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "ALL": { + return ALL; + } + + case "ENTITLED": { + return ENTITLED; + } + + case "EXPLICIT": { + return EXPLICIT; + } + + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case ALL: { + return "ALL"; + } - public CustomerAddressCreatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; + case ENTITLED: { + return "ENTITLED"; + } + + case EXPLICIT: { + return "EXPLICIT"; + } + + default: { + return ""; + } + } } + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "customerAddress": return true; + /** + * The type of line (i.e. line item or shipping line) on an order that the discount is applicable + * towards. + */ + public enum DiscountApplicationTargetType { + /** + * The discount applies onto line items. + */ + LINE_ITEM, - case "customerUserErrors": return true; + /** + * The discount applies onto shipping lines. + */ + SHIPPING_LINE, - case "userErrors": return true; + UNKNOWN_VALUE; - default: return false; + public static DiscountApplicationTargetType fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "LINE_ITEM": { + return LINE_ITEM; + } + + case "SHIPPING_LINE": { + return SHIPPING_LINE; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case LINE_ITEM: { + return "LINE_ITEM"; + } + + case SHIPPING_LINE: { + return "SHIPPING_LINE"; + } + + default: { + return ""; + } } } } - public interface CustomerAddressDeletePayloadQueryDefinition { - void define(CustomerAddressDeletePayloadQuery _queryBuilder); + public interface DiscountCodeApplicationQueryDefinition { + void define(DiscountCodeApplicationQuery _queryBuilder); } /** - * Return type for `customerAddressDelete` mutation. + * Discount code applications capture the intentions of a discount code at + * the time that it is applied. */ - public static class CustomerAddressDeletePayloadQuery extends Query { - CustomerAddressDeletePayloadQuery(StringBuilder _queryBuilder) { + public static class DiscountCodeApplicationQuery extends Query { + DiscountCodeApplicationQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The list of errors that occurred from executing the mutation. + * The method by which the discount's value is allocated to its entitled items. + */ + public DiscountCodeApplicationQuery allocationMethod() { + startField("allocationMethod"); + + return this; + } + + /** + * Specifies whether the discount code was applied successfully. + */ + public DiscountCodeApplicationQuery applicable() { + startField("applicable"); + + return this; + } + + /** + * The string identifying the discount code that was used at the time of application. */ - public CustomerAddressDeletePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); + public DiscountCodeApplicationQuery code() { + startField("code"); - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * Which lines of targetType that the discount is allocated over. + */ + public DiscountCodeApplicationQuery targetSelection() { + startField("targetSelection"); return this; } /** - * ID of the deleted customer address. + * The type of line that the discount is applicable towards. */ - public CustomerAddressDeletePayloadQuery deletedCustomerAddressId() { - startField("deletedCustomerAddressId"); + public DiscountCodeApplicationQuery targetType() { + startField("targetType"); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * The value of the discount application. */ - @Deprecated - public CustomerAddressDeletePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public DiscountCodeApplicationQuery value(PricingValueQueryDefinition queryDef) { + startField("value"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new PricingValueQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -26651,46 +33235,50 @@ public CustomerAddressDeletePayloadQuery userErrors(UserErrorQueryDefinition que } /** - * Return type for `customerAddressDelete` mutation. + * Discount code applications capture the intentions of a discount code at + * the time that it is applied. */ - public static class CustomerAddressDeletePayload extends AbstractResponse { - public CustomerAddressDeletePayload() { + public static class DiscountCodeApplication extends AbstractResponse implements DiscountApplication { + public DiscountCodeApplication() { } - public CustomerAddressDeletePayload(JsonObject fields) throws SchemaViolationError { + public DiscountCodeApplication(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } + case "allocationMethod": { + responseData.put(key, DiscountApplicationAllocationMethod.fromGraphQl(jsonAsString(field.getValue(), key))); - responseData.put(key, list1); + break; + } + + case "applicable": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } - case "deletedCustomerAddressId": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case "code": { + responseData.put(key, jsonAsString(field.getValue(), key)); - responseData.put(key, optional1); + break; + } + + case "targetSelection": { + responseData.put(key, DiscountApplicationTargetSelection.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } + case "targetType": { + responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); - responseData.put(key, list1); + break; + } + + case "value": { + responseData.put(key, UnknownPricingValue.create(jsonAsObject(field.getValue(), key))); break; } @@ -26707,159 +33295,219 @@ public CustomerAddressDeletePayload(JsonObject fields) throws SchemaViolationErr } public String getGraphQlTypeName() { - return "CustomerAddressDeletePayload"; + return "DiscountCodeApplication"; } /** - * The list of errors that occurred from executing the mutation. + * The method by which the discount's value is allocated to its entitled items. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public DiscountApplicationAllocationMethod getAllocationMethod() { + return (DiscountApplicationAllocationMethod) get("allocationMethod"); } - public CustomerAddressDeletePayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public DiscountCodeApplication setAllocationMethod(DiscountApplicationAllocationMethod arg) { + optimisticData.put(getKey("allocationMethod"), arg); return this; } /** - * ID of the deleted customer address. + * Specifies whether the discount code was applied successfully. */ - public String getDeletedCustomerAddressId() { - return (String) get("deletedCustomerAddressId"); + public Boolean getApplicable() { + return (Boolean) get("applicable"); } - public CustomerAddressDeletePayload setDeletedCustomerAddressId(String arg) { - optimisticData.put(getKey("deletedCustomerAddressId"), arg); + public DiscountCodeApplication setApplicable(Boolean arg) { + optimisticData.put(getKey("applicable"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * The string identifying the discount code that was used at the time of application. */ - public List getUserErrors() { - return (List) get("userErrors"); + public String getCode() { + return (String) get("code"); } - public CustomerAddressDeletePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public DiscountCodeApplication setCode(String arg) { + optimisticData.put(getKey("code"), arg); + return this; + } + + /** + * Which lines of targetType that the discount is allocated over. + */ + + public DiscountApplicationTargetSelection getTargetSelection() { + return (DiscountApplicationTargetSelection) get("targetSelection"); + } + + public DiscountCodeApplication setTargetSelection(DiscountApplicationTargetSelection arg) { + optimisticData.put(getKey("targetSelection"), arg); + return this; + } + + /** + * The type of line that the discount is applicable towards. + */ + + public DiscountApplicationTargetType getTargetType() { + return (DiscountApplicationTargetType) get("targetType"); + } + + public DiscountCodeApplication setTargetType(DiscountApplicationTargetType arg) { + optimisticData.put(getKey("targetType"), arg); + return this; + } + + /** + * The value of the discount application. + */ + + public PricingValue getValue() { + return (PricingValue) get("value"); + } + + public DiscountCodeApplication setValue(PricingValue arg) { + optimisticData.put(getKey("value"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "customerUserErrors": return true; + case "allocationMethod": return false; - case "deletedCustomerAddressId": return false; + case "applicable": return false; - case "userErrors": return true; + case "code": return false; + + case "targetSelection": return false; + + case "targetType": return false; + + case "value": return false; default: return false; } } } - public interface CustomerAddressUpdatePayloadQueryDefinition { - void define(CustomerAddressUpdatePayloadQuery _queryBuilder); + public interface DisplayableErrorQueryDefinition { + void define(DisplayableErrorQuery _queryBuilder); } /** - * Return type for `customerAddressUpdate` mutation. + * Represents an error in the input of a mutation. */ - public static class CustomerAddressUpdatePayloadQuery extends Query { - CustomerAddressUpdatePayloadQuery(StringBuilder _queryBuilder) { + public static class DisplayableErrorQuery extends Query { + DisplayableErrorQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("__typename"); } /** - * The customer’s updated mailing address. + * The path to the input field that caused the error. */ - public CustomerAddressUpdatePayloadQuery customerAddress(MailingAddressQueryDefinition queryDef) { - startField("customerAddress"); - - _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); + public DisplayableErrorQuery field() { + startField("field"); return this; } /** - * The list of errors that occurred from executing the mutation. + * The error message. */ - public CustomerAddressUpdatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); + public DisplayableErrorQuery message() { + startField("message"); - _queryBuilder.append('{'); + return this; + } + + public DisplayableErrorQuery onCartUserError(CartUserErrorQueryDefinition queryDef) { + startInlineFragment("CartUserError"); + queryDef.define(new CartUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public DisplayableErrorQuery onCheckoutUserError(CheckoutUserErrorQueryDefinition queryDef) { + startInlineFragment("CheckoutUserError"); + queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public DisplayableErrorQuery onCustomerUserError(CustomerUserErrorQueryDefinition queryDef) { + startInlineFragment("CustomerUserError"); queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; + } + public DisplayableErrorQuery onMetafieldDeleteUserError(MetafieldDeleteUserErrorQueryDefinition queryDef) { + startInlineFragment("MetafieldDeleteUserError"); + queryDef.define(new MetafieldDeleteUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. - */ - @Deprecated - public CustomerAddressUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public DisplayableErrorQuery onMetafieldsSetUserError(MetafieldsSetUserErrorQueryDefinition queryDef) { + startInlineFragment("MetafieldsSetUserError"); + queryDef.define(new MetafieldsSetUserErrorQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - _queryBuilder.append('{'); + public DisplayableErrorQuery onUserError(UserErrorQueryDefinition queryDef) { + startInlineFragment("UserError"); queryDef.define(new UserErrorQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; } } + public interface DisplayableError { + String getGraphQlTypeName(); + + List getField(); + + String getMessage(); + } + /** - * Return type for `customerAddressUpdate` mutation. + * Represents an error in the input of a mutation. */ - public static class CustomerAddressUpdatePayload extends AbstractResponse { - public CustomerAddressUpdatePayload() { + public static class UnknownDisplayableError extends AbstractResponse implements DisplayableError { + public UnknownDisplayableError() { } - public CustomerAddressUpdatePayload(JsonObject fields) throws SchemaViolationError { + public UnknownDisplayableError(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customerAddress": { - MailingAddress optional1 = null; + case "field": { + List optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); + optional1 = list1; } - responseData.put(key, list1); + 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); + case "message": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -26875,343 +33523,146 @@ public CustomerAddressUpdatePayload(JsonObject fields) throws SchemaViolationErr } } - public String getGraphQlTypeName() { - return "CustomerAddressUpdatePayload"; - } - - /** - * The customer’s updated mailing address. - */ - - public MailingAddress getCustomerAddress() { - return (MailingAddress) get("customerAddress"); - } - - public CustomerAddressUpdatePayload setCustomerAddress(MailingAddress arg) { - optimisticData.put(getKey("customerAddress"), arg); - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - */ - - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); - } - - public CustomerAddressUpdatePayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); - return this; - } - - /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. - */ - - public List getUserErrors() { - return (List) get("userErrors"); - } - - public CustomerAddressUpdatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "customerAddress": return true; - - case "customerUserErrors": return true; - - case "userErrors": return true; - - default: return false; - } - } - } - - public static class CustomerCreateInput implements Serializable { - private String email; - - private String password; - - private Input firstName = Input.undefined(); - - private Input lastName = Input.undefined(); - - private Input phone = Input.undefined(); - - private Input acceptsMarketing = Input.undefined(); - - public CustomerCreateInput(String email, String password) { - this.email = email; - - this.password = password; - } - - public String getEmail() { - return email; - } - - public CustomerCreateInput setEmail(String email) { - this.email = email; - return this; - } - - public String getPassword() { - return password; - } - - public CustomerCreateInput setPassword(String password) { - this.password = password; - return this; - } - - public String getFirstName() { - return firstName.getValue(); - } - - public Input getFirstNameInput() { - return firstName; - } + public static DisplayableError create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "CartUserError": { + return new CartUserError(fields); + } - public CustomerCreateInput setFirstName(String firstName) { - this.firstName = Input.optional(firstName); - return this; - } + case "CheckoutUserError": { + return new CheckoutUserError(fields); + } - public CustomerCreateInput setFirstNameInput(Input firstName) { - if (firstName == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.firstName = firstName; - return this; - } + case "CustomerUserError": { + return new CustomerUserError(fields); + } - public String getLastName() { - return lastName.getValue(); - } + case "MetafieldDeleteUserError": { + return new MetafieldDeleteUserError(fields); + } - public Input getLastNameInput() { - return lastName; - } + case "MetafieldsSetUserError": { + return new MetafieldsSetUserError(fields); + } - public CustomerCreateInput setLastName(String lastName) { - this.lastName = Input.optional(lastName); - return this; - } + case "UserError": { + return new UserError(fields); + } - public CustomerCreateInput setLastNameInput(Input lastName) { - if (lastName == null) { - throw new IllegalArgumentException("Input can not be null"); + default: { + return new UnknownDisplayableError(fields); + } } - this.lastName = lastName; - return this; } - public String getPhone() { - return phone.getValue(); + public String getGraphQlTypeName() { + return (String) get("__typename"); } - public Input getPhoneInput() { - return phone; - } + /** + * The path to the input field that caused the error. + */ - public CustomerCreateInput setPhone(String phone) { - this.phone = Input.optional(phone); - return this; + public List getField() { + return (List) get("field"); } - public CustomerCreateInput setPhoneInput(Input phone) { - if (phone == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.phone = phone; + public UnknownDisplayableError setField(List arg) { + optimisticData.put(getKey("field"), arg); return this; } - public Boolean getAcceptsMarketing() { - return acceptsMarketing.getValue(); - } - - public Input getAcceptsMarketingInput() { - return acceptsMarketing; - } + /** + * The error message. + */ - public CustomerCreateInput setAcceptsMarketing(Boolean acceptsMarketing) { - this.acceptsMarketing = Input.optional(acceptsMarketing); - return this; + public String getMessage() { + return (String) get("message"); } - public CustomerCreateInput setAcceptsMarketingInput(Input acceptsMarketing) { - if (acceptsMarketing == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.acceptsMarketing = acceptsMarketing; + public UnknownDisplayableError setMessage(String arg) { + optimisticData.put(getKey("message"), arg); return this; } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("email:"); - Query.appendQuotedString(_queryBuilder, email.toString()); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("password:"); - Query.appendQuotedString(_queryBuilder, password.toString()); - - if (this.firstName.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("firstName:"); - if (firstName.getValue() != null) { - Query.appendQuotedString(_queryBuilder, firstName.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.lastName.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("lastName:"); - if (lastName.getValue() != null) { - Query.appendQuotedString(_queryBuilder, lastName.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.phone.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("phone:"); - if (phone.getValue() != null) { - Query.appendQuotedString(_queryBuilder, phone.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "field": return false; - if (this.acceptsMarketing.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("acceptsMarketing:"); - if (acceptsMarketing.getValue() != null) { - _queryBuilder.append(acceptsMarketing.getValue()); - } else { - _queryBuilder.append("null"); - } - } + case "message": return false; - _queryBuilder.append('}'); + default: return false; + } } } - public interface CustomerCreatePayloadQueryDefinition { - void define(CustomerCreatePayloadQuery _queryBuilder); + public interface DomainQueryDefinition { + void define(DomainQuery _queryBuilder); } /** - * Return type for `customerCreate` mutation. + * Represents a web address. */ - public static class CustomerCreatePayloadQuery extends Query { - CustomerCreatePayloadQuery(StringBuilder _queryBuilder) { + public static class DomainQuery extends Query { + DomainQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The created customer object. + * The host name of the domain (eg: `example.com`). */ - public CustomerCreatePayloadQuery customer(CustomerQueryDefinition queryDef) { - startField("customer"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); + public DomainQuery host() { + startField("host"); return this; } /** - * The list of errors that occurred from executing the mutation. + * Whether SSL is enabled or not. */ - public CustomerCreatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public DomainQuery sslEnabled() { + startField("sslEnabled"); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * The URL of the domain (eg: `https://example.com`). */ - @Deprecated - public CustomerCreatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public DomainQuery url() { + startField("url"); return this; } } /** - * Return type for `customerCreate` mutation. + * Represents a web address. */ - public static class CustomerCreatePayload extends AbstractResponse { - public CustomerCreatePayload() { + public static class Domain extends AbstractResponse { + public Domain() { } - public CustomerCreatePayload(JsonObject fields) throws SchemaViolationError { + public Domain(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customer": { - Customer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "host": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "sslEnabled": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "url": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -27228,112 +33679,153 @@ public CustomerCreatePayload(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CustomerCreatePayload"; + return "Domain"; } /** - * The created customer object. + * The host name of the domain (eg: `example.com`). */ - public Customer getCustomer() { - return (Customer) get("customer"); + public String getHost() { + return (String) get("host"); } - public CustomerCreatePayload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); + public Domain setHost(String arg) { + optimisticData.put(getKey("host"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * Whether SSL is enabled or not. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public Boolean getSslEnabled() { + return (Boolean) get("sslEnabled"); } - public CustomerCreatePayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public Domain setSslEnabled(Boolean arg) { + optimisticData.put(getKey("sslEnabled"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * The URL of the domain (eg: `https://example.com`). */ - public List getUserErrors() { - return (List) get("userErrors"); + public String getUrl() { + return (String) get("url"); } - public CustomerCreatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public Domain setUrl(String arg) { + optimisticData.put(getKey("url"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "customer": return true; + case "host": return false; - case "customerUserErrors": return true; + case "sslEnabled": return false; - case "userErrors": return true; + case "url": return false; default: return false; } } } - public interface CustomerDefaultAddressUpdatePayloadQueryDefinition { - void define(CustomerDefaultAddressUpdatePayloadQuery _queryBuilder); + public interface ExternalVideoQueryDefinition { + void define(ExternalVideoQuery _queryBuilder); } /** - * Return type for `customerDefaultAddressUpdate` mutation. + * Represents a video hosted outside of Shopify. */ - public static class CustomerDefaultAddressUpdatePayloadQuery extends Query { - CustomerDefaultAddressUpdatePayloadQuery(StringBuilder _queryBuilder) { + public static class ExternalVideoQuery extends Query { + ExternalVideoQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * The updated customer object. + * A word or phrase to share the nature or contents of a media. */ - public CustomerDefaultAddressUpdatePayloadQuery customer(CustomerQueryDefinition queryDef) { - startField("customer"); + public ExternalVideoQuery alt() { + startField("alt"); - _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * The embed URL of the video for the respective host. + */ + public ExternalVideoQuery embedUrl() { + startField("embedUrl"); return this; } /** - * The list of errors that occurred from executing the mutation. + * The URL. + * + * @deprecated Use `originUrl` instead. */ - public CustomerDefaultAddressUpdatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); + @Deprecated + public ExternalVideoQuery embeddedUrl() { + startField("embeddedUrl"); + + return this; + } + + /** + * The host of the external video. + */ + public ExternalVideoQuery host() { + startField("host"); + + return this; + } + + /** + * The media content type. + */ + public ExternalVideoQuery mediaContentType() { + startField("mediaContentType"); + + return this; + } + + /** + * The origin URL of the video on the respective host. + */ + public ExternalVideoQuery originUrl() { + startField("originUrl"); + + return this; + } + + /** + * The presentation for a media. + */ + public ExternalVideoQuery presentation(MediaPresentationQueryDefinition queryDef) { + startField("presentation"); _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); + queryDef.define(new MediaPresentationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * The preview image for the media. */ - @Deprecated - public CustomerDefaultAddressUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public ExternalVideoQuery previewImage(ImageQueryDefinition queryDef) { + startField("previewImage"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new ImageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -27341,21 +33833,21 @@ public CustomerDefaultAddressUpdatePayloadQuery userErrors(UserErrorQueryDefinit } /** - * Return type for `customerDefaultAddressUpdate` mutation. + * Represents a video hosted outside of Shopify. */ - public static class CustomerDefaultAddressUpdatePayload extends AbstractResponse { - public CustomerDefaultAddressUpdatePayload() { + public static class ExternalVideo extends AbstractResponse implements Media, Node { + public ExternalVideo() { } - public CustomerDefaultAddressUpdatePayload(JsonObject fields) throws SchemaViolationError { + public ExternalVideo(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customer": { - Customer optional1 = null; + case "alt": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -27363,24 +33855,60 @@ public CustomerDefaultAddressUpdatePayload(JsonObject fields) throws SchemaViola break; } - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); + case "embedUrl": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "embeddedUrl": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "host": { + responseData.put(key, MediaHost.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "mediaContentType": { + responseData.put(key, MediaContentType.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "originUrl": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "presentation": { + MediaPresentation optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MediaPresentation(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + 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))); + case "previewImage": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } @@ -27396,321 +33924,201 @@ public CustomerDefaultAddressUpdatePayload(JsonObject fields) throws SchemaViola } } + public ExternalVideo(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "CustomerDefaultAddressUpdatePayload"; + return "ExternalVideo"; } /** - * The updated customer object. + * A word or phrase to share the nature or contents of a media. */ - public Customer getCustomer() { - return (Customer) get("customer"); + public String getAlt() { + return (String) get("alt"); } - public CustomerDefaultAddressUpdatePayload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); + public ExternalVideo setAlt(String arg) { + optimisticData.put(getKey("alt"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The embed URL of the video for the respective host. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public String getEmbedUrl() { + return (String) get("embedUrl"); } - public CustomerDefaultAddressUpdatePayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public ExternalVideo setEmbedUrl(String arg) { + optimisticData.put(getKey("embedUrl"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The URL. * - * @deprecated Use `customerUserErrors` instead. + * @deprecated Use `originUrl` instead. */ - public List getUserErrors() { - return (List) get("userErrors"); + public String getEmbeddedUrl() { + return (String) get("embeddedUrl"); } - public CustomerDefaultAddressUpdatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public ExternalVideo setEmbeddedUrl(String arg) { + optimisticData.put(getKey("embeddedUrl"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "customer": return true; - - case "customerUserErrors": return true; - - case "userErrors": return true; - - default: return false; - } - } - } - - /** - * Possible error codes that can be returned by `CustomerUserError`. - */ - public enum CustomerErrorCode { - /** - * Customer already enabled. - */ - ALREADY_ENABLED, - - /** - * Input email contains an invalid domain name. - */ - BAD_DOMAIN, - - /** - * The input value is blank. - */ - BLANK, - - /** - * Input contains HTML tags. - */ - CONTAINS_HTML_TAGS, - - /** - * Input contains URL. - */ - CONTAINS_URL, - /** - * Customer is disabled. - */ - CUSTOMER_DISABLED, - - /** - * The input value is invalid. + * The host of the external video. */ - INVALID, - /** - * Multipass token is not valid. - */ - INVALID_MULTIPASS_REQUEST, + public MediaHost getHost() { + return (MediaHost) get("host"); + } - /** - * Address does not exist. - */ - NOT_FOUND, + public ExternalVideo setHost(MediaHost arg) { + optimisticData.put(getKey("host"), arg); + return this; + } /** - * Input password starts or ends with whitespace. + * A globally-unique identifier. */ - PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE, - /** - * The input value is already taken. - */ - TAKEN, + public ID getId() { + return (ID) get("id"); + } /** - * Invalid activation token. + * The media content type. */ - TOKEN_INVALID, - /** - * The input value is too long. - */ - TOO_LONG, + public MediaContentType getMediaContentType() { + return (MediaContentType) get("mediaContentType"); + } - /** - * The input value is too short. - */ - TOO_SHORT, + public ExternalVideo setMediaContentType(MediaContentType arg) { + optimisticData.put(getKey("mediaContentType"), arg); + return this; + } /** - * Unidentified customer. + * The origin URL of the video on the respective host. */ - UNIDENTIFIED_CUSTOMER, - - UNKNOWN_VALUE; - - public static CustomerErrorCode fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "ALREADY_ENABLED": { - return ALREADY_ENABLED; - } - - case "BAD_DOMAIN": { - return BAD_DOMAIN; - } - - case "BLANK": { - return BLANK; - } - - case "CONTAINS_HTML_TAGS": { - return CONTAINS_HTML_TAGS; - } - - case "CONTAINS_URL": { - return CONTAINS_URL; - } - - case "CUSTOMER_DISABLED": { - return CUSTOMER_DISABLED; - } - - case "INVALID": { - return INVALID; - } - - case "INVALID_MULTIPASS_REQUEST": { - return INVALID_MULTIPASS_REQUEST; - } - - case "NOT_FOUND": { - return NOT_FOUND; - } - - case "PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE": { - return PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE; - } - - case "TAKEN": { - return TAKEN; - } - - case "TOKEN_INVALID": { - return TOKEN_INVALID; - } - - case "TOO_LONG": { - return TOO_LONG; - } - - case "TOO_SHORT": { - return TOO_SHORT; - } - - case "UNIDENTIFIED_CUSTOMER": { - return UNIDENTIFIED_CUSTOMER; - } - default: { - return UNKNOWN_VALUE; - } - } + public String getOriginUrl() { + return (String) get("originUrl"); + } + + public ExternalVideo setOriginUrl(String arg) { + optimisticData.put(getKey("originUrl"), arg); + return this; } - public String toString() { - switch (this) { - case ALREADY_ENABLED: { - return "ALREADY_ENABLED"; - } - case BAD_DOMAIN: { - return "BAD_DOMAIN"; - } + /** + * The presentation for a media. + */ - case BLANK: { - return "BLANK"; - } + public MediaPresentation getPresentation() { + return (MediaPresentation) get("presentation"); + } - case CONTAINS_HTML_TAGS: { - return "CONTAINS_HTML_TAGS"; - } + public ExternalVideo setPresentation(MediaPresentation arg) { + optimisticData.put(getKey("presentation"), arg); + return this; + } - case CONTAINS_URL: { - return "CONTAINS_URL"; - } + /** + * The preview image for the media. + */ - case CUSTOMER_DISABLED: { - return "CUSTOMER_DISABLED"; - } + public Image getPreviewImage() { + return (Image) get("previewImage"); + } - case INVALID: { - return "INVALID"; - } + public ExternalVideo setPreviewImage(Image arg) { + optimisticData.put(getKey("previewImage"), arg); + return this; + } - case INVALID_MULTIPASS_REQUEST: { - return "INVALID_MULTIPASS_REQUEST"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "alt": return false; - case NOT_FOUND: { - return "NOT_FOUND"; - } + case "embedUrl": return false; - case PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE: { - return "PASSWORD_STARTS_OR_ENDS_WITH_WHITESPACE"; - } + case "embeddedUrl": return false; - case TAKEN: { - return "TAKEN"; - } + case "host": return false; - case TOKEN_INVALID: { - return "TOKEN_INVALID"; - } + case "id": return false; - case TOO_LONG: { - return "TOO_LONG"; - } + case "mediaContentType": return false; - case TOO_SHORT: { - return "TOO_SHORT"; - } + case "originUrl": return false; - case UNIDENTIFIED_CUSTOMER: { - return "UNIDENTIFIED_CUSTOMER"; - } + case "presentation": return true; - default: { - return ""; - } + case "previewImage": return true; + + default: return false; } } } - public interface CustomerRecoverPayloadQueryDefinition { - void define(CustomerRecoverPayloadQuery _queryBuilder); + public interface FilterQueryDefinition { + void define(FilterQuery _queryBuilder); } /** - * Return type for `customerRecover` mutation. + * A filter that is supported on the parent field. */ - public static class CustomerRecoverPayloadQuery extends Query { - CustomerRecoverPayloadQuery(StringBuilder _queryBuilder) { + public static class FilterQuery extends Query { + FilterQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The list of errors that occurred from executing the mutation. + * A unique identifier. */ - public CustomerRecoverPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); + public FilterQuery id() { + startField("id"); - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * A human-friendly string for this filter. + */ + public FilterQuery label() { + startField("label"); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * An enumeration that denotes the type of data this filter represents. */ - @Deprecated - public CustomerRecoverPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public FilterQuery type() { + startField("type"); + + return this; + } + + /** + * The list of values for this filter. + */ + public FilterQuery values(FilterValueQueryDefinition queryDef) { + startField("values"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new FilterValueQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -27718,32 +34126,39 @@ public CustomerRecoverPayloadQuery userErrors(UserErrorQueryDefinition queryDef) } /** - * Return type for `customerRecover` mutation. + * A filter that is supported on the parent field. */ - public static class CustomerRecoverPayload extends AbstractResponse { - public CustomerRecoverPayload() { + public static class Filter extends AbstractResponse { + public Filter() { } - public CustomerRecoverPayload(JsonObject fields) throws SchemaViolationError { + public Filter(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } + case "id": { + responseData.put(key, jsonAsString(field.getValue(), key)); - responseData.put(key, list1); + break; + } + + case "label": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "userErrors": { - List list1 = new ArrayList<>(); + case "type": { + responseData.put(key, FilterType.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "values": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); + list1.add(new FilterValue(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -27763,168 +34178,227 @@ public CustomerRecoverPayload(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CustomerRecoverPayload"; + return "Filter"; } /** - * The list of errors that occurred from executing the mutation. + * A unique identifier. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public String getId() { + return (String) get("id"); } - public CustomerRecoverPayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public Filter setId(String arg) { + optimisticData.put(getKey("id"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * A human-friendly string for this filter. */ - public List getUserErrors() { - return (List) get("userErrors"); + public String getLabel() { + return (String) get("label"); } - public CustomerRecoverPayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public Filter setLabel(String arg) { + optimisticData.put(getKey("label"), arg); + return this; + } + + /** + * An enumeration that denotes the type of data this filter represents. + */ + + public FilterType getType() { + return (FilterType) get("type"); + } + + public Filter setType(FilterType arg) { + optimisticData.put(getKey("type"), arg); + return this; + } + + /** + * The list of values for this filter. + */ + + public List getValues() { + return (List) get("values"); + } + + public Filter setValues(List arg) { + optimisticData.put(getKey("values"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "customerUserErrors": return true; + case "id": return false; - case "userErrors": return true; + case "label": return false; + + case "type": return false; + + case "values": return true; default: return false; } } } - public interface CustomerResetByUrlPayloadQueryDefinition { - void define(CustomerResetByUrlPayloadQuery _queryBuilder); + /** + * The type of data that the filter group represents. + * For more information, refer to [Filter products in a collection with the Storefront API] + * (https://shopify.dev/custom-storefronts/products-collections/filter-products). + */ + public enum FilterType { + /** + * A boolean value. + */ + BOOLEAN, + + /** + * A list of selectable values. + */ + LIST, + + /** + * A range of prices. + */ + PRICE_RANGE, + + UNKNOWN_VALUE; + + public static FilterType fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "BOOLEAN": { + return BOOLEAN; + } + + case "LIST": { + return LIST; + } + + case "PRICE_RANGE": { + return PRICE_RANGE; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case BOOLEAN: { + return "BOOLEAN"; + } + + case LIST: { + return "LIST"; + } + + case PRICE_RANGE: { + return "PRICE_RANGE"; + } + + default: { + return ""; + } + } + } + } + + public interface FilterValueQueryDefinition { + void define(FilterValueQuery _queryBuilder); } /** - * Return type for `customerResetByUrl` mutation. + * A selectable value within a filter. */ - public static class CustomerResetByUrlPayloadQuery extends Query { - CustomerResetByUrlPayloadQuery(StringBuilder _queryBuilder) { + public static class FilterValueQuery extends Query { + FilterValueQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The customer object which was reset. + * The number of results that match this filter value. */ - public CustomerResetByUrlPayloadQuery customer(CustomerQueryDefinition queryDef) { - startField("customer"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); + public FilterValueQuery count() { + startField("count"); return this; } /** - * A newly created customer access token object for the customer. + * A unique identifier. */ - public CustomerResetByUrlPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { - startField("customerAccessToken"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); - _queryBuilder.append('}'); + public FilterValueQuery id() { + startField("id"); return this; } /** - * The list of errors that occurred from executing the mutation. + * An input object that can be used to filter by this value on the parent field. + * The value is provided as a helper for building dynamic filtering UI. For example, if you have a list + * of selected `FilterValue` objects, you can combine their respective `input` values to use in a + * subsequent query. */ - public CustomerResetByUrlPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public FilterValueQuery input() { + startField("input"); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * A human-friendly string for this filter value. */ - @Deprecated - public CustomerResetByUrlPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); - - _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public FilterValueQuery label() { + startField("label"); return this; } } /** - * Return type for `customerResetByUrl` mutation. + * A selectable value within a filter. */ - public static class CustomerResetByUrlPayload extends AbstractResponse { - public CustomerResetByUrlPayload() { + public static class FilterValue extends AbstractResponse { + public FilterValue() { } - public CustomerResetByUrlPayload(JsonObject fields) throws SchemaViolationError { + public FilterValue(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customer": { - Customer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "count": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); break; } - case "customerAccessToken": { - CustomerAccessToken optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "id": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "input": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "label": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -27941,187 +34415,231 @@ public CustomerResetByUrlPayload(JsonObject fields) throws SchemaViolationError } public String getGraphQlTypeName() { - return "CustomerResetByUrlPayload"; + return "FilterValue"; } /** - * The customer object which was reset. + * The number of results that match this filter value. */ - public Customer getCustomer() { - return (Customer) get("customer"); + public Integer getCount() { + return (Integer) get("count"); } - public CustomerResetByUrlPayload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); + public FilterValue setCount(Integer arg) { + optimisticData.put(getKey("count"), arg); return this; } /** - * A newly created customer access token object for the customer. + * A unique identifier. */ - public CustomerAccessToken getCustomerAccessToken() { - return (CustomerAccessToken) get("customerAccessToken"); + public String getId() { + return (String) get("id"); } - public CustomerResetByUrlPayload setCustomerAccessToken(CustomerAccessToken arg) { - optimisticData.put(getKey("customerAccessToken"), arg); + public FilterValue setId(String arg) { + optimisticData.put(getKey("id"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * An input object that can be used to filter by this value on the parent field. + * The value is provided as a helper for building dynamic filtering UI. For example, if you have a list + * of selected `FilterValue` objects, you can combine their respective `input` values to use in a + * subsequent query. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public String getInput() { + return (String) get("input"); } - public CustomerResetByUrlPayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public FilterValue setInput(String arg) { + optimisticData.put(getKey("input"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * A human-friendly string for this filter value. */ - public List getUserErrors() { - return (List) get("userErrors"); + public String getLabel() { + return (String) get("label"); } - public CustomerResetByUrlPayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public FilterValue setLabel(String arg) { + optimisticData.put(getKey("label"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "customer": return true; + case "count": return false; - case "customerAccessToken": return true; + case "id": return false; - case "customerUserErrors": return true; + case "input": return false; - case "userErrors": return true; + case "label": return false; default: return false; } } } - public static class CustomerResetInput implements Serializable { - private String resetToken; + public interface FulfillmentQueryDefinition { + void define(FulfillmentQuery _queryBuilder); + } - private String password; + /** + * Represents a single fulfillment in an order. + */ + public static class FulfillmentQuery extends Query { + FulfillmentQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - public CustomerResetInput(String resetToken, String password) { - this.resetToken = resetToken; + public class FulfillmentLineItemsArguments extends Arguments { + FulfillmentLineItemsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - this.password = password; - } + /** + * Returns up to the first `n` elements from the list. + */ + public FulfillmentLineItemsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - public String getResetToken() { - return resetToken; - } + /** + * Returns the elements that come after the specified cursor. + */ + public FulfillmentLineItemsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - public CustomerResetInput setResetToken(String resetToken) { - this.resetToken = resetToken; - return this; + /** + * Returns up to the last `n` elements from the list. + */ + public FulfillmentLineItemsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come before the specified cursor. + */ + public FulfillmentLineItemsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Reverse the order of the underlying list. + */ + public FulfillmentLineItemsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } } - public String getPassword() { - return password; + public interface FulfillmentLineItemsArgumentsDefinition { + void define(FulfillmentLineItemsArguments args); } - public CustomerResetInput setPassword(String password) { - this.password = password; - return this; + /** + * List of the fulfillment's line items. + */ + public FulfillmentQuery fulfillmentLineItems(FulfillmentLineItemConnectionQueryDefinition queryDef) { + return fulfillmentLineItems(args -> {}, queryDef); } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("resetToken:"); - Query.appendQuotedString(_queryBuilder, resetToken.toString()); + /** + * List of the fulfillment's line items. + */ + public FulfillmentQuery fulfillmentLineItems(FulfillmentLineItemsArgumentsDefinition argsDef, FulfillmentLineItemConnectionQueryDefinition queryDef) { + startField("fulfillmentLineItems"); - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("password:"); - Query.appendQuotedString(_queryBuilder, password.toString()); + FulfillmentLineItemsArguments args = new FulfillmentLineItemsArguments(_queryBuilder); + argsDef.define(args); + FulfillmentLineItemsArguments.end(args); + _queryBuilder.append('{'); + queryDef.define(new FulfillmentLineItemConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); - } - } - - public interface CustomerResetPayloadQueryDefinition { - void define(CustomerResetPayloadQuery _queryBuilder); - } - /** - * Return type for `customerReset` mutation. - */ - public static class CustomerResetPayloadQuery extends Query { - CustomerResetPayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * The customer object which was reset. + * The name of the tracking company. */ - public CustomerResetPayloadQuery customer(CustomerQueryDefinition queryDef) { - startField("customer"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); + public FulfillmentQuery trackingCompany() { + startField("trackingCompany"); return this; } - /** - * A newly created customer access token object for the customer. - */ - public CustomerResetPayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { - startField("customerAccessToken"); + public class TrackingInfoArguments extends Arguments { + TrackingInfoArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Truncate the array result to this size. + */ + public TrackingInfoArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } + } - return this; + public interface TrackingInfoArgumentsDefinition { + void define(TrackingInfoArguments args); } /** - * The list of errors that occurred from executing the mutation. + * Tracking information associated with the fulfillment, + * such as the tracking number and tracking URL. */ - public CustomerResetPayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + public FulfillmentQuery trackingInfo(FulfillmentTrackingInfoQueryDefinition queryDef) { + return trackingInfo(args -> {}, queryDef); } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * Tracking information associated with the fulfillment, + * such as the tracking number and tracking URL. */ - @Deprecated - public CustomerResetPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public FulfillmentQuery trackingInfo(TrackingInfoArgumentsDefinition argsDef, FulfillmentTrackingInfoQueryDefinition queryDef) { + startField("trackingInfo"); + + TrackingInfoArguments args = new TrackingInfoArguments(_queryBuilder); + argsDef.define(args); + TrackingInfoArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new FulfillmentTrackingInfoQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -28129,32 +34647,27 @@ public CustomerResetPayloadQuery userErrors(UserErrorQueryDefinition queryDef) { } /** - * Return type for `customerReset` mutation. + * Represents a single fulfillment in an order. */ - public static class CustomerResetPayload extends AbstractResponse { - public CustomerResetPayload() { + public static class Fulfillment extends AbstractResponse { + public Fulfillment() { } - public CustomerResetPayload(JsonObject fields) throws SchemaViolationError { + public Fulfillment(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customer": { - Customer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "fulfillmentLineItems": { + responseData.put(key, new FulfillmentLineItemConnection(jsonAsObject(field.getValue(), key))); break; } - case "customerAccessToken": { - CustomerAccessToken optional1 = null; + case "trackingCompany": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -28162,21 +34675,10 @@ public CustomerResetPayload(JsonObject fields) throws SchemaViolationError { break; } - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "userErrors": { - List list1 = new ArrayList<>(); + case "trackingInfo": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); + list1.add(new FulfillmentTrackingInfo(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -28196,355 +34698,363 @@ public CustomerResetPayload(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CustomerResetPayload"; - } - - /** - * The customer object which was reset. - */ - - public Customer getCustomer() { - return (Customer) get("customer"); - } - - public CustomerResetPayload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); - return this; + return "Fulfillment"; } /** - * A newly created customer access token object for the customer. + * List of the fulfillment's line items. */ - public CustomerAccessToken getCustomerAccessToken() { - return (CustomerAccessToken) get("customerAccessToken"); + public FulfillmentLineItemConnection getFulfillmentLineItems() { + return (FulfillmentLineItemConnection) get("fulfillmentLineItems"); } - public CustomerResetPayload setCustomerAccessToken(CustomerAccessToken arg) { - optimisticData.put(getKey("customerAccessToken"), arg); + public Fulfillment setFulfillmentLineItems(FulfillmentLineItemConnection arg) { + optimisticData.put(getKey("fulfillmentLineItems"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. + * The name of the tracking company. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public String getTrackingCompany() { + return (String) get("trackingCompany"); } - public CustomerResetPayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public Fulfillment setTrackingCompany(String arg) { + optimisticData.put(getKey("trackingCompany"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * Tracking information associated with the fulfillment, + * such as the tracking number and tracking URL. */ - public List getUserErrors() { - return (List) get("userErrors"); + public List getTrackingInfo() { + return (List) get("trackingInfo"); } - public CustomerResetPayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public Fulfillment setTrackingInfo(List arg) { + optimisticData.put(getKey("trackingInfo"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "customer": return true; - - case "customerAccessToken": return true; + case "fulfillmentLineItems": return true; - case "customerUserErrors": return true; + case "trackingCompany": return false; - case "userErrors": return true; + case "trackingInfo": return true; default: return false; } } } - public static class CustomerUpdateInput implements Serializable { - private Input firstName = Input.undefined(); - - private Input lastName = Input.undefined(); - - private Input email = Input.undefined(); + public interface FulfillmentLineItemQueryDefinition { + void define(FulfillmentLineItemQuery _queryBuilder); + } - private Input phone = Input.undefined(); + /** + * Represents a single line item in a fulfillment. There is at most one fulfillment line item for each + * order line item. + */ + public static class FulfillmentLineItemQuery extends Query { + FulfillmentLineItemQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - private Input password = Input.undefined(); + /** + * The associated order's line item. + */ + public FulfillmentLineItemQuery lineItem(OrderLineItemQueryDefinition queryDef) { + startField("lineItem"); - private Input acceptsMarketing = Input.undefined(); + _queryBuilder.append('{'); + queryDef.define(new OrderLineItemQuery(_queryBuilder)); + _queryBuilder.append('}'); - public String getFirstName() { - return firstName.getValue(); + return this; } - public Input getFirstNameInput() { - return firstName; - } + /** + * The amount fulfilled in this fulfillment. + */ + public FulfillmentLineItemQuery quantity() { + startField("quantity"); - public CustomerUpdateInput setFirstName(String firstName) { - this.firstName = Input.optional(firstName); return this; } + } - public CustomerUpdateInput setFirstNameInput(Input firstName) { - if (firstName == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.firstName = firstName; - return this; + /** + * Represents a single line item in a fulfillment. There is at most one fulfillment line item for each + * order line item. + */ + public static class FulfillmentLineItem extends AbstractResponse { + public FulfillmentLineItem() { } - public String getLastName() { - return lastName.getValue(); - } + public FulfillmentLineItem(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "lineItem": { + responseData.put(key, new OrderLineItem(jsonAsObject(field.getValue(), key))); - public Input getLastNameInput() { - return lastName; - } + break; + } - public CustomerUpdateInput setLastName(String lastName) { - this.lastName = Input.optional(lastName); - return this; - } + case "quantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); - public CustomerUpdateInput setLastNameInput(Input lastName) { - if (lastName == null) { - throw new IllegalArgumentException("Input can not be null"); + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } } - this.lastName = lastName; - return this; } - public String getEmail() { - return email.getValue(); + public String getGraphQlTypeName() { + return "FulfillmentLineItem"; } - public Input getEmailInput() { - return email; - } + /** + * The associated order's line item. + */ - public CustomerUpdateInput setEmail(String email) { - this.email = Input.optional(email); - return this; + public OrderLineItem getLineItem() { + return (OrderLineItem) get("lineItem"); } - public CustomerUpdateInput setEmailInput(Input email) { - if (email == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.email = email; + public FulfillmentLineItem setLineItem(OrderLineItem arg) { + optimisticData.put(getKey("lineItem"), arg); return this; } - public String getPhone() { - return phone.getValue(); - } + /** + * The amount fulfilled in this fulfillment. + */ - public Input getPhoneInput() { - return phone; + public Integer getQuantity() { + return (Integer) get("quantity"); } - public CustomerUpdateInput setPhone(String phone) { - this.phone = Input.optional(phone); + public FulfillmentLineItem setQuantity(Integer arg) { + optimisticData.put(getKey("quantity"), arg); return this; } - public CustomerUpdateInput setPhoneInput(Input phone) { - if (phone == null) { - throw new IllegalArgumentException("Input can not be null"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "lineItem": return true; + + case "quantity": return false; + + default: return false; } - this.phone = phone; - return this; } + } - public String getPassword() { - return password.getValue(); - } + public interface FulfillmentLineItemConnectionQueryDefinition { + void define(FulfillmentLineItemConnectionQuery _queryBuilder); + } - public Input getPasswordInput() { - return password; + /** + * An auto-generated type for paginating through multiple FulfillmentLineItems. + */ + public static class FulfillmentLineItemConnectionQuery extends Query { + FulfillmentLineItemConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } - public CustomerUpdateInput setPassword(String password) { - this.password = Input.optional(password); + /** + * A list of edges. + */ + public FulfillmentLineItemConnectionQuery edges(FulfillmentLineItemEdgeQueryDefinition queryDef) { + startField("edges"); + + _queryBuilder.append('{'); + queryDef.define(new FulfillmentLineItemEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public CustomerUpdateInput setPasswordInput(Input password) { - if (password == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.password = password; + /** + * A list of the nodes contained in FulfillmentLineItemEdge. + */ + public FulfillmentLineItemConnectionQuery nodes(FulfillmentLineItemQueryDefinition queryDef) { + startField("nodes"); + + _queryBuilder.append('{'); + queryDef.define(new FulfillmentLineItemQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public Boolean getAcceptsMarketing() { - return acceptsMarketing.getValue(); - } + /** + * Information to aid in pagination. + */ + public FulfillmentLineItemConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - public Input getAcceptsMarketingInput() { - return acceptsMarketing; - } + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); - public CustomerUpdateInput setAcceptsMarketing(Boolean acceptsMarketing) { - this.acceptsMarketing = Input.optional(acceptsMarketing); return this; } + } - public CustomerUpdateInput setAcceptsMarketingInput(Input acceptsMarketing) { - if (acceptsMarketing == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.acceptsMarketing = acceptsMarketing; - return this; + /** + * An auto-generated type for paginating through multiple FulfillmentLineItems. + */ + public static class FulfillmentLineItemConnection extends AbstractResponse { + public FulfillmentLineItemConnection() { } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + public FulfillmentLineItemConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new FulfillmentLineItemEdge(jsonAsObject(element1, key))); + } - if (this.firstName.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("firstName:"); - if (firstName.getValue() != null) { - Query.appendQuotedString(_queryBuilder, firstName.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + responseData.put(key, list1); - if (this.lastName.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("lastName:"); - if (lastName.getValue() != null) { - Query.appendQuotedString(_queryBuilder, lastName.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + break; + } - 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 "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new FulfillmentLineItem(jsonAsObject(element1, key))); + } - if (this.phone.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("phone:"); - if (phone.getValue() != null) { - Query.appendQuotedString(_queryBuilder, phone.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + responseData.put(key, list1); - if (this.password.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("password:"); - if (password.getValue() != null) { - Query.appendQuotedString(_queryBuilder, password.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + break; + } - if (this.acceptsMarketing.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("acceptsMarketing:"); - if (acceptsMarketing.getValue() != null) { - _queryBuilder.append(acceptsMarketing.getValue()); - } else { - _queryBuilder.append("null"); + 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()); + } } } + } - _queryBuilder.append('}'); + public String getGraphQlTypeName() { + return "FulfillmentLineItemConnection"; } - } - public interface CustomerUpdatePayloadQueryDefinition { - void define(CustomerUpdatePayloadQuery _queryBuilder); - } + /** + * A list of edges. + */ - /** - * Return type for `customerUpdate` mutation. - */ - public static class CustomerUpdatePayloadQuery extends Query { - CustomerUpdatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public List getEdges() { + return (List) get("edges"); + } + + public FulfillmentLineItemConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; } /** - * The updated customer object. + * A list of the nodes contained in FulfillmentLineItemEdge. */ - public CustomerUpdatePayloadQuery customer(CustomerQueryDefinition queryDef) { - startField("customer"); - _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); + public List getNodes() { + return (List) get("nodes"); + } + public FulfillmentLineItemConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * The newly created customer access token. If the customer's password is updated, all previous access - * tokens - * (including the one used to perform this mutation) become invalid, and a new token is generated. + * Information to aid in pagination. */ - public CustomerUpdatePayloadQuery customerAccessToken(CustomerAccessTokenQueryDefinition queryDef) { - startField("customerAccessToken"); - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenQuery(_queryBuilder)); - _queryBuilder.append('}'); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } + public FulfillmentLineItemConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; + + case "nodes": return true; + + case "pageInfo": return true; + + default: return false; + } + } + } + + public interface FulfillmentLineItemEdgeQueryDefinition { + void define(FulfillmentLineItemEdgeQuery _queryBuilder); + } + + /** + * An auto-generated type which holds one FulfillmentLineItem and a cursor during pagination. + */ + public static class FulfillmentLineItemEdgeQuery extends Query { + FulfillmentLineItemEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + /** - * The list of errors that occurred from executing the mutation. + * A cursor for use in pagination. */ - public CustomerUpdatePayloadQuery customerUserErrors(CustomerUserErrorQueryDefinition queryDef) { - startField("customerUserErrors"); - - _queryBuilder.append('{'); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); + public FulfillmentLineItemEdgeQuery cursor() { + startField("cursor"); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * The item at the end of FulfillmentLineItemEdge. */ - @Deprecated - public CustomerUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) { - startField("userErrors"); + public FulfillmentLineItemEdgeQuery node(FulfillmentLineItemQueryDefinition queryDef) { + startField("node"); _queryBuilder.append('{'); - queryDef.define(new UserErrorQuery(_queryBuilder)); + queryDef.define(new FulfillmentLineItemQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -28552,57 +35062,25 @@ public CustomerUpdatePayloadQuery userErrors(UserErrorQueryDefinition queryDef) } /** - * Return type for `customerUpdate` mutation. + * An auto-generated type which holds one FulfillmentLineItem and a cursor during pagination. */ - public static class CustomerUpdatePayload extends AbstractResponse { - public CustomerUpdatePayload() { + public static class FulfillmentLineItemEdge extends AbstractResponse { + public FulfillmentLineItemEdge() { } - public CustomerUpdatePayload(JsonObject fields) throws SchemaViolationError { + public FulfillmentLineItemEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "customer": { - Customer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "customerAccessToken": { - CustomerAccessToken optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessToken(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "customerUserErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CustomerUserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserError(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "node": { + responseData.put(key, new FulfillmentLineItem(jsonAsObject(field.getValue(), key))); break; } @@ -28619,136 +35097,93 @@ public CustomerUpdatePayload(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CustomerUpdatePayload"; - } - - /** - * The updated customer object. - */ - - public Customer getCustomer() { - return (Customer) get("customer"); - } - - public CustomerUpdatePayload setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); - return this; - } - - /** - * The newly created customer access token. If the customer's password is updated, all previous access - * tokens - * (including the one used to perform this mutation) become invalid, and a new token is generated. - */ - - public CustomerAccessToken getCustomerAccessToken() { - return (CustomerAccessToken) get("customerAccessToken"); - } - - public CustomerUpdatePayload setCustomerAccessToken(CustomerAccessToken arg) { - optimisticData.put(getKey("customerAccessToken"), arg); - return this; + return "FulfillmentLineItemEdge"; } /** - * The list of errors that occurred from executing the mutation. + * A cursor for use in pagination. */ - public List getCustomerUserErrors() { - return (List) get("customerUserErrors"); + public String getCursor() { + return (String) get("cursor"); } - public CustomerUpdatePayload setCustomerUserErrors(List arg) { - optimisticData.put(getKey("customerUserErrors"), arg); + public FulfillmentLineItemEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * The list of errors that occurred from executing the mutation. - * - * @deprecated Use `customerUserErrors` instead. + * The item at the end of FulfillmentLineItemEdge. */ - public List getUserErrors() { - return (List) get("userErrors"); + public FulfillmentLineItem getNode() { + return (FulfillmentLineItem) get("node"); } - public CustomerUpdatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public FulfillmentLineItemEdge setNode(FulfillmentLineItem arg) { + optimisticData.put(getKey("node"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "customer": return true; - - case "customerAccessToken": return true; - - case "customerUserErrors": return true; + case "cursor": return false; - case "userErrors": return true; + case "node": return true; default: return false; } } } - public interface CustomerUserErrorQueryDefinition { - void define(CustomerUserErrorQuery _queryBuilder); + public interface FulfillmentTrackingInfoQueryDefinition { + void define(FulfillmentTrackingInfoQuery _queryBuilder); } /** - * Represents an error that happens during execution of a customer mutation. + * Tracking information associated with the fulfillment. */ - public static class CustomerUserErrorQuery extends Query { - CustomerUserErrorQuery(StringBuilder _queryBuilder) { + public static class FulfillmentTrackingInfoQuery extends Query { + FulfillmentTrackingInfoQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The error code. - */ - public CustomerUserErrorQuery code() { - startField("code"); - - return this; - } - - /** - * The path to the input field that caused the error. + * The tracking number of the fulfillment. */ - public CustomerUserErrorQuery field() { - startField("field"); + public FulfillmentTrackingInfoQuery number() { + startField("number"); return this; } /** - * The error message. + * The URL to track the fulfillment. */ - public CustomerUserErrorQuery message() { - startField("message"); + public FulfillmentTrackingInfoQuery url() { + startField("url"); return this; } } /** - * Represents an error that happens during execution of a customer mutation. + * Tracking information associated with the fulfillment. */ - public static class CustomerUserError extends AbstractResponse implements DisplayableError { - public CustomerUserError() { + public static class FulfillmentTrackingInfo extends AbstractResponse { + public FulfillmentTrackingInfo() { } - public CustomerUserError(JsonObject fields) throws SchemaViolationError { + public FulfillmentTrackingInfo(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "code": { - CustomerErrorCode optional1 = null; + case "number": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = CustomerErrorCode.fromGraphQl(jsonAsString(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -28756,15 +35191,10 @@ public CustomerUserError(JsonObject fields) throws SchemaViolationError { break; } - case "field": { - List optional1 = null; + case "url": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } - - optional1 = list1; + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -28772,12 +35202,6 @@ public CustomerUserError(JsonObject fields) throws SchemaViolationError { break; } - case "message": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -28790,99 +35214,185 @@ public CustomerUserError(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "CustomerUserError"; - } - - /** - * The error code. - */ - - public CustomerErrorCode getCode() { - return (CustomerErrorCode) get("code"); - } - - public CustomerUserError setCode(CustomerErrorCode arg) { - optimisticData.put(getKey("code"), arg); - return this; + return "FulfillmentTrackingInfo"; } /** - * The path to the input field that caused the error. + * The tracking number of the fulfillment. */ - public List getField() { - return (List) get("field"); + public String getNumber() { + return (String) get("number"); } - public CustomerUserError setField(List arg) { - optimisticData.put(getKey("field"), arg); + public FulfillmentTrackingInfo setNumber(String arg) { + optimisticData.put(getKey("number"), arg); return this; } /** - * The error message. + * The URL to track the fulfillment. */ - public String getMessage() { - return (String) get("message"); + public String getUrl() { + return (String) get("url"); } - public CustomerUserError setMessage(String arg) { - optimisticData.put(getKey("message"), arg); + public FulfillmentTrackingInfo setUrl(String arg) { + optimisticData.put(getKey("url"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "code": return false; - - case "field": return false; + case "number": return false; - case "message": return false; + case "url": return false; default: return false; } } } - public interface DeliveryAddressQueryDefinition { - void define(DeliveryAddressQuery _queryBuilder); + public interface GenericFileQueryDefinition { + void define(GenericFileQuery _queryBuilder); } /** - * A delivery address of the buyer that is interacting with the cart. + * The generic file resource lets you manage files in a merchant’s store. Generic files include any + * file that doesn’t fit into a designated type such as image or video. Example: PDF, JSON. */ - public static class DeliveryAddressQuery extends Query { - DeliveryAddressQuery(StringBuilder _queryBuilder) { + public static class GenericFileQuery extends Query { + GenericFileQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - startField("__typename"); + startField("id"); } - public DeliveryAddressQuery onMailingAddress(MailingAddressQueryDefinition queryDef) { - startInlineFragment("MailingAddress"); - queryDef.define(new MailingAddressQuery(_queryBuilder)); + /** + * A word or phrase to indicate the contents of a file. + */ + public GenericFileQuery alt() { + startField("alt"); + + return this; + } + + /** + * The MIME type of the file. + */ + public GenericFileQuery mimeType() { + startField("mimeType"); + + return this; + } + + /** + * The size of the original file in bytes. + */ + public GenericFileQuery originalFileSize() { + startField("originalFileSize"); + + return this; + } + + /** + * The preview image for the file. + */ + public GenericFileQuery previewImage(ImageQueryDefinition queryDef) { + startField("previewImage"); + + _queryBuilder.append('{'); + queryDef.define(new ImageQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - } - public interface DeliveryAddress { - String getGraphQlTypeName(); + /** + * The URL of the file. + */ + public GenericFileQuery url() { + startField("url"); + + return this; + } } /** - * A delivery address of the buyer that is interacting with the cart. + * The generic file resource lets you manage files in a merchant’s store. Generic files include any + * file that doesn’t fit into a designated type such as image or video. Example: PDF, JSON. */ - public static class UnknownDeliveryAddress extends AbstractResponse implements DeliveryAddress { - public UnknownDeliveryAddress() { + public static class GenericFile extends AbstractResponse implements MetafieldReference, Node { + public GenericFile() { } - public UnknownDeliveryAddress(JsonObject fields) throws SchemaViolationError { + public GenericFile(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { + case "alt": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "mimeType": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "originalFileSize": { + Integer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsInteger(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "previewImage": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "url": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -28894,51 +35404,133 @@ public UnknownDeliveryAddress(JsonObject fields) throws SchemaViolationError { } } - public static DeliveryAddress create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "MailingAddress": { - return new MailingAddress(fields); - } + public GenericFile(ID id) { + this(); + optimisticData.put("id", id); + } + + public String getGraphQlTypeName() { + return "GenericFile"; + } + + /** + * A word or phrase to indicate the contents of a file. + */ + + public String getAlt() { + return (String) get("alt"); + } + + public GenericFile setAlt(String arg) { + optimisticData.put(getKey("alt"), arg); + return this; + } + + /** + * A globally-unique identifier. + */ + + public ID getId() { + return (ID) get("id"); + } + + /** + * The MIME type of the file. + */ + + public String getMimeType() { + return (String) get("mimeType"); + } + + public GenericFile setMimeType(String arg) { + optimisticData.put(getKey("mimeType"), arg); + return this; + } + + /** + * The size of the original file in bytes. + */ + + public Integer getOriginalFileSize() { + return (Integer) get("originalFileSize"); + } + + public GenericFile setOriginalFileSize(Integer arg) { + optimisticData.put(getKey("originalFileSize"), arg); + return this; + } + + /** + * The preview image for the file. + */ + + public Image getPreviewImage() { + return (Image) get("previewImage"); + } + + public GenericFile setPreviewImage(Image arg) { + optimisticData.put(getKey("previewImage"), arg); + return this; + } - default: { - return new UnknownDeliveryAddress(fields); - } - } + /** + * The URL of the file. + */ + + public String getUrl() { + return (String) get("url"); } - public String getGraphQlTypeName() { - return (String) get("__typename"); + public GenericFile setUrl(String arg) { + optimisticData.put(getKey("url"), arg); + return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { + case "alt": return false; + + case "id": return false; + + case "mimeType": return false; + + case "originalFileSize": return false; + + case "previewImage": return true; + + case "url": return false; + default: return false; } } } - public static class DeliveryAddressInput implements Serializable { - private Input deliveryAddress = Input.undefined(); + public static class GeoCoordinateInput implements Serializable { + private double latitude; - public MailingAddressInput getDeliveryAddress() { - return deliveryAddress.getValue(); + private double longitude; + + public GeoCoordinateInput(double latitude, double longitude) { + this.latitude = latitude; + + this.longitude = longitude; } - public Input getDeliveryAddressInput() { - return deliveryAddress; + public double getLatitude() { + return latitude; } - public DeliveryAddressInput setDeliveryAddress(MailingAddressInput deliveryAddress) { - this.deliveryAddress = Input.optional(deliveryAddress); + public GeoCoordinateInput setLatitude(double latitude) { + this.latitude = latitude; return this; } - public DeliveryAddressInput setDeliveryAddressInput(Input deliveryAddress) { - if (deliveryAddress == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.deliveryAddress = deliveryAddress; + public double getLongitude() { + return longitude; + } + + public GeoCoordinateInput setLongitude(double longitude) { + this.longitude = longitude; return this; } @@ -28946,651 +35538,867 @@ public void appendTo(StringBuilder _queryBuilder) { String separator = ""; _queryBuilder.append('{'); - if (this.deliveryAddress.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("deliveryAddress:"); - if (deliveryAddress.getValue() != null) { - deliveryAddress.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); - } - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("latitude:"); + _queryBuilder.append(latitude); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("longitude:"); + _queryBuilder.append(longitude); _queryBuilder.append('}'); } } + public interface HasMetafieldsQueryDefinition { + void define(HasMetafieldsQuery _queryBuilder); + } + /** - * List of different delivery method types. + * Represents information about the metafields associated to the specified resource. */ - public enum DeliveryMethodType { - /** - * Local Delivery. - */ - LOCAL, + public static class HasMetafieldsQuery extends Query { + HasMetafieldsQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - /** - * None. - */ - NONE, + startField("__typename"); + } /** - * Shipping to a Pickup Point. + * Returns a metafield found by namespace and key. */ - PICKUP_POINT, + public HasMetafieldsQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { + startField("metafield"); - /** - * Local Pickup. - */ - PICK_UP, + _queryBuilder.append("(namespace:"); + Query.appendQuotedString(_queryBuilder, namespace.toString()); - /** - * Retail. - */ - RETAIL, + _queryBuilder.append(",key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } /** - * Shipping. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - SHIPPING, - - UNKNOWN_VALUE; + public HasMetafieldsQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); - public static DeliveryMethodType fromGraphQl(String value) { - if (value == null) { - return null; + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } } + _queryBuilder.append(']'); - switch (value) { - case "LOCAL": { - return LOCAL; - } + _queryBuilder.append(')'); - case "NONE": { - return NONE; - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "PICKUP_POINT": { - return PICKUP_POINT; - } + return this; + } - case "PICK_UP": { - return PICK_UP; - } + public HasMetafieldsQuery onArticle(ArticleQueryDefinition queryDef) { + startInlineFragment("Article"); + queryDef.define(new ArticleQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case "RETAIL": { - return RETAIL; - } + public HasMetafieldsQuery onBlog(BlogQueryDefinition queryDef) { + startInlineFragment("Blog"); + queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case "SHIPPING": { - return SHIPPING; - } + public HasMetafieldsQuery onCart(CartQueryDefinition queryDef) { + startInlineFragment("Cart"); + queryDef.define(new CartQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - default: { - return UNKNOWN_VALUE; - } - } + public HasMetafieldsQuery onCollection(CollectionQueryDefinition queryDef) { + startInlineFragment("Collection"); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public String toString() { - switch (this) { - case LOCAL: { - return "LOCAL"; - } - case NONE: { - return "NONE"; - } + public HasMetafieldsQuery onCustomer(CustomerQueryDefinition queryDef) { + startInlineFragment("Customer"); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case PICKUP_POINT: { - return "PICKUP_POINT"; - } + public HasMetafieldsQuery onLocation(LocationQueryDefinition queryDef) { + startInlineFragment("Location"); + queryDef.define(new LocationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case PICK_UP: { - return "PICK_UP"; - } + public HasMetafieldsQuery onMarket(MarketQueryDefinition queryDef) { + startInlineFragment("Market"); + queryDef.define(new MarketQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case RETAIL: { - return "RETAIL"; - } + public HasMetafieldsQuery onOrder(OrderQueryDefinition queryDef) { + startInlineFragment("Order"); + queryDef.define(new OrderQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case SHIPPING: { - return "SHIPPING"; - } + public HasMetafieldsQuery onPage(PageQueryDefinition queryDef) { + startInlineFragment("Page"); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - default: { - return ""; - } - } + public HasMetafieldsQuery onProduct(ProductQueryDefinition queryDef) { + startInlineFragment("Product"); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public HasMetafieldsQuery onProductVariant(ProductVariantQueryDefinition queryDef) { + startInlineFragment("ProductVariant"); + queryDef.define(new ProductVariantQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public HasMetafieldsQuery onShop(ShopQueryDefinition queryDef) { + startInlineFragment("Shop"); + queryDef.define(new ShopQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } } + public interface HasMetafields { + String getGraphQlTypeName(); + + Metafield getMetafield(); + + List getMetafields(); + } + /** - * Digital wallet, such as Apple Pay, which can be used for accelerated checkouts. + * Represents information about the metafields associated to the specified resource. */ - public enum DigitalWallet { - /** - * Android Pay. - */ - ANDROID_PAY, + public static class UnknownHasMetafields extends AbstractResponse implements HasMetafields { + public UnknownHasMetafields() { + } - /** - * Apple Pay. - */ - APPLE_PAY, + public UnknownHasMetafields(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } - /** - * Google Pay. - */ - GOOGLE_PAY, + responseData.put(key, optional1); - /** - * Shopify Pay. - */ - SHOPIFY_PAY, + break; + } - UNKNOWN_VALUE; + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } - public static DigitalWallet fromGraphQl(String value) { - if (value == null) { - return null; + list1.add(optional2); + } + + responseData.put(key, list1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } } + } - switch (value) { - case "ANDROID_PAY": { - return ANDROID_PAY; + public static HasMetafields create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "Article": { + return new Article(fields); } - case "APPLE_PAY": { - return APPLE_PAY; + case "Blog": { + return new Blog(fields); } - case "GOOGLE_PAY": { - return GOOGLE_PAY; + case "Cart": { + return new Cart(fields); } - case "SHOPIFY_PAY": { - return SHOPIFY_PAY; + case "Collection": { + return new Collection(fields); } - default: { - return UNKNOWN_VALUE; + case "Customer": { + return new Customer(fields); } - } - } - public String toString() { - switch (this) { - case ANDROID_PAY: { - return "ANDROID_PAY"; + + case "Location": { + return new Location(fields); } - case APPLE_PAY: { - return "APPLE_PAY"; + case "Market": { + return new Market(fields); } - case GOOGLE_PAY: { - return "GOOGLE_PAY"; + case "Order": { + return new Order(fields); } - case SHOPIFY_PAY: { - return "SHOPIFY_PAY"; + case "Page": { + return new Page(fields); + } + + case "Product": { + return new Product(fields); + } + + case "ProductVariant": { + return new ProductVariant(fields); + } + + case "Shop": { + return new Shop(fields); } default: { - return ""; + return new UnknownHasMetafields(fields); } } } - } - - public interface DiscountAllocationQueryDefinition { - void define(DiscountAllocationQuery _queryBuilder); - } - /** - * An amount discounting the line that has been allocated by a discount. - */ - public static class DiscountAllocationQuery extends Query { - DiscountAllocationQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public String getGraphQlTypeName() { + return (String) get("__typename"); } /** - * Amount of discount allocated. + * Returns a metafield found by namespace and key. */ - public DiscountAllocationQuery allocatedAmount(MoneyV2QueryDefinition queryDef) { - startField("allocatedAmount"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } + public UnknownHasMetafields setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); return this; } /** - * The discount this allocated amount originated from. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public DiscountAllocationQuery discountApplication(DiscountApplicationQueryDefinition queryDef) { - startField("discountApplication"); - _queryBuilder.append('{'); - queryDef.define(new DiscountApplicationQuery(_queryBuilder)); - _queryBuilder.append('}'); + public List getMetafields() { + return (List) get("metafields"); + } + public UnknownHasMetafields setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); return this; } - } - /** - * An amount discounting the line that has been allocated by a discount. - */ - public static class DiscountAllocation extends AbstractResponse { - public DiscountAllocation() { - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "metafield": return true; - public DiscountAllocation(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "allocatedAmount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "metafields": return true; - break; - } + default: return false; + } + } + } - case "discountApplication": { - responseData.put(key, UnknownDiscountApplication.create(jsonAsObject(field.getValue(), key))); + public static class HasMetafieldsIdentifier implements Serializable { + private String namespace; - break; - } + private String key; - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + public HasMetafieldsIdentifier(String namespace, String key) { + this.namespace = namespace; - public String getGraphQlTypeName() { - return "DiscountAllocation"; + this.key = key; } - /** - * Amount of discount allocated. - */ - - public MoneyV2 getAllocatedAmount() { - return (MoneyV2) get("allocatedAmount"); + public String getNamespace() { + return namespace; } - public DiscountAllocation setAllocatedAmount(MoneyV2 arg) { - optimisticData.put(getKey("allocatedAmount"), arg); + public HasMetafieldsIdentifier setNamespace(String namespace) { + this.namespace = namespace; return this; } - /** - * The discount this allocated amount originated from. - */ - - public DiscountApplication getDiscountApplication() { - return (DiscountApplication) get("discountApplication"); + public String getKey() { + return key; } - public DiscountAllocation setDiscountApplication(DiscountApplication arg) { - optimisticData.put(getKey("discountApplication"), arg); + public HasMetafieldsIdentifier setKey(String key) { + this.key = key; return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "allocatedAmount": return true; + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("namespace:"); + Query.appendQuotedString(_queryBuilder, namespace.toString()); - case "discountApplication": return false; + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); - default: return false; - } + _queryBuilder.append('}'); } } - public interface DiscountApplicationQueryDefinition { - void define(DiscountApplicationQuery _queryBuilder); + public interface ImageQueryDefinition { + void define(ImageQuery _queryBuilder); } /** - * Discount applications capture the intentions of a discount source at - * the time of application. + * Represents an image resource. */ - public static class DiscountApplicationQuery extends Query { - DiscountApplicationQuery(StringBuilder _queryBuilder) { + public static class ImageQuery extends Query { + ImageQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("__typename"); } /** - * The method by which the discount's value is allocated to its entitled items. + * A word or phrase to share the nature or contents of an image. */ - public DiscountApplicationQuery allocationMethod() { - startField("allocationMethod"); + public ImageQuery altText() { + startField("altText"); return this; } /** - * Which lines of targetType that the discount is allocated over. + * The original height of the image in pixels. Returns `null` if the image is not hosted by Shopify. */ - public DiscountApplicationQuery targetSelection() { - startField("targetSelection"); + public ImageQuery height() { + startField("height"); return this; } /** - * The type of line that the discount is applicable towards. + * A unique identifier for the image. */ - public DiscountApplicationQuery targetType() { - startField("targetType"); + public ImageQuery id() { + startField("id"); return this; } /** - * The value of the discount application. + * The location of the original image as a URL. + * If there are any existing transformations in the original source URL, they will remain and not be + * stripped. + * + * @deprecated Use `url` instead. */ - public DiscountApplicationQuery value(PricingValueQueryDefinition queryDef) { - startField("value"); - - _queryBuilder.append('{'); - queryDef.define(new PricingValueQuery(_queryBuilder)); - _queryBuilder.append('}'); + @Deprecated + public ImageQuery originalSrc() { + startField("originalSrc"); return this; } - public DiscountApplicationQuery onAutomaticDiscountApplication(AutomaticDiscountApplicationQueryDefinition queryDef) { - startInlineFragment("AutomaticDiscountApplication"); - queryDef.define(new AutomaticDiscountApplicationQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The location of the image as a URL. + * + * @deprecated Use `url` instead. + */ + @Deprecated + public ImageQuery src() { + startField("src"); + return this; } - public DiscountApplicationQuery onDiscountCodeApplication(DiscountCodeApplicationQueryDefinition queryDef) { - startInlineFragment("DiscountCodeApplication"); - queryDef.define(new DiscountCodeApplicationQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public class TransformedSrcArguments extends Arguments { + TransformedSrcArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * Image width in pixels between 1 and 5760. + */ + public TransformedSrcArguments maxWidth(Integer value) { + if (value != null) { + startArgument("maxWidth"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Image height in pixels between 1 and 5760. + */ + public TransformedSrcArguments maxHeight(Integer value) { + if (value != null) { + startArgument("maxHeight"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Crops the image according to the specified region. + */ + public TransformedSrcArguments crop(CropRegion value) { + if (value != null) { + startArgument("crop"); + _queryBuilder.append(value.toString()); + } + return this; + } + + /** + * Image size multiplier for high-resolution retina displays. Must be between 1 and 3. + */ + public TransformedSrcArguments scale(Integer value) { + if (value != null) { + startArgument("scale"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Best effort conversion of image into content type (SVG -> PNG, Anything -> JPG, Anything -> WEBP are + * supported). + */ + public TransformedSrcArguments preferredContentType(ImageContentType value) { + if (value != null) { + startArgument("preferredContentType"); + _queryBuilder.append(value.toString()); + } + return this; + } } - public DiscountApplicationQuery onManualDiscountApplication(ManualDiscountApplicationQueryDefinition queryDef) { - startInlineFragment("ManualDiscountApplication"); - queryDef.define(new ManualDiscountApplicationQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public interface TransformedSrcArgumentsDefinition { + void define(TransformedSrcArguments args); } - public DiscountApplicationQuery onScriptDiscountApplication(ScriptDiscountApplicationQueryDefinition queryDef) { - startInlineFragment("ScriptDiscountApplication"); - queryDef.define(new ScriptDiscountApplicationQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The location of the transformed image as a URL. + * All transformation arguments are considered "best-effort". If they can be applied to an image, they + * will be. + * Otherwise any transformations which an image type does not support will be ignored. + * + * @deprecated Use `url(transform:)` instead + */ + public ImageQuery transformedSrc() { + return transformedSrc(args -> {}); + } + + /** + * The location of the transformed image as a URL. + * All transformation arguments are considered "best-effort". If they can be applied to an image, they + * will be. + * Otherwise any transformations which an image type does not support will be ignored. + * + * @deprecated Use `url(transform:)` instead + */ + @Deprecated + public ImageQuery transformedSrc(TransformedSrcArgumentsDefinition argsDef) { + startField("transformedSrc"); + + TransformedSrcArguments args = new TransformedSrcArguments(_queryBuilder); + argsDef.define(args); + TransformedSrcArguments.end(args); + return this; } - } - public interface DiscountApplication { - String getGraphQlTypeName(); + public class UrlArguments extends Arguments { + UrlArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - DiscountApplicationAllocationMethod getAllocationMethod(); + /** + * A set of options to transform the original image. + */ + public UrlArguments transform(ImageTransformInput value) { + if (value != null) { + startArgument("transform"); + value.appendTo(_queryBuilder); + } + return this; + } + } - DiscountApplicationTargetSelection getTargetSelection(); + public interface UrlArgumentsDefinition { + void define(UrlArguments args); + } - DiscountApplicationTargetType getTargetType(); + /** + * The location of the image as a URL. + * If no transform options are specified, then the original image will be preserved including any + * pre-applied transforms. + * All transformation options are considered "best-effort". Any transformation that the original image + * type doesn't support will be ignored. + * If you need multiple variations of the same image, then you can use [GraphQL + * aliases](https://graphql.org/learn/queries/#aliases). + */ + public ImageQuery url() { + return url(args -> {}); + } - PricingValue getValue(); + /** + * The location of the image as a URL. + * If no transform options are specified, then the original image will be preserved including any + * pre-applied transforms. + * All transformation options are considered "best-effort". Any transformation that the original image + * type doesn't support will be ignored. + * If you need multiple variations of the same image, then you can use [GraphQL + * aliases](https://graphql.org/learn/queries/#aliases). + */ + public ImageQuery url(UrlArgumentsDefinition argsDef) { + startField("url"); + + UrlArguments args = new UrlArguments(_queryBuilder); + argsDef.define(args); + UrlArguments.end(args); + + return this; + } + + /** + * The original width of the image in pixels. Returns `null` if the image is not hosted by Shopify. + */ + public ImageQuery width() { + startField("width"); + + return this; + } } /** - * Discount applications capture the intentions of a discount source at - * the time of application. + * Represents an image resource. */ - public static class UnknownDiscountApplication extends AbstractResponse implements DiscountApplication { - public UnknownDiscountApplication() { + public static class Image extends AbstractResponse { + public Image() { } - public UnknownDiscountApplication(JsonObject fields) throws SchemaViolationError { + public Image(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "allocationMethod": { - responseData.put(key, DiscountApplicationAllocationMethod.fromGraphQl(jsonAsString(field.getValue(), key))); + case "altText": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "targetSelection": { - responseData.put(key, DiscountApplicationTargetSelection.fromGraphQl(jsonAsString(field.getValue(), key))); + case "height": { + Integer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsInteger(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "targetType": { - responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); + case "id": { + ID optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ID(jsonAsString(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "value": { - responseData.put(key, UnknownPricingValue.create(jsonAsObject(field.getValue(), key))); + case "originalSrc": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "__typename": { + case "src": { responseData.put(key, jsonAsString(field.getValue(), key)); + break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); + + case "transformedSrc": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; } - } - } - } - public static DiscountApplication create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "AutomaticDiscountApplication": { - return new AutomaticDiscountApplication(fields); - } + case "url": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case "DiscountCodeApplication": { - return new DiscountCodeApplication(fields); - } + break; + } - case "ManualDiscountApplication": { - return new ManualDiscountApplication(fields); - } + case "width": { + Integer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsInteger(field.getValue(), key); + } - case "ScriptDiscountApplication": { - return new ScriptDiscountApplication(fields); - } + responseData.put(key, optional1); - default: { - return new UnknownDiscountApplication(fields); + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } } } public String getGraphQlTypeName() { - return (String) get("__typename"); + return "Image"; } /** - * The method by which the discount's value is allocated to its entitled items. + * A word or phrase to share the nature or contents of an image. */ - public DiscountApplicationAllocationMethod getAllocationMethod() { - return (DiscountApplicationAllocationMethod) get("allocationMethod"); + public String getAltText() { + return (String) get("altText"); } - public UnknownDiscountApplication setAllocationMethod(DiscountApplicationAllocationMethod arg) { - optimisticData.put(getKey("allocationMethod"), arg); + public Image setAltText(String arg) { + optimisticData.put(getKey("altText"), arg); return this; } /** - * Which lines of targetType that the discount is allocated over. + * The original height of the image in pixels. Returns `null` if the image is not hosted by Shopify. */ - public DiscountApplicationTargetSelection getTargetSelection() { - return (DiscountApplicationTargetSelection) get("targetSelection"); + public Integer getHeight() { + return (Integer) get("height"); } - public UnknownDiscountApplication setTargetSelection(DiscountApplicationTargetSelection arg) { - optimisticData.put(getKey("targetSelection"), arg); + public Image setHeight(Integer arg) { + optimisticData.put(getKey("height"), arg); return this; } /** - * The type of line that the discount is applicable towards. + * A unique identifier for the image. */ - public DiscountApplicationTargetType getTargetType() { - return (DiscountApplicationTargetType) get("targetType"); + public ID getId() { + return (ID) get("id"); } - public UnknownDiscountApplication setTargetType(DiscountApplicationTargetType arg) { - optimisticData.put(getKey("targetType"), arg); + public Image setId(ID arg) { + optimisticData.put(getKey("id"), arg); return this; } /** - * The value of the discount application. + * The location of the original image as a URL. + * If there are any existing transformations in the original source URL, they will remain and not be + * stripped. + * + * @deprecated Use `url` instead. */ - public PricingValue getValue() { - return (PricingValue) get("value"); + public String getOriginalSrc() { + return (String) get("originalSrc"); } - public UnknownDiscountApplication setValue(PricingValue arg) { - optimisticData.put(getKey("value"), arg); + public Image setOriginalSrc(String arg) { + optimisticData.put(getKey("originalSrc"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "allocationMethod": return false; - - case "targetSelection": return false; - - case "targetType": return false; + /** + * The location of the image as a URL. + * + * @deprecated Use `url` instead. + */ - case "value": return false; + public String getSrc() { + return (String) get("src"); + } - default: return false; - } + public Image setSrc(String arg) { + optimisticData.put(getKey("src"), arg); + return this; } - } - /** - * The method by which the discount's value is allocated onto its entitled lines. - */ - public enum DiscountApplicationAllocationMethod { /** - * The value is spread across all entitled lines. + * The location of the transformed image as a URL. + * All transformation arguments are considered "best-effort". If they can be applied to an image, they + * will be. + * Otherwise any transformations which an image type does not support will be ignored. + * + * @deprecated Use `url(transform:)` instead */ - ACROSS, + + public String getTransformedSrc() { + return (String) get("transformedSrc"); + } + + public Image setTransformedSrc(String arg) { + optimisticData.put(getKey("transformedSrc"), arg); + return this; + } /** - * The value is applied onto every entitled line. + * The location of the image as a URL. + * If no transform options are specified, then the original image will be preserved including any + * pre-applied transforms. + * All transformation options are considered "best-effort". Any transformation that the original image + * type doesn't support will be ignored. + * If you need multiple variations of the same image, then you can use [GraphQL + * aliases](https://graphql.org/learn/queries/#aliases). */ - EACH, + + public String getUrl() { + return (String) get("url"); + } + + public Image setUrl(String arg) { + optimisticData.put(getKey("url"), arg); + return this; + } /** - * The value is specifically applied onto a particular line. - * - * @deprecated Use ACROSS instead. + * The original width of the image in pixels. Returns `null` if the image is not hosted by Shopify. */ - @Deprecated - ONE, - UNKNOWN_VALUE; + public Integer getWidth() { + return (Integer) get("width"); + } - public static DiscountApplicationAllocationMethod fromGraphQl(String value) { - if (value == null) { - return null; - } + public Image setWidth(Integer arg) { + optimisticData.put(getKey("width"), arg); + return this; + } - switch (value) { - case "ACROSS": { - return ACROSS; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "altText": return false; - case "EACH": { - return EACH; - } + case "height": return false; - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case ACROSS: { - return "ACROSS"; - } + case "id": return false; - case EACH: { - return "EACH"; - } + case "originalSrc": return false; - default: { - return ""; - } + case "src": return false; + + case "transformedSrc": return false; + + case "url": return false; + + case "width": return false; + + default: return false; } } } - public interface DiscountApplicationConnectionQueryDefinition { - void define(DiscountApplicationConnectionQuery _queryBuilder); + public interface ImageConnectionQueryDefinition { + void define(ImageConnectionQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple DiscountApplications. + * An auto-generated type for paginating through multiple Images. */ - public static class DiscountApplicationConnectionQuery extends Query { - DiscountApplicationConnectionQuery(StringBuilder _queryBuilder) { + public static class ImageConnectionQuery extends Query { + ImageConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A list of edges. */ - public DiscountApplicationConnectionQuery edges(DiscountApplicationEdgeQueryDefinition queryDef) { + public ImageConnectionQuery edges(ImageEdgeQueryDefinition queryDef) { startField("edges"); _queryBuilder.append('{'); - queryDef.define(new DiscountApplicationEdgeQuery(_queryBuilder)); + queryDef.define(new ImageEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in DiscountApplicationEdge. + * A list of the nodes contained in ImageEdge. */ - public DiscountApplicationConnectionQuery nodes(DiscountApplicationQueryDefinition queryDef) { + public ImageConnectionQuery nodes(ImageQueryDefinition queryDef) { startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new DiscountApplicationQuery(_queryBuilder)); + queryDef.define(new ImageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -29599,7 +36407,7 @@ public DiscountApplicationConnectionQuery nodes(DiscountApplicationQueryDefiniti /** * Information to aid in pagination. */ - public DiscountApplicationConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + public ImageConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { startField("pageInfo"); _queryBuilder.append('{'); @@ -29611,21 +36419,21 @@ public DiscountApplicationConnectionQuery pageInfo(PageInfoQueryDefinition query } /** - * An auto-generated type for paginating through multiple DiscountApplications. + * An auto-generated type for paginating through multiple Images. */ - public static class DiscountApplicationConnection extends AbstractResponse { - public DiscountApplicationConnection() { + public static class ImageConnection extends AbstractResponse { + public ImageConnection() { } - public DiscountApplicationConnection(JsonObject fields) throws SchemaViolationError { + public ImageConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { case "edges": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new DiscountApplicationEdge(jsonAsObject(element1, key))); + list1.add(new ImageEdge(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -29634,9 +36442,9 @@ public DiscountApplicationConnection(JsonObject fields) throws SchemaViolationEr } case "nodes": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(UnknownDiscountApplication.create(jsonAsObject(element1, key))); + list1.add(new Image(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -29662,31 +36470,31 @@ public DiscountApplicationConnection(JsonObject fields) throws SchemaViolationEr } public String getGraphQlTypeName() { - return "DiscountApplicationConnection"; + return "ImageConnection"; } /** * A list of edges. */ - public List getEdges() { - return (List) get("edges"); + public List getEdges() { + return (List) get("edges"); } - public DiscountApplicationConnection setEdges(List arg) { + public ImageConnection setEdges(List arg) { optimisticData.put(getKey("edges"), arg); return this; } /** - * A list of the nodes contained in DiscountApplicationEdge. + * A list of the nodes contained in ImageEdge. */ - public List getNodes() { - return (List) get("nodes"); + public List getNodes() { + return (List) get("nodes"); } - public DiscountApplicationConnection setNodes(List arg) { + public ImageConnection setNodes(List arg) { optimisticData.put(getKey("nodes"), arg); return this; } @@ -29699,7 +36507,7 @@ public PageInfo getPageInfo() { return (PageInfo) get("pageInfo"); } - public DiscountApplicationConnection setPageInfo(PageInfo arg) { + public ImageConnection setPageInfo(PageInfo arg) { optimisticData.put(getKey("pageInfo"), arg); return this; } @@ -29708,7 +36516,7 @@ public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "edges": return true; - case "nodes": return false; + case "nodes": return true; case "pageInfo": return true; @@ -29717,35 +36525,100 @@ public boolean unwrapsToObject(String key) { } } - public interface DiscountApplicationEdgeQueryDefinition { - void define(DiscountApplicationEdgeQuery _queryBuilder); + /** + * List of supported image content types. + */ + public enum ImageContentType { + /** + * A JPG image. + */ + JPG, + + /** + * A PNG image. + */ + PNG, + + /** + * A WEBP image. + */ + WEBP, + + UNKNOWN_VALUE; + + public static ImageContentType fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "JPG": { + return JPG; + } + + case "PNG": { + return PNG; + } + + case "WEBP": { + return WEBP; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case JPG: { + return "JPG"; + } + + case PNG: { + return "PNG"; + } + + case WEBP: { + return "WEBP"; + } + + default: { + return ""; + } + } + } + } + + public interface ImageEdgeQueryDefinition { + void define(ImageEdgeQuery _queryBuilder); } /** - * An auto-generated type which holds one DiscountApplication and a cursor during pagination. + * An auto-generated type which holds one Image and a cursor during pagination. */ - public static class DiscountApplicationEdgeQuery extends Query { - DiscountApplicationEdgeQuery(StringBuilder _queryBuilder) { + public static class ImageEdgeQuery extends Query { + ImageEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A cursor for use in pagination. */ - public DiscountApplicationEdgeQuery cursor() { + public ImageEdgeQuery cursor() { startField("cursor"); return this; } /** - * The item at the end of DiscountApplicationEdge. + * The item at the end of ImageEdge. */ - public DiscountApplicationEdgeQuery node(DiscountApplicationQueryDefinition queryDef) { + public ImageEdgeQuery node(ImageQueryDefinition queryDef) { startField("node"); _queryBuilder.append('{'); - queryDef.define(new DiscountApplicationQuery(_queryBuilder)); + queryDef.define(new ImageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -29753,13 +36626,13 @@ public DiscountApplicationEdgeQuery node(DiscountApplicationQueryDefinition quer } /** - * An auto-generated type which holds one DiscountApplication and a cursor during pagination. + * An auto-generated type which holds one Image and a cursor during pagination. */ - public static class DiscountApplicationEdge extends AbstractResponse { - public DiscountApplicationEdge() { + public static class ImageEdge extends AbstractResponse { + public ImageEdge() { } - public DiscountApplicationEdge(JsonObject fields) throws SchemaViolationError { + public ImageEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -29771,7 +36644,7 @@ public DiscountApplicationEdge(JsonObject fields) throws SchemaViolationError { } case "node": { - responseData.put(key, UnknownDiscountApplication.create(jsonAsObject(field.getValue(), key))); + responseData.put(key, new Image(jsonAsObject(field.getValue(), key))); break; } @@ -29788,7 +36661,7 @@ public DiscountApplicationEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "DiscountApplicationEdge"; + return "ImageEdge"; } /** @@ -29799,20 +36672,20 @@ public String getCursor() { return (String) get("cursor"); } - public DiscountApplicationEdge setCursor(String arg) { + public ImageEdge setCursor(String arg) { optimisticData.put(getKey("cursor"), arg); return this; } /** - * The item at the end of DiscountApplicationEdge. + * The item at the end of ImageEdge. */ - public DiscountApplication getNode() { - return (DiscountApplication) get("node"); + public Image getNode() { + return (Image) get("node"); } - public DiscountApplicationEdge setNode(DiscountApplication arg) { + public ImageEdge setNode(Image arg) { optimisticData.put(getKey("node"), arg); return this; } @@ -29821,253 +36694,259 @@ public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "cursor": return false; - case "node": return false; + case "node": return true; default: return false; } } } - /** - * The lines on the order to which the discount is applied, of the type defined by - * the discount application's `targetType`. For example, the value `ENTITLED`, combined with a - * `targetType` of - * `LINE_ITEM`, applies the discount on all line items that are entitled to the discount. - * The value `ALL`, combined with a `targetType` of `SHIPPING_LINE`, applies the discount on all - * shipping lines. - */ - public enum DiscountApplicationTargetSelection { - /** - * The discount is allocated onto all the lines. - */ - ALL, + public static class ImageTransformInput implements Serializable { + private Input crop = Input.undefined(); - /** - * The discount is allocated onto only the lines that it's entitled for. - */ - ENTITLED, + private Input maxWidth = Input.undefined(); - /** - * The discount is allocated onto explicitly chosen lines. - */ - EXPLICIT, + private Input maxHeight = Input.undefined(); - UNKNOWN_VALUE; + private Input scale = Input.undefined(); - public static DiscountApplicationTargetSelection fromGraphQl(String value) { - if (value == null) { - return null; + private Input preferredContentType = Input.undefined(); + + public CropRegion getCrop() { + return crop.getValue(); + } + + public Input getCropInput() { + return crop; + } + + public ImageTransformInput setCrop(CropRegion crop) { + this.crop = Input.optional(crop); + return this; + } + + public ImageTransformInput setCropInput(Input crop) { + if (crop == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.crop = crop; + return this; + } - switch (value) { - case "ALL": { - return ALL; - } + public Integer getMaxWidth() { + return maxWidth.getValue(); + } - case "ENTITLED": { - return ENTITLED; - } + public Input getMaxWidthInput() { + return maxWidth; + } - case "EXPLICIT": { - return EXPLICIT; - } + public ImageTransformInput setMaxWidth(Integer maxWidth) { + this.maxWidth = Input.optional(maxWidth); + return this; + } - default: { - return UNKNOWN_VALUE; - } + public ImageTransformInput setMaxWidthInput(Input maxWidth) { + if (maxWidth == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.maxWidth = maxWidth; + return this; } - public String toString() { - switch (this) { - case ALL: { - return "ALL"; - } - case ENTITLED: { - return "ENTITLED"; - } + public Integer getMaxHeight() { + return maxHeight.getValue(); + } - case EXPLICIT: { - return "EXPLICIT"; - } + public Input getMaxHeightInput() { + return maxHeight; + } - default: { - return ""; - } + public ImageTransformInput setMaxHeight(Integer maxHeight) { + this.maxHeight = Input.optional(maxHeight); + return this; + } + + public ImageTransformInput setMaxHeightInput(Input maxHeight) { + if (maxHeight == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.maxHeight = maxHeight; + return this; } - } - /** - * The type of line (i.e. line item or shipping line) on an order that the discount is applicable - * towards. - */ - public enum DiscountApplicationTargetType { - /** - * The discount applies onto line items. - */ - LINE_ITEM, + public Integer getScale() { + return scale.getValue(); + } - /** - * The discount applies onto shipping lines. - */ - SHIPPING_LINE, + public Input getScaleInput() { + return scale; + } - UNKNOWN_VALUE; + public ImageTransformInput setScale(Integer scale) { + this.scale = Input.optional(scale); + return this; + } - public static DiscountApplicationTargetType fromGraphQl(String value) { - if (value == null) { - return null; + public ImageTransformInput setScaleInput(Input scale) { + if (scale == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.scale = scale; + return this; + } - switch (value) { - case "LINE_ITEM": { - return LINE_ITEM; - } + public ImageContentType getPreferredContentType() { + return preferredContentType.getValue(); + } - case "SHIPPING_LINE": { - return SHIPPING_LINE; + public Input getPreferredContentTypeInput() { + return preferredContentType; + } + + public ImageTransformInput setPreferredContentType(ImageContentType preferredContentType) { + this.preferredContentType = Input.optional(preferredContentType); + return this; + } + + public ImageTransformInput setPreferredContentTypeInput(Input preferredContentType) { + if (preferredContentType == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.preferredContentType = preferredContentType; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + if (this.crop.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("crop:"); + if (crop.getValue() != null) { + _queryBuilder.append(crop.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - default: { - return UNKNOWN_VALUE; + if (this.maxWidth.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("maxWidth:"); + if (maxWidth.getValue() != null) { + _queryBuilder.append(maxWidth.getValue()); + } else { + _queryBuilder.append("null"); } } - } - public String toString() { - switch (this) { - case LINE_ITEM: { - return "LINE_ITEM"; + + if (this.maxHeight.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("maxHeight:"); + if (maxHeight.getValue() != null) { + _queryBuilder.append(maxHeight.getValue()); + } else { + _queryBuilder.append("null"); } + } - case SHIPPING_LINE: { - return "SHIPPING_LINE"; + if (this.scale.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("scale:"); + if (scale.getValue() != null) { + _queryBuilder.append(scale.getValue()); + } else { + _queryBuilder.append("null"); } + } - default: { - return ""; + if (this.preferredContentType.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("preferredContentType:"); + if (preferredContentType.getValue() != null) { + _queryBuilder.append(preferredContentType.getValue().toString()); + } else { + _queryBuilder.append("null"); } } + + _queryBuilder.append('}'); } } - public interface DiscountCodeApplicationQueryDefinition { - void define(DiscountCodeApplicationQuery _queryBuilder); + public interface LanguageQueryDefinition { + void define(LanguageQuery _queryBuilder); } /** - * Discount code applications capture the intentions of a discount code at - * the time that it is applied. + * A language. */ - public static class DiscountCodeApplicationQuery extends Query { - DiscountCodeApplicationQuery(StringBuilder _queryBuilder) { + public static class LanguageQuery extends Query { + LanguageQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The method by which the discount's value is allocated to its entitled items. - */ - public DiscountCodeApplicationQuery allocationMethod() { - startField("allocationMethod"); - - return this; - } - - /** - * Specifies whether the discount code was applied successfully. - */ - public DiscountCodeApplicationQuery applicable() { - startField("applicable"); - - return this; - } - - /** - * The string identifying the discount code that was used at the time of application. - */ - public DiscountCodeApplicationQuery code() { - startField("code"); - - return this; - } - - /** - * Which lines of targetType that the discount is allocated over. + * The name of the language in the language itself. If the language uses capitalization, it is + * capitalized for a mid-sentence position. */ - public DiscountCodeApplicationQuery targetSelection() { - startField("targetSelection"); + public LanguageQuery endonymName() { + startField("endonymName"); return this; } /** - * The type of line that the discount is applicable towards. + * The ISO code. */ - public DiscountCodeApplicationQuery targetType() { - startField("targetType"); + public LanguageQuery isoCode() { + startField("isoCode"); return this; } /** - * The value of the discount application. + * The name of the language in the current language. */ - public DiscountCodeApplicationQuery value(PricingValueQueryDefinition queryDef) { - startField("value"); - - _queryBuilder.append('{'); - queryDef.define(new PricingValueQuery(_queryBuilder)); - _queryBuilder.append('}'); + public LanguageQuery name() { + startField("name"); return this; } } /** - * Discount code applications capture the intentions of a discount code at - * the time that it is applied. + * A language. */ - public static class DiscountCodeApplication extends AbstractResponse implements DiscountApplication { - public DiscountCodeApplication() { + public static class Language extends AbstractResponse { + public Language() { } - public DiscountCodeApplication(JsonObject fields) throws SchemaViolationError { + public Language(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "allocationMethod": { - responseData.put(key, DiscountApplicationAllocationMethod.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "applicable": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "code": { + case "endonymName": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "targetSelection": { - responseData.put(key, DiscountApplicationTargetSelection.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "targetType": { - responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); + case "isoCode": { + responseData.put(key, LanguageCode.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "value": { - responseData.put(key, UnknownPricingValue.create(jsonAsObject(field.getValue(), key))); + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -30083,2040 +36962,1998 @@ public DiscountCodeApplication(JsonObject fields) throws SchemaViolationError { } } - public String getGraphQlTypeName() { - return "DiscountCodeApplication"; - } - - /** - * The method by which the discount's value is allocated to its entitled items. - */ - - public DiscountApplicationAllocationMethod getAllocationMethod() { - return (DiscountApplicationAllocationMethod) get("allocationMethod"); - } - - public DiscountCodeApplication setAllocationMethod(DiscountApplicationAllocationMethod arg) { - optimisticData.put(getKey("allocationMethod"), arg); - return this; - } - - /** - * Specifies whether the discount code was applied successfully. - */ - - public Boolean getApplicable() { - return (Boolean) get("applicable"); - } - - public DiscountCodeApplication setApplicable(Boolean arg) { - optimisticData.put(getKey("applicable"), arg); - return this; - } - - /** - * The string identifying the discount code that was used at the time of application. - */ - - public String getCode() { - return (String) get("code"); - } - - public DiscountCodeApplication setCode(String arg) { - optimisticData.put(getKey("code"), arg); - return this; - } - + public String getGraphQlTypeName() { + return "Language"; + } + /** - * Which lines of targetType that the discount is allocated over. + * The name of the language in the language itself. If the language uses capitalization, it is + * capitalized for a mid-sentence position. */ - public DiscountApplicationTargetSelection getTargetSelection() { - return (DiscountApplicationTargetSelection) get("targetSelection"); + public String getEndonymName() { + return (String) get("endonymName"); } - public DiscountCodeApplication setTargetSelection(DiscountApplicationTargetSelection arg) { - optimisticData.put(getKey("targetSelection"), arg); + public Language setEndonymName(String arg) { + optimisticData.put(getKey("endonymName"), arg); return this; } /** - * The type of line that the discount is applicable towards. + * The ISO code. */ - public DiscountApplicationTargetType getTargetType() { - return (DiscountApplicationTargetType) get("targetType"); + public LanguageCode getIsoCode() { + return (LanguageCode) get("isoCode"); } - public DiscountCodeApplication setTargetType(DiscountApplicationTargetType arg) { - optimisticData.put(getKey("targetType"), arg); + public Language setIsoCode(LanguageCode arg) { + optimisticData.put(getKey("isoCode"), arg); return this; } /** - * The value of the discount application. + * The name of the language in the current language. */ - public PricingValue getValue() { - return (PricingValue) get("value"); + public String getName() { + return (String) get("name"); } - public DiscountCodeApplication setValue(PricingValue arg) { - optimisticData.put(getKey("value"), arg); + public Language setName(String arg) { + optimisticData.put(getKey("name"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "allocationMethod": return false; - - case "applicable": return false; - - case "code": return false; - - case "targetSelection": return false; + case "endonymName": return false; - case "targetType": return false; + case "isoCode": return false; - case "value": return false; + case "name": return false; default: return false; } } } - public interface DisplayableErrorQueryDefinition { - void define(DisplayableErrorQuery _queryBuilder); - } - /** - * Represents an error in the input of a mutation. + * ISO 639-1 language codes supported by Shopify. */ - public static class DisplayableErrorQuery extends Query { - DisplayableErrorQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public enum LanguageCode { + /** + * Afrikaans. + */ + AF, - startField("__typename"); - } + /** + * Akan. + */ + AK, /** - * The path to the input field that caused the error. + * Amharic. */ - public DisplayableErrorQuery field() { - startField("field"); + AM, - return this; - } + /** + * Arabic. + */ + AR, /** - * The error message. + * Assamese. */ - public DisplayableErrorQuery message() { - startField("message"); + AS, - return this; - } + /** + * Azerbaijani. + */ + AZ, - public DisplayableErrorQuery onCartUserError(CartUserErrorQueryDefinition queryDef) { - startInlineFragment("CartUserError"); - queryDef.define(new CartUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * Belarusian. + */ + BE, - public DisplayableErrorQuery onCheckoutUserError(CheckoutUserErrorQueryDefinition queryDef) { - startInlineFragment("CheckoutUserError"); - queryDef.define(new CheckoutUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * Bulgarian. + */ + BG, - public DisplayableErrorQuery onCustomerUserError(CustomerUserErrorQueryDefinition queryDef) { - startInlineFragment("CustomerUserError"); - queryDef.define(new CustomerUserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * Bambara. + */ + BM, - public DisplayableErrorQuery onUserError(UserErrorQueryDefinition queryDef) { - startInlineFragment("UserError"); - queryDef.define(new UserErrorQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - } + /** + * Bangla. + */ + BN, - public interface DisplayableError { - String getGraphQlTypeName(); + /** + * Tibetan. + */ + BO, - List getField(); + /** + * Breton. + */ + BR, - String getMessage(); - } + /** + * Bosnian. + */ + BS, - /** - * Represents an error in the input of a mutation. - */ - public static class UnknownDisplayableError extends AbstractResponse implements DisplayableError { - public UnknownDisplayableError() { - } + /** + * Catalan. + */ + CA, - public UnknownDisplayableError(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "field": { - List optional1 = null; - if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } + /** + * Chechen. + */ + CE, - optional1 = list1; - } + /** + * Czech. + */ + CS, - responseData.put(key, optional1); + /** + * Church Slavic. + */ + CU, - break; - } + /** + * Welsh. + */ + CY, - case "message": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Danish. + */ + DA, - break; - } + /** + * German. + */ + DE, - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + /** + * Dzongkha. + */ + DZ, - public static DisplayableError create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "CartUserError": { - return new CartUserError(fields); - } + /** + * Ewe. + */ + EE, - case "CheckoutUserError": { - return new CheckoutUserError(fields); - } + /** + * Greek. + */ + EL, - case "CustomerUserError": { - return new CustomerUserError(fields); - } + /** + * English. + */ + EN, - case "UserError": { - return new UserError(fields); - } + /** + * Esperanto. + */ + EO, - default: { - return new UnknownDisplayableError(fields); - } - } - } + /** + * Spanish. + */ + ES, - public String getGraphQlTypeName() { - return (String) get("__typename"); - } + /** + * Estonian. + */ + ET, /** - * The path to the input field that caused the error. + * Basque. */ + EU, - public List getField() { - return (List) get("field"); - } + /** + * Persian. + */ + FA, - public UnknownDisplayableError setField(List arg) { - optimisticData.put(getKey("field"), arg); - return this; - } + /** + * Fulah. + */ + FF, /** - * The error message. + * Finnish. */ + FI, - public String getMessage() { - return (String) get("message"); - } + /** + * Faroese. + */ + FO, - public UnknownDisplayableError setMessage(String arg) { - optimisticData.put(getKey("message"), arg); - return this; - } + /** + * French. + */ + FR, - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "field": return false; + /** + * Western Frisian. + */ + FY, - case "message": return false; + /** + * Irish. + */ + GA, - default: return false; - } - } - } + /** + * Scottish Gaelic. + */ + GD, - public interface DomainQueryDefinition { - void define(DomainQuery _queryBuilder); - } + /** + * Galician. + */ + GL, - /** - * Represents a web address. - */ - public static class DomainQuery extends Query { - DomainQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + /** + * Gujarati. + */ + GU, /** - * The host name of the domain (eg: `example.com`). + * Manx. */ - public DomainQuery host() { - startField("host"); + GV, - return this; - } + /** + * Hausa. + */ + HA, /** - * Whether SSL is enabled or not. + * Hebrew. */ - public DomainQuery sslEnabled() { - startField("sslEnabled"); + HE, - return this; - } + /** + * Hindi. + */ + HI, /** - * The URL of the domain (eg: `https://example.com`). + * Croatian. */ - public DomainQuery url() { - startField("url"); + HR, - return this; - } - } + /** + * Hungarian. + */ + HU, - /** - * Represents a web address. - */ - public static class Domain extends AbstractResponse { - public Domain() { - } + /** + * Armenian. + */ + HY, - public Domain(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "host": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Interlingua. + */ + IA, - break; - } + /** + * Indonesian. + */ + ID, - case "sslEnabled": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + /** + * Igbo. + */ + IG, - break; - } + /** + * Sichuan Yi. + */ + II, - case "url": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Icelandic. + */ + IS, - break; - } + /** + * Italian. + */ + IT, - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + /** + * Japanese. + */ + JA, - public String getGraphQlTypeName() { - return "Domain"; - } + /** + * Javanese. + */ + JV, + + /** + * Georgian. + */ + KA, + + /** + * Kikuyu. + */ + KI, + + /** + * Kazakh. + */ + KK, + + /** + * Kalaallisut. + */ + KL, + + /** + * Khmer. + */ + KM, + + /** + * Kannada. + */ + KN, + + /** + * Korean. + */ + KO, + + /** + * Kashmiri. + */ + KS, + + /** + * Kurdish. + */ + KU, + + /** + * Cornish. + */ + KW, + + /** + * Kyrgyz. + */ + KY, + + /** + * Luxembourgish. + */ + LB, + + /** + * Ganda. + */ + LG, + + /** + * Lingala. + */ + LN, /** - * The host name of the domain (eg: `example.com`). + * Lao. */ + LO, - public String getHost() { - return (String) get("host"); - } - - public Domain setHost(String arg) { - optimisticData.put(getKey("host"), arg); - return this; - } + /** + * Lithuanian. + */ + LT, /** - * Whether SSL is enabled or not. + * Luba-Katanga. */ + LU, - public Boolean getSslEnabled() { - return (Boolean) get("sslEnabled"); - } + /** + * Latvian. + */ + LV, - public Domain setSslEnabled(Boolean arg) { - optimisticData.put(getKey("sslEnabled"), arg); - return this; - } + /** + * Malagasy. + */ + MG, /** - * The URL of the domain (eg: `https://example.com`). + * Māori. */ + MI, - public String getUrl() { - return (String) get("url"); - } + /** + * Macedonian. + */ + MK, - public Domain setUrl(String arg) { - optimisticData.put(getKey("url"), arg); - return this; - } + /** + * Malayalam. + */ + ML, - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "host": return false; + /** + * Mongolian. + */ + MN, - case "sslEnabled": return false; + /** + * Marathi. + */ + MR, - case "url": return false; + /** + * Malay. + */ + MS, - default: return false; - } - } - } + /** + * Maltese. + */ + MT, - public interface ExternalVideoQueryDefinition { - void define(ExternalVideoQuery _queryBuilder); - } + /** + * Burmese. + */ + MY, - /** - * Represents a video hosted outside of Shopify. - */ - public static class ExternalVideoQuery extends Query { - ExternalVideoQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + /** + * Norwegian (Bokmål). + */ + NB, - startField("id"); - } + /** + * North Ndebele. + */ + ND, /** - * A word or phrase to share the nature or contents of a media. + * Nepali. */ - public ExternalVideoQuery alt() { - startField("alt"); + NE, - return this; - } + /** + * Dutch. + */ + NL, /** - * The embed URL of the video for the respective host. + * Norwegian Nynorsk. */ - public ExternalVideoQuery embedUrl() { - startField("embedUrl"); + NN, - return this; - } + /** + * Norwegian. + */ + NO, /** - * The URL. - * - * @deprecated Use `originUrl` instead. + * Oromo. */ - @Deprecated - public ExternalVideoQuery embeddedUrl() { - startField("embeddedUrl"); + OM, - return this; - } + /** + * Odia. + */ + OR, /** - * The host of the external video. + * Ossetic. */ - public ExternalVideoQuery host() { - startField("host"); + OS, - return this; - } + /** + * Punjabi. + */ + PA, /** - * The media content type. + * Polish. */ - public ExternalVideoQuery mediaContentType() { - startField("mediaContentType"); + PL, - return this; - } + /** + * Pashto. + */ + PS, /** - * The origin URL of the video on the respective host. + * Portuguese. */ - public ExternalVideoQuery originUrl() { - startField("originUrl"); + PT, - return this; - } + /** + * Portuguese (Brazil). + */ + PT_BR, /** - * The preview image for the media. + * Portuguese (Portugal). */ - public ExternalVideoQuery previewImage(ImageQueryDefinition queryDef) { - startField("previewImage"); + PT_PT, - _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Quechua. + */ + QU, - return this; - } - } + /** + * Romansh. + */ + RM, - /** - * Represents a video hosted outside of Shopify. - */ - public static class ExternalVideo extends AbstractResponse implements Media, Node { - public ExternalVideo() { - } + /** + * Rundi. + */ + RN, - public ExternalVideo(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "alt": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + /** + * Romanian. + */ + RO, - responseData.put(key, optional1); + /** + * Russian. + */ + RU, - break; - } + /** + * Kinyarwanda. + */ + RW, - case "embedUrl": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Sindhi. + */ + SD, - break; - } + /** + * Northern Sami. + */ + SE, - case "embeddedUrl": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Sango. + */ + SG, - break; - } + /** + * Sinhala. + */ + SI, - case "host": { - responseData.put(key, MediaHost.fromGraphQl(jsonAsString(field.getValue(), key))); + /** + * Slovak. + */ + SK, - break; - } + /** + * Slovenian. + */ + SL, - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + /** + * Shona. + */ + SN, - break; - } + /** + * Somali. + */ + SO, - case "mediaContentType": { - responseData.put(key, MediaContentType.fromGraphQl(jsonAsString(field.getValue(), key))); + /** + * Albanian. + */ + SQ, - break; - } + /** + * Serbian. + */ + SR, - case "originUrl": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Sundanese. + */ + SU, - break; - } + /** + * Swedish. + */ + SV, - case "previewImage": { - Image optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); - } + /** + * Swahili. + */ + SW, - responseData.put(key, optional1); + /** + * Tamil. + */ + TA, - break; - } + /** + * Telugu. + */ + TE, - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + /** + * Tajik. + */ + TG, - public ExternalVideo(ID id) { - this(); - optimisticData.put("id", id); - } + /** + * Thai. + */ + TH, - public String getGraphQlTypeName() { - return "ExternalVideo"; - } + /** + * Tigrinya. + */ + TI, /** - * A word or phrase to share the nature or contents of a media. + * Turkmen. */ + TK, - public String getAlt() { - return (String) get("alt"); - } + /** + * Tongan. + */ + TO, - public ExternalVideo setAlt(String arg) { - optimisticData.put(getKey("alt"), arg); - return this; - } + /** + * Turkish. + */ + TR, /** - * The embed URL of the video for the respective host. + * Tatar. */ + TT, - public String getEmbedUrl() { - return (String) get("embedUrl"); - } + /** + * Uyghur. + */ + UG, - public ExternalVideo setEmbedUrl(String arg) { - optimisticData.put(getKey("embedUrl"), arg); - return this; - } + /** + * Ukrainian. + */ + UK, /** - * The URL. - * - * @deprecated Use `originUrl` instead. + * Urdu. */ + UR, - public String getEmbeddedUrl() { - return (String) get("embeddedUrl"); - } + /** + * Uzbek. + */ + UZ, - public ExternalVideo setEmbeddedUrl(String arg) { - optimisticData.put(getKey("embeddedUrl"), arg); - return this; - } + /** + * Vietnamese. + */ + VI, /** - * The host of the external video. + * Volapük. */ + VO, - public MediaHost getHost() { - return (MediaHost) get("host"); - } + /** + * Wolof. + */ + WO, - public ExternalVideo setHost(MediaHost arg) { - optimisticData.put(getKey("host"), arg); - return this; - } + /** + * Xhosa. + */ + XH, /** - * A globally-unique identifier. + * Yiddish. */ + YI, - public ID getId() { - return (ID) get("id"); - } + /** + * Yoruba. + */ + YO, /** - * The media content type. + * Chinese. */ + ZH, - public MediaContentType getMediaContentType() { - return (MediaContentType) get("mediaContentType"); - } + /** + * Chinese (Simplified). + */ + ZH_CN, - public ExternalVideo setMediaContentType(MediaContentType arg) { - optimisticData.put(getKey("mediaContentType"), arg); - return this; - } + /** + * Chinese (Traditional). + */ + ZH_TW, /** - * The origin URL of the video on the respective host. + * Zulu. */ + ZU, + + UNKNOWN_VALUE; + + public static LanguageCode fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "AF": { + return AF; + } + + case "AK": { + return AK; + } + + case "AM": { + return AM; + } + + case "AR": { + return AR; + } + + case "AS": { + return AS; + } + + case "AZ": { + return AZ; + } + + case "BE": { + return BE; + } + + case "BG": { + return BG; + } + + case "BM": { + return BM; + } + + case "BN": { + return BN; + } + + case "BO": { + return BO; + } + + case "BR": { + return BR; + } + + case "BS": { + return BS; + } + + case "CA": { + return CA; + } - public String getOriginUrl() { - return (String) get("originUrl"); - } + case "CE": { + return CE; + } - public ExternalVideo setOriginUrl(String arg) { - optimisticData.put(getKey("originUrl"), arg); - return this; - } + case "CS": { + return CS; + } - /** - * The preview image for the media. - */ + case "CU": { + return CU; + } - public Image getPreviewImage() { - return (Image) get("previewImage"); - } + case "CY": { + return CY; + } - public ExternalVideo setPreviewImage(Image arg) { - optimisticData.put(getKey("previewImage"), arg); - return this; - } + case "DA": { + return DA; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "alt": return false; + case "DE": { + return DE; + } - case "embedUrl": return false; + case "DZ": { + return DZ; + } - case "embeddedUrl": return false; + case "EE": { + return EE; + } - case "host": return false; + case "EL": { + return EL; + } - case "id": return false; + case "EN": { + return EN; + } - case "mediaContentType": return false; + case "EO": { + return EO; + } - case "originUrl": return false; + case "ES": { + return ES; + } - case "previewImage": return true; + case "ET": { + return ET; + } - default: return false; - } - } - } + case "EU": { + return EU; + } - public interface FilterQueryDefinition { - void define(FilterQuery _queryBuilder); - } + case "FA": { + return FA; + } - /** - * A filter that is supported on the parent field. - */ - public static class FilterQuery extends Query { - FilterQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "FF": { + return FF; + } - /** - * A unique identifier. - */ - public FilterQuery id() { - startField("id"); + case "FI": { + return FI; + } - return this; - } + case "FO": { + return FO; + } - /** - * A human-friendly string for this filter. - */ - public FilterQuery label() { - startField("label"); + case "FR": { + return FR; + } - return this; - } + case "FY": { + return FY; + } - /** - * An enumeration that denotes the type of data this filter represents. - */ - public FilterQuery type() { - startField("type"); + case "GA": { + return GA; + } - return this; - } + case "GD": { + return GD; + } - /** - * The list of values for this filter. - */ - public FilterQuery values(FilterValueQueryDefinition queryDef) { - startField("values"); + case "GL": { + return GL; + } - _queryBuilder.append('{'); - queryDef.define(new FilterValueQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "GU": { + return GU; + } - return this; - } - } + case "GV": { + return GV; + } - /** - * A filter that is supported on the parent field. - */ - public static class Filter extends AbstractResponse { - public Filter() { - } + case "HA": { + return HA; + } - public Filter(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "id": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "HE": { + return HE; + } - break; - } + case "HI": { + return HI; + } - case "label": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "HR": { + return HR; + } - break; - } + case "HU": { + return HU; + } - case "type": { - responseData.put(key, FilterType.fromGraphQl(jsonAsString(field.getValue(), key))); + case "HY": { + return HY; + } - break; - } + case "IA": { + return IA; + } - case "values": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new FilterValue(jsonAsObject(element1, key))); - } + case "ID": { + return ID; + } - responseData.put(key, list1); + case "IG": { + return IG; + } - break; - } + case "II": { + return II; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "IS": { + return IS; } - } - } - public String getGraphQlTypeName() { - return "Filter"; - } + case "IT": { + return IT; + } - /** - * A unique identifier. - */ + case "JA": { + return JA; + } - public String getId() { - return (String) get("id"); - } + case "JV": { + return JV; + } - public Filter setId(String arg) { - optimisticData.put(getKey("id"), arg); - return this; - } + case "KA": { + return KA; + } - /** - * A human-friendly string for this filter. - */ + case "KI": { + return KI; + } - public String getLabel() { - return (String) get("label"); - } + case "KK": { + return KK; + } - public Filter setLabel(String arg) { - optimisticData.put(getKey("label"), arg); - return this; - } + case "KL": { + return KL; + } - /** - * An enumeration that denotes the type of data this filter represents. - */ + case "KM": { + return KM; + } - public FilterType getType() { - return (FilterType) get("type"); - } + case "KN": { + return KN; + } - public Filter setType(FilterType arg) { - optimisticData.put(getKey("type"), arg); - return this; - } + case "KO": { + return KO; + } - /** - * The list of values for this filter. - */ + case "KS": { + return KS; + } - public List getValues() { - return (List) get("values"); - } + case "KU": { + return KU; + } - public Filter setValues(List arg) { - optimisticData.put(getKey("values"), arg); - return this; - } + case "KW": { + return KW; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "id": return false; + case "KY": { + return KY; + } - case "label": return false; + case "LB": { + return LB; + } - case "type": return false; + case "LG": { + return LG; + } - case "values": return true; + case "LN": { + return LN; + } - default: return false; - } - } - } + case "LO": { + return LO; + } - /** - * The type of data that the filter group represents. - * For more information, refer to [Filter products in a collection with the Storefront API] - * (https://shopify.dev/custom-storefronts/products-collections/filter-products). - */ - public enum FilterType { - /** - * A boolean value. - */ - BOOLEAN, + case "LT": { + return LT; + } - /** - * A list of selectable values. - */ - LIST, + case "LU": { + return LU; + } - /** - * A range of prices. - */ - PRICE_RANGE, + case "LV": { + return LV; + } - UNKNOWN_VALUE; + case "MG": { + return MG; + } - public static FilterType fromGraphQl(String value) { - if (value == null) { - return null; - } + case "MI": { + return MI; + } - switch (value) { - case "BOOLEAN": { - return BOOLEAN; + case "MK": { + return MK; } - case "LIST": { - return LIST; + case "ML": { + return ML; } - case "PRICE_RANGE": { - return PRICE_RANGE; + case "MN": { + return MN; } - default: { - return UNKNOWN_VALUE; + case "MR": { + return MR; } - } - } - public String toString() { - switch (this) { - case BOOLEAN: { - return "BOOLEAN"; + + case "MS": { + return MS; } - case LIST: { - return "LIST"; + case "MT": { + return MT; } - case PRICE_RANGE: { - return "PRICE_RANGE"; + case "MY": { + return MY; } - default: { - return ""; + case "NB": { + return NB; } - } - } - } - public interface FilterValueQueryDefinition { - void define(FilterValueQuery _queryBuilder); - } + case "ND": { + return ND; + } - /** - * A selectable value within a filter. - */ - public static class FilterValueQuery extends Query { - FilterValueQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "NE": { + return NE; + } - /** - * The number of results that match this filter value. - */ - public FilterValueQuery count() { - startField("count"); + case "NL": { + return NL; + } - return this; - } + case "NN": { + return NN; + } - /** - * A unique identifier. - */ - public FilterValueQuery id() { - startField("id"); + case "NO": { + return NO; + } - return this; - } + case "OM": { + return OM; + } - /** - * An input object that can be used to filter by this value on the parent field. - * The value is provided as a helper for building dynamic filtering UI. For example, if you have a list - * of selected `FilterValue` objects, you can combine their respective `input` values to use in a - * subsequent query. - */ - public FilterValueQuery input() { - startField("input"); + case "OR": { + return OR; + } - return this; - } + case "OS": { + return OS; + } - /** - * A human-friendly string for this filter value. - */ - public FilterValueQuery label() { - startField("label"); + case "PA": { + return PA; + } - return this; - } - } + case "PL": { + return PL; + } - /** - * A selectable value within a filter. - */ - public static class FilterValue extends AbstractResponse { - public FilterValue() { - } + case "PS": { + return PS; + } - public FilterValue(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "count": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + case "PT": { + return PT; + } - break; - } + case "PT_BR": { + return PT_BR; + } - case "id": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "PT_PT": { + return PT_PT; + } + + case "QU": { + return QU; + } - break; - } + case "RM": { + return RM; + } - case "input": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "RN": { + return RN; + } - break; - } + case "RO": { + return RO; + } - case "label": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "RU": { + return RU; + } - break; - } + case "RW": { + return RW; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "SD": { + return SD; } - } - } - public String getGraphQlTypeName() { - return "FilterValue"; - } + case "SE": { + return SE; + } - /** - * The number of results that match this filter value. - */ + case "SG": { + return SG; + } - public Integer getCount() { - return (Integer) get("count"); - } + case "SI": { + return SI; + } - public FilterValue setCount(Integer arg) { - optimisticData.put(getKey("count"), arg); - return this; - } + case "SK": { + return SK; + } - /** - * A unique identifier. - */ + case "SL": { + return SL; + } - public String getId() { - return (String) get("id"); - } + case "SN": { + return SN; + } - public FilterValue setId(String arg) { - optimisticData.put(getKey("id"), arg); - return this; - } + case "SO": { + return SO; + } - /** - * An input object that can be used to filter by this value on the parent field. - * The value is provided as a helper for building dynamic filtering UI. For example, if you have a list - * of selected `FilterValue` objects, you can combine their respective `input` values to use in a - * subsequent query. - */ + case "SQ": { + return SQ; + } - public String getInput() { - return (String) get("input"); - } + case "SR": { + return SR; + } - public FilterValue setInput(String arg) { - optimisticData.put(getKey("input"), arg); - return this; - } + case "SU": { + return SU; + } - /** - * A human-friendly string for this filter value. - */ + case "SV": { + return SV; + } - public String getLabel() { - return (String) get("label"); - } + case "SW": { + return SW; + } - public FilterValue setLabel(String arg) { - optimisticData.put(getKey("label"), arg); - return this; - } + case "TA": { + return TA; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "count": return false; + case "TE": { + return TE; + } - case "id": return false; + case "TG": { + return TG; + } - case "input": return false; + case "TH": { + return TH; + } - case "label": return false; + case "TI": { + return TI; + } - default: return false; - } - } - } + case "TK": { + return TK; + } - public interface FulfillmentQueryDefinition { - void define(FulfillmentQuery _queryBuilder); - } + case "TO": { + return TO; + } - /** - * Represents a single fulfillment in an order. - */ - public static class FulfillmentQuery extends Query { - FulfillmentQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "TR": { + return TR; + } - public class FulfillmentLineItemsArguments extends Arguments { - FulfillmentLineItemsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + case "TT": { + return TT; + } - /** - * Returns up to the first `n` elements from the list. - */ - public FulfillmentLineItemsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); + case "UG": { + return UG; } - return this; - } - /** - * Returns the elements that come after the specified cursor. - */ - public FulfillmentLineItemsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "UK": { + return UK; } - return this; - } - /** - * Returns up to the last `n` elements from the list. - */ - public FulfillmentLineItemsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); + case "UR": { + return UR; } - return this; - } - /** - * Returns the elements that come before the specified cursor. - */ - public FulfillmentLineItemsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "UZ": { + return UZ; } - return this; - } - /** - * Reverse the order of the underlying list. - */ - public FulfillmentLineItemsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); + case "VI": { + return VI; } - return this; - } - } - public interface FulfillmentLineItemsArgumentsDefinition { - void define(FulfillmentLineItemsArguments args); - } + case "VO": { + return VO; + } - /** - * List of the fulfillment's line items. - */ - public FulfillmentQuery fulfillmentLineItems(FulfillmentLineItemConnectionQueryDefinition queryDef) { - return fulfillmentLineItems(args -> {}, queryDef); - } + case "WO": { + return WO; + } - /** - * List of the fulfillment's line items. - */ - public FulfillmentQuery fulfillmentLineItems(FulfillmentLineItemsArgumentsDefinition argsDef, FulfillmentLineItemConnectionQueryDefinition queryDef) { - startField("fulfillmentLineItems"); + case "XH": { + return XH; + } - FulfillmentLineItemsArguments args = new FulfillmentLineItemsArguments(_queryBuilder); - argsDef.define(args); - FulfillmentLineItemsArguments.end(args); + case "YI": { + return YI; + } - _queryBuilder.append('{'); - queryDef.define(new FulfillmentLineItemConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "YO": { + return YO; + } - return this; - } + case "ZH": { + return ZH; + } - /** - * The name of the tracking company. - */ - public FulfillmentQuery trackingCompany() { - startField("trackingCompany"); + case "ZH_CN": { + return ZH_CN; + } - return this; - } + case "ZH_TW": { + return ZH_TW; + } - public class TrackingInfoArguments extends Arguments { - TrackingInfoArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + case "ZU": { + return ZU; + } - /** - * Truncate the array result to this size. - */ - public TrackingInfoArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); + default: { + return UNKNOWN_VALUE; } - return this; } } + public String toString() { + switch (this) { + case AF: { + return "AF"; + } - public interface TrackingInfoArgumentsDefinition { - void define(TrackingInfoArguments args); - } + case AK: { + return "AK"; + } - /** - * Tracking information associated with the fulfillment, - * such as the tracking number and tracking URL. - */ - public FulfillmentQuery trackingInfo(FulfillmentTrackingInfoQueryDefinition queryDef) { - return trackingInfo(args -> {}, queryDef); - } + case AM: { + return "AM"; + } - /** - * Tracking information associated with the fulfillment, - * such as the tracking number and tracking URL. - */ - public FulfillmentQuery trackingInfo(TrackingInfoArgumentsDefinition argsDef, FulfillmentTrackingInfoQueryDefinition queryDef) { - startField("trackingInfo"); + case AR: { + return "AR"; + } - TrackingInfoArguments args = new TrackingInfoArguments(_queryBuilder); - argsDef.define(args); - TrackingInfoArguments.end(args); + case AS: { + return "AS"; + } - _queryBuilder.append('{'); - queryDef.define(new FulfillmentTrackingInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + case AZ: { + return "AZ"; + } - return this; - } - } + case BE: { + return "BE"; + } - /** - * Represents a single fulfillment in an order. - */ - public static class Fulfillment extends AbstractResponse { - public Fulfillment() { - } + case BG: { + return "BG"; + } - public Fulfillment(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "fulfillmentLineItems": { - responseData.put(key, new FulfillmentLineItemConnection(jsonAsObject(field.getValue(), key))); + case BM: { + return "BM"; + } - break; - } + case BN: { + return "BN"; + } - case "trackingCompany": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case BO: { + return "BO"; + } - responseData.put(key, optional1); + case BR: { + return "BR"; + } - break; - } + case BS: { + return "BS"; + } - case "trackingInfo": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new FulfillmentTrackingInfo(jsonAsObject(element1, key))); - } + case CA: { + return "CA"; + } - responseData.put(key, list1); + case CE: { + return "CE"; + } - break; - } + case CS: { + return "CS"; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case CU: { + return "CU"; } - } - } - public String getGraphQlTypeName() { - return "Fulfillment"; - } + case CY: { + return "CY"; + } - /** - * List of the fulfillment's line items. - */ + case DA: { + return "DA"; + } - public FulfillmentLineItemConnection getFulfillmentLineItems() { - return (FulfillmentLineItemConnection) get("fulfillmentLineItems"); - } + case DE: { + return "DE"; + } - public Fulfillment setFulfillmentLineItems(FulfillmentLineItemConnection arg) { - optimisticData.put(getKey("fulfillmentLineItems"), arg); - return this; - } + case DZ: { + return "DZ"; + } - /** - * The name of the tracking company. - */ + case EE: { + return "EE"; + } - public String getTrackingCompany() { - return (String) get("trackingCompany"); - } + case EL: { + return "EL"; + } - public Fulfillment setTrackingCompany(String arg) { - optimisticData.put(getKey("trackingCompany"), arg); - return this; - } + case EN: { + return "EN"; + } - /** - * Tracking information associated with the fulfillment, - * such as the tracking number and tracking URL. - */ + case EO: { + return "EO"; + } - public List getTrackingInfo() { - return (List) get("trackingInfo"); - } + case ES: { + return "ES"; + } - public Fulfillment setTrackingInfo(List arg) { - optimisticData.put(getKey("trackingInfo"), arg); - return this; - } + case ET: { + return "ET"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "fulfillmentLineItems": return true; + case EU: { + return "EU"; + } - case "trackingCompany": return false; + case FA: { + return "FA"; + } - case "trackingInfo": return true; + case FF: { + return "FF"; + } - default: return false; - } - } - } + case FI: { + return "FI"; + } - public interface FulfillmentLineItemQueryDefinition { - void define(FulfillmentLineItemQuery _queryBuilder); - } + case FO: { + return "FO"; + } - /** - * Represents a single line item in a fulfillment. There is at most one fulfillment line item for each - * order line item. - */ - public static class FulfillmentLineItemQuery extends Query { - FulfillmentLineItemQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case FR: { + return "FR"; + } - /** - * The associated order's line item. - */ - public FulfillmentLineItemQuery lineItem(OrderLineItemQueryDefinition queryDef) { - startField("lineItem"); + case FY: { + return "FY"; + } - _queryBuilder.append('{'); - queryDef.define(new OrderLineItemQuery(_queryBuilder)); - _queryBuilder.append('}'); + case GA: { + return "GA"; + } - return this; - } + case GD: { + return "GD"; + } - /** - * The amount fulfilled in this fulfillment. - */ - public FulfillmentLineItemQuery quantity() { - startField("quantity"); + case GL: { + return "GL"; + } - return this; - } - } + case GU: { + return "GU"; + } - /** - * Represents a single line item in a fulfillment. There is at most one fulfillment line item for each - * order line item. - */ - public static class FulfillmentLineItem extends AbstractResponse { - public FulfillmentLineItem() { - } + case GV: { + return "GV"; + } - public FulfillmentLineItem(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "lineItem": { - responseData.put(key, new OrderLineItem(jsonAsObject(field.getValue(), key))); + case HA: { + return "HA"; + } - break; - } + case HE: { + return "HE"; + } - case "quantity": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + case HI: { + return "HI"; + } - break; - } + case HR: { + return "HR"; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case HU: { + return "HU"; } - } - } - public String getGraphQlTypeName() { - return "FulfillmentLineItem"; - } + case HY: { + return "HY"; + } - /** - * The associated order's line item. - */ + case IA: { + return "IA"; + } - public OrderLineItem getLineItem() { - return (OrderLineItem) get("lineItem"); - } + case ID: { + return "ID"; + } - public FulfillmentLineItem setLineItem(OrderLineItem arg) { - optimisticData.put(getKey("lineItem"), arg); - return this; - } + case IG: { + return "IG"; + } - /** - * The amount fulfilled in this fulfillment. - */ + case II: { + return "II"; + } - public Integer getQuantity() { - return (Integer) get("quantity"); - } + case IS: { + return "IS"; + } - public FulfillmentLineItem setQuantity(Integer arg) { - optimisticData.put(getKey("quantity"), arg); - return this; - } + case IT: { + return "IT"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "lineItem": return true; + case JA: { + return "JA"; + } - case "quantity": return false; + case JV: { + return "JV"; + } - default: return false; - } - } - } + case KA: { + return "KA"; + } - public interface FulfillmentLineItemConnectionQueryDefinition { - void define(FulfillmentLineItemConnectionQuery _queryBuilder); - } + case KI: { + return "KI"; + } - /** - * An auto-generated type for paginating through multiple FulfillmentLineItems. - */ - public static class FulfillmentLineItemConnectionQuery extends Query { - FulfillmentLineItemConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case KK: { + return "KK"; + } - /** - * A list of edges. - */ - public FulfillmentLineItemConnectionQuery edges(FulfillmentLineItemEdgeQueryDefinition queryDef) { - startField("edges"); + case KL: { + return "KL"; + } - _queryBuilder.append('{'); - queryDef.define(new FulfillmentLineItemEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); + case KM: { + return "KM"; + } - return this; - } + case KN: { + return "KN"; + } - /** - * A list of the nodes contained in FulfillmentLineItemEdge. - */ - public FulfillmentLineItemConnectionQuery nodes(FulfillmentLineItemQueryDefinition queryDef) { - startField("nodes"); + case KO: { + return "KO"; + } - _queryBuilder.append('{'); - queryDef.define(new FulfillmentLineItemQuery(_queryBuilder)); - _queryBuilder.append('}'); + case KS: { + return "KS"; + } - return this; - } + case KU: { + return "KU"; + } - /** - * Information to aid in pagination. - */ - public FulfillmentLineItemConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + case KW: { + return "KW"; + } - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + case KY: { + return "KY"; + } - return this; - } - } + case LB: { + return "LB"; + } - /** - * An auto-generated type for paginating through multiple FulfillmentLineItems. - */ - public static class FulfillmentLineItemConnection extends AbstractResponse { - public FulfillmentLineItemConnection() { - } + case LG: { + return "LG"; + } - public FulfillmentLineItemConnection(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new FulfillmentLineItemEdge(jsonAsObject(element1, key))); - } + case LN: { + return "LN"; + } - responseData.put(key, list1); + case LO: { + return "LO"; + } - break; - } + case LT: { + return "LT"; + } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new FulfillmentLineItem(jsonAsObject(element1, key))); - } + case LU: { + return "LU"; + } - responseData.put(key, list1); + case LV: { + return "LV"; + } - break; - } + case MG: { + return "MG"; + } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case MI: { + return "MI"; + } - break; - } + case MK: { + return "MK"; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case ML: { + return "ML"; } - } - } - public String getGraphQlTypeName() { - return "FulfillmentLineItemConnection"; - } + case MN: { + return "MN"; + } - /** - * A list of edges. - */ + case MR: { + return "MR"; + } - public List getEdges() { - return (List) get("edges"); - } + case MS: { + return "MS"; + } - public FulfillmentLineItemConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; - } + case MT: { + return "MT"; + } - /** - * A list of the nodes contained in FulfillmentLineItemEdge. - */ + case MY: { + return "MY"; + } - public List getNodes() { - return (List) get("nodes"); - } + case NB: { + return "NB"; + } - public FulfillmentLineItemConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; - } + case ND: { + return "ND"; + } - /** - * Information to aid in pagination. - */ + case NE: { + return "NE"; + } - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } + case NL: { + return "NL"; + } - public FulfillmentLineItemConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); - return this; - } + case NN: { + return "NN"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; + case NO: { + return "NO"; + } - case "nodes": return true; + case OM: { + return "OM"; + } - case "pageInfo": return true; + case OR: { + return "OR"; + } - default: return false; - } - } - } + case OS: { + return "OS"; + } - public interface FulfillmentLineItemEdgeQueryDefinition { - void define(FulfillmentLineItemEdgeQuery _queryBuilder); - } + case PA: { + return "PA"; + } - /** - * An auto-generated type which holds one FulfillmentLineItem and a cursor during pagination. - */ - public static class FulfillmentLineItemEdgeQuery extends Query { - FulfillmentLineItemEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case PL: { + return "PL"; + } - /** - * A cursor for use in pagination. - */ - public FulfillmentLineItemEdgeQuery cursor() { - startField("cursor"); + case PS: { + return "PS"; + } - return this; - } + case PT: { + return "PT"; + } - /** - * The item at the end of FulfillmentLineItemEdge. - */ - public FulfillmentLineItemEdgeQuery node(FulfillmentLineItemQueryDefinition queryDef) { - startField("node"); + case PT_BR: { + return "PT_BR"; + } - _queryBuilder.append('{'); - queryDef.define(new FulfillmentLineItemQuery(_queryBuilder)); - _queryBuilder.append('}'); + case PT_PT: { + return "PT_PT"; + } - return this; - } - } + case QU: { + return "QU"; + } - /** - * An auto-generated type which holds one FulfillmentLineItem and a cursor during pagination. - */ - public static class FulfillmentLineItemEdge extends AbstractResponse { - public FulfillmentLineItemEdge() { - } + case RM: { + return "RM"; + } - public FulfillmentLineItemEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case RN: { + return "RN"; + } - break; - } + case RO: { + return "RO"; + } - case "node": { - responseData.put(key, new FulfillmentLineItem(jsonAsObject(field.getValue(), key))); + case RU: { + return "RU"; + } - break; - } + case RW: { + return "RW"; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case SD: { + return "SD"; } - } - } - public String getGraphQlTypeName() { - return "FulfillmentLineItemEdge"; - } + case SE: { + return "SE"; + } - /** - * A cursor for use in pagination. - */ + case SG: { + return "SG"; + } - public String getCursor() { - return (String) get("cursor"); - } + case SI: { + return "SI"; + } - public FulfillmentLineItemEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; - } + case SK: { + return "SK"; + } - /** - * The item at the end of FulfillmentLineItemEdge. - */ + case SL: { + return "SL"; + } - public FulfillmentLineItem getNode() { - return (FulfillmentLineItem) get("node"); - } + case SN: { + return "SN"; + } - public FulfillmentLineItemEdge setNode(FulfillmentLineItem arg) { - optimisticData.put(getKey("node"), arg); - return this; - } + case SO: { + return "SO"; + } + + case SQ: { + return "SQ"; + } + + case SR: { + return "SR"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; + case SU: { + return "SU"; + } - case "node": return true; + case SV: { + return "SV"; + } - default: return false; - } - } - } + case SW: { + return "SW"; + } - public interface FulfillmentTrackingInfoQueryDefinition { - void define(FulfillmentTrackingInfoQuery _queryBuilder); - } + case TA: { + return "TA"; + } - /** - * Tracking information associated with the fulfillment. - */ - public static class FulfillmentTrackingInfoQuery extends Query { - FulfillmentTrackingInfoQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case TE: { + return "TE"; + } - /** - * The tracking number of the fulfillment. - */ - public FulfillmentTrackingInfoQuery number() { - startField("number"); + case TG: { + return "TG"; + } - return this; - } + case TH: { + return "TH"; + } - /** - * The URL to track the fulfillment. - */ - public FulfillmentTrackingInfoQuery url() { - startField("url"); + case TI: { + return "TI"; + } - return this; - } - } + case TK: { + return "TK"; + } - /** - * Tracking information associated with the fulfillment. - */ - public static class FulfillmentTrackingInfo extends AbstractResponse { - public FulfillmentTrackingInfo() { - } + case TO: { + return "TO"; + } - public FulfillmentTrackingInfo(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "number": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case TR: { + return "TR"; + } - responseData.put(key, optional1); + case TT: { + return "TT"; + } - break; - } + case UG: { + return "UG"; + } - case "url": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case UK: { + return "UK"; + } - responseData.put(key, optional1); + case UR: { + return "UR"; + } - break; - } + case UZ: { + return "UZ"; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case VI: { + return "VI"; } - } - } - public String getGraphQlTypeName() { - return "FulfillmentTrackingInfo"; - } + case VO: { + return "VO"; + } - /** - * The tracking number of the fulfillment. - */ + case WO: { + return "WO"; + } - public String getNumber() { - return (String) get("number"); - } + case XH: { + return "XH"; + } - public FulfillmentTrackingInfo setNumber(String arg) { - optimisticData.put(getKey("number"), arg); - return this; - } + case YI: { + return "YI"; + } - /** - * The URL to track the fulfillment. - */ + case YO: { + return "YO"; + } - public String getUrl() { - return (String) get("url"); - } + case ZH: { + return "ZH"; + } - public FulfillmentTrackingInfo setUrl(String arg) { - optimisticData.put(getKey("url"), arg); - return this; - } + case ZH_CN: { + return "ZH_CN"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "number": return false; + case ZH_TW: { + return "ZH_TW"; + } - case "url": return false; + case ZU: { + return "ZU"; + } - default: return false; + default: { + return ""; + } } } } - public interface GenericFileQueryDefinition { - void define(GenericFileQuery _queryBuilder); + public interface LocalizationQueryDefinition { + void define(LocalizationQuery _queryBuilder); } /** - * The generic file resource lets you manage files in a merchant’s store. Generic files include any - * file that doesn’t fit into a designated type such as image or video. Example: PDF, JSON. + * Information about the localized experiences configured for the shop. */ - public static class GenericFileQuery extends Query { - GenericFileQuery(StringBuilder _queryBuilder) { + public static class LocalizationQuery extends Query { + LocalizationQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("id"); } /** - * A word or phrase to indicate the contents of a file. + * The list of countries with enabled localized experiences. */ - public GenericFileQuery alt() { - startField("alt"); + public LocalizationQuery availableCountries(CountryQueryDefinition queryDef) { + startField("availableCountries"); + + _queryBuilder.append('{'); + queryDef.define(new CountryQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The MIME type of the file. + * The list of languages available for the active country. */ - public GenericFileQuery mimeType() { - startField("mimeType"); + public LocalizationQuery availableLanguages(LanguageQueryDefinition queryDef) { + startField("availableLanguages"); + + _queryBuilder.append('{'); + queryDef.define(new LanguageQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The size of the original file in bytes. + * The country of the active localized experience. Use the `@inContext` directive to change this value. */ - public GenericFileQuery originalFileSize() { - startField("originalFileSize"); + public LocalizationQuery country(CountryQueryDefinition queryDef) { + startField("country"); + + _queryBuilder.append('{'); + queryDef.define(new CountryQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The preview image for the file. + * The language of the active localized experience. Use the `@inContext` directive to change this + * value. */ - public GenericFileQuery previewImage(ImageQueryDefinition queryDef) { - startField("previewImage"); + public LocalizationQuery language(LanguageQueryDefinition queryDef) { + startField("language"); _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); + queryDef.define(new LanguageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The URL of the file. + * The market including the country of the active localized experience. Use the `@inContext` directive + * to change this value. */ - public GenericFileQuery url() { - startField("url"); + public LocalizationQuery market(MarketQueryDefinition queryDef) { + startField("market"); + + _queryBuilder.append('{'); + queryDef.define(new MarketQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * The generic file resource lets you manage files in a merchant’s store. Generic files include any - * file that doesn’t fit into a designated type such as image or video. Example: PDF, JSON. + * Information about the localized experiences configured for the shop. */ - public static class GenericFile extends AbstractResponse implements MetafieldReference, Node { - public GenericFile() { + public static class Localization extends AbstractResponse { + public Localization() { } - public GenericFile(JsonObject fields) throws SchemaViolationError { + public Localization(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "alt": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "availableCountries": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Country(jsonAsObject(element1, key))); } - responseData.put(key, optional1); - - break; - } - - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + responseData.put(key, list1); break; } - case "mimeType": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "availableLanguages": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Language(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "originalFileSize": { - Integer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); - } - - responseData.put(key, optional1); + case "country": { + responseData.put(key, new Country(jsonAsObject(field.getValue(), key))); break; } - case "previewImage": { - Image optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "language": { + responseData.put(key, new Language(jsonAsObject(field.getValue(), key))); break; } - case "url": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "market": { + responseData.put(key, new Market(jsonAsObject(field.getValue(), key))); break; } @@ -32132,172 +38969,125 @@ public GenericFile(JsonObject fields) throws SchemaViolationError { } } - public GenericFile(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "GenericFile"; + return "Localization"; } /** - * A word or phrase to indicate the contents of a file. + * The list of countries with enabled localized experiences. */ - public String getAlt() { - return (String) get("alt"); + public List getAvailableCountries() { + return (List) get("availableCountries"); } - public GenericFile setAlt(String arg) { - optimisticData.put(getKey("alt"), arg); + public Localization setAvailableCountries(List arg) { + optimisticData.put(getKey("availableCountries"), arg); return this; } /** - * A globally-unique identifier. - */ - - public ID getId() { - return (ID) get("id"); - } - - /** - * The MIME type of the file. + * The list of languages available for the active country. */ - public String getMimeType() { - return (String) get("mimeType"); + public List getAvailableLanguages() { + return (List) get("availableLanguages"); } - public GenericFile setMimeType(String arg) { - optimisticData.put(getKey("mimeType"), arg); + public Localization setAvailableLanguages(List arg) { + optimisticData.put(getKey("availableLanguages"), arg); return this; } /** - * The size of the original file in bytes. + * The country of the active localized experience. Use the `@inContext` directive to change this value. */ - public Integer getOriginalFileSize() { - return (Integer) get("originalFileSize"); + public Country getCountry() { + return (Country) get("country"); } - public GenericFile setOriginalFileSize(Integer arg) { - optimisticData.put(getKey("originalFileSize"), arg); + public Localization setCountry(Country arg) { + optimisticData.put(getKey("country"), arg); return this; } /** - * The preview image for the file. + * The language of the active localized experience. Use the `@inContext` directive to change this + * value. */ - public Image getPreviewImage() { - return (Image) get("previewImage"); + public Language getLanguage() { + return (Language) get("language"); } - public GenericFile setPreviewImage(Image arg) { - optimisticData.put(getKey("previewImage"), arg); + public Localization setLanguage(Language arg) { + optimisticData.put(getKey("language"), arg); return this; } /** - * The URL of the file. + * The market including the country of the active localized experience. Use the `@inContext` directive + * to change this value. */ - public String getUrl() { - return (String) get("url"); + public Market getMarket() { + return (Market) get("market"); } - public GenericFile setUrl(String arg) { - optimisticData.put(getKey("url"), arg); + public Localization setMarket(Market arg) { + optimisticData.put(getKey("market"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "alt": return false; - - case "id": return false; + case "availableCountries": return true; - case "mimeType": return false; + case "availableLanguages": return true; - case "originalFileSize": return false; + case "country": return true; - case "previewImage": return true; + case "language": return true; - case "url": return false; + case "market": return true; default: return false; } } } - public static class GeoCoordinateInput implements Serializable { - private double latitude; - - private double longitude; - - public GeoCoordinateInput(double latitude, double longitude) { - this.latitude = latitude; - - this.longitude = longitude; - } - - public double getLatitude() { - return latitude; - } + public interface LocationQueryDefinition { + void define(LocationQuery _queryBuilder); + } - public GeoCoordinateInput setLatitude(double latitude) { - this.latitude = latitude; - return this; - } + /** + * Represents a location where product inventory is held. + */ + public static class LocationQuery extends Query { + LocationQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - public double getLongitude() { - return longitude; + startField("id"); } - public GeoCoordinateInput setLongitude(double longitude) { - this.longitude = longitude; - return this; - } + /** + * The address of the location. + */ + public LocationQuery address(LocationAddressQueryDefinition queryDef) { + startField("address"); - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; _queryBuilder.append('{'); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("latitude:"); - _queryBuilder.append(latitude); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("longitude:"); - _queryBuilder.append(longitude); - + queryDef.define(new LocationAddressQuery(_queryBuilder)); _queryBuilder.append('}'); - } - } - - public interface HasMetafieldsQueryDefinition { - void define(HasMetafieldsQuery _queryBuilder); - } - - /** - * Represents information about the metafields associated to the specified resource. - */ - public static class HasMetafieldsQuery extends Query { - HasMetafieldsQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - startField("__typename"); + return this; } /** * Returns a metafield found by namespace and key. */ - public HasMetafieldsQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { + public LocationQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { startField("metafield"); _queryBuilder.append("(namespace:"); @@ -32318,7 +39108,7 @@ public HasMetafieldsQuery metafield(String namespace, String key, MetafieldQuery /** * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public HasMetafieldsQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + public LocationQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { startField("metafields"); _queryBuilder.append("(identifiers:"); @@ -32342,90 +39132,40 @@ public HasMetafieldsQuery metafields(List identifiers, return this; } - public HasMetafieldsQuery onArticle(ArticleQueryDefinition queryDef) { - startInlineFragment("Article"); - queryDef.define(new ArticleQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onBlog(BlogQueryDefinition queryDef) { - startInlineFragment("Blog"); - queryDef.define(new BlogQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onCollection(CollectionQueryDefinition queryDef) { - startInlineFragment("Collection"); - queryDef.define(new CollectionQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onCustomer(CustomerQueryDefinition queryDef) { - startInlineFragment("Customer"); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onOrder(OrderQueryDefinition queryDef) { - startInlineFragment("Order"); - queryDef.define(new OrderQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onPage(PageQueryDefinition queryDef) { - startInlineFragment("Page"); - queryDef.define(new PageQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onProduct(ProductQueryDefinition queryDef) { - startInlineFragment("Product"); - queryDef.define(new ProductQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - - public HasMetafieldsQuery onProductVariant(ProductVariantQueryDefinition queryDef) { - startInlineFragment("ProductVariant"); - queryDef.define(new ProductVariantQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * The name of the location. + */ + public LocationQuery name() { + startField("name"); - public HasMetafieldsQuery onShop(ShopQueryDefinition queryDef) { - startInlineFragment("Shop"); - queryDef.define(new ShopQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } } - public interface HasMetafields { - String getGraphQlTypeName(); - - Metafield getMetafield(); - - List getMetafields(); - } - /** - * Represents information about the metafields associated to the specified resource. + * Represents a location where product inventory is held. */ - public static class UnknownHasMetafields extends AbstractResponse implements HasMetafields { - public UnknownHasMetafields() { + public static class Location extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { + public Location() { } - public UnknownHasMetafields(JsonObject fields) throws SchemaViolationError { + public Location(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { + case "address": { + responseData.put(key, new LocationAddress(jsonAsObject(field.getValue(), key))); + + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + case "metafield": { Metafield optional1 = null; if (!field.getValue().isJsonNull()) { @@ -32453,6 +39193,12 @@ public UnknownHasMetafields(JsonObject fields) throws SchemaViolationError { break; } + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -32464,53 +39210,34 @@ public UnknownHasMetafields(JsonObject fields) throws SchemaViolationError { } } - public static HasMetafields create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "Article": { - return new Article(fields); - } - - case "Blog": { - return new Blog(fields); - } - - case "Collection": { - return new Collection(fields); - } - - case "Customer": { - return new Customer(fields); - } - - case "Order": { - return new Order(fields); - } - - case "Page": { - return new Page(fields); - } + public Location(ID id) { + this(); + optimisticData.put("id", id); + } - case "Product": { - return new Product(fields); - } + public String getGraphQlTypeName() { + return "Location"; + } - case "ProductVariant": { - return new ProductVariant(fields); - } + /** + * The address of the location. + */ - case "Shop": { - return new Shop(fields); - } + public LocationAddress getAddress() { + return (LocationAddress) get("address"); + } - default: { - return new UnknownHasMetafields(fields); - } - } + public Location setAddress(LocationAddress arg) { + optimisticData.put(getKey("address"), arg); + return this; } - public String getGraphQlTypeName() { - return (String) get("__typename"); + /** + * A globally-unique identifier. + */ + + public ID getId() { + return (ID) get("id"); } /** @@ -32521,7 +39248,7 @@ public Metafield getMetafield() { return (Metafield) get("metafield"); } - public UnknownHasMetafields setMetafield(Metafield arg) { + public Location setMetafield(Metafield arg) { optimisticData.put(getKey("metafield"), arg); return this; } @@ -32534,307 +39261,175 @@ public List getMetafields() { return (List) get("metafields"); } - public UnknownHasMetafields setMetafields(List arg) { + public Location setMetafields(List arg) { optimisticData.put(getKey("metafields"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "metafield": return true; - - case "metafields": return true; - - default: return false; - } - } - } - - public static class HasMetafieldsIdentifier implements Serializable { - private String namespace; - - private String key; - - public HasMetafieldsIdentifier(String namespace, String key) { - this.namespace = namespace; - - this.key = key; - } + /** + * The name of the location. + */ - public String getNamespace() { - return namespace; + public String getName() { + return (String) get("name"); } - public HasMetafieldsIdentifier setNamespace(String namespace) { - this.namespace = namespace; + public Location setName(String arg) { + optimisticData.put(getKey("name"), arg); return this; } - public String getKey() { - return key; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "address": return true; - public HasMetafieldsIdentifier setKey(String key) { - this.key = key; - return this; - } + case "id": return false; - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + case "metafield": return true; - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("namespace:"); - Query.appendQuotedString(_queryBuilder, namespace.toString()); + case "metafields": return true; - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + case "name": return false; - _queryBuilder.append('}'); + default: return false; + } } } - public interface ImageQueryDefinition { - void define(ImageQuery _queryBuilder); + public interface LocationAddressQueryDefinition { + void define(LocationAddressQuery _queryBuilder); } /** - * Represents an image resource. + * Represents the address of a location. */ - public static class ImageQuery extends Query { - ImageQuery(StringBuilder _queryBuilder) { + public static class LocationAddressQuery extends Query { + LocationAddressQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A word or phrase to share the nature or contents of an image. + * The first line of the address for the location. */ - public ImageQuery altText() { - startField("altText"); + public LocationAddressQuery address1() { + startField("address1"); return this; } /** - * The original height of the image in pixels. Returns `null` if the image is not hosted by Shopify. + * The second line of the address for the location. */ - public ImageQuery height() { - startField("height"); + public LocationAddressQuery address2() { + startField("address2"); return this; } /** - * A unique identifier for the image. + * The city of the location. */ - public ImageQuery id() { - startField("id"); + public LocationAddressQuery city() { + startField("city"); return this; } /** - * The location of the original image as a URL. - * If there are any existing transformations in the original source URL, they will remain and not be - * stripped. - * - * @deprecated Use `url` instead. + * The country of the location. */ - @Deprecated - public ImageQuery originalSrc() { - startField("originalSrc"); + public LocationAddressQuery country() { + startField("country"); return this; } /** - * The location of the image as a URL. - * - * @deprecated Use `url` instead. + * The country code of the location. */ - @Deprecated - public ImageQuery src() { - startField("src"); + public LocationAddressQuery countryCode() { + startField("countryCode"); return this; } - public class TransformedSrcArguments extends Arguments { - TransformedSrcArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Image width in pixels between 1 and 5760. - */ - public TransformedSrcArguments maxWidth(Integer value) { - if (value != null) { - startArgument("maxWidth"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Image height in pixels between 1 and 5760. - */ - public TransformedSrcArguments maxHeight(Integer value) { - if (value != null) { - startArgument("maxHeight"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Crops the image according to the specified region. - */ - public TransformedSrcArguments crop(CropRegion value) { - if (value != null) { - startArgument("crop"); - _queryBuilder.append(value.toString()); - } - return this; - } - - /** - * Image size multiplier for high-resolution retina displays. Must be between 1 and 3. - */ - public TransformedSrcArguments scale(Integer value) { - if (value != null) { - startArgument("scale"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Best effort conversion of image into content type (SVG -> PNG, Anything -> JPG, Anything -> WEBP are - * supported). - */ - public TransformedSrcArguments preferredContentType(ImageContentType value) { - if (value != null) { - startArgument("preferredContentType"); - _queryBuilder.append(value.toString()); - } - return this; - } - } + /** + * A formatted version of the address for the location. + */ + public LocationAddressQuery formatted() { + startField("formatted"); - public interface TransformedSrcArgumentsDefinition { - void define(TransformedSrcArguments args); + return this; } /** - * The location of the transformed image as a URL. - * All transformation arguments are considered "best-effort". If they can be applied to an image, they - * will be. - * Otherwise any transformations which an image type does not support will be ignored. - * - * @deprecated Use `url(transform:)` instead + * The latitude coordinates of the location. */ - public ImageQuery transformedSrc() { - return transformedSrc(args -> {}); + public LocationAddressQuery latitude() { + startField("latitude"); + + return this; } /** - * The location of the transformed image as a URL. - * All transformation arguments are considered "best-effort". If they can be applied to an image, they - * will be. - * Otherwise any transformations which an image type does not support will be ignored. - * - * @deprecated Use `url(transform:)` instead + * The longitude coordinates of the location. */ - @Deprecated - public ImageQuery transformedSrc(TransformedSrcArgumentsDefinition argsDef) { - startField("transformedSrc"); - - TransformedSrcArguments args = new TransformedSrcArguments(_queryBuilder); - argsDef.define(args); - TransformedSrcArguments.end(args); + public LocationAddressQuery longitude() { + startField("longitude"); return this; } - public class UrlArguments extends Arguments { - UrlArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * A set of options to transform the original image. - */ - public UrlArguments transform(ImageTransformInput value) { - if (value != null) { - startArgument("transform"); - value.appendTo(_queryBuilder); - } - return this; - } - } + /** + * The phone number of the location. + */ + public LocationAddressQuery phone() { + startField("phone"); - public interface UrlArgumentsDefinition { - void define(UrlArguments args); + return this; } /** - * The location of the image as a URL. - * If no transform options are specified, then the original image will be preserved including any - * pre-applied transforms. - * All transformation options are considered "best-effort". Any transformation that the original image - * type doesn't support will be ignored. - * If you need multiple variations of the same image, then you can use [GraphQL - * aliases](https://graphql.org/learn/queries/#aliases). + * The province of the location. */ - public ImageQuery url() { - return url(args -> {}); + public LocationAddressQuery province() { + startField("province"); + + return this; } /** - * The location of the image as a URL. - * If no transform options are specified, then the original image will be preserved including any - * pre-applied transforms. - * All transformation options are considered "best-effort". Any transformation that the original image - * type doesn't support will be ignored. - * If you need multiple variations of the same image, then you can use [GraphQL - * aliases](https://graphql.org/learn/queries/#aliases). + * The code for the province, state, or district of the address of the location. */ - public ImageQuery url(UrlArgumentsDefinition argsDef) { - startField("url"); - - UrlArguments args = new UrlArguments(_queryBuilder); - argsDef.define(args); - UrlArguments.end(args); + public LocationAddressQuery provinceCode() { + startField("provinceCode"); return this; } /** - * The original width of the image in pixels. Returns `null` if the image is not hosted by Shopify. + * The ZIP code of the location. */ - public ImageQuery width() { - startField("width"); + public LocationAddressQuery zip() { + startField("zip"); return this; } } /** - * Represents an image resource. + * Represents the address of a location. */ - public static class Image extends AbstractResponse { - public Image() { + public static class LocationAddress extends AbstractResponse { + public LocationAddress() { } - public Image(JsonObject fields) throws SchemaViolationError { + public LocationAddress(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "altText": { + case "address1": { String optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = jsonAsString(field.getValue(), key); @@ -32845,10 +39440,10 @@ public Image(JsonObject fields) throws SchemaViolationError { break; } - case "height": { - Integer optional1 = null; + case "address2": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -32856,10 +39451,10 @@ public Image(JsonObject fields) throws SchemaViolationError { break; } - case "id": { - ID optional1 = null; + case "city": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new ID(jsonAsString(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -32867,34 +39462,98 @@ public Image(JsonObject fields) throws SchemaViolationError { break; } - case "originalSrc": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "country": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "src": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "countryCode": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "transformedSrc": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "formatted": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + responseData.put(key, list1); break; } - case "url": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "latitude": { + Double optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsDouble(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "width": { - Integer optional1 = null; + case "longitude": { + Double optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); + optional1 = jsonAsDouble(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "phone": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "province": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "provinceCode": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "zip": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -32913,187 +39572,230 @@ public Image(JsonObject fields) throws SchemaViolationError { } } - public String getGraphQlTypeName() { - return "Image"; + public String getGraphQlTypeName() { + return "LocationAddress"; + } + + /** + * The first line of the address for the location. + */ + + public String getAddress1() { + return (String) get("address1"); + } + + public LocationAddress setAddress1(String arg) { + optimisticData.put(getKey("address1"), arg); + return this; + } + + /** + * The second line of the address for the location. + */ + + public String getAddress2() { + return (String) get("address2"); + } + + public LocationAddress setAddress2(String arg) { + optimisticData.put(getKey("address2"), arg); + return this; + } + + /** + * The city of the location. + */ + + public String getCity() { + return (String) get("city"); + } + + public LocationAddress setCity(String arg) { + optimisticData.put(getKey("city"), arg); + return this; + } + + /** + * The country of the location. + */ + + public String getCountry() { + return (String) get("country"); + } + + public LocationAddress setCountry(String arg) { + optimisticData.put(getKey("country"), arg); + return this; } /** - * A word or phrase to share the nature or contents of an image. + * The country code of the location. */ - public String getAltText() { - return (String) get("altText"); + public String getCountryCode() { + return (String) get("countryCode"); } - public Image setAltText(String arg) { - optimisticData.put(getKey("altText"), arg); + public LocationAddress setCountryCode(String arg) { + optimisticData.put(getKey("countryCode"), arg); return this; } /** - * The original height of the image in pixels. Returns `null` if the image is not hosted by Shopify. + * A formatted version of the address for the location. */ - public Integer getHeight() { - return (Integer) get("height"); + public List getFormatted() { + return (List) get("formatted"); } - public Image setHeight(Integer arg) { - optimisticData.put(getKey("height"), arg); + public LocationAddress setFormatted(List arg) { + optimisticData.put(getKey("formatted"), arg); return this; } /** - * A unique identifier for the image. + * The latitude coordinates of the location. */ - public ID getId() { - return (ID) get("id"); + public Double getLatitude() { + return (Double) get("latitude"); } - public Image setId(ID arg) { - optimisticData.put(getKey("id"), arg); + public LocationAddress setLatitude(Double arg) { + optimisticData.put(getKey("latitude"), arg); return this; } /** - * The location of the original image as a URL. - * If there are any existing transformations in the original source URL, they will remain and not be - * stripped. - * - * @deprecated Use `url` instead. + * The longitude coordinates of the location. */ - public String getOriginalSrc() { - return (String) get("originalSrc"); + public Double getLongitude() { + return (Double) get("longitude"); } - public Image setOriginalSrc(String arg) { - optimisticData.put(getKey("originalSrc"), arg); + public LocationAddress setLongitude(Double arg) { + optimisticData.put(getKey("longitude"), arg); return this; } /** - * The location of the image as a URL. - * - * @deprecated Use `url` instead. + * The phone number of the location. */ - public String getSrc() { - return (String) get("src"); + public String getPhone() { + return (String) get("phone"); } - public Image setSrc(String arg) { - optimisticData.put(getKey("src"), arg); + public LocationAddress setPhone(String arg) { + optimisticData.put(getKey("phone"), arg); return this; } /** - * The location of the transformed image as a URL. - * All transformation arguments are considered "best-effort". If they can be applied to an image, they - * will be. - * Otherwise any transformations which an image type does not support will be ignored. - * - * @deprecated Use `url(transform:)` instead + * The province of the location. */ - public String getTransformedSrc() { - return (String) get("transformedSrc"); + public String getProvince() { + return (String) get("province"); } - public Image setTransformedSrc(String arg) { - optimisticData.put(getKey("transformedSrc"), arg); + public LocationAddress setProvince(String arg) { + optimisticData.put(getKey("province"), arg); return this; } /** - * The location of the image as a URL. - * If no transform options are specified, then the original image will be preserved including any - * pre-applied transforms. - * All transformation options are considered "best-effort". Any transformation that the original image - * type doesn't support will be ignored. - * If you need multiple variations of the same image, then you can use [GraphQL - * aliases](https://graphql.org/learn/queries/#aliases). + * The code for the province, state, or district of the address of the location. */ - public String getUrl() { - return (String) get("url"); + public String getProvinceCode() { + return (String) get("provinceCode"); } - public Image setUrl(String arg) { - optimisticData.put(getKey("url"), arg); + public LocationAddress setProvinceCode(String arg) { + optimisticData.put(getKey("provinceCode"), arg); return this; } /** - * The original width of the image in pixels. Returns `null` if the image is not hosted by Shopify. + * The ZIP code of the location. */ - public Integer getWidth() { - return (Integer) get("width"); + public String getZip() { + return (String) get("zip"); } - public Image setWidth(Integer arg) { - optimisticData.put(getKey("width"), arg); + public LocationAddress setZip(String arg) { + optimisticData.put(getKey("zip"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "altText": return false; + case "address1": return false; - case "height": return false; + case "address2": return false; - case "id": return false; + case "city": return false; - case "originalSrc": return false; + case "country": return false; - case "src": return false; + case "countryCode": return false; - case "transformedSrc": return false; + case "formatted": return false; - case "url": return false; + case "latitude": return false; - case "width": return false; + case "longitude": return false; + + case "phone": return false; + + case "province": return false; + + case "provinceCode": return false; + + case "zip": return false; default: return false; } } } - public interface ImageConnectionQueryDefinition { - void define(ImageConnectionQuery _queryBuilder); + public interface LocationConnectionQueryDefinition { + void define(LocationConnectionQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple Images. + * An auto-generated type for paginating through multiple Locations. */ - public static class ImageConnectionQuery extends Query { - ImageConnectionQuery(StringBuilder _queryBuilder) { + public static class LocationConnectionQuery extends Query { + LocationConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A list of edges. */ - public ImageConnectionQuery edges(ImageEdgeQueryDefinition queryDef) { + public LocationConnectionQuery edges(LocationEdgeQueryDefinition queryDef) { startField("edges"); _queryBuilder.append('{'); - queryDef.define(new ImageEdgeQuery(_queryBuilder)); + queryDef.define(new LocationEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in ImageEdge. + * A list of the nodes contained in LocationEdge. */ - public ImageConnectionQuery nodes(ImageQueryDefinition queryDef) { + public LocationConnectionQuery nodes(LocationQueryDefinition queryDef) { startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); + queryDef.define(new LocationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -33102,7 +39804,7 @@ public ImageConnectionQuery nodes(ImageQueryDefinition queryDef) { /** * Information to aid in pagination. */ - public ImageConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + public LocationConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { startField("pageInfo"); _queryBuilder.append('{'); @@ -33114,21 +39816,21 @@ public ImageConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { } /** - * An auto-generated type for paginating through multiple Images. + * An auto-generated type for paginating through multiple Locations. */ - public static class ImageConnection extends AbstractResponse { - public ImageConnection() { + public static class LocationConnection extends AbstractResponse { + public LocationConnection() { } - public ImageConnection(JsonObject fields) throws SchemaViolationError { + public LocationConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { case "edges": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ImageEdge(jsonAsObject(element1, key))); + list1.add(new LocationEdge(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -33137,9 +39839,9 @@ public ImageConnection(JsonObject fields) throws SchemaViolationError { } case "nodes": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Image(jsonAsObject(element1, key))); + list1.add(new Location(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -33165,31 +39867,31 @@ public ImageConnection(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "ImageConnection"; + return "LocationConnection"; } /** * A list of edges. */ - public List getEdges() { - return (List) get("edges"); + public List getEdges() { + return (List) get("edges"); } - public ImageConnection setEdges(List arg) { + public LocationConnection setEdges(List arg) { optimisticData.put(getKey("edges"), arg); return this; } /** - * A list of the nodes contained in ImageEdge. + * A list of the nodes contained in LocationEdge. */ - public List getNodes() { - return (List) get("nodes"); + public List getNodes() { + return (List) get("nodes"); } - public ImageConnection setNodes(List arg) { + public LocationConnection setNodes(List arg) { optimisticData.put(getKey("nodes"), arg); return this; } @@ -33202,7 +39904,7 @@ public PageInfo getPageInfo() { return (PageInfo) get("pageInfo"); } - public ImageConnection setPageInfo(PageInfo arg) { + public LocationConnection setPageInfo(PageInfo arg) { optimisticData.put(getKey("pageInfo"), arg); return this; } @@ -33220,100 +39922,35 @@ public boolean unwrapsToObject(String key) { } } - /** - * List of supported image content types. - */ - public enum ImageContentType { - /** - * A JPG image. - */ - JPG, - - /** - * A PNG image. - */ - PNG, - - /** - * A WEBP image. - */ - WEBP, - - UNKNOWN_VALUE; - - public static ImageContentType fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "JPG": { - return JPG; - } - - case "PNG": { - return PNG; - } - - case "WEBP": { - return WEBP; - } - - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case JPG: { - return "JPG"; - } - - case PNG: { - return "PNG"; - } - - case WEBP: { - return "WEBP"; - } - - default: { - return ""; - } - } - } - } - - public interface ImageEdgeQueryDefinition { - void define(ImageEdgeQuery _queryBuilder); + public interface LocationEdgeQueryDefinition { + void define(LocationEdgeQuery _queryBuilder); } /** - * An auto-generated type which holds one Image and a cursor during pagination. + * An auto-generated type which holds one Location and a cursor during pagination. */ - public static class ImageEdgeQuery extends Query { - ImageEdgeQuery(StringBuilder _queryBuilder) { + public static class LocationEdgeQuery extends Query { + LocationEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A cursor for use in pagination. */ - public ImageEdgeQuery cursor() { + public LocationEdgeQuery cursor() { startField("cursor"); return this; } /** - * The item at the end of ImageEdge. + * The item at the end of LocationEdge. */ - public ImageEdgeQuery node(ImageQueryDefinition queryDef) { + public LocationEdgeQuery node(LocationQueryDefinition queryDef) { startField("node"); _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); + queryDef.define(new LocationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -33321,13 +39958,13 @@ public ImageEdgeQuery node(ImageQueryDefinition queryDef) { } /** - * An auto-generated type which holds one Image and a cursor during pagination. + * An auto-generated type which holds one Location and a cursor during pagination. */ - public static class ImageEdge extends AbstractResponse { - public ImageEdge() { + public static class LocationEdge extends AbstractResponse { + public LocationEdge() { } - public ImageEdge(JsonObject fields) throws SchemaViolationError { + public LocationEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -33339,7 +39976,7 @@ public ImageEdge(JsonObject fields) throws SchemaViolationError { } case "node": { - responseData.put(key, new Image(jsonAsObject(field.getValue(), key))); + responseData.put(key, new Location(jsonAsObject(field.getValue(), key))); break; } @@ -33356,7 +39993,7 @@ public ImageEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "ImageEdge"; + return "LocationEdge"; } /** @@ -33367,20 +40004,20 @@ public String getCursor() { return (String) get("cursor"); } - public ImageEdge setCursor(String arg) { + public LocationEdge setCursor(String arg) { optimisticData.put(getKey("cursor"), arg); return this; } /** - * The item at the end of ImageEdge. + * The item at the end of LocationEdge. */ - public Image getNode() { - return (Image) get("node"); + public Location getNode() { + return (Location) get("node"); } - public ImageEdge setNode(Image arg) { + public LocationEdge setNode(Location arg) { optimisticData.put(getKey("node"), arg); return this; } @@ -33396,252 +40033,523 @@ public boolean unwrapsToObject(String key) { } } - public static class ImageTransformInput implements Serializable { - private Input crop = Input.undefined(); + /** + * The set of valid sort keys for the Location query. + */ + public enum LocationSortKeys { + /** + * Sort by the `city` value. + */ + CITY, - private Input maxWidth = Input.undefined(); + /** + * Sort by the `distance` value. + */ + DISTANCE, - private Input maxHeight = Input.undefined(); + /** + * Sort by the `id` value. + */ + ID, - private Input scale = Input.undefined(); + /** + * Sort by the `name` value. + */ + NAME, - private Input preferredContentType = Input.undefined(); + UNKNOWN_VALUE; - public CropRegion getCrop() { - return crop.getValue(); + public static LocationSortKeys fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "CITY": { + return CITY; + } + + case "DISTANCE": { + return DISTANCE; + } + + case "ID": { + return ID; + } + + case "NAME": { + return NAME; + } + + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case CITY: { + return "CITY"; + } - public Input getCropInput() { - return crop; + case DISTANCE: { + return "DISTANCE"; + } + + case ID: { + return "ID"; + } + + case NAME: { + return "NAME"; + } + + default: { + return ""; + } + } } + } - public ImageTransformInput setCrop(CropRegion crop) { - this.crop = Input.optional(crop); - return this; + public interface MailingAddressQueryDefinition { + void define(MailingAddressQuery _queryBuilder); + } + + /** + * Represents a mailing address for customers and shipping. + */ + public static class MailingAddressQuery extends Query { + MailingAddressQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); } - public ImageTransformInput setCropInput(Input crop) { - if (crop == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.crop = crop; + /** + * The first line of the address. Typically the street address or PO Box number. + */ + public MailingAddressQuery address1() { + startField("address1"); + return this; } - public Integer getMaxWidth() { - return maxWidth.getValue(); + /** + * The second line of the address. Typically the number of the apartment, suite, or unit. + */ + public MailingAddressQuery address2() { + startField("address2"); + + return this; } - public Input getMaxWidthInput() { - return maxWidth; + /** + * The name of the city, district, village, or town. + */ + public MailingAddressQuery city() { + startField("city"); + + return this; } - public ImageTransformInput setMaxWidth(Integer maxWidth) { - this.maxWidth = Input.optional(maxWidth); + /** + * The name of the customer's company or organization. + */ + public MailingAddressQuery company() { + startField("company"); + return this; } - public ImageTransformInput setMaxWidthInput(Input maxWidth) { - if (maxWidth == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.maxWidth = maxWidth; + /** + * The name of the country. + */ + public MailingAddressQuery country() { + startField("country"); + return this; } - public Integer getMaxHeight() { - return maxHeight.getValue(); + /** + * The two-letter code for the country of the address. + * For example, US. + * + * @deprecated Use `countryCodeV2` instead. + */ + @Deprecated + public MailingAddressQuery countryCode() { + startField("countryCode"); + + return this; } - public Input getMaxHeightInput() { - return maxHeight; + /** + * The two-letter code for the country of the address. + * For example, US. + */ + public MailingAddressQuery countryCodeV2() { + startField("countryCodeV2"); + + return this; } - public ImageTransformInput setMaxHeight(Integer maxHeight) { - this.maxHeight = Input.optional(maxHeight); + /** + * The first name of the customer. + */ + public MailingAddressQuery firstName() { + startField("firstName"); + return this; } - public ImageTransformInput setMaxHeightInput(Input maxHeight) { - if (maxHeight == null) { - throw new IllegalArgumentException("Input can not be null"); + public class FormattedArguments extends Arguments { + FormattedArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * Whether to include the customer's name in the formatted address. + */ + public FormattedArguments withName(Boolean value) { + if (value != null) { + startArgument("withName"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Whether to include the customer's company in the formatted address. + */ + public FormattedArguments withCompany(Boolean value) { + if (value != null) { + startArgument("withCompany"); + _queryBuilder.append(value); + } + return this; } - this.maxHeight = maxHeight; - return this; } - public Integer getScale() { - return scale.getValue(); + public interface FormattedArgumentsDefinition { + void define(FormattedArguments args); } - public Input getScaleInput() { - return scale; + /** + * A formatted version of the address, customized by the provided arguments. + */ + public MailingAddressQuery formatted() { + return formatted(args -> {}); } - public ImageTransformInput setScale(Integer scale) { - this.scale = Input.optional(scale); + /** + * A formatted version of the address, customized by the provided arguments. + */ + public MailingAddressQuery formatted(FormattedArgumentsDefinition argsDef) { + startField("formatted"); + + FormattedArguments args = new FormattedArguments(_queryBuilder); + argsDef.define(args); + FormattedArguments.end(args); + return this; } - public ImageTransformInput setScaleInput(Input scale) { - if (scale == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.scale = scale; - return this; - } + /** + * A comma-separated list of the values for city, province, and country. + */ + public MailingAddressQuery formattedArea() { + startField("formattedArea"); - public ImageContentType getPreferredContentType() { - return preferredContentType.getValue(); + return this; } - public Input getPreferredContentTypeInput() { - return preferredContentType; - } + /** + * The last name of the customer. + */ + public MailingAddressQuery lastName() { + startField("lastName"); - public ImageTransformInput setPreferredContentType(ImageContentType preferredContentType) { - this.preferredContentType = Input.optional(preferredContentType); return this; } - public ImageTransformInput setPreferredContentTypeInput(Input preferredContentType) { - if (preferredContentType == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.preferredContentType = preferredContentType; + /** + * The latitude coordinate of the customer address. + */ + public MailingAddressQuery latitude() { + startField("latitude"); + return this; } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - if (this.crop.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("crop:"); - if (crop.getValue() != null) { - _queryBuilder.append(crop.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.maxWidth.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("maxWidth:"); - if (maxWidth.getValue() != null) { - _queryBuilder.append(maxWidth.getValue()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.maxHeight.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("maxHeight:"); - if (maxHeight.getValue() != null) { - _queryBuilder.append(maxHeight.getValue()); - } else { - _queryBuilder.append("null"); - } - } + /** + * The longitude coordinate of the customer address. + */ + public MailingAddressQuery longitude() { + startField("longitude"); - if (this.scale.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("scale:"); - if (scale.getValue() != null) { - _queryBuilder.append(scale.getValue()); - } else { - _queryBuilder.append("null"); - } - } + return this; + } - if (this.preferredContentType.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("preferredContentType:"); - if (preferredContentType.getValue() != null) { - _queryBuilder.append(preferredContentType.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + /** + * The full name of the customer, based on firstName and lastName. + */ + public MailingAddressQuery name() { + startField("name"); - _queryBuilder.append('}'); + return this; } - } - public interface LanguageQueryDefinition { - void define(LanguageQuery _queryBuilder); - } + /** + * A unique phone number for the customer. + * Formatted using E.164 standard. For example, _+16135551111_. + */ + public MailingAddressQuery phone() { + startField("phone"); - /** - * A language. - */ - public static class LanguageQuery extends Query { - LanguageQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * The name of the language in the language itself. If the language uses capitalization, it is - * capitalized for a mid-sentence position. + * The region of the address, such as the province, state, or district. */ - public LanguageQuery endonymName() { - startField("endonymName"); + public MailingAddressQuery province() { + startField("province"); return this; } /** - * The ISO code. + * The two-letter code for the region. + * For example, ON. */ - public LanguageQuery isoCode() { - startField("isoCode"); + public MailingAddressQuery provinceCode() { + startField("provinceCode"); return this; } /** - * The name of the language in the current language. + * The zip or postal code of the address. */ - public LanguageQuery name() { - startField("name"); + public MailingAddressQuery zip() { + startField("zip"); return this; } } /** - * A language. + * Represents a mailing address for customers and shipping. */ - public static class Language extends AbstractResponse { - public Language() { + public static class MailingAddress extends AbstractResponse implements DeliveryAddress, Node { + public MailingAddress() { } - public Language(JsonObject fields) throws SchemaViolationError { + public MailingAddress(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "endonymName": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "address1": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "isoCode": { - responseData.put(key, LanguageCode.fromGraphQl(jsonAsString(field.getValue(), key))); + case "address2": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "city": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "company": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "country": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "countryCode": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "countryCodeV2": { + CountryCode optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = CountryCode.fromGraphQl(jsonAsString(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "firstName": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "formatted": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + responseData.put(key, list1); + + break; + } + + case "formattedArea": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "lastName": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "latitude": { + Double optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsDouble(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "longitude": { + Double optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsDouble(field.getValue(), key); + } + + responseData.put(key, optional1); break; } case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "phone": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "province": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "provinceCode": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "zip": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } @@ -33657,1861 +40565,2018 @@ public Language(JsonObject fields) throws SchemaViolationError { } } + public MailingAddress(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "Language"; + return "MailingAddress"; } /** - * The name of the language in the language itself. If the language uses capitalization, it is - * capitalized for a mid-sentence position. + * The first line of the address. Typically the street address or PO Box number. */ - public String getEndonymName() { - return (String) get("endonymName"); + public String getAddress1() { + return (String) get("address1"); } - public Language setEndonymName(String arg) { - optimisticData.put(getKey("endonymName"), arg); + public MailingAddress setAddress1(String arg) { + optimisticData.put(getKey("address1"), arg); return this; } /** - * The ISO code. + * The second line of the address. Typically the number of the apartment, suite, or unit. */ - public LanguageCode getIsoCode() { - return (LanguageCode) get("isoCode"); + public String getAddress2() { + return (String) get("address2"); } - public Language setIsoCode(LanguageCode arg) { - optimisticData.put(getKey("isoCode"), arg); + public MailingAddress setAddress2(String arg) { + optimisticData.put(getKey("address2"), arg); return this; } /** - * The name of the language in the current language. + * The name of the city, district, village, or town. */ - public String getName() { - return (String) get("name"); + public String getCity() { + return (String) get("city"); } - public Language setName(String arg) { - optimisticData.put(getKey("name"), arg); + public MailingAddress setCity(String arg) { + optimisticData.put(getKey("city"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "endonymName": return false; - - case "isoCode": return false; + /** + * The name of the customer's company or organization. + */ - case "name": return false; + public String getCompany() { + return (String) get("company"); + } - default: return false; - } + public MailingAddress setCompany(String arg) { + optimisticData.put(getKey("company"), arg); + return this; } - } - /** - * ISO 639-1 language codes supported by Shopify. - */ - public enum LanguageCode { /** - * Afrikaans. + * The name of the country. */ - AF, - /** - * Akan. - */ - AK, + public String getCountry() { + return (String) get("country"); + } - /** - * Amharic. - */ - AM, + public MailingAddress setCountry(String arg) { + optimisticData.put(getKey("country"), arg); + return this; + } /** - * Arabic. + * The two-letter code for the country of the address. + * For example, US. + * + * @deprecated Use `countryCodeV2` instead. */ - AR, - /** - * Assamese. - */ - AS, + public String getCountryCode() { + return (String) get("countryCode"); + } - /** - * Azerbaijani. - */ - AZ, + public MailingAddress setCountryCode(String arg) { + optimisticData.put(getKey("countryCode"), arg); + return this; + } /** - * Belarusian. + * The two-letter code for the country of the address. + * For example, US. */ - BE, - /** - * Bulgarian. - */ - BG, + public CountryCode getCountryCodeV2() { + return (CountryCode) get("countryCodeV2"); + } - /** - * Bambara. - */ - BM, + public MailingAddress setCountryCodeV2(CountryCode arg) { + optimisticData.put(getKey("countryCodeV2"), arg); + return this; + } /** - * Bangla. + * The first name of the customer. */ - BN, - /** - * Tibetan. - */ - BO, + public String getFirstName() { + return (String) get("firstName"); + } - /** - * Breton. - */ - BR, + public MailingAddress setFirstName(String arg) { + optimisticData.put(getKey("firstName"), arg); + return this; + } /** - * Bosnian. + * A formatted version of the address, customized by the provided arguments. */ - BS, - /** - * Catalan. - */ - CA, + public List getFormatted() { + return (List) get("formatted"); + } + + public MailingAddress setFormatted(List arg) { + optimisticData.put(getKey("formatted"), arg); + return this; + } /** - * Chechen. + * A comma-separated list of the values for city, province, and country. */ - CE, + + public String getFormattedArea() { + return (String) get("formattedArea"); + } + + public MailingAddress setFormattedArea(String arg) { + optimisticData.put(getKey("formattedArea"), arg); + return this; + } /** - * Czech. + * A globally-unique identifier. */ - CS, - /** - * Church Slavic. - */ - CU, + public ID getId() { + return (ID) get("id"); + } /** - * Welsh. + * The last name of the customer. */ - CY, - /** - * Danish. - */ - DA, + public String getLastName() { + return (String) get("lastName"); + } - /** - * German. - */ - DE, + public MailingAddress setLastName(String arg) { + optimisticData.put(getKey("lastName"), arg); + return this; + } /** - * Dzongkha. + * The latitude coordinate of the customer address. */ - DZ, - /** - * Ewe. - */ - EE, + public Double getLatitude() { + return (Double) get("latitude"); + } - /** - * Greek. - */ - EL, + public MailingAddress setLatitude(Double arg) { + optimisticData.put(getKey("latitude"), arg); + return this; + } /** - * English. + * The longitude coordinate of the customer address. */ - EN, - /** - * Esperanto. - */ - EO, + public Double getLongitude() { + return (Double) get("longitude"); + } - /** - * Spanish. - */ - ES, + public MailingAddress setLongitude(Double arg) { + optimisticData.put(getKey("longitude"), arg); + return this; + } /** - * Estonian. + * The full name of the customer, based on firstName and lastName. */ - ET, - /** - * Basque. - */ - EU, + public String getName() { + return (String) get("name"); + } - /** - * Persian. - */ - FA, + public MailingAddress setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } /** - * Fulah. + * A unique phone number for the customer. + * Formatted using E.164 standard. For example, _+16135551111_. */ - FF, - /** - * Finnish. - */ - FI, + public String getPhone() { + return (String) get("phone"); + } - /** - * Faroese. - */ - FO, + public MailingAddress setPhone(String arg) { + optimisticData.put(getKey("phone"), arg); + return this; + } /** - * French. + * The region of the address, such as the province, state, or district. */ - FR, - /** - * Western Frisian. - */ - FY, + public String getProvince() { + return (String) get("province"); + } - /** - * Irish. - */ - GA, + public MailingAddress setProvince(String arg) { + optimisticData.put(getKey("province"), arg); + return this; + } /** - * Scottish Gaelic. + * The two-letter code for the region. + * For example, ON. */ - GD, - /** - * Galician. - */ - GL, + public String getProvinceCode() { + return (String) get("provinceCode"); + } - /** - * Gujarati. - */ - GU, + public MailingAddress setProvinceCode(String arg) { + optimisticData.put(getKey("provinceCode"), arg); + return this; + } /** - * Manx. + * The zip or postal code of the address. */ - GV, - /** - * Hausa. - */ - HA, + public String getZip() { + return (String) get("zip"); + } - /** - * Hebrew. - */ - HE, + public MailingAddress setZip(String arg) { + optimisticData.put(getKey("zip"), arg); + return this; + } - /** - * Hindi. - */ - HI, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "address1": return false; - /** - * Croatian. - */ - HR, + case "address2": return false; - /** - * Hungarian. - */ - HU, + case "city": return false; - /** - * Armenian. - */ - HY, + case "company": return false; - /** - * Interlingua. - */ - IA, + case "country": return false; - /** - * Indonesian. - */ - ID, + case "countryCode": return false; - /** - * Igbo. - */ - IG, + case "countryCodeV2": return false; - /** - * Sichuan Yi. - */ - II, + case "firstName": return false; - /** - * Icelandic. - */ - IS, + case "formatted": return false; - /** - * Italian. - */ - IT, + case "formattedArea": return false; - /** - * Japanese. - */ - JA, + case "id": return false; - /** - * Javanese. - */ - JV, + case "lastName": return false; - /** - * Georgian. - */ - KA, + case "latitude": return false; - /** - * Kikuyu. - */ - KI, + case "longitude": return false; - /** - * Kazakh. - */ - KK, + case "name": return false; - /** - * Kalaallisut. - */ - KL, + case "phone": return false; - /** - * Khmer. - */ - KM, + case "province": return false; - /** - * Kannada. - */ - KN, + case "provinceCode": return false; - /** - * Korean. - */ - KO, + case "zip": return false; - /** - * Kashmiri. - */ - KS, + default: return false; + } + } + } - /** - * Kurdish. - */ - KU, + public interface MailingAddressConnectionQueryDefinition { + void define(MailingAddressConnectionQuery _queryBuilder); + } - /** - * Cornish. - */ - KW, + /** + * An auto-generated type for paginating through multiple MailingAddresses. + */ + public static class MailingAddressConnectionQuery extends Query { + MailingAddressConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Kyrgyz. + * A list of edges. */ - KY, + public MailingAddressConnectionQuery edges(MailingAddressEdgeQueryDefinition queryDef) { + startField("edges"); - /** - * Luxembourgish. - */ - LB, + _queryBuilder.append('{'); + queryDef.define(new MailingAddressEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Ganda. - */ - LG, + return this; + } /** - * Lingala. + * A list of the nodes contained in MailingAddressEdge. */ - LN, + public MailingAddressConnectionQuery nodes(MailingAddressQueryDefinition queryDef) { + startField("nodes"); - /** - * Lao. - */ - LO, + _queryBuilder.append('{'); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Lithuanian. - */ - LT, + return this; + } /** - * Luba-Katanga. + * Information to aid in pagination. */ - LU, + public MailingAddressConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - /** - * Latvian. - */ - LV, + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Malagasy. - */ - MG, + return this; + } + } - /** - * Māori. - */ - MI, + /** + * An auto-generated type for paginating through multiple MailingAddresses. + */ + public static class MailingAddressConnection extends AbstractResponse { + public MailingAddressConnection() { + } - /** - * Macedonian. - */ - MK, + public MailingAddressConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new MailingAddressEdge(jsonAsObject(element1, key))); + } - /** - * Malayalam. - */ - ML, + responseData.put(key, list1); - /** - * Mongolian. - */ - MN, + break; + } - /** - * Marathi. - */ - MR, + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new MailingAddress(jsonAsObject(element1, key))); + } - /** - * Malay. - */ - MS, + responseData.put(key, list1); - /** - * Maltese. - */ - MT, + break; + } - /** - * Burmese. - */ - MY, + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - /** - * Norwegian (Bokmål). - */ - NB, + break; + } - /** - * North Ndebele. - */ - ND, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * Nepali. - */ - NE, + public String getGraphQlTypeName() { + return "MailingAddressConnection"; + } /** - * Dutch. + * A list of edges. */ - NL, - /** - * Norwegian Nynorsk. - */ - NN, + public List getEdges() { + return (List) get("edges"); + } - /** - * Norwegian. - */ - NO, + public MailingAddressConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; + } /** - * Oromo. + * A list of the nodes contained in MailingAddressEdge. */ - OM, - /** - * Odia. - */ - OR, + public List getNodes() { + return (List) get("nodes"); + } - /** - * Ossetic. - */ - OS, + public MailingAddressConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; + } /** - * Punjabi. + * Information to aid in pagination. */ - PA, - /** - * Polish. - */ - PL, + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } - /** - * Pashto. - */ - PS, + public MailingAddressConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); + return this; + } - /** - * Portuguese. - */ - PT, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - /** - * Portuguese (Brazil). - */ - PT_BR, + case "nodes": return true; - /** - * Portuguese (Portugal). - */ - PT_PT, + case "pageInfo": return true; + + default: return false; + } + } + } + + public interface MailingAddressEdgeQueryDefinition { + void define(MailingAddressEdgeQuery _queryBuilder); + } + + /** + * An auto-generated type which holds one MailingAddress and a cursor during pagination. + */ + public static class MailingAddressEdgeQuery extends Query { + MailingAddressEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Quechua. + * A cursor for use in pagination. */ - QU, + public MailingAddressEdgeQuery cursor() { + startField("cursor"); - /** - * Romansh. - */ - RM, + return this; + } /** - * Rundi. + * The item at the end of MailingAddressEdge. */ - RN, + public MailingAddressEdgeQuery node(MailingAddressQueryDefinition queryDef) { + startField("node"); - /** - * Romanian. - */ - RO, + _queryBuilder.append('{'); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Russian. - */ - RU, + return this; + } + } - /** - * Kinyarwanda. - */ - RW, + /** + * An auto-generated type which holds one MailingAddress and a cursor during pagination. + */ + public static class MailingAddressEdge extends AbstractResponse { + public MailingAddressEdge() { + } - /** - * Sindhi. - */ - SD, + public MailingAddressEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * Northern Sami. - */ - SE, + break; + } - /** - * Sango. - */ - SG, + case "node": { + responseData.put(key, new MailingAddress(jsonAsObject(field.getValue(), key))); - /** - * Sinhala. - */ - SI, + break; + } - /** - * Slovak. - */ - SK, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - /** - * Slovenian. - */ - SL, + public String getGraphQlTypeName() { + return "MailingAddressEdge"; + } /** - * Shona. + * A cursor for use in pagination. */ - SN, - /** - * Somali. - */ - SO, + public String getCursor() { + return (String) get("cursor"); + } - /** - * Albanian. - */ - SQ, + public MailingAddressEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); + return this; + } /** - * Serbian. + * The item at the end of MailingAddressEdge. */ - SR, - /** - * Sundanese. - */ - SU, + public MailingAddress getNode() { + return (MailingAddress) get("node"); + } - /** - * Swedish. - */ - SV, + public MailingAddressEdge setNode(MailingAddress arg) { + optimisticData.put(getKey("node"), arg); + return this; + } - /** - * Swahili. - */ - SW, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - /** - * Tamil. - */ - TA, + case "node": return true; - /** - * Telugu. - */ - TE, + default: return false; + } + } + } - /** - * Tajik. - */ - TG, + public static class MailingAddressInput implements Serializable { + private Input address1 = Input.undefined(); - /** - * Thai. - */ - TH, + private Input address2 = Input.undefined(); - /** - * Tigrinya. - */ - TI, + private Input city = Input.undefined(); - /** - * Turkmen. - */ - TK, + private Input company = Input.undefined(); - /** - * Tongan. - */ - TO, + private Input country = Input.undefined(); - /** - * Turkish. - */ - TR, + private Input firstName = Input.undefined(); - /** - * Tatar. - */ - TT, + private Input lastName = Input.undefined(); - /** - * Uyghur. - */ - UG, + private Input phone = Input.undefined(); - /** - * Ukrainian. - */ - UK, + private Input province = Input.undefined(); - /** - * Urdu. - */ - UR, + private Input zip = Input.undefined(); - /** - * Uzbek. - */ - UZ, + public String getAddress1() { + return address1.getValue(); + } - /** - * Vietnamese. - */ - VI, + public Input getAddress1Input() { + return address1; + } - /** - * Volapük. - */ - VO, + public MailingAddressInput setAddress1(String address1) { + this.address1 = Input.optional(address1); + return this; + } - /** - * Wolof. - */ - WO, + public MailingAddressInput setAddress1Input(Input address1) { + if (address1 == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.address1 = address1; + return this; + } - /** - * Xhosa. - */ - XH, + public String getAddress2() { + return address2.getValue(); + } - /** - * Yiddish. - */ - YI, + public Input getAddress2Input() { + return address2; + } - /** - * Yoruba. - */ - YO, + public MailingAddressInput setAddress2(String address2) { + this.address2 = Input.optional(address2); + return this; + } - /** - * Chinese. - */ - ZH, + public MailingAddressInput setAddress2Input(Input address2) { + if (address2 == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.address2 = address2; + return this; + } - /** - * Chinese (Simplified). - */ - ZH_CN, + public String getCity() { + return city.getValue(); + } - /** - * Chinese (Traditional). - */ - ZH_TW, + public Input getCityInput() { + return city; + } - /** - * Zulu. - */ - ZU, + public MailingAddressInput setCity(String city) { + this.city = Input.optional(city); + return this; + } - UNKNOWN_VALUE; + public MailingAddressInput setCityInput(Input city) { + if (city == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.city = city; + return this; + } - public static LanguageCode fromGraphQl(String value) { - if (value == null) { - return null; + public String getCompany() { + return company.getValue(); + } + + public Input getCompanyInput() { + return company; + } + + public MailingAddressInput setCompany(String company) { + this.company = Input.optional(company); + return this; + } + + public MailingAddressInput setCompanyInput(Input company) { + if (company == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.company = company; + return this; + } - switch (value) { - case "AF": { - return AF; - } + public String getCountry() { + return country.getValue(); + } - case "AK": { - return AK; - } + public Input getCountryInput() { + return country; + } - case "AM": { - return AM; - } + public MailingAddressInput setCountry(String country) { + this.country = Input.optional(country); + return this; + } - case "AR": { - return AR; - } + public MailingAddressInput setCountryInput(Input country) { + if (country == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.country = country; + return this; + } - case "AS": { - return AS; - } + public String getFirstName() { + return firstName.getValue(); + } - case "AZ": { - return AZ; - } + public Input getFirstNameInput() { + return firstName; + } - case "BE": { - return BE; - } + public MailingAddressInput setFirstName(String firstName) { + this.firstName = Input.optional(firstName); + return this; + } - case "BG": { - return BG; - } + public MailingAddressInput setFirstNameInput(Input firstName) { + if (firstName == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.firstName = firstName; + return this; + } - case "BM": { - return BM; - } + public String getLastName() { + return lastName.getValue(); + } - case "BN": { - return BN; - } + public Input getLastNameInput() { + return lastName; + } - case "BO": { - return BO; - } + public MailingAddressInput setLastName(String lastName) { + this.lastName = Input.optional(lastName); + return this; + } - case "BR": { - return BR; - } + public MailingAddressInput setLastNameInput(Input lastName) { + if (lastName == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.lastName = lastName; + return this; + } - case "BS": { - return BS; - } + public String getPhone() { + return phone.getValue(); + } - case "CA": { - return CA; - } + public Input getPhoneInput() { + return phone; + } - case "CE": { - return CE; - } + public MailingAddressInput setPhone(String phone) { + this.phone = Input.optional(phone); + return this; + } - case "CS": { - return CS; - } + public MailingAddressInput setPhoneInput(Input phone) { + if (phone == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.phone = phone; + return this; + } - case "CU": { - return CU; - } + public String getProvince() { + return province.getValue(); + } - case "CY": { - return CY; - } + public Input getProvinceInput() { + return province; + } - case "DA": { - return DA; - } + public MailingAddressInput setProvince(String province) { + this.province = Input.optional(province); + return this; + } - case "DE": { - return DE; - } + public MailingAddressInput setProvinceInput(Input province) { + if (province == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.province = province; + return this; + } - case "DZ": { - return DZ; - } + public String getZip() { + return zip.getValue(); + } - case "EE": { - return EE; - } + public Input getZipInput() { + return zip; + } - case "EL": { - return EL; - } + public MailingAddressInput setZip(String zip) { + this.zip = Input.optional(zip); + return this; + } - case "EN": { - return EN; + public MailingAddressInput setZipInput(Input zip) { + if (zip == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.zip = zip; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + if (this.address1.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("address1:"); + if (address1.getValue() != null) { + Query.appendQuotedString(_queryBuilder, address1.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - case "EO": { - return EO; + if (this.address2.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("address2:"); + if (address2.getValue() != null) { + Query.appendQuotedString(_queryBuilder, address2.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - case "ES": { - return ES; + if (this.city.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("city:"); + if (city.getValue() != null) { + Query.appendQuotedString(_queryBuilder, city.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - case "ET": { - return ET; + if (this.company.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("company:"); + if (company.getValue() != null) { + Query.appendQuotedString(_queryBuilder, company.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - case "EU": { - return EU; + if (this.country.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("country:"); + if (country.getValue() != null) { + Query.appendQuotedString(_queryBuilder, country.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - case "FA": { - return FA; + if (this.firstName.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("firstName:"); + if (firstName.getValue() != null) { + Query.appendQuotedString(_queryBuilder, firstName.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - case "FF": { - return FF; + if (this.lastName.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("lastName:"); + if (lastName.getValue() != null) { + Query.appendQuotedString(_queryBuilder, lastName.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - case "FI": { - return FI; + if (this.phone.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("phone:"); + if (phone.getValue() != null) { + Query.appendQuotedString(_queryBuilder, phone.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - case "FO": { - return FO; + if (this.province.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("province:"); + if (province.getValue() != null) { + Query.appendQuotedString(_queryBuilder, province.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - case "FR": { - return FR; + if (this.zip.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("zip:"); + if (zip.getValue() != null) { + Query.appendQuotedString(_queryBuilder, zip.getValue().toString()); + } else { + _queryBuilder.append("null"); } + } - case "FY": { - return FY; - } + _queryBuilder.append('}'); + } + } - case "GA": { - return GA; - } + public interface ManualDiscountApplicationQueryDefinition { + void define(ManualDiscountApplicationQuery _queryBuilder); + } - case "GD": { - return GD; - } + /** + * Manual discount applications capture the intentions of a discount that was manually created. + */ + public static class ManualDiscountApplicationQuery extends Query { + ManualDiscountApplicationQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "GL": { - return GL; - } + /** + * The method by which the discount's value is allocated to its entitled items. + */ + public ManualDiscountApplicationQuery allocationMethod() { + startField("allocationMethod"); - case "GU": { - return GU; - } + return this; + } - case "GV": { - return GV; - } + /** + * The description of the application. + */ + public ManualDiscountApplicationQuery description() { + startField("description"); - case "HA": { - return HA; - } + return this; + } - case "HE": { - return HE; - } + /** + * Which lines of targetType that the discount is allocated over. + */ + public ManualDiscountApplicationQuery targetSelection() { + startField("targetSelection"); - case "HI": { - return HI; - } + return this; + } - case "HR": { - return HR; - } + /** + * The type of line that the discount is applicable towards. + */ + public ManualDiscountApplicationQuery targetType() { + startField("targetType"); - case "HU": { - return HU; - } + return this; + } - case "HY": { - return HY; - } + /** + * The title of the application. + */ + public ManualDiscountApplicationQuery title() { + startField("title"); - case "IA": { - return IA; - } + return this; + } - case "ID": { - return ID; - } + /** + * The value of the discount application. + */ + public ManualDiscountApplicationQuery value(PricingValueQueryDefinition queryDef) { + startField("value"); - case "IG": { - return IG; - } + _queryBuilder.append('{'); + queryDef.define(new PricingValueQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "II": { - return II; - } + return this; + } + } - case "IS": { - return IS; - } + /** + * Manual discount applications capture the intentions of a discount that was manually created. + */ + public static class ManualDiscountApplication extends AbstractResponse implements DiscountApplication { + public ManualDiscountApplication() { + } - case "IT": { - return IT; - } + public ManualDiscountApplication(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "allocationMethod": { + responseData.put(key, DiscountApplicationAllocationMethod.fromGraphQl(jsonAsString(field.getValue(), key))); - case "JA": { - return JA; - } + break; + } - case "JV": { - return JV; - } + case "description": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "KA": { - return KA; - } + responseData.put(key, optional1); - case "KI": { - return KI; - } + break; + } - case "KK": { - return KK; - } + case "targetSelection": { + responseData.put(key, DiscountApplicationTargetSelection.fromGraphQl(jsonAsString(field.getValue(), key))); - case "KL": { - return KL; - } + break; + } - case "KM": { - return KM; - } + case "targetType": { + responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); - case "KN": { - return KN; - } + break; + } - case "KO": { - return KO; - } + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case "KS": { - return KS; - } + break; + } - case "KU": { - return KU; - } + case "value": { + responseData.put(key, UnknownPricingValue.create(jsonAsObject(field.getValue(), key))); - case "KW": { - return KW; - } + break; + } - case "KY": { - return KY; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "LB": { - return LB; - } + public String getGraphQlTypeName() { + return "ManualDiscountApplication"; + } - case "LG": { - return LG; - } + /** + * The method by which the discount's value is allocated to its entitled items. + */ - case "LN": { - return LN; - } + public DiscountApplicationAllocationMethod getAllocationMethod() { + return (DiscountApplicationAllocationMethod) get("allocationMethod"); + } - case "LO": { - return LO; - } + public ManualDiscountApplication setAllocationMethod(DiscountApplicationAllocationMethod arg) { + optimisticData.put(getKey("allocationMethod"), arg); + return this; + } - case "LT": { - return LT; - } + /** + * The description of the application. + */ - case "LU": { - return LU; - } + public String getDescription() { + return (String) get("description"); + } - case "LV": { - return LV; - } + public ManualDiscountApplication setDescription(String arg) { + optimisticData.put(getKey("description"), arg); + return this; + } - case "MG": { - return MG; - } + /** + * Which lines of targetType that the discount is allocated over. + */ - case "MI": { - return MI; - } + public DiscountApplicationTargetSelection getTargetSelection() { + return (DiscountApplicationTargetSelection) get("targetSelection"); + } - case "MK": { - return MK; - } + public ManualDiscountApplication setTargetSelection(DiscountApplicationTargetSelection arg) { + optimisticData.put(getKey("targetSelection"), arg); + return this; + } - case "ML": { - return ML; - } + /** + * The type of line that the discount is applicable towards. + */ - case "MN": { - return MN; - } + public DiscountApplicationTargetType getTargetType() { + return (DiscountApplicationTargetType) get("targetType"); + } - case "MR": { - return MR; - } + public ManualDiscountApplication setTargetType(DiscountApplicationTargetType arg) { + optimisticData.put(getKey("targetType"), arg); + return this; + } - case "MS": { - return MS; - } + /** + * The title of the application. + */ - case "MT": { - return MT; - } + public String getTitle() { + return (String) get("title"); + } - case "MY": { - return MY; - } + public ManualDiscountApplication setTitle(String arg) { + optimisticData.put(getKey("title"), arg); + return this; + } - case "NB": { - return NB; - } + /** + * The value of the discount application. + */ - case "ND": { - return ND; - } + public PricingValue getValue() { + return (PricingValue) get("value"); + } - case "NE": { - return NE; - } + public ManualDiscountApplication setValue(PricingValue arg) { + optimisticData.put(getKey("value"), arg); + return this; + } - case "NL": { - return NL; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "allocationMethod": return false; - case "NN": { - return NN; - } + case "description": return false; - case "NO": { - return NO; - } + case "targetSelection": return false; - case "OM": { - return OM; - } + case "targetType": return false; - case "OR": { - return OR; - } + case "title": return false; - case "OS": { - return OS; - } + case "value": return false; - case "PA": { - return PA; - } + default: return false; + } + } + } - case "PL": { - return PL; - } + public interface MarketQueryDefinition { + void define(MarketQuery _queryBuilder); + } - case "PS": { - return PS; - } + /** + * A group of one or more regions of the world that a merchant is targeting for sales. To learn more + * about markets, refer to [the Shopify Markets conceptual overview](/docs/apps/markets). + */ + public static class MarketQuery extends Query { + MarketQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - case "PT": { - return PT; - } + startField("id"); + } - case "PT_BR": { - return PT_BR; - } + /** + * A human-readable unique string for the market automatically generated from its title. + */ + public MarketQuery handle() { + startField("handle"); - case "PT_PT": { - return PT_PT; - } + return this; + } - case "QU": { - return QU; - } + /** + * Returns a metafield found by namespace and key. + */ + public MarketQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { + startField("metafield"); - case "RM": { - return RM; - } + _queryBuilder.append("(namespace:"); + Query.appendQuotedString(_queryBuilder, namespace.toString()); - case "RN": { - return RN; - } + _queryBuilder.append(",key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); - case "RO": { - return RO; - } + _queryBuilder.append(')'); - case "RU": { - return RU; - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "RW": { - return RW; + return this; + } + + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ + public MarketQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); + + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); } + } + _queryBuilder.append(']'); - case "SD": { - return SD; - } + _queryBuilder.append(')'); - case "SE": { - return SE; - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "SG": { - return SG; - } + return this; + } + } - case "SI": { - return SI; - } + /** + * A group of one or more regions of the world that a merchant is targeting for sales. To learn more + * about markets, refer to [the Shopify Markets conceptual overview](/docs/apps/markets). + */ + public static class Market extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { + public Market() { + } - case "SK": { - return SK; - } + public Market(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case "SL": { - return SL; - } + break; + } - case "SN": { - return SN; - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - case "SO": { - return SO; - } + break; + } - case "SQ": { - return SQ; - } + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } - case "SR": { - return SR; - } + responseData.put(key, optional1); - case "SU": { - return SU; - } + break; + } - case "SV": { - return SV; - } + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } - case "SW": { - return SW; - } + list1.add(optional2); + } - case "TA": { - return TA; - } + responseData.put(key, list1); - case "TE": { - return TE; - } + break; + } - case "TG": { - return TG; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case "TH": { - return TH; - } + public Market(ID id) { + this(); + optimisticData.put("id", id); + } - case "TI": { - return TI; - } + public String getGraphQlTypeName() { + return "Market"; + } - case "TK": { - return TK; - } + /** + * A human-readable unique string for the market automatically generated from its title. + */ - case "TO": { - return TO; - } + public String getHandle() { + return (String) get("handle"); + } - case "TR": { - return TR; - } + public Market setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); + return this; + } - case "TT": { - return TT; - } + /** + * A globally-unique identifier. + */ - case "UG": { - return UG; - } + public ID getId() { + return (ID) get("id"); + } - case "UK": { - return UK; - } + /** + * Returns a metafield found by namespace and key. + */ - case "UR": { - return UR; - } + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } - case "UZ": { - return UZ; - } + public Market setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); + return this; + } - case "VI": { - return VI; - } + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ - case "VO": { - return VO; - } + public List getMetafields() { + return (List) get("metafields"); + } - case "WO": { - return WO; - } + public Market setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); + return this; + } - case "XH": { - return XH; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "handle": return false; - case "YI": { - return YI; - } + case "id": return false; - case "YO": { - return YO; - } + case "metafield": return true; - case "ZH": { - return ZH; - } + case "metafields": return true; - case "ZH_CN": { - return ZH_CN; - } + default: return false; + } + } + } - case "ZH_TW": { - return ZH_TW; - } + public interface MediaQueryDefinition { + void define(MediaQuery _queryBuilder); + } - case "ZU": { - return ZU; - } + /** + * Represents a media interface. + */ + public static class MediaQuery extends Query { + MediaQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - default: { - return UNKNOWN_VALUE; - } - } + startField("__typename"); } - public String toString() { - switch (this) { - case AF: { - return "AF"; - } - case AK: { - return "AK"; - } + /** + * A word or phrase to share the nature or contents of a media. + */ + public MediaQuery alt() { + startField("alt"); - case AM: { - return "AM"; - } + return this; + } - case AR: { - return "AR"; - } + /** + * The media content type. + */ + public MediaQuery mediaContentType() { + startField("mediaContentType"); - case AS: { - return "AS"; - } + return this; + } - case AZ: { - return "AZ"; - } + /** + * The presentation for a media. + */ + public MediaQuery presentation(MediaPresentationQueryDefinition queryDef) { + startField("presentation"); - case BE: { - return "BE"; - } + _queryBuilder.append('{'); + queryDef.define(new MediaPresentationQuery(_queryBuilder)); + _queryBuilder.append('}'); - case BG: { - return "BG"; - } + return this; + } - case BM: { - return "BM"; - } + /** + * The preview image for the media. + */ + public MediaQuery previewImage(ImageQueryDefinition queryDef) { + startField("previewImage"); - case BN: { - return "BN"; - } + _queryBuilder.append('{'); + queryDef.define(new ImageQuery(_queryBuilder)); + _queryBuilder.append('}'); - case BO: { - return "BO"; - } + return this; + } - case BR: { - return "BR"; - } + public MediaQuery onExternalVideo(ExternalVideoQueryDefinition queryDef) { + startInlineFragment("ExternalVideo"); + queryDef.define(new ExternalVideoQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case BS: { - return "BS"; - } + public MediaQuery onMediaImage(MediaImageQueryDefinition queryDef) { + startInlineFragment("MediaImage"); + queryDef.define(new MediaImageQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case CA: { - return "CA"; - } + public MediaQuery onModel3d(Model3dQueryDefinition queryDef) { + startInlineFragment("Model3d"); + queryDef.define(new Model3dQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case CE: { - return "CE"; - } + public MediaQuery onVideo(VideoQueryDefinition queryDef) { + startInlineFragment("Video"); + queryDef.define(new VideoQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + } - case CS: { - return "CS"; - } + public interface Media { + String getGraphQlTypeName(); - case CU: { - return "CU"; - } + String getAlt(); - case CY: { - return "CY"; - } + MediaContentType getMediaContentType(); - case DA: { - return "DA"; - } + MediaPresentation getPresentation(); - case DE: { - return "DE"; - } + Image getPreviewImage(); + } - case DZ: { - return "DZ"; - } + /** + * Represents a media interface. + */ + public static class UnknownMedia extends AbstractResponse implements Media { + public UnknownMedia() { + } - case EE: { - return "EE"; - } + public UnknownMedia(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "alt": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case EL: { - return "EL"; - } + responseData.put(key, optional1); - case EN: { - return "EN"; - } + break; + } - case EO: { - return "EO"; - } + case "mediaContentType": { + responseData.put(key, MediaContentType.fromGraphQl(jsonAsString(field.getValue(), key))); - case ES: { - return "ES"; - } + break; + } - case ET: { - return "ET"; - } + case "presentation": { + MediaPresentation optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MediaPresentation(jsonAsObject(field.getValue(), key)); + } - case EU: { - return "EU"; - } + responseData.put(key, optional1); - case FA: { - return "FA"; - } + break; + } - case FF: { - return "FF"; - } + case "previewImage": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); + } - case FI: { - return "FI"; - } + responseData.put(key, optional1); - case FO: { - return "FO"; - } + break; + } - case FR: { - return "FR"; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case FY: { - return "FY"; + public static Media create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "ExternalVideo": { + return new ExternalVideo(fields); } - case GA: { - return "GA"; + case "MediaImage": { + return new MediaImage(fields); } - case GD: { - return "GD"; + case "Model3d": { + return new Model3d(fields); } - case GL: { - return "GL"; + case "Video": { + return new Video(fields); } - case GU: { - return "GU"; + default: { + return new UnknownMedia(fields); } + } + } - case GV: { - return "GV"; - } + public String getGraphQlTypeName() { + return (String) get("__typename"); + } - case HA: { - return "HA"; - } + /** + * A word or phrase to share the nature or contents of a media. + */ - case HE: { - return "HE"; - } + public String getAlt() { + return (String) get("alt"); + } - case HI: { - return "HI"; - } + public UnknownMedia setAlt(String arg) { + optimisticData.put(getKey("alt"), arg); + return this; + } - case HR: { - return "HR"; - } + /** + * The media content type. + */ - case HU: { - return "HU"; - } + public MediaContentType getMediaContentType() { + return (MediaContentType) get("mediaContentType"); + } - case HY: { - return "HY"; - } + public UnknownMedia setMediaContentType(MediaContentType arg) { + optimisticData.put(getKey("mediaContentType"), arg); + return this; + } - case IA: { - return "IA"; - } + /** + * The presentation for a media. + */ - case ID: { - return "ID"; - } + public MediaPresentation getPresentation() { + return (MediaPresentation) get("presentation"); + } + + public UnknownMedia setPresentation(MediaPresentation arg) { + optimisticData.put(getKey("presentation"), arg); + return this; + } + + /** + * The preview image for the media. + */ - case IG: { - return "IG"; - } + public Image getPreviewImage() { + return (Image) get("previewImage"); + } - case II: { - return "II"; - } + public UnknownMedia setPreviewImage(Image arg) { + optimisticData.put(getKey("previewImage"), arg); + return this; + } - case IS: { - return "IS"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "alt": return false; - case IT: { - return "IT"; - } + case "mediaContentType": return false; - case JA: { - return "JA"; - } + case "presentation": return true; - case JV: { - return "JV"; - } + case "previewImage": return true; - case KA: { - return "KA"; - } + default: return false; + } + } + } - case KI: { - return "KI"; - } + public interface MediaConnectionQueryDefinition { + void define(MediaConnectionQuery _queryBuilder); + } - case KK: { - return "KK"; - } + /** + * An auto-generated type for paginating through multiple Media. + */ + public static class MediaConnectionQuery extends Query { + MediaConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case KL: { - return "KL"; - } + /** + * A list of edges. + */ + public MediaConnectionQuery edges(MediaEdgeQueryDefinition queryDef) { + startField("edges"); - case KM: { - return "KM"; - } + _queryBuilder.append('{'); + queryDef.define(new MediaEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); - case KN: { - return "KN"; - } + return this; + } - case KO: { - return "KO"; - } + /** + * A list of the nodes contained in MediaEdge. + */ + public MediaConnectionQuery nodes(MediaQueryDefinition queryDef) { + startField("nodes"); - case KS: { - return "KS"; - } + _queryBuilder.append('{'); + queryDef.define(new MediaQuery(_queryBuilder)); + _queryBuilder.append('}'); - case KU: { - return "KU"; - } + return this; + } - case KW: { - return "KW"; - } + /** + * Information to aid in pagination. + */ + public MediaConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - case KY: { - return "KY"; - } + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); - case LB: { - return "LB"; - } + return this; + } + } - case LG: { - return "LG"; - } + /** + * An auto-generated type for paginating through multiple Media. + */ + public static class MediaConnection extends AbstractResponse { + public MediaConnection() { + } - case LN: { - return "LN"; - } + public MediaConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new MediaEdge(jsonAsObject(element1, key))); + } - case LO: { - return "LO"; - } + responseData.put(key, list1); - case LT: { - return "LT"; - } + break; + } - case LU: { - return "LU"; - } + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(UnknownMedia.create(jsonAsObject(element1, key))); + } - case LV: { - return "LV"; - } + responseData.put(key, list1); - case MG: { - return "MG"; - } + break; + } - case MI: { - return "MI"; - } + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - case MK: { - return "MK"; - } + break; + } - case ML: { - return "ML"; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case MN: { - return "MN"; - } + public String getGraphQlTypeName() { + return "MediaConnection"; + } - case MR: { - return "MR"; - } + /** + * A list of edges. + */ - case MS: { - return "MS"; - } + public List getEdges() { + return (List) get("edges"); + } - case MT: { - return "MT"; - } + public MediaConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; + } - case MY: { - return "MY"; - } + /** + * A list of the nodes contained in MediaEdge. + */ - case NB: { - return "NB"; - } + public List getNodes() { + return (List) get("nodes"); + } - case ND: { - return "ND"; - } + public MediaConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; + } - case NE: { - return "NE"; - } + /** + * Information to aid in pagination. + */ - case NL: { - return "NL"; - } + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } - case NN: { - return "NN"; - } + public MediaConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); + return this; + } - case NO: { - return "NO"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - case OM: { - return "OM"; - } + case "nodes": return false; - case OR: { - return "OR"; - } + case "pageInfo": return true; - case OS: { - return "OS"; - } + default: return false; + } + } + } - case PA: { - return "PA"; - } + /** + * The possible content types for a media object. + */ + public enum MediaContentType { + /** + * An externally hosted video. + */ + EXTERNAL_VIDEO, - case PL: { - return "PL"; - } + /** + * A Shopify hosted image. + */ + IMAGE, - case PS: { - return "PS"; - } + /** + * A 3d model. + */ + MODEL_3D, - case PT: { - return "PT"; - } + /** + * A Shopify hosted video. + */ + VIDEO, - case PT_BR: { - return "PT_BR"; - } + UNKNOWN_VALUE; - case PT_PT: { - return "PT_PT"; - } + public static MediaContentType fromGraphQl(String value) { + if (value == null) { + return null; + } - case QU: { - return "QU"; + switch (value) { + case "EXTERNAL_VIDEO": { + return EXTERNAL_VIDEO; } - case RM: { - return "RM"; + case "IMAGE": { + return IMAGE; } - case RN: { - return "RN"; + case "MODEL_3D": { + return MODEL_3D; } - case RO: { - return "RO"; + case "VIDEO": { + return VIDEO; } - case RU: { - return "RU"; + default: { + return UNKNOWN_VALUE; } - - case RW: { - return "RW"; + } + } + public String toString() { + switch (this) { + case EXTERNAL_VIDEO: { + return "EXTERNAL_VIDEO"; } - case SD: { - return "SD"; + case IMAGE: { + return "IMAGE"; } - case SE: { - return "SE"; + case MODEL_3D: { + return "MODEL_3D"; } - case SG: { - return "SG"; + case VIDEO: { + return "VIDEO"; } - case SI: { - return "SI"; + default: { + return ""; } + } + } + } - case SK: { - return "SK"; - } + public interface MediaEdgeQueryDefinition { + void define(MediaEdgeQuery _queryBuilder); + } - case SL: { - return "SL"; - } + /** + * An auto-generated type which holds one Media and a cursor during pagination. + */ + public static class MediaEdgeQuery extends Query { + MediaEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case SN: { - return "SN"; - } + /** + * A cursor for use in pagination. + */ + public MediaEdgeQuery cursor() { + startField("cursor"); - case SO: { - return "SO"; - } + return this; + } - case SQ: { - return "SQ"; - } + /** + * The item at the end of MediaEdge. + */ + public MediaEdgeQuery node(MediaQueryDefinition queryDef) { + startField("node"); - case SR: { - return "SR"; - } + _queryBuilder.append('{'); + queryDef.define(new MediaQuery(_queryBuilder)); + _queryBuilder.append('}'); - case SU: { - return "SU"; - } + return this; + } + } - case SV: { - return "SV"; - } + /** + * An auto-generated type which holds one Media and a cursor during pagination. + */ + public static class MediaEdge extends AbstractResponse { + public MediaEdge() { + } - case SW: { - return "SW"; - } + public MediaEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case TA: { - return "TA"; - } + break; + } - case TE: { - return "TE"; - } + case "node": { + responseData.put(key, UnknownMedia.create(jsonAsObject(field.getValue(), key))); - case TG: { - return "TG"; - } + break; + } - case TH: { - return "TH"; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } + } + } - case TI: { - return "TI"; - } + public String getGraphQlTypeName() { + return "MediaEdge"; + } - case TK: { - return "TK"; - } + /** + * A cursor for use in pagination. + */ - case TO: { - return "TO"; - } + public String getCursor() { + return (String) get("cursor"); + } - case TR: { - return "TR"; - } + public MediaEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); + return this; + } - case TT: { - return "TT"; - } + /** + * The item at the end of MediaEdge. + */ - case UG: { - return "UG"; - } + public Media getNode() { + return (Media) get("node"); + } - case UK: { - return "UK"; - } + public MediaEdge setNode(Media arg) { + optimisticData.put(getKey("node"), arg); + return this; + } - case UR: { - return "UR"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - case UZ: { - return "UZ"; - } + case "node": return false; - case VI: { - return "VI"; - } + default: return false; + } + } + } - case VO: { - return "VO"; - } + /** + * Host for a Media Resource. + */ + public enum MediaHost { + /** + * Host for Vimeo embedded videos. + */ + VIMEO, - case WO: { - return "WO"; - } + /** + * Host for YouTube embedded videos. + */ + YOUTUBE, - case XH: { - return "XH"; - } + UNKNOWN_VALUE; - case YI: { - return "YI"; - } + public static MediaHost fromGraphQl(String value) { + if (value == null) { + return null; + } - case YO: { - return "YO"; + switch (value) { + case "VIMEO": { + return VIMEO; } - case ZH: { - return "ZH"; + case "YOUTUBE": { + return YOUTUBE; } - case ZH_CN: { - return "ZH_CN"; + default: { + return UNKNOWN_VALUE; } - - case ZH_TW: { - return "ZH_TW"; + } + } + public String toString() { + switch (this) { + case VIMEO: { + return "VIMEO"; } - case ZU: { - return "ZU"; + case YOUTUBE: { + return "YOUTUBE"; } default: { @@ -35521,66 +42586,72 @@ public String toString() { } } - public interface LocalizationQueryDefinition { - void define(LocalizationQuery _queryBuilder); + public interface MediaImageQueryDefinition { + void define(MediaImageQuery _queryBuilder); } /** - * Information about the localized experiences configured for the shop. + * Represents a Shopify hosted image. */ - public static class LocalizationQuery extends Query { - LocalizationQuery(StringBuilder _queryBuilder) { + public static class MediaImageQuery extends Query { + MediaImageQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * The list of countries with enabled localized experiences. + * A word or phrase to share the nature or contents of a media. */ - public LocalizationQuery availableCountries(CountryQueryDefinition queryDef) { - startField("availableCountries"); - - _queryBuilder.append('{'); - queryDef.define(new CountryQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MediaImageQuery alt() { + startField("alt"); return this; } /** - * The list of languages available for the active country. + * The image for the media. */ - public LocalizationQuery availableLanguages(LanguageQueryDefinition queryDef) { - startField("availableLanguages"); + public MediaImageQuery image(ImageQueryDefinition queryDef) { + startField("image"); _queryBuilder.append('{'); - queryDef.define(new LanguageQuery(_queryBuilder)); + queryDef.define(new ImageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The country of the active localized experience. Use the `@inContext` directive to change this value. + * The media content type. */ - public LocalizationQuery country(CountryQueryDefinition queryDef) { - startField("country"); + public MediaImageQuery mediaContentType() { + startField("mediaContentType"); + + return this; + } + + /** + * The presentation for a media. + */ + public MediaImageQuery presentation(MediaPresentationQueryDefinition queryDef) { + startField("presentation"); _queryBuilder.append('{'); - queryDef.define(new CountryQuery(_queryBuilder)); + queryDef.define(new MediaPresentationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The language of the active localized experience. Use the `@inContext` directive to change this - * value. + * The preview image for the media. */ - public LocalizationQuery language(LanguageQueryDefinition queryDef) { - startField("language"); + public MediaImageQuery previewImage(ImageQueryDefinition queryDef) { + startField("previewImage"); _queryBuilder.append('{'); - queryDef.define(new LanguageQuery(_queryBuilder)); + queryDef.define(new ImageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -35588,47 +42659,69 @@ public LocalizationQuery language(LanguageQueryDefinition queryDef) { } /** - * Information about the localized experiences configured for the shop. + * Represents a Shopify hosted image. */ - public static class Localization extends AbstractResponse { - public Localization() { + public static class MediaImage extends AbstractResponse implements Media, MetafieldReference, Node { + public MediaImage() { } - public Localization(JsonObject fields) throws SchemaViolationError { + public MediaImage(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "availableCountries": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Country(jsonAsObject(element1, key))); + case "alt": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "availableLanguages": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Language(jsonAsObject(element1, key))); + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "image": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "country": { - responseData.put(key, new Country(jsonAsObject(field.getValue(), key))); + case "mediaContentType": { + responseData.put(key, MediaContentType.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "language": { - responseData.put(key, new Language(jsonAsObject(field.getValue(), key))); + case "presentation": { + MediaPresentation optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MediaPresentation(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "previewImage": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } @@ -35644,129 +42737,155 @@ public Localization(JsonObject fields) throws SchemaViolationError { } } + public MediaImage(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "Localization"; + return "MediaImage"; } /** - * The list of countries with enabled localized experiences. + * A word or phrase to share the nature or contents of a media. */ - public List getAvailableCountries() { - return (List) get("availableCountries"); + public String getAlt() { + return (String) get("alt"); } - public Localization setAvailableCountries(List arg) { - optimisticData.put(getKey("availableCountries"), arg); + public MediaImage setAlt(String arg) { + optimisticData.put(getKey("alt"), arg); return this; } /** - * The list of languages available for the active country. + * A globally-unique identifier. */ - public List getAvailableLanguages() { - return (List) get("availableLanguages"); + public ID getId() { + return (ID) get("id"); } - public Localization setAvailableLanguages(List arg) { - optimisticData.put(getKey("availableLanguages"), arg); + /** + * The image for the media. + */ + + public Image getImage() { + return (Image) get("image"); + } + + public MediaImage setImage(Image arg) { + optimisticData.put(getKey("image"), arg); return this; } /** - * The country of the active localized experience. Use the `@inContext` directive to change this value. + * The media content type. */ - public Country getCountry() { - return (Country) get("country"); + public MediaContentType getMediaContentType() { + return (MediaContentType) get("mediaContentType"); } - public Localization setCountry(Country arg) { - optimisticData.put(getKey("country"), arg); + public MediaImage setMediaContentType(MediaContentType arg) { + optimisticData.put(getKey("mediaContentType"), arg); return this; } /** - * The language of the active localized experience. Use the `@inContext` directive to change this - * value. + * The presentation for a media. */ - public Language getLanguage() { - return (Language) get("language"); + public MediaPresentation getPresentation() { + return (MediaPresentation) get("presentation"); } - public Localization setLanguage(Language arg) { - optimisticData.put(getKey("language"), arg); + public MediaImage setPresentation(MediaPresentation arg) { + optimisticData.put(getKey("presentation"), arg); + return this; + } + + /** + * The preview image for the media. + */ + + public Image getPreviewImage() { + return (Image) get("previewImage"); + } + + public MediaImage setPreviewImage(Image arg) { + optimisticData.put(getKey("previewImage"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "availableCountries": return true; + case "alt": return false; - case "availableLanguages": return true; + case "id": return false; - case "country": return true; + case "image": return true; - case "language": return true; + case "mediaContentType": return false; + + case "presentation": return true; + + case "previewImage": return true; default: return false; } } } - public interface LocationQueryDefinition { - void define(LocationQuery _queryBuilder); + public interface MediaPresentationQueryDefinition { + void define(MediaPresentationQuery _queryBuilder); } /** - * Represents a location where product inventory is held. + * A media presentation. */ - public static class LocationQuery extends Query { - LocationQuery(StringBuilder _queryBuilder) { + public static class MediaPresentationQuery extends Query { + MediaPresentationQuery(StringBuilder _queryBuilder) { super(_queryBuilder); startField("id"); } /** - * The address of the location. + * A JSON object representing a presentation view. */ - public LocationQuery address(LocationAddressQueryDefinition queryDef) { - startField("address"); - - _queryBuilder.append('{'); - queryDef.define(new LocationAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MediaPresentationQuery asJson(MediaPresentationFormat format) { + startField("asJson"); - return this; - } + _queryBuilder.append("(format:"); + _queryBuilder.append(format.toString()); - /** - * The name of the location. - */ - public LocationQuery name() { - startField("name"); + _queryBuilder.append(')'); return this; } } /** - * Represents a location where product inventory is held. + * A media presentation. */ - public static class Location extends AbstractResponse implements Node { - public Location() { + public static class MediaPresentation extends AbstractResponse implements Node { + public MediaPresentation() { } - public Location(JsonObject fields) throws SchemaViolationError { + public MediaPresentation(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "address": { - responseData.put(key, new LocationAddress(jsonAsObject(field.getValue(), key))); + case "asJson": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } @@ -35777,12 +42896,6 @@ public Location(JsonObject fields) throws SchemaViolationError { break; } - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -35794,25 +42907,25 @@ public Location(JsonObject fields) throws SchemaViolationError { } } - public Location(ID id) { + public MediaPresentation(ID id) { this(); optimisticData.put("id", id); } public String getGraphQlTypeName() { - return "Location"; + return "MediaPresentation"; } /** - * The address of the location. + * A JSON object representing a presentation view. */ - public LocationAddress getAddress() { - return (LocationAddress) get("address"); + public String getAsJson() { + return (String) get("asJson"); } - public Location setAddress(LocationAddress arg) { - optimisticData.put(getKey("address"), arg); + public MediaPresentation setAsJson(String arg) { + optimisticData.put(getKey("asJson"), arg); return this; } @@ -35824,293 +42937,167 @@ public ID getId() { return (ID) get("id"); } - /** - * The name of the location. - */ - - public String getName() { - return (String) get("name"); - } - - public Location setName(String arg) { - optimisticData.put(getKey("name"), arg); - return this; - } - public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "address": return true; + case "asJson": return false; case "id": return false; - case "name": return false; - default: return false; } } } - public interface LocationAddressQueryDefinition { - void define(LocationAddressQuery _queryBuilder); - } - /** - * Represents the address of a location. + * The possible formats for a media presentation. */ - public static class LocationAddressQuery extends Query { - LocationAddressQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The first line of the address for the location. - */ - public LocationAddressQuery address1() { - startField("address1"); - - return this; - } - + public enum MediaPresentationFormat { /** - * The second line of the address for the location. + * A media image presentation. */ - public LocationAddressQuery address2() { - startField("address2"); - - return this; - } + IMAGE, /** - * The city of the location. + * A model viewer presentation. */ - public LocationAddressQuery city() { - startField("city"); + MODEL_VIEWER, - return this; - } + UNKNOWN_VALUE; - /** - * The country of the location. - */ - public LocationAddressQuery country() { - startField("country"); + public static MediaPresentationFormat fromGraphQl(String value) { + if (value == null) { + return null; + } - return this; - } + switch (value) { + case "IMAGE": { + return IMAGE; + } - /** - * The country code of the location. - */ - public LocationAddressQuery countryCode() { - startField("countryCode"); + case "MODEL_VIEWER": { + return MODEL_VIEWER; + } - return this; + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case IMAGE: { + return "IMAGE"; + } - /** - * A formatted version of the address for the location. - */ - public LocationAddressQuery formatted() { - startField("formatted"); + case MODEL_VIEWER: { + return "MODEL_VIEWER"; + } - return this; + default: { + return ""; + } + } } + } - /** - * The latitude coordinates of the location. - */ - public LocationAddressQuery latitude() { - startField("latitude"); - - return this; - } + public interface MenuQueryDefinition { + void define(MenuQuery _queryBuilder); + } - /** - * The longitude coordinates of the location. - */ - public LocationAddressQuery longitude() { - startField("longitude"); + /** + * A menu used for navigation within a storefront. + */ + public static class MenuQuery extends Query { + MenuQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - return this; + startField("id"); } /** - * The phone number of the location. + * The menu's handle. */ - public LocationAddressQuery phone() { - startField("phone"); + public MenuQuery handle() { + startField("handle"); return this; } /** - * The province of the location. + * The menu's child items. */ - public LocationAddressQuery province() { - startField("province"); - - return this; - } + public MenuQuery items(MenuItemQueryDefinition queryDef) { + startField("items"); - /** - * The code for the province, state, or district of the address of the location. - */ - public LocationAddressQuery provinceCode() { - startField("provinceCode"); + _queryBuilder.append('{'); + queryDef.define(new MenuItemQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The ZIP code of the location. + * The count of items on the menu. */ - public LocationAddressQuery zip() { - startField("zip"); - - return this; - } - } - - /** - * Represents the address of a location. - */ - public static class LocationAddress extends AbstractResponse { - public LocationAddress() { - } - - public LocationAddress(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "address1": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "address2": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "city": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "country": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "countryCode": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "formatted": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } - - responseData.put(key, list1); - - break; - } - - case "latitude": { - Double optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsDouble(field.getValue(), key); - } + public MenuQuery itemsCount() { + startField("itemsCount"); - responseData.put(key, optional1); + return this; + } - break; - } + /** + * The menu's title. + */ + public MenuQuery title() { + startField("title"); - case "longitude": { - Double optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsDouble(field.getValue(), key); - } + return this; + } + } - responseData.put(key, optional1); + /** + * A menu used for navigation within a storefront. + */ + public static class Menu extends AbstractResponse implements Node { + public Menu() { + } + + public Menu(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "phone": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); break; } - case "province": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "items": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new MenuItem(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "provinceCode": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "itemsCount": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); break; } - case "zip": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -36126,265 +43113,187 @@ public LocationAddress(JsonObject fields) throws SchemaViolationError { } } - public String getGraphQlTypeName() { - return "LocationAddress"; - } - - /** - * The first line of the address for the location. - */ - - public String getAddress1() { - return (String) get("address1"); + public Menu(ID id) { + this(); + optimisticData.put("id", id); } - public LocationAddress setAddress1(String arg) { - optimisticData.put(getKey("address1"), arg); - return this; + public String getGraphQlTypeName() { + return "Menu"; } /** - * The second line of the address for the location. + * The menu's handle. */ - public String getAddress2() { - return (String) get("address2"); + public String getHandle() { + return (String) get("handle"); } - public LocationAddress setAddress2(String arg) { - optimisticData.put(getKey("address2"), arg); + public Menu setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); return this; } /** - * The city of the location. + * A globally-unique identifier. */ - public String getCity() { - return (String) get("city"); - } - - public LocationAddress setCity(String arg) { - optimisticData.put(getKey("city"), arg); - return this; + public ID getId() { + return (ID) get("id"); } /** - * The country of the location. + * The menu's child items. */ - public String getCountry() { - return (String) get("country"); + public List getItems() { + return (List) get("items"); } - public LocationAddress setCountry(String arg) { - optimisticData.put(getKey("country"), arg); + public Menu setItems(List arg) { + optimisticData.put(getKey("items"), arg); return this; } /** - * The country code of the location. + * The count of items on the menu. */ - public String getCountryCode() { - return (String) get("countryCode"); + public Integer getItemsCount() { + return (Integer) get("itemsCount"); } - public LocationAddress setCountryCode(String arg) { - optimisticData.put(getKey("countryCode"), arg); + public Menu setItemsCount(Integer arg) { + optimisticData.put(getKey("itemsCount"), arg); return this; } /** - * A formatted version of the address for the location. + * The menu's title. */ - public List getFormatted() { - return (List) get("formatted"); + public String getTitle() { + return (String) get("title"); } - public LocationAddress setFormatted(List arg) { - optimisticData.put(getKey("formatted"), arg); + public Menu setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } - /** - * The latitude coordinates of the location. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "handle": return false; - public Double getLatitude() { - return (Double) get("latitude"); - } + case "id": return false; - public LocationAddress setLatitude(Double arg) { - optimisticData.put(getKey("latitude"), arg); - return this; - } + case "items": return true; - /** - * The longitude coordinates of the location. - */ + case "itemsCount": return false; - public Double getLongitude() { - return (Double) get("longitude"); - } + case "title": return false; - public LocationAddress setLongitude(Double arg) { - optimisticData.put(getKey("longitude"), arg); - return this; + default: return false; + } } + } - /** - * The phone number of the location. - */ + public interface MenuItemQueryDefinition { + void define(MenuItemQuery _queryBuilder); + } - public String getPhone() { - return (String) get("phone"); - } + /** + * A menu item within a parent menu. + */ + public static class MenuItemQuery extends Query { + MenuItemQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - public LocationAddress setPhone(String arg) { - optimisticData.put(getKey("phone"), arg); - return this; + startField("id"); } /** - * The province of the location. + * The menu item's child items. */ + public MenuItemQuery items(MenuItemQueryDefinition queryDef) { + startField("items"); - public String getProvince() { - return (String) get("province"); - } + _queryBuilder.append('{'); + queryDef.define(new MenuItemQuery(_queryBuilder)); + _queryBuilder.append('}'); - public LocationAddress setProvince(String arg) { - optimisticData.put(getKey("province"), arg); return this; } /** - * The code for the province, state, or district of the address of the location. + * The ID of the linked resource. */ + public MenuItemQuery resourceId() { + startField("resourceId"); - public String getProvinceCode() { - return (String) get("provinceCode"); - } - - public LocationAddress setProvinceCode(String arg) { - optimisticData.put(getKey("provinceCode"), arg); return this; } /** - * The ZIP code of the location. + * The menu item's tags to filter a collection. */ + public MenuItemQuery tags() { + startField("tags"); - public String getZip() { - return (String) get("zip"); - } - - public LocationAddress setZip(String arg) { - optimisticData.put(getKey("zip"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "address1": return false; - - case "address2": return false; - - case "city": return false; - - case "country": return false; - - case "countryCode": return false; - - case "formatted": return false; - - case "latitude": return false; - - case "longitude": return false; - - case "phone": return false; - - case "province": return false; - - case "provinceCode": return false; - - case "zip": return false; - - default: return false; - } - } - } - - public interface LocationConnectionQueryDefinition { - void define(LocationConnectionQuery _queryBuilder); - } - - /** - * An auto-generated type for paginating through multiple Locations. - */ - public static class LocationConnectionQuery extends Query { - LocationConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - /** - * A list of edges. + * The menu item's title. */ - public LocationConnectionQuery edges(LocationEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new LocationEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MenuItemQuery title() { + startField("title"); return this; } /** - * A list of the nodes contained in LocationEdge. + * The menu item's type. */ - public LocationConnectionQuery nodes(LocationQueryDefinition queryDef) { - startField("nodes"); - - _queryBuilder.append('{'); - queryDef.define(new LocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MenuItemQuery type() { + startField("type"); return this; } /** - * Information to aid in pagination. + * The menu item's URL. */ - public LocationConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MenuItemQuery url() { + startField("url"); return this; } } /** - * An auto-generated type for paginating through multiple Locations. + * A menu item within a parent menu. */ - public static class LocationConnection extends AbstractResponse { - public LocationConnection() { + public static class MenuItem extends AbstractResponse implements Node { + public MenuItem() { } - public LocationConnection(JsonObject fields) throws SchemaViolationError { + public MenuItem(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "items": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new LocationEdge(jsonAsObject(element1, key))); + list1.add(new MenuItem(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -36392,10 +43301,21 @@ public LocationConnection(JsonObject fields) throws SchemaViolationError { break; } - case "nodes": { - List list1 = new ArrayList<>(); + case "resourceId": { + ID optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ID(jsonAsString(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "tags": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Location(jsonAsObject(element1, key))); + list1.add(jsonAsString(element1, key)); } responseData.put(key, list1); @@ -36403,8 +43323,25 @@ public LocationConnection(JsonObject fields) throws SchemaViolationError { break; } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "type": { + responseData.put(key, MenuItemType.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "url": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } @@ -36420,219 +43357,231 @@ public LocationConnection(JsonObject fields) throws SchemaViolationError { } } + public MenuItem(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "LocationConnection"; + return "MenuItem"; } /** - * A list of edges. + * A globally-unique identifier. */ - public List getEdges() { - return (List) get("edges"); + public ID getId() { + return (ID) get("id"); } - public LocationConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); + /** + * The menu item's child items. + */ + + public List getItems() { + return (List) get("items"); + } + + public MenuItem setItems(List arg) { + optimisticData.put(getKey("items"), arg); return this; } /** - * A list of the nodes contained in LocationEdge. + * The ID of the linked resource. */ - public List getNodes() { - return (List) get("nodes"); + public ID getResourceId() { + return (ID) get("resourceId"); } - public LocationConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + public MenuItem setResourceId(ID arg) { + optimisticData.put(getKey("resourceId"), arg); return this; } /** - * Information to aid in pagination. + * The menu item's tags to filter a collection. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public List getTags() { + return (List) get("tags"); } - public LocationConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public MenuItem setTags(List arg) { + optimisticData.put(getKey("tags"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return true; - - case "pageInfo": return true; + /** + * The menu item's title. + */ - default: return false; - } + public String getTitle() { + return (String) get("title"); } - } - - public interface LocationEdgeQueryDefinition { - void define(LocationEdgeQuery _queryBuilder); - } - /** - * An auto-generated type which holds one Location and a cursor during pagination. - */ - public static class LocationEdgeQuery extends Query { - LocationEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public MenuItem setTitle(String arg) { + optimisticData.put(getKey("title"), arg); + return this; } /** - * A cursor for use in pagination. + * The menu item's type. */ - public LocationEdgeQuery cursor() { - startField("cursor"); + public MenuItemType getType() { + return (MenuItemType) get("type"); + } + + public MenuItem setType(MenuItemType arg) { + optimisticData.put(getKey("type"), arg); return this; } /** - * The item at the end of LocationEdge. + * The menu item's URL. */ - public LocationEdgeQuery node(LocationQueryDefinition queryDef) { - startField("node"); - _queryBuilder.append('{'); - queryDef.define(new LocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getUrl() { + return (String) get("url"); + } + public MenuItem setUrl(String arg) { + optimisticData.put(getKey("url"), arg); return this; } - } - /** - * An auto-generated type which holds one Location and a cursor during pagination. - */ - public static class LocationEdge extends AbstractResponse { - public LocationEdge() { - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "id": return false; - public LocationEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "items": return true; - break; - } + case "resourceId": return false; - case "node": { - responseData.put(key, new Location(jsonAsObject(field.getValue(), key))); + case "tags": return false; - break; - } + case "title": return false; - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + case "type": return false; - public String getGraphQlTypeName() { - return "LocationEdge"; + case "url": return false; + + default: return false; + } } + } + /** + * A menu item type. + */ + public enum MenuItemType { /** - * A cursor for use in pagination. + * An article link. */ + ARTICLE, - public String getCursor() { - return (String) get("cursor"); - } + /** + * A blog link. + */ + BLOG, - public LocationEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; - } + /** + * A catalog link. + */ + CATALOG, /** - * The item at the end of LocationEdge. + * A collection link. */ + COLLECTION, - public Location getNode() { - return (Location) get("node"); - } - - public LocationEdge setNode(Location arg) { - optimisticData.put(getKey("node"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; + /** + * A collection link. + */ + COLLECTIONS, - case "node": return true; + /** + * A frontpage link. + */ + FRONTPAGE, - default: return false; - } - } - } + /** + * An http link. + */ + HTTP, - /** - * The set of valid sort keys for the Location query. - */ - public enum LocationSortKeys { /** - * Sort by the `city` value. + * A page link. */ - CITY, + PAGE, /** - * Sort by the `distance` value. + * A product link. */ - DISTANCE, + PRODUCT, /** - * Sort by the `id` value. + * A search link. */ - ID, + SEARCH, /** - * Sort by the `name` value. + * A shop policy link. */ - NAME, + SHOP_POLICY, UNKNOWN_VALUE; - public static LocationSortKeys fromGraphQl(String value) { + public static MenuItemType fromGraphQl(String value) { if (value == null) { return null; } switch (value) { - case "CITY": { - return CITY; + case "ARTICLE": { + return ARTICLE; } - case "DISTANCE": { - return DISTANCE; + case "BLOG": { + return BLOG; } - case "ID": { - return ID; + case "CATALOG": { + return CATALOG; } - case "NAME": { - return NAME; + case "COLLECTION": { + return COLLECTION; + } + + case "COLLECTIONS": { + return COLLECTIONS; + } + + case "FRONTPAGE": { + return FRONTPAGE; + } + + case "HTTP": { + return HTTP; + } + + case "PAGE": { + return PAGE; + } + + case "PRODUCT": { + return PRODUCT; + } + + case "SEARCH": { + return SEARCH; + } + + case "SHOP_POLICY": { + return SHOP_POLICY; } default: { @@ -36642,20 +43591,48 @@ public static LocationSortKeys fromGraphQl(String value) { } public String toString() { switch (this) { - case CITY: { - return "CITY"; + case ARTICLE: { + return "ARTICLE"; } - case DISTANCE: { - return "DISTANCE"; + case BLOG: { + return "BLOG"; } - case ID: { - return "ID"; + case CATALOG: { + return "CATALOG"; } - case NAME: { - return "NAME"; + case COLLECTION: { + return "COLLECTION"; + } + + case COLLECTIONS: { + return "COLLECTIONS"; + } + + case FRONTPAGE: { + return "FRONTPAGE"; + } + + case HTTP: { + return "HTTP"; + } + + case PAGE: { + return "PAGE"; + } + + case PRODUCT: { + return "PRODUCT"; + } + + case SEARCH: { + return "SEARCH"; + } + + case SHOP_POLICY: { + return "SHOP_POLICY"; } default: { @@ -36665,345 +43642,285 @@ public String toString() { } } - public interface MailingAddressQueryDefinition { - void define(MailingAddressQuery _queryBuilder); + public interface MerchandiseQueryDefinition { + void define(MerchandiseQuery _queryBuilder); } /** - * Represents a mailing address for customers and shipping. + * The merchandise to be purchased at checkout. */ - public static class MailingAddressQuery extends Query { - MailingAddressQuery(StringBuilder _queryBuilder) { + public static class MerchandiseQuery extends Query { + MerchandiseQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - startField("id"); + startField("__typename"); } - /** - * The first line of the address. Typically the street address or PO Box number. - */ - public MailingAddressQuery address1() { - startField("address1"); - + public MerchandiseQuery onProductVariant(ProductVariantQueryDefinition queryDef) { + startInlineFragment("ProductVariant"); + queryDef.define(new ProductVariantQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } + } - /** - * The second line of the address. Typically the number of the apartment, suite, or unit. - */ - public MailingAddressQuery address2() { - startField("address2"); + public interface Merchandise { + String getGraphQlTypeName(); + } - return this; + /** + * The merchandise to be purchased at checkout. + */ + public static class UnknownMerchandise extends AbstractResponse implements Merchandise { + public UnknownMerchandise() { + } + + public UnknownMerchandise(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 Merchandise create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "ProductVariant": { + return new ProductVariant(fields); + } + + default: { + return new UnknownMerchandise(fields); + } + } + } + + public String getGraphQlTypeName() { + return (String) get("__typename"); + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + default: return false; + } + } + } + + public interface MetafieldQueryDefinition { + void define(MetafieldQuery _queryBuilder); + } + + /** + * Metafields represent custom metadata attached to a resource. Metafields can be sorted into + * namespaces and are + * comprised of keys, values, and value types. + */ + public static class MetafieldQuery extends Query { + MetafieldQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); } /** - * The name of the city, district, village, or town. + * The date and time when the storefront metafield was created. */ - public MailingAddressQuery city() { - startField("city"); + public MetafieldQuery createdAt() { + startField("createdAt"); return this; } /** - * The name of the customer's company or organization. + * The description of a metafield. */ - public MailingAddressQuery company() { - startField("company"); + public MetafieldQuery description() { + startField("description"); return this; } /** - * The name of the country. + * The key name for a metafield. */ - public MailingAddressQuery country() { - startField("country"); + public MetafieldQuery key() { + startField("key"); return this; } /** - * The two-letter code for the country of the address. - * For example, US. - * - * @deprecated Use `countryCodeV2` instead. + * The namespace for a metafield. */ - @Deprecated - public MailingAddressQuery countryCode() { - startField("countryCode"); + public MetafieldQuery namespace() { + startField("namespace"); return this; } /** - * The two-letter code for the country of the address. - * For example, US. + * The parent object that the metafield belongs to. */ - public MailingAddressQuery countryCodeV2() { - startField("countryCodeV2"); + public MetafieldQuery parentResource(MetafieldParentResourceQueryDefinition queryDef) { + startField("parentResource"); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldParentResourceQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The first name of the customer. + * Returns a reference object if the metafield definition's type is a resource reference. */ - public MailingAddressQuery firstName() { - startField("firstName"); + public MetafieldQuery reference(MetafieldReferenceQueryDefinition queryDef) { + startField("reference"); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldReferenceQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - public class FormattedArguments extends Arguments { - FormattedArguments(StringBuilder _queryBuilder) { + public class ReferencesArguments extends Arguments { + ReferencesArguments(StringBuilder _queryBuilder) { super(_queryBuilder, true); } /** - * Whether to include the customer's name in the formatted address. + * Returns up to the first `n` elements from the list. */ - public FormattedArguments withName(Boolean value) { + public ReferencesArguments first(Integer value) { if (value != null) { - startArgument("withName"); + startArgument("first"); _queryBuilder.append(value); } return this; } /** - * Whether to include the customer's company in the formatted address. + * Returns the elements that come after the specified cursor. */ - public FormattedArguments withCompany(Boolean value) { + public ReferencesArguments after(String value) { if (value != null) { - startArgument("withCompany"); - _queryBuilder.append(value); + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); } return this; } - } - - public interface FormattedArgumentsDefinition { - void define(FormattedArguments args); - } - - /** - * A formatted version of the address, customized by the provided arguments. - */ - public MailingAddressQuery formatted() { - return formatted(args -> {}); - } - - /** - * A formatted version of the address, customized by the provided arguments. - */ - public MailingAddressQuery formatted(FormattedArgumentsDefinition argsDef) { - startField("formatted"); - FormattedArguments args = new FormattedArguments(_queryBuilder); - argsDef.define(args); - FormattedArguments.end(args); - - return this; - } - - /** - * A comma-separated list of the values for city, province, and country. - */ - public MailingAddressQuery formattedArea() { - startField("formattedArea"); - - return this; - } - - /** - * The last name of the customer. - */ - public MailingAddressQuery lastName() { - startField("lastName"); - - return this; - } - - /** - * The latitude coordinate of the customer address. - */ - public MailingAddressQuery latitude() { - startField("latitude"); - - return this; - } - - /** - * The longitude coordinate of the customer address. - */ - public MailingAddressQuery longitude() { - startField("longitude"); + /** + * Returns up to the last `n` elements from the list. + */ + public ReferencesArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - return this; + /** + * Returns the elements that come before the specified cursor. + */ + public ReferencesArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } } - /** - * The full name of the customer, based on firstName and lastName. - */ - public MailingAddressQuery name() { - startField("name"); - - return this; + public interface ReferencesArgumentsDefinition { + void define(ReferencesArguments args); } /** - * A unique phone number for the customer. - * Formatted using E.164 standard. For example, _+16135551111_. + * A list of reference objects if the metafield's type is a resource reference list. */ - public MailingAddressQuery phone() { - startField("phone"); - - return this; + public MetafieldQuery references(MetafieldReferenceConnectionQueryDefinition queryDef) { + return references(args -> {}, queryDef); } /** - * The region of the address, such as the province, state, or district. + * A list of reference objects if the metafield's type is a resource reference list. */ - public MailingAddressQuery province() { - startField("province"); + public MetafieldQuery references(ReferencesArgumentsDefinition argsDef, MetafieldReferenceConnectionQueryDefinition queryDef) { + startField("references"); - return this; - } + ReferencesArguments args = new ReferencesArguments(_queryBuilder); + argsDef.define(args); + ReferencesArguments.end(args); - /** - * The two-letter code for the region. - * For example, ON. - */ - public MailingAddressQuery provinceCode() { - startField("provinceCode"); + _queryBuilder.append('{'); + queryDef.define(new MetafieldReferenceConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The zip or postal code of the address. + * The type name of the metafield. + * See the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). */ - public MailingAddressQuery zip() { - startField("zip"); - - return this; - } - } - - /** - * Represents a mailing address for customers and shipping. - */ - public static class MailingAddress extends AbstractResponse implements DeliveryAddress, Node { - public MailingAddress() { - } - - public MailingAddress(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "address1": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "address2": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "city": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "company": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "country": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "countryCode": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "countryCodeV2": { - CountryCode optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = CountryCode.fromGraphQl(jsonAsString(field.getValue(), key)); - } + public MetafieldQuery type() { + startField("type"); - responseData.put(key, optional1); + return this; + } - break; - } + /** + * The date and time when the storefront metafield was updated. + */ + public MetafieldQuery updatedAt() { + startField("updatedAt"); - case "firstName": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + return this; + } - responseData.put(key, optional1); + /** + * The value of a metafield. + */ + public MetafieldQuery value() { + startField("value"); - break; - } + return this; + } + } - case "formatted": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } + /** + * Metafields represent custom metadata attached to a resource. Metafields can be sorted into + * namespaces and are + * comprised of keys, values, and value types. + */ + public static class Metafield extends AbstractResponse implements Node { + public Metafield() { + } - responseData.put(key, list1); + public Metafield(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "createdAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); break; } - case "formattedArea": { + case "description": { String optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = jsonAsString(field.getValue(), key); @@ -37020,43 +43937,28 @@ public MailingAddress(JsonObject fields) throws SchemaViolationError { break; } - case "lastName": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "key": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "latitude": { - Double optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsDouble(field.getValue(), key); - } - - responseData.put(key, optional1); + case "namespace": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "longitude": { - Double optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsDouble(field.getValue(), key); - } - - responseData.put(key, optional1); + case "parentResource": { + responseData.put(key, UnknownMetafieldParentResource.create(jsonAsObject(field.getValue(), key))); break; } - case "name": { - String optional1 = null; + case "reference": { + MetafieldReference optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = UnknownMetafieldReference.create(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -37064,10 +43966,10 @@ public MailingAddress(JsonObject fields) throws SchemaViolationError { break; } - case "phone": { - String optional1 = null; + case "references": { + MetafieldReferenceConnection optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new MetafieldReferenceConnection(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -37075,35 +43977,20 @@ public MailingAddress(JsonObject fields) throws SchemaViolationError { break; } - case "province": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "type": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "provinceCode": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); break; } - case "zip": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "value": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -37119,400 +44006,733 @@ public MailingAddress(JsonObject fields) throws SchemaViolationError { } } - public MailingAddress(ID id) { + public Metafield(ID id) { this(); optimisticData.put("id", id); } public String getGraphQlTypeName() { - return "MailingAddress"; + return "Metafield"; } /** - * The first line of the address. Typically the street address or PO Box number. + * The date and time when the storefront metafield was created. */ - public String getAddress1() { - return (String) get("address1"); + public DateTime getCreatedAt() { + return (DateTime) get("createdAt"); } - public MailingAddress setAddress1(String arg) { - optimisticData.put(getKey("address1"), arg); + public Metafield setCreatedAt(DateTime arg) { + optimisticData.put(getKey("createdAt"), arg); return this; } /** - * The second line of the address. Typically the number of the apartment, suite, or unit. + * The description of a metafield. */ - public String getAddress2() { - return (String) get("address2"); + public String getDescription() { + return (String) get("description"); } - public MailingAddress setAddress2(String arg) { - optimisticData.put(getKey("address2"), arg); + public Metafield setDescription(String arg) { + optimisticData.put(getKey("description"), arg); return this; } /** - * The name of the city, district, village, or town. + * A globally-unique identifier. */ - public String getCity() { - return (String) get("city"); + public ID getId() { + return (ID) get("id"); } - public MailingAddress setCity(String arg) { - optimisticData.put(getKey("city"), arg); + /** + * The key name for a metafield. + */ + + public String getKey() { + return (String) get("key"); + } + + public Metafield setKey(String arg) { + optimisticData.put(getKey("key"), arg); return this; } /** - * The name of the customer's company or organization. + * The namespace for a metafield. */ - public String getCompany() { - return (String) get("company"); + public String getNamespace() { + return (String) get("namespace"); } - public MailingAddress setCompany(String arg) { - optimisticData.put(getKey("company"), arg); + public Metafield setNamespace(String arg) { + optimisticData.put(getKey("namespace"), arg); return this; } /** - * The name of the country. + * The parent object that the metafield belongs to. */ - public String getCountry() { - return (String) get("country"); + public MetafieldParentResource getParentResource() { + return (MetafieldParentResource) get("parentResource"); } - public MailingAddress setCountry(String arg) { - optimisticData.put(getKey("country"), arg); + public Metafield setParentResource(MetafieldParentResource arg) { + optimisticData.put(getKey("parentResource"), arg); return this; } /** - * The two-letter code for the country of the address. - * For example, US. - * - * @deprecated Use `countryCodeV2` instead. + * Returns a reference object if the metafield definition's type is a resource reference. */ - public String getCountryCode() { - return (String) get("countryCode"); + public MetafieldReference getReference() { + return (MetafieldReference) get("reference"); } - public MailingAddress setCountryCode(String arg) { - optimisticData.put(getKey("countryCode"), arg); + public Metafield setReference(MetafieldReference arg) { + optimisticData.put(getKey("reference"), arg); return this; } /** - * The two-letter code for the country of the address. - * For example, US. + * A list of reference objects if the metafield's type is a resource reference list. */ - public CountryCode getCountryCodeV2() { - return (CountryCode) get("countryCodeV2"); + public MetafieldReferenceConnection getReferences() { + return (MetafieldReferenceConnection) get("references"); } - public MailingAddress setCountryCodeV2(CountryCode arg) { - optimisticData.put(getKey("countryCodeV2"), arg); + public Metafield setReferences(MetafieldReferenceConnection arg) { + optimisticData.put(getKey("references"), arg); return this; } /** - * The first name of the customer. + * The type name of the metafield. + * See the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). */ - public String getFirstName() { - return (String) get("firstName"); + public String getType() { + return (String) get("type"); } - public MailingAddress setFirstName(String arg) { - optimisticData.put(getKey("firstName"), arg); + public Metafield setType(String arg) { + optimisticData.put(getKey("type"), arg); return this; } /** - * A formatted version of the address, customized by the provided arguments. + * The date and time when the storefront metafield was updated. */ - public List getFormatted() { - return (List) get("formatted"); + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); } - public MailingAddress setFormatted(List arg) { - optimisticData.put(getKey("formatted"), arg); + public Metafield setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); return this; } /** - * A comma-separated list of the values for city, province, and country. + * The value of a metafield. */ - public String getFormattedArea() { - return (String) get("formattedArea"); + public String getValue() { + return (String) get("value"); } - public MailingAddress setFormattedArea(String arg) { - optimisticData.put(getKey("formattedArea"), arg); + public Metafield setValue(String arg) { + optimisticData.put(getKey("value"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "createdAt": return false; + + case "description": return false; + + case "id": return false; + + case "key": return false; + + case "namespace": return false; + + case "parentResource": return false; + + case "reference": return false; + + case "references": return true; + + case "type": return false; + + case "updatedAt": return false; + + case "value": return false; + + default: return false; + } + } + } + + /** + * Possible error codes that can be returned by `MetafieldDeleteUserError`. + */ + public enum MetafieldDeleteErrorCode { /** - * A globally-unique identifier. + * The owner ID is invalid. */ + INVALID_OWNER, - public ID getId() { - return (ID) get("id"); + /** + * Metafield not found. + */ + METAFIELD_DOES_NOT_EXIST, + + UNKNOWN_VALUE; + + public static MetafieldDeleteErrorCode fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "INVALID_OWNER": { + return INVALID_OWNER; + } + + case "METAFIELD_DOES_NOT_EXIST": { + return METAFIELD_DOES_NOT_EXIST; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case INVALID_OWNER: { + return "INVALID_OWNER"; + } + + case METAFIELD_DOES_NOT_EXIST: { + return "METAFIELD_DOES_NOT_EXIST"; + } + + default: { + return ""; + } + } + } + } + + public interface MetafieldDeleteUserErrorQueryDefinition { + void define(MetafieldDeleteUserErrorQuery _queryBuilder); + } + + /** + * An error that occurs during the execution of cart metafield deletion. + */ + public static class MetafieldDeleteUserErrorQuery extends Query { + MetafieldDeleteUserErrorQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The last name of the customer. + * The error code. */ + public MetafieldDeleteUserErrorQuery code() { + startField("code"); - public String getLastName() { - return (String) get("lastName"); + return this; } - public MailingAddress setLastName(String arg) { - optimisticData.put(getKey("lastName"), arg); + /** + * The path to the input field that caused the error. + */ + public MetafieldDeleteUserErrorQuery field() { + startField("field"); + return this; } /** - * The latitude coordinate of the customer address. + * The error message. */ + public MetafieldDeleteUserErrorQuery message() { + startField("message"); - public Double getLatitude() { - return (Double) get("latitude"); + return this; } + } - public MailingAddress setLatitude(Double arg) { - optimisticData.put(getKey("latitude"), arg); + /** + * An error that occurs during the execution of cart metafield deletion. + */ + public static class MetafieldDeleteUserError extends AbstractResponse implements DisplayableError { + public MetafieldDeleteUserError() { + } + + public MetafieldDeleteUserError(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "code": { + MetafieldDeleteErrorCode optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = MetafieldDeleteErrorCode.fromGraphQl(jsonAsString(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "field": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + optional1 = list1; + } + + responseData.put(key, optional1); + + break; + } + + case "message": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "MetafieldDeleteUserError"; + } + + /** + * The error code. + */ + + public MetafieldDeleteErrorCode getCode() { + return (MetafieldDeleteErrorCode) get("code"); + } + + public MetafieldDeleteUserError setCode(MetafieldDeleteErrorCode arg) { + optimisticData.put(getKey("code"), arg); return this; } /** - * The longitude coordinate of the customer address. + * The path to the input field that caused the error. */ - public Double getLongitude() { - return (Double) get("longitude"); + public List getField() { + return (List) get("field"); } - public MailingAddress setLongitude(Double arg) { - optimisticData.put(getKey("longitude"), arg); + public MetafieldDeleteUserError setField(List arg) { + optimisticData.put(getKey("field"), arg); return this; } /** - * The full name of the customer, based on firstName and lastName. + * The error message. */ - public String getName() { - return (String) get("name"); + public String getMessage() { + return (String) get("message"); } - public MailingAddress setName(String arg) { - optimisticData.put(getKey("name"), arg); + public MetafieldDeleteUserError setMessage(String arg) { + optimisticData.put(getKey("message"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "code": return false; + + case "field": return false; + + case "message": return false; + + default: return false; + } + } + } + + public static class MetafieldFilter implements Serializable { + private String namespace; + + private String key; + + private String value; + + public MetafieldFilter(String namespace, String key, String value) { + this.namespace = namespace; + + this.key = key; + + this.value = value; + } + + public String getNamespace() { + return namespace; + } + + public MetafieldFilter setNamespace(String namespace) { + this.namespace = namespace; + return this; + } + + public String getKey() { + return key; + } + + public MetafieldFilter setKey(String key) { + this.key = key; + return this; + } + + public String getValue() { + return value; + } + + public MetafieldFilter setValue(String value) { + this.value = value; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("namespace:"); + Query.appendQuotedString(_queryBuilder, namespace.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("value:"); + Query.appendQuotedString(_queryBuilder, value.toString()); + + _queryBuilder.append('}'); + } + } + + public interface MetafieldParentResourceQueryDefinition { + void define(MetafieldParentResourceQuery _queryBuilder); + } + + /** + * A resource that the metafield belongs to. + */ + public static class MetafieldParentResourceQuery extends Query { + MetafieldParentResourceQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("__typename"); + } + + public MetafieldParentResourceQuery onArticle(ArticleQueryDefinition queryDef) { + startInlineFragment("Article"); + queryDef.define(new ArticleQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldParentResourceQuery onBlog(BlogQueryDefinition queryDef) { + startInlineFragment("Blog"); + queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * A unique phone number for the customer. - * Formatted using E.164 standard. For example, _+16135551111_. - */ - - public String getPhone() { - return (String) get("phone"); + public MetafieldParentResourceQuery onCart(CartQueryDefinition queryDef) { + startInlineFragment("Cart"); + queryDef.define(new CartQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public MailingAddress setPhone(String arg) { - optimisticData.put(getKey("phone"), arg); + public MetafieldParentResourceQuery onCollection(CollectionQueryDefinition queryDef) { + startInlineFragment("Collection"); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The region of the address, such as the province, state, or district. - */ - - public String getProvince() { - return (String) get("province"); + public MetafieldParentResourceQuery onCustomer(CustomerQueryDefinition queryDef) { + startInlineFragment("Customer"); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public MailingAddress setProvince(String arg) { - optimisticData.put(getKey("province"), arg); + public MetafieldParentResourceQuery onLocation(LocationQueryDefinition queryDef) { + startInlineFragment("Location"); + queryDef.define(new LocationQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The two-letter code for the region. - * For example, ON. - */ - - public String getProvinceCode() { - return (String) get("provinceCode"); + public MetafieldParentResourceQuery onMarket(MarketQueryDefinition queryDef) { + startInlineFragment("Market"); + queryDef.define(new MarketQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public MailingAddress setProvinceCode(String arg) { - optimisticData.put(getKey("provinceCode"), arg); + public MetafieldParentResourceQuery onOrder(OrderQueryDefinition queryDef) { + startInlineFragment("Order"); + queryDef.define(new OrderQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The zip or postal code of the address. - */ - - public String getZip() { - return (String) get("zip"); + public MetafieldParentResourceQuery onPage(PageQueryDefinition queryDef) { + startInlineFragment("Page"); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public MailingAddress setZip(String arg) { - optimisticData.put(getKey("zip"), arg); + public MetafieldParentResourceQuery onProduct(ProductQueryDefinition queryDef) { + startInlineFragment("Product"); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "address1": return false; + public MetafieldParentResourceQuery onProductVariant(ProductVariantQueryDefinition queryDef) { + startInlineFragment("ProductVariant"); + queryDef.define(new ProductVariantQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case "address2": return false; + public MetafieldParentResourceQuery onShop(ShopQueryDefinition queryDef) { + startInlineFragment("Shop"); + queryDef.define(new ShopQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + } - case "city": return false; + public interface MetafieldParentResource { + String getGraphQlTypeName(); + } - case "company": return false; + /** + * A resource that the metafield belongs to. + */ + public static class UnknownMetafieldParentResource extends AbstractResponse implements MetafieldParentResource { + public UnknownMetafieldParentResource() { + } - case "country": return false; + public UnknownMetafieldParentResource(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - case "countryCode": return false; + public static MetafieldParentResource create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "Article": { + return new Article(fields); + } - case "countryCodeV2": return false; + case "Blog": { + return new Blog(fields); + } - case "firstName": return false; + case "Cart": { + return new Cart(fields); + } - case "formatted": return false; + case "Collection": { + return new Collection(fields); + } - case "formattedArea": return false; + case "Customer": { + return new Customer(fields); + } - case "id": return false; + case "Location": { + return new Location(fields); + } - case "lastName": return false; + case "Market": { + return new Market(fields); + } - case "latitude": return false; + case "Order": { + return new Order(fields); + } - case "longitude": return false; + case "Page": { + return new Page(fields); + } - case "name": return false; + case "Product": { + return new Product(fields); + } - case "phone": return false; + case "ProductVariant": { + return new ProductVariant(fields); + } - case "province": return false; + case "Shop": { + return new Shop(fields); + } - case "provinceCode": return false; + default: { + return new UnknownMetafieldParentResource(fields); + } + } + } - case "zip": return false; + public String getGraphQlTypeName() { + return (String) get("__typename"); + } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { default: return false; } } } - public interface MailingAddressConnectionQueryDefinition { - void define(MailingAddressConnectionQuery _queryBuilder); + public interface MetafieldReferenceQueryDefinition { + void define(MetafieldReferenceQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple MailingAddresses. + * Returns the resource which is being referred to by a metafield. */ - public static class MailingAddressConnectionQuery extends Query { - MailingAddressConnectionQuery(StringBuilder _queryBuilder) { + public static class MetafieldReferenceQuery extends Query { + MetafieldReferenceQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - } - /** - * A list of edges. - */ - public MailingAddressConnectionQuery edges(MailingAddressEdgeQueryDefinition queryDef) { - startField("edges"); + startField("__typename"); + } - _queryBuilder.append('{'); - queryDef.define(new MailingAddressEdgeQuery(_queryBuilder)); + public MetafieldReferenceQuery onCollection(CollectionQueryDefinition queryDef) { + startInlineFragment("Collection"); + queryDef.define(new CollectionQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; + } + public MetafieldReferenceQuery onGenericFile(GenericFileQueryDefinition queryDef) { + startInlineFragment("GenericFile"); + queryDef.define(new GenericFileQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * A list of the nodes contained in MailingAddressEdge. - */ - public MailingAddressConnectionQuery nodes(MailingAddressQueryDefinition queryDef) { - startField("nodes"); + public MetafieldReferenceQuery onMediaImage(MediaImageQueryDefinition queryDef) { + startInlineFragment("MediaImage"); + queryDef.define(new MediaImageQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); + public MetafieldReferenceQuery onMetaobject(MetaobjectQueryDefinition queryDef) { + startInlineFragment("Metaobject"); + queryDef.define(new MetaobjectQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; + } + public MetafieldReferenceQuery onPage(PageQueryDefinition queryDef) { + startInlineFragment("Page"); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * Information to aid in pagination. - */ - public MailingAddressConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + public MetafieldReferenceQuery onProduct(ProductQueryDefinition queryDef) { + startInlineFragment("Product"); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); + public MetafieldReferenceQuery onProductVariant(ProductVariantQueryDefinition queryDef) { + startInlineFragment("ProductVariant"); + queryDef.define(new ProductVariantQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; + } + public MetafieldReferenceQuery onVideo(VideoQueryDefinition queryDef) { + startInlineFragment("Video"); + queryDef.define(new VideoQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } + public interface MetafieldReference { + String getGraphQlTypeName(); + } + /** - * An auto-generated type for paginating through multiple MailingAddresses. + * Returns the resource which is being referred to by a metafield. */ - public static class MailingAddressConnection extends AbstractResponse { - public MailingAddressConnection() { + public static class UnknownMetafieldReference extends AbstractResponse implements MetafieldReference { + public UnknownMetafieldReference() { } - public MailingAddressConnection(JsonObject fields) throws SchemaViolationError { + public UnknownMetafieldReference(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new MailingAddressEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new MailingAddress(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; @@ -37524,91 +44744,104 @@ public MailingAddressConnection(JsonObject fields) throws SchemaViolationError { } } - public String getGraphQlTypeName() { - return "MailingAddressConnection"; - } + public static MetafieldReference create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "Collection": { + return new Collection(fields); + } - /** - * A list of edges. - */ + case "GenericFile": { + return new GenericFile(fields); + } - public List getEdges() { - return (List) get("edges"); - } + case "MediaImage": { + return new MediaImage(fields); + } - public MailingAddressConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; - } + case "Metaobject": { + return new Metaobject(fields); + } - /** - * A list of the nodes contained in MailingAddressEdge. - */ + case "Page": { + return new Page(fields); + } - public List getNodes() { - return (List) get("nodes"); - } + case "Product": { + return new Product(fields); + } - public MailingAddressConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; - } + case "ProductVariant": { + return new ProductVariant(fields); + } - /** - * Information to aid in pagination. - */ + case "Video": { + return new Video(fields); + } - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + default: { + return new UnknownMetafieldReference(fields); + } + } } - public MailingAddressConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); - return this; + public String getGraphQlTypeName() { + return (String) get("__typename"); } 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 MailingAddressEdgeQueryDefinition { - void define(MailingAddressEdgeQuery _queryBuilder); + public interface MetafieldReferenceConnectionQueryDefinition { + void define(MetafieldReferenceConnectionQuery _queryBuilder); } /** - * An auto-generated type which holds one MailingAddress and a cursor during pagination. + * An auto-generated type for paginating through multiple MetafieldReferences. */ - public static class MailingAddressEdgeQuery extends Query { - MailingAddressEdgeQuery(StringBuilder _queryBuilder) { + public static class MetafieldReferenceConnectionQuery extends Query { + MetafieldReferenceConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A cursor for use in pagination. + * A list of edges. */ - public MailingAddressEdgeQuery cursor() { - startField("cursor"); + public MetafieldReferenceConnectionQuery edges(MetafieldReferenceEdgeQueryDefinition queryDef) { + startField("edges"); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldReferenceEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The item at the end of MailingAddressEdge. + * A list of the nodes contained in MetafieldReferenceEdge. */ - public MailingAddressEdgeQuery node(MailingAddressQueryDefinition queryDef) { - startField("node"); + public MetafieldReferenceConnectionQuery nodes(MetafieldReferenceQueryDefinition queryDef) { + startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); + queryDef.define(new MetafieldReferenceQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * Information to aid in pagination. + */ + public MetafieldReferenceConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); + + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -37616,523 +44849,299 @@ public MailingAddressEdgeQuery node(MailingAddressQueryDefinition queryDef) { } /** - * An auto-generated type which holds one MailingAddress and a cursor during pagination. + * An auto-generated type for paginating through multiple MetafieldReferences. */ - public static class MailingAddressEdge extends AbstractResponse { - public MailingAddressEdge() { + public static class MetafieldReferenceConnection extends AbstractResponse { + public MetafieldReferenceConnection() { } - public MailingAddressEdge(JsonObject fields) throws SchemaViolationError { + public MetafieldReferenceConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new MetafieldReferenceEdge(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } - case "node": { - responseData.put(key, new MailingAddress(jsonAsObject(field.getValue(), key))); + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(UnknownMetafieldReference.create(jsonAsObject(element1, key))); + } - break; - } + responseData.put(key, list1); - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "MailingAddressEdge"; - } - - /** - * A cursor for use in pagination. - */ - - public String getCursor() { - return (String) get("cursor"); - } - - public MailingAddressEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; - } - - /** - * The item at the end of MailingAddressEdge. - */ - - public MailingAddress getNode() { - return (MailingAddress) get("node"); - } - - public MailingAddressEdge setNode(MailingAddress 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 MailingAddressInput implements Serializable { - private Input address1 = Input.undefined(); - - private Input address2 = Input.undefined(); - - private Input city = Input.undefined(); - - private Input company = Input.undefined(); - - private Input country = Input.undefined(); - - private Input firstName = Input.undefined(); - - private Input lastName = Input.undefined(); - - private Input phone = Input.undefined(); - - private Input province = Input.undefined(); - - private Input zip = Input.undefined(); - - public String getAddress1() { - return address1.getValue(); - } - public Input getAddress1Input() { - return address1; - } + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - public MailingAddressInput setAddress1(String address1) { - this.address1 = Input.optional(address1); - return this; - } + break; + } - public MailingAddressInput setAddress1Input(Input address1) { - if (address1 == null) { - throw new IllegalArgumentException("Input can not be null"); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } } - this.address1 = address1; - return this; } - public String getAddress2() { - return address2.getValue(); + public String getGraphQlTypeName() { + return "MetafieldReferenceConnection"; } - public Input getAddress2Input() { - return address2; - } + /** + * A list of edges. + */ - public MailingAddressInput setAddress2(String address2) { - this.address2 = Input.optional(address2); - return this; + public List getEdges() { + return (List) get("edges"); } - public MailingAddressInput setAddress2Input(Input address2) { - if (address2 == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.address2 = address2; + public MetafieldReferenceConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } - public String getCity() { - return city.getValue(); - } - - public Input getCityInput() { - return city; - } + /** + * A list of the nodes contained in MetafieldReferenceEdge. + */ - public MailingAddressInput setCity(String city) { - this.city = Input.optional(city); - return this; + public List getNodes() { + return (List) get("nodes"); } - public MailingAddressInput setCityInput(Input city) { - if (city == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.city = city; + public MetafieldReferenceConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } - public String getCompany() { - return company.getValue(); - } - - public Input getCompanyInput() { - return company; - } + /** + * Information to aid in pagination. + */ - public MailingAddressInput setCompany(String company) { - this.company = Input.optional(company); - return this; + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public MailingAddressInput setCompanyInput(Input company) { - if (company == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.company = company; + public MetafieldReferenceConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } - public String getCountry() { - return country.getValue(); - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - public Input getCountryInput() { - return country; - } + case "nodes": return false; - public MailingAddressInput setCountry(String country) { - this.country = Input.optional(country); - return this; - } + case "pageInfo": return true; - public MailingAddressInput setCountryInput(Input country) { - if (country == null) { - throw new IllegalArgumentException("Input can not be null"); + default: return false; } - this.country = country; - return this; } + } - public String getFirstName() { - return firstName.getValue(); - } + public interface MetafieldReferenceEdgeQueryDefinition { + void define(MetafieldReferenceEdgeQuery _queryBuilder); + } - public Input getFirstNameInput() { - return firstName; + /** + * An auto-generated type which holds one MetafieldReference and a cursor during pagination. + */ + public static class MetafieldReferenceEdgeQuery extends Query { + MetafieldReferenceEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } - public MailingAddressInput setFirstName(String firstName) { - this.firstName = Input.optional(firstName); - return this; - } + /** + * A cursor for use in pagination. + */ + public MetafieldReferenceEdgeQuery cursor() { + startField("cursor"); - public MailingAddressInput setFirstNameInput(Input firstName) { - if (firstName == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.firstName = firstName; return this; } - public String getLastName() { - return lastName.getValue(); - } + /** + * The item at the end of MetafieldReferenceEdge. + */ + public MetafieldReferenceEdgeQuery node(MetafieldReferenceQueryDefinition queryDef) { + startField("node"); - public Input getLastNameInput() { - return lastName; - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldReferenceQuery(_queryBuilder)); + _queryBuilder.append('}'); - public MailingAddressInput setLastName(String lastName) { - this.lastName = Input.optional(lastName); return this; } + } - public MailingAddressInput setLastNameInput(Input lastName) { - if (lastName == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.lastName = lastName; - return this; + /** + * An auto-generated type which holds one MetafieldReference and a cursor during pagination. + */ + public static class MetafieldReferenceEdge extends AbstractResponse { + public MetafieldReferenceEdge() { } - public String getPhone() { - return phone.getValue(); - } + public MetafieldReferenceEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - public Input getPhoneInput() { - return phone; - } + break; + } - public MailingAddressInput setPhone(String phone) { - this.phone = Input.optional(phone); - return this; - } + case "node": { + responseData.put(key, UnknownMetafieldReference.create(jsonAsObject(field.getValue(), key))); - public MailingAddressInput setPhoneInput(Input phone) { - if (phone == null) { - throw new IllegalArgumentException("Input can not be null"); + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } } - this.phone = phone; - return this; } - public String getProvince() { - return province.getValue(); + public String getGraphQlTypeName() { + return "MetafieldReferenceEdge"; } - public Input getProvinceInput() { - return province; - } + /** + * A cursor for use in pagination. + */ - public MailingAddressInput setProvince(String province) { - this.province = Input.optional(province); - return this; + public String getCursor() { + return (String) get("cursor"); } - public MailingAddressInput setProvinceInput(Input province) { - if (province == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.province = province; + public MetafieldReferenceEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } - public String getZip() { - return zip.getValue(); - } - - public Input getZipInput() { - return zip; - } + /** + * The item at the end of MetafieldReferenceEdge. + */ - public MailingAddressInput setZip(String zip) { - this.zip = Input.optional(zip); - return this; + public MetafieldReference getNode() { + return (MetafieldReference) get("node"); } - public MailingAddressInput setZipInput(Input zip) { - if (zip == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.zip = zip; + public MetafieldReferenceEdge setNode(MetafieldReference arg) { + optimisticData.put(getKey("node"), arg); return this; } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - if (this.address1.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("address1:"); - if (address1.getValue() != null) { - Query.appendQuotedString(_queryBuilder, address1.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.address2.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("address2:"); - if (address2.getValue() != null) { - Query.appendQuotedString(_queryBuilder, address2.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.city.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("city:"); - if (city.getValue() != null) { - Query.appendQuotedString(_queryBuilder, city.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.company.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("company:"); - if (company.getValue() != null) { - Query.appendQuotedString(_queryBuilder, company.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.country.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("country:"); - if (country.getValue() != null) { - Query.appendQuotedString(_queryBuilder, country.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.firstName.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("firstName:"); - if (firstName.getValue() != null) { - Query.appendQuotedString(_queryBuilder, firstName.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.lastName.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("lastName:"); - if (lastName.getValue() != null) { - Query.appendQuotedString(_queryBuilder, lastName.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.phone.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("phone:"); - if (phone.getValue() != null) { - Query.appendQuotedString(_queryBuilder, phone.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - if (this.province.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("province:"); - if (province.getValue() != null) { - Query.appendQuotedString(_queryBuilder, province.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + case "node": return false; - if (this.zip.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("zip:"); - if (zip.getValue() != null) { - Query.appendQuotedString(_queryBuilder, zip.getValue().toString()); - } else { - _queryBuilder.append("null"); - } + default: return false; } - - _queryBuilder.append('}'); } } - public interface ManualDiscountApplicationQueryDefinition { - void define(ManualDiscountApplicationQuery _queryBuilder); + public interface MetafieldsSetUserErrorQueryDefinition { + void define(MetafieldsSetUserErrorQuery _queryBuilder); } /** - * Manual discount applications capture the intentions of a discount that was manually created. + * An error that occurs during the execution of `MetafieldsSet`. */ - public static class ManualDiscountApplicationQuery extends Query { - ManualDiscountApplicationQuery(StringBuilder _queryBuilder) { + public static class MetafieldsSetUserErrorQuery extends Query { + MetafieldsSetUserErrorQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The method by which the discount's value is allocated to its entitled items. - */ - public ManualDiscountApplicationQuery allocationMethod() { - startField("allocationMethod"); - - return this; - } - - /** - * The description of the application. - */ - public ManualDiscountApplicationQuery description() { - startField("description"); - - return this; - } - - /** - * Which lines of targetType that the discount is allocated over. + * The error code. */ - public ManualDiscountApplicationQuery targetSelection() { - startField("targetSelection"); + public MetafieldsSetUserErrorQuery code() { + startField("code"); return this; } /** - * The type of line that the discount is applicable towards. + * The index of the array element that's causing the error. */ - public ManualDiscountApplicationQuery targetType() { - startField("targetType"); + public MetafieldsSetUserErrorQuery elementIndex() { + startField("elementIndex"); return this; } /** - * The title of the application. + * The path to the input field that caused the error. */ - public ManualDiscountApplicationQuery title() { - startField("title"); + public MetafieldsSetUserErrorQuery field() { + startField("field"); return this; } /** - * The value of the discount application. + * The error message. */ - public ManualDiscountApplicationQuery value(PricingValueQueryDefinition queryDef) { - startField("value"); - - _queryBuilder.append('{'); - queryDef.define(new PricingValueQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MetafieldsSetUserErrorQuery message() { + startField("message"); return this; } } /** - * Manual discount applications capture the intentions of a discount that was manually created. + * An error that occurs during the execution of `MetafieldsSet`. */ - public static class ManualDiscountApplication extends AbstractResponse implements DiscountApplication { - public ManualDiscountApplication() { + public static class MetafieldsSetUserError extends AbstractResponse implements DisplayableError { + public MetafieldsSetUserError() { } - public ManualDiscountApplication(JsonObject fields) throws SchemaViolationError { + public MetafieldsSetUserError(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "allocationMethod": { - responseData.put(key, DiscountApplicationAllocationMethod.fromGraphQl(jsonAsString(field.getValue(), key))); + case "code": { + MetafieldsSetUserErrorCode optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = MetafieldsSetUserErrorCode.fromGraphQl(jsonAsString(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "description": { - String optional1 = null; + case "elementIndex": { + Integer optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = jsonAsInteger(field.getValue(), key); } responseData.put(key, optional1); @@ -38140,30 +45149,28 @@ public ManualDiscountApplication(JsonObject fields) throws SchemaViolationError break; } - case "targetSelection": { - responseData.put(key, DiscountApplicationTargetSelection.fromGraphQl(jsonAsString(field.getValue(), key))); + case "field": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } - break; - } + optional1 = list1; + } - case "targetType": { - responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); + responseData.put(key, optional1); break; } - case "title": { + case "message": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "value": { - responseData.put(key, UnknownPricingValue.create(jsonAsObject(field.getValue(), key))); - - break; - } - case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -38176,206 +45183,309 @@ public ManualDiscountApplication(JsonObject fields) throws SchemaViolationError } public String getGraphQlTypeName() { - return "ManualDiscountApplication"; + return "MetafieldsSetUserError"; } /** - * The method by which the discount's value is allocated to its entitled items. + * The error code. */ - public DiscountApplicationAllocationMethod getAllocationMethod() { - return (DiscountApplicationAllocationMethod) get("allocationMethod"); + public MetafieldsSetUserErrorCode getCode() { + return (MetafieldsSetUserErrorCode) get("code"); } - public ManualDiscountApplication setAllocationMethod(DiscountApplicationAllocationMethod arg) { - optimisticData.put(getKey("allocationMethod"), arg); + public MetafieldsSetUserError setCode(MetafieldsSetUserErrorCode arg) { + optimisticData.put(getKey("code"), arg); return this; } /** - * The description of the application. + * The index of the array element that's causing the error. */ - public String getDescription() { - return (String) get("description"); + public Integer getElementIndex() { + return (Integer) get("elementIndex"); } - public ManualDiscountApplication setDescription(String arg) { - optimisticData.put(getKey("description"), arg); + public MetafieldsSetUserError setElementIndex(Integer arg) { + optimisticData.put(getKey("elementIndex"), arg); + return this; + } + + /** + * The path to the input field that caused the error. + */ + + public List getField() { + return (List) get("field"); + } + + public MetafieldsSetUserError setField(List arg) { + optimisticData.put(getKey("field"), arg); + return this; + } + + /** + * The error message. + */ + + public String getMessage() { + return (String) get("message"); + } + + public MetafieldsSetUserError setMessage(String arg) { + optimisticData.put(getKey("message"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "code": return false; + + case "elementIndex": return false; + + case "field": return false; + + case "message": return false; + + default: return false; + } + } + } + + /** + * Possible error codes that can be returned by `MetafieldsSetUserError`. + */ + public enum MetafieldsSetUserErrorCode { + /** + * The input value is blank. + */ + BLANK, + + /** + * The input value isn't included in the list. + */ + INCLUSION, + + /** + * The owner ID is invalid. + */ + INVALID_OWNER, + + /** + * The type is invalid. + */ + INVALID_TYPE, + + /** + * The value is invalid for metafield type or for definition options. + */ + INVALID_VALUE, + + /** + * The input value should be less than or equal to the maximum value allowed. + */ + LESS_THAN_OR_EQUAL_TO, + + /** + * The input value needs to be blank. + */ + PRESENT, + /** - * Which lines of targetType that the discount is allocated over. + * The input value is too long. */ - - public DiscountApplicationTargetSelection getTargetSelection() { - return (DiscountApplicationTargetSelection) get("targetSelection"); - } - - public ManualDiscountApplication setTargetSelection(DiscountApplicationTargetSelection arg) { - optimisticData.put(getKey("targetSelection"), arg); - return this; - } + TOO_LONG, /** - * The type of line that the discount is applicable towards. + * The input value is too short. */ + TOO_SHORT, - public DiscountApplicationTargetType getTargetType() { - return (DiscountApplicationTargetType) get("targetType"); - } + UNKNOWN_VALUE; - public ManualDiscountApplication setTargetType(DiscountApplicationTargetType arg) { - optimisticData.put(getKey("targetType"), arg); - return this; - } + public static MetafieldsSetUserErrorCode fromGraphQl(String value) { + if (value == null) { + return null; + } - /** - * The title of the application. - */ + switch (value) { + case "BLANK": { + return BLANK; + } - public String getTitle() { - return (String) get("title"); - } + case "INCLUSION": { + return INCLUSION; + } - public ManualDiscountApplication setTitle(String arg) { - optimisticData.put(getKey("title"), arg); - return this; - } + case "INVALID_OWNER": { + return INVALID_OWNER; + } - /** - * The value of the discount application. - */ + case "INVALID_TYPE": { + return INVALID_TYPE; + } - public PricingValue getValue() { - return (PricingValue) get("value"); - } + case "INVALID_VALUE": { + return INVALID_VALUE; + } - public ManualDiscountApplication setValue(PricingValue arg) { - optimisticData.put(getKey("value"), arg); - return this; + case "LESS_THAN_OR_EQUAL_TO": { + return LESS_THAN_OR_EQUAL_TO; + } + + case "PRESENT": { + return PRESENT; + } + + case "TOO_LONG": { + return TOO_LONG; + } + + case "TOO_SHORT": { + return TOO_SHORT; + } + + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case BLANK: { + return "BLANK"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "allocationMethod": return false; + case INCLUSION: { + return "INCLUSION"; + } - case "description": return false; + case INVALID_OWNER: { + return "INVALID_OWNER"; + } - case "targetSelection": return false; + case INVALID_TYPE: { + return "INVALID_TYPE"; + } - case "targetType": return false; + case INVALID_VALUE: { + return "INVALID_VALUE"; + } - case "title": return false; + case LESS_THAN_OR_EQUAL_TO: { + return "LESS_THAN_OR_EQUAL_TO"; + } - case "value": return false; + case PRESENT: { + return "PRESENT"; + } - default: return false; + case TOO_LONG: { + return "TOO_LONG"; + } + + case TOO_SHORT: { + return "TOO_SHORT"; + } + + default: { + return ""; + } } } } - public interface MediaQueryDefinition { - void define(MediaQuery _queryBuilder); + public interface MetaobjectQueryDefinition { + void define(MetaobjectQuery _queryBuilder); } /** - * Represents a media interface. + * An instance of a user-defined model based on a MetaobjectDefinition. */ - public static class MediaQuery extends Query { - MediaQuery(StringBuilder _queryBuilder) { + public static class MetaobjectQuery extends Query { + MetaobjectQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - startField("__typename"); + startField("id"); } /** - * A word or phrase to share the nature or contents of a media. + * Accesses a field of the object by key. */ - public MediaQuery alt() { - startField("alt"); + public MetaobjectQuery field(String key, MetaobjectFieldQueryDefinition queryDef) { + startField("field"); - return this; - } + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); - /** - * The media content type. - */ - public MediaQuery mediaContentType() { - startField("mediaContentType"); + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new MetaobjectFieldQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The preview image for the media. + * All object fields with defined values. + * Omitted object keys can be assumed null, and no guarantees are made about field order. */ - public MediaQuery previewImage(ImageQueryDefinition queryDef) { - startField("previewImage"); + public MetaobjectQuery fields(MetaobjectFieldQueryDefinition queryDef) { + startField("fields"); _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); + queryDef.define(new MetaobjectFieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - public MediaQuery onExternalVideo(ExternalVideoQueryDefinition queryDef) { - startInlineFragment("ExternalVideo"); - queryDef.define(new ExternalVideoQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * The unique handle of the metaobject. Useful as a custom ID. + */ + public MetaobjectQuery handle() { + startField("handle"); - public MediaQuery onMediaImage(MediaImageQueryDefinition queryDef) { - startInlineFragment("MediaImage"); - queryDef.define(new MediaImageQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public MediaQuery onModel3d(Model3dQueryDefinition queryDef) { - startInlineFragment("Model3d"); - queryDef.define(new Model3dQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * The type of the metaobject. Defines the namespace of its associated metafields. + */ + public MetaobjectQuery type() { + startField("type"); - public MediaQuery onVideo(VideoQueryDefinition queryDef) { - startInlineFragment("Video"); - queryDef.define(new VideoQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - } - - public interface Media { - String getGraphQlTypeName(); - - String getAlt(); - MediaContentType getMediaContentType(); + /** + * The date and time when the metaobject was last updated. + */ + public MetaobjectQuery updatedAt() { + startField("updatedAt"); - Image getPreviewImage(); + return this; + } } /** - * Represents a media interface. + * An instance of a user-defined model based on a MetaobjectDefinition. */ - public static class UnknownMedia extends AbstractResponse implements Media { - public UnknownMedia() { + public static class Metaobject extends AbstractResponse implements MetafieldReference, Node { + public Metaobject() { } - public UnknownMedia(JsonObject fields) throws SchemaViolationError { + public Metaobject(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "alt": { - String optional1 = null; + case "field": { + MetaobjectField optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new MetaobjectField(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -38383,19 +45493,37 @@ public UnknownMedia(JsonObject fields) throws SchemaViolationError { break; } - case "mediaContentType": { - responseData.put(key, MediaContentType.fromGraphQl(jsonAsString(field.getValue(), key))); + case "fields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new MetaobjectField(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } - case "previewImage": { - Image optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); - } + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); - responseData.put(key, optional1); + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "type": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); break; } @@ -38411,120 +45539,141 @@ public UnknownMedia(JsonObject fields) throws SchemaViolationError { } } - public static Media create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "ExternalVideo": { - return new ExternalVideo(fields); - } + public Metaobject(ID id) { + this(); + optimisticData.put("id", id); + } - case "MediaImage": { - return new MediaImage(fields); - } + public String getGraphQlTypeName() { + return "Metaobject"; + } - case "Model3d": { - return new Model3d(fields); - } + /** + * Accesses a field of the object by key. + */ - case "Video": { - return new Video(fields); - } + public MetaobjectField getField() { + return (MetaobjectField) get("field"); + } - default: { - return new UnknownMedia(fields); - } - } + public Metaobject setField(MetaobjectField arg) { + optimisticData.put(getKey("field"), arg); + return this; } - public String getGraphQlTypeName() { - return (String) get("__typename"); + /** + * All object fields with defined values. + * Omitted object keys can be assumed null, and no guarantees are made about field order. + */ + + public List getFields() { + return (List) get("fields"); + } + + public Metaobject setFields(List arg) { + optimisticData.put(getKey("fields"), arg); + return this; } /** - * A word or phrase to share the nature or contents of a media. + * The unique handle of the metaobject. Useful as a custom ID. */ - public String getAlt() { - return (String) get("alt"); + public String getHandle() { + return (String) get("handle"); } - public UnknownMedia setAlt(String arg) { - optimisticData.put(getKey("alt"), arg); + public Metaobject setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); return this; } /** - * The media content type. + * A globally-unique identifier. */ - public MediaContentType getMediaContentType() { - return (MediaContentType) get("mediaContentType"); + public ID getId() { + return (ID) get("id"); } - public UnknownMedia setMediaContentType(MediaContentType arg) { - optimisticData.put(getKey("mediaContentType"), arg); + /** + * The type of the metaobject. Defines the namespace of its associated metafields. + */ + + public String getType() { + return (String) get("type"); + } + + public Metaobject setType(String arg) { + optimisticData.put(getKey("type"), arg); return this; } /** - * The preview image for the media. + * The date and time when the metaobject was last updated. */ - public Image getPreviewImage() { - return (Image) get("previewImage"); + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); } - public UnknownMedia setPreviewImage(Image arg) { - optimisticData.put(getKey("previewImage"), arg); + public Metaobject setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "alt": return false; + case "field": return true; - case "mediaContentType": return false; + case "fields": return true; - case "previewImage": return true; + case "handle": return false; + + case "id": return false; + + case "type": return false; + + case "updatedAt": return false; default: return false; } } } - public interface MediaConnectionQueryDefinition { - void define(MediaConnectionQuery _queryBuilder); + public interface MetaobjectConnectionQueryDefinition { + void define(MetaobjectConnectionQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple Media. + * An auto-generated type for paginating through multiple Metaobjects. */ - public static class MediaConnectionQuery extends Query { - MediaConnectionQuery(StringBuilder _queryBuilder) { + public static class MetaobjectConnectionQuery extends Query { + MetaobjectConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A list of edges. */ - public MediaConnectionQuery edges(MediaEdgeQueryDefinition queryDef) { + public MetaobjectConnectionQuery edges(MetaobjectEdgeQueryDefinition queryDef) { startField("edges"); _queryBuilder.append('{'); - queryDef.define(new MediaEdgeQuery(_queryBuilder)); + queryDef.define(new MetaobjectEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in MediaEdge. + * A list of the nodes contained in MetaobjectEdge. */ - public MediaConnectionQuery nodes(MediaQueryDefinition queryDef) { + public MetaobjectConnectionQuery nodes(MetaobjectQueryDefinition queryDef) { startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new MediaQuery(_queryBuilder)); + queryDef.define(new MetaobjectQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -38533,7 +45682,7 @@ public MediaConnectionQuery nodes(MediaQueryDefinition queryDef) { /** * Information to aid in pagination. */ - public MediaConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + public MetaobjectConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { startField("pageInfo"); _queryBuilder.append('{'); @@ -38545,21 +45694,21 @@ public MediaConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { } /** - * An auto-generated type for paginating through multiple Media. + * An auto-generated type for paginating through multiple Metaobjects. */ - public static class MediaConnection extends AbstractResponse { - public MediaConnection() { + public static class MetaobjectConnection extends AbstractResponse { + public MetaobjectConnection() { } - public MediaConnection(JsonObject fields) throws SchemaViolationError { + public MetaobjectConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { case "edges": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new MediaEdge(jsonAsObject(element1, key))); + list1.add(new MetaobjectEdge(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -38568,9 +45717,9 @@ public MediaConnection(JsonObject fields) throws SchemaViolationError { } case "nodes": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(UnknownMedia.create(jsonAsObject(element1, key))); + list1.add(new Metaobject(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -38596,31 +45745,31 @@ public MediaConnection(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "MediaConnection"; + return "MetaobjectConnection"; } /** * A list of edges. */ - public List getEdges() { - return (List) get("edges"); + public List getEdges() { + return (List) get("edges"); } - public MediaConnection setEdges(List arg) { + public MetaobjectConnection setEdges(List arg) { optimisticData.put(getKey("edges"), arg); return this; } /** - * A list of the nodes contained in MediaEdge. + * A list of the nodes contained in MetaobjectEdge. */ - public List getNodes() { - return (List) get("nodes"); + public List getNodes() { + return (List) get("nodes"); } - public MediaConnection setNodes(List arg) { + public MetaobjectConnection setNodes(List arg) { optimisticData.put(getKey("nodes"), arg); return this; } @@ -38633,7 +45782,7 @@ public PageInfo getPageInfo() { return (PageInfo) get("pageInfo"); } - public MediaConnection setPageInfo(PageInfo arg) { + public MetaobjectConnection setPageInfo(PageInfo arg) { optimisticData.put(getKey("pageInfo"), arg); return this; } @@ -38642,7 +45791,7 @@ public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "edges": return true; - case "nodes": return false; + case "nodes": return true; case "pageInfo": return true; @@ -38651,113 +45800,35 @@ public boolean unwrapsToObject(String key) { } } - /** - * The possible content types for a media object. - */ - public enum MediaContentType { - /** - * An externally hosted video. - */ - EXTERNAL_VIDEO, - - /** - * A Shopify hosted image. - */ - IMAGE, - - /** - * A 3d model. - */ - MODEL_3D, - - /** - * A Shopify hosted video. - */ - VIDEO, - - UNKNOWN_VALUE; - - public static MediaContentType fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "EXTERNAL_VIDEO": { - return EXTERNAL_VIDEO; - } - - case "IMAGE": { - return IMAGE; - } - - case "MODEL_3D": { - return MODEL_3D; - } - - case "VIDEO": { - return VIDEO; - } - - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case EXTERNAL_VIDEO: { - return "EXTERNAL_VIDEO"; - } - - case IMAGE: { - return "IMAGE"; - } - - case MODEL_3D: { - return "MODEL_3D"; - } - - case VIDEO: { - return "VIDEO"; - } - - default: { - return ""; - } - } - } - } - - public interface MediaEdgeQueryDefinition { - void define(MediaEdgeQuery _queryBuilder); + public interface MetaobjectEdgeQueryDefinition { + void define(MetaobjectEdgeQuery _queryBuilder); } /** - * An auto-generated type which holds one Media and a cursor during pagination. + * An auto-generated type which holds one Metaobject and a cursor during pagination. */ - public static class MediaEdgeQuery extends Query { - MediaEdgeQuery(StringBuilder _queryBuilder) { + public static class MetaobjectEdgeQuery extends Query { + MetaobjectEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A cursor for use in pagination. */ - public MediaEdgeQuery cursor() { + public MetaobjectEdgeQuery cursor() { startField("cursor"); return this; } /** - * The item at the end of MediaEdge. + * The item at the end of MetaobjectEdge. */ - public MediaEdgeQuery node(MediaQueryDefinition queryDef) { + public MetaobjectEdgeQuery node(MetaobjectQueryDefinition queryDef) { startField("node"); _queryBuilder.append('{'); - queryDef.define(new MediaQuery(_queryBuilder)); + queryDef.define(new MetaobjectQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -38765,13 +45836,13 @@ public MediaEdgeQuery node(MediaQueryDefinition queryDef) { } /** - * An auto-generated type which holds one Media and a cursor during pagination. + * An auto-generated type which holds one Metaobject and a cursor during pagination. */ - public static class MediaEdge extends AbstractResponse { - public MediaEdge() { + public static class MetaobjectEdge extends AbstractResponse { + public MetaobjectEdge() { } - public MediaEdge(JsonObject fields) throws SchemaViolationError { + public MetaobjectEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -38783,7 +45854,7 @@ public MediaEdge(JsonObject fields) throws SchemaViolationError { } case "node": { - responseData.put(key, UnknownMedia.create(jsonAsObject(field.getValue(), key))); + responseData.put(key, new Metaobject(jsonAsObject(field.getValue(), key))); break; } @@ -38800,7 +45871,7 @@ public MediaEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "MediaEdge"; + return "MetaobjectEdge"; } /** @@ -38811,20 +45882,20 @@ public String getCursor() { return (String) get("cursor"); } - public MediaEdge setCursor(String arg) { + public MetaobjectEdge setCursor(String arg) { optimisticData.put(getKey("cursor"), arg); return this; } /** - * The item at the end of MediaEdge. + * The item at the end of MetaobjectEdge. */ - public Media getNode() { - return (Media) get("node"); + public Metaobject getNode() { + return (Metaobject) get("node"); } - public MediaEdge setNode(Media arg) { + public MetaobjectEdge setNode(Metaobject arg) { optimisticData.put(getKey("node"), arg); return this; } @@ -38833,157 +45904,178 @@ public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "cursor": return false; - case "node": return false; + case "node": return true; default: return false; } } } + public interface MetaobjectFieldQueryDefinition { + void define(MetaobjectFieldQuery _queryBuilder); + } + /** - * Host for a Media Resource. + * Provides the value of a Metaobject field. */ - public enum MediaHost { + public static class MetaobjectFieldQuery extends Query { + MetaobjectFieldQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + /** - * Host for Vimeo embedded videos. + * The field key. */ - VIMEO, + public MetaobjectFieldQuery key() { + startField("key"); + + return this; + } /** - * Host for YouTube embedded videos. + * A referenced object if the field type is a resource reference. */ - YOUTUBE, + public MetaobjectFieldQuery reference(MetafieldReferenceQueryDefinition queryDef) { + startField("reference"); - UNKNOWN_VALUE; + _queryBuilder.append('{'); + queryDef.define(new MetafieldReferenceQuery(_queryBuilder)); + _queryBuilder.append('}'); - public static MediaHost fromGraphQl(String value) { - if (value == null) { - return null; - } + return this; + } - switch (value) { - case "VIMEO": { - return VIMEO; - } + public class ReferencesArguments extends Arguments { + ReferencesArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "YOUTUBE": { - return YOUTUBE; + /** + * Returns up to the first `n` elements from the list. + */ + public ReferencesArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); } + return this; + } - default: { - return UNKNOWN_VALUE; + /** + * Returns the elements that come after the specified cursor. + */ + public ReferencesArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } - } - public String toString() { - switch (this) { - case VIMEO: { - return "VIMEO"; - } - case YOUTUBE: { - return "YOUTUBE"; + /** + * Returns up to the last `n` elements from the list. + */ + public ReferencesArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); } + return this; + } - default: { - return ""; + /** + * Returns the elements that come before the specified cursor. + */ + public ReferencesArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } } - } - - public interface MediaImageQueryDefinition { - void define(MediaImageQuery _queryBuilder); - } - - /** - * Represents a Shopify hosted image. - */ - public static class MediaImageQuery extends Query { - MediaImageQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - startField("id"); + public interface ReferencesArgumentsDefinition { + void define(ReferencesArguments args); } /** - * A word or phrase to share the nature or contents of a media. + * A list of referenced objects if the field type is a resource reference list. */ - public MediaImageQuery alt() { - startField("alt"); - - return this; + public MetaobjectFieldQuery references(MetafieldReferenceConnectionQueryDefinition queryDef) { + return references(args -> {}, queryDef); } /** - * The image for the media. + * A list of referenced objects if the field type is a resource reference list. */ - public MediaImageQuery image(ImageQueryDefinition queryDef) { - startField("image"); + public MetaobjectFieldQuery references(ReferencesArgumentsDefinition argsDef, MetafieldReferenceConnectionQueryDefinition queryDef) { + startField("references"); + + ReferencesArguments args = new ReferencesArguments(_queryBuilder); + argsDef.define(args); + ReferencesArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); + queryDef.define(new MetafieldReferenceConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The media content type. + * The type name of the field. + * See the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). */ - public MediaImageQuery mediaContentType() { - startField("mediaContentType"); + public MetaobjectFieldQuery type() { + startField("type"); return this; } /** - * The preview image for the media. + * The field value. */ - public MediaImageQuery previewImage(ImageQueryDefinition queryDef) { - startField("previewImage"); - - _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MetaobjectFieldQuery value() { + startField("value"); return this; } } /** - * Represents a Shopify hosted image. + * Provides the value of a Metaobject field. */ - public static class MediaImage extends AbstractResponse implements Media, MetafieldReference, Node { - public MediaImage() { + public static class MetaobjectField extends AbstractResponse { + public MetaobjectField() { } - public MediaImage(JsonObject fields) throws SchemaViolationError { + public MetaobjectField(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "alt": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "key": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case "reference": { + MetafieldReference optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = UnknownMetafieldReference.create(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "image": { - Image optional1 = null; + case "references": { + MetafieldReferenceConnection optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); + optional1 = new MetafieldReferenceConnection(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -38991,16 +46083,16 @@ public MediaImage(JsonObject fields) throws SchemaViolationError { break; } - case "mediaContentType": { - responseData.put(key, MediaContentType.fromGraphQl(jsonAsString(field.getValue(), key))); + case "type": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "previewImage": { - Image optional1 = null; + case "value": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -39019,161 +46111,231 @@ public MediaImage(JsonObject fields) throws SchemaViolationError { } } - public MediaImage(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "MediaImage"; + return "MetaobjectField"; } /** - * A word or phrase to share the nature or contents of a media. + * The field key. */ - public String getAlt() { - return (String) get("alt"); + public String getKey() { + return (String) get("key"); } - public MediaImage setAlt(String arg) { - optimisticData.put(getKey("alt"), arg); + public MetaobjectField setKey(String arg) { + optimisticData.put(getKey("key"), arg); return this; } /** - * A globally-unique identifier. + * A referenced object if the field type is a resource reference. */ - public ID getId() { - return (ID) get("id"); + public MetafieldReference getReference() { + return (MetafieldReference) get("reference"); + } + + public MetaobjectField setReference(MetafieldReference arg) { + optimisticData.put(getKey("reference"), arg); + return this; } /** - * The image for the media. + * A list of referenced objects if the field type is a resource reference list. */ - public Image getImage() { - return (Image) get("image"); + public MetafieldReferenceConnection getReferences() { + return (MetafieldReferenceConnection) get("references"); } - public MediaImage setImage(Image arg) { - optimisticData.put(getKey("image"), arg); + public MetaobjectField setReferences(MetafieldReferenceConnection arg) { + optimisticData.put(getKey("references"), arg); return this; } /** - * The media content type. + * The type name of the field. + * See the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). */ - public MediaContentType getMediaContentType() { - return (MediaContentType) get("mediaContentType"); + public String getType() { + return (String) get("type"); } - public MediaImage setMediaContentType(MediaContentType arg) { - optimisticData.put(getKey("mediaContentType"), arg); + public MetaobjectField setType(String arg) { + optimisticData.put(getKey("type"), arg); return this; } /** - * The preview image for the media. + * The field value. */ - public Image getPreviewImage() { - return (Image) get("previewImage"); + public String getValue() { + return (String) get("value"); } - public MediaImage setPreviewImage(Image arg) { - optimisticData.put(getKey("previewImage"), arg); + public MetaobjectField setValue(String arg) { + optimisticData.put(getKey("value"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "alt": return false; + case "key": return false; - case "id": return false; + case "reference": return false; - case "image": return true; + case "references": return true; - case "mediaContentType": return false; + case "type": return false; - case "previewImage": return true; + case "value": return false; default: return false; } } } - public interface MenuQueryDefinition { - void define(MenuQuery _queryBuilder); + public static class MetaobjectHandleInput implements Serializable { + private String handle; + + private String type; + + public MetaobjectHandleInput(String handle, String type) { + this.handle = handle; + + this.type = type; + } + + public String getHandle() { + return handle; + } + + public MetaobjectHandleInput setHandle(String handle) { + this.handle = handle; + return this; + } + + public String getType() { + return type; + } + + public MetaobjectHandleInput setType(String type) { + this.type = type; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("handle:"); + Query.appendQuotedString(_queryBuilder, handle.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("type:"); + Query.appendQuotedString(_queryBuilder, type.toString()); + + _queryBuilder.append('}'); + } + } + + public interface Model3dQueryDefinition { + void define(Model3dQuery _queryBuilder); } /** - * A menu used for navigation within a storefront. + * Represents a Shopify hosted 3D model. */ - public static class MenuQuery extends Query { - MenuQuery(StringBuilder _queryBuilder) { + public static class Model3dQuery extends Query { + Model3dQuery(StringBuilder _queryBuilder) { super(_queryBuilder); startField("id"); } /** - * The menu's handle. + * A word or phrase to share the nature or contents of a media. */ - public MenuQuery handle() { - startField("handle"); + public Model3dQuery alt() { + startField("alt"); return this; } /** - * The menu's child items. + * The media content type. */ - public MenuQuery items(MenuItemQueryDefinition queryDef) { - startField("items"); + public Model3dQuery mediaContentType() { + startField("mediaContentType"); + + return this; + } + + /** + * The presentation for a media. + */ + public Model3dQuery presentation(MediaPresentationQueryDefinition queryDef) { + startField("presentation"); _queryBuilder.append('{'); - queryDef.define(new MenuItemQuery(_queryBuilder)); + queryDef.define(new MediaPresentationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The count of items on the menu. + * The preview image for the media. */ - public MenuQuery itemsCount() { - startField("itemsCount"); + public Model3dQuery previewImage(ImageQueryDefinition queryDef) { + startField("previewImage"); + + _queryBuilder.append('{'); + queryDef.define(new ImageQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The menu's title. + * The sources for a 3d model. */ - public MenuQuery title() { - startField("title"); + public Model3dQuery sources(Model3dSourceQueryDefinition queryDef) { + startField("sources"); + + _queryBuilder.append('{'); + queryDef.define(new Model3dSourceQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * A menu used for navigation within a storefront. + * Represents a Shopify hosted 3D model. */ - public static class Menu extends AbstractResponse implements Node { - public Menu() { + public static class Model3d extends AbstractResponse implements Media, Node { + public Model3d() { } - public Menu(JsonObject fields) throws SchemaViolationError { + public Model3d(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "handle": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "alt": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } @@ -39184,25 +46346,41 @@ public Menu(JsonObject fields) throws SchemaViolationError { break; } - case "items": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new MenuItem(jsonAsObject(element1, key))); + case "mediaContentType": { + responseData.put(key, MediaContentType.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "presentation": { + MediaPresentation optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MediaPresentation(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "itemsCount": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + case "previewImage": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "sources": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Model3dSource(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } @@ -39218,25 +46396,25 @@ public Menu(JsonObject fields) throws SchemaViolationError { } } - public Menu(ID id) { + public Model3d(ID id) { this(); optimisticData.put("id", id); } public String getGraphQlTypeName() { - return "Menu"; + return "Model3d"; } /** - * The menu's handle. + * A word or phrase to share the nature or contents of a media. */ - public String getHandle() { - return (String) get("handle"); + public String getAlt() { + return (String) get("alt"); } - public Menu setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); + public Model3d setAlt(String arg) { + optimisticData.put(getKey("alt"), arg); return this; } @@ -39249,128 +46427,119 @@ public ID getId() { } /** - * The menu's child items. + * The media content type. */ - public List getItems() { - return (List) get("items"); + public MediaContentType getMediaContentType() { + return (MediaContentType) get("mediaContentType"); } - public Menu setItems(List arg) { - optimisticData.put(getKey("items"), arg); + public Model3d setMediaContentType(MediaContentType arg) { + optimisticData.put(getKey("mediaContentType"), arg); return this; } /** - * The count of items on the menu. + * The presentation for a media. */ - public Integer getItemsCount() { - return (Integer) get("itemsCount"); + public MediaPresentation getPresentation() { + return (MediaPresentation) get("presentation"); } - public Menu setItemsCount(Integer arg) { - optimisticData.put(getKey("itemsCount"), arg); + public Model3d setPresentation(MediaPresentation arg) { + optimisticData.put(getKey("presentation"), arg); return this; } /** - * The menu's title. + * The preview image for the media. */ - public String getTitle() { - return (String) get("title"); + public Image getPreviewImage() { + return (Image) get("previewImage"); } - public Menu setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public Model3d setPreviewImage(Image arg) { + optimisticData.put(getKey("previewImage"), arg); + return this; + } + + /** + * The sources for a 3d model. + */ + + public List getSources() { + return (List) get("sources"); + } + + public Model3d setSources(List arg) { + optimisticData.put(getKey("sources"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "handle": return false; + case "alt": return false; case "id": return false; - case "items": return true; + case "mediaContentType": return false; - case "itemsCount": return false; + case "presentation": return true; - case "title": return false; + case "previewImage": return true; + + case "sources": return true; default: return false; } } } - public interface MenuItemQueryDefinition { - void define(MenuItemQuery _queryBuilder); + public interface Model3dSourceQueryDefinition { + void define(Model3dSourceQuery _queryBuilder); } /** - * A menu item within a parent menu. + * Represents a source for a Shopify hosted 3d model. */ - public static class MenuItemQuery extends Query { - MenuItemQuery(StringBuilder _queryBuilder) { + public static class Model3dSourceQuery extends Query { + Model3dSourceQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("id"); } /** - * The menu item's child items. - */ - public MenuItemQuery items(MenuItemQueryDefinition queryDef) { - startField("items"); - - _queryBuilder.append('{'); - queryDef.define(new MenuItemQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The ID of the linked resource. - */ - public MenuItemQuery resourceId() { - startField("resourceId"); - - return this; - } - - /** - * The menu item's tags to filter a collection. + * The filesize of the 3d model. */ - public MenuItemQuery tags() { - startField("tags"); + public Model3dSourceQuery filesize() { + startField("filesize"); return this; } /** - * The menu item's title. + * The format of the 3d model. */ - public MenuItemQuery title() { - startField("title"); + public Model3dSourceQuery format() { + startField("format"); return this; } /** - * The menu item's type. + * The MIME type of the 3d model. */ - public MenuItemQuery type() { - startField("type"); + public Model3dSourceQuery mimeType() { + startField("mimeType"); return this; } /** - * The menu item's URL. + * The URL of the 3d model. */ - public MenuItemQuery url() { + public Model3dSourceQuery url() { startField("url"); return this; @@ -39378,75 +46547,37 @@ public MenuItemQuery url() { } /** - * A menu item within a parent menu. + * Represents a source for a Shopify hosted 3d model. */ - public static class MenuItem extends AbstractResponse implements Node { - public MenuItem() { + public static class Model3dSource extends AbstractResponse { + public Model3dSource() { } - public MenuItem(JsonObject fields) throws SchemaViolationError { + public Model3dSource(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 "items": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new MenuItem(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "resourceId": { - ID optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ID(jsonAsString(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "tags": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } - - responseData.put(key, list1); + case "filesize": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); break; } - case "title": { + case "format": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "type": { - responseData.put(key, MenuItemType.fromGraphQl(jsonAsString(field.getValue(), key))); + case "mimeType": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } case "url": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -39462,1568 +46593,1700 @@ public MenuItem(JsonObject fields) throws SchemaViolationError { } } - public MenuItem(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "MenuItem"; - } - - /** - * A globally-unique identifier. - */ - - public ID getId() { - return (ID) get("id"); + return "Model3dSource"; } /** - * The menu item's child items. + * The filesize of the 3d model. */ - public List getItems() { - return (List) get("items"); + public Integer getFilesize() { + return (Integer) get("filesize"); } - public MenuItem setItems(List arg) { - optimisticData.put(getKey("items"), arg); + public Model3dSource setFilesize(Integer arg) { + optimisticData.put(getKey("filesize"), arg); return this; } /** - * The ID of the linked resource. + * The format of the 3d model. */ - public ID getResourceId() { - return (ID) get("resourceId"); + public String getFormat() { + return (String) get("format"); } - public MenuItem setResourceId(ID arg) { - optimisticData.put(getKey("resourceId"), arg); + public Model3dSource setFormat(String arg) { + optimisticData.put(getKey("format"), arg); return this; } /** - * The menu item's tags to filter a collection. + * The MIME type of the 3d model. */ - public List getTags() { - return (List) get("tags"); + public String getMimeType() { + return (String) get("mimeType"); } - public MenuItem setTags(List arg) { - optimisticData.put(getKey("tags"), arg); + public Model3dSource setMimeType(String arg) { + optimisticData.put(getKey("mimeType"), arg); return this; } /** - * The menu item's title. + * The URL of the 3d model. */ - public String getTitle() { - return (String) get("title"); + public String getUrl() { + return (String) get("url"); } - public MenuItem setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public Model3dSource setUrl(String arg) { + optimisticData.put(getKey("url"), arg); return this; } - /** - * The menu item's type. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "filesize": return false; - public MenuItemType getType() { - return (MenuItemType) get("type"); - } + case "format": return false; - public MenuItem setType(MenuItemType arg) { - optimisticData.put(getKey("type"), arg); - return this; - } + case "mimeType": return false; - /** - * The menu item's URL. - */ + case "url": return false; - public String getUrl() { - return (String) get("url"); + default: return false; + } } + } - public MenuItem setUrl(String arg) { - optimisticData.put(getKey("url"), arg); - return this; + public static class MoneyInput implements Serializable { + private String amount; + + private CurrencyCode currencyCode; + + public MoneyInput(String amount, CurrencyCode currencyCode) { + this.amount = amount; + + this.currencyCode = currencyCode; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "id": return false; + public String getAmount() { + return amount; + } - case "items": return true; + public MoneyInput setAmount(String amount) { + this.amount = amount; + return this; + } - case "resourceId": return false; + public CurrencyCode getCurrencyCode() { + return currencyCode; + } - case "tags": return false; + public MoneyInput setCurrencyCode(CurrencyCode currencyCode) { + this.currencyCode = currencyCode; + return this; + } - case "title": return false; + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - case "type": return false; + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("amount:"); + Query.appendQuotedString(_queryBuilder, amount.toString()); - case "url": return false; + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("currencyCode:"); + _queryBuilder.append(currencyCode.toString()); - default: return false; - } + _queryBuilder.append('}'); } } + public interface MoneyV2QueryDefinition { + void define(MoneyV2Query _queryBuilder); + } + /** - * A menu item type. + * A monetary value with currency. */ - public enum MenuItemType { - /** - * An article link. - */ - ARTICLE, + public static class MoneyV2Query extends Query { + MoneyV2Query(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * A blog link. + * Decimal money amount. */ - BLOG, + public MoneyV2Query amount() { + startField("amount"); - /** - * A catalog link. - */ - CATALOG, + return this; + } /** - * A collection link. + * Currency of the money. */ - COLLECTION, + public MoneyV2Query currencyCode() { + startField("currencyCode"); - /** - * A collection link. - */ - COLLECTIONS, + return this; + } + } - /** - * A frontpage link. - */ - FRONTPAGE, + /** + * A monetary value with currency. + */ + public static class MoneyV2 extends AbstractResponse implements PricingValue, SellingPlanCheckoutChargeValue { + public MoneyV2() { + } - /** - * An http link. - */ - HTTP, + public MoneyV2(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "amount": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * A page link. - */ - PAGE, + break; + } - /** - * A product link. - */ - PRODUCT, + case "currencyCode": { + responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); - /** - * A search link. - */ - SEARCH, + break; + } - /** - * A shop policy link. - */ - SHOP_POLICY, + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - UNKNOWN_VALUE; + public String getGraphQlTypeName() { + return "MoneyV2"; + } - public static MenuItemType fromGraphQl(String value) { - if (value == null) { - return null; - } + /** + * Decimal money amount. + */ - switch (value) { - case "ARTICLE": { - return ARTICLE; - } + public String getAmount() { + return (String) get("amount"); + } - case "BLOG": { - return BLOG; - } + public MoneyV2 setAmount(String arg) { + optimisticData.put(getKey("amount"), arg); + return this; + } - case "CATALOG": { - return CATALOG; - } + /** + * Currency of the money. + */ - case "COLLECTION": { - return COLLECTION; - } + public CurrencyCode getCurrencyCode() { + return (CurrencyCode) get("currencyCode"); + } - case "COLLECTIONS": { - return COLLECTIONS; - } + public MoneyV2 setCurrencyCode(CurrencyCode arg) { + optimisticData.put(getKey("currencyCode"), arg); + return this; + } - case "FRONTPAGE": { - return FRONTPAGE; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "amount": return false; - case "HTTP": { - return HTTP; - } + case "currencyCode": return false; - case "PAGE": { - return PAGE; - } + default: return false; + } + } + } - case "PRODUCT": { - return PRODUCT; - } + public interface MutationQueryDefinition { + void define(MutationQuery _queryBuilder); + } - case "SEARCH": { - return SEARCH; - } + /** + * The schema’s entry-point for mutations. This acts as the public, top-level API from which all + * mutation queries must start. + */ + public static class MutationQuery extends Query { + MutationQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "SHOP_POLICY": { - return SHOP_POLICY; - } + /** + * Updates the attributes on a cart. + */ + public MutationQuery cartAttributesUpdate(List attributes, ID cartId, CartAttributesUpdatePayloadQueryDefinition queryDef) { + startField("cartAttributesUpdate"); - default: { - return UNKNOWN_VALUE; + _queryBuilder.append("(attributes:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (AttributeInput item1 : attributes) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); } } - } - public String toString() { - switch (this) { - case ARTICLE: { - return "ARTICLE"; - } + _queryBuilder.append(']'); - case BLOG: { - return "BLOG"; - } + _queryBuilder.append(",cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); - case CATALOG: { - return "CATALOG"; - } + _queryBuilder.append(')'); - case COLLECTION: { - return "COLLECTION"; - } + _queryBuilder.append('{'); + queryDef.define(new CartAttributesUpdatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - case COLLECTIONS: { - return "COLLECTIONS"; - } + return this; + } - case FRONTPAGE: { - return "FRONTPAGE"; - } + /** + * Updates customer information associated with a cart. + * Buyer identity is used to determine + * [international + * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing) + * and should match the customer's shipping address. + */ + public MutationQuery cartBuyerIdentityUpdate(ID cartId, CartBuyerIdentityInput buyerIdentity, CartBuyerIdentityUpdatePayloadQueryDefinition queryDef) { + startField("cartBuyerIdentityUpdate"); - case HTTP: { - return "HTTP"; - } + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); - case PAGE: { - return "PAGE"; - } + _queryBuilder.append(",buyerIdentity:"); + buyerIdentity.appendTo(_queryBuilder); - case PRODUCT: { - return "PRODUCT"; - } + _queryBuilder.append(')'); - case SEARCH: { - return "SEARCH"; - } + _queryBuilder.append('{'); + queryDef.define(new CartBuyerIdentityUpdatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - case SHOP_POLICY: { - return "SHOP_POLICY"; - } + return this; + } - default: { - return ""; + public class CartCreateArguments extends Arguments { + CartCreateArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * The fields used to create a cart. + */ + public CartCreateArguments input(CartInput value) { + if (value != null) { + startArgument("input"); + value.appendTo(_queryBuilder); } + return this; } } - } - - public interface MerchandiseQueryDefinition { - void define(MerchandiseQuery _queryBuilder); - } - - /** - * The merchandise to be purchased at checkout. - */ - public static class MerchandiseQuery extends Query { - MerchandiseQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - startField("__typename"); + public interface CartCreateArgumentsDefinition { + void define(CartCreateArguments args); } - public MerchandiseQuery onProductVariant(ProductVariantQueryDefinition queryDef) { - startInlineFragment("ProductVariant"); - queryDef.define(new ProductVariantQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + /** + * Creates a new cart. + */ + public MutationQuery cartCreate(CartCreatePayloadQueryDefinition queryDef) { + return cartCreate(args -> {}, queryDef); } - } - public interface Merchandise { - String getGraphQlTypeName(); - } + /** + * Creates a new cart. + */ + public MutationQuery cartCreate(CartCreateArgumentsDefinition argsDef, CartCreatePayloadQueryDefinition queryDef) { + startField("cartCreate"); - /** - * The merchandise to be purchased at checkout. - */ - public static class UnknownMerchandise extends AbstractResponse implements Merchandise { - public UnknownMerchandise() { + CartCreateArguments args = new CartCreateArguments(_queryBuilder); + argsDef.define(args); + CartCreateArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new CartCreatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } - public UnknownMerchandise(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 class CartDiscountCodesUpdateArguments extends Arguments { + CartDiscountCodesUpdateArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); } - } - - public static Merchandise create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "ProductVariant": { - return new ProductVariant(fields); - } - default: { - return new UnknownMerchandise(fields); + /** + * The case-insensitive discount codes that the customer added at checkout. + */ + public CartDiscountCodesUpdateArguments discountCodes(List value) { + if (value != null) { + startArgument("discountCodes"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (String item1 : value) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + Query.appendQuotedString(_queryBuilder, item1.toString()); + } + } + _queryBuilder.append(']'); } + return this; } } - public String getGraphQlTypeName() { - return (String) get("__typename"); + public interface CartDiscountCodesUpdateArgumentsDefinition { + void define(CartDiscountCodesUpdateArguments args); } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - default: return false; - } + /** + * Updates the discount codes applied to the cart. + */ + public MutationQuery cartDiscountCodesUpdate(ID cartId, CartDiscountCodesUpdatePayloadQueryDefinition queryDef) { + return cartDiscountCodesUpdate(cartId, args -> {}, queryDef); } - } - public interface MetafieldQueryDefinition { - void define(MetafieldQuery _queryBuilder); - } + /** + * Updates the discount codes applied to the cart. + */ + public MutationQuery cartDiscountCodesUpdate(ID cartId, CartDiscountCodesUpdateArgumentsDefinition argsDef, CartDiscountCodesUpdatePayloadQueryDefinition queryDef) { + startField("cartDiscountCodesUpdate"); - /** - * Metafields represent custom metadata attached to a resource. Metafields can be sorted into - * namespaces and are - * comprised of keys, values, and value types. - */ - public static class MetafieldQuery extends Query { - MetafieldQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); - startField("id"); - } + argsDef.define(new CartDiscountCodesUpdateArguments(_queryBuilder)); - /** - * The date and time when the storefront metafield was created. - */ - public MetafieldQuery createdAt() { - startField("createdAt"); + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CartDiscountCodesUpdatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The description of a metafield. + * Adds a merchandise line to the cart. */ - public MetafieldQuery description() { - startField("description"); + public MutationQuery cartLinesAdd(List lines, ID cartId, CartLinesAddPayloadQueryDefinition queryDef) { + startField("cartLinesAdd"); - return this; - } + _queryBuilder.append("(lines:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (CartLineInput item1 : lines) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); - /** - * The key name for a metafield. - */ - public MetafieldQuery key() { - startField("key"); + _queryBuilder.append(",cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CartLinesAddPayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The namespace for a metafield. + * Removes one or more merchandise lines from the cart. */ - public MetafieldQuery namespace() { - startField("namespace"); + public MutationQuery cartLinesRemove(ID cartId, List lineIds, CartLinesRemovePayloadQueryDefinition queryDef) { + startField("cartLinesRemove"); + + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); + + _queryBuilder.append(",lineIds:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ID item1 : lineIds) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + Query.appendQuotedString(_queryBuilder, item1.toString()); + } + } + _queryBuilder.append(']'); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CartLinesRemovePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The parent object that the metafield belongs to. + * Updates one or more merchandise lines on a cart. */ - public MetafieldQuery parentResource(MetafieldParentResourceQueryDefinition queryDef) { - startField("parentResource"); + public MutationQuery cartLinesUpdate(ID cartId, List lines, CartLinesUpdatePayloadQueryDefinition queryDef) { + startField("cartLinesUpdate"); + + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); + + _queryBuilder.append(",lines:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (CartLineUpdateInput item1 : lines) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new MetafieldParentResourceQuery(_queryBuilder)); + queryDef.define(new CartLinesUpdatePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Returns a reference object if the metafield definition's type is a resource reference. + * Deletes a cart metafield. */ - public MetafieldQuery reference(MetafieldReferenceQueryDefinition queryDef) { - startField("reference"); + public MutationQuery cartMetafieldDelete(CartMetafieldDeleteInput input, CartMetafieldDeletePayloadQueryDefinition queryDef) { + startField("cartMetafieldDelete"); + + _queryBuilder.append("(input:"); + input.appendTo(_queryBuilder); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new MetafieldReferenceQuery(_queryBuilder)); + queryDef.define(new CartMetafieldDeletePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - public class ReferencesArguments extends Arguments { - ReferencesArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * Sets cart metafield values. Cart metafield values will be set regardless if they were previously + * created or not. + * Allows a maximum of 25 cart metafields to be set at a time. + */ + public MutationQuery cartMetafieldsSet(List metafields, CartMetafieldsSetPayloadQueryDefinition queryDef) { + startField("cartMetafieldsSet"); - /** - * Returns up to the first `n` elements from the list. - */ - public ReferencesArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); + _queryBuilder.append("(metafields:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (CartMetafieldsSetInput item1 : metafields) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); } - return this; } + _queryBuilder.append(']'); - /** - * Returns the elements that come after the specified cursor. - */ - public ReferencesArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + _queryBuilder.append(')'); - /** - * Returns up to the last `n` elements from the list. - */ - public ReferencesArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; + _queryBuilder.append('{'); + queryDef.define(new CartMetafieldsSetPayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + public class CartNoteUpdateArguments extends Arguments { + CartNoteUpdateArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); } /** - * Returns the elements that come before the specified cursor. + * The note on the cart. */ - public ReferencesArguments before(String value) { + public CartNoteUpdateArguments note(String value) { if (value != null) { - startArgument("before"); + startArgument("note"); Query.appendQuotedString(_queryBuilder, value.toString()); } return this; } } - public interface ReferencesArgumentsDefinition { - void define(ReferencesArguments args); + public interface CartNoteUpdateArgumentsDefinition { + void define(CartNoteUpdateArguments args); } /** - * A list of reference objects if the metafield's type is a resource reference list. + * Updates the note on the cart. */ - public MetafieldQuery references(MetafieldReferenceConnectionQueryDefinition queryDef) { - return references(args -> {}, queryDef); + public MutationQuery cartNoteUpdate(ID cartId, CartNoteUpdatePayloadQueryDefinition queryDef) { + return cartNoteUpdate(cartId, args -> {}, queryDef); } /** - * A list of reference objects if the metafield's type is a resource reference list. + * Updates the note on the cart. */ - public MetafieldQuery references(ReferencesArgumentsDefinition argsDef, MetafieldReferenceConnectionQueryDefinition queryDef) { - startField("references"); + public MutationQuery cartNoteUpdate(ID cartId, CartNoteUpdateArgumentsDefinition argsDef, CartNoteUpdatePayloadQueryDefinition queryDef) { + startField("cartNoteUpdate"); - ReferencesArguments args = new ReferencesArguments(_queryBuilder); - argsDef.define(args); - ReferencesArguments.end(args); + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); + + argsDef.define(new CartNoteUpdateArguments(_queryBuilder)); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new MetafieldReferenceConnectionQuery(_queryBuilder)); + queryDef.define(new CartNoteUpdatePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The type name of the metafield. - * See the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). + * Update the customer's payment method that will be used to checkout. */ - public MetafieldQuery type() { - startField("type"); + public MutationQuery cartPaymentUpdate(ID cartId, CartPaymentInput payment, CartPaymentUpdatePayloadQueryDefinition queryDef) { + startField("cartPaymentUpdate"); + + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); + + _queryBuilder.append(",payment:"); + payment.appendTo(_queryBuilder); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CartPaymentUpdatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The date and time when the storefront metafield was updated. + * Update the selected delivery options for a delivery group. */ - public MetafieldQuery updatedAt() { - startField("updatedAt"); + public MutationQuery cartSelectedDeliveryOptionsUpdate(ID cartId, List selectedDeliveryOptions, CartSelectedDeliveryOptionsUpdatePayloadQueryDefinition queryDef) { + startField("cartSelectedDeliveryOptionsUpdate"); + + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); + + _queryBuilder.append(",selectedDeliveryOptions:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (CartSelectedDeliveryOptionInput item1 : selectedDeliveryOptions) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CartSelectedDeliveryOptionsUpdatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The value of a metafield. + * Submit the cart for checkout completion. */ - public MetafieldQuery value() { - startField("value"); + public MutationQuery cartSubmitForCompletion(ID cartId, String attemptToken, CartSubmitForCompletionPayloadQueryDefinition queryDef) { + startField("cartSubmitForCompletion"); - return this; - } - } + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); - /** - * Metafields represent custom metadata attached to a resource. Metafields can be sorted into - * namespaces and are - * comprised of keys, values, and value types. - */ - public static class Metafield extends AbstractResponse implements Node { - public Metafield() { - } + _queryBuilder.append(",attemptToken:"); + Query.appendQuotedString(_queryBuilder, attemptToken.toString()); - public Metafield(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "createdAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + _queryBuilder.append(')'); - break; - } + _queryBuilder.append('{'); + queryDef.define(new CartSubmitForCompletionPayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "description": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + return this; + } - responseData.put(key, optional1); + /** + * Updates the attributes of a checkout if `allowPartialAddresses` is `true`. + */ + public MutationQuery checkoutAttributesUpdateV2(ID checkoutId, CheckoutAttributesUpdateV2Input input, CheckoutAttributesUpdateV2PayloadQueryDefinition queryDef) { + startField("checkoutAttributesUpdateV2"); - break; - } + _queryBuilder.append("(checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + _queryBuilder.append(",input:"); + input.appendTo(_queryBuilder); - break; - } + _queryBuilder.append(')'); - case "key": { - responseData.put(key, jsonAsString(field.getValue(), key)); + _queryBuilder.append('{'); + queryDef.define(new CheckoutAttributesUpdateV2PayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - break; - } + return this; + } - case "namespace": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Completes a checkout without providing payment information. You can use this mutation for free items + * or items whose purchase price is covered by a gift card. + */ + public MutationQuery checkoutCompleteFree(ID checkoutId, CheckoutCompleteFreePayloadQueryDefinition queryDef) { + startField("checkoutCompleteFree"); - break; - } + _queryBuilder.append("(checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - case "parentResource": { - responseData.put(key, UnknownMetafieldParentResource.create(jsonAsObject(field.getValue(), key))); + _queryBuilder.append(')'); - break; - } + _queryBuilder.append('{'); + queryDef.define(new CheckoutCompleteFreePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "reference": { - MetafieldReference optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = UnknownMetafieldReference.create(jsonAsObject(field.getValue(), key)); - } + return this; + } - responseData.put(key, optional1); + /** + * Completes a checkout using a credit card token from Shopify's card vault. Before you can complete + * checkouts using CheckoutCompleteWithCreditCardV2, you need to [_request payment + * processing_](https://shopify.dev/apps/channels/getting-started#request-payment-processing). + */ + public MutationQuery checkoutCompleteWithCreditCardV2(ID checkoutId, CreditCardPaymentInputV2 payment, CheckoutCompleteWithCreditCardV2PayloadQueryDefinition queryDef) { + startField("checkoutCompleteWithCreditCardV2"); - break; - } + _queryBuilder.append("(checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - case "references": { - MetafieldReferenceConnection optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MetafieldReferenceConnection(jsonAsObject(field.getValue(), key)); - } + _queryBuilder.append(",payment:"); + payment.appendTo(_queryBuilder); - responseData.put(key, optional1); + _queryBuilder.append(')'); - break; - } + _queryBuilder.append('{'); + queryDef.define(new CheckoutCompleteWithCreditCardV2PayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "type": { - responseData.put(key, jsonAsString(field.getValue(), key)); + return this; + } - break; - } + /** + * Completes a checkout with a tokenized payment. + */ + public MutationQuery checkoutCompleteWithTokenizedPaymentV3(ID checkoutId, TokenizedPaymentInputV3 payment, CheckoutCompleteWithTokenizedPaymentV3PayloadQueryDefinition queryDef) { + startField("checkoutCompleteWithTokenizedPaymentV3"); - case "updatedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + _queryBuilder.append("(checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - break; - } + _queryBuilder.append(",payment:"); + payment.appendTo(_queryBuilder); - case "value": { - responseData.put(key, jsonAsString(field.getValue(), key)); + _queryBuilder.append(')'); - break; - } + _queryBuilder.append('{'); + queryDef.define(new CheckoutCompleteWithTokenizedPaymentV3PayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + return this; } - public Metafield(ID id) { - this(); - optimisticData.put("id", id); + public class CheckoutCreateArguments extends Arguments { + CheckoutCreateArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } + + /** + * The checkout queue token. Available only to selected stores. + */ + public CheckoutCreateArguments queueToken(String value) { + if (value != null) { + startArgument("queueToken"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } } - public String getGraphQlTypeName() { - return "Metafield"; + public interface CheckoutCreateArgumentsDefinition { + void define(CheckoutCreateArguments args); } /** - * The date and time when the storefront metafield was created. + * Creates a new checkout. */ - - public DateTime getCreatedAt() { - return (DateTime) get("createdAt"); - } - - public Metafield setCreatedAt(DateTime arg) { - optimisticData.put(getKey("createdAt"), arg); - return this; + public MutationQuery checkoutCreate(CheckoutCreateInput input, CheckoutCreatePayloadQueryDefinition queryDef) { + return checkoutCreate(input, args -> {}, queryDef); } /** - * The description of a metafield. + * Creates a new checkout. */ + public MutationQuery checkoutCreate(CheckoutCreateInput input, CheckoutCreateArgumentsDefinition argsDef, CheckoutCreatePayloadQueryDefinition queryDef) { + startField("checkoutCreate"); - public String getDescription() { - return (String) get("description"); - } + _queryBuilder.append("(input:"); + input.appendTo(_queryBuilder); - public Metafield setDescription(String arg) { - optimisticData.put(getKey("description"), arg); - return this; - } + argsDef.define(new CheckoutCreateArguments(_queryBuilder)); - /** - * A globally-unique identifier. - */ + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CheckoutCreatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ID getId() { - return (ID) get("id"); + return this; } /** - * The key name for a metafield. + * Associates a customer to the checkout. */ + public MutationQuery checkoutCustomerAssociateV2(ID checkoutId, String customerAccessToken, CheckoutCustomerAssociateV2PayloadQueryDefinition queryDef) { + startField("checkoutCustomerAssociateV2"); - public String getKey() { - return (String) get("key"); - } + _queryBuilder.append("(checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - public Metafield setKey(String arg) { - optimisticData.put(getKey("key"), arg); - return this; - } + _queryBuilder.append(",customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - /** - * The namespace for a metafield. - */ + _queryBuilder.append(')'); - public String getNamespace() { - return (String) get("namespace"); - } + _queryBuilder.append('{'); + queryDef.define(new CheckoutCustomerAssociateV2PayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Metafield setNamespace(String arg) { - optimisticData.put(getKey("namespace"), arg); return this; } /** - * The parent object that the metafield belongs to. + * Disassociates the current checkout customer from the checkout. */ + public MutationQuery checkoutCustomerDisassociateV2(ID checkoutId, CheckoutCustomerDisassociateV2PayloadQueryDefinition queryDef) { + startField("checkoutCustomerDisassociateV2"); - public MetafieldParentResource getParentResource() { - return (MetafieldParentResource) get("parentResource"); - } + _queryBuilder.append("(checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CheckoutCustomerDisassociateV2PayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Metafield setParentResource(MetafieldParentResource arg) { - optimisticData.put(getKey("parentResource"), arg); return this; } /** - * Returns a reference object if the metafield definition's type is a resource reference. + * Applies a discount to an existing checkout using a discount code. */ + public MutationQuery checkoutDiscountCodeApplyV2(String discountCode, ID checkoutId, CheckoutDiscountCodeApplyV2PayloadQueryDefinition queryDef) { + startField("checkoutDiscountCodeApplyV2"); - public MetafieldReference getReference() { - return (MetafieldReference) get("reference"); - } + _queryBuilder.append("(discountCode:"); + Query.appendQuotedString(_queryBuilder, discountCode.toString()); - public Metafield setReference(MetafieldReference arg) { - optimisticData.put(getKey("reference"), arg); - return this; - } + _queryBuilder.append(",checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - /** - * A list of reference objects if the metafield's type is a resource reference list. - */ + _queryBuilder.append(')'); - public MetafieldReferenceConnection getReferences() { - return (MetafieldReferenceConnection) get("references"); - } + _queryBuilder.append('{'); + queryDef.define(new CheckoutDiscountCodeApplyV2PayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Metafield setReferences(MetafieldReferenceConnection arg) { - optimisticData.put(getKey("references"), arg); return this; } /** - * The type name of the metafield. - * See the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). + * Removes the applied discounts from an existing checkout. */ + public MutationQuery checkoutDiscountCodeRemove(ID checkoutId, CheckoutDiscountCodeRemovePayloadQueryDefinition queryDef) { + startField("checkoutDiscountCodeRemove"); - public String getType() { - return (String) get("type"); - } + _queryBuilder.append("(checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CheckoutDiscountCodeRemovePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Metafield setType(String arg) { - optimisticData.put(getKey("type"), arg); return this; } /** - * The date and time when the storefront metafield was updated. + * Updates the email on an existing checkout. */ + public MutationQuery checkoutEmailUpdateV2(ID checkoutId, String email, CheckoutEmailUpdateV2PayloadQueryDefinition queryDef) { + startField("checkoutEmailUpdateV2"); - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); - } + _queryBuilder.append("(checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - public Metafield setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); - return this; - } + _queryBuilder.append(",email:"); + Query.appendQuotedString(_queryBuilder, email.toString()); - /** - * The value of a metafield. - */ + _queryBuilder.append(')'); - public String getValue() { - return (String) get("value"); - } + _queryBuilder.append('{'); + queryDef.define(new CheckoutEmailUpdateV2PayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Metafield setValue(String arg) { - optimisticData.put(getKey("value"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "createdAt": return false; + /** + * Removes an applied gift card from the checkout. + */ + public MutationQuery checkoutGiftCardRemoveV2(ID appliedGiftCardId, ID checkoutId, CheckoutGiftCardRemoveV2PayloadQueryDefinition queryDef) { + startField("checkoutGiftCardRemoveV2"); - case "description": return false; + _queryBuilder.append("(appliedGiftCardId:"); + Query.appendQuotedString(_queryBuilder, appliedGiftCardId.toString()); - case "id": return false; + _queryBuilder.append(",checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - case "key": return false; + _queryBuilder.append(')'); - case "namespace": return false; + _queryBuilder.append('{'); + queryDef.define(new CheckoutGiftCardRemoveV2PayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "parentResource": return false; + return this; + } - case "reference": return false; + /** + * Appends gift cards to an existing checkout. + */ + public MutationQuery checkoutGiftCardsAppend(List giftCardCodes, ID checkoutId, CheckoutGiftCardsAppendPayloadQueryDefinition queryDef) { + startField("checkoutGiftCardsAppend"); - case "references": return true; + _queryBuilder.append("(giftCardCodes:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (String item1 : giftCardCodes) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + Query.appendQuotedString(_queryBuilder, item1.toString()); + } + } + _queryBuilder.append(']'); - case "type": return false; + _queryBuilder.append(",checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - case "updatedAt": return false; + _queryBuilder.append(')'); - case "value": return false; + _queryBuilder.append('{'); + queryDef.define(new CheckoutGiftCardsAppendPayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - default: return false; - } + return this; } - } - public static class MetafieldFilter implements Serializable { - private String namespace; + /** + * Adds a list of line items to a checkout. + */ + public MutationQuery checkoutLineItemsAdd(List lineItems, ID checkoutId, CheckoutLineItemsAddPayloadQueryDefinition queryDef) { + startField("checkoutLineItemsAdd"); - private String key; + _queryBuilder.append("(lineItems:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (CheckoutLineItemInput item1 : lineItems) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); - private String value; + _queryBuilder.append(",checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - public MetafieldFilter(String namespace, String key, String value) { - this.namespace = namespace; + _queryBuilder.append(')'); - this.key = key; + _queryBuilder.append('{'); + queryDef.define(new CheckoutLineItemsAddPayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - this.value = value; + return this; } - public String getNamespace() { - return namespace; - } + /** + * Removes line items from an existing checkout. + */ + public MutationQuery checkoutLineItemsRemove(ID checkoutId, List lineItemIds, CheckoutLineItemsRemovePayloadQueryDefinition queryDef) { + startField("checkoutLineItemsRemove"); - public MetafieldFilter setNamespace(String namespace) { - this.namespace = namespace; - return this; - } + _queryBuilder.append("(checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - public String getKey() { - return key; - } + _queryBuilder.append(",lineItemIds:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ID item1 : lineItemIds) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + Query.appendQuotedString(_queryBuilder, item1.toString()); + } + } + _queryBuilder.append(']'); - public MetafieldFilter setKey(String key) { - this.key = key; - return this; - } + _queryBuilder.append(')'); - public String getValue() { - return value; - } + _queryBuilder.append('{'); + queryDef.define(new CheckoutLineItemsRemovePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - public MetafieldFilter setValue(String value) { - this.value = value; return this; } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + /** + * Sets a list of line items to a checkout. + */ + public MutationQuery checkoutLineItemsReplace(List lineItems, ID checkoutId, CheckoutLineItemsReplacePayloadQueryDefinition queryDef) { + startField("checkoutLineItemsReplace"); - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("namespace:"); - Query.appendQuotedString(_queryBuilder, namespace.toString()); + _queryBuilder.append("(lineItems:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (CheckoutLineItemInput item1 : lineItems) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + _queryBuilder.append(",checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("value:"); - Query.appendQuotedString(_queryBuilder, value.toString()); + _queryBuilder.append(')'); + _queryBuilder.append('{'); + queryDef.define(new CheckoutLineItemsReplacePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); + + return this; } - } - public interface MetafieldParentResourceQueryDefinition { - void define(MetafieldParentResourceQuery _queryBuilder); - } + /** + * Updates line items on a checkout. + */ + public MutationQuery checkoutLineItemsUpdate(ID checkoutId, List lineItems, CheckoutLineItemsUpdatePayloadQueryDefinition queryDef) { + startField("checkoutLineItemsUpdate"); - /** - * A resource that the metafield belongs to. - */ - public static class MetafieldParentResourceQuery extends Query { - MetafieldParentResourceQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + _queryBuilder.append("(checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - startField("__typename"); - } + _queryBuilder.append(",lineItems:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (CheckoutLineItemUpdateInput item1 : lineItems) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); - public MetafieldParentResourceQuery onArticle(ArticleQueryDefinition queryDef) { - startInlineFragment("Article"); - queryDef.define(new ArticleQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + _queryBuilder.append(')'); - public MetafieldParentResourceQuery onBlog(BlogQueryDefinition queryDef) { - startInlineFragment("Blog"); - queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new CheckoutLineItemsUpdatePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public MetafieldParentResourceQuery onCollection(CollectionQueryDefinition queryDef) { - startInlineFragment("Collection"); - queryDef.define(new CollectionQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public MetafieldParentResourceQuery onCustomer(CustomerQueryDefinition queryDef) { - startInlineFragment("Customer"); - queryDef.define(new CustomerQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * Updates the shipping address of an existing checkout. + */ + public MutationQuery checkoutShippingAddressUpdateV2(MailingAddressInput shippingAddress, ID checkoutId, CheckoutShippingAddressUpdateV2PayloadQueryDefinition queryDef) { + startField("checkoutShippingAddressUpdateV2"); - public MetafieldParentResourceQuery onOrder(OrderQueryDefinition queryDef) { - startInlineFragment("Order"); - queryDef.define(new OrderQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + _queryBuilder.append("(shippingAddress:"); + shippingAddress.appendTo(_queryBuilder); - public MetafieldParentResourceQuery onPage(PageQueryDefinition queryDef) { - startInlineFragment("Page"); - queryDef.define(new PageQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + _queryBuilder.append(",checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - public MetafieldParentResourceQuery onProduct(ProductQueryDefinition queryDef) { - startInlineFragment("Product"); - queryDef.define(new ProductQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + _queryBuilder.append(')'); - public MetafieldParentResourceQuery onProductVariant(ProductVariantQueryDefinition queryDef) { - startInlineFragment("ProductVariant"); - queryDef.define(new ProductVariantQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new CheckoutShippingAddressUpdateV2PayloadQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public MetafieldParentResourceQuery onShop(ShopQueryDefinition queryDef) { - startInlineFragment("Shop"); - queryDef.define(new ShopQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - } - - public interface MetafieldParentResource { - String getGraphQlTypeName(); - } - - /** - * A resource that the metafield belongs to. - */ - public static class UnknownMetafieldParentResource extends AbstractResponse implements MetafieldParentResource { - public UnknownMetafieldParentResource() { - } - - public UnknownMetafieldParentResource(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public static MetafieldParentResource create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "Article": { - return new Article(fields); - } - case "Blog": { - return new Blog(fields); - } + /** + * Updates the shipping lines on an existing checkout. + */ + public MutationQuery checkoutShippingLineUpdate(ID checkoutId, String shippingRateHandle, CheckoutShippingLineUpdatePayloadQueryDefinition queryDef) { + startField("checkoutShippingLineUpdate"); - case "Collection": { - return new Collection(fields); - } + _queryBuilder.append("(checkoutId:"); + Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - case "Customer": { - return new Customer(fields); - } + _queryBuilder.append(",shippingRateHandle:"); + Query.appendQuotedString(_queryBuilder, shippingRateHandle.toString()); - case "Order": { - return new Order(fields); - } + _queryBuilder.append(')'); - case "Page": { - return new Page(fields); - } + _queryBuilder.append('{'); + queryDef.define(new CheckoutShippingLineUpdatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "Product": { - return new Product(fields); - } + return this; + } - case "ProductVariant": { - return new ProductVariant(fields); - } + /** + * Creates a customer access token. + * The customer access token is required to modify the customer object in any way. + */ + public MutationQuery customerAccessTokenCreate(CustomerAccessTokenCreateInput input, CustomerAccessTokenCreatePayloadQueryDefinition queryDef) { + startField("customerAccessTokenCreate"); - case "Shop": { - return new Shop(fields); - } + _queryBuilder.append("(input:"); + input.appendTo(_queryBuilder); - default: { - return new UnknownMetafieldParentResource(fields); - } - } - } + _queryBuilder.append(')'); - public String getGraphQlTypeName() { - return (String) get("__typename"); - } + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenCreatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - default: return false; - } + return this; } - } - public interface MetafieldReferenceQueryDefinition { - void define(MetafieldReferenceQuery _queryBuilder); - } + /** + * Creates a customer access token using a + * [multipass token](https://shopify.dev/api/multipass) instead of email and + * password. A customer record is created if the customer doesn't exist. If a customer + * record already exists but the record is disabled, then the customer record is enabled. + */ + public MutationQuery customerAccessTokenCreateWithMultipass(String multipassToken, CustomerAccessTokenCreateWithMultipassPayloadQueryDefinition queryDef) { + startField("customerAccessTokenCreateWithMultipass"); - /** - * Returns the resource which is being referred to by a metafield. - */ - public static class MetafieldReferenceQuery extends Query { - MetafieldReferenceQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + _queryBuilder.append("(multipassToken:"); + Query.appendQuotedString(_queryBuilder, multipassToken.toString()); - startField("__typename"); - } + _queryBuilder.append(')'); - public MetafieldReferenceQuery onCollection(CollectionQueryDefinition queryDef) { - startInlineFragment("Collection"); - queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenCreateWithMultipassPayloadQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - public MetafieldReferenceQuery onGenericFile(GenericFileQueryDefinition queryDef) { - startInlineFragment("GenericFile"); - queryDef.define(new GenericFileQuery(_queryBuilder)); + /** + * Permanently destroys a customer access token. + */ + public MutationQuery customerAccessTokenDelete(String customerAccessToken, CustomerAccessTokenDeletePayloadQueryDefinition queryDef) { + startField("customerAccessTokenDelete"); + + _queryBuilder.append("(customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenDeletePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - public MetafieldReferenceQuery onMediaImage(MediaImageQueryDefinition queryDef) { - startInlineFragment("MediaImage"); - queryDef.define(new MediaImageQuery(_queryBuilder)); + /** + * Renews a customer access token. + * Access token renewal must happen *before* a token expires. + * If a token has already expired, a new one should be created instead via `customerAccessTokenCreate`. + */ + public MutationQuery customerAccessTokenRenew(String customerAccessToken, CustomerAccessTokenRenewPayloadQueryDefinition queryDef) { + startField("customerAccessTokenRenew"); + + _queryBuilder.append("(customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CustomerAccessTokenRenewPayloadQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - public MetafieldReferenceQuery onMetaobject(MetaobjectQueryDefinition queryDef) { - startInlineFragment("Metaobject"); - queryDef.define(new MetaobjectQuery(_queryBuilder)); + /** + * Activates a customer. + */ + public MutationQuery customerActivate(ID id, CustomerActivateInput input, CustomerActivatePayloadQueryDefinition queryDef) { + startField("customerActivate"); + + _queryBuilder.append("(id:"); + Query.appendQuotedString(_queryBuilder, id.toString()); + + _queryBuilder.append(",input:"); + input.appendTo(_queryBuilder); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CustomerActivatePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - public MetafieldReferenceQuery onPage(PageQueryDefinition queryDef) { - startInlineFragment("Page"); - queryDef.define(new PageQuery(_queryBuilder)); + /** + * Activates a customer with the activation url received from `customerCreate`. + */ + public MutationQuery customerActivateByUrl(String activationUrl, String password, CustomerActivateByUrlPayloadQueryDefinition queryDef) { + startField("customerActivateByUrl"); + + _queryBuilder.append("(activationUrl:"); + Query.appendQuotedString(_queryBuilder, activationUrl.toString()); + + _queryBuilder.append(",password:"); + Query.appendQuotedString(_queryBuilder, password.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CustomerActivateByUrlPayloadQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - public MetafieldReferenceQuery onProduct(ProductQueryDefinition queryDef) { - startInlineFragment("Product"); - queryDef.define(new ProductQuery(_queryBuilder)); + /** + * Creates a new address for a customer. + */ + public MutationQuery customerAddressCreate(String customerAccessToken, MailingAddressInput address, CustomerAddressCreatePayloadQueryDefinition queryDef) { + startField("customerAddressCreate"); + + _queryBuilder.append("(customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + + _queryBuilder.append(",address:"); + address.appendTo(_queryBuilder); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CustomerAddressCreatePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - public MetafieldReferenceQuery onProductVariant(ProductVariantQueryDefinition queryDef) { - startInlineFragment("ProductVariant"); - queryDef.define(new ProductVariantQuery(_queryBuilder)); + /** + * Permanently deletes the address of an existing customer. + */ + public MutationQuery customerAddressDelete(ID id, String customerAccessToken, CustomerAddressDeletePayloadQueryDefinition queryDef) { + startField("customerAddressDelete"); + + _queryBuilder.append("(id:"); + Query.appendQuotedString(_queryBuilder, id.toString()); + + _queryBuilder.append(",customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CustomerAddressDeletePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - public MetafieldReferenceQuery onVideo(VideoQueryDefinition queryDef) { - startInlineFragment("Video"); - queryDef.define(new VideoQuery(_queryBuilder)); + /** + * Updates the address of an existing customer. + */ + public MutationQuery customerAddressUpdate(String customerAccessToken, ID id, MailingAddressInput address, CustomerAddressUpdatePayloadQueryDefinition queryDef) { + startField("customerAddressUpdate"); + + _queryBuilder.append("(customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + + _queryBuilder.append(",id:"); + Query.appendQuotedString(_queryBuilder, id.toString()); + + _queryBuilder.append(",address:"); + address.appendTo(_queryBuilder); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CustomerAddressUpdatePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - } - - public interface MetafieldReference { - String getGraphQlTypeName(); - } - /** - * Returns the resource which is being referred to by a metafield. - */ - public static class UnknownMetafieldReference extends AbstractResponse implements MetafieldReference { - public UnknownMetafieldReference() { - } + /** + * Creates a new customer. + */ + public MutationQuery customerCreate(CustomerCreateInput input, CustomerCreatePayloadQueryDefinition queryDef) { + startField("customerCreate"); - public UnknownMetafieldReference(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + _queryBuilder.append("(input:"); + input.appendTo(_queryBuilder); - public static MetafieldReference create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "Collection": { - return new Collection(fields); - } + _queryBuilder.append(')'); - case "GenericFile": { - return new GenericFile(fields); - } + _queryBuilder.append('{'); + queryDef.define(new CustomerCreatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "MediaImage": { - return new MediaImage(fields); - } + return this; + } - case "Metaobject": { - return new Metaobject(fields); - } + /** + * Updates the default address of an existing customer. + */ + public MutationQuery customerDefaultAddressUpdate(String customerAccessToken, ID addressId, CustomerDefaultAddressUpdatePayloadQueryDefinition queryDef) { + startField("customerDefaultAddressUpdate"); - case "Page": { - return new Page(fields); - } + _queryBuilder.append("(customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - case "Product": { - return new Product(fields); - } + _queryBuilder.append(",addressId:"); + Query.appendQuotedString(_queryBuilder, addressId.toString()); - case "ProductVariant": { - return new ProductVariant(fields); - } + _queryBuilder.append(')'); - case "Video": { - return new Video(fields); - } + _queryBuilder.append('{'); + queryDef.define(new CustomerDefaultAddressUpdatePayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); - default: { - return new UnknownMetafieldReference(fields); - } - } + return this; } - public String getGraphQlTypeName() { - return (String) get("__typename"); - } + /** + * Sends a reset password email to the customer. The reset password + * email contains a reset password URL and token that you can pass to + * the [`customerResetByUrl`](https://shopify.dev/api/storefront/latest/mutations/customerResetByUrl) + * or + * [`customerReset`](https://shopify.dev/api/storefront/latest/mutations/customerReset) mutation to + * reset the + * customer password. + * This mutation is throttled by IP. With authenticated access, + * you can provide a + * [`Shopify-Storefront-Buyer-IP`](https://shopify.dev/api/usage/authentication#optional-ip-header) + * instead of the request IP. + * Make sure that the value provided to `Shopify-Storefront-Buyer-IP` is trusted. Unthrottled access to + * this + * mutation presents a security risk. + */ + public MutationQuery customerRecover(String email, CustomerRecoverPayloadQueryDefinition queryDef) { + startField("customerRecover"); - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - default: return false; - } - } - } + _queryBuilder.append("(email:"); + Query.appendQuotedString(_queryBuilder, email.toString()); - public interface MetafieldReferenceConnectionQueryDefinition { - void define(MetafieldReferenceConnectionQuery _queryBuilder); - } + _queryBuilder.append(')'); - /** - * An auto-generated type for paginating through multiple MetafieldReferences. - */ - public static class MetafieldReferenceConnectionQuery extends Query { - MetafieldReferenceConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + _queryBuilder.append('{'); + queryDef.define(new CustomerRecoverPayloadQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * A list of edges. + * "Resets a customer’s password with the token received from a reset password email. You can send a + * reset password email with the + * [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation." */ - public MetafieldReferenceConnectionQuery edges(MetafieldReferenceEdgeQueryDefinition queryDef) { - startField("edges"); + public MutationQuery customerReset(ID id, CustomerResetInput input, CustomerResetPayloadQueryDefinition queryDef) { + startField("customerReset"); + + _queryBuilder.append("(id:"); + Query.appendQuotedString(_queryBuilder, id.toString()); + + _queryBuilder.append(",input:"); + input.appendTo(_queryBuilder); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new MetafieldReferenceEdgeQuery(_queryBuilder)); + queryDef.define(new CustomerResetPayloadQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in MetafieldReferenceEdge. + * "Resets a customer’s password with the reset password URL received from a reset password email. You + * can send a reset password email with the + * [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation." */ - public MetafieldReferenceConnectionQuery nodes(MetafieldReferenceQueryDefinition queryDef) { - startField("nodes"); + public MutationQuery customerResetByUrl(String resetUrl, String password, CustomerResetByUrlPayloadQueryDefinition queryDef) { + startField("customerResetByUrl"); + + _queryBuilder.append("(resetUrl:"); + Query.appendQuotedString(_queryBuilder, resetUrl.toString()); + + _queryBuilder.append(",password:"); + Query.appendQuotedString(_queryBuilder, password.toString()); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new MetafieldReferenceQuery(_queryBuilder)); + queryDef.define(new CustomerResetByUrlPayloadQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Information to aid in pagination. + * Updates an existing customer. */ - public MetafieldReferenceConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + public MutationQuery customerUpdate(String customerAccessToken, CustomerUpdateInput customer, CustomerUpdatePayloadQueryDefinition queryDef) { + startField("customerUpdate"); + + _queryBuilder.append("(customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + + _queryBuilder.append(",customer:"); + customer.appendTo(_queryBuilder); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); + queryDef.define(new CustomerUpdatePayloadQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + + public String toString() { + return _queryBuilder.toString(); + } } /** - * An auto-generated type for paginating through multiple MetafieldReferences. + * The schema’s entry-point for mutations. This acts as the public, top-level API from which all + * mutation queries must start. */ - public static class MetafieldReferenceConnection extends AbstractResponse { - public MetafieldReferenceConnection() { + public static class Mutation extends AbstractResponse { + public Mutation() { } - public MetafieldReferenceConnection(JsonObject fields) throws SchemaViolationError { + public Mutation(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new MetafieldReferenceEdge(jsonAsObject(element1, key))); + case "cartAttributesUpdate": { + CartAttributesUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartAttributesUpdatePayload(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(UnknownMetafieldReference.create(jsonAsObject(element1, key))); + case "cartBuyerIdentityUpdate": { + CartBuyerIdentityUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartBuyerIdentityUpdatePayload(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "cartCreate": { + CartCreatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartCreatePayload(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "cartDiscountCodesUpdate": { + CartDiscountCodesUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartDiscountCodesUpdatePayload(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - public String getGraphQlTypeName() { - return "MetafieldReferenceConnection"; - } + case "cartLinesAdd": { + CartLinesAddPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartLinesAddPayload(jsonAsObject(field.getValue(), key)); + } - /** - * A list of edges. - */ + responseData.put(key, optional1); - public List getEdges() { - return (List) get("edges"); - } + break; + } - public MetafieldReferenceConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; - } + case "cartLinesRemove": { + CartLinesRemovePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartLinesRemovePayload(jsonAsObject(field.getValue(), key)); + } - /** - * A list of the nodes contained in MetafieldReferenceEdge. - */ + responseData.put(key, optional1); - public List getNodes() { - return (List) get("nodes"); - } + break; + } - public MetafieldReferenceConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; - } + case "cartLinesUpdate": { + CartLinesUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartLinesUpdatePayload(jsonAsObject(field.getValue(), key)); + } - /** - * Information to aid in pagination. - */ + responseData.put(key, optional1); - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } + break; + } - public MetafieldReferenceConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); - return this; - } + case "cartMetafieldDelete": { + CartMetafieldDeletePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartMetafieldDeletePayload(jsonAsObject(field.getValue(), key)); + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; + responseData.put(key, optional1); - case "nodes": return false; + break; + } - case "pageInfo": return true; + case "cartMetafieldsSet": { + CartMetafieldsSetPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartMetafieldsSetPayload(jsonAsObject(field.getValue(), key)); + } - default: return false; - } - } - } + responseData.put(key, optional1); - public interface MetafieldReferenceEdgeQueryDefinition { - void define(MetafieldReferenceEdgeQuery _queryBuilder); - } + break; + } - /** - * An auto-generated type which holds one MetafieldReference and a cursor during pagination. - */ - public static class MetafieldReferenceEdgeQuery extends Query { - MetafieldReferenceEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "cartNoteUpdate": { + CartNoteUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartNoteUpdatePayload(jsonAsObject(field.getValue(), key)); + } - /** - * A cursor for use in pagination. - */ - public MetafieldReferenceEdgeQuery cursor() { - startField("cursor"); + responseData.put(key, optional1); - return this; - } + break; + } - /** - * The item at the end of MetafieldReferenceEdge. - */ - public MetafieldReferenceEdgeQuery node(MetafieldReferenceQueryDefinition queryDef) { - startField("node"); + case "cartPaymentUpdate": { + CartPaymentUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartPaymentUpdatePayload(jsonAsObject(field.getValue(), key)); + } - _queryBuilder.append('{'); - queryDef.define(new MetafieldReferenceQuery(_queryBuilder)); - _queryBuilder.append('}'); + responseData.put(key, optional1); - return this; - } - } + break; + } - /** - * An auto-generated type which holds one MetafieldReference and a cursor during pagination. - */ - public static class MetafieldReferenceEdge extends AbstractResponse { - public MetafieldReferenceEdge() { - } + case "cartSelectedDeliveryOptionsUpdate": { + CartSelectedDeliveryOptionsUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartSelectedDeliveryOptionsUpdatePayload(jsonAsObject(field.getValue(), key)); + } - public MetafieldReferenceEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + responseData.put(key, optional1); + + break; + } + + case "cartSubmitForCompletion": { + CartSubmitForCompletionPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CartSubmitForCompletionPayload(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "node": { - responseData.put(key, UnknownMetafieldReference.create(jsonAsObject(field.getValue(), key))); + case "checkoutAttributesUpdateV2": { + CheckoutAttributesUpdateV2Payload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutAttributesUpdateV2Payload(jsonAsObject(field.getValue(), key)); + } - break; - } + responseData.put(key, optional1); - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "MetafieldReferenceEdge"; - } - /** - * A cursor for use in pagination. - */ + case "checkoutCompleteFree": { + CheckoutCompleteFreePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutCompleteFreePayload(jsonAsObject(field.getValue(), key)); + } - public String getCursor() { - return (String) get("cursor"); - } + responseData.put(key, optional1); - public MetafieldReferenceEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; - } + break; + } - /** - * The item at the end of MetafieldReferenceEdge. - */ + case "checkoutCompleteWithCreditCardV2": { + CheckoutCompleteWithCreditCardV2Payload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutCompleteWithCreditCardV2Payload(jsonAsObject(field.getValue(), key)); + } - public MetafieldReference getNode() { - return (MetafieldReference) get("node"); - } + responseData.put(key, optional1); - public MetafieldReferenceEdge setNode(MetafieldReference arg) { - optimisticData.put(getKey("node"), arg); - return this; - } + break; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; + case "checkoutCompleteWithTokenizedPaymentV3": { + CheckoutCompleteWithTokenizedPaymentV3Payload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutCompleteWithTokenizedPaymentV3Payload(jsonAsObject(field.getValue(), key)); + } - case "node": return false; + responseData.put(key, optional1); - default: return false; - } - } - } + break; + } - public interface MetaobjectQueryDefinition { - void define(MetaobjectQuery _queryBuilder); - } + case "checkoutCreate": { + CheckoutCreatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutCreatePayload(jsonAsObject(field.getValue(), key)); + } - /** - * An instance of a user-defined model based on a MetaobjectDefinition. - */ - public static class MetaobjectQuery extends Query { - MetaobjectQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + responseData.put(key, optional1); - startField("id"); - } + break; + } - /** - * Accesses a field of the object by key. - */ - public MetaobjectQuery field(String key, MetaobjectFieldQueryDefinition queryDef) { - startField("field"); + case "checkoutCustomerAssociateV2": { + CheckoutCustomerAssociateV2Payload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutCustomerAssociateV2Payload(jsonAsObject(field.getValue(), key)); + } - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + responseData.put(key, optional1); - _queryBuilder.append(')'); + break; + } - _queryBuilder.append('{'); - queryDef.define(new MetaobjectFieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "checkoutCustomerDisassociateV2": { + CheckoutCustomerDisassociateV2Payload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutCustomerDisassociateV2Payload(jsonAsObject(field.getValue(), key)); + } - return this; - } + responseData.put(key, optional1); - /** - * All object fields with defined values. - * Omitted object keys can be assumed null, and no guarantees are made about field order. - */ - public MetaobjectQuery fields(MetaobjectFieldQueryDefinition queryDef) { - startField("fields"); + break; + } - _queryBuilder.append('{'); - queryDef.define(new MetaobjectFieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "checkoutDiscountCodeApplyV2": { + CheckoutDiscountCodeApplyV2Payload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutDiscountCodeApplyV2Payload(jsonAsObject(field.getValue(), key)); + } - return this; - } + responseData.put(key, optional1); - /** - * The unique handle of the metaobject. Useful as a custom ID. - */ - public MetaobjectQuery handle() { - startField("handle"); + break; + } - return this; - } + case "checkoutDiscountCodeRemove": { + CheckoutDiscountCodeRemovePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutDiscountCodeRemovePayload(jsonAsObject(field.getValue(), key)); + } - /** - * The type of the metaobject. Defines the namespace of its associated metafields. - */ - public MetaobjectQuery type() { - startField("type"); + responseData.put(key, optional1); - return this; - } + break; + } - /** - * The date and time when the metaobject was last updated. - */ - public MetaobjectQuery updatedAt() { - startField("updatedAt"); + case "checkoutEmailUpdateV2": { + CheckoutEmailUpdateV2Payload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutEmailUpdateV2Payload(jsonAsObject(field.getValue(), key)); + } - return this; - } - } + responseData.put(key, optional1); - /** - * An instance of a user-defined model based on a MetaobjectDefinition. - */ - public static class Metaobject extends AbstractResponse implements MetafieldReference, Node { - public Metaobject() { - } + break; + } - public Metaobject(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "field": { - MetaobjectField optional1 = null; + case "checkoutGiftCardRemoveV2": { + CheckoutGiftCardRemoveV2Payload optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MetaobjectField(jsonAsObject(field.getValue(), key)); + optional1 = new CheckoutGiftCardRemoveV2Payload(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -41031,242 +48294,244 @@ public Metaobject(JsonObject fields) throws SchemaViolationError { break; } - case "fields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new MetaobjectField(jsonAsObject(element1, key))); + case "checkoutGiftCardsAppend": { + CheckoutGiftCardsAppendPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutGiftCardsAppendPayload(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "handle": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "checkoutLineItemsAdd": { + CheckoutLineItemsAddPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutLineItemsAddPayload(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case "checkoutLineItemsRemove": { + CheckoutLineItemsRemovePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutLineItemsRemovePayload(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "type": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "checkoutLineItemsReplace": { + CheckoutLineItemsReplacePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutLineItemsReplacePayload(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "updatedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + case "checkoutLineItemsUpdate": { + CheckoutLineItemsUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutLineItemsUpdatePayload(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "checkoutShippingAddressUpdateV2": { + CheckoutShippingAddressUpdateV2Payload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutShippingAddressUpdateV2Payload(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - public Metaobject(ID id) { - this(); - optimisticData.put("id", id); - } + case "checkoutShippingLineUpdate": { + CheckoutShippingLineUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CheckoutShippingLineUpdatePayload(jsonAsObject(field.getValue(), key)); + } - public String getGraphQlTypeName() { - return "Metaobject"; - } + responseData.put(key, optional1); - /** - * Accesses a field of the object by key. - */ + break; + } - public MetaobjectField getField() { - return (MetaobjectField) get("field"); - } + case "customerAccessTokenCreate": { + CustomerAccessTokenCreatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessTokenCreatePayload(jsonAsObject(field.getValue(), key)); + } - public Metaobject setField(MetaobjectField arg) { - optimisticData.put(getKey("field"), arg); - return this; - } + responseData.put(key, optional1); - /** - * All object fields with defined values. - * Omitted object keys can be assumed null, and no guarantees are made about field order. - */ + break; + } - public List getFields() { - return (List) get("fields"); - } + case "customerAccessTokenCreateWithMultipass": { + CustomerAccessTokenCreateWithMultipassPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessTokenCreateWithMultipassPayload(jsonAsObject(field.getValue(), key)); + } - public Metaobject setFields(List arg) { - optimisticData.put(getKey("fields"), arg); - return this; - } + responseData.put(key, optional1); - /** - * The unique handle of the metaobject. Useful as a custom ID. - */ + break; + } - public String getHandle() { - return (String) get("handle"); - } + case "customerAccessTokenDelete": { + CustomerAccessTokenDeletePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessTokenDeletePayload(jsonAsObject(field.getValue(), key)); + } - public Metaobject setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); - return this; - } + responseData.put(key, optional1); - /** - * A globally-unique identifier. - */ + break; + } - public ID getId() { - return (ID) get("id"); - } + case "customerAccessTokenRenew": { + CustomerAccessTokenRenewPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAccessTokenRenewPayload(jsonAsObject(field.getValue(), key)); + } - /** - * The type of the metaobject. Defines the namespace of its associated metafields. - */ + responseData.put(key, optional1); - public String getType() { - return (String) get("type"); - } + break; + } - public Metaobject setType(String arg) { - optimisticData.put(getKey("type"), arg); - return this; - } + case "customerActivate": { + CustomerActivatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerActivatePayload(jsonAsObject(field.getValue(), key)); + } - /** - * The date and time when the metaobject was last updated. - */ + responseData.put(key, optional1); - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); - } + break; + } - public Metaobject setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); - return this; - } + case "customerActivateByUrl": { + CustomerActivateByUrlPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerActivateByUrlPayload(jsonAsObject(field.getValue(), key)); + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "field": return true; + responseData.put(key, optional1); - case "fields": return true; + break; + } - case "handle": return false; + case "customerAddressCreate": { + CustomerAddressCreatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAddressCreatePayload(jsonAsObject(field.getValue(), key)); + } - case "id": return false; + responseData.put(key, optional1); - case "type": return false; + break; + } - case "updatedAt": return false; + case "customerAddressDelete": { + CustomerAddressDeletePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAddressDeletePayload(jsonAsObject(field.getValue(), key)); + } - default: return false; - } - } - } + responseData.put(key, optional1); - public interface MetaobjectConnectionQueryDefinition { - void define(MetaobjectConnectionQuery _queryBuilder); - } + break; + } - /** - * An auto-generated type for paginating through multiple Metaobjects. - */ - public static class MetaobjectConnectionQuery extends Query { - MetaobjectConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "customerAddressUpdate": { + CustomerAddressUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerAddressUpdatePayload(jsonAsObject(field.getValue(), key)); + } - /** - * A list of edges. - */ - public MetaobjectConnectionQuery edges(MetaobjectEdgeQueryDefinition queryDef) { - startField("edges"); + responseData.put(key, optional1); - _queryBuilder.append('{'); - queryDef.define(new MetaobjectEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; - } + case "customerCreate": { + CustomerCreatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerCreatePayload(jsonAsObject(field.getValue(), key)); + } - /** - * A list of the nodes contained in MetaobjectEdge. - */ - public MetaobjectConnectionQuery nodes(MetaobjectQueryDefinition queryDef) { - startField("nodes"); + responseData.put(key, optional1); - _queryBuilder.append('{'); - queryDef.define(new MetaobjectQuery(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; - } + case "customerDefaultAddressUpdate": { + CustomerDefaultAddressUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerDefaultAddressUpdatePayload(jsonAsObject(field.getValue(), key)); + } - /** - * Information to aid in pagination. - */ - public MetaobjectConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + responseData.put(key, optional1); - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; - } - } + case "customerRecover": { + CustomerRecoverPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerRecoverPayload(jsonAsObject(field.getValue(), key)); + } - /** - * An auto-generated type for paginating through multiple Metaobjects. - */ - public static class MetaobjectConnection extends AbstractResponse { - public MetaobjectConnection() { - } + responseData.put(key, optional1); - public MetaobjectConnection(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new MetaobjectEdge(jsonAsObject(element1, key))); + break; + } + + case "customerReset": { + CustomerResetPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerResetPayload(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Metaobject(jsonAsObject(element1, key))); + case "customerResetByUrl": { + CustomerResetByUrlPayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerResetByUrlPayload(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "customerUpdate": { + CustomerUpdatePayload optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CustomerUpdatePayload(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } @@ -41283,984 +48548,1005 @@ public MetaobjectConnection(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "MetaobjectConnection"; + return "Mutation"; } /** - * A list of edges. + * Updates the attributes on a cart. */ - public List getEdges() { - return (List) get("edges"); + public CartAttributesUpdatePayload getCartAttributesUpdate() { + return (CartAttributesUpdatePayload) get("cartAttributesUpdate"); } - public MetaobjectConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); + public Mutation setCartAttributesUpdate(CartAttributesUpdatePayload arg) { + optimisticData.put(getKey("cartAttributesUpdate"), arg); return this; } /** - * A list of the nodes contained in MetaobjectEdge. + * Updates customer information associated with a cart. + * Buyer identity is used to determine + * [international + * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing) + * and should match the customer's shipping address. */ - public List getNodes() { - return (List) get("nodes"); + public CartBuyerIdentityUpdatePayload getCartBuyerIdentityUpdate() { + return (CartBuyerIdentityUpdatePayload) get("cartBuyerIdentityUpdate"); } - public MetaobjectConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + public Mutation setCartBuyerIdentityUpdate(CartBuyerIdentityUpdatePayload arg) { + optimisticData.put(getKey("cartBuyerIdentityUpdate"), arg); return this; } /** - * Information to aid in pagination. + * Creates a new cart. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public CartCreatePayload getCartCreate() { + return (CartCreatePayload) get("cartCreate"); } - public MetaobjectConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public Mutation setCartCreate(CartCreatePayload arg) { + optimisticData.put(getKey("cartCreate"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; + /** + * Updates the discount codes applied to the cart. + */ - case "nodes": return true; + public CartDiscountCodesUpdatePayload getCartDiscountCodesUpdate() { + return (CartDiscountCodesUpdatePayload) get("cartDiscountCodesUpdate"); + } - case "pageInfo": return true; + public Mutation setCartDiscountCodesUpdate(CartDiscountCodesUpdatePayload arg) { + optimisticData.put(getKey("cartDiscountCodesUpdate"), arg); + return this; + } - default: return false; - } + /** + * Adds a merchandise line to the cart. + */ + + public CartLinesAddPayload getCartLinesAdd() { + return (CartLinesAddPayload) get("cartLinesAdd"); } - } - public interface MetaobjectEdgeQueryDefinition { - void define(MetaobjectEdgeQuery _queryBuilder); - } + public Mutation setCartLinesAdd(CartLinesAddPayload arg) { + optimisticData.put(getKey("cartLinesAdd"), arg); + return this; + } - /** - * An auto-generated type which holds one Metaobject and a cursor during pagination. - */ - public static class MetaobjectEdgeQuery extends Query { - MetaobjectEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + /** + * Removes one or more merchandise lines from the cart. + */ + + public CartLinesRemovePayload getCartLinesRemove() { + return (CartLinesRemovePayload) get("cartLinesRemove"); + } + + public Mutation setCartLinesRemove(CartLinesRemovePayload arg) { + optimisticData.put(getKey("cartLinesRemove"), arg); + return this; } /** - * A cursor for use in pagination. + * Updates one or more merchandise lines on a cart. */ - public MetaobjectEdgeQuery cursor() { - startField("cursor"); + public CartLinesUpdatePayload getCartLinesUpdate() { + return (CartLinesUpdatePayload) get("cartLinesUpdate"); + } + + public Mutation setCartLinesUpdate(CartLinesUpdatePayload arg) { + optimisticData.put(getKey("cartLinesUpdate"), arg); return this; } /** - * The item at the end of MetaobjectEdge. + * Deletes a cart metafield. */ - public MetaobjectEdgeQuery node(MetaobjectQueryDefinition queryDef) { - startField("node"); - _queryBuilder.append('{'); - queryDef.define(new MetaobjectQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CartMetafieldDeletePayload getCartMetafieldDelete() { + return (CartMetafieldDeletePayload) get("cartMetafieldDelete"); + } + public Mutation setCartMetafieldDelete(CartMetafieldDeletePayload arg) { + optimisticData.put(getKey("cartMetafieldDelete"), arg); return this; } - } - /** - * An auto-generated type which holds one Metaobject and a cursor during pagination. - */ - public static class MetaobjectEdge extends AbstractResponse { - public MetaobjectEdge() { + /** + * Sets cart metafield values. Cart metafield values will be set regardless if they were previously + * created or not. + * Allows a maximum of 25 cart metafields to be set at a time. + */ + + public CartMetafieldsSetPayload getCartMetafieldsSet() { + return (CartMetafieldsSetPayload) get("cartMetafieldsSet"); } - public MetaobjectEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + public Mutation setCartMetafieldsSet(CartMetafieldsSetPayload arg) { + optimisticData.put(getKey("cartMetafieldsSet"), arg); + return this; + } - break; - } + /** + * Updates the note on the cart. + */ - case "node": { - responseData.put(key, new Metaobject(jsonAsObject(field.getValue(), key))); + public CartNoteUpdatePayload getCartNoteUpdate() { + return (CartNoteUpdatePayload) get("cartNoteUpdate"); + } - break; - } + public Mutation setCartNoteUpdate(CartNoteUpdatePayload arg) { + optimisticData.put(getKey("cartNoteUpdate"), arg); + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + /** + * Update the customer's payment method that will be used to checkout. + */ + + public CartPaymentUpdatePayload getCartPaymentUpdate() { + return (CartPaymentUpdatePayload) get("cartPaymentUpdate"); } - public String getGraphQlTypeName() { - return "MetaobjectEdge"; + public Mutation setCartPaymentUpdate(CartPaymentUpdatePayload arg) { + optimisticData.put(getKey("cartPaymentUpdate"), arg); + return this; } /** - * A cursor for use in pagination. + * Update the selected delivery options for a delivery group. */ - public String getCursor() { - return (String) get("cursor"); + public CartSelectedDeliveryOptionsUpdatePayload getCartSelectedDeliveryOptionsUpdate() { + return (CartSelectedDeliveryOptionsUpdatePayload) get("cartSelectedDeliveryOptionsUpdate"); } - public MetaobjectEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public Mutation setCartSelectedDeliveryOptionsUpdate(CartSelectedDeliveryOptionsUpdatePayload arg) { + optimisticData.put(getKey("cartSelectedDeliveryOptionsUpdate"), arg); return this; } /** - * The item at the end of MetaobjectEdge. + * Submit the cart for checkout completion. */ - public Metaobject getNode() { - return (Metaobject) get("node"); + public CartSubmitForCompletionPayload getCartSubmitForCompletion() { + return (CartSubmitForCompletionPayload) get("cartSubmitForCompletion"); } - public MetaobjectEdge setNode(Metaobject arg) { - optimisticData.put(getKey("node"), arg); + public Mutation setCartSubmitForCompletion(CartSubmitForCompletionPayload arg) { + optimisticData.put(getKey("cartSubmitForCompletion"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; + /** + * Updates the attributes of a checkout if `allowPartialAddresses` is `true`. + */ - case "node": return true; + public CheckoutAttributesUpdateV2Payload getCheckoutAttributesUpdateV2() { + return (CheckoutAttributesUpdateV2Payload) get("checkoutAttributesUpdateV2"); + } - default: return false; - } + public Mutation setCheckoutAttributesUpdateV2(CheckoutAttributesUpdateV2Payload arg) { + optimisticData.put(getKey("checkoutAttributesUpdateV2"), arg); + return this; } - } - public interface MetaobjectFieldQueryDefinition { - void define(MetaobjectFieldQuery _queryBuilder); - } + /** + * Completes a checkout without providing payment information. You can use this mutation for free items + * or items whose purchase price is covered by a gift card. + */ - /** - * Provides the value of a Metaobject field. - */ - public static class MetaobjectFieldQuery extends Query { - MetaobjectFieldQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public CheckoutCompleteFreePayload getCheckoutCompleteFree() { + return (CheckoutCompleteFreePayload) get("checkoutCompleteFree"); + } + + public Mutation setCheckoutCompleteFree(CheckoutCompleteFreePayload arg) { + optimisticData.put(getKey("checkoutCompleteFree"), arg); + return this; } /** - * The field key. + * Completes a checkout using a credit card token from Shopify's card vault. Before you can complete + * checkouts using CheckoutCompleteWithCreditCardV2, you need to [_request payment + * processing_](https://shopify.dev/apps/channels/getting-started#request-payment-processing). */ - public MetaobjectFieldQuery key() { - startField("key"); + public CheckoutCompleteWithCreditCardV2Payload getCheckoutCompleteWithCreditCardV2() { + return (CheckoutCompleteWithCreditCardV2Payload) get("checkoutCompleteWithCreditCardV2"); + } + + public Mutation setCheckoutCompleteWithCreditCardV2(CheckoutCompleteWithCreditCardV2Payload arg) { + optimisticData.put(getKey("checkoutCompleteWithCreditCardV2"), arg); return this; } /** - * A referenced object if the field type is a resource reference. + * Completes a checkout with a tokenized payment. */ - public MetaobjectFieldQuery reference(MetafieldReferenceQueryDefinition queryDef) { - startField("reference"); - _queryBuilder.append('{'); - queryDef.define(new MetafieldReferenceQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CheckoutCompleteWithTokenizedPaymentV3Payload getCheckoutCompleteWithTokenizedPaymentV3() { + return (CheckoutCompleteWithTokenizedPaymentV3Payload) get("checkoutCompleteWithTokenizedPaymentV3"); + } + public Mutation setCheckoutCompleteWithTokenizedPaymentV3(CheckoutCompleteWithTokenizedPaymentV3Payload arg) { + optimisticData.put(getKey("checkoutCompleteWithTokenizedPaymentV3"), arg); return this; } - public class ReferencesArguments extends Arguments { - ReferencesArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * Creates a new checkout. + */ - /** - * Returns up to the first `n` elements from the list. - */ - public ReferencesArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public CheckoutCreatePayload getCheckoutCreate() { + return (CheckoutCreatePayload) get("checkoutCreate"); + } - /** - * Returns the elements that come after the specified cursor. - */ - public ReferencesArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public Mutation setCheckoutCreate(CheckoutCreatePayload arg) { + optimisticData.put(getKey("checkoutCreate"), arg); + return this; + } - /** - * Returns up to the last `n` elements from the list. - */ - public ReferencesArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + /** + * Associates a customer to the checkout. + */ - /** - * Returns the elements that come before the specified cursor. - */ - public ReferencesArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public CheckoutCustomerAssociateV2Payload getCheckoutCustomerAssociateV2() { + return (CheckoutCustomerAssociateV2Payload) get("checkoutCustomerAssociateV2"); } - public interface ReferencesArgumentsDefinition { - void define(ReferencesArguments args); + public Mutation setCheckoutCustomerAssociateV2(CheckoutCustomerAssociateV2Payload arg) { + optimisticData.put(getKey("checkoutCustomerAssociateV2"), arg); + return this; } /** - * A list of referenced objects if the field type is a resource reference list. + * Disassociates the current checkout customer from the checkout. */ - public MetaobjectFieldQuery references(MetafieldReferenceConnectionQueryDefinition queryDef) { - return references(args -> {}, queryDef); + + public CheckoutCustomerDisassociateV2Payload getCheckoutCustomerDisassociateV2() { + return (CheckoutCustomerDisassociateV2Payload) get("checkoutCustomerDisassociateV2"); + } + + public Mutation setCheckoutCustomerDisassociateV2(CheckoutCustomerDisassociateV2Payload arg) { + optimisticData.put(getKey("checkoutCustomerDisassociateV2"), arg); + return this; } /** - * A list of referenced objects if the field type is a resource reference list. + * Applies a discount to an existing checkout using a discount code. */ - public MetaobjectFieldQuery references(ReferencesArgumentsDefinition argsDef, MetafieldReferenceConnectionQueryDefinition queryDef) { - startField("references"); - ReferencesArguments args = new ReferencesArguments(_queryBuilder); - argsDef.define(args); - ReferencesArguments.end(args); + public CheckoutDiscountCodeApplyV2Payload getCheckoutDiscountCodeApplyV2() { + return (CheckoutDiscountCodeApplyV2Payload) get("checkoutDiscountCodeApplyV2"); + } - _queryBuilder.append('{'); - queryDef.define(new MetafieldReferenceConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Mutation setCheckoutDiscountCodeApplyV2(CheckoutDiscountCodeApplyV2Payload arg) { + optimisticData.put(getKey("checkoutDiscountCodeApplyV2"), arg); + return this; + } + + /** + * Removes the applied discounts from an existing checkout. + */ + + public CheckoutDiscountCodeRemovePayload getCheckoutDiscountCodeRemove() { + return (CheckoutDiscountCodeRemovePayload) get("checkoutDiscountCodeRemove"); + } + public Mutation setCheckoutDiscountCodeRemove(CheckoutDiscountCodeRemovePayload arg) { + optimisticData.put(getKey("checkoutDiscountCodeRemove"), arg); return this; } /** - * The type name of the field. - * See the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). + * Updates the email on an existing checkout. */ - public MetaobjectFieldQuery type() { - startField("type"); + public CheckoutEmailUpdateV2Payload getCheckoutEmailUpdateV2() { + return (CheckoutEmailUpdateV2Payload) get("checkoutEmailUpdateV2"); + } + + public Mutation setCheckoutEmailUpdateV2(CheckoutEmailUpdateV2Payload arg) { + optimisticData.put(getKey("checkoutEmailUpdateV2"), arg); return this; } /** - * The field value. + * Removes an applied gift card from the checkout. */ - public MetaobjectFieldQuery value() { - startField("value"); + public CheckoutGiftCardRemoveV2Payload getCheckoutGiftCardRemoveV2() { + return (CheckoutGiftCardRemoveV2Payload) get("checkoutGiftCardRemoveV2"); + } + + public Mutation setCheckoutGiftCardRemoveV2(CheckoutGiftCardRemoveV2Payload arg) { + optimisticData.put(getKey("checkoutGiftCardRemoveV2"), arg); return this; } - } - /** - * Provides the value of a Metaobject field. - */ - public static class MetaobjectField extends AbstractResponse { - public MetaobjectField() { + /** + * Appends gift cards to an existing checkout. + */ + + public CheckoutGiftCardsAppendPayload getCheckoutGiftCardsAppend() { + return (CheckoutGiftCardsAppendPayload) get("checkoutGiftCardsAppend"); } - public MetaobjectField(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "key": { - responseData.put(key, jsonAsString(field.getValue(), key)); + public Mutation setCheckoutGiftCardsAppend(CheckoutGiftCardsAppendPayload arg) { + optimisticData.put(getKey("checkoutGiftCardsAppend"), arg); + return this; + } - break; - } + /** + * Adds a list of line items to a checkout. + */ - case "reference": { - MetafieldReference optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = UnknownMetafieldReference.create(jsonAsObject(field.getValue(), key)); - } + public CheckoutLineItemsAddPayload getCheckoutLineItemsAdd() { + return (CheckoutLineItemsAddPayload) get("checkoutLineItemsAdd"); + } - responseData.put(key, optional1); + public Mutation setCheckoutLineItemsAdd(CheckoutLineItemsAddPayload arg) { + optimisticData.put(getKey("checkoutLineItemsAdd"), arg); + return this; + } - break; - } + /** + * Removes line items from an existing checkout. + */ - case "references": { - MetafieldReferenceConnection optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MetafieldReferenceConnection(jsonAsObject(field.getValue(), key)); - } + public CheckoutLineItemsRemovePayload getCheckoutLineItemsRemove() { + return (CheckoutLineItemsRemovePayload) get("checkoutLineItemsRemove"); + } - responseData.put(key, optional1); + public Mutation setCheckoutLineItemsRemove(CheckoutLineItemsRemovePayload arg) { + optimisticData.put(getKey("checkoutLineItemsRemove"), arg); + return this; + } - break; - } + /** + * Sets a list of line items to a checkout. + */ - case "type": { - responseData.put(key, jsonAsString(field.getValue(), key)); + public CheckoutLineItemsReplacePayload getCheckoutLineItemsReplace() { + return (CheckoutLineItemsReplacePayload) get("checkoutLineItemsReplace"); + } - break; - } + public Mutation setCheckoutLineItemsReplace(CheckoutLineItemsReplacePayload arg) { + optimisticData.put(getKey("checkoutLineItemsReplace"), arg); + return this; + } - case "value": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + /** + * Updates line items on a checkout. + */ - responseData.put(key, optional1); + public CheckoutLineItemsUpdatePayload getCheckoutLineItemsUpdate() { + return (CheckoutLineItemsUpdatePayload) get("checkoutLineItemsUpdate"); + } - break; - } + public Mutation setCheckoutLineItemsUpdate(CheckoutLineItemsUpdatePayload arg) { + optimisticData.put(getKey("checkoutLineItemsUpdate"), arg); + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + /** + * Updates the shipping address of an existing checkout. + */ + + public CheckoutShippingAddressUpdateV2Payload getCheckoutShippingAddressUpdateV2() { + return (CheckoutShippingAddressUpdateV2Payload) get("checkoutShippingAddressUpdateV2"); } - public String getGraphQlTypeName() { - return "MetaobjectField"; + public Mutation setCheckoutShippingAddressUpdateV2(CheckoutShippingAddressUpdateV2Payload arg) { + optimisticData.put(getKey("checkoutShippingAddressUpdateV2"), arg); + return this; } /** - * The field key. + * Updates the shipping lines on an existing checkout. */ - public String getKey() { - return (String) get("key"); + public CheckoutShippingLineUpdatePayload getCheckoutShippingLineUpdate() { + return (CheckoutShippingLineUpdatePayload) get("checkoutShippingLineUpdate"); } - public MetaobjectField setKey(String arg) { - optimisticData.put(getKey("key"), arg); + public Mutation setCheckoutShippingLineUpdate(CheckoutShippingLineUpdatePayload arg) { + optimisticData.put(getKey("checkoutShippingLineUpdate"), arg); + return this; + } + + /** + * Creates a customer access token. + * The customer access token is required to modify the customer object in any way. + */ + + public CustomerAccessTokenCreatePayload getCustomerAccessTokenCreate() { + return (CustomerAccessTokenCreatePayload) get("customerAccessTokenCreate"); + } + + public Mutation setCustomerAccessTokenCreate(CustomerAccessTokenCreatePayload arg) { + optimisticData.put(getKey("customerAccessTokenCreate"), arg); + return this; + } + + /** + * Creates a customer access token using a + * [multipass token](https://shopify.dev/api/multipass) instead of email and + * password. A customer record is created if the customer doesn't exist. If a customer + * record already exists but the record is disabled, then the customer record is enabled. + */ + + public CustomerAccessTokenCreateWithMultipassPayload getCustomerAccessTokenCreateWithMultipass() { + return (CustomerAccessTokenCreateWithMultipassPayload) get("customerAccessTokenCreateWithMultipass"); + } + + public Mutation setCustomerAccessTokenCreateWithMultipass(CustomerAccessTokenCreateWithMultipassPayload arg) { + optimisticData.put(getKey("customerAccessTokenCreateWithMultipass"), arg); return this; } /** - * A referenced object if the field type is a resource reference. + * Permanently destroys a customer access token. */ - public MetafieldReference getReference() { - return (MetafieldReference) get("reference"); + public CustomerAccessTokenDeletePayload getCustomerAccessTokenDelete() { + return (CustomerAccessTokenDeletePayload) get("customerAccessTokenDelete"); } - public MetaobjectField setReference(MetafieldReference arg) { - optimisticData.put(getKey("reference"), arg); + public Mutation setCustomerAccessTokenDelete(CustomerAccessTokenDeletePayload arg) { + optimisticData.put(getKey("customerAccessTokenDelete"), arg); return this; } /** - * A list of referenced objects if the field type is a resource reference list. + * Renews a customer access token. + * Access token renewal must happen *before* a token expires. + * If a token has already expired, a new one should be created instead via `customerAccessTokenCreate`. */ - public MetafieldReferenceConnection getReferences() { - return (MetafieldReferenceConnection) get("references"); + public CustomerAccessTokenRenewPayload getCustomerAccessTokenRenew() { + return (CustomerAccessTokenRenewPayload) get("customerAccessTokenRenew"); } - public MetaobjectField setReferences(MetafieldReferenceConnection arg) { - optimisticData.put(getKey("references"), arg); + public Mutation setCustomerAccessTokenRenew(CustomerAccessTokenRenewPayload arg) { + optimisticData.put(getKey("customerAccessTokenRenew"), arg); return this; } /** - * The type name of the field. - * See the list of [supported types](https://shopify.dev/apps/metafields/definitions/types). + * Activates a customer. */ - public String getType() { - return (String) get("type"); + public CustomerActivatePayload getCustomerActivate() { + return (CustomerActivatePayload) get("customerActivate"); } - public MetaobjectField setType(String arg) { - optimisticData.put(getKey("type"), arg); + public Mutation setCustomerActivate(CustomerActivatePayload arg) { + optimisticData.put(getKey("customerActivate"), arg); return this; } /** - * The field value. + * Activates a customer with the activation url received from `customerCreate`. */ - public String getValue() { - return (String) get("value"); + public CustomerActivateByUrlPayload getCustomerActivateByUrl() { + return (CustomerActivateByUrlPayload) get("customerActivateByUrl"); } - public MetaobjectField setValue(String arg) { - optimisticData.put(getKey("value"), arg); + public Mutation setCustomerActivateByUrl(CustomerActivateByUrlPayload arg) { + optimisticData.put(getKey("customerActivateByUrl"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "key": return false; - - case "reference": return false; - - case "references": return true; - - case "type": return false; - - case "value": return false; + /** + * Creates a new address for a customer. + */ - default: return false; - } + public CustomerAddressCreatePayload getCustomerAddressCreate() { + return (CustomerAddressCreatePayload) get("customerAddressCreate"); } - } - - public static class MetaobjectHandleInput implements Serializable { - private String handle; - - private String type; - - public MetaobjectHandleInput(String handle, String type) { - this.handle = handle; - this.type = type; + public Mutation setCustomerAddressCreate(CustomerAddressCreatePayload arg) { + optimisticData.put(getKey("customerAddressCreate"), arg); + return this; } - public String getHandle() { - return handle; + /** + * Permanently deletes the address of an existing customer. + */ + + public CustomerAddressDeletePayload getCustomerAddressDelete() { + return (CustomerAddressDeletePayload) get("customerAddressDelete"); } - public MetaobjectHandleInput setHandle(String handle) { - this.handle = handle; + public Mutation setCustomerAddressDelete(CustomerAddressDeletePayload arg) { + optimisticData.put(getKey("customerAddressDelete"), arg); return this; } - public String getType() { - return type; + /** + * Updates the address of an existing customer. + */ + + public CustomerAddressUpdatePayload getCustomerAddressUpdate() { + return (CustomerAddressUpdatePayload) get("customerAddressUpdate"); } - public MetaobjectHandleInput setType(String type) { - this.type = type; + public Mutation setCustomerAddressUpdate(CustomerAddressUpdatePayload arg) { + optimisticData.put(getKey("customerAddressUpdate"), arg); return this; } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("handle:"); - Query.appendQuotedString(_queryBuilder, handle.toString()); + /** + * Creates a new customer. + */ - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("type:"); - Query.appendQuotedString(_queryBuilder, type.toString()); + public CustomerCreatePayload getCustomerCreate() { + return (CustomerCreatePayload) get("customerCreate"); + } - _queryBuilder.append('}'); + public Mutation setCustomerCreate(CustomerCreatePayload arg) { + optimisticData.put(getKey("customerCreate"), arg); + return this; } - } - public interface Model3dQueryDefinition { - void define(Model3dQuery _queryBuilder); - } + /** + * Updates the default address of an existing customer. + */ - /** - * Represents a Shopify hosted 3D model. - */ - public static class Model3dQuery extends Query { - Model3dQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public CustomerDefaultAddressUpdatePayload getCustomerDefaultAddressUpdate() { + return (CustomerDefaultAddressUpdatePayload) get("customerDefaultAddressUpdate"); + } - startField("id"); + public Mutation setCustomerDefaultAddressUpdate(CustomerDefaultAddressUpdatePayload arg) { + optimisticData.put(getKey("customerDefaultAddressUpdate"), arg); + return this; } /** - * A word or phrase to share the nature or contents of a media. + * Sends a reset password email to the customer. The reset password + * email contains a reset password URL and token that you can pass to + * the [`customerResetByUrl`](https://shopify.dev/api/storefront/latest/mutations/customerResetByUrl) + * or + * [`customerReset`](https://shopify.dev/api/storefront/latest/mutations/customerReset) mutation to + * reset the + * customer password. + * This mutation is throttled by IP. With authenticated access, + * you can provide a + * [`Shopify-Storefront-Buyer-IP`](https://shopify.dev/api/usage/authentication#optional-ip-header) + * instead of the request IP. + * Make sure that the value provided to `Shopify-Storefront-Buyer-IP` is trusted. Unthrottled access to + * this + * mutation presents a security risk. */ - public Model3dQuery alt() { - startField("alt"); + public CustomerRecoverPayload getCustomerRecover() { + return (CustomerRecoverPayload) get("customerRecover"); + } + + public Mutation setCustomerRecover(CustomerRecoverPayload arg) { + optimisticData.put(getKey("customerRecover"), arg); return this; } /** - * The media content type. + * "Resets a customer’s password with the token received from a reset password email. You can send a + * reset password email with the + * [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation." */ - public Model3dQuery mediaContentType() { - startField("mediaContentType"); + public CustomerResetPayload getCustomerReset() { + return (CustomerResetPayload) get("customerReset"); + } + + public Mutation setCustomerReset(CustomerResetPayload arg) { + optimisticData.put(getKey("customerReset"), arg); return this; } /** - * The preview image for the media. + * "Resets a customer’s password with the reset password URL received from a reset password email. You + * can send a reset password email with the + * [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation." */ - public Model3dQuery previewImage(ImageQueryDefinition queryDef) { - startField("previewImage"); - _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CustomerResetByUrlPayload getCustomerResetByUrl() { + return (CustomerResetByUrlPayload) get("customerResetByUrl"); + } + public Mutation setCustomerResetByUrl(CustomerResetByUrlPayload arg) { + optimisticData.put(getKey("customerResetByUrl"), arg); return this; } /** - * The sources for a 3d model. + * Updates an existing customer. */ - public Model3dQuery sources(Model3dSourceQueryDefinition queryDef) { - startField("sources"); - _queryBuilder.append('{'); - queryDef.define(new Model3dSourceQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CustomerUpdatePayload getCustomerUpdate() { + return (CustomerUpdatePayload) get("customerUpdate"); + } + public Mutation setCustomerUpdate(CustomerUpdatePayload arg) { + optimisticData.put(getKey("customerUpdate"), arg); return this; } - } - /** - * Represents a Shopify hosted 3D model. - */ - public static class Model3d extends AbstractResponse implements Media, Node { - public Model3d() { - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cartAttributesUpdate": return true; - public Model3d(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "alt": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + case "cartBuyerIdentityUpdate": return true; - responseData.put(key, optional1); + case "cartCreate": return true; - break; - } + case "cartDiscountCodesUpdate": return true; - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case "cartLinesAdd": return true; - break; - } + case "cartLinesRemove": return true; - case "mediaContentType": { - responseData.put(key, MediaContentType.fromGraphQl(jsonAsString(field.getValue(), key))); + case "cartLinesUpdate": return true; - break; - } + case "cartMetafieldDelete": return true; - case "previewImage": { - Image optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); - } + case "cartMetafieldsSet": return true; - responseData.put(key, optional1); + case "cartNoteUpdate": return true; - break; - } + case "cartPaymentUpdate": return true; - case "sources": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Model3dSource(jsonAsObject(element1, key))); - } + case "cartSelectedDeliveryOptionsUpdate": return true; - responseData.put(key, list1); + case "cartSubmitForCompletion": return true; - break; - } + case "checkoutAttributesUpdateV2": return true; - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } + case "checkoutCompleteFree": return true; - public Model3d(ID id) { - this(); - optimisticData.put("id", id); - } + case "checkoutCompleteWithCreditCardV2": return true; - public String getGraphQlTypeName() { - return "Model3d"; - } + case "checkoutCompleteWithTokenizedPaymentV3": return true; - /** - * A word or phrase to share the nature or contents of a media. - */ + case "checkoutCreate": return true; - public String getAlt() { - return (String) get("alt"); - } + case "checkoutCustomerAssociateV2": return true; - public Model3d setAlt(String arg) { - optimisticData.put(getKey("alt"), arg); - return this; - } + case "checkoutCustomerDisassociateV2": return true; - /** - * A globally-unique identifier. - */ + case "checkoutDiscountCodeApplyV2": return true; - public ID getId() { - return (ID) get("id"); - } + case "checkoutDiscountCodeRemove": return true; - /** - * The media content type. - */ + case "checkoutEmailUpdateV2": return true; - public MediaContentType getMediaContentType() { - return (MediaContentType) get("mediaContentType"); - } + case "checkoutGiftCardRemoveV2": return true; - public Model3d setMediaContentType(MediaContentType arg) { - optimisticData.put(getKey("mediaContentType"), arg); - return this; - } + case "checkoutGiftCardsAppend": return true; - /** - * The preview image for the media. - */ + case "checkoutLineItemsAdd": return true; - public Image getPreviewImage() { - return (Image) get("previewImage"); - } + case "checkoutLineItemsRemove": return true; - public Model3d setPreviewImage(Image arg) { - optimisticData.put(getKey("previewImage"), arg); - return this; - } + case "checkoutLineItemsReplace": return true; - /** - * The sources for a 3d model. - */ + case "checkoutLineItemsUpdate": return true; - public List getSources() { - return (List) get("sources"); - } + case "checkoutShippingAddressUpdateV2": return true; - public Model3d setSources(List arg) { - optimisticData.put(getKey("sources"), arg); - return this; - } + case "checkoutShippingLineUpdate": return true; - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "alt": return false; + case "customerAccessTokenCreate": return true; - case "id": return false; + case "customerAccessTokenCreateWithMultipass": return true; - case "mediaContentType": return false; + case "customerAccessTokenDelete": return true; - case "previewImage": return true; + case "customerAccessTokenRenew": return true; - case "sources": return true; + case "customerActivate": return true; + + case "customerActivateByUrl": return true; + + case "customerAddressCreate": return true; + + case "customerAddressDelete": return true; + + case "customerAddressUpdate": return true; + + case "customerCreate": return true; + + case "customerDefaultAddressUpdate": return true; + + case "customerRecover": return true; + + case "customerReset": return true; + + case "customerResetByUrl": return true; + + case "customerUpdate": return true; default: return false; } } } - public interface Model3dSourceQueryDefinition { - void define(Model3dSourceQuery _queryBuilder); + public interface NodeQueryDefinition { + void define(NodeQuery _queryBuilder); } /** - * Represents a source for a Shopify hosted 3d model. + * An object with an ID field to support global identification, in accordance with the + * [Relay specification](https://relay.dev/graphql/objectidentification.htm#sec-Node-Interface). + * This interface is used by the [node](https://shopify.dev/api/admin-graphql/unstable/queries/node) + * and [nodes](https://shopify.dev/api/admin-graphql/unstable/queries/nodes) queries. */ - public static class Model3dSourceQuery extends Query { - Model3dSourceQuery(StringBuilder _queryBuilder) { + public static class NodeQuery extends Query { + NodeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("__typename"); } /** - * The filesize of the 3d model. + * A globally-unique identifier. */ - public Model3dSourceQuery filesize() { - startField("filesize"); + public NodeQuery id() { + startField("id"); return this; } - /** - * The format of the 3d model. - */ - public Model3dSourceQuery format() { - startField("format"); - + public NodeQuery onAppliedGiftCard(AppliedGiftCardQueryDefinition queryDef) { + startInlineFragment("AppliedGiftCard"); + queryDef.define(new AppliedGiftCardQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The MIME type of the 3d model. - */ - public Model3dSourceQuery mimeType() { - startField("mimeType"); - + public NodeQuery onArticle(ArticleQueryDefinition queryDef) { + startInlineFragment("Article"); + queryDef.define(new ArticleQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The URL of the 3d model. - */ - public Model3dSourceQuery url() { - startField("url"); - + public NodeQuery onBlog(BlogQueryDefinition queryDef) { + startInlineFragment("Blog"); + queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - } - /** - * Represents a source for a Shopify hosted 3d model. - */ - public static class Model3dSource extends AbstractResponse { - public Model3dSource() { + public NodeQuery onCart(CartQueryDefinition queryDef) { + startInlineFragment("Cart"); + queryDef.define(new CartQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public Model3dSource(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "filesize": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); - - break; - } - - case "format": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "mimeType": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } + public NodeQuery onCartLine(CartLineQueryDefinition queryDef) { + startInlineFragment("CartLine"); + queryDef.define(new CartLineQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case "url": { - responseData.put(key, jsonAsString(field.getValue(), key)); + public NodeQuery onCheckout(CheckoutQueryDefinition queryDef) { + startInlineFragment("Checkout"); + queryDef.define(new CheckoutQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - break; - } + public NodeQuery onCheckoutLineItem(CheckoutLineItemQueryDefinition queryDef) { + startInlineFragment("CheckoutLineItem"); + queryDef.define(new CheckoutLineItemQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public NodeQuery onCollection(CollectionQueryDefinition queryDef) { + startInlineFragment("Collection"); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public String getGraphQlTypeName() { - return "Model3dSource"; + public NodeQuery onComment(CommentQueryDefinition queryDef) { + startInlineFragment("Comment"); + queryDef.define(new CommentQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - /** - * The filesize of the 3d model. - */ + public NodeQuery onExternalVideo(ExternalVideoQueryDefinition queryDef) { + startInlineFragment("ExternalVideo"); + queryDef.define(new ExternalVideoQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - public Integer getFilesize() { - return (Integer) get("filesize"); + public NodeQuery onGenericFile(GenericFileQueryDefinition queryDef) { + startInlineFragment("GenericFile"); + queryDef.define(new GenericFileQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public Model3dSource setFilesize(Integer arg) { - optimisticData.put(getKey("filesize"), arg); + public NodeQuery onLocation(LocationQueryDefinition queryDef) { + startInlineFragment("Location"); + queryDef.define(new LocationQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The format of the 3d model. - */ - - public String getFormat() { - return (String) get("format"); + public NodeQuery onMailingAddress(MailingAddressQueryDefinition queryDef) { + startInlineFragment("MailingAddress"); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public Model3dSource setFormat(String arg) { - optimisticData.put(getKey("format"), arg); + public NodeQuery onMarket(MarketQueryDefinition queryDef) { + startInlineFragment("Market"); + queryDef.define(new MarketQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The MIME type of the 3d model. - */ - - public String getMimeType() { - return (String) get("mimeType"); + public NodeQuery onMediaImage(MediaImageQueryDefinition queryDef) { + startInlineFragment("MediaImage"); + queryDef.define(new MediaImageQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public Model3dSource setMimeType(String arg) { - optimisticData.put(getKey("mimeType"), arg); + public NodeQuery onMediaPresentation(MediaPresentationQueryDefinition queryDef) { + startInlineFragment("MediaPresentation"); + queryDef.define(new MediaPresentationQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The URL of the 3d model. - */ - - public String getUrl() { - return (String) get("url"); + public NodeQuery onMenu(MenuQueryDefinition queryDef) { + startInlineFragment("Menu"); + queryDef.define(new MenuQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public Model3dSource setUrl(String arg) { - optimisticData.put(getKey("url"), arg); + public NodeQuery onMenuItem(MenuItemQueryDefinition queryDef) { + startInlineFragment("MenuItem"); + queryDef.define(new MenuItemQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "filesize": return false; - - case "format": return false; - - case "mimeType": return false; - - case "url": return false; - - default: return false; - } + public NodeQuery onMetafield(MetafieldQueryDefinition queryDef) { + startInlineFragment("Metafield"); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - } - - public static class MoneyInput implements Serializable { - private String amount; - private CurrencyCode currencyCode; - - public MoneyInput(String amount, CurrencyCode currencyCode) { - this.amount = amount; - - this.currencyCode = currencyCode; + public NodeQuery onMetaobject(MetaobjectQueryDefinition queryDef) { + startInlineFragment("Metaobject"); + queryDef.define(new MetaobjectQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public String getAmount() { - return amount; + public NodeQuery onModel3d(Model3dQueryDefinition queryDef) { + startInlineFragment("Model3d"); + queryDef.define(new Model3dQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public MoneyInput setAmount(String amount) { - this.amount = amount; + public NodeQuery onOrder(OrderQueryDefinition queryDef) { + startInlineFragment("Order"); + queryDef.define(new OrderQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - public CurrencyCode getCurrencyCode() { - return currencyCode; + public NodeQuery onPage(PageQueryDefinition queryDef) { + startInlineFragment("Page"); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public MoneyInput setCurrencyCode(CurrencyCode currencyCode) { - this.currencyCode = currencyCode; + public NodeQuery onPayment(PaymentQueryDefinition queryDef) { + startInlineFragment("Payment"); + queryDef.define(new PaymentQuery(_queryBuilder)); + _queryBuilder.append('}'); 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("currencyCode:"); - _queryBuilder.append(currencyCode.toString()); - + public NodeQuery onProduct(ProductQueryDefinition queryDef) { + startInlineFragment("Product"); + queryDef.define(new ProductQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - } - public interface MoneyV2QueryDefinition { - void define(MoneyV2Query _queryBuilder); - } + public NodeQuery onProductOption(ProductOptionQueryDefinition queryDef) { + startInlineFragment("ProductOption"); + queryDef.define(new ProductOptionQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - /** - * A monetary value with currency. - */ - public static class MoneyV2Query extends Query { - MoneyV2Query(StringBuilder _queryBuilder) { - super(_queryBuilder); + public NodeQuery onProductVariant(ProductVariantQueryDefinition queryDef) { + startInlineFragment("ProductVariant"); + queryDef.define(new ProductVariantQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - /** - * Decimal money amount. - */ - public MoneyV2Query amount() { - startField("amount"); + public NodeQuery onShop(ShopQueryDefinition queryDef) { + startInlineFragment("Shop"); + queryDef.define(new ShopQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + public NodeQuery onShopPolicy(ShopPolicyQueryDefinition queryDef) { + startInlineFragment("ShopPolicy"); + queryDef.define(new ShopPolicyQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * Currency of the money. - */ - public MoneyV2Query currencyCode() { - startField("currencyCode"); + public NodeQuery onUrlRedirect(UrlRedirectQueryDefinition queryDef) { + startInlineFragment("UrlRedirect"); + queryDef.define(new UrlRedirectQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + public NodeQuery onVideo(VideoQueryDefinition queryDef) { + startInlineFragment("Video"); + queryDef.define(new VideoQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } + public interface Node extends com.shopify.graphql.support.Node { + String getGraphQlTypeName(); + + ID getId(); + } + /** - * A monetary value with currency. + * An object with an ID field to support global identification, in accordance with the + * [Relay specification](https://relay.dev/graphql/objectidentification.htm#sec-Node-Interface). + * This interface is used by the [node](https://shopify.dev/api/admin-graphql/unstable/queries/node) + * and [nodes](https://shopify.dev/api/admin-graphql/unstable/queries/nodes) queries. */ - public static class MoneyV2 extends AbstractResponse implements PricingValue, SellingPlanCheckoutChargeValue { - public MoneyV2() { + public static class UnknownNode extends AbstractResponse implements Node { + public UnknownNode() { } - public MoneyV2(JsonObject fields) throws SchemaViolationError { + public UnknownNode(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "amount": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "currencyCode": { - responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); break; } @@ -42276,678 +49562,709 @@ public MoneyV2(JsonObject fields) throws SchemaViolationError { } } - public String getGraphQlTypeName() { - return "MoneyV2"; - } + public static Node create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "AppliedGiftCard": { + return new AppliedGiftCard(fields); + } - /** - * Decimal money amount. - */ + case "Article": { + return new Article(fields); + } - public String getAmount() { - return (String) get("amount"); + case "Blog": { + return new Blog(fields); + } + + case "Cart": { + return new Cart(fields); + } + + case "CartLine": { + return new CartLine(fields); + } + + case "Checkout": { + return new Checkout(fields); + } + + case "CheckoutLineItem": { + return new CheckoutLineItem(fields); + } + + case "Collection": { + return new Collection(fields); + } + + case "Comment": { + return new Comment(fields); + } + + case "ExternalVideo": { + return new ExternalVideo(fields); + } + + case "GenericFile": { + return new GenericFile(fields); + } + + case "Location": { + return new Location(fields); + } + + case "MailingAddress": { + return new MailingAddress(fields); + } + + case "Market": { + return new Market(fields); + } + + case "MediaImage": { + return new MediaImage(fields); + } + + case "MediaPresentation": { + return new MediaPresentation(fields); + } + + case "Menu": { + return new Menu(fields); + } + + case "MenuItem": { + return new MenuItem(fields); + } + + case "Metafield": { + return new Metafield(fields); + } + + case "Metaobject": { + return new Metaobject(fields); + } + + case "Model3d": { + return new Model3d(fields); + } + + case "Order": { + return new Order(fields); + } + + case "Page": { + return new Page(fields); + } + + case "Payment": { + return new Payment(fields); + } + + case "Product": { + return new Product(fields); + } + + case "ProductOption": { + return new ProductOption(fields); + } + + case "ProductVariant": { + return new ProductVariant(fields); + } + + case "Shop": { + return new Shop(fields); + } + + case "ShopPolicy": { + return new ShopPolicy(fields); + } + + case "UrlRedirect": { + return new UrlRedirect(fields); + } + + case "Video": { + return new Video(fields); + } + + default: { + return new UnknownNode(fields); + } + } } - public MoneyV2 setAmount(String arg) { - optimisticData.put(getKey("amount"), arg); - return this; + public String getGraphQlTypeName() { + return (String) get("__typename"); } /** - * Currency of the money. + * A globally-unique identifier. */ - public CurrencyCode getCurrencyCode() { - return (CurrencyCode) get("currencyCode"); + public ID getId() { + return (ID) get("id"); } - public MoneyV2 setCurrencyCode(CurrencyCode arg) { - optimisticData.put(getKey("currencyCode"), arg); + public UnknownNode setId(ID arg) { + optimisticData.put(getKey("id"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "amount": return false; - - case "currencyCode": return false; + case "id": return false; default: return false; } } } - public interface MutationQueryDefinition { - void define(MutationQuery _queryBuilder); + public interface OnlineStorePublishableQueryDefinition { + void define(OnlineStorePublishableQuery _queryBuilder); } /** - * The schema’s entry-point for mutations. This acts as the public, top-level API from which all - * mutation queries must start. + * Represents a resource that can be published to the Online Store sales channel. */ - public static class MutationQuery extends Query { - MutationQuery(StringBuilder _queryBuilder) { + public static class OnlineStorePublishableQuery extends Query { + OnlineStorePublishableQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("__typename"); } /** - * Updates the attributes on a cart. + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. */ - public MutationQuery cartAttributesUpdate(List attributes, ID cartId, CartAttributesUpdatePayloadQueryDefinition queryDef) { - startField("cartAttributesUpdate"); + public OnlineStorePublishableQuery onlineStoreUrl() { + startField("onlineStoreUrl"); - _queryBuilder.append("(attributes:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (AttributeInput item1 : attributes) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); + return this; + } - _queryBuilder.append(",cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); + public OnlineStorePublishableQuery onArticle(ArticleQueryDefinition queryDef) { + startInlineFragment("Article"); + queryDef.define(new ArticleQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - _queryBuilder.append(')'); + public OnlineStorePublishableQuery onBlog(BlogQueryDefinition queryDef) { + startInlineFragment("Blog"); + queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new CartAttributesUpdatePayloadQuery(_queryBuilder)); + public OnlineStorePublishableQuery onCollection(CollectionQueryDefinition queryDef) { + startInlineFragment("Collection"); + queryDef.define(new CollectionQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; + } + public OnlineStorePublishableQuery onPage(PageQueryDefinition queryDef) { + startInlineFragment("Page"); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * Updates customer information associated with a cart. - * Buyer identity is used to determine - * [international - * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing) - * and should match the customer's shipping address. - */ - public MutationQuery cartBuyerIdentityUpdate(ID cartId, CartBuyerIdentityInput buyerIdentity, CartBuyerIdentityUpdatePayloadQueryDefinition queryDef) { - startField("cartBuyerIdentityUpdate"); + public OnlineStorePublishableQuery onProduct(ProductQueryDefinition queryDef) { + startInlineFragment("Product"); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + } - _queryBuilder.append("(cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); + public interface OnlineStorePublishable { + String getGraphQlTypeName(); - _queryBuilder.append(",buyerIdentity:"); - buyerIdentity.appendTo(_queryBuilder); + String getOnlineStoreUrl(); + } - _queryBuilder.append(')'); + /** + * Represents a resource that can be published to the Online Store sales channel. + */ + public static class UnknownOnlineStorePublishable extends AbstractResponse implements OnlineStorePublishable { + public UnknownOnlineStorePublishable() { + } - _queryBuilder.append('{'); - queryDef.define(new CartBuyerIdentityUpdatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public UnknownOnlineStorePublishable(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "onlineStoreUrl": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - return this; - } + responseData.put(key, optional1); - public class CartCreateArguments extends Arguments { - CartCreateArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + break; + } - /** - * The fields used to create a cart. - */ - public CartCreateArguments input(CartInput value) { - if (value != null) { - startArgument("input"); - value.appendTo(_queryBuilder); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } } - public interface CartCreateArgumentsDefinition { - void define(CartCreateArguments args); - } - - /** - * Creates a new cart. - */ - public MutationQuery cartCreate(CartCreatePayloadQueryDefinition queryDef) { - return cartCreate(args -> {}, queryDef); - } - - /** - * Creates a new cart. - */ - public MutationQuery cartCreate(CartCreateArgumentsDefinition argsDef, CartCreatePayloadQueryDefinition queryDef) { - startField("cartCreate"); + public static OnlineStorePublishable create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "Article": { + return new Article(fields); + } - CartCreateArguments args = new CartCreateArguments(_queryBuilder); - argsDef.define(args); - CartCreateArguments.end(args); + case "Blog": { + return new Blog(fields); + } - _queryBuilder.append('{'); - queryDef.define(new CartCreatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "Collection": { + return new Collection(fields); + } - return this; - } + case "Page": { + return new Page(fields); + } - public class CartDiscountCodesUpdateArguments extends Arguments { - CartDiscountCodesUpdateArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } + case "Product": { + return new Product(fields); + } - /** - * The case-insensitive discount codes that the customer added at checkout. - */ - public CartDiscountCodesUpdateArguments discountCodes(List value) { - if (value != null) { - startArgument("discountCodes"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (String item1 : value) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - Query.appendQuotedString(_queryBuilder, item1.toString()); - } - } - _queryBuilder.append(']'); + default: { + return new UnknownOnlineStorePublishable(fields); } - return this; } } - public interface CartDiscountCodesUpdateArgumentsDefinition { - void define(CartDiscountCodesUpdateArguments args); - } - - /** - * Updates the discount codes applied to the cart. - */ - public MutationQuery cartDiscountCodesUpdate(ID cartId, CartDiscountCodesUpdatePayloadQueryDefinition queryDef) { - return cartDiscountCodesUpdate(cartId, args -> {}, queryDef); + public String getGraphQlTypeName() { + return (String) get("__typename"); } /** - * Updates the discount codes applied to the cart. + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. */ - public MutationQuery cartDiscountCodesUpdate(ID cartId, CartDiscountCodesUpdateArgumentsDefinition argsDef, CartDiscountCodesUpdatePayloadQueryDefinition queryDef) { - startField("cartDiscountCodesUpdate"); - - _queryBuilder.append("(cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); - argsDef.define(new CartDiscountCodesUpdateArguments(_queryBuilder)); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CartDiscountCodesUpdatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getOnlineStoreUrl() { + return (String) get("onlineStoreUrl"); + } + public UnknownOnlineStorePublishable setOnlineStoreUrl(String arg) { + optimisticData.put(getKey("onlineStoreUrl"), arg); return this; } - /** - * Adds a merchandise line to the cart. - */ - public MutationQuery cartLinesAdd(List lines, ID cartId, CartLinesAddPayloadQueryDefinition queryDef) { - startField("cartLinesAdd"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "onlineStoreUrl": return false; - _queryBuilder.append("(lines:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (CartLineInput item1 : lines) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } + default: return false; } - _queryBuilder.append(']'); - - _queryBuilder.append(",cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); + } + } - _queryBuilder.append(')'); + public interface OrderQueryDefinition { + void define(OrderQuery _queryBuilder); + } - _queryBuilder.append('{'); - queryDef.define(new CartLinesAddPayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * An order is a customer’s completed request to purchase one or more products from a shop. An order is + * created when a customer completes the checkout process, during which time they provides an email + * address, billing address and payment information. + */ + public static class OrderQuery extends Query { + OrderQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - return this; + startField("id"); } /** - * Removes one or more merchandise lines from the cart. + * The address associated with the payment method. */ - public MutationQuery cartLinesRemove(ID cartId, List lineIds, CartLinesRemovePayloadQueryDefinition queryDef) { - startField("cartLinesRemove"); - - _queryBuilder.append("(cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); - - _queryBuilder.append(",lineIds:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (ID item1 : lineIds) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - Query.appendQuotedString(_queryBuilder, item1.toString()); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); + public OrderQuery billingAddress(MailingAddressQueryDefinition queryDef) { + startField("billingAddress"); _queryBuilder.append('{'); - queryDef.define(new CartLinesRemovePayloadQuery(_queryBuilder)); + queryDef.define(new MailingAddressQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Updates one or more merchandise lines on a cart. + * The reason for the order's cancellation. Returns `null` if the order wasn't canceled. */ - public MutationQuery cartLinesUpdate(ID cartId, List lines, CartLinesUpdatePayloadQueryDefinition queryDef) { - startField("cartLinesUpdate"); - - _queryBuilder.append("(cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); - - _queryBuilder.append(",lines:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (CartLineUpdateInput item1 : lines) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CartLinesUpdatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public OrderQuery cancelReason() { + startField("cancelReason"); return this; } - public class CartNoteUpdateArguments extends Arguments { - CartNoteUpdateArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } - - /** - * The note on the cart. - */ - public CartNoteUpdateArguments note(String value) { - if (value != null) { - startArgument("note"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - } + /** + * The date and time when the order was canceled. Returns null if the order wasn't canceled. + */ + public OrderQuery canceledAt() { + startField("canceledAt"); - public interface CartNoteUpdateArgumentsDefinition { - void define(CartNoteUpdateArguments args); + return this; } /** - * Updates the note on the cart. + * The code of the currency used for the payment. */ - public MutationQuery cartNoteUpdate(ID cartId, CartNoteUpdatePayloadQueryDefinition queryDef) { - return cartNoteUpdate(cartId, args -> {}, queryDef); + public OrderQuery currencyCode() { + startField("currencyCode"); + + return this; } /** - * Updates the note on the cart. + * The subtotal of line items and their discounts, excluding line items that have been removed. Does + * not contain order-level discounts, duties, shipping costs, or shipping discounts. Taxes are not + * included unless the order is a taxes-included order. */ - public MutationQuery cartNoteUpdate(ID cartId, CartNoteUpdateArgumentsDefinition argsDef, CartNoteUpdatePayloadQueryDefinition queryDef) { - startField("cartNoteUpdate"); - - _queryBuilder.append("(cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); - - argsDef.define(new CartNoteUpdateArguments(_queryBuilder)); - - _queryBuilder.append(')'); + public OrderQuery currentSubtotalPrice(MoneyV2QueryDefinition queryDef) { + startField("currentSubtotalPrice"); _queryBuilder.append('{'); - queryDef.define(new CartNoteUpdatePayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Update the selected delivery options for a delivery group. + * The total cost of duties for the order, including refunds. */ - public MutationQuery cartSelectedDeliveryOptionsUpdate(ID cartId, List selectedDeliveryOptions, CartSelectedDeliveryOptionsUpdatePayloadQueryDefinition queryDef) { - startField("cartSelectedDeliveryOptionsUpdate"); - - _queryBuilder.append("(cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); - - _queryBuilder.append(",selectedDeliveryOptions:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (CartSelectedDeliveryOptionInput item1 : selectedDeliveryOptions) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); + public OrderQuery currentTotalDuties(MoneyV2QueryDefinition queryDef) { + startField("currentTotalDuties"); _queryBuilder.append('{'); - queryDef.define(new CartSelectedDeliveryOptionsUpdatePayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Updates the attributes of a checkout if `allowPartialAddresses` is `true`. + * The total amount of the order, including duties, taxes and discounts, minus amounts for line items + * that have been removed. */ - public MutationQuery checkoutAttributesUpdateV2(ID checkoutId, CheckoutAttributesUpdateV2Input input, CheckoutAttributesUpdateV2PayloadQueryDefinition queryDef) { - startField("checkoutAttributesUpdateV2"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",input:"); - input.appendTo(_queryBuilder); - - _queryBuilder.append(')'); + public OrderQuery currentTotalPrice(MoneyV2QueryDefinition queryDef) { + startField("currentTotalPrice"); _queryBuilder.append('{'); - queryDef.define(new CheckoutAttributesUpdateV2PayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Completes a checkout without providing payment information. You can use this mutation for free items - * or items whose purchase price is covered by a gift card. + * The total of all taxes applied to the order, excluding taxes for returned line items. */ - public MutationQuery checkoutCompleteFree(ID checkoutId, CheckoutCompleteFreePayloadQueryDefinition queryDef) { - startField("checkoutCompleteFree"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(')'); + public OrderQuery currentTotalTax(MoneyV2QueryDefinition queryDef) { + startField("currentTotalTax"); _queryBuilder.append('{'); - queryDef.define(new CheckoutCompleteFreePayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Completes a checkout using a credit card token from Shopify's card vault. Before you can complete - * checkouts using CheckoutCompleteWithCreditCardV2, you need to [_request payment - * processing_](https://shopify.dev/apps/channels/getting-started#request-payment-processing). + * A list of the custom attributes added to the order. */ - public MutationQuery checkoutCompleteWithCreditCardV2(ID checkoutId, CreditCardPaymentInputV2 payment, CheckoutCompleteWithCreditCardV2PayloadQueryDefinition queryDef) { - startField("checkoutCompleteWithCreditCardV2"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",payment:"); - payment.appendTo(_queryBuilder); - - _queryBuilder.append(')'); + public OrderQuery customAttributes(AttributeQueryDefinition queryDef) { + startField("customAttributes"); _queryBuilder.append('{'); - queryDef.define(new CheckoutCompleteWithCreditCardV2PayloadQuery(_queryBuilder)); + queryDef.define(new AttributeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Completes a checkout with a tokenized payment. + * The locale code in which this specific order happened. */ - public MutationQuery checkoutCompleteWithTokenizedPaymentV3(ID checkoutId, TokenizedPaymentInputV3 payment, CheckoutCompleteWithTokenizedPaymentV3PayloadQueryDefinition queryDef) { - startField("checkoutCompleteWithTokenizedPaymentV3"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",payment:"); - payment.appendTo(_queryBuilder); + public OrderQuery customerLocale() { + startField("customerLocale"); - _queryBuilder.append(')'); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutCompleteWithTokenizedPaymentV3PayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The unique URL that the customer can use to access the order. + */ + public OrderQuery customerUrl() { + startField("customerUrl"); return this; } - public class CheckoutCreateArguments extends Arguments { - CheckoutCreateArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); + public class DiscountApplicationsArguments extends Arguments { + DiscountApplicationsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); } /** - * The checkout queue token. Available only to selected stores. + * Returns up to the first `n` elements from the list. */ - public CheckoutCreateArguments queueToken(String value) { + public DiscountApplicationsArguments first(Integer value) { if (value != null) { - startArgument("queueToken"); + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come after the specified cursor. + */ + public DiscountApplicationsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Returns up to the last `n` elements from the list. + */ + public DiscountApplicationsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come before the specified cursor. + */ + public DiscountApplicationsArguments before(String value) { + if (value != null) { + startArgument("before"); Query.appendQuotedString(_queryBuilder, value.toString()); } return this; } + + /** + * Reverse the order of the underlying list. + */ + public DiscountApplicationsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } } - public interface CheckoutCreateArgumentsDefinition { - void define(CheckoutCreateArguments args); + public interface DiscountApplicationsArgumentsDefinition { + void define(DiscountApplicationsArguments args); } /** - * Creates a new checkout. + * Discounts that have been applied on the order. */ - public MutationQuery checkoutCreate(CheckoutCreateInput input, CheckoutCreatePayloadQueryDefinition queryDef) { - return checkoutCreate(input, args -> {}, queryDef); + public OrderQuery discountApplications(DiscountApplicationConnectionQueryDefinition queryDef) { + return discountApplications(args -> {}, queryDef); } /** - * Creates a new checkout. + * Discounts that have been applied on the order. */ - public MutationQuery checkoutCreate(CheckoutCreateInput input, CheckoutCreateArgumentsDefinition argsDef, CheckoutCreatePayloadQueryDefinition queryDef) { - startField("checkoutCreate"); - - _queryBuilder.append("(input:"); - input.appendTo(_queryBuilder); - - argsDef.define(new CheckoutCreateArguments(_queryBuilder)); + public OrderQuery discountApplications(DiscountApplicationsArgumentsDefinition argsDef, DiscountApplicationConnectionQueryDefinition queryDef) { + startField("discountApplications"); - _queryBuilder.append(')'); + DiscountApplicationsArguments args = new DiscountApplicationsArguments(_queryBuilder); + argsDef.define(args); + DiscountApplicationsArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new CheckoutCreatePayloadQuery(_queryBuilder)); + queryDef.define(new DiscountApplicationConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Associates a customer to the checkout. + * Whether the order has had any edits applied or not. */ - public MutationQuery checkoutCustomerAssociateV2(ID checkoutId, String customerAccessToken, CheckoutCustomerAssociateV2PayloadQueryDefinition queryDef) { - startField("checkoutCustomerAssociateV2"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutCustomerAssociateV2PayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public OrderQuery edited() { + startField("edited"); return this; } /** - * Disassociates the current checkout customer from the checkout. + * The customer's email address. */ - public MutationQuery checkoutCustomerDisassociateV2(ID checkoutId, CheckoutCustomerDisassociateV2PayloadQueryDefinition queryDef) { - startField("checkoutCustomerDisassociateV2"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutCustomerDisassociateV2PayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public OrderQuery email() { + startField("email"); return this; } /** - * Applies a discount to an existing checkout using a discount code. + * The financial status of the order. */ - public MutationQuery checkoutDiscountCodeApplyV2(String discountCode, ID checkoutId, CheckoutDiscountCodeApplyV2PayloadQueryDefinition queryDef) { - startField("checkoutDiscountCodeApplyV2"); - - _queryBuilder.append("(discountCode:"); - Query.appendQuotedString(_queryBuilder, discountCode.toString()); - - _queryBuilder.append(",checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutDiscountCodeApplyV2PayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public OrderQuery financialStatus() { + startField("financialStatus"); return this; } /** - * Removes the applied discounts from an existing checkout. + * The fulfillment status for the order. */ - public MutationQuery checkoutDiscountCodeRemove(ID checkoutId, CheckoutDiscountCodeRemovePayloadQueryDefinition queryDef) { - startField("checkoutDiscountCodeRemove"); + public OrderQuery fulfillmentStatus() { + startField("fulfillmentStatus"); - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); + return this; + } - _queryBuilder.append(')'); + public class LineItemsArguments extends Arguments { + LineItemsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - _queryBuilder.append('{'); - queryDef.define(new CheckoutDiscountCodeRemovePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Returns up to the first `n` elements from the list. + */ + public LineItemsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come after the specified cursor. + */ + public LineItemsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Returns up to the last `n` elements from the list. + */ + public LineItemsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come before the specified cursor. + */ + public LineItemsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Reverse the order of the underlying list. + */ + public LineItemsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } + } - return this; + public interface LineItemsArgumentsDefinition { + void define(LineItemsArguments args); } /** - * Updates the email on an existing checkout. + * List of the order’s line items. */ - public MutationQuery checkoutEmailUpdateV2(ID checkoutId, String email, CheckoutEmailUpdateV2PayloadQueryDefinition queryDef) { - startField("checkoutEmailUpdateV2"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",email:"); - Query.appendQuotedString(_queryBuilder, email.toString()); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutEmailUpdateV2PayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + public OrderQuery lineItems(OrderLineItemConnectionQueryDefinition queryDef) { + return lineItems(args -> {}, queryDef); } /** - * Removes an applied gift card from the checkout. + * List of the order’s line items. */ - public MutationQuery checkoutGiftCardRemoveV2(ID appliedGiftCardId, ID checkoutId, CheckoutGiftCardRemoveV2PayloadQueryDefinition queryDef) { - startField("checkoutGiftCardRemoveV2"); - - _queryBuilder.append("(appliedGiftCardId:"); - Query.appendQuotedString(_queryBuilder, appliedGiftCardId.toString()); - - _queryBuilder.append(",checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); + public OrderQuery lineItems(LineItemsArgumentsDefinition argsDef, OrderLineItemConnectionQueryDefinition queryDef) { + startField("lineItems"); - _queryBuilder.append(')'); + LineItemsArguments args = new LineItemsArguments(_queryBuilder); + argsDef.define(args); + LineItemsArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new CheckoutGiftCardRemoveV2PayloadQuery(_queryBuilder)); + queryDef.define(new OrderLineItemConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Appends gift cards to an existing checkout. + * Returns a metafield found by namespace and key. */ - public MutationQuery checkoutGiftCardsAppend(List giftCardCodes, ID checkoutId, CheckoutGiftCardsAppendPayloadQueryDefinition queryDef) { - startField("checkoutGiftCardsAppend"); + public OrderQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { + startField("metafield"); - _queryBuilder.append("(giftCardCodes:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (String item1 : giftCardCodes) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - Query.appendQuotedString(_queryBuilder, item1.toString()); - } - } - _queryBuilder.append(']'); + _queryBuilder.append("(namespace:"); + Query.appendQuotedString(_queryBuilder, namespace.toString()); - _queryBuilder.append(",checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); + _queryBuilder.append(",key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new CheckoutGiftCardsAppendPayloadQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Adds a list of line items to a checkout. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public MutationQuery checkoutLineItemsAdd(List lineItems, ID checkoutId, CheckoutLineItemsAddPayloadQueryDefinition queryDef) { - startField("checkoutLineItemsAdd"); + public OrderQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); - _queryBuilder.append("(lineItems:"); + _queryBuilder.append("(identifiers:"); _queryBuilder.append('['); { String listSeperator1 = ""; - for (CheckoutLineItemInput item1 : lineItems) { + for (HasMetafieldsIdentifier item1 : identifiers) { _queryBuilder.append(listSeperator1); listSeperator1 = ","; item1.appendTo(_queryBuilder); @@ -42955,495 +50272,326 @@ public MutationQuery checkoutLineItemsAdd(List lineItems, } _queryBuilder.append(']'); - _queryBuilder.append(",checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new CheckoutLineItemsAddPayloadQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Removes line items from an existing checkout. + * Unique identifier for the order that appears on the order. + * For example, _#1000_ or _Store1001. */ - public MutationQuery checkoutLineItemsRemove(ID checkoutId, List lineItemIds, CheckoutLineItemsRemovePayloadQueryDefinition queryDef) { - startField("checkoutLineItemsRemove"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",lineItemIds:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (ID item1 : lineItemIds) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - Query.appendQuotedString(_queryBuilder, item1.toString()); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutLineItemsRemovePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public OrderQuery name() { + startField("name"); return this; } /** - * Sets a list of line items to a checkout. + * A unique numeric identifier for the order for use by shop owner and customer. */ - public MutationQuery checkoutLineItemsReplace(List lineItems, ID checkoutId, CheckoutLineItemsReplacePayloadQueryDefinition queryDef) { - startField("checkoutLineItemsReplace"); - - _queryBuilder.append("(lineItems:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (CheckoutLineItemInput item1 : lineItems) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(",checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutLineItemsReplacePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public OrderQuery orderNumber() { + startField("orderNumber"); return this; } /** - * Updates line items on a checkout. + * The total cost of duties charged at checkout. */ - public MutationQuery checkoutLineItemsUpdate(ID checkoutId, List lineItems, CheckoutLineItemsUpdatePayloadQueryDefinition queryDef) { - startField("checkoutLineItemsUpdate"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",lineItems:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (CheckoutLineItemUpdateInput item1 : lineItems) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); + public OrderQuery originalTotalDuties(MoneyV2QueryDefinition queryDef) { + startField("originalTotalDuties"); _queryBuilder.append('{'); - queryDef.define(new CheckoutLineItemsUpdatePayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Updates the shipping address of an existing checkout. + * The total price of the order before any applied edits. */ - public MutationQuery checkoutShippingAddressUpdateV2(MailingAddressInput shippingAddress, ID checkoutId, CheckoutShippingAddressUpdateV2PayloadQueryDefinition queryDef) { - startField("checkoutShippingAddressUpdateV2"); - - _queryBuilder.append("(shippingAddress:"); - shippingAddress.appendTo(_queryBuilder); - - _queryBuilder.append(",checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(')'); + public OrderQuery originalTotalPrice(MoneyV2QueryDefinition queryDef) { + startField("originalTotalPrice"); _queryBuilder.append('{'); - queryDef.define(new CheckoutShippingAddressUpdateV2PayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Updates the shipping lines on an existing checkout. + * The customer's phone number for receiving SMS notifications. */ - public MutationQuery checkoutShippingLineUpdate(ID checkoutId, String shippingRateHandle, CheckoutShippingLineUpdatePayloadQueryDefinition queryDef) { - startField("checkoutShippingLineUpdate"); - - _queryBuilder.append("(checkoutId:"); - Query.appendQuotedString(_queryBuilder, checkoutId.toString()); - - _queryBuilder.append(",shippingRateHandle:"); - Query.appendQuotedString(_queryBuilder, shippingRateHandle.toString()); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutShippingLineUpdatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public OrderQuery phone() { + startField("phone"); return this; } /** - * Creates a customer access token. - * The customer access token is required to modify the customer object in any way. + * The date and time when the order was imported. + * This value can be set to dates in the past when importing from other systems. + * If no value is provided, it will be auto-generated based on current date and time. */ - public MutationQuery customerAccessTokenCreate(CustomerAccessTokenCreateInput input, CustomerAccessTokenCreatePayloadQueryDefinition queryDef) { - startField("customerAccessTokenCreate"); - - _queryBuilder.append("(input:"); - input.appendTo(_queryBuilder); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenCreatePayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public OrderQuery processedAt() { + startField("processedAt"); return this; } /** - * Creates a customer access token using a - * [multipass token](https://shopify.dev/api/multipass) instead of email and - * password. A customer record is created if the customer doesn't exist. If a customer - * record already exists but the record is disabled, then the customer record is enabled. + * The address to where the order will be shipped. */ - public MutationQuery customerAccessTokenCreateWithMultipass(String multipassToken, CustomerAccessTokenCreateWithMultipassPayloadQueryDefinition queryDef) { - startField("customerAccessTokenCreateWithMultipass"); - - _queryBuilder.append("(multipassToken:"); - Query.appendQuotedString(_queryBuilder, multipassToken.toString()); - - _queryBuilder.append(')'); + public OrderQuery shippingAddress(MailingAddressQueryDefinition queryDef) { + startField("shippingAddress"); _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenCreateWithMultipassPayloadQuery(_queryBuilder)); + queryDef.define(new MailingAddressQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Permanently destroys a customer access token. + * The discounts that have been allocated onto the shipping line by discount applications. */ - public MutationQuery customerAccessTokenDelete(String customerAccessToken, CustomerAccessTokenDeletePayloadQueryDefinition queryDef) { - startField("customerAccessTokenDelete"); - - _queryBuilder.append("(customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - - _queryBuilder.append(')'); + public OrderQuery shippingDiscountAllocations(DiscountAllocationQueryDefinition queryDef) { + startField("shippingDiscountAllocations"); _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenDeletePayloadQuery(_queryBuilder)); + queryDef.define(new DiscountAllocationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Renews a customer access token. - * Access token renewal must happen *before* a token expires. - * If a token has already expired, a new one should be created instead via `customerAccessTokenCreate`. + * The unique URL for the order's status page. */ - public MutationQuery customerAccessTokenRenew(String customerAccessToken, CustomerAccessTokenRenewPayloadQueryDefinition queryDef) { - startField("customerAccessTokenRenew"); - - _queryBuilder.append("(customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new CustomerAccessTokenRenewPayloadQuery(_queryBuilder)); - _queryBuilder.append('}'); + public OrderQuery statusUrl() { + startField("statusUrl"); return this; } /** - * Activates a customer. + * Price of the order before shipping and taxes. */ - public MutationQuery customerActivate(ID id, CustomerActivateInput input, CustomerActivatePayloadQueryDefinition queryDef) { - startField("customerActivate"); - - _queryBuilder.append("(id:"); - Query.appendQuotedString(_queryBuilder, id.toString()); - - _queryBuilder.append(",input:"); - input.appendTo(_queryBuilder); - - _queryBuilder.append(')'); + public OrderQuery subtotalPrice(MoneyV2QueryDefinition queryDef) { + startField("subtotalPrice"); _queryBuilder.append('{'); - queryDef.define(new CustomerActivatePayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Activates a customer with the activation url received from `customerCreate`. + * Price of the order before duties, shipping and taxes. + * + * @deprecated Use `subtotalPrice` instead. */ - public MutationQuery customerActivateByUrl(String activationUrl, String password, CustomerActivateByUrlPayloadQueryDefinition queryDef) { - startField("customerActivateByUrl"); - - _queryBuilder.append("(activationUrl:"); - Query.appendQuotedString(_queryBuilder, activationUrl.toString()); - - _queryBuilder.append(",password:"); - Query.appendQuotedString(_queryBuilder, password.toString()); - - _queryBuilder.append(')'); + @Deprecated + public OrderQuery subtotalPriceV2(MoneyV2QueryDefinition queryDef) { + startField("subtotalPriceV2"); _queryBuilder.append('{'); - queryDef.define(new CustomerActivateByUrlPayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } + public class SuccessfulFulfillmentsArguments extends Arguments { + SuccessfulFulfillmentsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * Truncate the array result to this size. + */ + public SuccessfulFulfillmentsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } + } + + public interface SuccessfulFulfillmentsArgumentsDefinition { + void define(SuccessfulFulfillmentsArguments args); + } + /** - * Creates a new address for a customer. + * List of the order’s successful fulfillments. */ - public MutationQuery customerAddressCreate(String customerAccessToken, MailingAddressInput address, CustomerAddressCreatePayloadQueryDefinition queryDef) { - startField("customerAddressCreate"); - - _queryBuilder.append("(customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + public OrderQuery successfulFulfillments(FulfillmentQueryDefinition queryDef) { + return successfulFulfillments(args -> {}, queryDef); + } - _queryBuilder.append(",address:"); - address.appendTo(_queryBuilder); + /** + * List of the order’s successful fulfillments. + */ + public OrderQuery successfulFulfillments(SuccessfulFulfillmentsArgumentsDefinition argsDef, FulfillmentQueryDefinition queryDef) { + startField("successfulFulfillments"); - _queryBuilder.append(')'); + SuccessfulFulfillmentsArguments args = new SuccessfulFulfillmentsArguments(_queryBuilder); + argsDef.define(args); + SuccessfulFulfillmentsArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new CustomerAddressCreatePayloadQuery(_queryBuilder)); + queryDef.define(new FulfillmentQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Permanently deletes the address of an existing customer. + * The sum of all the prices of all the items in the order, duties, taxes and discounts included (must + * be positive). */ - public MutationQuery customerAddressDelete(ID id, String customerAccessToken, CustomerAddressDeletePayloadQueryDefinition queryDef) { - startField("customerAddressDelete"); - - _queryBuilder.append("(id:"); - Query.appendQuotedString(_queryBuilder, id.toString()); - - _queryBuilder.append(",customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - - _queryBuilder.append(')'); + public OrderQuery totalPrice(MoneyV2QueryDefinition queryDef) { + startField("totalPrice"); _queryBuilder.append('{'); - queryDef.define(new CustomerAddressDeletePayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Updates the address of an existing customer. + * The sum of all the prices of all the items in the order, duties, taxes and discounts included (must + * be positive). + * + * @deprecated Use `totalPrice` instead. */ - public MutationQuery customerAddressUpdate(String customerAccessToken, ID id, MailingAddressInput address, CustomerAddressUpdatePayloadQueryDefinition queryDef) { - startField("customerAddressUpdate"); - - _queryBuilder.append("(customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - - _queryBuilder.append(",id:"); - Query.appendQuotedString(_queryBuilder, id.toString()); - - _queryBuilder.append(",address:"); - address.appendTo(_queryBuilder); - - _queryBuilder.append(')'); + @Deprecated + public OrderQuery totalPriceV2(MoneyV2QueryDefinition queryDef) { + startField("totalPriceV2"); _queryBuilder.append('{'); - queryDef.define(new CustomerAddressUpdatePayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Creates a new customer. + * The total amount that has been refunded. */ - public MutationQuery customerCreate(CustomerCreateInput input, CustomerCreatePayloadQueryDefinition queryDef) { - startField("customerCreate"); - - _queryBuilder.append("(input:"); - input.appendTo(_queryBuilder); - - _queryBuilder.append(')'); + public OrderQuery totalRefunded(MoneyV2QueryDefinition queryDef) { + startField("totalRefunded"); _queryBuilder.append('{'); - queryDef.define(new CustomerCreatePayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Updates the default address of an existing customer. + * The total amount that has been refunded. + * + * @deprecated Use `totalRefunded` instead. */ - public MutationQuery customerDefaultAddressUpdate(String customerAccessToken, ID addressId, CustomerDefaultAddressUpdatePayloadQueryDefinition queryDef) { - startField("customerDefaultAddressUpdate"); - - _queryBuilder.append("(customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - - _queryBuilder.append(",addressId:"); - Query.appendQuotedString(_queryBuilder, addressId.toString()); - - _queryBuilder.append(')'); + @Deprecated + public OrderQuery totalRefundedV2(MoneyV2QueryDefinition queryDef) { + startField("totalRefundedV2"); _queryBuilder.append('{'); - queryDef.define(new CustomerDefaultAddressUpdatePayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Sends a reset password email to the customer. The reset password - * email contains a reset password URL and token that you can pass to - * the [`customerResetByUrl`](https://shopify.dev/api/storefront/latest/mutations/customerResetByUrl) - * or - * [`customerReset`](https://shopify.dev/api/storefront/latest/mutations/customerReset) mutation to - * reset the - * customer password. - * This mutation is throttled by IP. With authenticated access, - * you can provide a - * [`Shopify-Storefront-Buyer-IP`](https://shopify.dev/api/usage/authentication#optional-ip-header) - * instead of the request IP. - * Make sure that the value provided to `Shopify-Storefront-Buyer-IP` is trusted. Unthrottled access to - * this - * mutation presents a security risk. + * The total cost of shipping. */ - public MutationQuery customerRecover(String email, CustomerRecoverPayloadQueryDefinition queryDef) { - startField("customerRecover"); - - _queryBuilder.append("(email:"); - Query.appendQuotedString(_queryBuilder, email.toString()); - - _queryBuilder.append(')'); + public OrderQuery totalShippingPrice(MoneyV2QueryDefinition queryDef) { + startField("totalShippingPrice"); _queryBuilder.append('{'); - queryDef.define(new CustomerRecoverPayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * "Resets a customer’s password with the token received from a reset password email. You can send a - * reset password email with the - * [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation." + * The total cost of shipping. + * + * @deprecated Use `totalShippingPrice` instead. */ - public MutationQuery customerReset(ID id, CustomerResetInput input, CustomerResetPayloadQueryDefinition queryDef) { - startField("customerReset"); - - _queryBuilder.append("(id:"); - Query.appendQuotedString(_queryBuilder, id.toString()); - - _queryBuilder.append(",input:"); - input.appendTo(_queryBuilder); - - _queryBuilder.append(')'); + @Deprecated + public OrderQuery totalShippingPriceV2(MoneyV2QueryDefinition queryDef) { + startField("totalShippingPriceV2"); _queryBuilder.append('{'); - queryDef.define(new CustomerResetPayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * "Resets a customer’s password with the reset password URL received from a reset password email. You - * can send a reset password email with the - * [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation." + * The total cost of taxes. */ - public MutationQuery customerResetByUrl(String resetUrl, String password, CustomerResetByUrlPayloadQueryDefinition queryDef) { - startField("customerResetByUrl"); - - _queryBuilder.append("(resetUrl:"); - Query.appendQuotedString(_queryBuilder, resetUrl.toString()); - - _queryBuilder.append(",password:"); - Query.appendQuotedString(_queryBuilder, password.toString()); - - _queryBuilder.append(')'); + public OrderQuery totalTax(MoneyV2QueryDefinition queryDef) { + startField("totalTax"); _queryBuilder.append('{'); - queryDef.define(new CustomerResetByUrlPayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Updates an existing customer. + * The total cost of taxes. + * + * @deprecated Use `totalTax` instead. */ - public MutationQuery customerUpdate(String customerAccessToken, CustomerUpdateInput customer, CustomerUpdatePayloadQueryDefinition queryDef) { - startField("customerUpdate"); - - _queryBuilder.append("(customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); - - _queryBuilder.append(",customer:"); - customer.appendTo(_queryBuilder); - - _queryBuilder.append(')'); + @Deprecated + public OrderQuery totalTaxV2(MoneyV2QueryDefinition queryDef) { + startField("totalTaxV2"); _queryBuilder.append('{'); - queryDef.define(new CustomerUpdatePayloadQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } - - public String toString() { - return _queryBuilder.toString(); - } } /** - * The schema’s entry-point for mutations. This acts as the public, top-level API from which all - * mutation queries must start. + * An order is a customer’s completed request to purchase one or more products from a shop. An order is + * created when a customer completes the checkout process, during which time they provides an email + * address, billing address and payment information. */ - public static class Mutation extends AbstractResponse { - public Mutation() { + public static class Order extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { + public Order() { } - public Mutation(JsonObject fields) throws SchemaViolationError { + public Order(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cartAttributesUpdate": { - CartAttributesUpdatePayload optional1 = null; + case "billingAddress": { + MailingAddress optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CartAttributesUpdatePayload(jsonAsObject(field.getValue(), key)); + optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -43451,10 +50599,10 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "cartBuyerIdentityUpdate": { - CartBuyerIdentityUpdatePayload optional1 = null; + case "cancelReason": { + OrderCancelReason optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CartBuyerIdentityUpdatePayload(jsonAsObject(field.getValue(), key)); + optional1 = OrderCancelReason.fromGraphQl(jsonAsString(field.getValue(), key)); } responseData.put(key, optional1); @@ -43462,10 +50610,10 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "cartCreate": { - CartCreatePayload optional1 = null; + case "canceledAt": { + DateTime optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CartCreatePayload(jsonAsObject(field.getValue(), key)); + optional1 = Utils.parseDateTime(jsonAsString(field.getValue(), key)); } responseData.put(key, optional1); @@ -43473,32 +50621,22 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "cartDiscountCodesUpdate": { - CartDiscountCodesUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartDiscountCodesUpdatePayload(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "currencyCode": { + responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "cartLinesAdd": { - CartLinesAddPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartLinesAddPayload(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "currentSubtotalPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "cartLinesRemove": { - CartLinesRemovePayload optional1 = null; + case "currentTotalDuties": { + MoneyV2 optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CartLinesRemovePayload(jsonAsObject(field.getValue(), key)); + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -43506,32 +50644,33 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "cartLinesUpdate": { - CartLinesUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartLinesUpdatePayload(jsonAsObject(field.getValue(), key)); - } + case "currentTotalPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - responseData.put(key, optional1); + break; + } + + case "currentTotalTax": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "cartNoteUpdate": { - CartNoteUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CartNoteUpdatePayload(jsonAsObject(field.getValue(), key)); + case "customAttributes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Attribute(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "cartSelectedDeliveryOptionsUpdate": { - CartSelectedDeliveryOptionsUpdatePayload optional1 = null; + case "customerLocale": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CartSelectedDeliveryOptionsUpdatePayload(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -43539,10 +50678,10 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "checkoutAttributesUpdateV2": { - CheckoutAttributesUpdateV2Payload optional1 = null; + case "customerUrl": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutAttributesUpdateV2Payload(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -43550,21 +50689,22 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "checkoutCompleteFree": { - CheckoutCompleteFreePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutCompleteFreePayload(jsonAsObject(field.getValue(), key)); - } + case "discountApplications": { + responseData.put(key, new DiscountApplicationConnection(jsonAsObject(field.getValue(), key))); - responseData.put(key, optional1); + break; + } + + case "edited": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } - case "checkoutCompleteWithCreditCardV2": { - CheckoutCompleteWithCreditCardV2Payload optional1 = null; + case "email": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutCompleteWithCreditCardV2Payload(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -43572,10 +50712,10 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "checkoutCompleteWithTokenizedPaymentV3": { - CheckoutCompleteWithTokenizedPaymentV3Payload optional1 = null; + case "financialStatus": { + OrderFinancialStatus optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutCompleteWithTokenizedPaymentV3Payload(jsonAsObject(field.getValue(), key)); + optional1 = OrderFinancialStatus.fromGraphQl(jsonAsString(field.getValue(), key)); } responseData.put(key, optional1); @@ -43583,32 +50723,28 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "checkoutCreate": { - CheckoutCreatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutCreatePayload(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "fulfillmentStatus": { + responseData.put(key, OrderFulfillmentStatus.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "checkoutCustomerAssociateV2": { - CheckoutCustomerAssociateV2Payload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutCustomerAssociateV2Payload(jsonAsObject(field.getValue(), key)); - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - responseData.put(key, optional1); + break; + } + + case "lineItems": { + responseData.put(key, new OrderLineItemConnection(jsonAsObject(field.getValue(), key))); break; } - case "checkoutCustomerDisassociateV2": { - CheckoutCustomerDisassociateV2Payload optional1 = null; + case "metafield": { + Metafield optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutCustomerDisassociateV2Payload(jsonAsObject(field.getValue(), key)); + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -43616,32 +50752,38 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "checkoutDiscountCodeApplyV2": { - CheckoutDiscountCodeApplyV2Payload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutDiscountCodeApplyV2Payload(jsonAsObject(field.getValue(), key)); + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } + + list1.add(optional2); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "checkoutDiscountCodeRemove": { - CheckoutDiscountCodeRemovePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutDiscountCodeRemovePayload(jsonAsObject(field.getValue(), key)); - } + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); - responseData.put(key, optional1); + break; + } + + case "orderNumber": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); break; } - case "checkoutEmailUpdateV2": { - CheckoutEmailUpdateV2Payload optional1 = null; + case "originalTotalDuties": { + MoneyV2 optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutEmailUpdateV2Payload(jsonAsObject(field.getValue(), key)); + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -43649,21 +50791,16 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "checkoutGiftCardRemoveV2": { - CheckoutGiftCardRemoveV2Payload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutGiftCardRemoveV2Payload(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "originalTotalPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "checkoutGiftCardsAppend": { - CheckoutGiftCardsAppendPayload optional1 = null; + case "phone": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutGiftCardsAppendPayload(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -43671,21 +50808,16 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "checkoutLineItemsAdd": { - CheckoutLineItemsAddPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutLineItemsAddPayload(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "processedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); break; } - case "checkoutLineItemsRemove": { - CheckoutLineItemsRemovePayload optional1 = null; + case "shippingAddress": { + MailingAddress optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutLineItemsRemovePayload(jsonAsObject(field.getValue(), key)); + optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -43693,32 +50825,27 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "checkoutLineItemsReplace": { - CheckoutLineItemsReplacePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutLineItemsReplacePayload(jsonAsObject(field.getValue(), key)); + case "shippingDiscountAllocations": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new DiscountAllocation(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "checkoutLineItemsUpdate": { - CheckoutLineItemsUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutLineItemsUpdatePayload(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "statusUrl": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "checkoutShippingAddressUpdateV2": { - CheckoutShippingAddressUpdateV2Payload optional1 = null; + case "subtotalPrice": { + MoneyV2 optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutShippingAddressUpdateV2Payload(jsonAsObject(field.getValue(), key)); + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -43726,10 +50853,10 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "checkoutShippingLineUpdate": { - CheckoutShippingLineUpdatePayload optional1 = null; + case "subtotalPriceV2": { + MoneyV2 optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CheckoutShippingLineUpdatePayload(jsonAsObject(field.getValue(), key)); + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -43737,10 +50864,15 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "customerAccessTokenCreate": { - CustomerAccessTokenCreatePayload optional1 = null; + case "successfulFulfillments": { + List optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessTokenCreatePayload(jsonAsObject(field.getValue(), key)); + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Fulfillment(jsonAsObject(element1, key))); + } + + optional1 = list1; } responseData.put(key, optional1); @@ -43748,43 +50880,46 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "customerAccessTokenCreateWithMultipass": { - CustomerAccessTokenCreateWithMultipassPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessTokenCreateWithMultipassPayload(jsonAsObject(field.getValue(), key)); - } + case "totalPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - responseData.put(key, optional1); + break; + } + + case "totalPriceV2": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "customerAccessTokenDelete": { - CustomerAccessTokenDeletePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessTokenDeletePayload(jsonAsObject(field.getValue(), key)); - } + case "totalRefunded": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - responseData.put(key, optional1); + break; + } + + case "totalRefundedV2": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "customerAccessTokenRenew": { - CustomerAccessTokenRenewPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAccessTokenRenewPayload(jsonAsObject(field.getValue(), key)); - } + case "totalShippingPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - responseData.put(key, optional1); + break; + } + + case "totalShippingPriceV2": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "customerActivate": { - CustomerActivatePayload optional1 = null; + case "totalTax": { + MoneyV2 optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CustomerActivatePayload(jsonAsObject(field.getValue(), key)); + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -43792,10 +50927,10 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "customerActivateByUrl": { - CustomerActivateByUrlPayload optional1 = null; + case "totalTaxV2": { + MoneyV2 optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new CustomerActivateByUrlPayload(jsonAsObject(field.getValue(), key)); + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -43803,1040 +50938,1479 @@ public Mutation(JsonObject fields) throws SchemaViolationError { break; } - case "customerAddressCreate": { - CustomerAddressCreatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAddressCreatePayload(jsonAsObject(field.getValue(), key)); - } + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - responseData.put(key, optional1); + public Order(ID id) { + this(); + optimisticData.put("id", id); + } + + public String getGraphQlTypeName() { + return "Order"; + } + + /** + * The address associated with the payment method. + */ + + public MailingAddress getBillingAddress() { + return (MailingAddress) get("billingAddress"); + } + + public Order setBillingAddress(MailingAddress arg) { + optimisticData.put(getKey("billingAddress"), arg); + return this; + } + + /** + * The reason for the order's cancellation. Returns `null` if the order wasn't canceled. + */ + + public OrderCancelReason getCancelReason() { + return (OrderCancelReason) get("cancelReason"); + } + + public Order setCancelReason(OrderCancelReason arg) { + optimisticData.put(getKey("cancelReason"), arg); + return this; + } + + /** + * The date and time when the order was canceled. Returns null if the order wasn't canceled. + */ + + public DateTime getCanceledAt() { + return (DateTime) get("canceledAt"); + } + + public Order setCanceledAt(DateTime arg) { + optimisticData.put(getKey("canceledAt"), arg); + return this; + } + + /** + * The code of the currency used for the payment. + */ + + public CurrencyCode getCurrencyCode() { + return (CurrencyCode) get("currencyCode"); + } + + public Order setCurrencyCode(CurrencyCode arg) { + optimisticData.put(getKey("currencyCode"), arg); + return this; + } + + /** + * The subtotal of line items and their discounts, excluding line items that have been removed. Does + * not contain order-level discounts, duties, shipping costs, or shipping discounts. Taxes are not + * included unless the order is a taxes-included order. + */ + + public MoneyV2 getCurrentSubtotalPrice() { + return (MoneyV2) get("currentSubtotalPrice"); + } + + public Order setCurrentSubtotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("currentSubtotalPrice"), arg); + return this; + } + + /** + * The total cost of duties for the order, including refunds. + */ + + public MoneyV2 getCurrentTotalDuties() { + return (MoneyV2) get("currentTotalDuties"); + } + + public Order setCurrentTotalDuties(MoneyV2 arg) { + optimisticData.put(getKey("currentTotalDuties"), arg); + return this; + } + + /** + * The total amount of the order, including duties, taxes and discounts, minus amounts for line items + * that have been removed. + */ + + public MoneyV2 getCurrentTotalPrice() { + return (MoneyV2) get("currentTotalPrice"); + } + + public Order setCurrentTotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("currentTotalPrice"), arg); + return this; + } + + /** + * The total of all taxes applied to the order, excluding taxes for returned line items. + */ + + public MoneyV2 getCurrentTotalTax() { + return (MoneyV2) get("currentTotalTax"); + } + + public Order setCurrentTotalTax(MoneyV2 arg) { + optimisticData.put(getKey("currentTotalTax"), arg); + return this; + } + + /** + * A list of the custom attributes added to the order. + */ + + public List getCustomAttributes() { + return (List) get("customAttributes"); + } + + public Order setCustomAttributes(List arg) { + optimisticData.put(getKey("customAttributes"), arg); + return this; + } + + /** + * The locale code in which this specific order happened. + */ + + public String getCustomerLocale() { + return (String) get("customerLocale"); + } + + public Order setCustomerLocale(String arg) { + optimisticData.put(getKey("customerLocale"), arg); + return this; + } + + /** + * The unique URL that the customer can use to access the order. + */ + + public String getCustomerUrl() { + return (String) get("customerUrl"); + } + + public Order setCustomerUrl(String arg) { + optimisticData.put(getKey("customerUrl"), arg); + return this; + } + + /** + * Discounts that have been applied on the order. + */ + + public DiscountApplicationConnection getDiscountApplications() { + return (DiscountApplicationConnection) get("discountApplications"); + } + + public Order setDiscountApplications(DiscountApplicationConnection arg) { + optimisticData.put(getKey("discountApplications"), arg); + return this; + } + + /** + * Whether the order has had any edits applied or not. + */ + + public Boolean getEdited() { + return (Boolean) get("edited"); + } + + public Order setEdited(Boolean arg) { + optimisticData.put(getKey("edited"), arg); + return this; + } + + /** + * The customer's email address. + */ + + public String getEmail() { + return (String) get("email"); + } + + public Order setEmail(String arg) { + optimisticData.put(getKey("email"), arg); + return this; + } + + /** + * The financial status of the order. + */ + + public OrderFinancialStatus getFinancialStatus() { + return (OrderFinancialStatus) get("financialStatus"); + } + + public Order setFinancialStatus(OrderFinancialStatus arg) { + optimisticData.put(getKey("financialStatus"), arg); + return this; + } + + /** + * The fulfillment status for the order. + */ + + public OrderFulfillmentStatus getFulfillmentStatus() { + return (OrderFulfillmentStatus) get("fulfillmentStatus"); + } - break; - } + public Order setFulfillmentStatus(OrderFulfillmentStatus arg) { + optimisticData.put(getKey("fulfillmentStatus"), arg); + return this; + } - case "customerAddressDelete": { - CustomerAddressDeletePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAddressDeletePayload(jsonAsObject(field.getValue(), key)); - } + /** + * A globally-unique identifier. + */ - responseData.put(key, optional1); + public ID getId() { + return (ID) get("id"); + } - break; - } + /** + * List of the order’s line items. + */ - case "customerAddressUpdate": { - CustomerAddressUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerAddressUpdatePayload(jsonAsObject(field.getValue(), key)); - } + public OrderLineItemConnection getLineItems() { + return (OrderLineItemConnection) get("lineItems"); + } - responseData.put(key, optional1); + public Order setLineItems(OrderLineItemConnection arg) { + optimisticData.put(getKey("lineItems"), arg); + return this; + } - break; - } + /** + * Returns a metafield found by namespace and key. + */ - case "customerCreate": { - CustomerCreatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerCreatePayload(jsonAsObject(field.getValue(), key)); - } + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } - responseData.put(key, optional1); + public Order setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); + return this; + } - break; - } + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ - case "customerDefaultAddressUpdate": { - CustomerDefaultAddressUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerDefaultAddressUpdatePayload(jsonAsObject(field.getValue(), key)); - } + public List getMetafields() { + return (List) get("metafields"); + } - responseData.put(key, optional1); + public Order setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); + return this; + } - break; - } + /** + * Unique identifier for the order that appears on the order. + * For example, _#1000_ or _Store1001. + */ - case "customerRecover": { - CustomerRecoverPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerRecoverPayload(jsonAsObject(field.getValue(), key)); - } + public String getName() { + return (String) get("name"); + } - responseData.put(key, optional1); + public Order setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } - break; - } + /** + * A unique numeric identifier for the order for use by shop owner and customer. + */ - case "customerReset": { - CustomerResetPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerResetPayload(jsonAsObject(field.getValue(), key)); - } + public Integer getOrderNumber() { + return (Integer) get("orderNumber"); + } - responseData.put(key, optional1); + public Order setOrderNumber(Integer arg) { + optimisticData.put(getKey("orderNumber"), arg); + return this; + } - break; - } + /** + * The total cost of duties charged at checkout. + */ - case "customerResetByUrl": { - CustomerResetByUrlPayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerResetByUrlPayload(jsonAsObject(field.getValue(), key)); - } + public MoneyV2 getOriginalTotalDuties() { + return (MoneyV2) get("originalTotalDuties"); + } - responseData.put(key, optional1); + public Order setOriginalTotalDuties(MoneyV2 arg) { + optimisticData.put(getKey("originalTotalDuties"), arg); + return this; + } - break; - } + /** + * The total price of the order before any applied edits. + */ - case "customerUpdate": { - CustomerUpdatePayload optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CustomerUpdatePayload(jsonAsObject(field.getValue(), key)); - } + public MoneyV2 getOriginalTotalPrice() { + return (MoneyV2) get("originalTotalPrice"); + } - responseData.put(key, optional1); + public Order setOriginalTotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("originalTotalPrice"), arg); + return this; + } - break; - } + /** + * The customer's phone number for receiving SMS notifications. + */ - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public String getPhone() { + return (String) get("phone"); } - public String getGraphQlTypeName() { - return "Mutation"; + public Order setPhone(String arg) { + optimisticData.put(getKey("phone"), arg); + return this; } /** - * Updates the attributes on a cart. + * The date and time when the order was imported. + * This value can be set to dates in the past when importing from other systems. + * If no value is provided, it will be auto-generated based on current date and time. */ - public CartAttributesUpdatePayload getCartAttributesUpdate() { - return (CartAttributesUpdatePayload) get("cartAttributesUpdate"); + public DateTime getProcessedAt() { + return (DateTime) get("processedAt"); } - public Mutation setCartAttributesUpdate(CartAttributesUpdatePayload arg) { - optimisticData.put(getKey("cartAttributesUpdate"), arg); + public Order setProcessedAt(DateTime arg) { + optimisticData.put(getKey("processedAt"), arg); return this; } /** - * Updates customer information associated with a cart. - * Buyer identity is used to determine - * [international - * pricing](https://shopify.dev/custom-storefronts/internationalization/international-pricing) - * and should match the customer's shipping address. + * The address to where the order will be shipped. */ - public CartBuyerIdentityUpdatePayload getCartBuyerIdentityUpdate() { - return (CartBuyerIdentityUpdatePayload) get("cartBuyerIdentityUpdate"); + public MailingAddress getShippingAddress() { + return (MailingAddress) get("shippingAddress"); } - public Mutation setCartBuyerIdentityUpdate(CartBuyerIdentityUpdatePayload arg) { - optimisticData.put(getKey("cartBuyerIdentityUpdate"), arg); + public Order setShippingAddress(MailingAddress arg) { + optimisticData.put(getKey("shippingAddress"), arg); return this; } /** - * Creates a new cart. + * The discounts that have been allocated onto the shipping line by discount applications. */ - public CartCreatePayload getCartCreate() { - return (CartCreatePayload) get("cartCreate"); + public List getShippingDiscountAllocations() { + return (List) get("shippingDiscountAllocations"); } - public Mutation setCartCreate(CartCreatePayload arg) { - optimisticData.put(getKey("cartCreate"), arg); + public Order setShippingDiscountAllocations(List arg) { + optimisticData.put(getKey("shippingDiscountAllocations"), arg); return this; } /** - * Updates the discount codes applied to the cart. + * The unique URL for the order's status page. */ - public CartDiscountCodesUpdatePayload getCartDiscountCodesUpdate() { - return (CartDiscountCodesUpdatePayload) get("cartDiscountCodesUpdate"); + public String getStatusUrl() { + return (String) get("statusUrl"); } - public Mutation setCartDiscountCodesUpdate(CartDiscountCodesUpdatePayload arg) { - optimisticData.put(getKey("cartDiscountCodesUpdate"), arg); + public Order setStatusUrl(String arg) { + optimisticData.put(getKey("statusUrl"), arg); return this; } /** - * Adds a merchandise line to the cart. + * Price of the order before shipping and taxes. */ - public CartLinesAddPayload getCartLinesAdd() { - return (CartLinesAddPayload) get("cartLinesAdd"); + public MoneyV2 getSubtotalPrice() { + return (MoneyV2) get("subtotalPrice"); } - public Mutation setCartLinesAdd(CartLinesAddPayload arg) { - optimisticData.put(getKey("cartLinesAdd"), arg); + public Order setSubtotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("subtotalPrice"), arg); return this; } /** - * Removes one or more merchandise lines from the cart. + * Price of the order before duties, shipping and taxes. + * + * @deprecated Use `subtotalPrice` instead. */ - public CartLinesRemovePayload getCartLinesRemove() { - return (CartLinesRemovePayload) get("cartLinesRemove"); + public MoneyV2 getSubtotalPriceV2() { + return (MoneyV2) get("subtotalPriceV2"); } - public Mutation setCartLinesRemove(CartLinesRemovePayload arg) { - optimisticData.put(getKey("cartLinesRemove"), arg); + public Order setSubtotalPriceV2(MoneyV2 arg) { + optimisticData.put(getKey("subtotalPriceV2"), arg); return this; } /** - * Updates one or more merchandise lines on a cart. + * List of the order’s successful fulfillments. */ - public CartLinesUpdatePayload getCartLinesUpdate() { - return (CartLinesUpdatePayload) get("cartLinesUpdate"); + public List getSuccessfulFulfillments() { + return (List) get("successfulFulfillments"); } - public Mutation setCartLinesUpdate(CartLinesUpdatePayload arg) { - optimisticData.put(getKey("cartLinesUpdate"), arg); + public Order setSuccessfulFulfillments(List arg) { + optimisticData.put(getKey("successfulFulfillments"), arg); return this; } /** - * Updates the note on the cart. + * The sum of all the prices of all the items in the order, duties, taxes and discounts included (must + * be positive). */ - public CartNoteUpdatePayload getCartNoteUpdate() { - return (CartNoteUpdatePayload) get("cartNoteUpdate"); + public MoneyV2 getTotalPrice() { + return (MoneyV2) get("totalPrice"); } - public Mutation setCartNoteUpdate(CartNoteUpdatePayload arg) { - optimisticData.put(getKey("cartNoteUpdate"), arg); + public Order setTotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("totalPrice"), arg); return this; } /** - * Update the selected delivery options for a delivery group. + * The sum of all the prices of all the items in the order, duties, taxes and discounts included (must + * be positive). + * + * @deprecated Use `totalPrice` instead. */ - public CartSelectedDeliveryOptionsUpdatePayload getCartSelectedDeliveryOptionsUpdate() { - return (CartSelectedDeliveryOptionsUpdatePayload) get("cartSelectedDeliveryOptionsUpdate"); + public MoneyV2 getTotalPriceV2() { + return (MoneyV2) get("totalPriceV2"); } - public Mutation setCartSelectedDeliveryOptionsUpdate(CartSelectedDeliveryOptionsUpdatePayload arg) { - optimisticData.put(getKey("cartSelectedDeliveryOptionsUpdate"), arg); + public Order setTotalPriceV2(MoneyV2 arg) { + optimisticData.put(getKey("totalPriceV2"), arg); return this; } /** - * Updates the attributes of a checkout if `allowPartialAddresses` is `true`. + * The total amount that has been refunded. */ - public CheckoutAttributesUpdateV2Payload getCheckoutAttributesUpdateV2() { - return (CheckoutAttributesUpdateV2Payload) get("checkoutAttributesUpdateV2"); + public MoneyV2 getTotalRefunded() { + return (MoneyV2) get("totalRefunded"); } - public Mutation setCheckoutAttributesUpdateV2(CheckoutAttributesUpdateV2Payload arg) { - optimisticData.put(getKey("checkoutAttributesUpdateV2"), arg); + public Order setTotalRefunded(MoneyV2 arg) { + optimisticData.put(getKey("totalRefunded"), arg); return this; } /** - * Completes a checkout without providing payment information. You can use this mutation for free items - * or items whose purchase price is covered by a gift card. + * The total amount that has been refunded. + * + * @deprecated Use `totalRefunded` instead. */ - public CheckoutCompleteFreePayload getCheckoutCompleteFree() { - return (CheckoutCompleteFreePayload) get("checkoutCompleteFree"); + public MoneyV2 getTotalRefundedV2() { + return (MoneyV2) get("totalRefundedV2"); } - public Mutation setCheckoutCompleteFree(CheckoutCompleteFreePayload arg) { - optimisticData.put(getKey("checkoutCompleteFree"), arg); + public Order setTotalRefundedV2(MoneyV2 arg) { + optimisticData.put(getKey("totalRefundedV2"), arg); return this; } /** - * Completes a checkout using a credit card token from Shopify's card vault. Before you can complete - * checkouts using CheckoutCompleteWithCreditCardV2, you need to [_request payment - * processing_](https://shopify.dev/apps/channels/getting-started#request-payment-processing). + * The total cost of shipping. */ - public CheckoutCompleteWithCreditCardV2Payload getCheckoutCompleteWithCreditCardV2() { - return (CheckoutCompleteWithCreditCardV2Payload) get("checkoutCompleteWithCreditCardV2"); + public MoneyV2 getTotalShippingPrice() { + return (MoneyV2) get("totalShippingPrice"); } - public Mutation setCheckoutCompleteWithCreditCardV2(CheckoutCompleteWithCreditCardV2Payload arg) { - optimisticData.put(getKey("checkoutCompleteWithCreditCardV2"), arg); + public Order setTotalShippingPrice(MoneyV2 arg) { + optimisticData.put(getKey("totalShippingPrice"), arg); return this; } /** - * Completes a checkout with a tokenized payment. + * The total cost of shipping. + * + * @deprecated Use `totalShippingPrice` instead. */ - public CheckoutCompleteWithTokenizedPaymentV3Payload getCheckoutCompleteWithTokenizedPaymentV3() { - return (CheckoutCompleteWithTokenizedPaymentV3Payload) get("checkoutCompleteWithTokenizedPaymentV3"); + public MoneyV2 getTotalShippingPriceV2() { + return (MoneyV2) get("totalShippingPriceV2"); } - public Mutation setCheckoutCompleteWithTokenizedPaymentV3(CheckoutCompleteWithTokenizedPaymentV3Payload arg) { - optimisticData.put(getKey("checkoutCompleteWithTokenizedPaymentV3"), arg); + public Order setTotalShippingPriceV2(MoneyV2 arg) { + optimisticData.put(getKey("totalShippingPriceV2"), arg); return this; } /** - * Creates a new checkout. + * The total cost of taxes. */ - public CheckoutCreatePayload getCheckoutCreate() { - return (CheckoutCreatePayload) get("checkoutCreate"); + public MoneyV2 getTotalTax() { + return (MoneyV2) get("totalTax"); } - public Mutation setCheckoutCreate(CheckoutCreatePayload arg) { - optimisticData.put(getKey("checkoutCreate"), arg); + public Order setTotalTax(MoneyV2 arg) { + optimisticData.put(getKey("totalTax"), arg); return this; } /** - * Associates a customer to the checkout. + * The total cost of taxes. + * + * @deprecated Use `totalTax` instead. */ - public CheckoutCustomerAssociateV2Payload getCheckoutCustomerAssociateV2() { - return (CheckoutCustomerAssociateV2Payload) get("checkoutCustomerAssociateV2"); + public MoneyV2 getTotalTaxV2() { + return (MoneyV2) get("totalTaxV2"); } - public Mutation setCheckoutCustomerAssociateV2(CheckoutCustomerAssociateV2Payload arg) { - optimisticData.put(getKey("checkoutCustomerAssociateV2"), arg); + public Order setTotalTaxV2(MoneyV2 arg) { + optimisticData.put(getKey("totalTaxV2"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "billingAddress": return true; + + case "cancelReason": return false; + + case "canceledAt": return false; + + case "currencyCode": return false; + + case "currentSubtotalPrice": return true; + + case "currentTotalDuties": return true; + + case "currentTotalPrice": return true; + + case "currentTotalTax": return true; + + case "customAttributes": return true; + + case "customerLocale": return false; + + case "customerUrl": return false; + + case "discountApplications": return true; + + case "edited": return false; + + case "email": return false; + + case "financialStatus": return false; + + case "fulfillmentStatus": return false; + + case "id": return false; + + case "lineItems": return true; + + case "metafield": return true; + + case "metafields": return true; + + case "name": return false; + + case "orderNumber": return false; + + case "originalTotalDuties": return true; + + case "originalTotalPrice": return true; + + case "phone": return false; + + case "processedAt": return false; + + case "shippingAddress": return true; + + case "shippingDiscountAllocations": return true; + + case "statusUrl": return false; + + case "subtotalPrice": return true; + + case "subtotalPriceV2": return true; + + case "successfulFulfillments": return true; + + case "totalPrice": return true; + + case "totalPriceV2": return true; + + case "totalRefunded": return true; + + case "totalRefundedV2": return true; + + case "totalShippingPrice": return true; + + case "totalShippingPriceV2": return true; + + case "totalTax": return true; + + case "totalTaxV2": return true; + + default: return false; + } + } + } + + /** + * Represents the reason for the order's cancellation. + */ + public enum OrderCancelReason { /** - * Disassociates the current checkout customer from the checkout. + * The customer wanted to cancel the order. */ + CUSTOMER, - public CheckoutCustomerDisassociateV2Payload getCheckoutCustomerDisassociateV2() { - return (CheckoutCustomerDisassociateV2Payload) get("checkoutCustomerDisassociateV2"); + /** + * Payment was declined. + */ + DECLINED, + + /** + * The order was fraudulent. + */ + FRAUD, + + /** + * There was insufficient inventory. + */ + INVENTORY, + + /** + * The order was canceled for an unlisted reason. + */ + OTHER, + + UNKNOWN_VALUE; + + public static OrderCancelReason fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "CUSTOMER": { + return CUSTOMER; + } + + case "DECLINED": { + return DECLINED; + } + + case "FRAUD": { + return FRAUD; + } + + case "INVENTORY": { + return INVENTORY; + } + + case "OTHER": { + return OTHER; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case CUSTOMER: { + return "CUSTOMER"; + } + + case DECLINED: { + return "DECLINED"; + } + + case FRAUD: { + return "FRAUD"; + } + + case INVENTORY: { + return "INVENTORY"; + } + + case OTHER: { + return "OTHER"; + } + + default: { + return ""; + } + } } + } - public Mutation setCheckoutCustomerDisassociateV2(CheckoutCustomerDisassociateV2Payload arg) { - optimisticData.put(getKey("checkoutCustomerDisassociateV2"), arg); - return this; + public interface OrderConnectionQueryDefinition { + void define(OrderConnectionQuery _queryBuilder); + } + + /** + * An auto-generated type for paginating through multiple Orders. + */ + public static class OrderConnectionQuery extends Query { + OrderConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * Applies a discount to an existing checkout using a discount code. + * A list of edges. */ + public OrderConnectionQuery edges(OrderEdgeQueryDefinition queryDef) { + startField("edges"); - public CheckoutDiscountCodeApplyV2Payload getCheckoutDiscountCodeApplyV2() { - return (CheckoutDiscountCodeApplyV2Payload) get("checkoutDiscountCodeApplyV2"); - } + _queryBuilder.append('{'); + queryDef.define(new OrderEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Mutation setCheckoutDiscountCodeApplyV2(CheckoutDiscountCodeApplyV2Payload arg) { - optimisticData.put(getKey("checkoutDiscountCodeApplyV2"), arg); return this; } /** - * Removes the applied discounts from an existing checkout. + * A list of the nodes contained in OrderEdge. */ + public OrderConnectionQuery nodes(OrderQueryDefinition queryDef) { + startField("nodes"); - public CheckoutDiscountCodeRemovePayload getCheckoutDiscountCodeRemove() { - return (CheckoutDiscountCodeRemovePayload) get("checkoutDiscountCodeRemove"); - } + _queryBuilder.append('{'); + queryDef.define(new OrderQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Mutation setCheckoutDiscountCodeRemove(CheckoutDiscountCodeRemovePayload arg) { - optimisticData.put(getKey("checkoutDiscountCodeRemove"), arg); return this; } /** - * Updates the email on an existing checkout. + * Information to aid in pagination. */ + public OrderConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - public CheckoutEmailUpdateV2Payload getCheckoutEmailUpdateV2() { - return (CheckoutEmailUpdateV2Payload) get("checkoutEmailUpdateV2"); - } + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Mutation setCheckoutEmailUpdateV2(CheckoutEmailUpdateV2Payload arg) { - optimisticData.put(getKey("checkoutEmailUpdateV2"), arg); return this; } /** - * Removes an applied gift card from the checkout. + * The total count of Orders. */ + public OrderConnectionQuery totalCount() { + startField("totalCount"); - public CheckoutGiftCardRemoveV2Payload getCheckoutGiftCardRemoveV2() { - return (CheckoutGiftCardRemoveV2Payload) get("checkoutGiftCardRemoveV2"); + return this; } + } - public Mutation setCheckoutGiftCardRemoveV2(CheckoutGiftCardRemoveV2Payload arg) { - optimisticData.put(getKey("checkoutGiftCardRemoveV2"), arg); - return this; + /** + * An auto-generated type for paginating through multiple Orders. + */ + public static class OrderConnection extends AbstractResponse { + public OrderConnection() { } - /** - * Appends gift cards to an existing checkout. - */ + public OrderConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new OrderEdge(jsonAsObject(element1, key))); + } - public CheckoutGiftCardsAppendPayload getCheckoutGiftCardsAppend() { - return (CheckoutGiftCardsAppendPayload) get("checkoutGiftCardsAppend"); - } + responseData.put(key, list1); - public Mutation setCheckoutGiftCardsAppend(CheckoutGiftCardsAppendPayload arg) { - optimisticData.put(getKey("checkoutGiftCardsAppend"), arg); - return this; - } + break; + } - /** - * Adds a list of line items to a checkout. - */ + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Order(jsonAsObject(element1, key))); + } - public CheckoutLineItemsAddPayload getCheckoutLineItemsAdd() { - return (CheckoutLineItemsAddPayload) get("checkoutLineItemsAdd"); - } + responseData.put(key, list1); - public Mutation setCheckoutLineItemsAdd(CheckoutLineItemsAddPayload arg) { - optimisticData.put(getKey("checkoutLineItemsAdd"), arg); - return this; - } + break; + } - /** - * Removes line items from an existing checkout. - */ + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - public CheckoutLineItemsRemovePayload getCheckoutLineItemsRemove() { - return (CheckoutLineItemsRemovePayload) get("checkoutLineItemsRemove"); - } + break; + } - public Mutation setCheckoutLineItemsRemove(CheckoutLineItemsRemovePayload arg) { - optimisticData.put(getKey("checkoutLineItemsRemove"), arg); - return this; - } + case "totalCount": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * Sets a list of line items to a checkout. - */ + break; + } - public CheckoutLineItemsReplacePayload getCheckoutLineItemsReplace() { - return (CheckoutLineItemsReplacePayload) get("checkoutLineItemsReplace"); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public Mutation setCheckoutLineItemsReplace(CheckoutLineItemsReplacePayload arg) { - optimisticData.put(getKey("checkoutLineItemsReplace"), arg); - return this; + public String getGraphQlTypeName() { + return "OrderConnection"; } /** - * Updates line items on a checkout. + * A list of edges. */ - public CheckoutLineItemsUpdatePayload getCheckoutLineItemsUpdate() { - return (CheckoutLineItemsUpdatePayload) get("checkoutLineItemsUpdate"); + public List getEdges() { + return (List) get("edges"); } - public Mutation setCheckoutLineItemsUpdate(CheckoutLineItemsUpdatePayload arg) { - optimisticData.put(getKey("checkoutLineItemsUpdate"), arg); + public OrderConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * Updates the shipping address of an existing checkout. + * A list of the nodes contained in OrderEdge. */ - public CheckoutShippingAddressUpdateV2Payload getCheckoutShippingAddressUpdateV2() { - return (CheckoutShippingAddressUpdateV2Payload) get("checkoutShippingAddressUpdateV2"); + public List getNodes() { + return (List) get("nodes"); } - public Mutation setCheckoutShippingAddressUpdateV2(CheckoutShippingAddressUpdateV2Payload arg) { - optimisticData.put(getKey("checkoutShippingAddressUpdateV2"), arg); + public OrderConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * Updates the shipping lines on an existing checkout. + * Information to aid in pagination. */ - public CheckoutShippingLineUpdatePayload getCheckoutShippingLineUpdate() { - return (CheckoutShippingLineUpdatePayload) get("checkoutShippingLineUpdate"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public Mutation setCheckoutShippingLineUpdate(CheckoutShippingLineUpdatePayload arg) { - optimisticData.put(getKey("checkoutShippingLineUpdate"), arg); + public OrderConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } /** - * Creates a customer access token. - * The customer access token is required to modify the customer object in any way. + * The total count of Orders. */ - public CustomerAccessTokenCreatePayload getCustomerAccessTokenCreate() { - return (CustomerAccessTokenCreatePayload) get("customerAccessTokenCreate"); + public String getTotalCount() { + return (String) get("totalCount"); } - public Mutation setCustomerAccessTokenCreate(CustomerAccessTokenCreatePayload arg) { - optimisticData.put(getKey("customerAccessTokenCreate"), arg); + public OrderConnection setTotalCount(String arg) { + optimisticData.put(getKey("totalCount"), arg); return this; } - /** - * Creates a customer access token using a - * [multipass token](https://shopify.dev/api/multipass) instead of email and - * password. A customer record is created if the customer doesn't exist. If a customer - * record already exists but the record is disabled, then the customer record is enabled. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - public CustomerAccessTokenCreateWithMultipassPayload getCustomerAccessTokenCreateWithMultipass() { - return (CustomerAccessTokenCreateWithMultipassPayload) get("customerAccessTokenCreateWithMultipass"); - } + case "nodes": return true; - public Mutation setCustomerAccessTokenCreateWithMultipass(CustomerAccessTokenCreateWithMultipassPayload arg) { - optimisticData.put(getKey("customerAccessTokenCreateWithMultipass"), arg); - return this; - } + case "pageInfo": return true; - /** - * Permanently destroys a customer access token. - */ + case "totalCount": return false; - public CustomerAccessTokenDeletePayload getCustomerAccessTokenDelete() { - return (CustomerAccessTokenDeletePayload) get("customerAccessTokenDelete"); + default: return false; + } } + } - public Mutation setCustomerAccessTokenDelete(CustomerAccessTokenDeletePayload arg) { - optimisticData.put(getKey("customerAccessTokenDelete"), arg); - return this; + public interface OrderEdgeQueryDefinition { + void define(OrderEdgeQuery _queryBuilder); + } + + /** + * An auto-generated type which holds one Order and a cursor during pagination. + */ + public static class OrderEdgeQuery extends Query { + OrderEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * Renews a customer access token. - * Access token renewal must happen *before* a token expires. - * If a token has already expired, a new one should be created instead via `customerAccessTokenCreate`. + * A cursor for use in pagination. */ + public OrderEdgeQuery cursor() { + startField("cursor"); - public CustomerAccessTokenRenewPayload getCustomerAccessTokenRenew() { - return (CustomerAccessTokenRenewPayload) get("customerAccessTokenRenew"); - } - - public Mutation setCustomerAccessTokenRenew(CustomerAccessTokenRenewPayload arg) { - optimisticData.put(getKey("customerAccessTokenRenew"), arg); return this; } /** - * Activates a customer. + * The item at the end of OrderEdge. */ + public OrderEdgeQuery node(OrderQueryDefinition queryDef) { + startField("node"); - public CustomerActivatePayload getCustomerActivate() { - return (CustomerActivatePayload) get("customerActivate"); - } + _queryBuilder.append('{'); + queryDef.define(new OrderQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Mutation setCustomerActivate(CustomerActivatePayload arg) { - optimisticData.put(getKey("customerActivate"), arg); return this; } + } - /** - * Activates a customer with the activation url received from `customerCreate`. - */ - - public CustomerActivateByUrlPayload getCustomerActivateByUrl() { - return (CustomerActivateByUrlPayload) get("customerActivateByUrl"); - } - - public Mutation setCustomerActivateByUrl(CustomerActivateByUrlPayload arg) { - optimisticData.put(getKey("customerActivateByUrl"), arg); - return this; + /** + * An auto-generated type which holds one Order and a cursor during pagination. + */ + public static class OrderEdge extends AbstractResponse { + public OrderEdge() { } - /** - * Creates a new address for a customer. - */ + public OrderEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - public CustomerAddressCreatePayload getCustomerAddressCreate() { - return (CustomerAddressCreatePayload) get("customerAddressCreate"); - } + break; + } - public Mutation setCustomerAddressCreate(CustomerAddressCreatePayload arg) { - optimisticData.put(getKey("customerAddressCreate"), arg); - return this; - } + case "node": { + responseData.put(key, new Order(jsonAsObject(field.getValue(), key))); - /** - * Permanently deletes the address of an existing customer. - */ + break; + } - public CustomerAddressDeletePayload getCustomerAddressDelete() { - return (CustomerAddressDeletePayload) get("customerAddressDelete"); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public Mutation setCustomerAddressDelete(CustomerAddressDeletePayload arg) { - optimisticData.put(getKey("customerAddressDelete"), arg); - return this; + public String getGraphQlTypeName() { + return "OrderEdge"; } /** - * Updates the address of an existing customer. + * A cursor for use in pagination. */ - public CustomerAddressUpdatePayload getCustomerAddressUpdate() { - return (CustomerAddressUpdatePayload) get("customerAddressUpdate"); + public String getCursor() { + return (String) get("cursor"); } - public Mutation setCustomerAddressUpdate(CustomerAddressUpdatePayload arg) { - optimisticData.put(getKey("customerAddressUpdate"), arg); + public OrderEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * Creates a new customer. + * The item at the end of OrderEdge. */ - public CustomerCreatePayload getCustomerCreate() { - return (CustomerCreatePayload) get("customerCreate"); + public Order getNode() { + return (Order) get("node"); } - public Mutation setCustomerCreate(CustomerCreatePayload arg) { - optimisticData.put(getKey("customerCreate"), arg); + public OrderEdge setNode(Order arg) { + optimisticData.put(getKey("node"), arg); return this; } - /** - * Updates the default address of an existing customer. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - public CustomerDefaultAddressUpdatePayload getCustomerDefaultAddressUpdate() { - return (CustomerDefaultAddressUpdatePayload) get("customerDefaultAddressUpdate"); - } + case "node": return true; - public Mutation setCustomerDefaultAddressUpdate(CustomerDefaultAddressUpdatePayload arg) { - optimisticData.put(getKey("customerDefaultAddressUpdate"), arg); - return this; + default: return false; + } } + } + /** + * Represents the order's current financial status. + */ + public enum OrderFinancialStatus { /** - * Sends a reset password email to the customer. The reset password - * email contains a reset password URL and token that you can pass to - * the [`customerResetByUrl`](https://shopify.dev/api/storefront/latest/mutations/customerResetByUrl) - * or - * [`customerReset`](https://shopify.dev/api/storefront/latest/mutations/customerReset) mutation to - * reset the - * customer password. - * This mutation is throttled by IP. With authenticated access, - * you can provide a - * [`Shopify-Storefront-Buyer-IP`](https://shopify.dev/api/usage/authentication#optional-ip-header) - * instead of the request IP. - * Make sure that the value provided to `Shopify-Storefront-Buyer-IP` is trusted. Unthrottled access to - * this - * mutation presents a security risk. + * Displayed as **Authorized**. */ - - public CustomerRecoverPayload getCustomerRecover() { - return (CustomerRecoverPayload) get("customerRecover"); - } - - public Mutation setCustomerRecover(CustomerRecoverPayload arg) { - optimisticData.put(getKey("customerRecover"), arg); - return this; - } + AUTHORIZED, /** - * "Resets a customer’s password with the token received from a reset password email. You can send a - * reset password email with the - * [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation." + * Displayed as **Paid**. */ + PAID, - public CustomerResetPayload getCustomerReset() { - return (CustomerResetPayload) get("customerReset"); - } - - public Mutation setCustomerReset(CustomerResetPayload arg) { - optimisticData.put(getKey("customerReset"), arg); - return this; - } + /** + * Displayed as **Partially paid**. + */ + PARTIALLY_PAID, /** - * "Resets a customer’s password with the reset password URL received from a reset password email. You - * can send a reset password email with the - * [`customerRecover`](https://shopify.dev/api/storefront/latest/mutations/customerRecover) mutation." + * Displayed as **Partially refunded**. */ + PARTIALLY_REFUNDED, - public CustomerResetByUrlPayload getCustomerResetByUrl() { - return (CustomerResetByUrlPayload) get("customerResetByUrl"); - } + /** + * Displayed as **Pending**. + */ + PENDING, - public Mutation setCustomerResetByUrl(CustomerResetByUrlPayload arg) { - optimisticData.put(getKey("customerResetByUrl"), arg); - return this; - } + /** + * Displayed as **Refunded**. + */ + REFUNDED, /** - * Updates an existing customer. + * Displayed as **Voided**. */ + VOIDED, - public CustomerUpdatePayload getCustomerUpdate() { - return (CustomerUpdatePayload) get("customerUpdate"); - } + UNKNOWN_VALUE; - public Mutation setCustomerUpdate(CustomerUpdatePayload arg) { - optimisticData.put(getKey("customerUpdate"), arg); - return this; - } + public static OrderFinancialStatus fromGraphQl(String value) { + if (value == null) { + return null; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cartAttributesUpdate": return true; + switch (value) { + case "AUTHORIZED": { + return AUTHORIZED; + } - case "cartBuyerIdentityUpdate": return true; + case "PAID": { + return PAID; + } - case "cartCreate": return true; + case "PARTIALLY_PAID": { + return PARTIALLY_PAID; + } - case "cartDiscountCodesUpdate": return true; + case "PARTIALLY_REFUNDED": { + return PARTIALLY_REFUNDED; + } - case "cartLinesAdd": return true; + case "PENDING": { + return PENDING; + } - case "cartLinesRemove": return true; + case "REFUNDED": { + return REFUNDED; + } - case "cartLinesUpdate": return true; + case "VOIDED": { + return VOIDED; + } - case "cartNoteUpdate": return true; + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case AUTHORIZED: { + return "AUTHORIZED"; + } - case "cartSelectedDeliveryOptionsUpdate": return true; + case PAID: { + return "PAID"; + } - case "checkoutAttributesUpdateV2": return true; + case PARTIALLY_PAID: { + return "PARTIALLY_PAID"; + } - case "checkoutCompleteFree": return true; + case PARTIALLY_REFUNDED: { + return "PARTIALLY_REFUNDED"; + } - case "checkoutCompleteWithCreditCardV2": return true; + case PENDING: { + return "PENDING"; + } - case "checkoutCompleteWithTokenizedPaymentV3": return true; + case REFUNDED: { + return "REFUNDED"; + } - case "checkoutCreate": return true; + case VOIDED: { + return "VOIDED"; + } - case "checkoutCustomerAssociateV2": return true; + default: { + return ""; + } + } + } + } + + /** + * Represents the order's aggregated fulfillment status for display purposes. + */ + public enum OrderFulfillmentStatus { + /** + * Displayed as **Fulfilled**. All of the items in the order have been fulfilled. + */ + FULFILLED, + + /** + * Displayed as **In progress**. Some of the items in the order have been fulfilled, or a request for + * fulfillment has been sent to the fulfillment service. + */ + IN_PROGRESS, - case "checkoutCustomerDisassociateV2": return true; + /** + * Displayed as **On hold**. All of the unfulfilled items in this order are on hold. + */ + ON_HOLD, - case "checkoutDiscountCodeApplyV2": return true; + /** + * Displayed as **Open**. None of the items in the order have been fulfilled. Replaced by "UNFULFILLED" + * status. + */ + OPEN, - case "checkoutDiscountCodeRemove": return true; + /** + * Displayed as **Partially fulfilled**. Some of the items in the order have been fulfilled. + */ + PARTIALLY_FULFILLED, - case "checkoutEmailUpdateV2": return true; + /** + * Displayed as **Pending fulfillment**. A request for fulfillment of some items awaits a response from + * the fulfillment service. Replaced by "IN_PROGRESS" status. + */ + PENDING_FULFILLMENT, - case "checkoutGiftCardRemoveV2": return true; + /** + * Displayed as **Restocked**. All of the items in the order have been restocked. Replaced by + * "UNFULFILLED" status. + */ + RESTOCKED, - case "checkoutGiftCardsAppend": return true; + /** + * Displayed as **Scheduled**. All of the unfulfilled items in this order are scheduled for fulfillment + * at later time. + */ + SCHEDULED, - case "checkoutLineItemsAdd": return true; + /** + * Displayed as **Unfulfilled**. None of the items in the order have been fulfilled. + */ + UNFULFILLED, - case "checkoutLineItemsRemove": return true; + UNKNOWN_VALUE; - case "checkoutLineItemsReplace": return true; + public static OrderFulfillmentStatus fromGraphQl(String value) { + if (value == null) { + return null; + } - case "checkoutLineItemsUpdate": return true; + switch (value) { + case "FULFILLED": { + return FULFILLED; + } - case "checkoutShippingAddressUpdateV2": return true; + case "IN_PROGRESS": { + return IN_PROGRESS; + } - case "checkoutShippingLineUpdate": return true; + case "ON_HOLD": { + return ON_HOLD; + } - case "customerAccessTokenCreate": return true; + case "OPEN": { + return OPEN; + } - case "customerAccessTokenCreateWithMultipass": return true; + case "PARTIALLY_FULFILLED": { + return PARTIALLY_FULFILLED; + } - case "customerAccessTokenDelete": return true; + case "PENDING_FULFILLMENT": { + return PENDING_FULFILLMENT; + } - case "customerAccessTokenRenew": return true; + case "RESTOCKED": { + return RESTOCKED; + } - case "customerActivate": return true; + case "SCHEDULED": { + return SCHEDULED; + } - case "customerActivateByUrl": return true; + case "UNFULFILLED": { + return UNFULFILLED; + } - case "customerAddressCreate": return true; + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case FULFILLED: { + return "FULFILLED"; + } - case "customerAddressDelete": return true; + case IN_PROGRESS: { + return "IN_PROGRESS"; + } - case "customerAddressUpdate": return true; + case ON_HOLD: { + return "ON_HOLD"; + } - case "customerCreate": return true; + case OPEN: { + return "OPEN"; + } - case "customerDefaultAddressUpdate": return true; + case PARTIALLY_FULFILLED: { + return "PARTIALLY_FULFILLED"; + } - case "customerRecover": return true; + case PENDING_FULFILLMENT: { + return "PENDING_FULFILLMENT"; + } - case "customerReset": return true; + case RESTOCKED: { + return "RESTOCKED"; + } - case "customerResetByUrl": return true; + case SCHEDULED: { + return "SCHEDULED"; + } - case "customerUpdate": return true; + case UNFULFILLED: { + return "UNFULFILLED"; + } - default: return false; + default: { + return ""; + } } } } - public interface NodeQueryDefinition { - void define(NodeQuery _queryBuilder); + public interface OrderLineItemQueryDefinition { + void define(OrderLineItemQuery _queryBuilder); } /** - * An object with an ID field to support global identification, in accordance with the - * [Relay specification](https://relay.dev/graphql/objectidentification.htm#sec-Node-Interface). - * This interface is used by the [node](https://shopify.dev/api/admin-graphql/unstable/queries/node) - * and [nodes](https://shopify.dev/api/admin-graphql/unstable/queries/nodes) queries. + * Represents a single line in an order. There is one line item for each distinct product variant. */ - public static class NodeQuery extends Query { - NodeQuery(StringBuilder _queryBuilder) { + public static class OrderLineItemQuery extends Query { + OrderLineItemQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("__typename"); } /** - * A globally-unique identifier. + * The number of entries associated to the line item minus the items that have been removed. */ - public NodeQuery id() { - startField("id"); + public OrderLineItemQuery currentQuantity() { + startField("currentQuantity"); return this; } - public NodeQuery onAppliedGiftCard(AppliedGiftCardQueryDefinition queryDef) { - startInlineFragment("AppliedGiftCard"); - queryDef.define(new AppliedGiftCardQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * List of custom attributes associated to the line item. + */ + public OrderLineItemQuery customAttributes(AttributeQueryDefinition queryDef) { + startField("customAttributes"); - public NodeQuery onArticle(ArticleQueryDefinition queryDef) { - startInlineFragment("Article"); - queryDef.define(new ArticleQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new AttributeQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public NodeQuery onBlog(BlogQueryDefinition queryDef) { - startInlineFragment("Blog"); - queryDef.define(new BlogQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public NodeQuery onCart(CartQueryDefinition queryDef) { - startInlineFragment("Cart"); - queryDef.define(new CartQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * The discounts that have been allocated onto the order line item by discount applications. + */ + public OrderLineItemQuery discountAllocations(DiscountAllocationQueryDefinition queryDef) { + startField("discountAllocations"); - public NodeQuery onCartLine(CartLineQueryDefinition queryDef) { - startInlineFragment("CartLine"); - queryDef.define(new CartLineQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new DiscountAllocationQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public NodeQuery onCheckout(CheckoutQueryDefinition queryDef) { - startInlineFragment("Checkout"); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public NodeQuery onCheckoutLineItem(CheckoutLineItemQueryDefinition queryDef) { - startInlineFragment("CheckoutLineItem"); - queryDef.define(new CheckoutLineItemQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * The total price of the line item, including discounts, and displayed in the presentment currency. + */ + public OrderLineItemQuery discountedTotalPrice(MoneyV2QueryDefinition queryDef) { + startField("discountedTotalPrice"); - public NodeQuery onCollection(CollectionQueryDefinition queryDef) { - startInlineFragment("Collection"); - queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public NodeQuery onComment(CommentQueryDefinition queryDef) { - startInlineFragment("Comment"); - queryDef.define(new CommentQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public NodeQuery onExternalVideo(ExternalVideoQueryDefinition queryDef) { - startInlineFragment("ExternalVideo"); - queryDef.define(new ExternalVideoQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * The total price of the line item, not including any discounts. The total price is calculated using + * the original unit price multiplied by the quantity, and it is displayed in the presentment currency. + */ + public OrderLineItemQuery originalTotalPrice(MoneyV2QueryDefinition queryDef) { + startField("originalTotalPrice"); - public NodeQuery onGenericFile(GenericFileQueryDefinition queryDef) { - startInlineFragment("GenericFile"); - queryDef.define(new GenericFileQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public NodeQuery onLocation(LocationQueryDefinition queryDef) { - startInlineFragment("Location"); - queryDef.define(new LocationQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public NodeQuery onMailingAddress(MailingAddressQueryDefinition queryDef) { - startInlineFragment("MailingAddress"); - queryDef.define(new MailingAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * The number of products variants associated to the line item. + */ + public OrderLineItemQuery quantity() { + startField("quantity"); - public NodeQuery onMediaImage(MediaImageQueryDefinition queryDef) { - startInlineFragment("MediaImage"); - queryDef.define(new MediaImageQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public NodeQuery onMenu(MenuQueryDefinition queryDef) { - startInlineFragment("Menu"); - queryDef.define(new MenuQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * The title of the product combined with title of the variant. + */ + public OrderLineItemQuery title() { + startField("title"); - public NodeQuery onMenuItem(MenuItemQueryDefinition queryDef) { - startInlineFragment("MenuItem"); - queryDef.define(new MenuItemQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public NodeQuery onMetafield(MetafieldQueryDefinition queryDef) { - startInlineFragment("Metafield"); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * The product variant object associated to the line item. + */ + public OrderLineItemQuery variant(ProductVariantQueryDefinition queryDef) { + startField("variant"); - public NodeQuery onMetaobject(MetaobjectQueryDefinition queryDef) { - startInlineFragment("Metaobject"); - queryDef.define(new MetaobjectQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new ProductVariantQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public NodeQuery onModel3d(Model3dQueryDefinition queryDef) { - startInlineFragment("Model3d"); - queryDef.define(new Model3dQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } + } - public NodeQuery onOrder(OrderQueryDefinition queryDef) { - startInlineFragment("Order"); - queryDef.define(new OrderQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + /** + * Represents a single line in an order. There is one line item for each distinct product variant. + */ + public static class OrderLineItem extends AbstractResponse { + public OrderLineItem() { } - public NodeQuery onPage(PageQueryDefinition queryDef) { - startInlineFragment("Page"); - queryDef.define(new PageQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + public OrderLineItem(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "currentQuantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); - public NodeQuery onPayment(PaymentQueryDefinition queryDef) { - startInlineFragment("Payment"); - queryDef.define(new PaymentQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + break; + } - public NodeQuery onProduct(ProductQueryDefinition queryDef) { - startInlineFragment("Product"); - queryDef.define(new ProductQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + case "customAttributes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Attribute(jsonAsObject(element1, key))); + } - public NodeQuery onProductOption(ProductOptionQueryDefinition queryDef) { - startInlineFragment("ProductOption"); - queryDef.define(new ProductOptionQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + responseData.put(key, list1); - public NodeQuery onProductVariant(ProductVariantQueryDefinition queryDef) { - startInlineFragment("ProductVariant"); - queryDef.define(new ProductVariantQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + break; + } - public NodeQuery onShop(ShopQueryDefinition queryDef) { - startInlineFragment("Shop"); - queryDef.define(new ShopQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + case "discountAllocations": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new DiscountAllocation(jsonAsObject(element1, key))); + } - public NodeQuery onShopPolicy(ShopPolicyQueryDefinition queryDef) { - startInlineFragment("ShopPolicy"); - queryDef.define(new ShopPolicyQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + responseData.put(key, list1); - public NodeQuery onUrlRedirect(UrlRedirectQueryDefinition queryDef) { - startInlineFragment("UrlRedirect"); - queryDef.define(new UrlRedirectQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + break; + } - public NodeQuery onVideo(VideoQueryDefinition queryDef) { - startInlineFragment("Video"); - queryDef.define(new VideoQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } - } + case "discountedTotalPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - public interface Node extends com.shopify.graphql.support.Node { - String getGraphQlTypeName(); + break; + } - ID getId(); - } + case "originalTotalPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - /** - * An object with an ID field to support global identification, in accordance with the - * [Relay specification](https://relay.dev/graphql/objectidentification.htm#sec-Node-Interface). - * This interface is used by the [node](https://shopify.dev/api/admin-graphql/unstable/queries/node) - * and [nodes](https://shopify.dev/api/admin-graphql/unstable/queries/nodes) queries. - */ - public static class UnknownNode extends AbstractResponse implements Node { - public UnknownNode() { - } + break; + } - public UnknownNode(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case "quantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); + + break; + } + + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "variant": { + ProductVariant optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ProductVariant(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } @@ -44852,242 +52426,226 @@ public UnknownNode(JsonObject fields) throws SchemaViolationError { } } - public static Node create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "AppliedGiftCard": { - return new AppliedGiftCard(fields); - } - - case "Article": { - return new Article(fields); - } - - case "Blog": { - return new Blog(fields); - } - - case "Cart": { - return new Cart(fields); - } - - case "CartLine": { - return new CartLine(fields); - } - - case "Checkout": { - return new Checkout(fields); - } - - case "CheckoutLineItem": { - return new CheckoutLineItem(fields); - } - - case "Collection": { - return new Collection(fields); - } - - case "Comment": { - return new Comment(fields); - } - - case "ExternalVideo": { - return new ExternalVideo(fields); - } + public String getGraphQlTypeName() { + return "OrderLineItem"; + } - case "GenericFile": { - return new GenericFile(fields); - } + /** + * The number of entries associated to the line item minus the items that have been removed. + */ - case "Location": { - return new Location(fields); - } + public Integer getCurrentQuantity() { + return (Integer) get("currentQuantity"); + } - case "MailingAddress": { - return new MailingAddress(fields); - } + public OrderLineItem setCurrentQuantity(Integer arg) { + optimisticData.put(getKey("currentQuantity"), arg); + return this; + } - case "MediaImage": { - return new MediaImage(fields); - } + /** + * List of custom attributes associated to the line item. + */ - case "Menu": { - return new Menu(fields); - } + public List getCustomAttributes() { + return (List) get("customAttributes"); + } - case "MenuItem": { - return new MenuItem(fields); - } + public OrderLineItem setCustomAttributes(List arg) { + optimisticData.put(getKey("customAttributes"), arg); + return this; + } - case "Metafield": { - return new Metafield(fields); - } + /** + * The discounts that have been allocated onto the order line item by discount applications. + */ - case "Metaobject": { - return new Metaobject(fields); - } + public List getDiscountAllocations() { + return (List) get("discountAllocations"); + } - case "Model3d": { - return new Model3d(fields); - } + public OrderLineItem setDiscountAllocations(List arg) { + optimisticData.put(getKey("discountAllocations"), arg); + return this; + } - case "Order": { - return new Order(fields); - } + /** + * The total price of the line item, including discounts, and displayed in the presentment currency. + */ - case "Page": { - return new Page(fields); - } + public MoneyV2 getDiscountedTotalPrice() { + return (MoneyV2) get("discountedTotalPrice"); + } - case "Payment": { - return new Payment(fields); - } + public OrderLineItem setDiscountedTotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("discountedTotalPrice"), arg); + return this; + } - case "Product": { - return new Product(fields); - } + /** + * The total price of the line item, not including any discounts. The total price is calculated using + * the original unit price multiplied by the quantity, and it is displayed in the presentment currency. + */ - case "ProductOption": { - return new ProductOption(fields); - } + public MoneyV2 getOriginalTotalPrice() { + return (MoneyV2) get("originalTotalPrice"); + } - case "ProductVariant": { - return new ProductVariant(fields); - } + public OrderLineItem setOriginalTotalPrice(MoneyV2 arg) { + optimisticData.put(getKey("originalTotalPrice"), arg); + return this; + } - case "Shop": { - return new Shop(fields); - } + /** + * The number of products variants associated to the line item. + */ - case "ShopPolicy": { - return new ShopPolicy(fields); - } + public Integer getQuantity() { + return (Integer) get("quantity"); + } - case "UrlRedirect": { - return new UrlRedirect(fields); - } + public OrderLineItem setQuantity(Integer arg) { + optimisticData.put(getKey("quantity"), arg); + return this; + } - case "Video": { - return new Video(fields); - } + /** + * The title of the product combined with title of the variant. + */ - default: { - return new UnknownNode(fields); - } - } + public String getTitle() { + return (String) get("title"); } - public String getGraphQlTypeName() { - return (String) get("__typename"); + public OrderLineItem setTitle(String arg) { + optimisticData.put(getKey("title"), arg); + return this; } /** - * A globally-unique identifier. + * The product variant object associated to the line item. */ - public ID getId() { - return (ID) get("id"); + public ProductVariant getVariant() { + return (ProductVariant) get("variant"); } - public UnknownNode setId(ID arg) { - optimisticData.put(getKey("id"), arg); + public OrderLineItem setVariant(ProductVariant arg) { + optimisticData.put(getKey("variant"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "id": return false; + case "currentQuantity": return false; + + case "customAttributes": return true; + + case "discountAllocations": return true; + + case "discountedTotalPrice": return true; + + case "originalTotalPrice": return true; + + case "quantity": return false; + + case "title": return false; + + case "variant": return true; default: return false; } } } - public interface OnlineStorePublishableQueryDefinition { - void define(OnlineStorePublishableQuery _queryBuilder); + public interface OrderLineItemConnectionQueryDefinition { + void define(OrderLineItemConnectionQuery _queryBuilder); } /** - * Represents a resource that can be published to the Online Store sales channel. + * An auto-generated type for paginating through multiple OrderLineItems. */ - public static class OnlineStorePublishableQuery extends Query { - OnlineStorePublishableQuery(StringBuilder _queryBuilder) { + public static class OrderLineItemConnectionQuery extends Query { + OrderLineItemConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("__typename"); } /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. + * A list of edges. */ - public OnlineStorePublishableQuery onlineStoreUrl() { - startField("onlineStoreUrl"); - - return this; - } + public OrderLineItemConnectionQuery edges(OrderLineItemEdgeQueryDefinition queryDef) { + startField("edges"); - public OnlineStorePublishableQuery onArticle(ArticleQueryDefinition queryDef) { - startInlineFragment("Article"); - queryDef.define(new ArticleQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new OrderLineItemEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; - } - public OnlineStorePublishableQuery onBlog(BlogQueryDefinition queryDef) { - startInlineFragment("Blog"); - queryDef.define(new BlogQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public OnlineStorePublishableQuery onCollection(CollectionQueryDefinition queryDef) { - startInlineFragment("Collection"); - queryDef.define(new CollectionQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * A list of the nodes contained in OrderLineItemEdge. + */ + public OrderLineItemConnectionQuery nodes(OrderLineItemQueryDefinition queryDef) { + startField("nodes"); - public OnlineStorePublishableQuery onPage(PageQueryDefinition queryDef) { - startInlineFragment("Page"); - queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new OrderLineItemQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } - public OnlineStorePublishableQuery onProduct(ProductQueryDefinition queryDef) { - startInlineFragment("Product"); - queryDef.define(new ProductQuery(_queryBuilder)); + /** + * Information to aid in pagination. + */ + public OrderLineItemConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); + + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); _queryBuilder.append('}'); + return this; } } - public interface OnlineStorePublishable { - String getGraphQlTypeName(); - - String getOnlineStoreUrl(); - } - /** - * Represents a resource that can be published to the Online Store sales channel. + * An auto-generated type for paginating through multiple OrderLineItems. */ - public static class UnknownOnlineStorePublishable extends AbstractResponse implements OnlineStorePublishable { - public UnknownOnlineStorePublishable() { + public static class OrderLineItemConnection extends AbstractResponse { + public OrderLineItemConnection() { } - public UnknownOnlineStorePublishable(JsonObject fields) throws SchemaViolationError { + public OrderLineItemConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "onlineStoreUrl": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new OrderLineItemEdge(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); + + break; + } + + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new OrderLineItem(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } @@ -45103,401 +52661,299 @@ public UnknownOnlineStorePublishable(JsonObject fields) throws SchemaViolationEr } } - public static OnlineStorePublishable create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "Article": { - return new Article(fields); - } + public String getGraphQlTypeName() { + return "OrderLineItemConnection"; + } - case "Blog": { - return new Blog(fields); - } + /** + * A list of edges. + */ - case "Collection": { - return new Collection(fields); - } + public List getEdges() { + return (List) get("edges"); + } - case "Page": { - return new Page(fields); - } + public OrderLineItemConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; + } - case "Product": { - return new Product(fields); - } + /** + * A list of the nodes contained in OrderLineItemEdge. + */ - default: { - return new UnknownOnlineStorePublishable(fields); - } - } + public List getNodes() { + return (List) get("nodes"); } - public String getGraphQlTypeName() { - return (String) get("__typename"); + public OrderLineItemConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; } /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. + * Information to aid in pagination. */ - public String getOnlineStoreUrl() { - return (String) get("onlineStoreUrl"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public UnknownOnlineStorePublishable setOnlineStoreUrl(String arg) { - optimisticData.put(getKey("onlineStoreUrl"), arg); + public OrderLineItemConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "onlineStoreUrl": return false; + case "edges": return true; + + case "nodes": return true; + + case "pageInfo": return true; default: return false; } } } - public interface OrderQueryDefinition { - void define(OrderQuery _queryBuilder); + public interface OrderLineItemEdgeQueryDefinition { + void define(OrderLineItemEdgeQuery _queryBuilder); } /** - * An order is a customer’s completed request to purchase one or more products from a shop. An order is - * created when a customer completes the checkout process, during which time they provides an email - * address, billing address and payment information. + * An auto-generated type which holds one OrderLineItem and a cursor during pagination. */ - public static class OrderQuery extends Query { - OrderQuery(StringBuilder _queryBuilder) { + public static class OrderLineItemEdgeQuery extends Query { + OrderLineItemEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("id"); - } - - /** - * The reason for the order's cancellation. Returns `null` if the order wasn't canceled. - */ - public OrderQuery cancelReason() { - startField("cancelReason"); - - return this; - } - - /** - * The date and time when the order was canceled. Returns null if the order wasn't canceled. - */ - public OrderQuery canceledAt() { - startField("canceledAt"); - - return this; } /** - * The code of the currency used for the payment. + * A cursor for use in pagination. */ - public OrderQuery currencyCode() { - startField("currencyCode"); + public OrderLineItemEdgeQuery cursor() { + startField("cursor"); return this; } /** - * The subtotal of line items and their discounts, excluding line items that have been removed. Does - * not contain order-level discounts, duties, shipping costs, or shipping discounts. Taxes are not - * included unless the order is a taxes-included order. + * The item at the end of OrderLineItemEdge. */ - public OrderQuery currentSubtotalPrice(MoneyV2QueryDefinition queryDef) { - startField("currentSubtotalPrice"); + public OrderLineItemEdgeQuery node(OrderLineItemQueryDefinition queryDef) { + startField("node"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new OrderLineItemQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - /** - * The total cost of duties for the order, including refunds. - */ - public OrderQuery currentTotalDuties(MoneyV2QueryDefinition queryDef) { - startField("currentTotalDuties"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + /** + * An auto-generated type which holds one OrderLineItem and a cursor during pagination. + */ + public static class OrderLineItemEdge extends AbstractResponse { + public OrderLineItemEdge() { } - /** - * The total amount of the order, including duties, taxes and discounts, minus amounts for line items - * that have been removed. - */ - public OrderQuery currentTotalPrice(MoneyV2QueryDefinition queryDef) { - startField("currentTotalPrice"); + public OrderLineItemEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; - } + case "node": { + responseData.put(key, new OrderLineItem(jsonAsObject(field.getValue(), key))); - /** - * The total of all taxes applied to the order, excluding taxes for returned line items. - */ - public OrderQuery currentTotalTax(MoneyV2QueryDefinition queryDef) { - startField("currentTotalTax"); + break; + } - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } - return this; + public String getGraphQlTypeName() { + return "OrderLineItemEdge"; } /** - * A list of the custom attributes added to the order. + * A cursor for use in pagination. */ - public OrderQuery customAttributes(AttributeQueryDefinition queryDef) { - startField("customAttributes"); - - _queryBuilder.append('{'); - queryDef.define(new AttributeQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public String getCursor() { + return (String) get("cursor"); } - /** - * The locale code in which this specific order happened. - */ - public OrderQuery customerLocale() { - startField("customerLocale"); - + public OrderLineItemEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * The unique URL that the customer can use to access the order. + * The item at the end of OrderLineItemEdge. */ - public OrderQuery customerUrl() { - startField("customerUrl"); - - return this; - } - - public class DiscountApplicationsArguments extends Arguments { - DiscountApplicationsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public DiscountApplicationsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public DiscountApplicationsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the last `n` elements from the list. - */ - public DiscountApplicationsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public DiscountApplicationsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Reverse the order of the underlying list. - */ - public DiscountApplicationsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - } - public interface DiscountApplicationsArgumentsDefinition { - void define(DiscountApplicationsArguments args); + public OrderLineItem getNode() { + return (OrderLineItem) get("node"); } - /** - * Discounts that have been applied on the order. - */ - public OrderQuery discountApplications(DiscountApplicationConnectionQueryDefinition queryDef) { - return discountApplications(args -> {}, queryDef); + public OrderLineItemEdge setNode(OrderLineItem arg) { + optimisticData.put(getKey("node"), arg); + return this; } - /** - * Discounts that have been applied on the order. - */ - public OrderQuery discountApplications(DiscountApplicationsArgumentsDefinition argsDef, DiscountApplicationConnectionQueryDefinition queryDef) { - startField("discountApplications"); - - DiscountApplicationsArguments args = new DiscountApplicationsArguments(_queryBuilder); - argsDef.define(args); - DiscountApplicationsArguments.end(args); - - _queryBuilder.append('{'); - queryDef.define(new DiscountApplicationConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - return this; + case "node": return true; + + default: return false; + } } + } + /** + * The set of valid sort keys for the Order query. + */ + public enum OrderSortKeys { /** - * Whether the order has had any edits applied or not. + * Sort by the `id` value. */ - public OrderQuery edited() { - startField("edited"); - - return this; - } + ID, /** - * The customer's email address. + * Sort by the `processed_at` value. */ - public OrderQuery email() { - startField("email"); - - return this; - } + PROCESSED_AT, /** - * The financial status of the order. + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. */ - public OrderQuery financialStatus() { - startField("financialStatus"); - - return this; - } + RELEVANCE, /** - * The fulfillment status for the order. + * Sort by the `total_price` value. */ - public OrderQuery fulfillmentStatus() { - startField("fulfillmentStatus"); + TOTAL_PRICE, - return this; - } + UNKNOWN_VALUE; - public class LineItemsArguments extends Arguments { - LineItemsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); + public static OrderSortKeys fromGraphQl(String value) { + if (value == null) { + return null; } - /** - * Returns up to the first `n` elements from the list. - */ - public LineItemsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); + switch (value) { + case "ID": { + return ID; } - return this; - } - /** - * Returns the elements that come after the specified cursor. - */ - public LineItemsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "PROCESSED_AT": { + return PROCESSED_AT; } - return this; - } - /** - * Returns up to the last `n` elements from the list. - */ - public LineItemsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); + case "RELEVANCE": { + return RELEVANCE; } - return this; - } - /** - * Returns the elements that come before the specified cursor. - */ - public LineItemsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "TOTAL_PRICE": { + return TOTAL_PRICE; + } + + default: { + return UNKNOWN_VALUE; } - return this; } + } + public String toString() { + switch (this) { + case ID: { + return "ID"; + } - /** - * Reverse the order of the underlying list. - */ - public LineItemsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); + case PROCESSED_AT: { + return "PROCESSED_AT"; + } + + case RELEVANCE: { + return "RELEVANCE"; + } + + case TOTAL_PRICE: { + return "TOTAL_PRICE"; + } + + default: { + return ""; } - return this; } } + } - public interface LineItemsArgumentsDefinition { - void define(LineItemsArguments args); + public interface PageQueryDefinition { + void define(PageQuery _queryBuilder); + } + + /** + * Shopify merchants can create pages to hold static HTML content. Each Page object represents a custom + * page on the online store. + */ + public static class PageQuery extends Query { + PageQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); } /** - * List of the order’s line items. + * The description of the page, complete with HTML formatting. */ - public OrderQuery lineItems(OrderLineItemConnectionQueryDefinition queryDef) { - return lineItems(args -> {}, queryDef); + public PageQuery body() { + startField("body"); + + return this; } /** - * List of the order’s line items. + * Summary of the page body. */ - public OrderQuery lineItems(LineItemsArgumentsDefinition argsDef, OrderLineItemConnectionQueryDefinition queryDef) { - startField("lineItems"); + public PageQuery bodySummary() { + startField("bodySummary"); - LineItemsArguments args = new LineItemsArguments(_queryBuilder); - argsDef.define(args); - LineItemsArguments.end(args); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new OrderLineItemConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The timestamp of the page creation. + */ + public PageQuery createdAt() { + startField("createdAt"); + + return this; + } + + /** + * A human-friendly unique string for the page automatically generated from its title. + */ + public PageQuery handle() { + startField("handle"); return this; } @@ -45505,7 +52961,7 @@ public OrderQuery lineItems(LineItemsArgumentsDefinition argsDef, OrderLineItemC /** * Returns a metafield found by namespace and key. */ - public OrderQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { + public PageQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { startField("metafield"); _queryBuilder.append("(namespace:"); @@ -45526,7 +52982,7 @@ public OrderQuery metafield(String namespace, String key, MetafieldQueryDefiniti /** * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public OrderQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + public PageQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { startField("metafields"); _queryBuilder.append("(identifiers:"); @@ -45551,292 +53007,385 @@ public OrderQuery metafields(List identifiers, Metafiel } /** - * Unique identifier for the order that appears on the order. - * For example, _#1000_ or _Store1001. + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. */ - public OrderQuery name() { - startField("name"); + public PageQuery onlineStoreUrl() { + startField("onlineStoreUrl"); return this; } /** - * A unique numeric identifier for the order for use by shop owner and customer. + * The page's SEO information. */ - public OrderQuery orderNumber() { - startField("orderNumber"); + public PageQuery seo(SEOQueryDefinition queryDef) { + startField("seo"); + + _queryBuilder.append('{'); + queryDef.define(new SEOQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The total cost of duties charged at checkout. + * The title of the page. */ - public OrderQuery originalTotalDuties(MoneyV2QueryDefinition queryDef) { - startField("originalTotalDuties"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public PageQuery title() { + startField("title"); return this; } /** - * The total price of the order before any applied edits. + * The timestamp of the latest page update. */ - public OrderQuery originalTotalPrice(MoneyV2QueryDefinition queryDef) { - startField("originalTotalPrice"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public PageQuery updatedAt() { + startField("updatedAt"); return this; } + } + + /** + * Shopify merchants can create pages to hold static HTML content. Each Page object represents a custom + * page on the online store. + */ + public static class Page extends AbstractResponse implements HasMetafields, MetafieldParentResource, MetafieldReference, Node, OnlineStorePublishable { + public Page() { + } + + public Page(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "body": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "bodySummary": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "createdAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "metafields": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } + + list1.add(optional2); + } + + responseData.put(key, list1); + + break; + } + + case "onlineStoreUrl": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "seo": { + SEO optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new SEO(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public Page(ID id) { + this(); + optimisticData.put("id", id); + } + + public String getGraphQlTypeName() { + return "Page"; + } /** - * The customer's phone number for receiving SMS notifications. + * The description of the page, complete with HTML formatting. */ - public OrderQuery phone() { - startField("phone"); + public String getBody() { + return (String) get("body"); + } + + public Page setBody(String arg) { + optimisticData.put(getKey("body"), arg); return this; } /** - * The date and time when the order was imported. - * This value can be set to dates in the past when importing from other systems. - * If no value is provided, it will be auto-generated based on current date and time. + * Summary of the page body. */ - public OrderQuery processedAt() { - startField("processedAt"); + public String getBodySummary() { + return (String) get("bodySummary"); + } + + public Page setBodySummary(String arg) { + optimisticData.put(getKey("bodySummary"), arg); return this; } /** - * The address to where the order will be shipped. + * The timestamp of the page creation. */ - public OrderQuery shippingAddress(MailingAddressQueryDefinition queryDef) { - startField("shippingAddress"); - _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); + public DateTime getCreatedAt() { + return (DateTime) get("createdAt"); + } + public Page setCreatedAt(DateTime arg) { + optimisticData.put(getKey("createdAt"), arg); return this; } /** - * The discounts that have been allocated onto the shipping line by discount applications. + * A human-friendly unique string for the page automatically generated from its title. */ - public OrderQuery shippingDiscountAllocations(DiscountAllocationQueryDefinition queryDef) { - startField("shippingDiscountAllocations"); - _queryBuilder.append('{'); - queryDef.define(new DiscountAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getHandle() { + return (String) get("handle"); + } + public Page setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); return this; } /** - * The unique URL for the order's status page. + * A globally-unique identifier. */ - public OrderQuery statusUrl() { - startField("statusUrl"); - return this; + public ID getId() { + return (ID) get("id"); } /** - * Price of the order before shipping and taxes. + * Returns a metafield found by namespace and key. */ - public OrderQuery subtotalPrice(MoneyV2QueryDefinition queryDef) { - startField("subtotalPrice"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } + public Page setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); return this; } /** - * Price of the order before duties, shipping and taxes. - * - * @deprecated Use `subtotalPrice` instead. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - @Deprecated - public OrderQuery subtotalPriceV2(MoneyV2QueryDefinition queryDef) { - startField("subtotalPriceV2"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public List getMetafields() { + return (List) get("metafields"); + } + public Page setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); return this; } - public class SuccessfulFulfillmentsArguments extends Arguments { - SuccessfulFulfillmentsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. + */ - /** - * Truncate the array result to this size. - */ - public SuccessfulFulfillmentsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public String getOnlineStoreUrl() { + return (String) get("onlineStoreUrl"); } - public interface SuccessfulFulfillmentsArgumentsDefinition { - void define(SuccessfulFulfillmentsArguments args); + public Page setOnlineStoreUrl(String arg) { + optimisticData.put(getKey("onlineStoreUrl"), arg); + return this; } /** - * List of the order’s successful fulfillments. + * The page's SEO information. */ - public OrderQuery successfulFulfillments(FulfillmentQueryDefinition queryDef) { - return successfulFulfillments(args -> {}, queryDef); + + public SEO getSeo() { + return (SEO) get("seo"); + } + + public Page setSeo(SEO arg) { + optimisticData.put(getKey("seo"), arg); + return this; } /** - * List of the order’s successful fulfillments. + * The title of the page. */ - public OrderQuery successfulFulfillments(SuccessfulFulfillmentsArgumentsDefinition argsDef, FulfillmentQueryDefinition queryDef) { - startField("successfulFulfillments"); - - SuccessfulFulfillmentsArguments args = new SuccessfulFulfillmentsArguments(_queryBuilder); - argsDef.define(args); - SuccessfulFulfillmentsArguments.end(args); - _queryBuilder.append('{'); - queryDef.define(new FulfillmentQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getTitle() { + return (String) get("title"); + } + public Page setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } /** - * The sum of all the prices of all the items in the order, duties, taxes and discounts included (must - * be positive). + * The timestamp of the latest page update. */ - public OrderQuery totalPrice(MoneyV2QueryDefinition queryDef) { - startField("totalPrice"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); + } + public Page setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); return this; } - /** - * The sum of all the prices of all the items in the order, duties, taxes and discounts included (must - * be positive). - * - * @deprecated Use `totalPrice` instead. - */ - @Deprecated - public OrderQuery totalPriceV2(MoneyV2QueryDefinition queryDef) { - startField("totalPriceV2"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "body": return false; - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + case "bodySummary": return false; + + case "createdAt": return false; + + case "handle": return false; + + case "id": return false; - return this; - } + case "metafield": return true; - /** - * The total amount that has been refunded. - */ - public OrderQuery totalRefunded(MoneyV2QueryDefinition queryDef) { - startField("totalRefunded"); + case "metafields": return true; - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + case "onlineStoreUrl": return false; - return this; - } + case "seo": return true; - /** - * The total amount that has been refunded. - * - * @deprecated Use `totalRefunded` instead. - */ - @Deprecated - public OrderQuery totalRefundedV2(MoneyV2QueryDefinition queryDef) { - startField("totalRefundedV2"); + case "title": return false; - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + case "updatedAt": return false; - return this; + default: return false; + } } + } - /** - * The total cost of shipping. - */ - public OrderQuery totalShippingPrice(MoneyV2QueryDefinition queryDef) { - startField("totalShippingPrice"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public interface PageConnectionQueryDefinition { + void define(PageConnectionQuery _queryBuilder); + } - return this; + /** + * An auto-generated type for paginating through multiple Pages. + */ + public static class PageConnectionQuery extends Query { + PageConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The total cost of shipping. - * - * @deprecated Use `totalShippingPrice` instead. + * A list of edges. */ - @Deprecated - public OrderQuery totalShippingPriceV2(MoneyV2QueryDefinition queryDef) { - startField("totalShippingPriceV2"); + public PageConnectionQuery edges(PageEdgeQueryDefinition queryDef) { + startField("edges"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new PageEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The total cost of taxes. + * A list of the nodes contained in PageEdge. */ - public OrderQuery totalTax(MoneyV2QueryDefinition queryDef) { - startField("totalTax"); + public PageConnectionQuery nodes(PageQueryDefinition queryDef) { + startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new PageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The total cost of taxes. - * - * @deprecated Use `totalTax` instead. + * Information to aid in pagination. */ - @Deprecated - public OrderQuery totalTaxV2(MoneyV2QueryDefinition queryDef) { - startField("totalTaxV2"); + public PageConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new PageInfoQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -45844,80 +53393,21 @@ public OrderQuery totalTaxV2(MoneyV2QueryDefinition queryDef) { } /** - * An order is a customer’s completed request to purchase one or more products from a shop. An order is - * created when a customer completes the checkout process, during which time they provides an email - * address, billing address and payment information. + * An auto-generated type for paginating through multiple Pages. */ - public static class Order extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { - public Order() { + public static class PageConnection extends AbstractResponse { + public PageConnection() { } - public Order(JsonObject fields) throws SchemaViolationError { + public PageConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cancelReason": { - OrderCancelReason optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = OrderCancelReason.fromGraphQl(jsonAsString(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "canceledAt": { - DateTime optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = Utils.parseDateTime(jsonAsString(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "currencyCode": { - responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "currentSubtotalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "currentTotalDuties": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "currentTotalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "currentTotalTax": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "customAttributes": { - List list1 = new ArrayList<>(); + case "edges": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Attribute(jsonAsObject(element1, key))); + list1.add(new PageEdge(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -45925,270 +53415,295 @@ public Order(JsonObject fields) throws SchemaViolationError { break; } - case "customerLocale": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "customerUrl": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Page(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "discountApplications": { - responseData.put(key, new DiscountApplicationConnection(jsonAsObject(field.getValue(), key))); + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } - case "edited": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - - case "email": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; + default: { + throw new SchemaViolationError(this, key, field.getValue()); } + } + } + } - case "financialStatus": { - OrderFinancialStatus optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = OrderFinancialStatus.fromGraphQl(jsonAsString(field.getValue(), key)); - } - - responseData.put(key, optional1); + public String getGraphQlTypeName() { + return "PageConnection"; + } - break; - } + /** + * A list of edges. + */ - case "fulfillmentStatus": { - responseData.put(key, OrderFulfillmentStatus.fromGraphQl(jsonAsString(field.getValue(), key))); + public List getEdges() { + return (List) get("edges"); + } - break; - } + public PageConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; + } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + /** + * A list of the nodes contained in PageEdge. + */ - break; - } + public List getNodes() { + return (List) get("nodes"); + } - case "lineItems": { - responseData.put(key, new OrderLineItemConnection(jsonAsObject(field.getValue(), key))); + public PageConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; + } - break; - } + /** + * Information to aid in pagination. + */ - case "metafield": { - Metafield optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); - } + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } - responseData.put(key, optional1); + public PageConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); + return this; + } - break; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - case "metafields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } + case "nodes": return true; - list1.add(optional2); - } + case "pageInfo": return true; - responseData.put(key, list1); + default: return false; + } + } + } - break; - } + public interface PageEdgeQueryDefinition { + void define(PageEdgeQuery _queryBuilder); + } - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * An auto-generated type which holds one Page and a cursor during pagination. + */ + public static class PageEdgeQuery extends Query { + PageEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - break; - } + /** + * A cursor for use in pagination. + */ + public PageEdgeQuery cursor() { + startField("cursor"); - case "orderNumber": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + return this; + } - break; - } + /** + * The item at the end of PageEdge. + */ + public PageEdgeQuery node(PageQueryDefinition queryDef) { + startField("node"); - case "originalTotalDuties": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } + _queryBuilder.append('{'); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); - responseData.put(key, optional1); + return this; + } + } - break; - } + /** + * An auto-generated type which holds one Page and a cursor during pagination. + */ + public static class PageEdge extends AbstractResponse { + public PageEdge() { + } - case "originalTotalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + public PageEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "phone": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "node": { + responseData.put(key, new Page(jsonAsObject(field.getValue(), key))); break; } - case "processedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - - case "shippingAddress": { - MailingAddress optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; + default: { + throw new SchemaViolationError(this, key, field.getValue()); } + } + } + } - case "shippingDiscountAllocations": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new DiscountAllocation(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + public String getGraphQlTypeName() { + return "PageEdge"; + } - break; - } + /** + * A cursor for use in pagination. + */ - case "statusUrl": { - responseData.put(key, jsonAsString(field.getValue(), key)); + public String getCursor() { + return (String) get("cursor"); + } - break; - } + public PageEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); + return this; + } - case "subtotalPrice": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } + /** + * The item at the end of PageEdge. + */ - responseData.put(key, optional1); + public Page getNode() { + return (Page) get("node"); + } - break; - } + public PageEdge setNode(Page arg) { + optimisticData.put(getKey("node"), arg); + return this; + } - case "subtotalPriceV2": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - responseData.put(key, optional1); + case "node": return true; - break; - } + default: return false; + } + } + } - case "successfulFulfillments": { - List optional1 = null; - if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Fulfillment(jsonAsObject(element1, key))); - } + public interface PageInfoQueryDefinition { + void define(PageInfoQuery _queryBuilder); + } - optional1 = list1; - } + /** + * Returns information about pagination in a connection, in accordance with the + * [Relay specification](https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo). + * For more information, please read our [GraphQL Pagination Usage + * Guide](https://shopify.dev/api/usage/pagination-graphql). + */ + public static class PageInfoQuery extends Query { + PageInfoQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - responseData.put(key, optional1); + /** + * The cursor corresponding to the last node in edges. + */ + public PageInfoQuery endCursor() { + startField("endCursor"); - break; - } + return this; + } - case "totalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + /** + * Whether there are more pages to fetch following the current page. + */ + public PageInfoQuery hasNextPage() { + startField("hasNextPage"); - break; - } + return this; + } - case "totalPriceV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + /** + * Whether there are any pages prior to the current page. + */ + public PageInfoQuery hasPreviousPage() { + startField("hasPreviousPage"); - break; - } + return this; + } - case "totalRefunded": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + /** + * The cursor corresponding to the first node in edges. + */ + public PageInfoQuery startCursor() { + startField("startCursor"); - break; - } + return this; + } + } - case "totalRefundedV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + /** + * Returns information about pagination in a connection, in accordance with the + * [Relay specification](https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo). + * For more information, please read our [GraphQL Pagination Usage + * Guide](https://shopify.dev/api/usage/pagination-graphql). + */ + public static class PageInfo extends AbstractResponse { + public PageInfo() { + } - break; - } + public PageInfo(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "endCursor": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "totalShippingPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + responseData.put(key, optional1); break; } - case "totalShippingPriceV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "hasNextPage": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } - case "totalTax": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "hasPreviousPage": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } - case "totalTaxV2": { - MoneyV2 optional1 = null; + case "startCursor": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -46207,788 +53722,712 @@ public Order(JsonObject fields) throws SchemaViolationError { } } - public Order(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "Order"; + return "PageInfo"; } /** - * The reason for the order's cancellation. Returns `null` if the order wasn't canceled. + * The cursor corresponding to the last node in edges. */ - public OrderCancelReason getCancelReason() { - return (OrderCancelReason) get("cancelReason"); + public String getEndCursor() { + return (String) get("endCursor"); } - public Order setCancelReason(OrderCancelReason arg) { - optimisticData.put(getKey("cancelReason"), arg); + public PageInfo setEndCursor(String arg) { + optimisticData.put(getKey("endCursor"), arg); return this; } /** - * The date and time when the order was canceled. Returns null if the order wasn't canceled. + * Whether there are more pages to fetch following the current page. */ - public DateTime getCanceledAt() { - return (DateTime) get("canceledAt"); + public Boolean getHasNextPage() { + return (Boolean) get("hasNextPage"); } - public Order setCanceledAt(DateTime arg) { - optimisticData.put(getKey("canceledAt"), arg); + public PageInfo setHasNextPage(Boolean arg) { + optimisticData.put(getKey("hasNextPage"), arg); return this; } /** - * The code of the currency used for the payment. + * Whether there are any pages prior to the current page. */ - public CurrencyCode getCurrencyCode() { - return (CurrencyCode) get("currencyCode"); + public Boolean getHasPreviousPage() { + return (Boolean) get("hasPreviousPage"); } - public Order setCurrencyCode(CurrencyCode arg) { - optimisticData.put(getKey("currencyCode"), arg); + public PageInfo setHasPreviousPage(Boolean arg) { + optimisticData.put(getKey("hasPreviousPage"), arg); return this; } /** - * The subtotal of line items and their discounts, excluding line items that have been removed. Does - * not contain order-level discounts, duties, shipping costs, or shipping discounts. Taxes are not - * included unless the order is a taxes-included order. + * The cursor corresponding to the first node in edges. */ - public MoneyV2 getCurrentSubtotalPrice() { - return (MoneyV2) get("currentSubtotalPrice"); + public String getStartCursor() { + return (String) get("startCursor"); } - public Order setCurrentSubtotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("currentSubtotalPrice"), arg); + public PageInfo setStartCursor(String arg) { + optimisticData.put(getKey("startCursor"), arg); return this; } - /** - * The total cost of duties for the order, including refunds. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "endCursor": return false; - public MoneyV2 getCurrentTotalDuties() { - return (MoneyV2) get("currentTotalDuties"); - } + case "hasNextPage": return false; - public Order setCurrentTotalDuties(MoneyV2 arg) { - optimisticData.put(getKey("currentTotalDuties"), arg); - return this; + case "hasPreviousPage": return false; + + case "startCursor": return false; + + default: return false; + } } + } + /** + * The set of valid sort keys for the Page query. + */ + public enum PageSortKeys { /** - * The total amount of the order, including duties, taxes and discounts, minus amounts for line items - * that have been removed. + * Sort by the `id` value. */ + ID, - public MoneyV2 getCurrentTotalPrice() { - return (MoneyV2) get("currentTotalPrice"); - } + /** + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. + */ + RELEVANCE, - public Order setCurrentTotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("currentTotalPrice"), arg); - return this; - } + /** + * Sort by the `title` value. + */ + TITLE, /** - * The total of all taxes applied to the order, excluding taxes for returned line items. + * Sort by the `updated_at` value. */ + UPDATED_AT, - public MoneyV2 getCurrentTotalTax() { - return (MoneyV2) get("currentTotalTax"); - } + UNKNOWN_VALUE; - public Order setCurrentTotalTax(MoneyV2 arg) { - optimisticData.put(getKey("currentTotalTax"), arg); - return this; - } + public static PageSortKeys fromGraphQl(String value) { + if (value == null) { + return null; + } - /** - * A list of the custom attributes added to the order. - */ + switch (value) { + case "ID": { + return ID; + } - public List getCustomAttributes() { - return (List) get("customAttributes"); - } + case "RELEVANCE": { + return RELEVANCE; + } - public Order setCustomAttributes(List arg) { - optimisticData.put(getKey("customAttributes"), arg); - return this; - } + case "TITLE": { + return TITLE; + } - /** - * The locale code in which this specific order happened. - */ + case "UPDATED_AT": { + return UPDATED_AT; + } - public String getCustomerLocale() { - return (String) get("customerLocale"); + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case ID: { + return "ID"; + } - public Order setCustomerLocale(String arg) { - optimisticData.put(getKey("customerLocale"), arg); - return this; - } + case RELEVANCE: { + return "RELEVANCE"; + } - /** - * The unique URL that the customer can use to access the order. - */ + case TITLE: { + return "TITLE"; + } - public String getCustomerUrl() { - return (String) get("customerUrl"); + case UPDATED_AT: { + return "UPDATED_AT"; + } + + default: { + return ""; + } + } } + } - public Order setCustomerUrl(String arg) { - optimisticData.put(getKey("customerUrl"), arg); - return this; + public interface PaymentQueryDefinition { + void define(PaymentQuery _queryBuilder); + } + + /** + * A payment applied to a checkout. + */ + public static class PaymentQuery extends Query { + PaymentQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); } /** - * Discounts that have been applied on the order. + * The amount of the payment. */ + public PaymentQuery amount(MoneyV2QueryDefinition queryDef) { + startField("amount"); - public DiscountApplicationConnection getDiscountApplications() { - return (DiscountApplicationConnection) get("discountApplications"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public Order setDiscountApplications(DiscountApplicationConnection arg) { - optimisticData.put(getKey("discountApplications"), arg); return this; } /** - * Whether the order has had any edits applied or not. + * The amount of the payment. + * + * @deprecated Use `amount` instead. */ + @Deprecated + public PaymentQuery amountV2(MoneyV2QueryDefinition queryDef) { + startField("amountV2"); - public Boolean getEdited() { - return (Boolean) get("edited"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public Order setEdited(Boolean arg) { - optimisticData.put(getKey("edited"), arg); return this; } /** - * The customer's email address. + * The billing address for the payment. */ + public PaymentQuery billingAddress(MailingAddressQueryDefinition queryDef) { + startField("billingAddress"); - public String getEmail() { - return (String) get("email"); - } + _queryBuilder.append('{'); + queryDef.define(new MailingAddressQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Order setEmail(String arg) { - optimisticData.put(getKey("email"), arg); return this; } /** - * The financial status of the order. + * The checkout to which the payment belongs. */ + public PaymentQuery checkout(CheckoutQueryDefinition queryDef) { + startField("checkout"); - public OrderFinancialStatus getFinancialStatus() { - return (OrderFinancialStatus) get("financialStatus"); - } + _queryBuilder.append('{'); + queryDef.define(new CheckoutQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Order setFinancialStatus(OrderFinancialStatus arg) { - optimisticData.put(getKey("financialStatus"), arg); return this; } /** - * The fulfillment status for the order. + * The credit card used for the payment in the case of direct payments. */ + public PaymentQuery creditCard(CreditCardQueryDefinition queryDef) { + startField("creditCard"); - public OrderFulfillmentStatus getFulfillmentStatus() { - return (OrderFulfillmentStatus) get("fulfillmentStatus"); - } + _queryBuilder.append('{'); + queryDef.define(new CreditCardQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Order setFulfillmentStatus(OrderFulfillmentStatus arg) { - optimisticData.put(getKey("fulfillmentStatus"), arg); return this; } /** - * A globally-unique identifier. + * A message describing a processing error during asynchronous processing. */ + public PaymentQuery errorMessage() { + startField("errorMessage"); - public ID getId() { - return (ID) get("id"); + return this; } /** - * List of the order’s line items. + * A client-side generated token to identify a payment and perform idempotent operations. + * For more information, refer to + * [Idempotent requests](https://shopify.dev/api/usage/idempotent-requests). */ + public PaymentQuery idempotencyKey() { + startField("idempotencyKey"); - public OrderLineItemConnection getLineItems() { - return (OrderLineItemConnection) get("lineItems"); - } - - public Order setLineItems(OrderLineItemConnection arg) { - optimisticData.put(getKey("lineItems"), arg); return this; } /** - * Returns a metafield found by namespace and key. + * The URL where the customer needs to be redirected so they can complete the 3D Secure payment flow. */ + public PaymentQuery nextActionUrl() { + startField("nextActionUrl"); - public Metafield getMetafield() { - return (Metafield) get("metafield"); - } - - public Order setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); return this; } /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * Whether the payment is still processing asynchronously. */ + public PaymentQuery ready() { + startField("ready"); - public List getMetafields() { - return (List) get("metafields"); - } - - public Order setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); return this; } /** - * Unique identifier for the order that appears on the order. - * For example, _#1000_ or _Store1001. + * A flag to indicate if the payment is to be done in test mode for gateways that support it. */ + public PaymentQuery test() { + startField("test"); - public String getName() { - return (String) get("name"); - } - - public Order setName(String arg) { - optimisticData.put(getKey("name"), arg); return this; } /** - * A unique numeric identifier for the order for use by shop owner and customer. + * The actual transaction recorded by Shopify after having processed the payment with the gateway. */ + public PaymentQuery transaction(TransactionQueryDefinition queryDef) { + startField("transaction"); - public Integer getOrderNumber() { - return (Integer) get("orderNumber"); - } + _queryBuilder.append('{'); + queryDef.define(new TransactionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Order setOrderNumber(Integer arg) { - optimisticData.put(getKey("orderNumber"), arg); return this; } + } - /** - * The total cost of duties charged at checkout. - */ - - public MoneyV2 getOriginalTotalDuties() { - return (MoneyV2) get("originalTotalDuties"); + /** + * A payment applied to a checkout. + */ + public static class Payment extends AbstractResponse implements Node { + public Payment() { } - public Order setOriginalTotalDuties(MoneyV2 arg) { - optimisticData.put(getKey("originalTotalDuties"), arg); - return this; - } + public Payment(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))); - /** - * The total price of the order before any applied edits. - */ + break; + } - public MoneyV2 getOriginalTotalPrice() { - return (MoneyV2) get("originalTotalPrice"); - } + case "amountV2": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - public Order setOriginalTotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("originalTotalPrice"), arg); - return this; - } + break; + } - /** - * The customer's phone number for receiving SMS notifications. - */ + case "billingAddress": { + MailingAddress optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); + } - public String getPhone() { - return (String) get("phone"); - } + responseData.put(key, optional1); - public Order setPhone(String arg) { - optimisticData.put(getKey("phone"), arg); - return this; - } + break; + } - /** - * The date and time when the order was imported. - * This value can be set to dates in the past when importing from other systems. - * If no value is provided, it will be auto-generated based on current date and time. - */ + case "checkout": { + responseData.put(key, new Checkout(jsonAsObject(field.getValue(), key))); - public DateTime getProcessedAt() { - return (DateTime) get("processedAt"); - } + break; + } - public Order setProcessedAt(DateTime arg) { - optimisticData.put(getKey("processedAt"), arg); - return this; - } + case "creditCard": { + CreditCard optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CreditCard(jsonAsObject(field.getValue(), key)); + } - /** - * The address to where the order will be shipped. - */ + responseData.put(key, optional1); - public MailingAddress getShippingAddress() { - return (MailingAddress) get("shippingAddress"); - } + break; + } - public Order setShippingAddress(MailingAddress arg) { - optimisticData.put(getKey("shippingAddress"), arg); - return this; - } + case "errorMessage": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - /** - * The discounts that have been allocated onto the shipping line by discount applications. - */ + responseData.put(key, optional1); - public List getShippingDiscountAllocations() { - return (List) get("shippingDiscountAllocations"); + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "idempotencyKey": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "nextActionUrl": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "ready": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); + + break; + } + + case "test": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); + + break; + } + + case "transaction": { + Transaction optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Transaction(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public Order setShippingDiscountAllocations(List arg) { - optimisticData.put(getKey("shippingDiscountAllocations"), arg); - return this; + public Payment(ID id) { + this(); + optimisticData.put("id", id); + } + + public String getGraphQlTypeName() { + return "Payment"; } /** - * The unique URL for the order's status page. + * The amount of the payment. */ - public String getStatusUrl() { - return (String) get("statusUrl"); + public MoneyV2 getAmount() { + return (MoneyV2) get("amount"); } - public Order setStatusUrl(String arg) { - optimisticData.put(getKey("statusUrl"), arg); + public Payment setAmount(MoneyV2 arg) { + optimisticData.put(getKey("amount"), arg); return this; } /** - * Price of the order before shipping and taxes. + * The amount of the payment. + * + * @deprecated Use `amount` instead. */ - public MoneyV2 getSubtotalPrice() { - return (MoneyV2) get("subtotalPrice"); + public MoneyV2 getAmountV2() { + return (MoneyV2) get("amountV2"); } - public Order setSubtotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("subtotalPrice"), arg); + public Payment setAmountV2(MoneyV2 arg) { + optimisticData.put(getKey("amountV2"), arg); return this; } /** - * Price of the order before duties, shipping and taxes. - * - * @deprecated Use `subtotalPrice` instead. + * The billing address for the payment. */ - public MoneyV2 getSubtotalPriceV2() { - return (MoneyV2) get("subtotalPriceV2"); + public MailingAddress getBillingAddress() { + return (MailingAddress) get("billingAddress"); } - public Order setSubtotalPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("subtotalPriceV2"), arg); + public Payment setBillingAddress(MailingAddress arg) { + optimisticData.put(getKey("billingAddress"), arg); return this; } /** - * List of the order’s successful fulfillments. + * The checkout to which the payment belongs. */ - public List getSuccessfulFulfillments() { - return (List) get("successfulFulfillments"); + public Checkout getCheckout() { + return (Checkout) get("checkout"); } - public Order setSuccessfulFulfillments(List arg) { - optimisticData.put(getKey("successfulFulfillments"), arg); + public Payment setCheckout(Checkout arg) { + optimisticData.put(getKey("checkout"), arg); return this; } /** - * The sum of all the prices of all the items in the order, duties, taxes and discounts included (must - * be positive). + * The credit card used for the payment in the case of direct payments. */ - public MoneyV2 getTotalPrice() { - return (MoneyV2) get("totalPrice"); + public CreditCard getCreditCard() { + return (CreditCard) get("creditCard"); } - public Order setTotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("totalPrice"), arg); + public Payment setCreditCard(CreditCard arg) { + optimisticData.put(getKey("creditCard"), arg); return this; } /** - * The sum of all the prices of all the items in the order, duties, taxes and discounts included (must - * be positive). - * - * @deprecated Use `totalPrice` instead. + * A message describing a processing error during asynchronous processing. */ - public MoneyV2 getTotalPriceV2() { - return (MoneyV2) get("totalPriceV2"); + public String getErrorMessage() { + return (String) get("errorMessage"); } - public Order setTotalPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("totalPriceV2"), arg); + public Payment setErrorMessage(String arg) { + optimisticData.put(getKey("errorMessage"), arg); return this; } /** - * The total amount that has been refunded. + * A globally-unique identifier. */ - public MoneyV2 getTotalRefunded() { - return (MoneyV2) get("totalRefunded"); - } - - public Order setTotalRefunded(MoneyV2 arg) { - optimisticData.put(getKey("totalRefunded"), arg); - return this; + public ID getId() { + return (ID) get("id"); } /** - * The total amount that has been refunded. - * - * @deprecated Use `totalRefunded` instead. + * A client-side generated token to identify a payment and perform idempotent operations. + * For more information, refer to + * [Idempotent requests](https://shopify.dev/api/usage/idempotent-requests). */ - public MoneyV2 getTotalRefundedV2() { - return (MoneyV2) get("totalRefundedV2"); + public String getIdempotencyKey() { + return (String) get("idempotencyKey"); } - public Order setTotalRefundedV2(MoneyV2 arg) { - optimisticData.put(getKey("totalRefundedV2"), arg); + public Payment setIdempotencyKey(String arg) { + optimisticData.put(getKey("idempotencyKey"), arg); return this; } /** - * The total cost of shipping. + * The URL where the customer needs to be redirected so they can complete the 3D Secure payment flow. */ - public MoneyV2 getTotalShippingPrice() { - return (MoneyV2) get("totalShippingPrice"); + public String getNextActionUrl() { + return (String) get("nextActionUrl"); } - public Order setTotalShippingPrice(MoneyV2 arg) { - optimisticData.put(getKey("totalShippingPrice"), arg); + public Payment setNextActionUrl(String arg) { + optimisticData.put(getKey("nextActionUrl"), arg); return this; } /** - * The total cost of shipping. - * - * @deprecated Use `totalShippingPrice` instead. + * Whether the payment is still processing asynchronously. */ - public MoneyV2 getTotalShippingPriceV2() { - return (MoneyV2) get("totalShippingPriceV2"); + public Boolean getReady() { + return (Boolean) get("ready"); } - public Order setTotalShippingPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("totalShippingPriceV2"), arg); + public Payment setReady(Boolean arg) { + optimisticData.put(getKey("ready"), arg); return this; } /** - * The total cost of taxes. + * A flag to indicate if the payment is to be done in test mode for gateways that support it. */ - public MoneyV2 getTotalTax() { - return (MoneyV2) get("totalTax"); + public Boolean getTest() { + return (Boolean) get("test"); } - public Order setTotalTax(MoneyV2 arg) { - optimisticData.put(getKey("totalTax"), arg); + public Payment setTest(Boolean arg) { + optimisticData.put(getKey("test"), arg); return this; } /** - * The total cost of taxes. - * - * @deprecated Use `totalTax` instead. + * The actual transaction recorded by Shopify after having processed the payment with the gateway. */ - public MoneyV2 getTotalTaxV2() { - return (MoneyV2) get("totalTaxV2"); + public Transaction getTransaction() { + return (Transaction) get("transaction"); } - public Order setTotalTaxV2(MoneyV2 arg) { - optimisticData.put(getKey("totalTaxV2"), arg); + public Payment setTransaction(Transaction arg) { + optimisticData.put(getKey("transaction"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cancelReason": return false; - - case "canceledAt": return false; - - case "currencyCode": return false; - - case "currentSubtotalPrice": return true; - - case "currentTotalDuties": return true; - - case "currentTotalPrice": return true; - - case "currentTotalTax": return true; - - case "customAttributes": return true; - - case "customerLocale": return false; - - case "customerUrl": return false; + case "amount": return true; - case "discountApplications": return true; + case "amountV2": return true; - case "edited": return false; + case "billingAddress": return true; - case "email": return false; + case "checkout": return true; - case "financialStatus": return false; + case "creditCard": return true; - case "fulfillmentStatus": return false; + case "errorMessage": return false; case "id": return false; - case "lineItems": return true; - - case "metafield": return true; - - case "metafields": return true; - - case "name": return false; - - case "orderNumber": return false; - - case "originalTotalDuties": return true; - - case "originalTotalPrice": return true; - - case "phone": return false; - - case "processedAt": return false; - - case "shippingAddress": return true; - - case "shippingDiscountAllocations": return true; - - case "statusUrl": return false; - - case "subtotalPrice": return true; - - case "subtotalPriceV2": return true; - - case "successfulFulfillments": return true; - - case "totalPrice": return true; - - case "totalPriceV2": return true; - - case "totalRefunded": return true; - - case "totalRefundedV2": return true; + case "idempotencyKey": return false; - case "totalShippingPrice": return true; + case "nextActionUrl": return false; - case "totalShippingPriceV2": return true; + case "ready": return false; - case "totalTax": return true; + case "test": return false; - case "totalTaxV2": return true; + case "transaction": return true; default: return false; } } } + public interface PaymentSettingsQueryDefinition { + void define(PaymentSettingsQuery _queryBuilder); + } + /** - * Represents the reason for the order's cancellation. + * Settings related to payments. */ - public enum OrderCancelReason { - /** - * The customer wanted to cancel the order. - */ - CUSTOMER, - - /** - * Payment was declined. - */ - DECLINED, + public static class PaymentSettingsQuery extends Query { + PaymentSettingsQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * The order was fraudulent. + * List of the card brands which the shop accepts. */ - FRAUD, + public PaymentSettingsQuery acceptedCardBrands() { + startField("acceptedCardBrands"); - /** - * There was insufficient inventory. - */ - INVENTORY, + return this; + } /** - * The order was canceled for an unlisted reason. + * The url pointing to the endpoint to vault credit cards. */ - OTHER, - - UNKNOWN_VALUE; - - public static OrderCancelReason fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "CUSTOMER": { - return CUSTOMER; - } - - case "DECLINED": { - return DECLINED; - } - - case "FRAUD": { - return FRAUD; - } - - case "INVENTORY": { - return INVENTORY; - } - - case "OTHER": { - return OTHER; - } - - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case CUSTOMER: { - return "CUSTOMER"; - } - - case DECLINED: { - return "DECLINED"; - } - - case FRAUD: { - return "FRAUD"; - } - - case INVENTORY: { - return "INVENTORY"; - } - - case OTHER: { - return "OTHER"; - } + public PaymentSettingsQuery cardVaultUrl() { + startField("cardVaultUrl"); - default: { - return ""; - } - } + return this; } - } - public interface OrderConnectionQueryDefinition { - void define(OrderConnectionQuery _queryBuilder); - } + /** + * The country where the shop is located. + */ + public PaymentSettingsQuery countryCode() { + startField("countryCode"); - /** - * An auto-generated type for paginating through multiple Orders. - */ - public static class OrderConnectionQuery extends Query { - OrderConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * A list of edges. + * The three-letter code for the shop's primary currency. */ - public OrderConnectionQuery edges(OrderEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new OrderEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); + public PaymentSettingsQuery currencyCode() { + startField("currencyCode"); return this; } /** - * A list of the nodes contained in OrderEdge. + * A list of enabled currencies (ISO 4217 format) that the shop accepts. Merchants can enable + * currencies from their Shopify Payments settings in the Shopify admin. */ - public OrderConnectionQuery nodes(OrderQueryDefinition queryDef) { - startField("nodes"); - - _queryBuilder.append('{'); - queryDef.define(new OrderQuery(_queryBuilder)); - _queryBuilder.append('}'); + public PaymentSettingsQuery enabledPresentmentCurrencies() { + startField("enabledPresentmentCurrencies"); return this; } /** - * Information to aid in pagination. + * The shop’s Shopify Payments account id. */ - public OrderConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + public PaymentSettingsQuery shopifyPaymentsAccountId() { + startField("shopifyPaymentsAccountId"); return this; } /** - * The total count of Orders. + * List of the digital wallets which the shop supports. */ - public OrderConnectionQuery totalCount() { - startField("totalCount"); + public PaymentSettingsQuery supportedDigitalWallets() { + startField("supportedDigitalWallets"); return this; } } /** - * An auto-generated type for paginating through multiple Orders. + * Settings related to payments. */ - public static class OrderConnection extends AbstractResponse { - public OrderConnection() { + public static class PaymentSettings extends AbstractResponse { + public PaymentSettings() { } - public OrderConnection(JsonObject fields) throws SchemaViolationError { + public PaymentSettings(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); + case "acceptedCardBrands": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new OrderEdge(jsonAsObject(element1, key))); + list1.add(CardBrand.fromGraphQl(jsonAsString(element1, key))); } responseData.put(key, list1); @@ -46996,166 +54435,53 @@ public OrderConnection(JsonObject fields) throws SchemaViolationError { break; } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Order(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "cardVaultUrl": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "countryCode": { + responseData.put(key, CountryCode.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "totalCount": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } + case "currencyCode": { + responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "OrderConnection"; - } - - /** - * A list of edges. - */ - - public List getEdges() { - return (List) get("edges"); - } - - public OrderConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; - } - - /** - * A list of the nodes contained in OrderEdge. - */ - - public List getNodes() { - return (List) get("nodes"); - } - - public OrderConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; - } - - /** - * Information to aid in pagination. - */ - - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } - - public OrderConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); - return this; - } - - /** - * The total count of Orders. - */ - - public String getTotalCount() { - return (String) get("totalCount"); - } - - public OrderConnection setTotalCount(String arg) { - optimisticData.put(getKey("totalCount"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return true; - - case "pageInfo": return true; - - case "totalCount": return false; - - default: return false; - } - } - } - - public interface OrderEdgeQueryDefinition { - void define(OrderEdgeQuery _queryBuilder); - } - - /** - * An auto-generated type which holds one Order and a cursor during pagination. - */ - public static class OrderEdgeQuery extends Query { - OrderEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * A cursor for use in pagination. - */ - public OrderEdgeQuery cursor() { - startField("cursor"); - - return this; - } - /** - * The item at the end of OrderEdge. - */ - public OrderEdgeQuery node(OrderQueryDefinition queryDef) { - startField("node"); + case "enabledPresentmentCurrencies": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(CurrencyCode.fromGraphQl(jsonAsString(element1, key))); + } - _queryBuilder.append('{'); - queryDef.define(new OrderQuery(_queryBuilder)); - _queryBuilder.append('}'); + responseData.put(key, list1); - return this; - } - } + break; + } - /** - * An auto-generated type which holds one Order and a cursor during pagination. - */ - public static class OrderEdge extends AbstractResponse { - public OrderEdge() { - } + case "shopifyPaymentsAccountId": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - public OrderEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + responseData.put(key, optional1); break; } - case "node": { - responseData.put(key, new Order(jsonAsObject(field.getValue(), key))); + case "supportedDigitalWallets": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(DigitalWallet.fromGraphQl(jsonAsString(element1, key))); + } + + responseData.put(key, list1); break; } @@ -47172,259 +54498,177 @@ public OrderEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "OrderEdge"; + return "PaymentSettings"; } /** - * A cursor for use in pagination. + * List of the card brands which the shop accepts. */ - public String getCursor() { - return (String) get("cursor"); + public List getAcceptedCardBrands() { + return (List) get("acceptedCardBrands"); } - public OrderEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public PaymentSettings setAcceptedCardBrands(List arg) { + optimisticData.put(getKey("acceptedCardBrands"), arg); return this; } /** - * The item at the end of OrderEdge. + * The url pointing to the endpoint to vault credit cards. */ - public Order getNode() { - return (Order) get("node"); + public String getCardVaultUrl() { + return (String) get("cardVaultUrl"); } - public OrderEdge setNode(Order arg) { - optimisticData.put(getKey("node"), arg); + public PaymentSettings setCardVaultUrl(String arg) { + optimisticData.put(getKey("cardVaultUrl"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; + /** + * The country where the shop is located. + */ - case "node": return true; + public CountryCode getCountryCode() { + return (CountryCode) get("countryCode"); + } - default: return false; - } + public PaymentSettings setCountryCode(CountryCode arg) { + optimisticData.put(getKey("countryCode"), arg); + return this; } - } - /** - * Represents the order's current financial status. - */ - public enum OrderFinancialStatus { /** - * Displayed as **Authorized**. + * The three-letter code for the shop's primary currency. */ - AUTHORIZED, - /** - * Displayed as **Paid**. - */ - PAID, + public CurrencyCode getCurrencyCode() { + return (CurrencyCode) get("currencyCode"); + } - /** - * Displayed as **Partially paid**. - */ - PARTIALLY_PAID, + public PaymentSettings setCurrencyCode(CurrencyCode arg) { + optimisticData.put(getKey("currencyCode"), arg); + return this; + } /** - * Displayed as **Partially refunded**. + * A list of enabled currencies (ISO 4217 format) that the shop accepts. Merchants can enable + * currencies from their Shopify Payments settings in the Shopify admin. */ - PARTIALLY_REFUNDED, - /** - * Displayed as **Pending**. - */ - PENDING, + public List getEnabledPresentmentCurrencies() { + return (List) get("enabledPresentmentCurrencies"); + } - /** - * Displayed as **Refunded**. - */ - REFUNDED, + public PaymentSettings setEnabledPresentmentCurrencies(List arg) { + optimisticData.put(getKey("enabledPresentmentCurrencies"), arg); + return this; + } /** - * Displayed as **Voided**. + * The shop’s Shopify Payments account id. */ - VOIDED, - - UNKNOWN_VALUE; - - public static OrderFinancialStatus fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "AUTHORIZED": { - return AUTHORIZED; - } - - case "PAID": { - return PAID; - } - - case "PARTIALLY_PAID": { - return PARTIALLY_PAID; - } - case "PARTIALLY_REFUNDED": { - return PARTIALLY_REFUNDED; - } + public String getShopifyPaymentsAccountId() { + return (String) get("shopifyPaymentsAccountId"); + } - case "PENDING": { - return PENDING; - } + public PaymentSettings setShopifyPaymentsAccountId(String arg) { + optimisticData.put(getKey("shopifyPaymentsAccountId"), arg); + return this; + } - case "REFUNDED": { - return REFUNDED; - } + /** + * List of the digital wallets which the shop supports. + */ - case "VOIDED": { - return VOIDED; - } + public List getSupportedDigitalWallets() { + return (List) get("supportedDigitalWallets"); + } - default: { - return UNKNOWN_VALUE; - } - } + public PaymentSettings setSupportedDigitalWallets(List arg) { + optimisticData.put(getKey("supportedDigitalWallets"), arg); + return this; } - public String toString() { - switch (this) { - case AUTHORIZED: { - return "AUTHORIZED"; - } - case PAID: { - return "PAID"; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "acceptedCardBrands": return false; - case PARTIALLY_PAID: { - return "PARTIALLY_PAID"; - } + case "cardVaultUrl": return false; - case PARTIALLY_REFUNDED: { - return "PARTIALLY_REFUNDED"; - } + case "countryCode": return false; - case PENDING: { - return "PENDING"; - } + case "currencyCode": return false; - case REFUNDED: { - return "REFUNDED"; - } + case "enabledPresentmentCurrencies": return false; - case VOIDED: { - return "VOIDED"; - } + case "shopifyPaymentsAccountId": return false; - default: { - return ""; - } + case "supportedDigitalWallets": return false; + + default: return false; } } } /** - * Represents the order's aggregated fulfillment status for display purposes. + * The valid values for the types of payment token. */ - public enum OrderFulfillmentStatus { - /** - * Displayed as **Fulfilled**. All of the items in the order have been fulfilled. - */ - FULFILLED, - - /** - * Displayed as **In progress**. Some of the items in the order have been fulfilled, or a request for - * fulfillment has been sent to the fulfillment service. - */ - IN_PROGRESS, - - /** - * Displayed as **On hold**. All of the unfulfilled items in this order are on hold. - */ - ON_HOLD, - - /** - * Displayed as **Open**. None of the items in the order have been fulfilled. Replaced by "UNFULFILLED" - * status. - */ - OPEN, - + public enum PaymentTokenType { /** - * Displayed as **Partially fulfilled**. Some of the items in the order have been fulfilled. + * Apple Pay token type. */ - PARTIALLY_FULFILLED, + APPLE_PAY, /** - * Displayed as **Pending fulfillment**. A request for fulfillment of some items awaits a response from - * the fulfillment service. Replaced by "IN_PROGRESS" status. + * Google Pay token type. */ - PENDING_FULFILLMENT, + GOOGLE_PAY, /** - * Displayed as **Restocked**. All of the items in the order have been restocked. Replaced by - * "UNFULFILLED" status. + * Shopify Pay token type. */ - RESTOCKED, + SHOPIFY_PAY, /** - * Displayed as **Scheduled**. All of the unfulfilled items in this order are scheduled for fulfillment - * at later time. + * Stripe token type. */ - SCHEDULED, + STRIPE_VAULT_TOKEN, /** - * Displayed as **Unfulfilled**. None of the items in the order have been fulfilled. + * Vault payment token type. */ - UNFULFILLED, + VAULT, UNKNOWN_VALUE; - public static OrderFulfillmentStatus fromGraphQl(String value) { + public static PaymentTokenType fromGraphQl(String value) { if (value == null) { return null; } switch (value) { - case "FULFILLED": { - return FULFILLED; - } - - case "IN_PROGRESS": { - return IN_PROGRESS; - } - - case "ON_HOLD": { - return ON_HOLD; - } - - case "OPEN": { - return OPEN; - } - - case "PARTIALLY_FULFILLED": { - return PARTIALLY_FULFILLED; + case "APPLE_PAY": { + return APPLE_PAY; } - case "PENDING_FULFILLMENT": { - return PENDING_FULFILLMENT; + case "GOOGLE_PAY": { + return GOOGLE_PAY; } - case "RESTOCKED": { - return RESTOCKED; + case "SHOPIFY_PAY": { + return SHOPIFY_PAY; } - case "SCHEDULED": { - return SCHEDULED; + case "STRIPE_VAULT_TOKEN": { + return STRIPE_VAULT_TOKEN; } - case "UNFULFILLED": { - return UNFULFILLED; + case "VAULT": { + return VAULT; } default: { @@ -47434,884 +54678,1150 @@ public static OrderFulfillmentStatus fromGraphQl(String value) { } public String toString() { switch (this) { - case FULFILLED: { - return "FULFILLED"; + case APPLE_PAY: { + return "APPLE_PAY"; } - case IN_PROGRESS: { - return "IN_PROGRESS"; + case GOOGLE_PAY: { + return "GOOGLE_PAY"; } - case ON_HOLD: { - return "ON_HOLD"; + case SHOPIFY_PAY: { + return "SHOPIFY_PAY"; } - case OPEN: { - return "OPEN"; + case STRIPE_VAULT_TOKEN: { + return "STRIPE_VAULT_TOKEN"; } - case PARTIALLY_FULFILLED: { - return "PARTIALLY_FULFILLED"; + case VAULT: { + return "VAULT"; } - case PENDING_FULFILLMENT: { - return "PENDING_FULFILLMENT"; + default: { + return ""; } + } + } + } - case RESTOCKED: { - return "RESTOCKED"; - } + public static class PriceRangeFilter implements Serializable { + private Input min = Input.undefined(); - case SCHEDULED: { - return "SCHEDULED"; - } + private Input max = Input.undefined(); - case UNFULFILLED: { - return "UNFULFILLED"; + public Double getMin() { + return min.getValue(); + } + + public Input getMinInput() { + return min; + } + + public PriceRangeFilter setMin(Double min) { + this.min = Input.optional(min); + return this; + } + + public PriceRangeFilter setMinInput(Input min) { + if (min == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.min = min; + return this; + } + + public Double getMax() { + return max.getValue(); + } + + public Input getMaxInput() { + return max; + } + + public PriceRangeFilter setMax(Double max) { + this.max = Input.optional(max); + return this; + } + + public PriceRangeFilter setMaxInput(Input max) { + if (max == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.max = max; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + if (this.min.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("min:"); + if (min.getValue() != null) { + _queryBuilder.append(min.getValue()); + } else { + _queryBuilder.append("null"); } + } - default: { - return ""; + if (this.max.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("max:"); + if (max.getValue() != null) { + _queryBuilder.append(max.getValue()); + } else { + _queryBuilder.append("null"); } } + + _queryBuilder.append('}'); } } - public interface OrderLineItemQueryDefinition { - void define(OrderLineItemQuery _queryBuilder); + public interface PricingPercentageValueQueryDefinition { + void define(PricingPercentageValueQuery _queryBuilder); } /** - * Represents a single line in an order. There is one line item for each distinct product variant. + * The value of the percentage pricing object. */ - public static class OrderLineItemQuery extends Query { - OrderLineItemQuery(StringBuilder _queryBuilder) { + public static class PricingPercentageValueQuery extends Query { + PricingPercentageValueQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The number of entries associated to the line item minus the items that have been removed. + * The percentage value of the object. */ - public OrderLineItemQuery currentQuantity() { - startField("currentQuantity"); + public PricingPercentageValueQuery percentage() { + startField("percentage"); return this; } + } - /** - * List of custom attributes associated to the line item. - */ - public OrderLineItemQuery customAttributes(AttributeQueryDefinition queryDef) { - startField("customAttributes"); - - _queryBuilder.append('{'); - queryDef.define(new AttributeQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + /** + * The value of the percentage pricing object. + */ + public static class PricingPercentageValue extends AbstractResponse implements PricingValue { + public PricingPercentageValue() { } - /** - * The discounts that have been allocated onto the order line item by discount applications. - */ - public OrderLineItemQuery discountAllocations(DiscountAllocationQueryDefinition queryDef) { - startField("discountAllocations"); + public PricingPercentageValue(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "percentage": { + responseData.put(key, jsonAsDouble(field.getValue(), key)); - _queryBuilder.append('{'); - queryDef.define(new DiscountAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - /** - * The total price of the line item, including discounts, and displayed in the presentment currency. - */ - public OrderLineItemQuery discountedTotalPrice(MoneyV2QueryDefinition queryDef) { - startField("discountedTotalPrice"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + public String getGraphQlTypeName() { + return "PricingPercentageValue"; } /** - * The total price of the line item, not including any discounts. The total price is calculated using - * the original unit price multiplied by the quantity, and it is displayed in the presentment currency. + * The percentage value of the object. */ - public OrderLineItemQuery originalTotalPrice(MoneyV2QueryDefinition queryDef) { - startField("originalTotalPrice"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public Double getPercentage() { + return (Double) get("percentage"); + } + public PricingPercentageValue setPercentage(Double arg) { + optimisticData.put(getKey("percentage"), arg); return this; } - /** - * The number of products variants associated to the line item. - */ - public OrderLineItemQuery quantity() { - startField("quantity"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "percentage": return false; - return this; + default: return false; + } } + } - /** - * The title of the product combined with title of the variant. - */ - public OrderLineItemQuery title() { - startField("title"); + public interface PricingValueQueryDefinition { + void define(PricingValueQuery _queryBuilder); + } + + /** + * The price value (fixed or percentage) for a discount application. + */ + public static class PricingValueQuery extends Query { + PricingValueQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("__typename"); + } + public PricingValueQuery onMoneyV2(MoneyV2QueryDefinition queryDef) { + startInlineFragment("MoneyV2"); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The product variant object associated to the line item. - */ - public OrderLineItemQuery variant(ProductVariantQueryDefinition queryDef) { - startField("variant"); - - _queryBuilder.append('{'); - queryDef.define(new ProductVariantQuery(_queryBuilder)); + public PricingValueQuery onPricingPercentageValue(PricingPercentageValueQueryDefinition queryDef) { + startInlineFragment("PricingPercentageValue"); + queryDef.define(new PricingPercentageValueQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; } } + public interface PricingValue { + String getGraphQlTypeName(); + } + /** - * Represents a single line in an order. There is one line item for each distinct product variant. + * The price value (fixed or percentage) for a discount application. */ - public static class OrderLineItem extends AbstractResponse { - public OrderLineItem() { + public static class UnknownPricingValue extends AbstractResponse implements PricingValue { + public UnknownPricingValue() { } - public OrderLineItem(JsonObject fields) throws SchemaViolationError { + public UnknownPricingValue(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "currentQuantity": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); - + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - - case "customAttributes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Attribute(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; + default: { + throw new SchemaViolationError(this, key, field.getValue()); } + } + } + } - case "discountAllocations": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new DiscountAllocation(jsonAsObject(element1, key))); - } + public static PricingValue create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "MoneyV2": { + return new MoneyV2(fields); + } - responseData.put(key, list1); + case "PricingPercentageValue": { + return new PricingPercentageValue(fields); + } - break; - } + default: { + return new UnknownPricingValue(fields); + } + } + } - case "discountedTotalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + public String getGraphQlTypeName() { + return (String) get("__typename"); + } - break; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + default: return false; + } + } + } - case "originalTotalPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + public interface ProductQueryDefinition { + void define(ProductQuery _queryBuilder); + } - break; - } + /** + * A product represents an individual item for sale in a Shopify store. Products are often physical, + * but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, + * as do services (such as equipment rental, work for hire, customization of another product or an + * extended warranty). + */ + public static class ProductQuery extends Query { + ProductQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - case "quantity": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + startField("id"); + } - break; - } + /** + * Indicates if at least one product variant is available for sale. + */ + public ProductQuery availableForSale() { + startField("availableForSale"); - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + return this; + } - break; - } + public class CollectionsArguments extends Arguments { + CollectionsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "variant": { - ProductVariant optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ProductVariant(jsonAsObject(field.getValue(), key)); - } + /** + * Returns up to the first `n` elements from the list. + */ + public CollectionsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - responseData.put(key, optional1); + /** + * Returns the elements that come after the specified cursor. + */ + public CollectionsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - break; - } + /** + * Returns up to the last `n` elements from the list. + */ + public CollectionsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + /** + * Returns the elements that come before the specified cursor. + */ + public CollectionsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Reverse the order of the underlying list. + */ + public CollectionsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; } } - public String getGraphQlTypeName() { - return "OrderLineItem"; + public interface CollectionsArgumentsDefinition { + void define(CollectionsArguments args); } /** - * The number of entries associated to the line item minus the items that have been removed. + * List of collections a product belongs to. */ - - public Integer getCurrentQuantity() { - return (Integer) get("currentQuantity"); - } - - public OrderLineItem setCurrentQuantity(Integer arg) { - optimisticData.put(getKey("currentQuantity"), arg); - return this; + public ProductQuery collections(CollectionConnectionQueryDefinition queryDef) { + return collections(args -> {}, queryDef); } /** - * List of custom attributes associated to the line item. + * List of collections a product belongs to. */ + public ProductQuery collections(CollectionsArgumentsDefinition argsDef, CollectionConnectionQueryDefinition queryDef) { + startField("collections"); - public List getCustomAttributes() { - return (List) get("customAttributes"); - } + CollectionsArguments args = new CollectionsArguments(_queryBuilder); + argsDef.define(args); + CollectionsArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new CollectionConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public OrderLineItem setCustomAttributes(List arg) { - optimisticData.put(getKey("customAttributes"), arg); return this; } /** - * The discounts that have been allocated onto the order line item by discount applications. + * The compare at price of the product across all variants. */ + public ProductQuery compareAtPriceRange(ProductPriceRangeQueryDefinition queryDef) { + startField("compareAtPriceRange"); - public List getDiscountAllocations() { - return (List) get("discountAllocations"); - } + _queryBuilder.append('{'); + queryDef.define(new ProductPriceRangeQuery(_queryBuilder)); + _queryBuilder.append('}'); - public OrderLineItem setDiscountAllocations(List arg) { - optimisticData.put(getKey("discountAllocations"), arg); return this; } /** - * The total price of the line item, including discounts, and displayed in the presentment currency. + * The date and time when the product was created. */ + public ProductQuery createdAt() { + startField("createdAt"); - public MoneyV2 getDiscountedTotalPrice() { - return (MoneyV2) get("discountedTotalPrice"); - } - - public OrderLineItem setDiscountedTotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("discountedTotalPrice"), arg); return this; } - /** - * The total price of the line item, not including any discounts. The total price is calculated using - * the original unit price multiplied by the quantity, and it is displayed in the presentment currency. - */ + public class DescriptionArguments extends Arguments { + DescriptionArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - public MoneyV2 getOriginalTotalPrice() { - return (MoneyV2) get("originalTotalPrice"); + /** + * Truncates string after the given length. + */ + public DescriptionArguments truncateAt(Integer value) { + if (value != null) { + startArgument("truncateAt"); + _queryBuilder.append(value); + } + return this; + } } - public OrderLineItem setOriginalTotalPrice(MoneyV2 arg) { - optimisticData.put(getKey("originalTotalPrice"), arg); - return this; + public interface DescriptionArgumentsDefinition { + void define(DescriptionArguments args); } /** - * The number of products variants associated to the line item. + * Stripped description of the product, single line with HTML tags removed. */ - - public Integer getQuantity() { - return (Integer) get("quantity"); + public ProductQuery description() { + return description(args -> {}); } - public OrderLineItem setQuantity(Integer arg) { - optimisticData.put(getKey("quantity"), arg); + /** + * Stripped description of the product, single line with HTML tags removed. + */ + public ProductQuery description(DescriptionArgumentsDefinition argsDef) { + startField("description"); + + DescriptionArguments args = new DescriptionArguments(_queryBuilder); + argsDef.define(args); + DescriptionArguments.end(args); + return this; } /** - * The title of the product combined with title of the variant. + * The description of the product, complete with HTML formatting. */ + public ProductQuery descriptionHtml() { + startField("descriptionHtml"); - public String getTitle() { - return (String) get("title"); - } - - public OrderLineItem setTitle(String arg) { - optimisticData.put(getKey("title"), arg); return this; } /** - * The product variant object associated to the line item. + * The featured image for the product. + * This field is functionally equivalent to `images(first: 1)`. */ + public ProductQuery featuredImage(ImageQueryDefinition queryDef) { + startField("featuredImage"); - public ProductVariant getVariant() { - return (ProductVariant) get("variant"); - } + _queryBuilder.append('{'); + queryDef.define(new ImageQuery(_queryBuilder)); + _queryBuilder.append('}'); - public OrderLineItem setVariant(ProductVariant arg) { - optimisticData.put(getKey("variant"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "currentQuantity": return false; + /** + * A human-friendly unique string for the Product automatically generated from its title. + * They are used by the Liquid templating language to refer to objects. + */ + public ProductQuery handle() { + startField("handle"); - case "customAttributes": return true; + return this; + } - case "discountAllocations": return true; + public class ImagesArguments extends Arguments { + ImagesArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "discountedTotalPrice": return true; + /** + * Returns up to the first `n` elements from the list. + */ + public ImagesArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - case "originalTotalPrice": return true; + /** + * Returns the elements that come after the specified cursor. + */ + public ImagesArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "quantity": return false; + /** + * Returns up to the last `n` elements from the list. + */ + public ImagesArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - case "title": return false; + /** + * Returns the elements that come before the specified cursor. + */ + public ImagesArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "variant": return true; + /** + * Reverse the order of the underlying list. + */ + public ImagesArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } - default: return false; + /** + * Sort the underlying list by the given key. + */ + public ImagesArguments sortKey(ProductImageSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; } } - } - - public interface OrderLineItemConnectionQueryDefinition { - void define(OrderLineItemConnectionQuery _queryBuilder); - } - /** - * An auto-generated type for paginating through multiple OrderLineItems. - */ - public static class OrderLineItemConnectionQuery extends Query { - OrderLineItemConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public interface ImagesArgumentsDefinition { + void define(ImagesArguments args); } /** - * A list of edges. + * List of images associated with the product. */ - public OrderLineItemConnectionQuery edges(OrderLineItemEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new OrderLineItemEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + public ProductQuery images(ImageConnectionQueryDefinition queryDef) { + return images(args -> {}, queryDef); } /** - * A list of the nodes contained in OrderLineItemEdge. + * List of images associated with the product. */ - public OrderLineItemConnectionQuery nodes(OrderLineItemQueryDefinition queryDef) { - startField("nodes"); + public ProductQuery images(ImagesArgumentsDefinition argsDef, ImageConnectionQueryDefinition queryDef) { + startField("images"); + + ImagesArguments args = new ImagesArguments(_queryBuilder); + argsDef.define(args); + ImagesArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new OrderLineItemQuery(_queryBuilder)); + queryDef.define(new ImageConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Information to aid in pagination. + * Whether the product is a gift card. */ - public OrderLineItemConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ProductQuery isGiftCard() { + startField("isGiftCard"); return this; } - } - - /** - * An auto-generated type for paginating through multiple OrderLineItems. - */ - public static class OrderLineItemConnection extends AbstractResponse { - public OrderLineItemConnection() { - } - - public OrderLineItemConnection(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new OrderLineItemEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - break; - } + public class MediaArguments extends Arguments { + MediaArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new OrderLineItem(jsonAsObject(element1, key))); - } + /** + * Returns up to the first `n` elements from the list. + */ + public MediaArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - responseData.put(key, list1); + /** + * Returns the elements that come after the specified cursor. + */ + public MediaArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - break; - } + /** + * Returns up to the last `n` elements from the list. + */ + public MediaArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + /** + * Returns the elements that come before the specified cursor. + */ + public MediaArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - break; - } + /** + * Reverse the order of the underlying list. + */ + public MediaArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + /** + * Sort the underlying list by the given key. + */ + public MediaArguments sortKey(ProductMediaSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); } + return this; } } - public String getGraphQlTypeName() { - return "OrderLineItemConnection"; + public interface MediaArgumentsDefinition { + void define(MediaArguments args); } /** - * A list of edges. + * The media associated with the product. */ - - public List getEdges() { - return (List) get("edges"); - } - - public OrderLineItemConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; + public ProductQuery media(MediaConnectionQueryDefinition queryDef) { + return media(args -> {}, queryDef); } /** - * A list of the nodes contained in OrderLineItemEdge. + * The media associated with the product. */ + public ProductQuery media(MediaArgumentsDefinition argsDef, MediaConnectionQueryDefinition queryDef) { + startField("media"); - public List getNodes() { - return (List) get("nodes"); - } + MediaArguments args = new MediaArguments(_queryBuilder); + argsDef.define(args); + MediaArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new MediaConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public OrderLineItemConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); return this; } /** - * Information to aid in pagination. + * Returns a metafield found by namespace and key. */ + public ProductQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { + startField("metafield"); - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } - - public OrderLineItemConnection 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; + _queryBuilder.append("(namespace:"); + Query.appendQuotedString(_queryBuilder, namespace.toString()); - case "pageInfo": return true; + _queryBuilder.append(",key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); - default: return false; - } - } - } + _queryBuilder.append(')'); - public interface OrderLineItemEdgeQueryDefinition { - void define(OrderLineItemEdgeQuery _queryBuilder); - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * An auto-generated type which holds one OrderLineItem and a cursor during pagination. - */ - public static class OrderLineItemEdgeQuery extends Query { - OrderLineItemEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * A cursor for use in pagination. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public OrderLineItemEdgeQuery cursor() { - startField("cursor"); + public ProductQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); - return this; - } + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); - /** - * The item at the end of OrderLineItemEdge. - */ - public OrderLineItemEdgeQuery node(OrderLineItemQueryDefinition queryDef) { - startField("node"); + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new OrderLineItemQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - } - - /** - * An auto-generated type which holds one OrderLineItem and a cursor during pagination. - */ - public static class OrderLineItemEdge extends AbstractResponse { - public OrderLineItemEdge() { - } - - public OrderLineItemEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } + /** + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. + */ + public ProductQuery onlineStoreUrl() { + startField("onlineStoreUrl"); - case "node": { - responseData.put(key, new OrderLineItem(jsonAsObject(field.getValue(), key))); + return this; + } - break; - } + public class OptionsArguments extends Arguments { + OptionsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + /** + * Truncate the array result to this size. + */ + public OptionsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); } + return this; } } - public String getGraphQlTypeName() { - return "OrderLineItemEdge"; + public interface OptionsArgumentsDefinition { + void define(OptionsArguments args); } /** - * A cursor for use in pagination. + * List of product options. */ - - public String getCursor() { - return (String) get("cursor"); - } - - public OrderLineItemEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; + public ProductQuery options(ProductOptionQueryDefinition queryDef) { + return options(args -> {}, queryDef); } /** - * The item at the end of OrderLineItemEdge. + * List of product options. */ + public ProductQuery options(OptionsArgumentsDefinition argsDef, ProductOptionQueryDefinition queryDef) { + startField("options"); - public OrderLineItem getNode() { - return (OrderLineItem) get("node"); - } + OptionsArguments args = new OptionsArguments(_queryBuilder); + argsDef.define(args); + OptionsArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new ProductOptionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public OrderLineItemEdge setNode(OrderLineItem arg) { - optimisticData.put(getKey("node"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; + /** + * The price range. + */ + public ProductQuery priceRange(ProductPriceRangeQueryDefinition queryDef) { + startField("priceRange"); - case "node": return true; + _queryBuilder.append('{'); + queryDef.define(new ProductPriceRangeQuery(_queryBuilder)); + _queryBuilder.append('}'); - default: return false; - } + return this; } - } - /** - * The set of valid sort keys for the Order query. - */ - public enum OrderSortKeys { /** - * Sort by the `id` value. + * A categorization that a product can be tagged with, commonly used for filtering and searching. */ - ID, + public ProductQuery productType() { + startField("productType"); - /** - * Sort by the `processed_at` value. - */ - PROCESSED_AT, + return this; + } /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. + * The date and time when the product was published to the channel. */ - RELEVANCE, + public ProductQuery publishedAt() { + startField("publishedAt"); + + return this; + } /** - * Sort by the `total_price` value. + * Whether the product can only be purchased with a selling plan. */ - TOTAL_PRICE, + public ProductQuery requiresSellingPlan() { + startField("requiresSellingPlan"); - UNKNOWN_VALUE; + return this; + } - public static OrderSortKeys fromGraphQl(String value) { - if (value == null) { - return null; + public class SellingPlanGroupsArguments extends Arguments { + SellingPlanGroupsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); } - switch (value) { - case "ID": { - return ID; + /** + * Returns up to the first `n` elements from the list. + */ + public SellingPlanGroupsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); } + return this; + } - case "PROCESSED_AT": { - return PROCESSED_AT; + /** + * Returns the elements that come after the specified cursor. + */ + public SellingPlanGroupsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - case "RELEVANCE": { - return RELEVANCE; + /** + * Returns up to the last `n` elements from the list. + */ + public SellingPlanGroupsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); } + return this; + } - case "TOTAL_PRICE": { - return TOTAL_PRICE; + /** + * Returns the elements that come before the specified cursor. + */ + public SellingPlanGroupsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - default: { - return UNKNOWN_VALUE; + /** + * Reverse the order of the underlying list. + */ + public SellingPlanGroupsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; } } - public String toString() { - switch (this) { - case ID: { - return "ID"; - } - - case PROCESSED_AT: { - return "PROCESSED_AT"; - } - - case RELEVANCE: { - return "RELEVANCE"; - } - case TOTAL_PRICE: { - return "TOTAL_PRICE"; - } + public interface SellingPlanGroupsArgumentsDefinition { + void define(SellingPlanGroupsArguments args); + } - default: { - return ""; - } - } + /** + * A list of a product's available selling plan groups. A selling plan group represents a selling + * method. For example, 'Subscribe and save' is a selling method where customers pay for goods or + * services per delivery. A selling plan group contains individual selling plans. + */ + public ProductQuery sellingPlanGroups(SellingPlanGroupConnectionQueryDefinition queryDef) { + return sellingPlanGroups(args -> {}, queryDef); } - } - public interface PageQueryDefinition { - void define(PageQuery _queryBuilder); - } + /** + * A list of a product's available selling plan groups. A selling plan group represents a selling + * method. For example, 'Subscribe and save' is a selling method where customers pay for goods or + * services per delivery. A selling plan group contains individual selling plans. + */ + public ProductQuery sellingPlanGroups(SellingPlanGroupsArgumentsDefinition argsDef, SellingPlanGroupConnectionQueryDefinition queryDef) { + startField("sellingPlanGroups"); - /** - * Shopify merchants can create pages to hold static HTML content. Each Page object represents a custom - * page on the online store. - */ - public static class PageQuery extends Query { - PageQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + SellingPlanGroupsArguments args = new SellingPlanGroupsArguments(_queryBuilder); + argsDef.define(args); + SellingPlanGroupsArguments.end(args); - startField("id"); + _queryBuilder.append('{'); + queryDef.define(new SellingPlanGroupConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * The description of the page, complete with HTML formatting. + * The product's SEO information. */ - public PageQuery body() { - startField("body"); + public ProductQuery seo(SEOQueryDefinition queryDef) { + startField("seo"); + + _queryBuilder.append('{'); + queryDef.define(new SEOQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * Summary of the page body. + * A comma separated list of tags that have been added to the product. + * Additional access scope required for private apps: unauthenticated_read_product_tags. */ - public PageQuery bodySummary() { - startField("bodySummary"); + public ProductQuery tags() { + startField("tags"); return this; } /** - * The timestamp of the page creation. + * The product’s title. */ - public PageQuery createdAt() { - startField("createdAt"); + public ProductQuery title() { + startField("title"); return this; } /** - * A human-friendly unique string for the page automatically generated from its title. + * The total quantity of inventory in stock for this Product. */ - public PageQuery handle() { - startField("handle"); + public ProductQuery totalInventory() { + startField("totalInventory"); return this; } /** - * Returns a metafield found by namespace and key. + * The date and time when the product was last modified. + * A product's `updatedAt` value can change for different reasons. For example, if an order + * is placed for a product that has inventory tracking set up, then the inventory adjustment + * is counted as an update. */ - public PageQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { - startField("metafield"); - - _queryBuilder.append("(namespace:"); - Query.appendQuotedString(_queryBuilder, namespace.toString()); - - _queryBuilder.append(",key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ProductQuery updatedAt() { + startField("updatedAt"); return this; } /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * Find a product’s variant based on its selected options. + * This is useful for converting a user’s selection of product options into a single matching variant. + * If there is not a variant for the selected options, `null` will be returned. */ - public PageQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); + public ProductQuery variantBySelectedOptions(List selectedOptions, ProductVariantQueryDefinition queryDef) { + startField("variantBySelectedOptions"); - _queryBuilder.append("(identifiers:"); + _queryBuilder.append("(selectedOptions:"); _queryBuilder.append('['); { String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { + for (SelectedOptionInput item1 : selectedOptions) { _queryBuilder.append(listSeperator1); listSeperator1 = ","; item1.appendTo(_queryBuilder); } } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + _queryBuilder.append(']'); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new ProductVariantQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + public class VariantsArguments extends Arguments { + VariantsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * Returns up to the first `n` elements from the list. + */ + public VariantsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come after the specified cursor. + */ + public VariantsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Returns up to the last `n` elements from the list. + */ + public VariantsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come before the specified cursor. + */ + public VariantsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Reverse the order of the underlying list. + */ + public VariantsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Sort the underlying list by the given key. + */ + public VariantsArguments sortKey(ProductVariantSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; + } + } - return this; + public interface VariantsArgumentsDefinition { + void define(VariantsArguments args); } /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. + * List of the product’s variants. */ - public PageQuery onlineStoreUrl() { - startField("onlineStoreUrl"); - - return this; + public ProductQuery variants(ProductVariantConnectionQueryDefinition queryDef) { + return variants(args -> {}, queryDef); } /** - * The page's SEO information. + * List of the product’s variants. */ - public PageQuery seo(SEOQueryDefinition queryDef) { - startField("seo"); + public ProductQuery variants(VariantsArgumentsDefinition argsDef, ProductVariantConnectionQueryDefinition queryDef) { + startField("variants"); + + VariantsArguments args = new VariantsArguments(_queryBuilder); + argsDef.define(args); + VariantsArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new SEOQuery(_queryBuilder)); + queryDef.define(new ProductVariantConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The title of the page. - */ - public PageQuery title() { - startField("title"); - - return this; - } - - /** - * The timestamp of the latest page update. + * The product’s vendor name. */ - public PageQuery updatedAt() { - startField("updatedAt"); + public ProductQuery vendor() { + startField("vendor"); return this; } } /** - * Shopify merchants can create pages to hold static HTML content. Each Page object represents a custom - * page on the online store. + * A product represents an individual item for sale in a Shopify store. Products are often physical, + * but they don't have to be. + * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, + * as do services (such as equipment rental, work for hire, customization of another product or an + * extended warranty). */ - public static class Page extends AbstractResponse implements HasMetafields, MetafieldParentResource, MetafieldReference, Node, OnlineStorePublishable { - public Page() { + public static class Product extends AbstractResponse implements HasMetafields, MetafieldParentResource, MetafieldReference, Node, OnlineStorePublishable { + public Product() { } - public Page(JsonObject fields) throws SchemaViolationError { + public Product(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "body": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "availableForSale": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } - case "bodySummary": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "collections": { + responseData.put(key, new CollectionConnection(jsonAsObject(field.getValue(), key))); + + break; + } + + case "compareAtPriceRange": { + responseData.put(key, new ProductPriceRange(jsonAsObject(field.getValue(), key))); break; } @@ -48322,6 +55832,29 @@ public Page(JsonObject fields) throws SchemaViolationError { break; } + case "description": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "descriptionHtml": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "featuredImage": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + case "handle": { responseData.put(key, jsonAsString(field.getValue(), key)); @@ -48334,6 +55867,24 @@ public Page(JsonObject fields) throws SchemaViolationError { break; } + case "images": { + responseData.put(key, new ImageConnection(jsonAsObject(field.getValue(), key))); + + break; + } + + case "isGiftCard": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); + + break; + } + + case "media": { + responseData.put(key, new MediaConnection(jsonAsObject(field.getValue(), key))); + + break; + } + case "metafield": { Metafield optional1 = null; if (!field.getValue().isJsonNull()) { @@ -48372,13 +55923,60 @@ public Page(JsonObject fields) throws SchemaViolationError { break; } + case "options": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ProductOption(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "priceRange": { + responseData.put(key, new ProductPriceRange(jsonAsObject(field.getValue(), key))); + + break; + } + + case "productType": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "publishedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + + case "requiresSellingPlan": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); + + break; + } + + case "sellingPlanGroups": { + responseData.put(key, new SellingPlanGroupConnection(jsonAsObject(field.getValue(), key))); + + break; + } + case "seo": { - SEO optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new SEO(jsonAsObject(field.getValue(), key)); + responseData.put(key, new SEO(jsonAsObject(field.getValue(), key))); + + break; + } + + case "tags": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } @@ -48389,12 +55987,46 @@ public Page(JsonObject fields) throws SchemaViolationError { break; } + case "totalInventory": { + Integer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsInteger(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + case "updatedAt": { responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); break; } + case "variantBySelectedOptions": { + ProductVariant optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ProductVariant(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "variants": { + responseData.put(key, new ProductVariantConnection(jsonAsObject(field.getValue(), key))); + + break; + } + + case "vendor": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -48406,626 +56038,457 @@ public Page(JsonObject fields) throws SchemaViolationError { } } - public Page(ID id) { + public Product(ID id) { this(); optimisticData.put("id", id); } public String getGraphQlTypeName() { - return "Page"; - } - - /** - * The description of the page, complete with HTML formatting. - */ - - public String getBody() { - return (String) get("body"); - } - - public Page setBody(String arg) { - optimisticData.put(getKey("body"), arg); - return this; - } - - /** - * Summary of the page body. - */ - - public String getBodySummary() { - return (String) get("bodySummary"); - } - - public Page setBodySummary(String arg) { - optimisticData.put(getKey("bodySummary"), arg); - return this; + return "Product"; } /** - * The timestamp of the page creation. + * Indicates if at least one product variant is available for sale. */ - public DateTime getCreatedAt() { - return (DateTime) get("createdAt"); + public Boolean getAvailableForSale() { + return (Boolean) get("availableForSale"); } - public Page setCreatedAt(DateTime arg) { - optimisticData.put(getKey("createdAt"), arg); + public Product setAvailableForSale(Boolean arg) { + optimisticData.put(getKey("availableForSale"), arg); return this; } /** - * A human-friendly unique string for the page automatically generated from its title. + * List of collections a product belongs to. */ - public String getHandle() { - return (String) get("handle"); + public CollectionConnection getCollections() { + return (CollectionConnection) get("collections"); } - public Page setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); + public Product setCollections(CollectionConnection arg) { + optimisticData.put(getKey("collections"), arg); return this; } /** - * A globally-unique identifier. - */ - - public ID getId() { - return (ID) get("id"); - } - - /** - * Returns a metafield found by namespace and key. + * The compare at price of the product across all variants. */ - public Metafield getMetafield() { - return (Metafield) get("metafield"); + public ProductPriceRange getCompareAtPriceRange() { + return (ProductPriceRange) get("compareAtPriceRange"); } - public Page setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); + public Product setCompareAtPriceRange(ProductPriceRange arg) { + optimisticData.put(getKey("compareAtPriceRange"), arg); return this; } /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * The date and time when the product was created. */ - public List getMetafields() { - return (List) get("metafields"); + public DateTime getCreatedAt() { + return (DateTime) get("createdAt"); } - public Page setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); + public Product setCreatedAt(DateTime arg) { + optimisticData.put(getKey("createdAt"), arg); return this; } /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. + * Stripped description of the product, single line with HTML tags removed. */ - public String getOnlineStoreUrl() { - return (String) get("onlineStoreUrl"); + public String getDescription() { + return (String) get("description"); } - public Page setOnlineStoreUrl(String arg) { - optimisticData.put(getKey("onlineStoreUrl"), arg); + public Product setDescription(String arg) { + optimisticData.put(getKey("description"), arg); return this; } /** - * The page's SEO information. + * The description of the product, complete with HTML formatting. */ - public SEO getSeo() { - return (SEO) get("seo"); + public String getDescriptionHtml() { + return (String) get("descriptionHtml"); } - public Page setSeo(SEO arg) { - optimisticData.put(getKey("seo"), arg); + public Product setDescriptionHtml(String arg) { + optimisticData.put(getKey("descriptionHtml"), arg); return this; } /** - * The title of the page. + * The featured image for the product. + * This field is functionally equivalent to `images(first: 1)`. */ - public String getTitle() { - return (String) get("title"); + public Image getFeaturedImage() { + return (Image) get("featuredImage"); } - public Page setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public Product setFeaturedImage(Image arg) { + optimisticData.put(getKey("featuredImage"), arg); return this; } /** - * The timestamp of the latest page update. + * A human-friendly unique string for the Product automatically generated from its title. + * They are used by the Liquid templating language to refer to objects. */ - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); + public String getHandle() { + return (String) get("handle"); } - public Page setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); + public Product setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "body": return false; - - case "bodySummary": return false; - - case "createdAt": return false; - - case "handle": return false; - - case "id": return false; - - case "metafield": return true; - - case "metafields": return true; - - case "onlineStoreUrl": return false; - - case "seo": return true; - - case "title": return false; - - case "updatedAt": return false; - - default: return false; - } - } - } - - public interface PageConnectionQueryDefinition { - void define(PageConnectionQuery _queryBuilder); - } - - /** - * An auto-generated type for paginating through multiple Pages. - */ - public static class PageConnectionQuery extends Query { - PageConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - /** - * A list of edges. + * A globally-unique identifier. */ - public PageConnectionQuery edges(PageEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new PageEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public ID getId() { + return (ID) get("id"); } /** - * A list of the nodes contained in PageEdge. + * List of images associated with the product. */ - public PageConnectionQuery nodes(PageQueryDefinition queryDef) { - startField("nodes"); - - _queryBuilder.append('{'); - queryDef.define(new PageQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public ImageConnection getImages() { + return (ImageConnection) get("images"); } - /** - * Information to aid in pagination. - */ - public PageConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); - + public Product setImages(ImageConnection arg) { + optimisticData.put(getKey("images"), arg); return this; } - } - - /** - * An auto-generated type for paginating through multiple Pages. - */ - public static class PageConnection extends AbstractResponse { - public PageConnection() { - } - - public PageConnection(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new PageEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Page(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "PageConnection"; - } /** - * A list of edges. + * Whether the product is a gift card. */ - public List getEdges() { - return (List) get("edges"); + public Boolean getIsGiftCard() { + return (Boolean) get("isGiftCard"); } - public PageConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); + public Product setIsGiftCard(Boolean arg) { + optimisticData.put(getKey("isGiftCard"), arg); return this; } /** - * A list of the nodes contained in PageEdge. + * The media associated with the product. */ - public List getNodes() { - return (List) get("nodes"); + public MediaConnection getMedia() { + return (MediaConnection) get("media"); } - public PageConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + public Product setMedia(MediaConnection arg) { + optimisticData.put(getKey("media"), arg); return this; } /** - * Information to aid in pagination. + * Returns a metafield found by namespace and key. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public Metafield getMetafield() { + return (Metafield) get("metafield"); } - public PageConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public Product setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), 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 PageEdgeQueryDefinition { - void define(PageEdgeQuery _queryBuilder); - } - - /** - * An auto-generated type which holds one Page and a cursor during pagination. - */ - public static class PageEdgeQuery extends Query { - PageEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - /** - * A cursor for use in pagination. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public PageEdgeQuery cursor() { - startField("cursor"); + public List getMetafields() { + return (List) get("metafields"); + } + + public Product setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); return this; } /** - * The item at the end of PageEdge. + * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is + * currently not published to the Online Store sales channel. */ - public PageEdgeQuery node(PageQueryDefinition queryDef) { - startField("node"); - - _queryBuilder.append('{'); - queryDef.define(new PageQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public String getOnlineStoreUrl() { + return (String) get("onlineStoreUrl"); } - } - /** - * An auto-generated type which holds one Page and a cursor during pagination. - */ - public static class PageEdge extends AbstractResponse { - public PageEdge() { + public Product setOnlineStoreUrl(String arg) { + optimisticData.put(getKey("onlineStoreUrl"), arg); + return this; } - public PageEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "node": { - responseData.put(key, new Page(jsonAsObject(field.getValue(), key))); - - break; - } + /** + * List of product options. + */ - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public List getOptions() { + return (List) get("options"); } - public String getGraphQlTypeName() { - return "PageEdge"; + public Product setOptions(List arg) { + optimisticData.put(getKey("options"), arg); + return this; } /** - * A cursor for use in pagination. + * The price range. */ - public String getCursor() { - return (String) get("cursor"); + public ProductPriceRange getPriceRange() { + return (ProductPriceRange) get("priceRange"); } - public PageEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public Product setPriceRange(ProductPriceRange arg) { + optimisticData.put(getKey("priceRange"), arg); return this; } /** - * The item at the end of PageEdge. + * A categorization that a product can be tagged with, commonly used for filtering and searching. */ - public Page getNode() { - return (Page) get("node"); + public String getProductType() { + return (String) get("productType"); } - public PageEdge setNode(Page arg) { - optimisticData.put(getKey("node"), arg); + public Product setProductType(String arg) { + optimisticData.put(getKey("productType"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; - - case "node": return true; + /** + * The date and time when the product was published to the channel. + */ - default: return false; - } + public DateTime getPublishedAt() { + return (DateTime) get("publishedAt"); } - } - - public interface PageInfoQueryDefinition { - void define(PageInfoQuery _queryBuilder); - } - /** - * Returns information about pagination in a connection, in accordance with the - * [Relay specification](https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo). - */ - public static class PageInfoQuery extends Query { - PageInfoQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public Product setPublishedAt(DateTime arg) { + optimisticData.put(getKey("publishedAt"), arg); + return this; } /** - * The cursor corresponding to the last node in edges. + * Whether the product can only be purchased with a selling plan. */ - public PageInfoQuery endCursor() { - startField("endCursor"); + public Boolean getRequiresSellingPlan() { + return (Boolean) get("requiresSellingPlan"); + } + + public Product setRequiresSellingPlan(Boolean arg) { + optimisticData.put(getKey("requiresSellingPlan"), arg); return this; } /** - * Whether there are more pages to fetch following the current page. + * A list of a product's available selling plan groups. A selling plan group represents a selling + * method. For example, 'Subscribe and save' is a selling method where customers pay for goods or + * services per delivery. A selling plan group contains individual selling plans. */ - public PageInfoQuery hasNextPage() { - startField("hasNextPage"); + public SellingPlanGroupConnection getSellingPlanGroups() { + return (SellingPlanGroupConnection) get("sellingPlanGroups"); + } + + public Product setSellingPlanGroups(SellingPlanGroupConnection arg) { + optimisticData.put(getKey("sellingPlanGroups"), arg); return this; } /** - * Whether there are any pages prior to the current page. + * The product's SEO information. */ - public PageInfoQuery hasPreviousPage() { - startField("hasPreviousPage"); + public SEO getSeo() { + return (SEO) get("seo"); + } + + public Product setSeo(SEO arg) { + optimisticData.put(getKey("seo"), arg); return this; } /** - * The cursor corresponding to the first node in edges. + * A comma separated list of tags that have been added to the product. + * Additional access scope required for private apps: unauthenticated_read_product_tags. */ - public PageInfoQuery startCursor() { - startField("startCursor"); - return this; + public List getTags() { + return (List) get("tags"); } - } - /** - * Returns information about pagination in a connection, in accordance with the - * [Relay specification](https://relay.dev/graphql/connections.htm#sec-undefined.PageInfo). - */ - public static class PageInfo extends AbstractResponse { - public PageInfo() { + public Product setTags(List arg) { + optimisticData.put(getKey("tags"), arg); + return this; } - public PageInfo(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "endCursor": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "hasNextPage": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "hasPreviousPage": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } + /** + * The product’s title. + */ - case "startCursor": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + public String getTitle() { + return (String) get("title"); + } - responseData.put(key, optional1); + public Product setTitle(String arg) { + optimisticData.put(getKey("title"), arg); + return this; + } - break; - } + /** + * The total quantity of inventory in stock for this Product. + */ - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public Integer getTotalInventory() { + return (Integer) get("totalInventory"); } - public String getGraphQlTypeName() { - return "PageInfo"; + public Product setTotalInventory(Integer arg) { + optimisticData.put(getKey("totalInventory"), arg); + return this; } /** - * The cursor corresponding to the last node in edges. + * The date and time when the product was last modified. + * A product's `updatedAt` value can change for different reasons. For example, if an order + * is placed for a product that has inventory tracking set up, then the inventory adjustment + * is counted as an update. */ - public String getEndCursor() { - return (String) get("endCursor"); + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); } - public PageInfo setEndCursor(String arg) { - optimisticData.put(getKey("endCursor"), arg); + public Product setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); return this; } /** - * Whether there are more pages to fetch following the current page. + * Find a product’s variant based on its selected options. + * This is useful for converting a user’s selection of product options into a single matching variant. + * If there is not a variant for the selected options, `null` will be returned. */ - public Boolean getHasNextPage() { - return (Boolean) get("hasNextPage"); + public ProductVariant getVariantBySelectedOptions() { + return (ProductVariant) get("variantBySelectedOptions"); } - public PageInfo setHasNextPage(Boolean arg) { - optimisticData.put(getKey("hasNextPage"), arg); + public Product setVariantBySelectedOptions(ProductVariant arg) { + optimisticData.put(getKey("variantBySelectedOptions"), arg); return this; } /** - * Whether there are any pages prior to the current page. + * List of the product’s variants. */ - public Boolean getHasPreviousPage() { - return (Boolean) get("hasPreviousPage"); + public ProductVariantConnection getVariants() { + return (ProductVariantConnection) get("variants"); } - public PageInfo setHasPreviousPage(Boolean arg) { - optimisticData.put(getKey("hasPreviousPage"), arg); + public Product setVariants(ProductVariantConnection arg) { + optimisticData.put(getKey("variants"), arg); return this; } /** - * The cursor corresponding to the first node in edges. + * The product’s vendor name. */ - public String getStartCursor() { - return (String) get("startCursor"); + public String getVendor() { + return (String) get("vendor"); } - public PageInfo setStartCursor(String arg) { - optimisticData.put(getKey("startCursor"), arg); + public Product setVendor(String arg) { + optimisticData.put(getKey("vendor"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "endCursor": return false; + case "availableForSale": return false; - case "hasNextPage": return false; + case "collections": return true; - case "hasPreviousPage": return false; + case "compareAtPriceRange": return true; - case "startCursor": return false; + case "createdAt": return false; + + case "description": return false; + + case "descriptionHtml": return false; + + case "featuredImage": return true; + + case "handle": return false; + + case "id": return false; + + case "images": return true; + + case "isGiftCard": return false; + + case "media": return true; + + case "metafield": return true; + + case "metafields": return true; + + case "onlineStoreUrl": return false; + + case "options": return true; + + case "priceRange": return true; + + case "productType": return false; + + case "publishedAt": return false; + + case "requiresSellingPlan": return false; + + case "sellingPlanGroups": return true; + + case "seo": return true; + + case "tags": return false; + + case "title": return false; + + case "totalInventory": return false; + + case "updatedAt": return false; + + case "variantBySelectedOptions": return true; + + case "variants": return true; + + case "vendor": return false; default: return false; } @@ -49033,14 +56496,39 @@ public boolean unwrapsToObject(String key) { } /** - * The set of valid sort keys for the Page query. + * The set of valid sort keys for the ProductCollection query. */ - public enum PageSortKeys { + public enum ProductCollectionSortKeys { + /** + * Sort by the `best-selling` value. + */ + BEST_SELLING, + + /** + * Sort by the `collection-default` value. + */ + COLLECTION_DEFAULT, + + /** + * Sort by the `created` value. + */ + CREATED, + /** * Sort by the `id` value. */ ID, + /** + * Sort by the `manual` value. + */ + MANUAL, + + /** + * Sort by the `price` value. + */ + PRICE, + /** * Sort by relevance to the search terms when the `query` parameter is specified on the connection. * Don't use this sort key when no search query is specified. @@ -49052,23 +56540,38 @@ public enum PageSortKeys { */ TITLE, - /** - * Sort by the `updated_at` value. - */ - UPDATED_AT, - UNKNOWN_VALUE; - public static PageSortKeys fromGraphQl(String value) { + public static ProductCollectionSortKeys fromGraphQl(String value) { if (value == null) { return null; } switch (value) { + case "BEST_SELLING": { + return BEST_SELLING; + } + + case "COLLECTION_DEFAULT": { + return COLLECTION_DEFAULT; + } + + case "CREATED": { + return CREATED; + } + case "ID": { return ID; } + case "MANUAL": { + return MANUAL; + } + + case "PRICE": { + return PRICE; + } + case "RELEVANCE": { return RELEVANCE; } @@ -49077,10 +56580,6 @@ public static PageSortKeys fromGraphQl(String value) { return TITLE; } - case "UPDATED_AT": { - return UPDATED_AT; - } - default: { return UNKNOWN_VALUE; } @@ -49088,10 +56587,30 @@ public static PageSortKeys fromGraphQl(String value) { } public String toString() { switch (this) { + case BEST_SELLING: { + return "BEST_SELLING"; + } + + case COLLECTION_DEFAULT: { + return "COLLECTION_DEFAULT"; + } + + case CREATED: { + return "CREATED"; + } + case ID: { return "ID"; } + case MANUAL: { + return "MANUAL"; + } + + case PRICE: { + return "PRICE"; + } + case RELEVANCE: { return "RELEVANCE"; } @@ -49100,10 +56619,6 @@ public String toString() { return "TITLE"; } - case UPDATED_AT: { - return "UPDATED_AT"; - } - default: { return ""; } @@ -49111,143 +56626,65 @@ public String toString() { } } - public interface PaymentQueryDefinition { - void define(PaymentQuery _queryBuilder); - } - - /** - * A payment applied to a checkout. - */ - public static class PaymentQuery extends Query { - PaymentQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - - startField("id"); - } - - /** - * The amount of the payment. - */ - public PaymentQuery amount(MoneyV2QueryDefinition queryDef) { - startField("amount"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The amount of the payment. - * - * @deprecated Use `amount` instead. - */ - @Deprecated - public PaymentQuery amountV2(MoneyV2QueryDefinition queryDef) { - startField("amountV2"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The billing address for the payment. - */ - public PaymentQuery billingAddress(MailingAddressQueryDefinition queryDef) { - startField("billingAddress"); - - _queryBuilder.append('{'); - queryDef.define(new MailingAddressQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The checkout to which the payment belongs. - */ - public PaymentQuery checkout(CheckoutQueryDefinition queryDef) { - startField("checkout"); - - _queryBuilder.append('{'); - queryDef.define(new CheckoutQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The credit card used for the payment in the case of direct payments. - */ - public PaymentQuery creditCard(CreditCardQueryDefinition queryDef) { - startField("creditCard"); - - _queryBuilder.append('{'); - queryDef.define(new CreditCardQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * A message describing a processing error during asynchronous processing. - */ - public PaymentQuery errorMessage() { - startField("errorMessage"); - - return this; - } - - /** - * A client-side generated token to identify a payment and perform idempotent operations. - * For more information, refer to - * [Idempotent requests](https://shopify.dev/api/usage/idempotent-requests). - */ - public PaymentQuery idempotencyKey() { - startField("idempotencyKey"); + public interface ProductConnectionQueryDefinition { + void define(ProductConnectionQuery _queryBuilder); + } - return this; + /** + * An auto-generated type for paginating through multiple Products. + */ + public static class ProductConnectionQuery extends Query { + ProductConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The URL where the customer needs to be redirected so they can complete the 3D Secure payment flow. + * A list of edges. */ - public PaymentQuery nextActionUrl() { - startField("nextActionUrl"); + public ProductConnectionQuery edges(ProductEdgeQueryDefinition queryDef) { + startField("edges"); + + _queryBuilder.append('{'); + queryDef.define(new ProductEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * Whether the payment is still processing asynchronously. + * A list of available filters. */ - public PaymentQuery ready() { - startField("ready"); + public ProductConnectionQuery filters(FilterQueryDefinition queryDef) { + startField("filters"); + + _queryBuilder.append('{'); + queryDef.define(new FilterQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * A flag to indicate if the payment is to be done in test mode for gateways that support it. + * A list of the nodes contained in ProductEdge. */ - public PaymentQuery test() { - startField("test"); + public ProductConnectionQuery nodes(ProductQueryDefinition queryDef) { + startField("nodes"); + + _queryBuilder.append('{'); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The actual transaction recorded by Shopify after having processed the payment with the gateway. + * Information to aid in pagination. */ - public PaymentQuery transaction(TransactionQueryDefinition queryDef) { - startField("transaction"); + public ProductConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); _queryBuilder.append('{'); - queryDef.define(new TransactionQuery(_queryBuilder)); + queryDef.define(new PageInfoQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -49255,115 +56692,52 @@ public PaymentQuery transaction(TransactionQueryDefinition queryDef) { } /** - * A payment applied to a checkout. + * An auto-generated type for paginating through multiple Products. */ - public static class Payment extends AbstractResponse implements Node { - public Payment() { + public static class ProductConnection extends AbstractResponse { + public ProductConnection() { } - public Payment(JsonObject fields) throws SchemaViolationError { + public ProductConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "amount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "amountV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "billingAddress": { - MailingAddress optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MailingAddress(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "checkout": { - responseData.put(key, new Checkout(jsonAsObject(field.getValue(), key))); - - break; - } - - case "creditCard": { - CreditCard optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new CreditCard(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "errorMessage": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ProductEdge(jsonAsObject(element1, key))); } - responseData.put(key, optional1); - - break; - } - - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + responseData.put(key, list1); break; } - case "idempotencyKey": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "filters": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Filter(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "nextActionUrl": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Product(jsonAsObject(element1, key))); } - responseData.put(key, optional1); - - break; - } - - case "ready": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "test": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + responseData.put(key, list1); break; } - case "transaction": { - Transaction optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Transaction(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } @@ -49379,535 +56753,516 @@ public Payment(JsonObject fields) throws SchemaViolationError { } } - public Payment(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "Payment"; + return "ProductConnection"; } /** - * The amount of the payment. + * A list of edges. */ - public MoneyV2 getAmount() { - return (MoneyV2) get("amount"); + public List getEdges() { + return (List) get("edges"); } - public Payment setAmount(MoneyV2 arg) { - optimisticData.put(getKey("amount"), arg); + public ProductConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * The amount of the payment. - * - * @deprecated Use `amount` instead. + * A list of available filters. */ - public MoneyV2 getAmountV2() { - return (MoneyV2) get("amountV2"); + public List getFilters() { + return (List) get("filters"); } - public Payment setAmountV2(MoneyV2 arg) { - optimisticData.put(getKey("amountV2"), arg); + public ProductConnection setFilters(List arg) { + optimisticData.put(getKey("filters"), arg); return this; } /** - * The billing address for the payment. + * A list of the nodes contained in ProductEdge. */ - public MailingAddress getBillingAddress() { - return (MailingAddress) get("billingAddress"); + public List getNodes() { + return (List) get("nodes"); } - public Payment setBillingAddress(MailingAddress arg) { - optimisticData.put(getKey("billingAddress"), arg); + public ProductConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * The checkout to which the payment belongs. + * Information to aid in pagination. */ - public Checkout getCheckout() { - return (Checkout) get("checkout"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public Payment setCheckout(Checkout arg) { - optimisticData.put(getKey("checkout"), arg); + public ProductConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } - /** - * The credit card used for the payment in the case of direct payments. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - public CreditCard getCreditCard() { - return (CreditCard) get("creditCard"); - } + case "filters": return true; - public Payment setCreditCard(CreditCard arg) { - optimisticData.put(getKey("creditCard"), arg); - return this; - } + case "nodes": return true; - /** - * A message describing a processing error during asynchronous processing. - */ + case "pageInfo": return true; - public String getErrorMessage() { - return (String) get("errorMessage"); + default: return false; + } } + } - public Payment setErrorMessage(String arg) { - optimisticData.put(getKey("errorMessage"), arg); - return this; + public interface ProductEdgeQueryDefinition { + void define(ProductEdgeQuery _queryBuilder); + } + + /** + * An auto-generated type which holds one Product and a cursor during pagination. + */ + public static class ProductEdgeQuery extends Query { + ProductEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * A globally-unique identifier. + * A cursor for use in pagination. */ + public ProductEdgeQuery cursor() { + startField("cursor"); - public ID getId() { - return (ID) get("id"); + return this; } /** - * A client-side generated token to identify a payment and perform idempotent operations. - * For more information, refer to - * [Idempotent requests](https://shopify.dev/api/usage/idempotent-requests). + * The item at the end of ProductEdge. */ + public ProductEdgeQuery node(ProductQueryDefinition queryDef) { + startField("node"); - public String getIdempotencyKey() { - return (String) get("idempotencyKey"); - } + _queryBuilder.append('{'); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); - public Payment setIdempotencyKey(String arg) { - optimisticData.put(getKey("idempotencyKey"), arg); return this; } + } - /** - * The URL where the customer needs to be redirected so they can complete the 3D Secure payment flow. - */ - - public String getNextActionUrl() { - return (String) get("nextActionUrl"); + /** + * An auto-generated type which holds one Product and a cursor during pagination. + */ + public static class ProductEdge extends AbstractResponse { + public ProductEdge() { } - public Payment setNextActionUrl(String arg) { - optimisticData.put(getKey("nextActionUrl"), arg); - return this; - } + public ProductEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * Whether the payment is still processing asynchronously. - */ + break; + } - public Boolean getReady() { - return (Boolean) get("ready"); + case "node": { + responseData.put(key, new Product(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public Payment setReady(Boolean arg) { - optimisticData.put(getKey("ready"), arg); - return this; + public String getGraphQlTypeName() { + return "ProductEdge"; } /** - * A flag to indicate if the payment is to be done in test mode for gateways that support it. + * A cursor for use in pagination. */ - public Boolean getTest() { - return (Boolean) get("test"); + public String getCursor() { + return (String) get("cursor"); } - public Payment setTest(Boolean arg) { - optimisticData.put(getKey("test"), arg); + public ProductEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * The actual transaction recorded by Shopify after having processed the payment with the gateway. + * The item at the end of ProductEdge. */ - public Transaction getTransaction() { - return (Transaction) get("transaction"); + public Product getNode() { + return (Product) get("node"); } - public Payment setTransaction(Transaction arg) { - optimisticData.put(getKey("transaction"), arg); + public ProductEdge setNode(Product arg) { + optimisticData.put(getKey("node"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "amount": return true; - - case "amountV2": return true; - - case "billingAddress": return true; - - case "checkout": return true; - - case "creditCard": return true; - - case "errorMessage": return false; - - case "id": return false; - - case "idempotencyKey": return false; - - case "nextActionUrl": return false; - - case "ready": return false; - - case "test": return false; + case "cursor": return false; - case "transaction": return true; + case "node": return true; default: return false; } } } - public interface PaymentSettingsQueryDefinition { - void define(PaymentSettingsQuery _queryBuilder); - } + public static class ProductFilter implements Serializable { + private Input available = Input.undefined(); - /** - * Settings related to payments. - */ - public static class PaymentSettingsQuery extends Query { - PaymentSettingsQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + private Input variantOption = Input.undefined(); - /** - * List of the card brands which the shop accepts. - */ - public PaymentSettingsQuery acceptedCardBrands() { - startField("acceptedCardBrands"); + private Input productType = Input.undefined(); - return this; - } + private Input productVendor = Input.undefined(); - /** - * The url pointing to the endpoint to vault credit cards. - */ - public PaymentSettingsQuery cardVaultUrl() { - startField("cardVaultUrl"); + private Input price = Input.undefined(); - return this; - } + private Input productMetafield = Input.undefined(); - /** - * The country where the shop is located. - */ - public PaymentSettingsQuery countryCode() { - startField("countryCode"); + private Input variantMetafield = Input.undefined(); - return this; + private Input tag = Input.undefined(); + + public Boolean getAvailable() { + return available.getValue(); } - /** - * The three-letter code for the shop's primary currency. - */ - public PaymentSettingsQuery currencyCode() { - startField("currencyCode"); + public Input getAvailableInput() { + return available; + } + public ProductFilter setAvailable(Boolean available) { + this.available = Input.optional(available); return this; } - /** - * A list of enabled currencies (ISO 4217 format) that the shop accepts. Merchants can enable - * currencies from their Shopify Payments settings in the Shopify admin. - */ - public PaymentSettingsQuery enabledPresentmentCurrencies() { - startField("enabledPresentmentCurrencies"); - + public ProductFilter setAvailableInput(Input available) { + if (available == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.available = available; return this; } - /** - * The shop’s Shopify Payments account id. - */ - public PaymentSettingsQuery shopifyPaymentsAccountId() { - startField("shopifyPaymentsAccountId"); - - return this; + public VariantOptionFilter getVariantOption() { + return variantOption.getValue(); } - /** - * List of the digital wallets which the shop supports. - */ - public PaymentSettingsQuery supportedDigitalWallets() { - startField("supportedDigitalWallets"); + public Input getVariantOptionInput() { + return variantOption; + } + public ProductFilter setVariantOption(VariantOptionFilter variantOption) { + this.variantOption = Input.optional(variantOption); return this; } - } - /** - * Settings related to payments. - */ - public static class PaymentSettings extends AbstractResponse { - public PaymentSettings() { + public ProductFilter setVariantOptionInput(Input variantOption) { + if (variantOption == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.variantOption = variantOption; + return this; } - public PaymentSettings(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "acceptedCardBrands": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(CardBrand.fromGraphQl(jsonAsString(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "cardVaultUrl": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "countryCode": { - responseData.put(key, CountryCode.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "currencyCode": { - responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "enabledPresentmentCurrencies": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(CurrencyCode.fromGraphQl(jsonAsString(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "shopifyPaymentsAccountId": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "supportedDigitalWallets": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(DigitalWallet.fromGraphQl(jsonAsString(element1, key))); - } + public String getProductType() { + return productType.getValue(); + } - responseData.put(key, list1); + public Input getProductTypeInput() { + return productType; + } - break; - } + public ProductFilter setProductType(String productType) { + this.productType = Input.optional(productType); + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } + public ProductFilter setProductTypeInput(Input productType) { + if (productType == null) { + throw new IllegalArgumentException("Input can not be null"); } + this.productType = productType; + return this; } - public String getGraphQlTypeName() { - return "PaymentSettings"; + public String getProductVendor() { + return productVendor.getValue(); } - /** - * List of the card brands which the shop accepts. - */ + public Input getProductVendorInput() { + return productVendor; + } - public List getAcceptedCardBrands() { - return (List) get("acceptedCardBrands"); + public ProductFilter setProductVendor(String productVendor) { + this.productVendor = Input.optional(productVendor); + return this; } - public PaymentSettings setAcceptedCardBrands(List arg) { - optimisticData.put(getKey("acceptedCardBrands"), arg); + public ProductFilter setProductVendorInput(Input productVendor) { + if (productVendor == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.productVendor = productVendor; return this; } - /** - * The url pointing to the endpoint to vault credit cards. - */ + public PriceRangeFilter getPrice() { + return price.getValue(); + } - public String getCardVaultUrl() { - return (String) get("cardVaultUrl"); + public Input getPriceInput() { + return price; } - public PaymentSettings setCardVaultUrl(String arg) { - optimisticData.put(getKey("cardVaultUrl"), arg); + public ProductFilter setPrice(PriceRangeFilter price) { + this.price = Input.optional(price); return this; } - /** - * The country where the shop is located. - */ - - public CountryCode getCountryCode() { - return (CountryCode) get("countryCode"); + public ProductFilter setPriceInput(Input price) { + if (price == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.price = price; + return this; } - public PaymentSettings setCountryCode(CountryCode arg) { - optimisticData.put(getKey("countryCode"), arg); - return this; + public MetafieldFilter getProductMetafield() { + return productMetafield.getValue(); } - /** - * The three-letter code for the shop's primary currency. - */ + public Input getProductMetafieldInput() { + return productMetafield; + } - public CurrencyCode getCurrencyCode() { - return (CurrencyCode) get("currencyCode"); + public ProductFilter setProductMetafield(MetafieldFilter productMetafield) { + this.productMetafield = Input.optional(productMetafield); + return this; } - public PaymentSettings setCurrencyCode(CurrencyCode arg) { - optimisticData.put(getKey("currencyCode"), arg); + public ProductFilter setProductMetafieldInput(Input productMetafield) { + if (productMetafield == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.productMetafield = productMetafield; return this; } - /** - * A list of enabled currencies (ISO 4217 format) that the shop accepts. Merchants can enable - * currencies from their Shopify Payments settings in the Shopify admin. - */ + public MetafieldFilter getVariantMetafield() { + return variantMetafield.getValue(); + } - public List getEnabledPresentmentCurrencies() { - return (List) get("enabledPresentmentCurrencies"); + public Input getVariantMetafieldInput() { + return variantMetafield; } - public PaymentSettings setEnabledPresentmentCurrencies(List arg) { - optimisticData.put(getKey("enabledPresentmentCurrencies"), arg); + public ProductFilter setVariantMetafield(MetafieldFilter variantMetafield) { + this.variantMetafield = Input.optional(variantMetafield); return this; } - /** - * The shop’s Shopify Payments account id. - */ - - public String getShopifyPaymentsAccountId() { - return (String) get("shopifyPaymentsAccountId"); + public ProductFilter setVariantMetafieldInput(Input variantMetafield) { + if (variantMetafield == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.variantMetafield = variantMetafield; + return this; } - public PaymentSettings setShopifyPaymentsAccountId(String arg) { - optimisticData.put(getKey("shopifyPaymentsAccountId"), arg); - return this; + public String getTag() { + return tag.getValue(); } - /** - * List of the digital wallets which the shop supports. - */ + public Input getTagInput() { + return tag; + } - public List getSupportedDigitalWallets() { - return (List) get("supportedDigitalWallets"); + public ProductFilter setTag(String tag) { + this.tag = Input.optional(tag); + return this; } - public PaymentSettings setSupportedDigitalWallets(List arg) { - optimisticData.put(getKey("supportedDigitalWallets"), arg); + public ProductFilter setTagInput(Input tag) { + if (tag == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.tag = tag; return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "acceptedCardBrands": return false; + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - case "cardVaultUrl": return false; + if (this.available.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("available:"); + if (available.getValue() != null) { + _queryBuilder.append(available.getValue()); + } else { + _queryBuilder.append("null"); + } + } - case "countryCode": return false; + if (this.variantOption.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("variantOption:"); + if (variantOption.getValue() != null) { + variantOption.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } - case "currencyCode": return false; + if (this.productType.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("productType:"); + if (productType.getValue() != null) { + Query.appendQuotedString(_queryBuilder, productType.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - case "enabledPresentmentCurrencies": return false; + if (this.productVendor.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("productVendor:"); + if (productVendor.getValue() != null) { + Query.appendQuotedString(_queryBuilder, productVendor.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - case "shopifyPaymentsAccountId": return false; + if (this.price.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("price:"); + if (price.getValue() != null) { + price.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } - case "supportedDigitalWallets": return false; + if (this.productMetafield.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("productMetafield:"); + if (productMetafield.getValue() != null) { + productMetafield.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } - default: return false; + if (this.variantMetafield.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("variantMetafield:"); + if (variantMetafield.getValue() != null) { + variantMetafield.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + if (this.tag.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("tag:"); + if (tag.getValue() != null) { + Query.appendQuotedString(_queryBuilder, tag.getValue().toString()); + } else { + _queryBuilder.append("null"); + } } + + _queryBuilder.append('}'); } } /** - * The valid values for the types of payment token. + * The set of valid sort keys for the ProductImage query. */ - public enum PaymentTokenType { - /** - * Apple Pay token type. - */ - APPLE_PAY, - + public enum ProductImageSortKeys { /** - * Google Pay token type. + * Sort by the `created_at` value. */ - GOOGLE_PAY, + CREATED_AT, /** - * Shopify Pay token type. + * Sort by the `id` value. */ - SHOPIFY_PAY, + ID, /** - * Stripe token type. + * Sort by the `position` value. */ - STRIPE_VAULT_TOKEN, + POSITION, /** - * Vault payment token type. + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. */ - VAULT, + RELEVANCE, UNKNOWN_VALUE; - public static PaymentTokenType fromGraphQl(String value) { + public static ProductImageSortKeys fromGraphQl(String value) { if (value == null) { return null; } switch (value) { - case "APPLE_PAY": { - return APPLE_PAY; - } - - case "GOOGLE_PAY": { - return GOOGLE_PAY; + case "CREATED_AT": { + return CREATED_AT; } - case "SHOPIFY_PAY": { - return SHOPIFY_PAY; + case "ID": { + return ID; } - case "STRIPE_VAULT_TOKEN": { - return STRIPE_VAULT_TOKEN; + case "POSITION": { + return POSITION; } - case "VAULT": { - return VAULT; + case "RELEVANCE": { + return RELEVANCE; } default: { @@ -49917,24 +57272,20 @@ public static PaymentTokenType fromGraphQl(String value) { } public String toString() { switch (this) { - case APPLE_PAY: { - return "APPLE_PAY"; - } - - case GOOGLE_PAY: { - return "GOOGLE_PAY"; + case CREATED_AT: { + return "CREATED_AT"; } - case SHOPIFY_PAY: { - return "SHOPIFY_PAY"; + case ID: { + return "ID"; } - case STRIPE_VAULT_TOKEN: { - return "STRIPE_VAULT_TOKEN"; + case POSITION: { + return "POSITION"; } - case VAULT: { - return "VAULT"; + case RELEVANCE: { + return "RELEVANCE"; } default: { @@ -49944,119 +57295,140 @@ public String toString() { } } - public static class PriceRangeFilter implements Serializable { - private Input min = Input.undefined(); - - private Input max = Input.undefined(); + /** + * The set of valid sort keys for the ProductMedia query. + */ + public enum ProductMediaSortKeys { + /** + * Sort by the `id` value. + */ + ID, - public Double getMin() { - return min.getValue(); - } + /** + * Sort by the `position` value. + */ + POSITION, - public Input getMinInput() { - return min; - } + /** + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. + */ + RELEVANCE, - public PriceRangeFilter setMin(Double min) { - this.min = Input.optional(min); - return this; - } + UNKNOWN_VALUE; - public PriceRangeFilter setMinInput(Input min) { - if (min == null) { - throw new IllegalArgumentException("Input can not be null"); + public static ProductMediaSortKeys fromGraphQl(String value) { + if (value == null) { + return null; } - this.min = min; - return this; - } - public Double getMax() { - return max.getValue(); - } + switch (value) { + case "ID": { + return ID; + } - public Input getMaxInput() { - return max; - } + case "POSITION": { + return POSITION; + } - public PriceRangeFilter setMax(Double max) { - this.max = Input.optional(max); - return this; - } + case "RELEVANCE": { + return RELEVANCE; + } - public PriceRangeFilter setMaxInput(Input max) { - if (max == null) { - throw new IllegalArgumentException("Input can not be null"); + default: { + return UNKNOWN_VALUE; + } } - this.max = max; - return this; } + public String toString() { + switch (this) { + case ID: { + return "ID"; + } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + case POSITION: { + return "POSITION"; + } - if (this.min.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("min:"); - if (min.getValue() != null) { - _queryBuilder.append(min.getValue()); - } else { - _queryBuilder.append("null"); + case RELEVANCE: { + return "RELEVANCE"; } - } - if (this.max.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("max:"); - if (max.getValue() != null) { - _queryBuilder.append(max.getValue()); - } else { - _queryBuilder.append("null"); + default: { + return ""; } } - - _queryBuilder.append('}'); } } - public interface PricingPercentageValueQueryDefinition { - void define(PricingPercentageValueQuery _queryBuilder); + public interface ProductOptionQueryDefinition { + void define(ProductOptionQuery _queryBuilder); } /** - * The value of the percentage pricing object. + * Product property names like "Size", "Color", and "Material" that the customers can select. + * Variants are selected based on permutations of these options. + * 255 characters limit each. */ - public static class PricingPercentageValueQuery extends Query { - PricingPercentageValueQuery(StringBuilder _queryBuilder) { + public static class ProductOptionQuery extends Query { + ProductOptionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * The percentage value of the object. + * The product option’s name. */ - public PricingPercentageValueQuery percentage() { - startField("percentage"); + public ProductOptionQuery name() { + startField("name"); + + return this; + } + + /** + * The corresponding value to the product option name. + */ + public ProductOptionQuery values() { + startField("values"); return this; } } /** - * The value of the percentage pricing object. + * Product property names like "Size", "Color", and "Material" that the customers can select. + * Variants are selected based on permutations of these options. + * 255 characters limit each. */ - public static class PricingPercentageValue extends AbstractResponse implements PricingValue { - public PricingPercentageValue() { + public static class ProductOption extends AbstractResponse implements Node { + public ProductOption() { } - public PricingPercentageValue(JsonObject fields) throws SchemaViolationError { + public ProductOption(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "percentage": { - responseData.put(key, jsonAsDouble(field.getValue(), key)); + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "values": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + responseData.put(key, list1); break; } @@ -50072,77 +57444,125 @@ public PricingPercentageValue(JsonObject fields) throws SchemaViolationError { } } + public ProductOption(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "PricingPercentageValue"; + return "ProductOption"; } /** - * The percentage value of the object. + * A globally-unique identifier. */ - public Double getPercentage() { - return (Double) get("percentage"); + public ID getId() { + return (ID) get("id"); } - public PricingPercentageValue setPercentage(Double arg) { - optimisticData.put(getKey("percentage"), arg); + /** + * The product option’s name. + */ + + public String getName() { + return (String) get("name"); + } + + public ProductOption setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } + + /** + * The corresponding value to the product option name. + */ + + public List getValues() { + return (List) get("values"); + } + + public ProductOption setValues(List arg) { + optimisticData.put(getKey("values"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "percentage": return false; + case "id": return false; + + case "name": return false; + + case "values": return false; default: return false; } } } - public interface PricingValueQueryDefinition { - void define(PricingValueQuery _queryBuilder); + public interface ProductPriceRangeQueryDefinition { + void define(ProductPriceRangeQuery _queryBuilder); } /** - * The price value (fixed or percentage) for a discount application. + * The price range of the product. */ - public static class PricingValueQuery extends Query { - PricingValueQuery(StringBuilder _queryBuilder) { + public static class ProductPriceRangeQuery extends Query { + ProductPriceRangeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("__typename"); } - public PricingValueQuery onMoneyV2(MoneyV2QueryDefinition queryDef) { - startInlineFragment("MoneyV2"); + /** + * The highest variant's price. + */ + public ProductPriceRangeQuery maxVariantPrice(MoneyV2QueryDefinition queryDef) { + startField("maxVariantPrice"); + + _queryBuilder.append('{'); queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); + return this; } - public PricingValueQuery onPricingPercentageValue(PricingPercentageValueQueryDefinition queryDef) { - startInlineFragment("PricingPercentageValue"); - queryDef.define(new PricingPercentageValueQuery(_queryBuilder)); + /** + * The lowest variant's price. + */ + public ProductPriceRangeQuery minVariantPrice(MoneyV2QueryDefinition queryDef) { + startField("minVariantPrice"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); + return this; } } - public interface PricingValue { - String getGraphQlTypeName(); - } - /** - * The price value (fixed or percentage) for a discount application. + * The price range of the product. */ - public static class UnknownPricingValue extends AbstractResponse implements PricingValue { - public UnknownPricingValue() { + public static class ProductPriceRange extends AbstractResponse { + public ProductPriceRange() { } - public UnknownPricingValue(JsonObject fields) throws SchemaViolationError { + public ProductPriceRange(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { + case "maxVariantPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "minVariantPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -50154,450 +57574,329 @@ public UnknownPricingValue(JsonObject fields) throws SchemaViolationError { } } - public static PricingValue create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "MoneyV2": { - return new MoneyV2(fields); - } + public String getGraphQlTypeName() { + return "ProductPriceRange"; + } - case "PricingPercentageValue": { - return new PricingPercentageValue(fields); - } + /** + * The highest variant's price. + */ - default: { - return new UnknownPricingValue(fields); - } - } + public MoneyV2 getMaxVariantPrice() { + return (MoneyV2) get("maxVariantPrice"); } - public String getGraphQlTypeName() { - return (String) get("__typename"); + public ProductPriceRange setMaxVariantPrice(MoneyV2 arg) { + optimisticData.put(getKey("maxVariantPrice"), arg); + return this; + } + + /** + * The lowest variant's price. + */ + + public MoneyV2 getMinVariantPrice() { + return (MoneyV2) get("minVariantPrice"); + } + + public ProductPriceRange setMinVariantPrice(MoneyV2 arg) { + optimisticData.put(getKey("minVariantPrice"), arg); + return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { + case "maxVariantPrice": return true; + + case "minVariantPrice": return true; + default: return false; } } } - public interface ProductQueryDefinition { - void define(ProductQuery _queryBuilder); - } - /** - * A product represents an individual item for sale in a Shopify store. Products are often physical, - * but they don't have to be. - * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, - * as do services (such as equipment rental, work for hire, customization of another product or an - * extended warranty). + * The recommendation intent that is used to generate product recommendations. + * You can use intent to generate product recommendations according to different strategies. */ - public static class ProductQuery extends Query { - ProductQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - - startField("id"); - } + public enum ProductRecommendationIntent { + /** + * Offer customers products that are complementary to a product for which recommendations are to be + * fetched. An example is add-on products that display in a Pair it with section. + */ + COMPLEMENTARY, /** - * Indicates if at least one product variant is available for sale. + * Offer customers a mix of products that are similar or complementary to a product for which + * recommendations are to be fetched. An example is substitutable products that display in a You may + * also like section. */ - public ProductQuery availableForSale() { - startField("availableForSale"); + RELATED, - return this; - } + UNKNOWN_VALUE; - public class CollectionsArguments extends Arguments { - CollectionsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); + public static ProductRecommendationIntent fromGraphQl(String value) { + if (value == null) { + return null; } - /** - * Returns up to the first `n` elements from the list. - */ - public CollectionsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); + switch (value) { + case "COMPLEMENTARY": { + return COMPLEMENTARY; } - return this; - } - /** - * Returns the elements that come after the specified cursor. - */ - public CollectionsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "RELATED": { + return RELATED; } - return this; - } - /** - * Returns up to the last `n` elements from the list. - */ - public CollectionsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); + default: { + return UNKNOWN_VALUE; } - return this; } + } + public String toString() { + switch (this) { + case COMPLEMENTARY: { + return "COMPLEMENTARY"; + } - /** - * Returns the elements that come before the specified cursor. - */ - public CollectionsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case RELATED: { + return "RELATED"; } - return this; - } - /** - * Reverse the order of the underlying list. - */ - public CollectionsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); + default: { + return ""; } - return this; } } + } - public interface CollectionsArgumentsDefinition { - void define(CollectionsArguments args); - } - + /** + * The set of valid sort keys for the Product query. + */ + public enum ProductSortKeys { /** - * List of collections a product belongs to. + * Sort by the `best_selling` value. */ - public ProductQuery collections(CollectionConnectionQueryDefinition queryDef) { - return collections(args -> {}, queryDef); - } + BEST_SELLING, /** - * List of collections a product belongs to. + * Sort by the `created_at` value. */ - public ProductQuery collections(CollectionsArgumentsDefinition argsDef, CollectionConnectionQueryDefinition queryDef) { - startField("collections"); - - CollectionsArguments args = new CollectionsArguments(_queryBuilder); - argsDef.define(args); - CollectionsArguments.end(args); - - _queryBuilder.append('{'); - queryDef.define(new CollectionConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } + CREATED_AT, /** - * The compare at price of the product across all variants. + * Sort by the `id` value. */ - public ProductQuery compareAtPriceRange(ProductPriceRangeQueryDefinition queryDef) { - startField("compareAtPriceRange"); - - _queryBuilder.append('{'); - queryDef.define(new ProductPriceRangeQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } + ID, /** - * The date and time when the product was created. + * Sort by the `price` value. */ - public ProductQuery createdAt() { - startField("createdAt"); - - return this; - } - - public class DescriptionArguments extends Arguments { - DescriptionArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Truncates string after the given length. - */ - public DescriptionArguments truncateAt(Integer value) { - if (value != null) { - startArgument("truncateAt"); - _queryBuilder.append(value); - } - return this; - } - } - - public interface DescriptionArgumentsDefinition { - void define(DescriptionArguments args); - } + PRICE, /** - * Stripped description of the product, single line with HTML tags removed. + * Sort by the `product_type` value. */ - public ProductQuery description() { - return description(args -> {}); - } + PRODUCT_TYPE, /** - * Stripped description of the product, single line with HTML tags removed. + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. */ - public ProductQuery description(DescriptionArgumentsDefinition argsDef) { - startField("description"); - - DescriptionArguments args = new DescriptionArguments(_queryBuilder); - argsDef.define(args); - DescriptionArguments.end(args); - - return this; - } + RELEVANCE, /** - * The description of the product, complete with HTML formatting. + * Sort by the `title` value. */ - public ProductQuery descriptionHtml() { - startField("descriptionHtml"); - - return this; - } + TITLE, /** - * The featured image for the product. - * This field is functionally equivalent to `images(first: 1)`. + * Sort by the `updated_at` value. */ - public ProductQuery featuredImage(ImageQueryDefinition queryDef) { - startField("featuredImage"); - - _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } + UPDATED_AT, /** - * A human-friendly unique string for the Product automatically generated from its title. - * They are used by the Liquid templating language to refer to objects. + * Sort by the `vendor` value. */ - public ProductQuery handle() { - startField("handle"); + VENDOR, - return this; - } + UNKNOWN_VALUE; - public class ImagesArguments extends Arguments { - ImagesArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); + public static ProductSortKeys fromGraphQl(String value) { + if (value == null) { + return null; } - /** - * Returns up to the first `n` elements from the list. - */ - public ImagesArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); + switch (value) { + case "BEST_SELLING": { + return BEST_SELLING; } - return this; - } - /** - * Returns the elements that come after the specified cursor. - */ - public ImagesArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "CREATED_AT": { + return CREATED_AT; } - return this; - } - /** - * Returns up to the last `n` elements from the list. - */ - public ImagesArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); + case "ID": { + return ID; } - return this; - } - /** - * Returns the elements that come before the specified cursor. - */ - public ImagesArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "PRICE": { + return PRICE; } - return this; - } - /** - * Reverse the order of the underlying list. - */ - public ImagesArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); + case "PRODUCT_TYPE": { + return PRODUCT_TYPE; } - return this; - } - /** - * Sort the underlying list by the given key. - */ - public ImagesArguments sortKey(ProductImageSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); + case "RELEVANCE": { + return RELEVANCE; } - return this; - } - } - public interface ImagesArgumentsDefinition { - void define(ImagesArguments args); - } + case "TITLE": { + return TITLE; + } - /** - * List of images associated with the product. - */ - public ProductQuery images(ImageConnectionQueryDefinition queryDef) { - return images(args -> {}, queryDef); - } + case "UPDATED_AT": { + return UPDATED_AT; + } - /** - * List of images associated with the product. - */ - public ProductQuery images(ImagesArgumentsDefinition argsDef, ImageConnectionQueryDefinition queryDef) { - startField("images"); + case "VENDOR": { + return VENDOR; + } - ImagesArguments args = new ImagesArguments(_queryBuilder); - argsDef.define(args); - ImagesArguments.end(args); + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case BEST_SELLING: { + return "BEST_SELLING"; + } - _queryBuilder.append('{'); - queryDef.define(new ImageConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + case CREATED_AT: { + return "CREATED_AT"; + } - return this; - } + case ID: { + return "ID"; + } - /** - * Whether the product is a gift card. - */ - public ProductQuery isGiftCard() { - startField("isGiftCard"); + case PRICE: { + return "PRICE"; + } - return this; - } + case PRODUCT_TYPE: { + return "PRODUCT_TYPE"; + } - public class MediaArguments extends Arguments { - MediaArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + case RELEVANCE: { + return "RELEVANCE"; + } - /** - * Returns up to the first `n` elements from the list. - */ - public MediaArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); + case TITLE: { + return "TITLE"; } - return this; - } - /** - * Returns the elements that come after the specified cursor. - */ - public MediaArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case UPDATED_AT: { + return "UPDATED_AT"; } - return this; - } - /** - * Returns up to the last `n` elements from the list. - */ - public MediaArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); + case VENDOR: { + return "VENDOR"; } - return this; - } - /** - * Returns the elements that come before the specified cursor. - */ - public MediaArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); + default: { + return ""; } - return this; } + } + } + + public interface ProductVariantQueryDefinition { + void define(ProductVariantQuery _queryBuilder); + } + + /** + * A product variant represents a different version of a product, such as differing sizes or differing + * colors. + */ + public static class ProductVariantQuery extends Query { + ProductVariantQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); + } + + /** + * Indicates if the product variant is available for sale. + */ + public ProductVariantQuery availableForSale() { + startField("availableForSale"); - /** - * Reverse the order of the underlying list. - */ - public MediaArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + return this; + } - /** - * Sort the underlying list by the given key. - */ - public MediaArguments sortKey(ProductMediaSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; - } + /** + * The barcode (for example, ISBN, UPC, or GTIN) associated with the variant. + */ + public ProductVariantQuery barcode() { + startField("barcode"); + + return this; } - public interface MediaArgumentsDefinition { - void define(MediaArguments args); + /** + * The compare at price of the variant. This can be used to mark a variant as on sale, when + * `compareAtPrice` is higher than `price`. + */ + public ProductVariantQuery compareAtPrice(MoneyV2QueryDefinition queryDef) { + startField("compareAtPrice"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * The media associated with the product. + * The compare at price of the variant. This can be used to mark a variant as on sale, when + * `compareAtPriceV2` is higher than `priceV2`. + * + * @deprecated Use `compareAtPrice` instead. */ - public ProductQuery media(MediaConnectionQueryDefinition queryDef) { - return media(args -> {}, queryDef); + @Deprecated + public ProductVariantQuery compareAtPriceV2(MoneyV2QueryDefinition queryDef) { + startField("compareAtPriceV2"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * The media associated with the product. + * Whether a product is out of stock but still available for purchase (used for backorders). */ - public ProductQuery media(MediaArgumentsDefinition argsDef, MediaConnectionQueryDefinition queryDef) { - startField("media"); + public ProductVariantQuery currentlyNotInStock() { + startField("currentlyNotInStock"); - MediaArguments args = new MediaArguments(_queryBuilder); - argsDef.define(args); - MediaArguments.end(args); + return this; + } + + /** + * Image associated with the product variant. This field falls back to the product image if no image is + * available. + */ + public ProductVariantQuery image(ImageQueryDefinition queryDef) { + startField("image"); _queryBuilder.append('{'); - queryDef.define(new MediaConnectionQuery(_queryBuilder)); + queryDef.define(new ImageQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -50606,7 +57905,7 @@ public ProductQuery media(MediaArgumentsDefinition argsDef, MediaConnectionQuery /** * Returns a metafield found by namespace and key. */ - public ProductQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { + public ProductVariantQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { startField("metafield"); _queryBuilder.append("(namespace:"); @@ -50627,7 +57926,7 @@ public ProductQuery metafield(String namespace, String key, MetafieldQueryDefini /** * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public ProductQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + public ProductVariantQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { startField("metafields"); _queryBuilder.append("(identifiers:"); @@ -50652,109 +57951,88 @@ public ProductQuery metafields(List identifiers, Metafi } /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. + * The product variant’s price. */ - public ProductQuery onlineStoreUrl() { - startField("onlineStoreUrl"); - - return this; - } - - public class OptionsArguments extends Arguments { - OptionsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Truncate the array result to this size. - */ - public OptionsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - } + public ProductVariantQuery price(MoneyV2QueryDefinition queryDef) { + startField("price"); - public interface OptionsArgumentsDefinition { - void define(OptionsArguments args); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - /** - * List of product options. - */ - public ProductQuery options(ProductOptionQueryDefinition queryDef) { - return options(args -> {}, queryDef); + return this; } /** - * List of product options. + * The product variant’s price. + * + * @deprecated Use `price` instead. */ - public ProductQuery options(OptionsArgumentsDefinition argsDef, ProductOptionQueryDefinition queryDef) { - startField("options"); - - OptionsArguments args = new OptionsArguments(_queryBuilder); - argsDef.define(args); - OptionsArguments.end(args); + @Deprecated + public ProductVariantQuery priceV2(MoneyV2QueryDefinition queryDef) { + startField("priceV2"); _queryBuilder.append('{'); - queryDef.define(new ProductOptionQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The price range. + * The product object that the product variant belongs to. */ - public ProductQuery priceRange(ProductPriceRangeQueryDefinition queryDef) { - startField("priceRange"); + public ProductVariantQuery product(ProductQueryDefinition queryDef) { + startField("product"); _queryBuilder.append('{'); - queryDef.define(new ProductPriceRangeQuery(_queryBuilder)); + queryDef.define(new ProductQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A categorization that a product can be tagged with, commonly used for filtering and searching. + * The total sellable quantity of the variant for online sales channels. */ - public ProductQuery productType() { - startField("productType"); + public ProductVariantQuery quantityAvailable() { + startField("quantityAvailable"); return this; } /** - * The date and time when the product was published to the channel. + * Whether a customer needs to provide a shipping address when placing an order for the product + * variant. */ - public ProductQuery publishedAt() { - startField("publishedAt"); + public ProductVariantQuery requiresShipping() { + startField("requiresShipping"); return this; } /** - * Whether the product can only be purchased with a selling plan. + * List of product options applied to the variant. */ - public ProductQuery requiresSellingPlan() { - startField("requiresSellingPlan"); + public ProductVariantQuery selectedOptions(SelectedOptionQueryDefinition queryDef) { + startField("selectedOptions"); + + _queryBuilder.append('{'); + queryDef.define(new SelectedOptionQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - public class SellingPlanGroupsArguments extends Arguments { - SellingPlanGroupsArguments(StringBuilder _queryBuilder) { + public class SellingPlanAllocationsArguments extends Arguments { + SellingPlanAllocationsArguments(StringBuilder _queryBuilder) { super(_queryBuilder, true); } /** * Returns up to the first `n` elements from the list. */ - public SellingPlanGroupsArguments first(Integer value) { + public SellingPlanAllocationsArguments first(Integer value) { if (value != null) { startArgument("first"); _queryBuilder.append(value); @@ -50765,7 +58043,7 @@ public SellingPlanGroupsArguments first(Integer value) { /** * Returns the elements that come after the specified cursor. */ - public SellingPlanGroupsArguments after(String value) { + public SellingPlanAllocationsArguments after(String value) { if (value != null) { startArgument("after"); Query.appendQuotedString(_queryBuilder, value.toString()); @@ -50776,7 +58054,7 @@ public SellingPlanGroupsArguments after(String value) { /** * Returns up to the last `n` elements from the list. */ - public SellingPlanGroupsArguments last(Integer value) { + public SellingPlanAllocationsArguments last(Integer value) { if (value != null) { startArgument("last"); _queryBuilder.append(value); @@ -50787,7 +58065,7 @@ public SellingPlanGroupsArguments last(Integer value) { /** * Returns the elements that come before the specified cursor. */ - public SellingPlanGroupsArguments before(String value) { + public SellingPlanAllocationsArguments before(String value) { if (value != null) { startArgument("before"); Query.appendQuotedString(_queryBuilder, value.toString()); @@ -50798,7 +58076,7 @@ public SellingPlanGroupsArguments before(String value) { /** * Reverse the order of the underlying list. */ - public SellingPlanGroupsArguments reverse(Boolean value) { + public SellingPlanAllocationsArguments reverse(Boolean value) { if (value != null) { startArgument("reverse"); _queryBuilder.append(value); @@ -50807,129 +58085,54 @@ public SellingPlanGroupsArguments reverse(Boolean value) { } } - public interface SellingPlanGroupsArgumentsDefinition { - void define(SellingPlanGroupsArguments args); + public interface SellingPlanAllocationsArgumentsDefinition { + void define(SellingPlanAllocationsArguments args); } /** - * A list of a product's available selling plan groups. A selling plan group represents a selling - * method. For example, 'Subscribe and save' is a selling method where customers pay for goods or - * services per delivery. A selling plan group contains individual selling plans. + * Represents an association between a variant and a selling plan. Selling plan allocations describe + * which selling plans are available for each variant, and what their impact is on pricing. */ - public ProductQuery sellingPlanGroups(SellingPlanGroupConnectionQueryDefinition queryDef) { - return sellingPlanGroups(args -> {}, queryDef); + public ProductVariantQuery sellingPlanAllocations(SellingPlanAllocationConnectionQueryDefinition queryDef) { + return sellingPlanAllocations(args -> {}, queryDef); } /** - * A list of a product's available selling plan groups. A selling plan group represents a selling - * method. For example, 'Subscribe and save' is a selling method where customers pay for goods or - * services per delivery. A selling plan group contains individual selling plans. + * Represents an association between a variant and a selling plan. Selling plan allocations describe + * which selling plans are available for each variant, and what their impact is on pricing. */ - public ProductQuery sellingPlanGroups(SellingPlanGroupsArgumentsDefinition argsDef, SellingPlanGroupConnectionQueryDefinition queryDef) { - startField("sellingPlanGroups"); + public ProductVariantQuery sellingPlanAllocations(SellingPlanAllocationsArgumentsDefinition argsDef, SellingPlanAllocationConnectionQueryDefinition queryDef) { + startField("sellingPlanAllocations"); - SellingPlanGroupsArguments args = new SellingPlanGroupsArguments(_queryBuilder); + SellingPlanAllocationsArguments args = new SellingPlanAllocationsArguments(_queryBuilder); argsDef.define(args); - SellingPlanGroupsArguments.end(args); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanGroupConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The product's SEO information. - */ - public ProductQuery seo(SEOQueryDefinition queryDef) { - startField("seo"); + SellingPlanAllocationsArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new SEOQuery(_queryBuilder)); + queryDef.define(new SellingPlanAllocationConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A comma separated list of tags that have been added to the product. - * Additional access scope required for private apps: unauthenticated_read_product_tags. - */ - public ProductQuery tags() { - startField("tags"); - - return this; - } - - /** - * The product’s title. - */ - public ProductQuery title() { - startField("title"); - - return this; - } - - /** - * The total quantity of inventory in stock for this Product. - */ - public ProductQuery totalInventory() { - startField("totalInventory"); - - return this; - } - - /** - * The date and time when the product was last modified. - * A product's `updatedAt` value can change for different reasons. For example, if an order - * is placed for a product that has inventory tracking set up, then the inventory adjustment - * is counted as an update. - */ - public ProductQuery updatedAt() { - startField("updatedAt"); - - return this; - } - - /** - * Find a product’s variant based on its selected options. - * This is useful for converting a user’s selection of product options into a single matching variant. - * If there is not a variant for the selected options, `null` will be returned. + * The SKU (stock keeping unit) associated with the variant. */ - public ProductQuery variantBySelectedOptions(List selectedOptions, ProductVariantQueryDefinition queryDef) { - startField("variantBySelectedOptions"); - - _queryBuilder.append("(selectedOptions:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (SelectedOptionInput item1 : selectedOptions) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new ProductVariantQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ProductVariantQuery sku() { + startField("sku"); return this; } - public class VariantsArguments extends Arguments { - VariantsArguments(StringBuilder _queryBuilder) { + public class StoreAvailabilityArguments extends Arguments { + StoreAvailabilityArguments(StringBuilder _queryBuilder) { super(_queryBuilder, true); } /** * Returns up to the first `n` elements from the list. */ - public VariantsArguments first(Integer value) { + public StoreAvailabilityArguments first(Integer value) { if (value != null) { startArgument("first"); _queryBuilder.append(value); @@ -50940,7 +58143,7 @@ public VariantsArguments first(Integer value) { /** * Returns the elements that come after the specified cursor. */ - public VariantsArguments after(String value) { + public StoreAvailabilityArguments after(String value) { if (value != null) { startArgument("after"); Query.appendQuotedString(_queryBuilder, value.toString()); @@ -50951,7 +58154,7 @@ public VariantsArguments after(String value) { /** * Returns up to the last `n` elements from the list. */ - public VariantsArguments last(Integer value) { + public StoreAvailabilityArguments last(Integer value) { if (value != null) { startArgument("last"); _queryBuilder.append(value); @@ -50962,7 +58165,7 @@ public VariantsArguments last(Integer value) { /** * Returns the elements that come before the specified cursor. */ - public VariantsArguments before(String value) { + public StoreAvailabilityArguments before(String value) { if (value != null) { startArgument("before"); Query.appendQuotedString(_queryBuilder, value.toString()); @@ -50973,7 +58176,7 @@ public VariantsArguments before(String value) { /** * Reverse the order of the underlying list. */ - public VariantsArguments reverse(Boolean value) { + public StoreAvailabilityArguments reverse(Boolean value) { if (value != null) { startArgument("reverse"); _queryBuilder.append(value); @@ -50982,67 +58185,108 @@ public VariantsArguments reverse(Boolean value) { } /** - * Sort the underlying list by the given key. + * Used to sort results based on proximity to the provided location. */ - public VariantsArguments sortKey(ProductVariantSortKeys value) { + public StoreAvailabilityArguments near(GeoCoordinateInput value) { if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); + startArgument("near"); + value.appendTo(_queryBuilder); } return this; } } - public interface VariantsArgumentsDefinition { - void define(VariantsArguments args); + public interface StoreAvailabilityArgumentsDefinition { + void define(StoreAvailabilityArguments args); } /** - * List of the product’s variants. + * The in-store pickup availability of this variant by location. */ - public ProductQuery variants(ProductVariantConnectionQueryDefinition queryDef) { - return variants(args -> {}, queryDef); + public ProductVariantQuery storeAvailability(StoreAvailabilityConnectionQueryDefinition queryDef) { + return storeAvailability(args -> {}, queryDef); } /** - * List of the product’s variants. + * The in-store pickup availability of this variant by location. */ - public ProductQuery variants(VariantsArgumentsDefinition argsDef, ProductVariantConnectionQueryDefinition queryDef) { - startField("variants"); + public ProductVariantQuery storeAvailability(StoreAvailabilityArgumentsDefinition argsDef, StoreAvailabilityConnectionQueryDefinition queryDef) { + startField("storeAvailability"); - VariantsArguments args = new VariantsArguments(_queryBuilder); + StoreAvailabilityArguments args = new StoreAvailabilityArguments(_queryBuilder); argsDef.define(args); - VariantsArguments.end(args); + StoreAvailabilityArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new ProductVariantConnectionQuery(_queryBuilder)); + queryDef.define(new StoreAvailabilityConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The product’s vendor name. + * The product variant’s title. */ - public ProductQuery vendor() { - startField("vendor"); + public ProductVariantQuery title() { + startField("title"); + + return this; + } + + /** + * The unit price value for the variant based on the variant's measurement. + */ + public ProductVariantQuery unitPrice(MoneyV2QueryDefinition queryDef) { + startField("unitPrice"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The unit price measurement for the variant. + */ + public ProductVariantQuery unitPriceMeasurement(UnitPriceMeasurementQueryDefinition queryDef) { + startField("unitPriceMeasurement"); + + _queryBuilder.append('{'); + queryDef.define(new UnitPriceMeasurementQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The weight of the product variant in the unit system specified with `weight_unit`. + */ + public ProductVariantQuery weight() { + startField("weight"); + + return this; + } + + /** + * Unit of measurement for weight. + */ + public ProductVariantQuery weightUnit() { + startField("weightUnit"); return this; } } /** - * A product represents an individual item for sale in a Shopify store. Products are often physical, - * but they don't have to be. - * For example, a digital download (such as a movie, music or ebook file) also qualifies as a product, - * as do services (such as equipment rental, work for hire, customization of another product or an - * extended warranty). + * A product variant represents a different version of a product, such as differing sizes or differing + * colors. */ - public static class Product extends AbstractResponse implements HasMetafields, MetafieldParentResource, MetafieldReference, Node, OnlineStorePublishable { - public Product() { + public static class ProductVariant extends AbstractResponse implements HasMetafields, Merchandise, MetafieldParentResource, MetafieldReference, Node { + public ProductVariant() { } - public Product(JsonObject fields) throws SchemaViolationError { + public ProductVariant(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -51053,40 +58297,32 @@ public Product(JsonObject fields) throws SchemaViolationError { break; } - case "collections": { - responseData.put(key, new CollectionConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "compareAtPriceRange": { - responseData.put(key, new ProductPriceRange(jsonAsObject(field.getValue(), key))); - - break; - } + case "barcode": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "createdAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + responseData.put(key, optional1); break; } - case "description": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } + case "compareAtPrice": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } - case "descriptionHtml": { - responseData.put(key, jsonAsString(field.getValue(), key)); + responseData.put(key, optional1); break; } - case "featuredImage": { - Image optional1 = null; + case "compareAtPriceV2": { + MoneyV2 optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -51094,8 +58330,8 @@ public Product(JsonObject fields) throws SchemaViolationError { break; } - case "handle": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "currentlyNotInStock": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } @@ -51106,20 +58342,13 @@ public Product(JsonObject fields) throws SchemaViolationError { break; } - case "images": { - responseData.put(key, new ImageConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "isGiftCard": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } + case "image": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); + } - case "media": { - responseData.put(key, new MediaConnection(jsonAsObject(field.getValue(), key))); + responseData.put(key, optional1); break; } @@ -51151,71 +58380,71 @@ public Product(JsonObject fields) throws SchemaViolationError { break; } - case "onlineStoreUrl": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "price": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "options": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ProductOption(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "priceV2": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "priceRange": { - responseData.put(key, new ProductPriceRange(jsonAsObject(field.getValue(), key))); + case "product": { + responseData.put(key, new Product(jsonAsObject(field.getValue(), key))); break; } - case "productType": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "quantityAvailable": { + Integer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsInteger(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "publishedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + case "requiresShipping": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } - case "requiresSellingPlan": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + case "selectedOptions": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SelectedOption(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } - case "sellingPlanGroups": { - responseData.put(key, new SellingPlanGroupConnection(jsonAsObject(field.getValue(), key))); + case "sellingPlanAllocations": { + responseData.put(key, new SellingPlanAllocationConnection(jsonAsObject(field.getValue(), key))); break; } - case "seo": { - responseData.put(key, new SEO(jsonAsObject(field.getValue(), key))); + case "sku": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "tags": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } - - responseData.put(key, list1); + case "storeAvailability": { + responseData.put(key, new StoreAvailabilityConnection(jsonAsObject(field.getValue(), key))); break; } @@ -51226,10 +58455,10 @@ public Product(JsonObject fields) throws SchemaViolationError { break; } - case "totalInventory": { - Integer optional1 = null; + case "unitPrice": { + MoneyV2 optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -51237,16 +58466,10 @@ public Product(JsonObject fields) throws SchemaViolationError { break; } - case "updatedAt": { - responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - - break; - } - - case "variantBySelectedOptions": { - ProductVariant optional1 = null; + case "unitPriceMeasurement": { + UnitPriceMeasurement optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new ProductVariant(jsonAsObject(field.getValue(), key)); + optional1 = new UnitPriceMeasurement(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -51254,14 +58477,19 @@ public Product(JsonObject fields) throws SchemaViolationError { break; } - case "variants": { - responseData.put(key, new ProductVariantConnection(jsonAsObject(field.getValue(), key))); + case "weight": { + Double optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsDouble(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "vendor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "weightUnit": { + responseData.put(key, WeightUnit.fromGraphQl(jsonAsString(field.getValue(), key))); break; } @@ -51277,118 +58505,81 @@ public Product(JsonObject fields) throws SchemaViolationError { } } - public Product(ID id) { + public ProductVariant(ID id) { this(); optimisticData.put("id", id); } public String getGraphQlTypeName() { - return "Product"; + return "ProductVariant"; } /** - * Indicates if at least one product variant is available for sale. + * Indicates if the product variant is available for sale. */ public Boolean getAvailableForSale() { return (Boolean) get("availableForSale"); } - public Product setAvailableForSale(Boolean arg) { + public ProductVariant setAvailableForSale(Boolean arg) { optimisticData.put(getKey("availableForSale"), arg); return this; } /** - * List of collections a product belongs to. - */ - - public CollectionConnection getCollections() { - return (CollectionConnection) get("collections"); - } - - public Product setCollections(CollectionConnection arg) { - optimisticData.put(getKey("collections"), arg); - return this; - } - - /** - * The compare at price of the product across all variants. - */ - - public ProductPriceRange getCompareAtPriceRange() { - return (ProductPriceRange) get("compareAtPriceRange"); - } - - public Product setCompareAtPriceRange(ProductPriceRange arg) { - optimisticData.put(getKey("compareAtPriceRange"), arg); - return this; - } - - /** - * The date and time when the product was created. - */ - - public DateTime getCreatedAt() { - return (DateTime) get("createdAt"); - } - - public Product setCreatedAt(DateTime arg) { - optimisticData.put(getKey("createdAt"), arg); - return this; - } - - /** - * Stripped description of the product, single line with HTML tags removed. + * The barcode (for example, ISBN, UPC, or GTIN) associated with the variant. */ - public String getDescription() { - return (String) get("description"); + public String getBarcode() { + return (String) get("barcode"); } - public Product setDescription(String arg) { - optimisticData.put(getKey("description"), arg); + public ProductVariant setBarcode(String arg) { + optimisticData.put(getKey("barcode"), arg); return this; } /** - * The description of the product, complete with HTML formatting. + * The compare at price of the variant. This can be used to mark a variant as on sale, when + * `compareAtPrice` is higher than `price`. */ - public String getDescriptionHtml() { - return (String) get("descriptionHtml"); + public MoneyV2 getCompareAtPrice() { + return (MoneyV2) get("compareAtPrice"); } - public Product setDescriptionHtml(String arg) { - optimisticData.put(getKey("descriptionHtml"), arg); + public ProductVariant setCompareAtPrice(MoneyV2 arg) { + optimisticData.put(getKey("compareAtPrice"), arg); return this; } /** - * The featured image for the product. - * This field is functionally equivalent to `images(first: 1)`. + * The compare at price of the variant. This can be used to mark a variant as on sale, when + * `compareAtPriceV2` is higher than `priceV2`. + * + * @deprecated Use `compareAtPrice` instead. */ - public Image getFeaturedImage() { - return (Image) get("featuredImage"); + public MoneyV2 getCompareAtPriceV2() { + return (MoneyV2) get("compareAtPriceV2"); } - public Product setFeaturedImage(Image arg) { - optimisticData.put(getKey("featuredImage"), arg); + public ProductVariant setCompareAtPriceV2(MoneyV2 arg) { + optimisticData.put(getKey("compareAtPriceV2"), arg); return this; } /** - * A human-friendly unique string for the Product automatically generated from its title. - * They are used by the Liquid templating language to refer to objects. + * Whether a product is out of stock but still available for purchase (used for backorders). */ - public String getHandle() { - return (String) get("handle"); + public Boolean getCurrentlyNotInStock() { + return (Boolean) get("currentlyNotInStock"); } - public Product setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); + public ProductVariant setCurrentlyNotInStock(Boolean arg) { + optimisticData.put(getKey("currentlyNotInStock"), arg); return this; } @@ -51401,41 +58592,16 @@ public ID getId() { } /** - * List of images associated with the product. - */ - - public ImageConnection getImages() { - return (ImageConnection) get("images"); - } - - public Product setImages(ImageConnection arg) { - optimisticData.put(getKey("images"), arg); - return this; - } - - /** - * Whether the product is a gift card. - */ - - public Boolean getIsGiftCard() { - return (Boolean) get("isGiftCard"); - } - - public Product setIsGiftCard(Boolean arg) { - optimisticData.put(getKey("isGiftCard"), arg); - return this; - } - - /** - * The media associated with the product. + * Image associated with the product variant. This field falls back to the product image if no image is + * available. */ - public MediaConnection getMedia() { - return (MediaConnection) get("media"); + public Image getImage() { + return (Image) get("image"); } - public Product setMedia(MediaConnection arg) { - optimisticData.put(getKey("media"), arg); + public ProductVariant setImage(Image arg) { + optimisticData.put(getKey("image"), arg); return this; } @@ -51447,7 +58613,7 @@ public Metafield getMetafield() { return (Metafield) get("metafield"); } - public Product setMetafield(Metafield arg) { + public ProductVariant setMetafield(Metafield arg) { optimisticData.put(getKey("metafield"), arg); return this; } @@ -51460,212 +58626,194 @@ public List getMetafields() { return (List) get("metafields"); } - public Product setMetafields(List arg) { + public ProductVariant setMetafields(List arg) { optimisticData.put(getKey("metafields"), arg); return this; } /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. + * The product variant’s price. */ - public String getOnlineStoreUrl() { - return (String) get("onlineStoreUrl"); + public MoneyV2 getPrice() { + return (MoneyV2) get("price"); } - public Product setOnlineStoreUrl(String arg) { - optimisticData.put(getKey("onlineStoreUrl"), arg); + public ProductVariant setPrice(MoneyV2 arg) { + optimisticData.put(getKey("price"), arg); return this; } /** - * List of product options. + * The product variant’s price. + * + * @deprecated Use `price` instead. */ - public List getOptions() { - return (List) get("options"); + public MoneyV2 getPriceV2() { + return (MoneyV2) get("priceV2"); } - public Product setOptions(List arg) { - optimisticData.put(getKey("options"), arg); + public ProductVariant setPriceV2(MoneyV2 arg) { + optimisticData.put(getKey("priceV2"), arg); return this; } /** - * The price range. + * The product object that the product variant belongs to. */ - public ProductPriceRange getPriceRange() { - return (ProductPriceRange) get("priceRange"); + public Product getProduct() { + return (Product) get("product"); } - public Product setPriceRange(ProductPriceRange arg) { - optimisticData.put(getKey("priceRange"), arg); + public ProductVariant setProduct(Product arg) { + optimisticData.put(getKey("product"), arg); return this; } /** - * A categorization that a product can be tagged with, commonly used for filtering and searching. + * The total sellable quantity of the variant for online sales channels. */ - public String getProductType() { - return (String) get("productType"); + public Integer getQuantityAvailable() { + return (Integer) get("quantityAvailable"); } - public Product setProductType(String arg) { - optimisticData.put(getKey("productType"), arg); + public ProductVariant setQuantityAvailable(Integer arg) { + optimisticData.put(getKey("quantityAvailable"), arg); return this; } /** - * The date and time when the product was published to the channel. + * Whether a customer needs to provide a shipping address when placing an order for the product + * variant. */ - public DateTime getPublishedAt() { - return (DateTime) get("publishedAt"); + public Boolean getRequiresShipping() { + return (Boolean) get("requiresShipping"); } - public Product setPublishedAt(DateTime arg) { - optimisticData.put(getKey("publishedAt"), arg); + public ProductVariant setRequiresShipping(Boolean arg) { + optimisticData.put(getKey("requiresShipping"), arg); return this; } /** - * Whether the product can only be purchased with a selling plan. + * List of product options applied to the variant. */ - public Boolean getRequiresSellingPlan() { - return (Boolean) get("requiresSellingPlan"); + public List getSelectedOptions() { + return (List) get("selectedOptions"); } - public Product setRequiresSellingPlan(Boolean arg) { - optimisticData.put(getKey("requiresSellingPlan"), arg); + public ProductVariant setSelectedOptions(List arg) { + optimisticData.put(getKey("selectedOptions"), arg); return this; } /** - * A list of a product's available selling plan groups. A selling plan group represents a selling - * method. For example, 'Subscribe and save' is a selling method where customers pay for goods or - * services per delivery. A selling plan group contains individual selling plans. + * Represents an association between a variant and a selling plan. Selling plan allocations describe + * which selling plans are available for each variant, and what their impact is on pricing. */ - public SellingPlanGroupConnection getSellingPlanGroups() { - return (SellingPlanGroupConnection) get("sellingPlanGroups"); + public SellingPlanAllocationConnection getSellingPlanAllocations() { + return (SellingPlanAllocationConnection) get("sellingPlanAllocations"); } - public Product setSellingPlanGroups(SellingPlanGroupConnection arg) { - optimisticData.put(getKey("sellingPlanGroups"), arg); + public ProductVariant setSellingPlanAllocations(SellingPlanAllocationConnection arg) { + optimisticData.put(getKey("sellingPlanAllocations"), arg); return this; } /** - * The product's SEO information. + * The SKU (stock keeping unit) associated with the variant. */ - public SEO getSeo() { - return (SEO) get("seo"); + public String getSku() { + return (String) get("sku"); } - public Product setSeo(SEO arg) { - optimisticData.put(getKey("seo"), arg); + public ProductVariant setSku(String arg) { + optimisticData.put(getKey("sku"), arg); return this; } /** - * A comma separated list of tags that have been added to the product. - * Additional access scope required for private apps: unauthenticated_read_product_tags. + * The in-store pickup availability of this variant by location. */ - public List getTags() { - return (List) get("tags"); + public StoreAvailabilityConnection getStoreAvailability() { + return (StoreAvailabilityConnection) get("storeAvailability"); } - public Product setTags(List arg) { - optimisticData.put(getKey("tags"), arg); + public ProductVariant setStoreAvailability(StoreAvailabilityConnection arg) { + optimisticData.put(getKey("storeAvailability"), arg); return this; } /** - * The product’s title. + * The product variant’s title. */ public String getTitle() { return (String) get("title"); } - public Product setTitle(String arg) { + public ProductVariant setTitle(String arg) { optimisticData.put(getKey("title"), arg); return this; } /** - * The total quantity of inventory in stock for this Product. - */ - - public Integer getTotalInventory() { - return (Integer) get("totalInventory"); - } - - public Product setTotalInventory(Integer arg) { - optimisticData.put(getKey("totalInventory"), arg); - return this; - } - - /** - * The date and time when the product was last modified. - * A product's `updatedAt` value can change for different reasons. For example, if an order - * is placed for a product that has inventory tracking set up, then the inventory adjustment - * is counted as an update. + * The unit price value for the variant based on the variant's measurement. */ - public DateTime getUpdatedAt() { - return (DateTime) get("updatedAt"); + public MoneyV2 getUnitPrice() { + return (MoneyV2) get("unitPrice"); } - public Product setUpdatedAt(DateTime arg) { - optimisticData.put(getKey("updatedAt"), arg); + public ProductVariant setUnitPrice(MoneyV2 arg) { + optimisticData.put(getKey("unitPrice"), arg); return this; } /** - * Find a product’s variant based on its selected options. - * This is useful for converting a user’s selection of product options into a single matching variant. - * If there is not a variant for the selected options, `null` will be returned. + * The unit price measurement for the variant. */ - public ProductVariant getVariantBySelectedOptions() { - return (ProductVariant) get("variantBySelectedOptions"); + public UnitPriceMeasurement getUnitPriceMeasurement() { + return (UnitPriceMeasurement) get("unitPriceMeasurement"); } - public Product setVariantBySelectedOptions(ProductVariant arg) { - optimisticData.put(getKey("variantBySelectedOptions"), arg); + public ProductVariant setUnitPriceMeasurement(UnitPriceMeasurement arg) { + optimisticData.put(getKey("unitPriceMeasurement"), arg); return this; } /** - * List of the product’s variants. + * The weight of the product variant in the unit system specified with `weight_unit`. */ - public ProductVariantConnection getVariants() { - return (ProductVariantConnection) get("variants"); + public Double getWeight() { + return (Double) get("weight"); } - public Product setVariants(ProductVariantConnection arg) { - optimisticData.put(getKey("variants"), arg); + public ProductVariant setWeight(Double arg) { + optimisticData.put(getKey("weight"), arg); return this; } /** - * The product’s vendor name. + * Unit of measurement for weight. */ - public String getVendor() { - return (String) get("vendor"); + public WeightUnit getWeightUnit() { + return (WeightUnit) get("weightUnit"); } - public Product setVendor(String arg) { - optimisticData.put(getKey("vendor"), arg); + public ProductVariant setWeightUnit(WeightUnit arg) { + optimisticData.put(getKey("weightUnit"), arg); return this; } @@ -51673,244 +58821,88 @@ public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "availableForSale": return false; - case "collections": return true; - - case "compareAtPriceRange": return true; - - case "createdAt": return false; - - case "description": return false; + case "barcode": return false; - case "descriptionHtml": return false; + case "compareAtPrice": return true; - case "featuredImage": return true; + case "compareAtPriceV2": return true; - case "handle": return false; + case "currentlyNotInStock": return false; case "id": return false; - case "images": return true; - - case "isGiftCard": return false; - - case "media": return true; + case "image": return true; case "metafield": return true; case "metafields": return true; - case "onlineStoreUrl": return false; + case "price": return true; - case "options": return true; + case "priceV2": return true; - case "priceRange": return true; + case "product": return true; - case "productType": return false; + case "quantityAvailable": return false; - case "publishedAt": return false; + case "requiresShipping": return false; - case "requiresSellingPlan": return false; + case "selectedOptions": return true; - case "sellingPlanGroups": return true; + case "sellingPlanAllocations": return true; - case "seo": return true; + case "sku": return false; - case "tags": return false; + case "storeAvailability": return true; case "title": return false; - case "totalInventory": return false; - - case "updatedAt": return false; - - case "variantBySelectedOptions": return true; - - case "variants": return true; - - case "vendor": return false; - - default: return false; - } - } - } - - /** - * The set of valid sort keys for the ProductCollection query. - */ - public enum ProductCollectionSortKeys { - /** - * Sort by the `best-selling` value. - */ - BEST_SELLING, - - /** - * Sort by the `collection-default` value. - */ - COLLECTION_DEFAULT, - - /** - * Sort by the `created` value. - */ - CREATED, - - /** - * Sort by the `id` value. - */ - ID, - - /** - * Sort by the `manual` value. - */ - MANUAL, - - /** - * Sort by the `price` value. - */ - PRICE, - - /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. - */ - RELEVANCE, - - /** - * Sort by the `title` value. - */ - TITLE, - - UNKNOWN_VALUE; - - public static ProductCollectionSortKeys fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "BEST_SELLING": { - return BEST_SELLING; - } - - case "COLLECTION_DEFAULT": { - return COLLECTION_DEFAULT; - } - - case "CREATED": { - return CREATED; - } - - case "ID": { - return ID; - } - - case "MANUAL": { - return MANUAL; - } - - case "PRICE": { - return PRICE; - } - - case "RELEVANCE": { - return RELEVANCE; - } - - case "TITLE": { - return TITLE; - } - - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case BEST_SELLING: { - return "BEST_SELLING"; - } - - case COLLECTION_DEFAULT: { - return "COLLECTION_DEFAULT"; - } - - case CREATED: { - return "CREATED"; - } - - case ID: { - return "ID"; - } - - case MANUAL: { - return "MANUAL"; - } - - case PRICE: { - return "PRICE"; - } + case "unitPrice": return true; - case RELEVANCE: { - return "RELEVANCE"; - } + case "unitPriceMeasurement": return true; - case TITLE: { - return "TITLE"; - } + case "weight": return false; - default: { - return ""; - } + case "weightUnit": return false; + + default: return false; } } } - public interface ProductConnectionQueryDefinition { - void define(ProductConnectionQuery _queryBuilder); + public interface ProductVariantConnectionQueryDefinition { + void define(ProductVariantConnectionQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple Products. + * An auto-generated type for paginating through multiple ProductVariants. */ - public static class ProductConnectionQuery extends Query { - ProductConnectionQuery(StringBuilder _queryBuilder) { + public static class ProductVariantConnectionQuery extends Query { + ProductVariantConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A list of edges. */ - public ProductConnectionQuery edges(ProductEdgeQueryDefinition queryDef) { + public ProductVariantConnectionQuery edges(ProductVariantEdgeQueryDefinition queryDef) { startField("edges"); _queryBuilder.append('{'); - queryDef.define(new ProductEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * A list of available filters. - */ - public ProductConnectionQuery filters(FilterQueryDefinition queryDef) { - startField("filters"); - - _queryBuilder.append('{'); - queryDef.define(new FilterQuery(_queryBuilder)); + queryDef.define(new ProductVariantEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in ProductEdge. + * A list of the nodes contained in ProductVariantEdge. */ - public ProductConnectionQuery nodes(ProductQueryDefinition queryDef) { + public ProductVariantConnectionQuery nodes(ProductVariantQueryDefinition queryDef) { startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new ProductQuery(_queryBuilder)); + queryDef.define(new ProductVariantQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -51919,7 +58911,7 @@ public ProductConnectionQuery nodes(ProductQueryDefinition queryDef) { /** * Information to aid in pagination. */ - public ProductConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + public ProductVariantConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { startField("pageInfo"); _queryBuilder.append('{'); @@ -51931,32 +58923,21 @@ public ProductConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { } /** - * An auto-generated type for paginating through multiple Products. + * An auto-generated type for paginating through multiple ProductVariants. */ - public static class ProductConnection extends AbstractResponse { - public ProductConnection() { + public static class ProductVariantConnection extends AbstractResponse { + public ProductVariantConnection() { } - public ProductConnection(JsonObject fields) throws SchemaViolationError { + public ProductVariantConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ProductEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "filters": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Filter(jsonAsObject(element1, key))); + list1.add(new ProductVariantEdge(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -51965,9 +58946,9 @@ public ProductConnection(JsonObject fields) throws SchemaViolationError { } case "nodes": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Product(jsonAsObject(element1, key))); + list1.add(new ProductVariant(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -51993,44 +58974,31 @@ public ProductConnection(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "ProductConnection"; + return "ProductVariantConnection"; } /** * A list of edges. */ - public List getEdges() { - return (List) get("edges"); + public List getEdges() { + return (List) get("edges"); } - public ProductConnection setEdges(List arg) { + public ProductVariantConnection setEdges(List arg) { optimisticData.put(getKey("edges"), arg); return this; } /** - * A list of available filters. - */ - - public List getFilters() { - return (List) get("filters"); - } - - public ProductConnection setFilters(List arg) { - optimisticData.put(getKey("filters"), arg); - return this; - } - - /** - * A list of the nodes contained in ProductEdge. + * A list of the nodes contained in ProductVariantEdge. */ - public List getNodes() { - return (List) get("nodes"); + public List getNodes() { + return (List) get("nodes"); } - public ProductConnection setNodes(List arg) { + public ProductVariantConnection setNodes(List arg) { optimisticData.put(getKey("nodes"), arg); return this; } @@ -52043,7 +59011,7 @@ public PageInfo getPageInfo() { return (PageInfo) get("pageInfo"); } - public ProductConnection setPageInfo(PageInfo arg) { + public ProductVariantConnection setPageInfo(PageInfo arg) { optimisticData.put(getKey("pageInfo"), arg); return this; } @@ -52052,8 +59020,6 @@ public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "edges": return true; - case "filters": return true; - case "nodes": return true; case "pageInfo": return true; @@ -52063,35 +59029,35 @@ public boolean unwrapsToObject(String key) { } } - public interface ProductEdgeQueryDefinition { - void define(ProductEdgeQuery _queryBuilder); + public interface ProductVariantEdgeQueryDefinition { + void define(ProductVariantEdgeQuery _queryBuilder); } /** - * An auto-generated type which holds one Product and a cursor during pagination. + * An auto-generated type which holds one ProductVariant and a cursor during pagination. */ - public static class ProductEdgeQuery extends Query { - ProductEdgeQuery(StringBuilder _queryBuilder) { + public static class ProductVariantEdgeQuery extends Query { + ProductVariantEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A cursor for use in pagination. */ - public ProductEdgeQuery cursor() { + public ProductVariantEdgeQuery cursor() { startField("cursor"); return this; } /** - * The item at the end of ProductEdge. + * The item at the end of ProductVariantEdge. */ - public ProductEdgeQuery node(ProductQueryDefinition queryDef) { + public ProductVariantEdgeQuery node(ProductVariantQueryDefinition queryDef) { startField("node"); _queryBuilder.append('{'); - queryDef.define(new ProductQuery(_queryBuilder)); + queryDef.define(new ProductVariantQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -52099,13 +59065,13 @@ public ProductEdgeQuery node(ProductQueryDefinition queryDef) { } /** - * An auto-generated type which holds one Product and a cursor during pagination. + * An auto-generated type which holds one ProductVariant and a cursor during pagination. */ - public static class ProductEdge extends AbstractResponse { - public ProductEdge() { + public static class ProductVariantEdge extends AbstractResponse { + public ProductVariantEdge() { } - public ProductEdge(JsonObject fields) throws SchemaViolationError { + public ProductVariantEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -52117,7 +59083,7 @@ public ProductEdge(JsonObject fields) throws SchemaViolationError { } case "node": { - responseData.put(key, new Product(jsonAsObject(field.getValue(), key))); + responseData.put(key, new ProductVariant(jsonAsObject(field.getValue(), key))); break; } @@ -52134,7 +59100,7 @@ public ProductEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "ProductEdge"; + return "ProductVariantEdge"; } /** @@ -52145,20 +59111,20 @@ public String getCursor() { return (String) get("cursor"); } - public ProductEdge setCursor(String arg) { + public ProductVariantEdge setCursor(String arg) { optimisticData.put(getKey("cursor"), arg); return this; } /** - * The item at the end of ProductEdge. + * The item at the end of ProductVariantEdge. */ - public Product getNode() { - return (Product) get("node"); + public ProductVariant getNode() { + return (ProductVariant) get("node"); } - public ProductEdge setNode(Product arg) { + public ProductVariantEdge setNode(ProductVariant arg) { optimisticData.put(getKey("node"), arg); return this; } @@ -52174,999 +59140,1357 @@ public boolean unwrapsToObject(String key) { } } - public static class ProductFilter implements Serializable { - private Input available = Input.undefined(); + /** + * The set of valid sort keys for the ProductVariant query. + */ + public enum ProductVariantSortKeys { + /** + * Sort by the `id` value. + */ + ID, - private Input variantOption = Input.undefined(); + /** + * Sort by the `position` value. + */ + POSITION, - private Input productType = Input.undefined(); + /** + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. + */ + RELEVANCE, - private Input productVendor = Input.undefined(); + /** + * Sort by the `sku` value. + */ + SKU, - private Input price = Input.undefined(); + /** + * Sort by the `title` value. + */ + TITLE, - private Input productMetafield = Input.undefined(); + UNKNOWN_VALUE; - private Input variantMetafield = Input.undefined(); + public static ProductVariantSortKeys fromGraphQl(String value) { + if (value == null) { + return null; + } - private Input tag = Input.undefined(); + switch (value) { + case "ID": { + return ID; + } - public Boolean getAvailable() { - return available.getValue(); - } + case "POSITION": { + return POSITION; + } - public Input getAvailableInput() { - return available; - } + case "RELEVANCE": { + return RELEVANCE; + } - public ProductFilter setAvailable(Boolean available) { - this.available = Input.optional(available); - return this; - } + case "SKU": { + return SKU; + } - public ProductFilter setAvailableInput(Input available) { - if (available == null) { - throw new IllegalArgumentException("Input can not be null"); + case "TITLE": { + return TITLE; + } + + default: { + return UNKNOWN_VALUE; + } } - this.available = available; - return this; } + public String toString() { + switch (this) { + case ID: { + return "ID"; + } - public VariantOptionFilter getVariantOption() { - return variantOption.getValue(); - } + case POSITION: { + return "POSITION"; + } - public Input getVariantOptionInput() { - return variantOption; - } + case RELEVANCE: { + return "RELEVANCE"; + } - public ProductFilter setVariantOption(VariantOptionFilter variantOption) { - this.variantOption = Input.optional(variantOption); - return this; - } + case SKU: { + return "SKU"; + } - public ProductFilter setVariantOptionInput(Input variantOption) { - if (variantOption == null) { - throw new IllegalArgumentException("Input can not be null"); + case TITLE: { + return "TITLE"; + } + + default: { + return ""; + } } - this.variantOption = variantOption; - return this; } + } - public String getProductType() { - return productType.getValue(); - } + public interface QueryRootQueryDefinition { + void define(QueryRootQuery _queryBuilder); + } - public Input getProductTypeInput() { - return productType; + /** + * The schema’s entry-point for queries. This acts as the public, top-level API from which all queries + * must start. + */ + public static class QueryRootQuery extends Query { + QueryRootQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } - public ProductFilter setProductType(String productType) { - this.productType = Input.optional(productType); - return this; - } + /** + * Fetch a specific Article by its ID. + */ + public QueryRootQuery article(ID id, ArticleQueryDefinition queryDef) { + startField("article"); - public ProductFilter setProductTypeInput(Input productType) { - if (productType == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.productType = productType; - return this; - } + _queryBuilder.append("(id:"); + Query.appendQuotedString(_queryBuilder, id.toString()); - public String getProductVendor() { - return productVendor.getValue(); - } + _queryBuilder.append(')'); - public Input getProductVendorInput() { - return productVendor; - } + _queryBuilder.append('{'); + queryDef.define(new ArticleQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ProductFilter setProductVendor(String productVendor) { - this.productVendor = Input.optional(productVendor); return this; } - public ProductFilter setProductVendorInput(Input productVendor) { - if (productVendor == null) { - throw new IllegalArgumentException("Input can not be null"); + public class ArticlesArguments extends Arguments { + ArticlesArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); } - this.productVendor = productVendor; - return this; - } - public PriceRangeFilter getPrice() { - return price.getValue(); - } - - public Input getPriceInput() { - return price; - } + /** + * Returns up to the first `n` elements from the list. + */ + public ArticlesArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - public ProductFilter setPrice(PriceRangeFilter price) { - this.price = Input.optional(price); - return this; - } + /** + * Returns the elements that come after the specified cursor. + */ + public ArticlesArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - public ProductFilter setPriceInput(Input price) { - if (price == null) { - throw new IllegalArgumentException("Input can not be null"); + /** + * Returns up to the last `n` elements from the list. + */ + public ArticlesArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; } - this.price = price; - return this; - } - public MetafieldFilter getProductMetafield() { - return productMetafield.getValue(); - } + /** + * Returns the elements that come before the specified cursor. + */ + public ArticlesArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - public Input getProductMetafieldInput() { - return productMetafield; - } + /** + * Reverse the order of the underlying list. + */ + public ArticlesArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } - public ProductFilter setProductMetafield(MetafieldFilter productMetafield) { - this.productMetafield = Input.optional(productMetafield); - return this; - } + /** + * Sort the underlying list by the given key. + */ + public ArticlesArguments sortKey(ArticleSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; + } - public ProductFilter setProductMetafieldInput(Input productMetafield) { - if (productMetafield == null) { - throw new IllegalArgumentException("Input can not be null"); + /** + * Supported filter parameters: + * - `author` + * - `blog_title` + * - `created_at` + * - `tag` + * - `tag_not` + * - `updated_at` + * See the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) + * for more information about using filters. + */ + public ArticlesArguments query(String value) { + if (value != null) { + startArgument("query"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; } - this.productMetafield = productMetafield; - return this; } - public MetafieldFilter getVariantMetafield() { - return variantMetafield.getValue(); + public interface ArticlesArgumentsDefinition { + void define(ArticlesArguments args); } - public Input getVariantMetafieldInput() { - return variantMetafield; + /** + * List of the shop's articles. + */ + public QueryRootQuery articles(ArticleConnectionQueryDefinition queryDef) { + return articles(args -> {}, queryDef); } - public ProductFilter setVariantMetafield(MetafieldFilter variantMetafield) { - this.variantMetafield = Input.optional(variantMetafield); + /** + * List of the shop's articles. + */ + public QueryRootQuery articles(ArticlesArgumentsDefinition argsDef, ArticleConnectionQueryDefinition queryDef) { + startField("articles"); + + ArticlesArguments args = new ArticlesArguments(_queryBuilder); + argsDef.define(args); + ArticlesArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new ArticleConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public ProductFilter setVariantMetafieldInput(Input variantMetafield) { - if (variantMetafield == null) { - throw new IllegalArgumentException("Input can not be null"); + public class BlogArguments extends Arguments { + BlogArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * The ID of the `Blog`. + */ + public BlogArguments id(ID value) { + if (value != null) { + startArgument("id"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * The handle of the `Blog`. + */ + public BlogArguments handle(String value) { + if (value != null) { + startArgument("handle"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; } - this.variantMetafield = variantMetafield; - return this; } - public String getTag() { - return tag.getValue(); + public interface BlogArgumentsDefinition { + void define(BlogArguments args); } - public Input getTagInput() { - return tag; + /** + * Fetch a specific `Blog` by one of its unique attributes. + */ + public QueryRootQuery blog(BlogQueryDefinition queryDef) { + return blog(args -> {}, queryDef); } - public ProductFilter setTag(String tag) { - this.tag = Input.optional(tag); + /** + * Fetch a specific `Blog` by one of its unique attributes. + */ + public QueryRootQuery blog(BlogArgumentsDefinition argsDef, BlogQueryDefinition queryDef) { + startField("blog"); + + BlogArguments args = new BlogArguments(_queryBuilder); + argsDef.define(args); + BlogArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public ProductFilter setTagInput(Input tag) { - if (tag == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.tag = tag; + /** + * Find a blog by its handle. + * + * @deprecated Use `blog` instead. + */ + @Deprecated + public QueryRootQuery blogByHandle(String handle, BlogQueryDefinition queryDef) { + startField("blogByHandle"); + + _queryBuilder.append("(handle:"); + Query.appendQuotedString(_queryBuilder, handle.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new BlogQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - if (this.available.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("available:"); - if (available.getValue() != null) { - _queryBuilder.append(available.getValue()); - } else { - _queryBuilder.append("null"); - } + public class BlogsArguments extends Arguments { + BlogsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); } - if (this.variantOption.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("variantOption:"); - if (variantOption.getValue() != null) { - variantOption.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); + /** + * Returns up to the first `n` elements from the list. + */ + public BlogsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); } + return this; } - if (this.productType.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("productType:"); - if (productType.getValue() != null) { - Query.appendQuotedString(_queryBuilder, productType.getValue().toString()); - } else { - _queryBuilder.append("null"); + /** + * Returns the elements that come after the specified cursor. + */ + public BlogsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } - if (this.productVendor.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("productVendor:"); - if (productVendor.getValue() != null) { - Query.appendQuotedString(_queryBuilder, productVendor.getValue().toString()); - } else { - _queryBuilder.append("null"); + /** + * Returns up to the last `n` elements from the list. + */ + public BlogsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); } + return this; } - if (this.price.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("price:"); - if (price.getValue() != null) { - price.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); + /** + * Returns the elements that come before the specified cursor. + */ + public BlogsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } - if (this.productMetafield.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("productMetafield:"); - if (productMetafield.getValue() != null) { - productMetafield.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); + /** + * Reverse the order of the underlying list. + */ + public BlogsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; } - if (this.variantMetafield.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("variantMetafield:"); - if (variantMetafield.getValue() != null) { - variantMetafield.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); + /** + * Sort the underlying list by the given key. + */ + public BlogsArguments sortKey(BlogSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); } + return this; } - if (this.tag.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("tag:"); - if (tag.getValue() != null) { - Query.appendQuotedString(_queryBuilder, tag.getValue().toString()); - } else { - _queryBuilder.append("null"); + /** + * Supported filter parameters: + * - `created_at` + * - `handle` + * - `title` + * - `updated_at` + * See the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) + * for more information about using filters. + */ + public BlogsArguments query(String value) { + if (value != null) { + startArgument("query"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } + } - _queryBuilder.append('}'); + public interface BlogsArgumentsDefinition { + void define(BlogsArguments args); } - } - /** - * The set of valid sort keys for the ProductImage query. - */ - public enum ProductImageSortKeys { /** - * Sort by the `created_at` value. + * List of the shop's blogs. */ - CREATED_AT, + public QueryRootQuery blogs(BlogConnectionQueryDefinition queryDef) { + return blogs(args -> {}, queryDef); + } /** - * Sort by the `id` value. + * List of the shop's blogs. */ - ID, + public QueryRootQuery blogs(BlogsArgumentsDefinition argsDef, BlogConnectionQueryDefinition queryDef) { + startField("blogs"); - /** - * Sort by the `position` value. - */ - POSITION, + BlogsArguments args = new BlogsArguments(_queryBuilder); + argsDef.define(args); + BlogsArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new BlogConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. + * Retrieve a cart by its ID. For more information, refer to + * [Manage a cart with the Storefront API](https://shopify.dev/custom-storefronts/cart/manage). */ - RELEVANCE, + public QueryRootQuery cart(ID id, CartQueryDefinition queryDef) { + startField("cart"); - UNKNOWN_VALUE; + _queryBuilder.append("(id:"); + Query.appendQuotedString(_queryBuilder, id.toString()); - public static ProductImageSortKeys fromGraphQl(String value) { - if (value == null) { - return null; - } + _queryBuilder.append(')'); - switch (value) { - case "CREATED_AT": { - return CREATED_AT; - } + _queryBuilder.append('{'); + queryDef.define(new CartQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "ID": { - return ID; - } + return this; + } - case "POSITION": { - return POSITION; - } + /** + * A poll for the status of the cart checkout completion and order creation. + */ + public QueryRootQuery cartCompletionAttempt(String attemptId, CartCompletionAttemptResultQueryDefinition queryDef) { + startField("cartCompletionAttempt"); - case "RELEVANCE": { - return RELEVANCE; - } + _queryBuilder.append("(attemptId:"); + Query.appendQuotedString(_queryBuilder, attemptId.toString()); - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case CREATED_AT: { - return "CREATED_AT"; - } + _queryBuilder.append(')'); - case ID: { - return "ID"; - } + _queryBuilder.append('{'); + queryDef.define(new CartCompletionAttemptResultQuery(_queryBuilder)); + _queryBuilder.append('}'); - case POSITION: { - return "POSITION"; - } + return this; + } - case RELEVANCE: { - return "RELEVANCE"; + public class CollectionArguments extends Arguments { + CollectionArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * The ID of the `Collection`. + */ + public CollectionArguments id(ID value) { + if (value != null) { + startArgument("id"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - default: { - return ""; + /** + * The handle of the `Collection`. + */ + public CollectionArguments handle(String value) { + if (value != null) { + startArgument("handle"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } } - } - /** - * The set of valid sort keys for the ProductMedia query. - */ - public enum ProductMediaSortKeys { + public interface CollectionArgumentsDefinition { + void define(CollectionArguments args); + } + /** - * Sort by the `id` value. + * Fetch a specific `Collection` by one of its unique attributes. */ - ID, + public QueryRootQuery collection(CollectionQueryDefinition queryDef) { + return collection(args -> {}, queryDef); + } /** - * Sort by the `position` value. + * Fetch a specific `Collection` by one of its unique attributes. */ - POSITION, + public QueryRootQuery collection(CollectionArgumentsDefinition argsDef, CollectionQueryDefinition queryDef) { + startField("collection"); + + CollectionArguments args = new CollectionArguments(_queryBuilder); + argsDef.define(args); + CollectionArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. + * Find a collection by its handle. + * + * @deprecated Use `collection` instead. */ - RELEVANCE, + @Deprecated + public QueryRootQuery collectionByHandle(String handle, CollectionQueryDefinition queryDef) { + startField("collectionByHandle"); - UNKNOWN_VALUE; + _queryBuilder.append("(handle:"); + Query.appendQuotedString(_queryBuilder, handle.toString()); - public static ProductMediaSortKeys fromGraphQl(String value) { - if (value == null) { - return null; + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CollectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + public class CollectionsArguments extends Arguments { + CollectionsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); } - switch (value) { - case "ID": { - return ID; + /** + * Returns up to the first `n` elements from the list. + */ + public CollectionsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); } + return this; + } - case "POSITION": { - return POSITION; + /** + * Returns the elements that come after the specified cursor. + */ + public CollectionsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - case "RELEVANCE": { - return RELEVANCE; + /** + * Returns up to the last `n` elements from the list. + */ + public CollectionsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); } + return this; + } - default: { - return UNKNOWN_VALUE; + /** + * Returns the elements that come before the specified cursor. + */ + public CollectionsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } - } - public String toString() { - switch (this) { - case ID: { - return "ID"; - } - case POSITION: { - return "POSITION"; + /** + * Reverse the order of the underlying list. + */ + public CollectionsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; + } - case RELEVANCE: { - return "RELEVANCE"; + /** + * Sort the underlying list by the given key. + */ + public CollectionsArguments sortKey(CollectionSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); } + return this; + } - default: { - return ""; + /** + * Supported filter parameters: + * - `collection_type` + * - `title` + * - `updated_at` + * See the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) + * for more information about using filters. + */ + public CollectionsArguments query(String value) { + if (value != null) { + startArgument("query"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } } - } - - public interface ProductOptionQueryDefinition { - void define(ProductOptionQuery _queryBuilder); - } - /** - * Product property names like "Size", "Color", and "Material" that the customers can select. - * Variants are selected based on permutations of these options. - * 255 characters limit each. - */ - public static class ProductOptionQuery extends Query { - ProductOptionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public interface CollectionsArgumentsDefinition { + void define(CollectionsArguments args); + } - startField("id"); + /** + * List of the shop’s collections. + */ + public QueryRootQuery collections(CollectionConnectionQueryDefinition queryDef) { + return collections(args -> {}, queryDef); } /** - * The product option’s name. + * List of the shop’s collections. */ - public ProductOptionQuery name() { - startField("name"); + public QueryRootQuery collections(CollectionsArgumentsDefinition argsDef, CollectionConnectionQueryDefinition queryDef) { + startField("collections"); + + CollectionsArguments args = new CollectionsArguments(_queryBuilder); + argsDef.define(args); + CollectionsArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new CollectionConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The corresponding value to the product option name. + * Find a customer by its access token. */ - public ProductOptionQuery values() { - startField("values"); + public QueryRootQuery customer(String customerAccessToken, CustomerQueryDefinition queryDef) { + startField("customer"); + + _queryBuilder.append("(customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new CustomerQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - } - /** - * Product property names like "Size", "Color", and "Material" that the customers can select. - * Variants are selected based on permutations of these options. - * 255 characters limit each. - */ - public static class ProductOption extends AbstractResponse implements Node { - public ProductOption() { - } + /** + * Returns the localized experiences configured for the shop. + */ + public QueryRootQuery localization(LocalizationQueryDefinition queryDef) { + startField("localization"); - public ProductOption(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + _queryBuilder.append('{'); + queryDef.define(new LocalizationQuery(_queryBuilder)); + _queryBuilder.append('}'); - break; - } + return this; + } - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + public class LocationsArguments extends Arguments { + LocationsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - break; - } + /** + * Returns up to the first `n` elements from the list. + */ + public LocationsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - case "values": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } + /** + * Returns the elements that come after the specified cursor. + */ + public LocationsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - responseData.put(key, list1); + /** + * Returns up to the last `n` elements from the list. + */ + public LocationsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - break; - } + /** + * Returns the elements that come before the specified cursor. + */ + public LocationsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + /** + * Reverse the order of the underlying list. + */ + public LocationsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; } - } - public ProductOption(ID id) { - this(); - optimisticData.put("id", id); + /** + * Sort the underlying list by the given key. + */ + public LocationsArguments sortKey(LocationSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; + } + + /** + * Used to sort results based on proximity to the provided location. + */ + public LocationsArguments near(GeoCoordinateInput value) { + if (value != null) { + startArgument("near"); + value.appendTo(_queryBuilder); + } + return this; + } } - public String getGraphQlTypeName() { - return "ProductOption"; + public interface LocationsArgumentsDefinition { + void define(LocationsArguments args); } /** - * A globally-unique identifier. + * List of the shop's locations that support in-store pickup. + * When sorting by distance, you must specify a location via the `near` argument. */ - - public ID getId() { - return (ID) get("id"); + public QueryRootQuery locations(LocationConnectionQueryDefinition queryDef) { + return locations(args -> {}, queryDef); } /** - * The product option’s name. + * List of the shop's locations that support in-store pickup. + * When sorting by distance, you must specify a location via the `near` argument. */ + public QueryRootQuery locations(LocationsArgumentsDefinition argsDef, LocationConnectionQueryDefinition queryDef) { + startField("locations"); - public String getName() { - return (String) get("name"); - } + LocationsArguments args = new LocationsArguments(_queryBuilder); + argsDef.define(args); + LocationsArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new LocationConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ProductOption setName(String arg) { - optimisticData.put(getKey("name"), arg); return this; } /** - * The corresponding value to the product option name. + * A storefront menu. */ + public QueryRootQuery menu(String handle, MenuQueryDefinition queryDef) { + startField("menu"); - public List getValues() { - return (List) get("values"); - } + _queryBuilder.append("(handle:"); + Query.appendQuotedString(_queryBuilder, handle.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new MenuQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ProductOption setValues(List arg) { - optimisticData.put(getKey("values"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "id": return false; - - case "name": return false; + public class MetaobjectArguments extends Arguments { + MetaobjectArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "values": return false; + /** + * The ID of the metaobject. + */ + public MetaobjectArguments id(ID value) { + if (value != null) { + startArgument("id"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - default: return false; + /** + * The handle and type of the metaobject. + */ + public MetaobjectArguments handle(MetaobjectHandleInput value) { + if (value != null) { + startArgument("handle"); + value.appendTo(_queryBuilder); + } + return this; } } - } - - public interface ProductPriceRangeQueryDefinition { - void define(ProductPriceRangeQuery _queryBuilder); - } - /** - * The price range of the product. - */ - public static class ProductPriceRangeQuery extends Query { - ProductPriceRangeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public interface MetaobjectArgumentsDefinition { + void define(MetaobjectArguments args); } /** - * The highest variant's price. + * Fetch a specific Metaobject by one of its unique identifiers. */ - public ProductPriceRangeQuery maxVariantPrice(MoneyV2QueryDefinition queryDef) { - startField("maxVariantPrice"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + public QueryRootQuery metaobject(MetaobjectQueryDefinition queryDef) { + return metaobject(args -> {}, queryDef); } /** - * The lowest variant's price. + * Fetch a specific Metaobject by one of its unique identifiers. */ - public ProductPriceRangeQuery minVariantPrice(MoneyV2QueryDefinition queryDef) { - startField("minVariantPrice"); + public QueryRootQuery metaobject(MetaobjectArgumentsDefinition argsDef, MetaobjectQueryDefinition queryDef) { + startField("metaobject"); + + MetaobjectArguments args = new MetaobjectArguments(_queryBuilder); + argsDef.define(args); + MetaobjectArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new MetaobjectQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - } - /** - * The price range of the product. - */ - public static class ProductPriceRange extends AbstractResponse { - public ProductPriceRange() { - } + public class MetaobjectsArguments extends Arguments { + MetaobjectsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } - public ProductPriceRange(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "maxVariantPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + /** + * The key of a field to sort with. Supports "id" and "updated_at". + */ + public MetaobjectsArguments sortKey(String value) { + if (value != null) { + startArgument("sortKey"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - break; - } + /** + * Returns up to the first `n` elements from the list. + */ + public MetaobjectsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - case "minVariantPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + /** + * Returns the elements that come after the specified cursor. + */ + public MetaobjectsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - break; - } + /** + * Returns up to the last `n` elements from the list. + */ + public MetaobjectsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + /** + * Returns the elements that come before the specified cursor. + */ + public MetaobjectsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } + + /** + * Reverse the order of the underlying list. + */ + public MetaobjectsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; } } - public String getGraphQlTypeName() { - return "ProductPriceRange"; + public interface MetaobjectsArgumentsDefinition { + void define(MetaobjectsArguments args); } /** - * The highest variant's price. + * All active metaobjects for the shop. */ - - public MoneyV2 getMaxVariantPrice() { - return (MoneyV2) get("maxVariantPrice"); - } - - public ProductPriceRange setMaxVariantPrice(MoneyV2 arg) { - optimisticData.put(getKey("maxVariantPrice"), arg); - return this; + public QueryRootQuery metaobjects(String type, MetaobjectConnectionQueryDefinition queryDef) { + return metaobjects(type, args -> {}, queryDef); } /** - * The lowest variant's price. + * All active metaobjects for the shop. */ + public QueryRootQuery metaobjects(String type, MetaobjectsArgumentsDefinition argsDef, MetaobjectConnectionQueryDefinition queryDef) { + startField("metaobjects"); - public MoneyV2 getMinVariantPrice() { - return (MoneyV2) get("minVariantPrice"); - } + _queryBuilder.append("(type:"); + Query.appendQuotedString(_queryBuilder, type.toString()); - public ProductPriceRange setMinVariantPrice(MoneyV2 arg) { - optimisticData.put(getKey("minVariantPrice"), arg); - return this; - } + argsDef.define(new MetaobjectsArguments(_queryBuilder)); - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "maxVariantPrice": return true; + _queryBuilder.append(')'); - case "minVariantPrice": return true; + _queryBuilder.append('{'); + queryDef.define(new MetaobjectConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - default: return false; - } + return this; } - } - /** - * The set of valid sort keys for the Product query. - */ - public enum ProductSortKeys { /** - * Sort by the `best_selling` value. + * Returns a specific node by ID. */ - BEST_SELLING, + public QueryRootQuery node(ID id, NodeQueryDefinition queryDef) { + startField("node"); - /** - * Sort by the `created_at` value. - */ - CREATED_AT, + _queryBuilder.append("(id:"); + Query.appendQuotedString(_queryBuilder, id.toString()); - /** - * Sort by the `id` value. - */ - ID, + _queryBuilder.append(')'); - /** - * Sort by the `price` value. - */ - PRICE, + _queryBuilder.append('{'); + queryDef.define(new NodeQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * Sort by the `product_type` value. - */ - PRODUCT_TYPE, + return this; + } /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. + * Returns the list of nodes with the given IDs. */ - RELEVANCE, + public QueryRootQuery nodes(List ids, NodeQueryDefinition queryDef) { + startField("nodes"); - /** - * Sort by the `title` value. - */ - TITLE, + _queryBuilder.append("(ids:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ID item1 : ids) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + Query.appendQuotedString(_queryBuilder, item1.toString()); + } + } + _queryBuilder.append(']'); - /** - * Sort by the `updated_at` value. - */ - UPDATED_AT, + _queryBuilder.append(')'); - /** - * Sort by the `vendor` value. - */ - VENDOR, + _queryBuilder.append('{'); + queryDef.define(new NodeQuery(_queryBuilder)); + _queryBuilder.append('}'); - UNKNOWN_VALUE; + return this; + } - public static ProductSortKeys fromGraphQl(String value) { - if (value == null) { - return null; + public class PageArguments extends Arguments { + PageArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); } - switch (value) { - case "BEST_SELLING": { - return BEST_SELLING; + /** + * The ID of the `Page`. + */ + public PageArguments id(ID value) { + if (value != null) { + startArgument("id"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - case "CREATED_AT": { - return CREATED_AT; + /** + * The handle of the `Page`. + */ + public PageArguments handle(String value) { + if (value != null) { + startArgument("handle"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } + } - case "ID": { - return ID; - } + public interface PageArgumentsDefinition { + void define(PageArguments args); + } - case "PRICE": { - return PRICE; - } + /** + * Fetch a specific `Page` by one of its unique attributes. + */ + public QueryRootQuery page(PageQueryDefinition queryDef) { + return page(args -> {}, queryDef); + } - case "PRODUCT_TYPE": { - return PRODUCT_TYPE; - } + /** + * Fetch a specific `Page` by one of its unique attributes. + */ + public QueryRootQuery page(PageArgumentsDefinition argsDef, PageQueryDefinition queryDef) { + startField("page"); - case "RELEVANCE": { - return RELEVANCE; - } + PageArguments args = new PageArguments(_queryBuilder); + argsDef.define(args); + PageArguments.end(args); - case "TITLE": { - return TITLE; - } + _queryBuilder.append('{'); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "UPDATED_AT": { - return UPDATED_AT; - } + return this; + } - case "VENDOR": { - return VENDOR; - } + /** + * Find a page by its handle. + * + * @deprecated Use `page` instead. + */ + @Deprecated + public QueryRootQuery pageByHandle(String handle, PageQueryDefinition queryDef) { + startField("pageByHandle"); - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case BEST_SELLING: { - return "BEST_SELLING"; - } + _queryBuilder.append("(handle:"); + Query.appendQuotedString(_queryBuilder, handle.toString()); - case CREATED_AT: { - return "CREATED_AT"; - } + _queryBuilder.append(')'); - case ID: { - return "ID"; - } + _queryBuilder.append('{'); + queryDef.define(new PageQuery(_queryBuilder)); + _queryBuilder.append('}'); - case PRICE: { - return "PRICE"; + return this; + } + + public class PagesArguments extends Arguments { + PagesArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * Returns up to the first `n` elements from the list. + */ + public PagesArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); } + return this; + } - case PRODUCT_TYPE: { - return "PRODUCT_TYPE"; + /** + * Returns the elements that come after the specified cursor. + */ + public PagesArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - case RELEVANCE: { - return "RELEVANCE"; + /** + * Returns up to the last `n` elements from the list. + */ + public PagesArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); } + return this; + } - case TITLE: { - return "TITLE"; + /** + * Returns the elements that come before the specified cursor. + */ + public PagesArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - case UPDATED_AT: { - return "UPDATED_AT"; + /** + * Reverse the order of the underlying list. + */ + public PagesArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); } + return this; + } - case VENDOR: { - return "VENDOR"; + /** + * Sort the underlying list by the given key. + */ + public PagesArguments sortKey(PageSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); } + return this; + } - default: { - return ""; + /** + * Supported filter parameters: + * - `created_at` + * - `handle` + * - `title` + * - `updated_at` + * See the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) + * for more information about using filters. + */ + public PagesArguments query(String value) { + if (value != null) { + startArgument("query"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } } - } - - public interface ProductVariantQueryDefinition { - void define(ProductVariantQuery _queryBuilder); - } - - /** - * A product variant represents a different version of a product, such as differing sizes or differing - * colors. - */ - public static class ProductVariantQuery extends Query { - ProductVariantQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - startField("id"); + public interface PagesArgumentsDefinition { + void define(PagesArguments args); } /** - * Indicates if the product variant is available for sale. + * List of the shop's pages. */ - public ProductVariantQuery availableForSale() { - startField("availableForSale"); - - return this; + public QueryRootQuery pages(PageConnectionQueryDefinition queryDef) { + return pages(args -> {}, queryDef); } /** - * The barcode (for example, ISBN, UPC, or GTIN) associated with the variant. + * List of the shop's pages. */ - public ProductVariantQuery barcode() { - startField("barcode"); - - return this; - } + public QueryRootQuery pages(PagesArgumentsDefinition argsDef, PageConnectionQueryDefinition queryDef) { + startField("pages"); - /** - * The compare at price of the variant. This can be used to mark a variant as on sale, when - * `compareAtPrice` is higher than `price`. - */ - public ProductVariantQuery compareAtPrice(MoneyV2QueryDefinition queryDef) { - startField("compareAtPrice"); + PagesArguments args = new PagesArguments(_queryBuilder); + argsDef.define(args); + PagesArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new PageConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - /** - * The compare at price of the variant. This can be used to mark a variant as on sale, when - * `compareAtPriceV2` is higher than `priceV2`. - * - * @deprecated Use `compareAtPrice` instead. - */ - @Deprecated - public ProductVariantQuery compareAtPriceV2(MoneyV2QueryDefinition queryDef) { - startField("compareAtPriceV2"); + public class ProductArguments extends Arguments { + ProductArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The ID of the `Product`. + */ + public ProductArguments id(ID value) { + if (value != null) { + startArgument("id"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - return this; + /** + * The handle of the `Product`. + */ + public ProductArguments handle(String value) { + if (value != null) { + startArgument("handle"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + } + + public interface ProductArgumentsDefinition { + void define(ProductArguments args); } /** - * Whether a product is out of stock but still available for purchase (used for backorders). + * Fetch a specific `Product` by one of its unique attributes. */ - public ProductVariantQuery currentlyNotInStock() { - startField("currentlyNotInStock"); - - return this; + public QueryRootQuery product(ProductQueryDefinition queryDef) { + return product(args -> {}, queryDef); } /** - * Image associated with the product variant. This field falls back to the product image if no image is - * available. + * Fetch a specific `Product` by one of its unique attributes. */ - public ProductVariantQuery image(ImageQueryDefinition queryDef) { - startField("image"); + public QueryRootQuery product(ProductArgumentsDefinition argsDef, ProductQueryDefinition queryDef) { + startField("product"); + + ProductArguments args = new ProductArguments(_queryBuilder); + argsDef.define(args); + ProductArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); + queryDef.define(new ProductQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Returns a metafield found by namespace and key. + * Find a product by its handle. + * + * @deprecated Use `product` instead. */ - public ProductVariantQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { - startField("metafield"); - - _queryBuilder.append("(namespace:"); - Query.appendQuotedString(_queryBuilder, namespace.toString()); + @Deprecated + public QueryRootQuery productByHandle(String handle, ProductQueryDefinition queryDef) { + startField("productByHandle"); - _queryBuilder.append(",key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + _queryBuilder.append("(handle:"); + Query.appendQuotedString(_queryBuilder, handle.toString()); _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); + queryDef.define(new ProductQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ - public ProductVariantQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); + public class ProductRecommendationsArguments extends Arguments { + ProductRecommendationsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); + /** + * The recommendation intent that is used to generate product recommendations. You can use intent to + * generate product recommendations on various pages across the channels, according to different + * strategies. + */ + public ProductRecommendationsArguments intent(ProductRecommendationIntent value) { + if (value != null) { + startArgument("intent"); + _queryBuilder.append(value.toString()); } + return this; } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + } - return this; + public interface ProductRecommendationsArgumentsDefinition { + void define(ProductRecommendationsArguments args); } /** - * The product variant’s price. + * Find recommended products related to a given `product_id`. + * To learn more about how recommendations are generated, see + * [*Showing product recommendations on product + * pages*](https://help.shopify.com/themes/development/recommended-products). */ - public ProductVariantQuery price(MoneyV2QueryDefinition queryDef) { - startField("price"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; + public QueryRootQuery productRecommendations(ID productId, ProductQueryDefinition queryDef) { + return productRecommendations(productId, args -> {}, queryDef); } /** - * The product variant’s price. - * - * @deprecated Use `price` instead. + * Find recommended products related to a given `product_id`. + * To learn more about how recommendations are generated, see + * [*Showing product recommendations on product + * pages*](https://help.shopify.com/themes/development/recommended-products). */ - @Deprecated - public ProductVariantQuery priceV2(MoneyV2QueryDefinition queryDef) { - startField("priceV2"); + public QueryRootQuery productRecommendations(ID productId, ProductRecommendationsArgumentsDefinition argsDef, ProductQueryDefinition queryDef) { + startField("productRecommendations"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + _queryBuilder.append("(productId:"); + Query.appendQuotedString(_queryBuilder, productId.toString()); - return this; - } + argsDef.define(new ProductRecommendationsArguments(_queryBuilder)); - /** - * The product object that the product variant belongs to. - */ - public ProductVariantQuery product(ProductQueryDefinition queryDef) { - startField("product"); + _queryBuilder.append(')'); _queryBuilder.append('{'); queryDef.define(new ProductQuery(_queryBuilder)); @@ -53176,46 +60500,51 @@ public ProductVariantQuery product(ProductQueryDefinition queryDef) { } /** - * The total sellable quantity of the variant for online sales channels. + * Tags added to products. + * Additional access scope required: unauthenticated_read_product_tags. */ - public ProductVariantQuery quantityAvailable() { - startField("quantityAvailable"); + public QueryRootQuery productTags(int first, StringConnectionQueryDefinition queryDef) { + startField("productTags"); - return this; - } + _queryBuilder.append("(first:"); + _queryBuilder.append(first); - /** - * Whether a customer needs to provide a shipping address when placing an order for the product - * variant. - */ - public ProductVariantQuery requiresShipping() { - startField("requiresShipping"); + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new StringConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * List of product options applied to the variant. + * List of product types for the shop's products that are published to your app. */ - public ProductVariantQuery selectedOptions(SelectedOptionQueryDefinition queryDef) { - startField("selectedOptions"); + public QueryRootQuery productTypes(int first, StringConnectionQueryDefinition queryDef) { + startField("productTypes"); + + _queryBuilder.append("(first:"); + _queryBuilder.append(first); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new SelectedOptionQuery(_queryBuilder)); + queryDef.define(new StringConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - public class SellingPlanAllocationsArguments extends Arguments { - SellingPlanAllocationsArguments(StringBuilder _queryBuilder) { + public class ProductsArguments extends Arguments { + ProductsArguments(StringBuilder _queryBuilder) { super(_queryBuilder, true); } /** * Returns up to the first `n` elements from the list. */ - public SellingPlanAllocationsArguments first(Integer value) { + public ProductsArguments first(Integer value) { if (value != null) { startArgument("first"); _queryBuilder.append(value); @@ -53226,7 +60555,7 @@ public SellingPlanAllocationsArguments first(Integer value) { /** * Returns the elements that come after the specified cursor. */ - public SellingPlanAllocationsArguments after(String value) { + public ProductsArguments after(String value) { if (value != null) { startArgument("after"); Query.appendQuotedString(_queryBuilder, value.toString()); @@ -53237,7 +60566,7 @@ public SellingPlanAllocationsArguments after(String value) { /** * Returns up to the last `n` elements from the list. */ - public SellingPlanAllocationsArguments last(Integer value) { + public ProductsArguments last(Integer value) { if (value != null) { startArgument("last"); _queryBuilder.append(value); @@ -53248,7 +60577,7 @@ public SellingPlanAllocationsArguments last(Integer value) { /** * Returns the elements that come before the specified cursor. */ - public SellingPlanAllocationsArguments before(String value) { + public ProductsArguments before(String value) { if (value != null) { startArgument("before"); Query.appendQuotedString(_queryBuilder, value.toString()); @@ -53259,63 +60588,112 @@ public SellingPlanAllocationsArguments before(String value) { /** * Reverse the order of the underlying list. */ - public SellingPlanAllocationsArguments reverse(Boolean value) { + public ProductsArguments reverse(Boolean value) { if (value != null) { startArgument("reverse"); _queryBuilder.append(value); } return this; } + + /** + * Sort the underlying list by the given key. + */ + public ProductsArguments sortKey(ProductSortKeys value) { + if (value != null) { + startArgument("sortKey"); + _queryBuilder.append(value.toString()); + } + return this; + } + + /** + * Supported filter parameters: + * - `available_for_sale` + * - `created_at` + * - `product_type` + * - `tag` + * - `tag_not` + * - `title` + * - `updated_at` + * - `variants.price` + * - `vendor` + * See the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) + * for more information about using filters. + */ + public ProductsArguments query(String value) { + if (value != null) { + startArgument("query"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } } - public interface SellingPlanAllocationsArgumentsDefinition { - void define(SellingPlanAllocationsArguments args); + public interface ProductsArgumentsDefinition { + void define(ProductsArguments args); } /** - * Represents an association between a variant and a selling plan. Selling plan allocations describe - * which selling plans are available for each variant, and what their impact is on pricing. + * List of the shop’s products. */ - public ProductVariantQuery sellingPlanAllocations(SellingPlanAllocationConnectionQueryDefinition queryDef) { - return sellingPlanAllocations(args -> {}, queryDef); + public QueryRootQuery products(ProductConnectionQueryDefinition queryDef) { + return products(args -> {}, queryDef); } /** - * Represents an association between a variant and a selling plan. Selling plan allocations describe - * which selling plans are available for each variant, and what their impact is on pricing. + * List of the shop’s products. */ - public ProductVariantQuery sellingPlanAllocations(SellingPlanAllocationsArgumentsDefinition argsDef, SellingPlanAllocationConnectionQueryDefinition queryDef) { - startField("sellingPlanAllocations"); + public QueryRootQuery products(ProductsArgumentsDefinition argsDef, ProductConnectionQueryDefinition queryDef) { + startField("products"); - SellingPlanAllocationsArguments args = new SellingPlanAllocationsArguments(_queryBuilder); + ProductsArguments args = new ProductsArguments(_queryBuilder); argsDef.define(args); - SellingPlanAllocationsArguments.end(args); + ProductsArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new SellingPlanAllocationConnectionQuery(_queryBuilder)); + queryDef.define(new ProductConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The SKU (stock keeping unit) associated with the variant. + * The list of public Storefront API versions, including supported, release candidate and unstable + * versions. */ - public ProductVariantQuery sku() { - startField("sku"); + public QueryRootQuery publicApiVersions(ApiVersionQueryDefinition queryDef) { + startField("publicApiVersions"); + + _queryBuilder.append('{'); + queryDef.define(new ApiVersionQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - public class StoreAvailabilityArguments extends Arguments { - StoreAvailabilityArguments(StringBuilder _queryBuilder) { + /** + * The shop associated with the storefront access token. + */ + public QueryRootQuery shop(ShopQueryDefinition queryDef) { + startField("shop"); + + _queryBuilder.append('{'); + queryDef.define(new ShopQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + public class UrlRedirectsArguments extends Arguments { + UrlRedirectsArguments(StringBuilder _queryBuilder) { super(_queryBuilder, true); } /** * Returns up to the first `n` elements from the list. */ - public StoreAvailabilityArguments first(Integer value) { + public UrlRedirectsArguments first(Integer value) { if (value != null) { startArgument("first"); _queryBuilder.append(value); @@ -53326,7 +60704,7 @@ public StoreAvailabilityArguments first(Integer value) { /** * Returns the elements that come after the specified cursor. */ - public StoreAvailabilityArguments after(String value) { + public UrlRedirectsArguments after(String value) { if (value != null) { startArgument("after"); Query.appendQuotedString(_queryBuilder, value.toString()); @@ -53337,7 +60715,7 @@ public StoreAvailabilityArguments after(String value) { /** * Returns up to the last `n` elements from the list. */ - public StoreAvailabilityArguments last(Integer value) { + public UrlRedirectsArguments last(Integer value) { if (value != null) { startArgument("last"); _queryBuilder.append(value); @@ -53348,7 +60726,7 @@ public StoreAvailabilityArguments last(Integer value) { /** * Returns the elements that come before the specified cursor. */ - public StoreAvailabilityArguments before(String value) { + public UrlRedirectsArguments before(String value) { if (value != null) { startArgument("before"); Query.appendQuotedString(_queryBuilder, value.toString()); @@ -53359,7 +60737,7 @@ public StoreAvailabilityArguments before(String value) { /** * Reverse the order of the underlying list. */ - public StoreAvailabilityArguments reverse(Boolean value) { + public UrlRedirectsArguments reverse(Boolean value) { if (value != null) { startArgument("reverse"); _queryBuilder.append(value); @@ -53368,122 +60746,89 @@ public StoreAvailabilityArguments reverse(Boolean value) { } /** - * Used to sort results based on proximity to the provided location. + * Supported filter parameters: + * - `created_at` + * - `path` + * - `target` + * See the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) + * for more information about using filters. */ - public StoreAvailabilityArguments near(GeoCoordinateInput value) { + public UrlRedirectsArguments query(String value) { if (value != null) { - startArgument("near"); - value.appendTo(_queryBuilder); + startArgument("query"); + Query.appendQuotedString(_queryBuilder, value.toString()); } return this; } } - public interface StoreAvailabilityArgumentsDefinition { - void define(StoreAvailabilityArguments args); + public interface UrlRedirectsArgumentsDefinition { + void define(UrlRedirectsArguments args); } /** - * The in-store pickup availability of this variant by location. + * A list of redirects for a shop. */ - public ProductVariantQuery storeAvailability(StoreAvailabilityConnectionQueryDefinition queryDef) { - return storeAvailability(args -> {}, queryDef); + public QueryRootQuery urlRedirects(UrlRedirectConnectionQueryDefinition queryDef) { + return urlRedirects(args -> {}, queryDef); } /** - * The in-store pickup availability of this variant by location. + * A list of redirects for a shop. */ - public ProductVariantQuery storeAvailability(StoreAvailabilityArgumentsDefinition argsDef, StoreAvailabilityConnectionQueryDefinition queryDef) { - startField("storeAvailability"); + public QueryRootQuery urlRedirects(UrlRedirectsArgumentsDefinition argsDef, UrlRedirectConnectionQueryDefinition queryDef) { + startField("urlRedirects"); - StoreAvailabilityArguments args = new StoreAvailabilityArguments(_queryBuilder); + UrlRedirectsArguments args = new UrlRedirectsArguments(_queryBuilder); argsDef.define(args); - StoreAvailabilityArguments.end(args); - - _queryBuilder.append('{'); - queryDef.define(new StoreAvailabilityConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The product variant’s title. - */ - public ProductVariantQuery title() { - startField("title"); - - return this; - } - - /** - * The unit price value for the variant based on the variant's measurement. - */ - public ProductVariantQuery unitPrice(MoneyV2QueryDefinition queryDef) { - startField("unitPrice"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The unit price measurement for the variant. - */ - public ProductVariantQuery unitPriceMeasurement(UnitPriceMeasurementQueryDefinition queryDef) { - startField("unitPriceMeasurement"); + UrlRedirectsArguments.end(args); _queryBuilder.append('{'); - queryDef.define(new UnitPriceMeasurementQuery(_queryBuilder)); + queryDef.define(new UrlRedirectConnectionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - /** - * The weight of the product variant in the unit system specified with `weight_unit`. - */ - public ProductVariantQuery weight() { - startField("weight"); - - return this; - } - - /** - * Unit of measurement for weight. - */ - public ProductVariantQuery weightUnit() { - startField("weightUnit"); - - return this; + public String toString() { + return _queryBuilder.toString(); } } /** - * A product variant represents a different version of a product, such as differing sizes or differing - * colors. + * The schema’s entry-point for queries. This acts as the public, top-level API from which all queries + * must start. */ - public static class ProductVariant extends AbstractResponse implements HasMetafields, Merchandise, MetafieldParentResource, MetafieldReference, Node { - public ProductVariant() { + public static class QueryRoot extends AbstractResponse { + public QueryRoot() { } - public ProductVariant(JsonObject fields) throws SchemaViolationError { + public QueryRoot(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "availableForSale": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + case "article": { + Article optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Article(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "barcode": { - String optional1 = null; + case "articles": { + responseData.put(key, new ArticleConnection(jsonAsObject(field.getValue(), key))); + + break; + } + + case "blog": { + Blog optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new Blog(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -53491,10 +60836,10 @@ public ProductVariant(JsonObject fields) throws SchemaViolationError { break; } - case "compareAtPrice": { - MoneyV2 optional1 = null; + case "blogByHandle": { + Blog optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + optional1 = new Blog(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -53502,10 +60847,16 @@ public ProductVariant(JsonObject fields) throws SchemaViolationError { break; } - case "compareAtPriceV2": { - MoneyV2 optional1 = null; + case "blogs": { + responseData.put(key, new BlogConnection(jsonAsObject(field.getValue(), key))); + + break; + } + + case "cart": { + Cart optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + optional1 = new Cart(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -53513,22 +60864,21 @@ public ProductVariant(JsonObject fields) throws SchemaViolationError { break; } - case "currentlyNotInStock": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } + case "cartCompletionAttempt": { + CartCompletionAttemptResult optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = UnknownCartCompletionAttemptResult.create(jsonAsObject(field.getValue(), key)); + } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + responseData.put(key, optional1); break; } - case "image": { - Image optional1 = null; + case "collection": { + Collection optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); + optional1 = new Collection(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -53536,10 +60886,10 @@ public ProductVariant(JsonObject fields) throws SchemaViolationError { break; } - case "metafield": { - Metafield optional1 = null; + case "collectionByHandle": { + Collection optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + optional1 = new Collection(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -53547,44 +60897,50 @@ public ProductVariant(JsonObject fields) throws SchemaViolationError { break; } - case "metafields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } + case "collections": { + responseData.put(key, new CollectionConnection(jsonAsObject(field.getValue(), key))); - list1.add(optional2); + break; + } + + case "customer": { + Customer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Customer(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "price": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "localization": { + responseData.put(key, new Localization(jsonAsObject(field.getValue(), key))); break; } - case "priceV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "locations": { + responseData.put(key, new LocationConnection(jsonAsObject(field.getValue(), key))); break; } - case "product": { - responseData.put(key, new Product(jsonAsObject(field.getValue(), key))); + case "menu": { + Menu optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Menu(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "quantityAvailable": { - Integer optional1 = null; + case "metaobject": { + Metaobject optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); + optional1 = new Metaobject(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -53592,33 +60948,43 @@ public ProductVariant(JsonObject fields) throws SchemaViolationError { break; } - case "requiresShipping": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + case "metaobjects": { + responseData.put(key, new MetaobjectConnection(jsonAsObject(field.getValue(), key))); break; } - case "selectedOptions": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SelectedOption(jsonAsObject(element1, key))); + case "node": { + Node optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = UnknownNode.create(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "sellingPlanAllocations": { - responseData.put(key, new SellingPlanAllocationConnection(jsonAsObject(field.getValue(), key))); + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + Node optional2 = null; + if (!element1.isJsonNull()) { + optional2 = UnknownNode.create(jsonAsObject(element1, key)); + } + + list1.add(optional2); + } + + responseData.put(key, list1); break; } - case "sku": { - String optional1 = null; + case "page": { + Page optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new Page(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -53626,22 +60992,27 @@ public ProductVariant(JsonObject fields) throws SchemaViolationError { break; } - case "storeAvailability": { - responseData.put(key, new StoreAvailabilityConnection(jsonAsObject(field.getValue(), key))); + case "pageByHandle": { + Page optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Page(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "pages": { + responseData.put(key, new PageConnection(jsonAsObject(field.getValue(), key))); break; } - case "unitPrice": { - MoneyV2 optional1 = null; + case "product": { + Product optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + optional1 = new Product(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -53649,10 +61020,10 @@ public ProductVariant(JsonObject fields) throws SchemaViolationError { break; } - case "unitPriceMeasurement": { - UnitPriceMeasurement optional1 = null; + case "productByHandle": { + Product optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new UnitPriceMeasurement(jsonAsObject(field.getValue(), key)); + optional1 = new Product(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -53660,10 +61031,15 @@ public ProductVariant(JsonObject fields) throws SchemaViolationError { break; } - case "weight": { - Double optional1 = null; + case "productRecommendations": { + List optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsDouble(field.getValue(), key); + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new Product(jsonAsObject(element1, key))); + } + + optional1 = list1; } responseData.put(key, optional1); @@ -53671,2304 +61047,1879 @@ public ProductVariant(JsonObject fields) throws SchemaViolationError { break; } - case "weightUnit": { - responseData.put(key, WeightUnit.fromGraphQl(jsonAsString(field.getValue(), key))); + case "productTags": { + responseData.put(key, new StringConnection(jsonAsObject(field.getValue(), key))); break; } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "productTypes": { + responseData.put(key, new StringConnection(jsonAsObject(field.getValue(), key))); + break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public ProductVariant(ID id) { - this(); - optimisticData.put("id", id); - } - - public String getGraphQlTypeName() { - return "ProductVariant"; - } - - /** - * Indicates if the product variant is available for sale. - */ - - public Boolean getAvailableForSale() { - return (Boolean) get("availableForSale"); - } - - public ProductVariant setAvailableForSale(Boolean arg) { - optimisticData.put(getKey("availableForSale"), arg); - return this; - } - - /** - * The barcode (for example, ISBN, UPC, or GTIN) associated with the variant. - */ - - public String getBarcode() { - return (String) get("barcode"); - } - - public ProductVariant setBarcode(String arg) { - optimisticData.put(getKey("barcode"), arg); - return this; - } - - /** - * The compare at price of the variant. This can be used to mark a variant as on sale, when - * `compareAtPrice` is higher than `price`. - */ - public MoneyV2 getCompareAtPrice() { - return (MoneyV2) get("compareAtPrice"); - } - - public ProductVariant setCompareAtPrice(MoneyV2 arg) { - optimisticData.put(getKey("compareAtPrice"), arg); - return this; - } - - /** - * The compare at price of the variant. This can be used to mark a variant as on sale, when - * `compareAtPriceV2` is higher than `priceV2`. - * - * @deprecated Use `compareAtPrice` instead. - */ + case "products": { + responseData.put(key, new ProductConnection(jsonAsObject(field.getValue(), key))); - public MoneyV2 getCompareAtPriceV2() { - return (MoneyV2) get("compareAtPriceV2"); - } + break; + } - public ProductVariant setCompareAtPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("compareAtPriceV2"), arg); - return this; - } + case "publicApiVersions": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ApiVersion(jsonAsObject(element1, key))); + } - /** - * Whether a product is out of stock but still available for purchase (used for backorders). - */ + responseData.put(key, list1); - public Boolean getCurrentlyNotInStock() { - return (Boolean) get("currentlyNotInStock"); - } + break; + } - public ProductVariant setCurrentlyNotInStock(Boolean arg) { - optimisticData.put(getKey("currentlyNotInStock"), arg); - return this; - } + case "shop": { + responseData.put(key, new Shop(jsonAsObject(field.getValue(), key))); - /** - * A globally-unique identifier. - */ + break; + } - public ID getId() { - return (ID) get("id"); - } + case "urlRedirects": { + responseData.put(key, new UrlRedirectConnection(jsonAsObject(field.getValue(), key))); - /** - * Image associated with the product variant. This field falls back to the product image if no image is - * available. - */ + break; + } - public Image getImage() { - return (Image) get("image"); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public ProductVariant setImage(Image arg) { - optimisticData.put(getKey("image"), arg); - return this; + public String getGraphQlTypeName() { + return "QueryRoot"; } /** - * Returns a metafield found by namespace and key. + * Fetch a specific Article by its ID. */ - public Metafield getMetafield() { - return (Metafield) get("metafield"); + public Article getArticle() { + return (Article) get("article"); } - public ProductVariant setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); + public QueryRoot setArticle(Article arg) { + optimisticData.put(getKey("article"), arg); return this; } /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. + * List of the shop's articles. */ - public List getMetafields() { - return (List) get("metafields"); + public ArticleConnection getArticles() { + return (ArticleConnection) get("articles"); } - public ProductVariant setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); + public QueryRoot setArticles(ArticleConnection arg) { + optimisticData.put(getKey("articles"), arg); return this; } /** - * The product variant’s price. + * Fetch a specific `Blog` by one of its unique attributes. */ - public MoneyV2 getPrice() { - return (MoneyV2) get("price"); + public Blog getBlog() { + return (Blog) get("blog"); } - public ProductVariant setPrice(MoneyV2 arg) { - optimisticData.put(getKey("price"), arg); + public QueryRoot setBlog(Blog arg) { + optimisticData.put(getKey("blog"), arg); return this; } /** - * The product variant’s price. + * Find a blog by its handle. * - * @deprecated Use `price` instead. - */ - - public MoneyV2 getPriceV2() { - return (MoneyV2) get("priceV2"); - } - - public ProductVariant setPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("priceV2"), arg); - return this; - } - - /** - * The product object that the product variant belongs to. - */ - - public Product getProduct() { - return (Product) get("product"); - } - - public ProductVariant setProduct(Product arg) { - optimisticData.put(getKey("product"), arg); - return this; - } - - /** - * The total sellable quantity of the variant for online sales channels. - */ - - public Integer getQuantityAvailable() { - return (Integer) get("quantityAvailable"); - } - - public ProductVariant setQuantityAvailable(Integer arg) { - optimisticData.put(getKey("quantityAvailable"), arg); - return this; - } - - /** - * Whether a customer needs to provide a shipping address when placing an order for the product - * variant. - */ - - public Boolean getRequiresShipping() { - return (Boolean) get("requiresShipping"); - } - - public ProductVariant setRequiresShipping(Boolean arg) { - optimisticData.put(getKey("requiresShipping"), arg); - return this; - } - - /** - * List of product options applied to the variant. - */ - - public List getSelectedOptions() { - return (List) get("selectedOptions"); - } - - public ProductVariant setSelectedOptions(List arg) { - optimisticData.put(getKey("selectedOptions"), arg); - return this; - } - - /** - * Represents an association between a variant and a selling plan. Selling plan allocations describe - * which selling plans are available for each variant, and what their impact is on pricing. + * @deprecated Use `blog` instead. */ - public SellingPlanAllocationConnection getSellingPlanAllocations() { - return (SellingPlanAllocationConnection) get("sellingPlanAllocations"); + public Blog getBlogByHandle() { + return (Blog) get("blogByHandle"); } - public ProductVariant setSellingPlanAllocations(SellingPlanAllocationConnection arg) { - optimisticData.put(getKey("sellingPlanAllocations"), arg); + public QueryRoot setBlogByHandle(Blog arg) { + optimisticData.put(getKey("blogByHandle"), arg); return this; } /** - * The SKU (stock keeping unit) associated with the variant. + * List of the shop's blogs. */ - public String getSku() { - return (String) get("sku"); + public BlogConnection getBlogs() { + return (BlogConnection) get("blogs"); } - public ProductVariant setSku(String arg) { - optimisticData.put(getKey("sku"), arg); + public QueryRoot setBlogs(BlogConnection arg) { + optimisticData.put(getKey("blogs"), arg); return this; } /** - * The in-store pickup availability of this variant by location. + * Retrieve a cart by its ID. For more information, refer to + * [Manage a cart with the Storefront API](https://shopify.dev/custom-storefronts/cart/manage). */ - public StoreAvailabilityConnection getStoreAvailability() { - return (StoreAvailabilityConnection) get("storeAvailability"); + public Cart getCart() { + return (Cart) get("cart"); } - public ProductVariant setStoreAvailability(StoreAvailabilityConnection arg) { - optimisticData.put(getKey("storeAvailability"), arg); + public QueryRoot setCart(Cart arg) { + optimisticData.put(getKey("cart"), arg); return this; } /** - * The product variant’s title. + * A poll for the status of the cart checkout completion and order creation. */ - public String getTitle() { - return (String) get("title"); + public CartCompletionAttemptResult getCartCompletionAttempt() { + return (CartCompletionAttemptResult) get("cartCompletionAttempt"); } - public ProductVariant setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public QueryRoot setCartCompletionAttempt(CartCompletionAttemptResult arg) { + optimisticData.put(getKey("cartCompletionAttempt"), arg); return this; } /** - * The unit price value for the variant based on the variant's measurement. + * Fetch a specific `Collection` by one of its unique attributes. */ - public MoneyV2 getUnitPrice() { - return (MoneyV2) get("unitPrice"); + public Collection getCollection() { + return (Collection) get("collection"); } - public ProductVariant setUnitPrice(MoneyV2 arg) { - optimisticData.put(getKey("unitPrice"), arg); + public QueryRoot setCollection(Collection arg) { + optimisticData.put(getKey("collection"), arg); return this; } /** - * The unit price measurement for the variant. + * Find a collection by its handle. + * + * @deprecated Use `collection` instead. */ - public UnitPriceMeasurement getUnitPriceMeasurement() { - return (UnitPriceMeasurement) get("unitPriceMeasurement"); + public Collection getCollectionByHandle() { + return (Collection) get("collectionByHandle"); } - public ProductVariant setUnitPriceMeasurement(UnitPriceMeasurement arg) { - optimisticData.put(getKey("unitPriceMeasurement"), arg); + public QueryRoot setCollectionByHandle(Collection arg) { + optimisticData.put(getKey("collectionByHandle"), arg); return this; } /** - * The weight of the product variant in the unit system specified with `weight_unit`. + * List of the shop’s collections. */ - public Double getWeight() { - return (Double) get("weight"); + public CollectionConnection getCollections() { + return (CollectionConnection) get("collections"); } - public ProductVariant setWeight(Double arg) { - optimisticData.put(getKey("weight"), arg); + public QueryRoot setCollections(CollectionConnection arg) { + optimisticData.put(getKey("collections"), arg); return this; } /** - * Unit of measurement for weight. + * Find a customer by its access token. */ - public WeightUnit getWeightUnit() { - return (WeightUnit) get("weightUnit"); - } - - public ProductVariant setWeightUnit(WeightUnit arg) { - optimisticData.put(getKey("weightUnit"), arg); - return this; - } - - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "availableForSale": return false; - - case "barcode": return false; - - case "compareAtPrice": return true; - - case "compareAtPriceV2": return true; - - case "currentlyNotInStock": return false; - - case "id": return false; - - case "image": return true; - - case "metafield": return true; - - case "metafields": return true; - - case "price": return true; - - case "priceV2": return true; - - case "product": return true; - - case "quantityAvailable": return false; - - case "requiresShipping": return false; - - case "selectedOptions": return true; - - case "sellingPlanAllocations": return true; - - case "sku": return false; - - case "storeAvailability": return true; - - case "title": return false; - - case "unitPrice": return true; - - case "unitPriceMeasurement": return true; - - case "weight": return false; - - case "weightUnit": return false; - - default: return false; - } - } - } - - public interface ProductVariantConnectionQueryDefinition { - void define(ProductVariantConnectionQuery _queryBuilder); - } + public Customer getCustomer() { + return (Customer) get("customer"); + } - /** - * An auto-generated type for paginating through multiple ProductVariants. - */ - public static class ProductVariantConnectionQuery extends Query { - ProductVariantConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public QueryRoot setCustomer(Customer arg) { + optimisticData.put(getKey("customer"), arg); + return this; } /** - * A list of edges. + * Returns the localized experiences configured for the shop. */ - public ProductVariantConnectionQuery edges(ProductVariantEdgeQueryDefinition queryDef) { - startField("edges"); - _queryBuilder.append('{'); - queryDef.define(new ProductVariantEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Localization getLocalization() { + return (Localization) get("localization"); + } + public QueryRoot setLocalization(Localization arg) { + optimisticData.put(getKey("localization"), arg); return this; } /** - * A list of the nodes contained in ProductVariantEdge. + * List of the shop's locations that support in-store pickup. + * When sorting by distance, you must specify a location via the `near` argument. */ - public ProductVariantConnectionQuery nodes(ProductVariantQueryDefinition queryDef) { - startField("nodes"); - _queryBuilder.append('{'); - queryDef.define(new ProductVariantQuery(_queryBuilder)); - _queryBuilder.append('}'); + public LocationConnection getLocations() { + return (LocationConnection) get("locations"); + } + public QueryRoot setLocations(LocationConnection arg) { + optimisticData.put(getKey("locations"), arg); return this; } /** - * Information to aid in pagination. + * A storefront menu. */ - public ProductVariantConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Menu getMenu() { + return (Menu) get("menu"); + } + public QueryRoot setMenu(Menu arg) { + optimisticData.put(getKey("menu"), arg); return this; } - } - /** - * An auto-generated type for paginating through multiple ProductVariants. - */ - public static class ProductVariantConnection extends AbstractResponse { - public ProductVariantConnection() { + /** + * Fetch a specific Metaobject by one of its unique identifiers. + */ + + public Metaobject getMetaobject() { + return (Metaobject) get("metaobject"); } - public ProductVariantConnection(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 ProductVariantEdge(jsonAsObject(element1, key))); - } + public QueryRoot setMetaobject(Metaobject arg) { + optimisticData.put(getKey("metaobject"), arg); + return this; + } - responseData.put(key, list1); + /** + * All active metaobjects for the shop. + */ - break; - } + public MetaobjectConnection getMetaobjects() { + return (MetaobjectConnection) get("metaobjects"); + } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ProductVariant(jsonAsObject(element1, key))); - } + public QueryRoot setMetaobjects(MetaobjectConnection arg) { + optimisticData.put(getKey("metaobjects"), arg); + return this; + } - responseData.put(key, list1); + /** + * Returns a specific node by ID. + */ - break; - } + public Node getNode() { + return (Node) get("node"); + } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + public QueryRoot setNode(Node arg) { + optimisticData.put(getKey("node"), arg); + return this; + } - break; - } + /** + * Returns the list of nodes with the given IDs. + */ - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public List getNodes() { + return (List) get("nodes"); } - public String getGraphQlTypeName() { - return "ProductVariantConnection"; + public QueryRoot setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; } /** - * A list of edges. + * Fetch a specific `Page` by one of its unique attributes. */ - public List getEdges() { - return (List) get("edges"); + public Page getPage() { + return (Page) get("page"); } - public ProductVariantConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); + public QueryRoot setPage(Page arg) { + optimisticData.put(getKey("page"), arg); return this; } /** - * A list of the nodes contained in ProductVariantEdge. + * Find a page by its handle. + * + * @deprecated Use `page` instead. */ - public List getNodes() { - return (List) get("nodes"); + public Page getPageByHandle() { + return (Page) get("pageByHandle"); } - public ProductVariantConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + public QueryRoot setPageByHandle(Page arg) { + optimisticData.put(getKey("pageByHandle"), arg); return this; } /** - * Information to aid in pagination. + * List of the shop's pages. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public PageConnection getPages() { + return (PageConnection) get("pages"); } - public ProductVariantConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public QueryRoot setPages(PageConnection arg) { + optimisticData.put(getKey("pages"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return true; + /** + * Fetch a specific `Product` by one of its unique attributes. + */ - case "pageInfo": return true; + public Product getProduct() { + return (Product) get("product"); + } - default: return false; - } + public QueryRoot setProduct(Product arg) { + optimisticData.put(getKey("product"), arg); + return this; } - } - public interface ProductVariantEdgeQueryDefinition { - void define(ProductVariantEdgeQuery _queryBuilder); - } + /** + * Find a product by its handle. + * + * @deprecated Use `product` instead. + */ - /** - * An auto-generated type which holds one ProductVariant and a cursor during pagination. - */ - public static class ProductVariantEdgeQuery extends Query { - ProductVariantEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public Product getProductByHandle() { + return (Product) get("productByHandle"); + } + + public QueryRoot setProductByHandle(Product arg) { + optimisticData.put(getKey("productByHandle"), arg); + return this; } /** - * A cursor for use in pagination. + * Find recommended products related to a given `product_id`. + * To learn more about how recommendations are generated, see + * [*Showing product recommendations on product + * pages*](https://help.shopify.com/themes/development/recommended-products). */ - public ProductVariantEdgeQuery cursor() { - startField("cursor"); + public List getProductRecommendations() { + return (List) get("productRecommendations"); + } + + public QueryRoot setProductRecommendations(List arg) { + optimisticData.put(getKey("productRecommendations"), arg); return this; } /** - * The item at the end of ProductVariantEdge. + * Tags added to products. + * Additional access scope required: unauthenticated_read_product_tags. */ - public ProductVariantEdgeQuery node(ProductVariantQueryDefinition queryDef) { - startField("node"); - _queryBuilder.append('{'); - queryDef.define(new ProductVariantQuery(_queryBuilder)); - _queryBuilder.append('}'); + public StringConnection getProductTags() { + return (StringConnection) get("productTags"); + } + public QueryRoot setProductTags(StringConnection arg) { + optimisticData.put(getKey("productTags"), arg); return this; } - } - /** - * An auto-generated type which holds one ProductVariant and a cursor during pagination. - */ - public static class ProductVariantEdge extends AbstractResponse { - public ProductVariantEdge() { + /** + * List of product types for the shop's products that are published to your app. + */ + + public StringConnection getProductTypes() { + return (StringConnection) get("productTypes"); } - public ProductVariantEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + public QueryRoot setProductTypes(StringConnection arg) { + optimisticData.put(getKey("productTypes"), arg); + return this; + } - break; - } + /** + * List of the shop’s products. + */ - case "node": { - responseData.put(key, new ProductVariant(jsonAsObject(field.getValue(), key))); + public ProductConnection getProducts() { + return (ProductConnection) get("products"); + } - break; - } + public QueryRoot setProducts(ProductConnection arg) { + optimisticData.put(getKey("products"), arg); + return this; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + /** + * The list of public Storefront API versions, including supported, release candidate and unstable + * versions. + */ + + public List getPublicApiVersions() { + return (List) get("publicApiVersions"); } - public String getGraphQlTypeName() { - return "ProductVariantEdge"; + public QueryRoot setPublicApiVersions(List arg) { + optimisticData.put(getKey("publicApiVersions"), arg); + return this; } /** - * A cursor for use in pagination. + * The shop associated with the storefront access token. */ - public String getCursor() { - return (String) get("cursor"); + public Shop getShop() { + return (Shop) get("shop"); } - public ProductVariantEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public QueryRoot setShop(Shop arg) { + optimisticData.put(getKey("shop"), arg); return this; } /** - * The item at the end of ProductVariantEdge. + * A list of redirects for a shop. */ - public ProductVariant getNode() { - return (ProductVariant) get("node"); + public UrlRedirectConnection getUrlRedirects() { + return (UrlRedirectConnection) get("urlRedirects"); } - public ProductVariantEdge setNode(ProductVariant arg) { - optimisticData.put(getKey("node"), arg); + public QueryRoot setUrlRedirects(UrlRedirectConnection arg) { + optimisticData.put(getKey("urlRedirects"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cursor": return false; + case "article": return true; - case "node": return true; + case "articles": return true; - default: return false; - } - } - } + case "blog": return true; - /** - * The set of valid sort keys for the ProductVariant query. - */ - public enum ProductVariantSortKeys { - /** - * Sort by the `id` value. - */ - ID, + case "blogByHandle": return true; - /** - * Sort by the `position` value. - */ - POSITION, + case "blogs": return true; - /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. - */ - RELEVANCE, + case "cart": return true; - /** - * Sort by the `sku` value. - */ - SKU, + case "cartCompletionAttempt": return false; - /** - * Sort by the `title` value. - */ - TITLE, + case "collection": return true; - UNKNOWN_VALUE; + case "collectionByHandle": return true; - public static ProductVariantSortKeys fromGraphQl(String value) { - if (value == null) { - return null; - } + case "collections": return true; - switch (value) { - case "ID": { - return ID; - } + case "customer": return true; - case "POSITION": { - return POSITION; - } + case "localization": return true; - case "RELEVANCE": { - return RELEVANCE; - } + case "locations": return true; - case "SKU": { - return SKU; - } + case "menu": return true; - case "TITLE": { - return TITLE; - } + case "metaobject": return true; - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case ID: { - return "ID"; - } + case "metaobjects": return true; - case POSITION: { - return "POSITION"; - } + case "node": return false; - case RELEVANCE: { - return "RELEVANCE"; - } + case "nodes": return false; - case SKU: { - return "SKU"; - } + case "page": return true; - case TITLE: { - return "TITLE"; - } + case "pageByHandle": return true; - default: { - return ""; - } + case "pages": return true; + + case "product": return true; + + case "productByHandle": return true; + + case "productRecommendations": return true; + + case "productTags": return true; + + case "productTypes": return true; + + case "products": return true; + + case "publicApiVersions": return true; + + case "shop": return true; + + case "urlRedirects": return true; + + default: return false; } } } - public interface QueryRootQueryDefinition { - void define(QueryRootQuery _queryBuilder); + public interface SEOQueryDefinition { + void define(SEOQuery _queryBuilder); } /** - * The schema’s entry-point for queries. This acts as the public, top-level API from which all queries - * must start. + * SEO information. */ - public static class QueryRootQuery extends Query { - QueryRootQuery(StringBuilder _queryBuilder) { + public static class SEOQuery extends Query { + SEOQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } - public class ArticlesArguments extends Arguments { - ArticlesArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * The meta description. + */ + public SEOQuery description() { + startField("description"); - /** - * Returns up to the first `n` elements from the list. - */ - public ArticlesArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + return this; + } - /** - * Returns the elements that come after the specified cursor. - */ - public ArticlesArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + /** + * The SEO title. + */ + public SEOQuery title() { + startField("title"); - /** - * Returns up to the last `n` elements from the list. - */ - public ArticlesArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + return this; + } + } - /** - * Returns the elements that come before the specified cursor. - */ - public ArticlesArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + /** + * SEO information. + */ + public static class SEO extends AbstractResponse { + public SEO() { + } + + public SEO(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "description": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - /** - * Reverse the order of the underlying list. - */ - public ArticlesArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + responseData.put(key, optional1); - /** - * Sort the underlying list by the given key. - */ - public ArticlesArguments sortKey(ArticleSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; - } + break; + } - /** - * Supported filter parameters: - * - `author` - * - `blog_title` - * - `created_at` - * - `tag` - * - `tag_not` - * - `updated_at` - * See the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) - * for more information about using filters. - */ - public ArticlesArguments query(String value) { - if (value != null) { - startArgument("query"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "title": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } } - public interface ArticlesArgumentsDefinition { - void define(ArticlesArguments args); + public String getGraphQlTypeName() { + return "SEO"; } /** - * List of the shop's articles. + * The meta description. */ - public QueryRootQuery articles(ArticleConnectionQueryDefinition queryDef) { - return articles(args -> {}, queryDef); + + public String getDescription() { + return (String) get("description"); + } + + public SEO setDescription(String arg) { + optimisticData.put(getKey("description"), arg); + return this; } /** - * List of the shop's articles. + * The SEO title. */ - public QueryRootQuery articles(ArticlesArgumentsDefinition argsDef, ArticleConnectionQueryDefinition queryDef) { - startField("articles"); - - ArticlesArguments args = new ArticlesArguments(_queryBuilder); - argsDef.define(args); - ArticlesArguments.end(args); - _queryBuilder.append('{'); - queryDef.define(new ArticleConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getTitle() { + return (String) get("title"); + } + public SEO setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } - public class BlogArguments extends Arguments { - BlogArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "description": return false; - /** - * The ID of the `Blog`. - */ - public BlogArguments id(ID value) { - if (value != null) { - startArgument("id"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + case "title": return false; - /** - * The handle of the `Blog`. - */ - public BlogArguments handle(String value) { - if (value != null) { - startArgument("handle"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; + default: return false; } } + } - public interface BlogArgumentsDefinition { - void define(BlogArguments args); + public interface ScriptDiscountApplicationQueryDefinition { + void define(ScriptDiscountApplicationQuery _queryBuilder); + } + + /** + * Script discount applications capture the intentions of a discount that + * was created by a Shopify Script. + */ + public static class ScriptDiscountApplicationQuery extends Query { + ScriptDiscountApplicationQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * Fetch a specific `Blog` by one of its unique attributes. + * The method by which the discount's value is allocated to its entitled items. */ - public QueryRootQuery blog(BlogQueryDefinition queryDef) { - return blog(args -> {}, queryDef); + public ScriptDiscountApplicationQuery allocationMethod() { + startField("allocationMethod"); + + return this; } /** - * Fetch a specific `Blog` by one of its unique attributes. + * Which lines of targetType that the discount is allocated over. */ - public QueryRootQuery blog(BlogArgumentsDefinition argsDef, BlogQueryDefinition queryDef) { - startField("blog"); + public ScriptDiscountApplicationQuery targetSelection() { + startField("targetSelection"); - BlogArguments args = new BlogArguments(_queryBuilder); - argsDef.define(args); - BlogArguments.end(args); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new BlogQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The type of line that the discount is applicable towards. + */ + public ScriptDiscountApplicationQuery targetType() { + startField("targetType"); return this; } /** - * Find a blog by its handle. - * - * @deprecated Use `blog` instead. + * The title of the application as defined by the Script. */ - @Deprecated - public QueryRootQuery blogByHandle(String handle, BlogQueryDefinition queryDef) { - startField("blogByHandle"); + public ScriptDiscountApplicationQuery title() { + startField("title"); - _queryBuilder.append("(handle:"); - Query.appendQuotedString(_queryBuilder, handle.toString()); + return this; + } - _queryBuilder.append(')'); + /** + * The value of the discount application. + */ + public ScriptDiscountApplicationQuery value(PricingValueQueryDefinition queryDef) { + startField("value"); _queryBuilder.append('{'); - queryDef.define(new BlogQuery(_queryBuilder)); + queryDef.define(new PricingValueQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - public class BlogsArguments extends Arguments { - BlogsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * Script discount applications capture the intentions of a discount that + * was created by a Shopify Script. + */ + public static class ScriptDiscountApplication extends AbstractResponse implements DiscountApplication { + public ScriptDiscountApplication() { + } - /** - * Returns up to the first `n` elements from the list. - */ - public BlogsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public ScriptDiscountApplication(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "allocationMethod": { + responseData.put(key, DiscountApplicationAllocationMethod.fromGraphQl(jsonAsString(field.getValue(), key))); - /** - * Returns the elements that come after the specified cursor. - */ - public BlogsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + break; + } - /** - * Returns up to the last `n` elements from the list. - */ - public BlogsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + case "targetSelection": { + responseData.put(key, DiscountApplicationTargetSelection.fromGraphQl(jsonAsString(field.getValue(), key))); - /** - * Returns the elements that come before the specified cursor. - */ - public BlogsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + break; + } - /** - * Reverse the order of the underlying list. - */ - public BlogsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + case "targetType": { + responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); - /** - * Sort the underlying list by the given key. - */ - public BlogsArguments sortKey(BlogSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; - } + break; + } - /** - * Supported filter parameters: - * - `created_at` - * - `handle` - * - `title` - * - `updated_at` - * See the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) - * for more information about using filters. - */ - public BlogsArguments query(String value) { - if (value != null) { - startArgument("query"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "value": { + responseData.put(key, UnknownPricingValue.create(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } } - public interface BlogsArgumentsDefinition { - void define(BlogsArguments args); + public String getGraphQlTypeName() { + return "ScriptDiscountApplication"; } /** - * List of the shop's blogs. + * The method by which the discount's value is allocated to its entitled items. */ - public QueryRootQuery blogs(BlogConnectionQueryDefinition queryDef) { - return blogs(args -> {}, queryDef); + + public DiscountApplicationAllocationMethod getAllocationMethod() { + return (DiscountApplicationAllocationMethod) get("allocationMethod"); + } + + public ScriptDiscountApplication setAllocationMethod(DiscountApplicationAllocationMethod arg) { + optimisticData.put(getKey("allocationMethod"), arg); + return this; } /** - * List of the shop's blogs. + * Which lines of targetType that the discount is allocated over. */ - public QueryRootQuery blogs(BlogsArgumentsDefinition argsDef, BlogConnectionQueryDefinition queryDef) { - startField("blogs"); - BlogsArguments args = new BlogsArguments(_queryBuilder); - argsDef.define(args); - BlogsArguments.end(args); + public DiscountApplicationTargetSelection getTargetSelection() { + return (DiscountApplicationTargetSelection) get("targetSelection"); + } - _queryBuilder.append('{'); - queryDef.define(new BlogConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ScriptDiscountApplication setTargetSelection(DiscountApplicationTargetSelection arg) { + optimisticData.put(getKey("targetSelection"), arg); + return this; + } + + /** + * The type of line that the discount is applicable towards. + */ + + public DiscountApplicationTargetType getTargetType() { + return (DiscountApplicationTargetType) get("targetType"); + } + public ScriptDiscountApplication setTargetType(DiscountApplicationTargetType arg) { + optimisticData.put(getKey("targetType"), arg); return this; } /** - * Retrieve a cart by its ID. For more information, refer to - * [Manage a cart with the Storefront API](https://shopify.dev/custom-storefronts/cart/manage). + * The title of the application as defined by the Script. */ - public QueryRootQuery cart(ID id, CartQueryDefinition queryDef) { - startField("cart"); - _queryBuilder.append("(id:"); - Query.appendQuotedString(_queryBuilder, id.toString()); + public String getTitle() { + return (String) get("title"); + } - _queryBuilder.append(')'); + public ScriptDiscountApplication setTitle(String arg) { + optimisticData.put(getKey("title"), arg); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new CartQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The value of the discount application. + */ + + public PricingValue getValue() { + return (PricingValue) get("value"); + } + public ScriptDiscountApplication setValue(PricingValue arg) { + optimisticData.put(getKey("value"), arg); return this; } - public class CollectionArguments extends Arguments { - CollectionArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "allocationMethod": return false; - /** - * The ID of the `Collection`. - */ - public CollectionArguments id(ID value) { - if (value != null) { - startArgument("id"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; + case "targetSelection": return false; + + case "targetType": return false; + + case "title": return false; + + case "value": return false; + + default: return false; } + } + } - /** - * The handle of the `Collection`. - */ - public CollectionArguments handle(String value) { - if (value != null) { - startArgument("handle"); - Query.appendQuotedString(_queryBuilder, value.toString()); + public interface SelectedOptionQueryDefinition { + void define(SelectedOptionQuery _queryBuilder); + } + + /** + * Properties used by customers to select a product variant. + * Products can have multiple options, like different sizes or colors. + */ + public static class SelectedOptionQuery extends Query { + SelectedOptionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The product option’s name. + */ + public SelectedOptionQuery name() { + startField("name"); + + return this; + } + + /** + * The product option’s value. + */ + public SelectedOptionQuery value() { + startField("value"); + + return this; + } + } + + /** + * Properties used by customers to select a product variant. + * Products can have multiple options, like different sizes or colors. + */ + public static class SelectedOption extends AbstractResponse { + public SelectedOption() { + } + + public SelectedOption(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "value": { + 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()); + } } - return this; } } - public interface CollectionArgumentsDefinition { - void define(CollectionArguments args); + public String getGraphQlTypeName() { + return "SelectedOption"; } /** - * Fetch a specific `Collection` by one of its unique attributes. + * The product option’s name. */ - public QueryRootQuery collection(CollectionQueryDefinition queryDef) { - return collection(args -> {}, queryDef); + + public String getName() { + return (String) get("name"); + } + + public SelectedOption setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; } /** - * Fetch a specific `Collection` by one of its unique attributes. + * The product option’s value. */ - public QueryRootQuery collection(CollectionArgumentsDefinition argsDef, CollectionQueryDefinition queryDef) { - startField("collection"); - - CollectionArguments args = new CollectionArguments(_queryBuilder); - argsDef.define(args); - CollectionArguments.end(args); - _queryBuilder.append('{'); - queryDef.define(new CollectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getValue() { + return (String) get("value"); + } + public SelectedOption setValue(String arg) { + optimisticData.put(getKey("value"), arg); return this; } - /** - * Find a collection by its handle. - * - * @deprecated Use `collection` instead. - */ - @Deprecated - public QueryRootQuery collectionByHandle(String handle, CollectionQueryDefinition queryDef) { - startField("collectionByHandle"); - - _queryBuilder.append("(handle:"); - Query.appendQuotedString(_queryBuilder, handle.toString()); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "name": return false; + + case "value": return false; + + default: return false; + } + } + } + + public static class SelectedOptionInput implements Serializable { + private String name; - _queryBuilder.append(')'); + private String value; - _queryBuilder.append('{'); - queryDef.define(new CollectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SelectedOptionInput(String name, String value) { + this.name = name; - return this; + this.value = value; } - public class CollectionsArguments extends Arguments { - CollectionsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + public String getName() { + return name; + } - /** - * Returns up to the first `n` elements from the list. - */ - public CollectionsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public SelectedOptionInput setName(String name) { + this.name = name; + return this; + } - /** - * Returns the elements that come after the specified cursor. - */ - public CollectionsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public String getValue() { + return value; + } - /** - * Returns up to the last `n` elements from the list. - */ - public CollectionsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + public SelectedOptionInput setValue(String value) { + this.value = value; + return this; + } - /** - * Returns the elements that come before the specified cursor. - */ - public CollectionsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - /** - * Reverse the order of the underlying list. - */ - public CollectionsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("name:"); + Query.appendQuotedString(_queryBuilder, name.toString()); - /** - * Sort the underlying list by the given key. - */ - public CollectionsArguments sortKey(CollectionSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("value:"); + Query.appendQuotedString(_queryBuilder, value.toString()); - /** - * Supported filter parameters: - * - `collection_type` - * - `title` - * - `updated_at` - * See the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) - * for more information about using filters. - */ - public CollectionsArguments query(String value) { - if (value != null) { - startArgument("query"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + _queryBuilder.append('}'); } + } - public interface CollectionsArgumentsDefinition { - void define(CollectionsArguments args); + public interface SellingPlanQueryDefinition { + void define(SellingPlanQuery _queryBuilder); + } + + /** + * Represents how products and variants can be sold and purchased. + */ + public static class SellingPlanQuery extends Query { + SellingPlanQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * List of the shop’s collections. + * The initial payment due for the purchase. */ - public QueryRootQuery collections(CollectionConnectionQueryDefinition queryDef) { - return collections(args -> {}, queryDef); + public SellingPlanQuery checkoutCharge(SellingPlanCheckoutChargeQueryDefinition queryDef) { + startField("checkoutCharge"); + + _queryBuilder.append('{'); + queryDef.define(new SellingPlanCheckoutChargeQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * List of the shop’s collections. + * The description of the selling plan. */ - public QueryRootQuery collections(CollectionsArgumentsDefinition argsDef, CollectionConnectionQueryDefinition queryDef) { - startField("collections"); + public SellingPlanQuery description() { + startField("description"); - CollectionsArguments args = new CollectionsArguments(_queryBuilder); - argsDef.define(args); - CollectionsArguments.end(args); + return this; + } - _queryBuilder.append('{'); - queryDef.define(new CollectionConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * A globally-unique identifier. + */ + public SellingPlanQuery id() { + startField("id"); return this; } /** - * Find a customer by its access token. + * The name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'. */ - public QueryRootQuery customer(String customerAccessToken, CustomerQueryDefinition queryDef) { - startField("customer"); + public SellingPlanQuery name() { + startField("name"); - _queryBuilder.append("(customerAccessToken:"); - Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + return this; + } - _queryBuilder.append(')'); + /** + * The selling plan options available in the drop-down list in the storefront. For example, 'Delivery + * every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the product. + * Individual selling plans contribute their options to the associated selling plan group. For example, + * a selling plan group might have an option called `option1: Delivery every`. One selling plan in that + * group could contribute `option1: 2 weeks` with the pricing for that option, and another selling plan + * could contribute `option1: 4 weeks`, with different pricing. + */ + public SellingPlanQuery options(SellingPlanOptionQueryDefinition queryDef) { + startField("options"); _queryBuilder.append('{'); - queryDef.define(new CustomerQuery(_queryBuilder)); + queryDef.define(new SellingPlanOptionQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Returns the localized experiences configured for the shop. + * The price adjustments that a selling plan makes when a variant is purchased with a selling plan. */ - public QueryRootQuery localization(LocalizationQueryDefinition queryDef) { - startField("localization"); + public SellingPlanQuery priceAdjustments(SellingPlanPriceAdjustmentQueryDefinition queryDef) { + startField("priceAdjustments"); _queryBuilder.append('{'); - queryDef.define(new LocalizationQuery(_queryBuilder)); + queryDef.define(new SellingPlanPriceAdjustmentQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } - public class LocationsArguments extends Arguments { - LocationsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public LocationsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + /** + * Whether purchasing the selling plan will result in multiple deliveries. + */ + public SellingPlanQuery recurringDeliveries() { + startField("recurringDeliveries"); - /** - * Returns the elements that come after the specified cursor. - */ - public LocationsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + return this; + } + } - /** - * Returns up to the last `n` elements from the list. - */ - public LocationsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + /** + * Represents how products and variants can be sold and purchased. + */ + public static class SellingPlan extends AbstractResponse { + public SellingPlan() { + } - /** - * Returns the elements that come before the specified cursor. - */ - public LocationsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public SellingPlan(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "checkoutCharge": { + responseData.put(key, new SellingPlanCheckoutCharge(jsonAsObject(field.getValue(), key))); - /** - * Reverse the order of the underlying list. - */ - public LocationsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + break; + } - /** - * Sort the underlying list by the given key. - */ - public LocationsArguments sortKey(LocationSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; - } + case "description": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - /** - * Used to sort results based on proximity to the provided location. - */ - public LocationsArguments near(GeoCoordinateInput value) { - if (value != null) { - startArgument("near"); - value.appendTo(_queryBuilder); - } - return this; - } - } + responseData.put(key, optional1); - public interface LocationsArgumentsDefinition { - void define(LocationsArguments args); - } + break; + } - /** - * List of the shop's locations that support in-store pickup. - * When sorting by distance, you must specify a location via the `near` argument. - */ - public QueryRootQuery locations(LocationConnectionQueryDefinition queryDef) { - return locations(args -> {}, queryDef); - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - /** - * List of the shop's locations that support in-store pickup. - * When sorting by distance, you must specify a location via the `near` argument. - */ - public QueryRootQuery locations(LocationsArgumentsDefinition argsDef, LocationConnectionQueryDefinition queryDef) { - startField("locations"); + break; + } - LocationsArguments args = new LocationsArguments(_queryBuilder); - argsDef.define(args); - LocationsArguments.end(args); + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); - _queryBuilder.append('{'); - queryDef.define(new LocationConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + break; + } - return this; - } + case "options": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlanOption(jsonAsObject(element1, key))); + } - /** - * A storefront menu. - */ - public QueryRootQuery menu(String handle, MenuQueryDefinition queryDef) { - startField("menu"); + responseData.put(key, list1); - _queryBuilder.append("(handle:"); - Query.appendQuotedString(_queryBuilder, handle.toString()); + break; + } - _queryBuilder.append(')'); + case "priceAdjustments": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlanPriceAdjustment(jsonAsObject(element1, key))); + } - _queryBuilder.append('{'); - queryDef.define(new MenuQuery(_queryBuilder)); - _queryBuilder.append('}'); + responseData.put(key, list1); - return this; - } + break; + } - public class MetaobjectArguments extends Arguments { - MetaobjectArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + case "recurringDeliveries": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - /** - * The ID of the metaobject. - */ - public MetaobjectArguments id(ID value) { - if (value != null) { - startArgument("id"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + break; + } - /** - * The handle and type of the metaobject. - */ - public MetaobjectArguments handle(MetaobjectHandleInput value) { - if (value != null) { - startArgument("handle"); - value.appendTo(_queryBuilder); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } } - public interface MetaobjectArgumentsDefinition { - void define(MetaobjectArguments args); + public String getGraphQlTypeName() { + return "SellingPlan"; } /** - * Fetch a specific Metaobject by one of its unique identifiers. + * The initial payment due for the purchase. */ - public QueryRootQuery metaobject(MetaobjectQueryDefinition queryDef) { - return metaobject(args -> {}, queryDef); + + public SellingPlanCheckoutCharge getCheckoutCharge() { + return (SellingPlanCheckoutCharge) get("checkoutCharge"); + } + + public SellingPlan setCheckoutCharge(SellingPlanCheckoutCharge arg) { + optimisticData.put(getKey("checkoutCharge"), arg); + return this; } /** - * Fetch a specific Metaobject by one of its unique identifiers. + * The description of the selling plan. */ - public QueryRootQuery metaobject(MetaobjectArgumentsDefinition argsDef, MetaobjectQueryDefinition queryDef) { - startField("metaobject"); - MetaobjectArguments args = new MetaobjectArguments(_queryBuilder); - argsDef.define(args); - MetaobjectArguments.end(args); - - _queryBuilder.append('{'); - queryDef.define(new MetaobjectQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getDescription() { + return (String) get("description"); + } + public SellingPlan setDescription(String arg) { + optimisticData.put(getKey("description"), arg); return this; } - public class MetaobjectsArguments extends Arguments { - MetaobjectsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } + /** + * A globally-unique identifier. + */ - /** - * The key of a field to sort with. Supports "id" and "updated_at". - */ - public MetaobjectsArguments sortKey(String value) { - if (value != null) { - startArgument("sortKey"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public ID getId() { + return (ID) get("id"); + } - /** - * Returns up to the first `n` elements from the list. - */ - public MetaobjectsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public SellingPlan setId(ID arg) { + optimisticData.put(getKey("id"), arg); + return this; + } - /** - * Returns the elements that come after the specified cursor. - */ - public MetaobjectsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + /** + * The name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'. + */ - /** - * Returns up to the last `n` elements from the list. - */ - public MetaobjectsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + public String getName() { + return (String) get("name"); + } - /** - * Returns the elements that come before the specified cursor. - */ - public MetaobjectsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public SellingPlan setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } + + /** + * The selling plan options available in the drop-down list in the storefront. For example, 'Delivery + * every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the product. + * Individual selling plans contribute their options to the associated selling plan group. For example, + * a selling plan group might have an option called `option1: Delivery every`. One selling plan in that + * group could contribute `option1: 2 weeks` with the pricing for that option, and another selling plan + * could contribute `option1: 4 weeks`, with different pricing. + */ - /** - * Reverse the order of the underlying list. - */ - public MetaobjectsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + public List getOptions() { + return (List) get("options"); } - public interface MetaobjectsArgumentsDefinition { - void define(MetaobjectsArguments args); + public SellingPlan setOptions(List arg) { + optimisticData.put(getKey("options"), arg); + return this; } /** - * All active metaobjects for the shop. + * The price adjustments that a selling plan makes when a variant is purchased with a selling plan. */ - public QueryRootQuery metaobjects(String type, MetaobjectConnectionQueryDefinition queryDef) { - return metaobjects(type, args -> {}, queryDef); + + public List getPriceAdjustments() { + return (List) get("priceAdjustments"); + } + + public SellingPlan setPriceAdjustments(List arg) { + optimisticData.put(getKey("priceAdjustments"), arg); + return this; } /** - * All active metaobjects for the shop. + * Whether purchasing the selling plan will result in multiple deliveries. */ - public QueryRootQuery metaobjects(String type, MetaobjectsArgumentsDefinition argsDef, MetaobjectConnectionQueryDefinition queryDef) { - startField("metaobjects"); - _queryBuilder.append("(type:"); - Query.appendQuotedString(_queryBuilder, type.toString()); + public Boolean getRecurringDeliveries() { + return (Boolean) get("recurringDeliveries"); + } - argsDef.define(new MetaobjectsArguments(_queryBuilder)); + public SellingPlan setRecurringDeliveries(Boolean arg) { + optimisticData.put(getKey("recurringDeliveries"), arg); + return this; + } - _queryBuilder.append(')'); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "checkoutCharge": return true; + + case "description": return false; + + case "id": return false; + + case "name": return false; + + case "options": return true; + + case "priceAdjustments": return true; + + case "recurringDeliveries": return false; + + default: return false; + } + } + } + + public interface SellingPlanAllocationQueryDefinition { + void define(SellingPlanAllocationQuery _queryBuilder); + } + + /** + * Represents an association between a variant and a selling plan. Selling plan allocations describe + * the options offered for each variant, and the price of the variant when purchased with a selling + * plan. + */ + public static class SellingPlanAllocationQuery extends Query { + SellingPlanAllocationQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The checkout charge amount due for the purchase. + */ + public SellingPlanAllocationQuery checkoutChargeAmount(MoneyV2QueryDefinition queryDef) { + startField("checkoutChargeAmount"); _queryBuilder.append('{'); - queryDef.define(new MetaobjectConnectionQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Returns a specific node by ID. + * A list of price adjustments, with a maximum of two. When there are two, the first price adjustment + * goes into effect at the time of purchase, while the second one starts after a certain number of + * orders. A price adjustment represents how a selling plan affects pricing when a variant is purchased + * with a selling plan. Prices display in the customer's currency if the shop is configured for it. */ - public QueryRootQuery node(ID id, NodeQueryDefinition queryDef) { - startField("node"); - - _queryBuilder.append("(id:"); - Query.appendQuotedString(_queryBuilder, id.toString()); - - _queryBuilder.append(')'); + public SellingPlanAllocationQuery priceAdjustments(SellingPlanAllocationPriceAdjustmentQueryDefinition queryDef) { + startField("priceAdjustments"); _queryBuilder.append('{'); - queryDef.define(new NodeQuery(_queryBuilder)); + queryDef.define(new SellingPlanAllocationPriceAdjustmentQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Returns the list of nodes with the given IDs. + * The remaining balance charge amount due for the purchase. */ - public QueryRootQuery nodes(List ids, NodeQueryDefinition queryDef) { - startField("nodes"); + public SellingPlanAllocationQuery remainingBalanceChargeAmount(MoneyV2QueryDefinition queryDef) { + startField("remainingBalanceChargeAmount"); - _queryBuilder.append("(ids:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (ID item1 : ids) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - Query.appendQuotedString(_queryBuilder, item1.toString()); - } - } - _queryBuilder.append(']'); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - _queryBuilder.append(')'); + return this; + } + + /** + * A representation of how products and variants can be sold and purchased. For example, an individual + * selling plan could be '6 weeks of prepaid granola, delivered weekly'. + */ + public SellingPlanAllocationQuery sellingPlan(SellingPlanQueryDefinition queryDef) { + startField("sellingPlan"); _queryBuilder.append('{'); - queryDef.define(new NodeQuery(_queryBuilder)); + queryDef.define(new SellingPlanQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - public class PageArguments extends Arguments { - PageArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * Represents an association between a variant and a selling plan. Selling plan allocations describe + * the options offered for each variant, and the price of the variant when purchased with a selling + * plan. + */ + public static class SellingPlanAllocation extends AbstractResponse { + public SellingPlanAllocation() { + } - /** - * The ID of the `Page`. - */ - public PageArguments id(ID value) { - if (value != null) { - startArgument("id"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public SellingPlanAllocation(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "checkoutChargeAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - /** - * The handle of the `Page`. - */ - public PageArguments handle(String value) { - if (value != null) { - startArgument("handle"); - Query.appendQuotedString(_queryBuilder, value.toString()); + break; + } + + case "priceAdjustments": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlanAllocationPriceAdjustment(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "remainingBalanceChargeAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "sellingPlan": { + responseData.put(key, new SellingPlan(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } } - public interface PageArgumentsDefinition { - void define(PageArguments args); + public String getGraphQlTypeName() { + return "SellingPlanAllocation"; } /** - * Fetch a specific `Page` by one of its unique attributes. + * The checkout charge amount due for the purchase. */ - public QueryRootQuery page(PageQueryDefinition queryDef) { - return page(args -> {}, queryDef); + + public MoneyV2 getCheckoutChargeAmount() { + return (MoneyV2) get("checkoutChargeAmount"); + } + + public SellingPlanAllocation setCheckoutChargeAmount(MoneyV2 arg) { + optimisticData.put(getKey("checkoutChargeAmount"), arg); + return this; } /** - * Fetch a specific `Page` by one of its unique attributes. + * A list of price adjustments, with a maximum of two. When there are two, the first price adjustment + * goes into effect at the time of purchase, while the second one starts after a certain number of + * orders. A price adjustment represents how a selling plan affects pricing when a variant is purchased + * with a selling plan. Prices display in the customer's currency if the shop is configured for it. */ - public QueryRootQuery page(PageArgumentsDefinition argsDef, PageQueryDefinition queryDef) { - startField("page"); - - PageArguments args = new PageArguments(_queryBuilder); - argsDef.define(args); - PageArguments.end(args); - _queryBuilder.append('{'); - queryDef.define(new PageQuery(_queryBuilder)); - _queryBuilder.append('}'); + public List getPriceAdjustments() { + return (List) get("priceAdjustments"); + } + public SellingPlanAllocation setPriceAdjustments(List arg) { + optimisticData.put(getKey("priceAdjustments"), arg); return this; } /** - * Find a page by its handle. - * - * @deprecated Use `page` instead. + * The remaining balance charge amount due for the purchase. */ - @Deprecated - public QueryRootQuery pageByHandle(String handle, PageQueryDefinition queryDef) { - startField("pageByHandle"); - - _queryBuilder.append("(handle:"); - Query.appendQuotedString(_queryBuilder, handle.toString()); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new PageQuery(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getRemainingBalanceChargeAmount() { + return (MoneyV2) get("remainingBalanceChargeAmount"); + } + public SellingPlanAllocation setRemainingBalanceChargeAmount(MoneyV2 arg) { + optimisticData.put(getKey("remainingBalanceChargeAmount"), arg); return this; } - public class PagesArguments extends Arguments { - PagesArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * A representation of how products and variants can be sold and purchased. For example, an individual + * selling plan could be '6 weeks of prepaid granola, delivered weekly'. + */ - /** - * Returns up to the first `n` elements from the list. - */ - public PagesArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public SellingPlan getSellingPlan() { + return (SellingPlan) get("sellingPlan"); + } - /** - * Returns the elements that come after the specified cursor. - */ - public PagesArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public SellingPlanAllocation setSellingPlan(SellingPlan arg) { + optimisticData.put(getKey("sellingPlan"), arg); + return this; + } - /** - * Returns up to the last `n` elements from the list. - */ - public PagesArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "checkoutChargeAmount": return true; - /** - * Returns the elements that come before the specified cursor. - */ - public PagesArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + case "priceAdjustments": return true; - /** - * Reverse the order of the underlying list. - */ - public PagesArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + case "remainingBalanceChargeAmount": return true; - /** - * Sort the underlying list by the given key. - */ - public PagesArguments sortKey(PageSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; - } + case "sellingPlan": return true; - /** - * Supported filter parameters: - * - `created_at` - * - `handle` - * - `title` - * - `updated_at` - * See the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) - * for more information about using filters. - */ - public PagesArguments query(String value) { - if (value != null) { - startArgument("query"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; + default: return false; } } + } - public interface PagesArgumentsDefinition { - void define(PagesArguments args); + public interface SellingPlanAllocationConnectionQueryDefinition { + void define(SellingPlanAllocationConnectionQuery _queryBuilder); + } + + /** + * An auto-generated type for paginating through multiple SellingPlanAllocations. + */ + public static class SellingPlanAllocationConnectionQuery extends Query { + SellingPlanAllocationConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * List of the shop's pages. + * A list of edges. */ - public QueryRootQuery pages(PageConnectionQueryDefinition queryDef) { - return pages(args -> {}, queryDef); + public SellingPlanAllocationConnectionQuery edges(SellingPlanAllocationEdgeQueryDefinition queryDef) { + startField("edges"); + + _queryBuilder.append('{'); + queryDef.define(new SellingPlanAllocationEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * List of the shop's pages. + * A list of the nodes contained in SellingPlanAllocationEdge. */ - public QueryRootQuery pages(PagesArgumentsDefinition argsDef, PageConnectionQueryDefinition queryDef) { - startField("pages"); + public SellingPlanAllocationConnectionQuery nodes(SellingPlanAllocationQueryDefinition queryDef) { + startField("nodes"); - PagesArguments args = new PagesArguments(_queryBuilder); - argsDef.define(args); - PagesArguments.end(args); + _queryBuilder.append('{'); + queryDef.define(new SellingPlanAllocationQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * Information to aid in pagination. + */ + public SellingPlanAllocationConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); _queryBuilder.append('{'); - queryDef.define(new PageConnectionQuery(_queryBuilder)); + queryDef.define(new PageInfoQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - public class ProductArguments extends Arguments { - ProductArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * An auto-generated type for paginating through multiple SellingPlanAllocations. + */ + public static class SellingPlanAllocationConnection extends AbstractResponse { + public SellingPlanAllocationConnection() { + } - /** - * The ID of the `Product`. - */ - public ProductArguments id(ID value) { - if (value != null) { - startArgument("id"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public SellingPlanAllocationConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlanAllocationEdge(jsonAsObject(element1, key))); + } - /** - * The handle of the `Product`. - */ - public ProductArguments handle(String value) { - if (value != null) { - startArgument("handle"); - Query.appendQuotedString(_queryBuilder, value.toString()); + responseData.put(key, list1); + + break; + } + + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlanAllocation(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } } - public interface ProductArgumentsDefinition { - void define(ProductArguments args); + public String getGraphQlTypeName() { + return "SellingPlanAllocationConnection"; } /** - * Fetch a specific `Product` by one of its unique attributes. + * A list of edges. */ - public QueryRootQuery product(ProductQueryDefinition queryDef) { - return product(args -> {}, queryDef); + + public List getEdges() { + return (List) get("edges"); + } + + public SellingPlanAllocationConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; } /** - * Fetch a specific `Product` by one of its unique attributes. + * A list of the nodes contained in SellingPlanAllocationEdge. */ - public QueryRootQuery product(ProductArgumentsDefinition argsDef, ProductQueryDefinition queryDef) { - startField("product"); - - ProductArguments args = new ProductArguments(_queryBuilder); - argsDef.define(args); - ProductArguments.end(args); - _queryBuilder.append('{'); - queryDef.define(new ProductQuery(_queryBuilder)); - _queryBuilder.append('}'); + public List getNodes() { + return (List) get("nodes"); + } + public SellingPlanAllocationConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * Find a product by its handle. - * - * @deprecated Use `product` instead. + * Information to aid in pagination. */ - @Deprecated - public QueryRootQuery productByHandle(String handle, ProductQueryDefinition queryDef) { - startField("productByHandle"); - - _queryBuilder.append("(handle:"); - Query.appendQuotedString(_queryBuilder, handle.toString()); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new ProductQuery(_queryBuilder)); - _queryBuilder.append('}'); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } + public SellingPlanAllocationConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } - /** - * Find recommended products related to a given `product_id`. - * To learn more about how recommendations are generated, see - * [*Showing product recommendations on product - * pages*](https://help.shopify.com/themes/development/recommended-products). - */ - public QueryRootQuery productRecommendations(ID productId, ProductQueryDefinition queryDef) { - startField("productRecommendations"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - _queryBuilder.append("(productId:"); - Query.appendQuotedString(_queryBuilder, productId.toString()); + case "nodes": return true; - _queryBuilder.append(')'); + case "pageInfo": return true; - _queryBuilder.append('{'); - queryDef.define(new ProductQuery(_queryBuilder)); - _queryBuilder.append('}'); + default: return false; + } + } + } - return this; + public interface SellingPlanAllocationEdgeQueryDefinition { + void define(SellingPlanAllocationEdgeQuery _queryBuilder); + } + + /** + * An auto-generated type which holds one SellingPlanAllocation and a cursor during pagination. + */ + public static class SellingPlanAllocationEdgeQuery extends Query { + SellingPlanAllocationEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * Tags added to products. - * Additional access scope required: unauthenticated_read_product_tags. + * A cursor for use in pagination. */ - public QueryRootQuery productTags(int first, StringConnectionQueryDefinition queryDef) { - startField("productTags"); - - _queryBuilder.append("(first:"); - _queryBuilder.append(first); - - _queryBuilder.append(')'); - - _queryBuilder.append('{'); - queryDef.define(new StringConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SellingPlanAllocationEdgeQuery cursor() { + startField("cursor"); return this; } /** - * List of product types for the shop's products that are published to your app. + * The item at the end of SellingPlanAllocationEdge. */ - public QueryRootQuery productTypes(int first, StringConnectionQueryDefinition queryDef) { - startField("productTypes"); - - _queryBuilder.append("(first:"); - _queryBuilder.append(first); - - _queryBuilder.append(')'); + public SellingPlanAllocationEdgeQuery node(SellingPlanAllocationQueryDefinition queryDef) { + startField("node"); _queryBuilder.append('{'); - queryDef.define(new StringConnectionQuery(_queryBuilder)); + queryDef.define(new SellingPlanAllocationQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - public class ProductsArguments extends Arguments { - ProductsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public ProductsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public ProductsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + /** + * An auto-generated type which holds one SellingPlanAllocation and a cursor during pagination. + */ + public static class SellingPlanAllocationEdge extends AbstractResponse { + public SellingPlanAllocationEdge() { + } - /** - * Returns up to the last `n` elements from the list. - */ - public ProductsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + public SellingPlanAllocationEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * Returns the elements that come before the specified cursor. - */ - public ProductsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + break; + } - /** - * Reverse the order of the underlying list. - */ - public ProductsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + case "node": { + responseData.put(key, new SellingPlanAllocation(jsonAsObject(field.getValue(), key))); - /** - * Sort the underlying list by the given key. - */ - public ProductsArguments sortKey(ProductSortKeys value) { - if (value != null) { - startArgument("sortKey"); - _queryBuilder.append(value.toString()); - } - return this; - } + break; + } - /** - * Supported filter parameters: - * - `available_for_sale` - * - `created_at` - * - `product_type` - * - `tag` - * - `tag_not` - * - `title` - * - `updated_at` - * - `variants.price` - * - `vendor` - * See the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) - * for more information about using filters. - */ - public ProductsArguments query(String value) { - if (value != null) { - startArgument("query"); - Query.appendQuotedString(_queryBuilder, value.toString()); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } - return this; } } - public interface ProductsArgumentsDefinition { - void define(ProductsArguments args); + public String getGraphQlTypeName() { + return "SellingPlanAllocationEdge"; } /** - * List of the shop’s products. + * A cursor for use in pagination. */ - public QueryRootQuery products(ProductConnectionQueryDefinition queryDef) { - return products(args -> {}, queryDef); + + public String getCursor() { + return (String) get("cursor"); + } + + public SellingPlanAllocationEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); + return this; } /** - * List of the shop’s products. + * The item at the end of SellingPlanAllocationEdge. */ - public QueryRootQuery products(ProductsArgumentsDefinition argsDef, ProductConnectionQueryDefinition queryDef) { - startField("products"); - - ProductsArguments args = new ProductsArguments(_queryBuilder); - argsDef.define(args); - ProductsArguments.end(args); - _queryBuilder.append('{'); - queryDef.define(new ProductConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SellingPlanAllocation getNode() { + return (SellingPlanAllocation) get("node"); + } + public SellingPlanAllocationEdge setNode(SellingPlanAllocation arg) { + optimisticData.put(getKey("node"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; + + case "node": return true; + + default: return false; + } + } + } + + public interface SellingPlanAllocationPriceAdjustmentQueryDefinition { + void define(SellingPlanAllocationPriceAdjustmentQuery _queryBuilder); + } + + /** + * The resulting prices for variants when they're purchased with a specific selling plan. + */ + public static class SellingPlanAllocationPriceAdjustmentQuery extends Query { + SellingPlanAllocationPriceAdjustmentQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + /** - * The list of public Storefront API versions, including supported, release candidate and unstable - * versions. + * The price of the variant when it's purchased without a selling plan for the same number of + * deliveries. For example, if a customer purchases 6 deliveries of $10.00 granola separately, then the + * price is 6 x $10.00 = $60.00. */ - public QueryRootQuery publicApiVersions(ApiVersionQueryDefinition queryDef) { - startField("publicApiVersions"); + public SellingPlanAllocationPriceAdjustmentQuery compareAtPrice(MoneyV2QueryDefinition queryDef) { + startField("compareAtPrice"); _queryBuilder.append('{'); - queryDef.define(new ApiVersionQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The shop associated with the storefront access token. + * The effective price for a single delivery. For example, for a prepaid subscription plan that + * includes 6 deliveries at the price of $48.00, the per delivery price is $8.00. */ - public QueryRootQuery shop(ShopQueryDefinition queryDef) { - startField("shop"); + public SellingPlanAllocationPriceAdjustmentQuery perDeliveryPrice(MoneyV2QueryDefinition queryDef) { + startField("perDeliveryPrice"); _queryBuilder.append('{'); - queryDef.define(new ShopQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); 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; - } - - /** - * Supported filter parameters: - * - `created_at` - * - `path` - * - `target` - * See the detailed [search syntax](https://shopify.dev/api/usage/search-syntax) - * for more information about using filters. - */ - public UrlRedirectsArguments query(String value) { - if (value != null) { - startArgument("query"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - } - - public interface UrlRedirectsArgumentsDefinition { - void define(UrlRedirectsArguments args); - } - /** - * A list of redirects for a shop. + * The price of the variant when it's purchased with a selling plan For example, for a prepaid + * subscription plan that includes 6 deliveries of $10.00 granola, where the customer gets 20% off, the + * price is 6 x $10.00 x 0.80 = $48.00. */ - public QueryRootQuery urlRedirects(UrlRedirectConnectionQueryDefinition queryDef) { - return urlRedirects(args -> {}, queryDef); + public SellingPlanAllocationPriceAdjustmentQuery price(MoneyV2QueryDefinition queryDef) { + startField("price"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * A list of redirects for a shop. + * The resulting price per unit for the variant associated with the selling plan. If the variant isn't + * sold by quantity or measurement, then this field returns `null`. */ - public QueryRootQuery urlRedirects(UrlRedirectsArgumentsDefinition argsDef, UrlRedirectConnectionQueryDefinition queryDef) { - startField("urlRedirects"); - - UrlRedirectsArguments args = new UrlRedirectsArguments(_queryBuilder); - argsDef.define(args); - UrlRedirectsArguments.end(args); + public SellingPlanAllocationPriceAdjustmentQuery unitPrice(MoneyV2QueryDefinition queryDef) { + startField("unitPrice"); _queryBuilder.append('{'); - queryDef.define(new UrlRedirectConnectionQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } - - public String toString() { - return _queryBuilder.toString(); - } } /** - * The schema’s entry-point for queries. This acts as the public, top-level API from which all queries - * must start. + * The resulting prices for variants when they're purchased with a specific selling plan. */ - public static class QueryRoot extends AbstractResponse { - public QueryRoot() { + public static class SellingPlanAllocationPriceAdjustment extends AbstractResponse { + public SellingPlanAllocationPriceAdjustment() { } - public QueryRoot(JsonObject fields) throws SchemaViolationError { + public SellingPlanAllocationPriceAdjustment(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "articles": { - responseData.put(key, new ArticleConnection(jsonAsObject(field.getValue(), key))); - - break; - } - - case "blog": { - Blog optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Blog(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "blogByHandle": { - Blog optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Blog(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "compareAtPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "blogs": { - responseData.put(key, new BlogConnection(jsonAsObject(field.getValue(), key))); + case "perDeliveryPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "cart": { - Cart optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Cart(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "price": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "collection": { - Collection optional1 = null; + case "unitPrice": { + MoneyV2 optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Collection(jsonAsObject(field.getValue(), key)); + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -55976,204 +62927,241 @@ public QueryRoot(JsonObject fields) throws SchemaViolationError { break; } - case "collectionByHandle": { - Collection optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Collection(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - - case "collections": { - responseData.put(key, new CollectionConnection(jsonAsObject(field.getValue(), key))); - - break; + default: { + throw new SchemaViolationError(this, key, field.getValue()); } + } + } + } - case "customer": { - Customer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Customer(jsonAsObject(field.getValue(), key)); - } + public String getGraphQlTypeName() { + return "SellingPlanAllocationPriceAdjustment"; + } - responseData.put(key, optional1); + /** + * The price of the variant when it's purchased without a selling plan for the same number of + * deliveries. For example, if a customer purchases 6 deliveries of $10.00 granola separately, then the + * price is 6 x $10.00 = $60.00. + */ - break; - } + public MoneyV2 getCompareAtPrice() { + return (MoneyV2) get("compareAtPrice"); + } - case "localization": { - responseData.put(key, new Localization(jsonAsObject(field.getValue(), key))); + public SellingPlanAllocationPriceAdjustment setCompareAtPrice(MoneyV2 arg) { + optimisticData.put(getKey("compareAtPrice"), arg); + return this; + } - break; - } + /** + * The effective price for a single delivery. For example, for a prepaid subscription plan that + * includes 6 deliveries at the price of $48.00, the per delivery price is $8.00. + */ - case "locations": { - responseData.put(key, new LocationConnection(jsonAsObject(field.getValue(), key))); + public MoneyV2 getPerDeliveryPrice() { + return (MoneyV2) get("perDeliveryPrice"); + } - break; - } + public SellingPlanAllocationPriceAdjustment setPerDeliveryPrice(MoneyV2 arg) { + optimisticData.put(getKey("perDeliveryPrice"), arg); + return this; + } - case "menu": { - Menu optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Menu(jsonAsObject(field.getValue(), key)); - } + /** + * The price of the variant when it's purchased with a selling plan For example, for a prepaid + * subscription plan that includes 6 deliveries of $10.00 granola, where the customer gets 20% off, the + * price is 6 x $10.00 x 0.80 = $48.00. + */ - responseData.put(key, optional1); + public MoneyV2 getPrice() { + return (MoneyV2) get("price"); + } - break; - } + public SellingPlanAllocationPriceAdjustment setPrice(MoneyV2 arg) { + optimisticData.put(getKey("price"), arg); + return this; + } - case "metaobject": { - Metaobject optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metaobject(jsonAsObject(field.getValue(), key)); - } + /** + * The resulting price per unit for the variant associated with the selling plan. If the variant isn't + * sold by quantity or measurement, then this field returns `null`. + */ - responseData.put(key, optional1); + public MoneyV2 getUnitPrice() { + return (MoneyV2) get("unitPrice"); + } - break; - } + public SellingPlanAllocationPriceAdjustment setUnitPrice(MoneyV2 arg) { + optimisticData.put(getKey("unitPrice"), arg); + return this; + } - case "metaobjects": { - responseData.put(key, new MetaobjectConnection(jsonAsObject(field.getValue(), key))); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "compareAtPrice": return true; - break; - } + case "perDeliveryPrice": return true; - case "node": { - Node optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = UnknownNode.create(jsonAsObject(field.getValue(), key)); - } + case "price": return true; - responseData.put(key, optional1); + case "unitPrice": return true; - break; - } + default: return false; + } + } + } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Node optional2 = null; - if (!element1.isJsonNull()) { - optional2 = UnknownNode.create(jsonAsObject(element1, key)); - } + public interface SellingPlanCheckoutChargeQueryDefinition { + void define(SellingPlanCheckoutChargeQuery _queryBuilder); + } - list1.add(optional2); - } + /** + * The initial payment due for the purchase. + */ + public static class SellingPlanCheckoutChargeQuery extends Query { + SellingPlanCheckoutChargeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - responseData.put(key, list1); + /** + * The charge type for the checkout charge. + */ + public SellingPlanCheckoutChargeQuery type() { + startField("type"); - break; - } + return this; + } - case "page": { - Page optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Page(jsonAsObject(field.getValue(), key)); - } + /** + * The charge value for the checkout charge. + */ + public SellingPlanCheckoutChargeQuery value(SellingPlanCheckoutChargeValueQueryDefinition queryDef) { + startField("value"); - responseData.put(key, optional1); + _queryBuilder.append('{'); + queryDef.define(new SellingPlanCheckoutChargeValueQuery(_queryBuilder)); + _queryBuilder.append('}'); - break; - } + return this; + } + } - case "pageByHandle": { - Page optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Page(jsonAsObject(field.getValue(), key)); - } + /** + * The initial payment due for the purchase. + */ + public static class SellingPlanCheckoutCharge extends AbstractResponse { + public SellingPlanCheckoutCharge() { + } - responseData.put(key, optional1); + 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 "pages": { - responseData.put(key, new PageConnection(jsonAsObject(field.getValue(), key))); + case "value": { + responseData.put(key, UnknownSellingPlanCheckoutChargeValue.create(jsonAsObject(field.getValue(), key))); break; } - case "product": { - Product optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Product(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - - case "productByHandle": { - Product optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Product(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; + default: { + throw new SchemaViolationError(this, key, field.getValue()); } + } + } + } - case "productRecommendations": { - List optional1 = null; - if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Product(jsonAsObject(element1, key))); - } + public String getGraphQlTypeName() { + return "SellingPlanCheckoutCharge"; + } - optional1 = list1; - } + /** + * The charge type for the checkout charge. + */ - responseData.put(key, optional1); + public SellingPlanCheckoutChargeType getType() { + return (SellingPlanCheckoutChargeType) get("type"); + } - break; - } + public SellingPlanCheckoutCharge setType(SellingPlanCheckoutChargeType arg) { + optimisticData.put(getKey("type"), arg); + return this; + } - case "productTags": { - responseData.put(key, new StringConnection(jsonAsObject(field.getValue(), key))); + /** + * The charge value for the checkout charge. + */ - break; - } + public SellingPlanCheckoutChargeValue getValue() { + return (SellingPlanCheckoutChargeValue) get("value"); + } - case "productTypes": { - responseData.put(key, new StringConnection(jsonAsObject(field.getValue(), key))); + public SellingPlanCheckoutCharge setValue(SellingPlanCheckoutChargeValue arg) { + optimisticData.put(getKey("value"), arg); + return this; + } - break; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "type": return false; - case "products": { - responseData.put(key, new ProductConnection(jsonAsObject(field.getValue(), key))); + case "value": return false; - break; - } + default: return false; + } + } + } - case "publicApiVersions": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ApiVersion(jsonAsObject(element1, key))); - } + public interface SellingPlanCheckoutChargePercentageValueQueryDefinition { + void define(SellingPlanCheckoutChargePercentageValueQuery _queryBuilder); + } - responseData.put(key, list1); + /** + * The percentage value of the price used for checkout charge. + */ + public static class SellingPlanCheckoutChargePercentageValueQuery extends Query { + SellingPlanCheckoutChargePercentageValueQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - break; - } + /** + * The percentage value of the price used for checkout charge. + */ + public SellingPlanCheckoutChargePercentageValueQuery percentage() { + startField("percentage"); - case "shop": { - responseData.put(key, new Shop(jsonAsObject(field.getValue(), key))); + return this; + } + } - break; - } + /** + * The percentage value of the price used for checkout charge. + */ + public static class SellingPlanCheckoutChargePercentageValue extends AbstractResponse implements SellingPlanCheckoutChargeValue { + public SellingPlanCheckoutChargePercentageValue() { + } - case "urlRedirects": { - responseData.put(key, new UrlRedirectConnection(jsonAsObject(field.getValue(), key))); + 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; } @@ -56190,495 +63178,753 @@ public QueryRoot(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "QueryRoot"; + return "SellingPlanCheckoutChargePercentageValue"; } /** - * List of the shop's articles. + * The percentage value of the price used for checkout charge. */ - public ArticleConnection getArticles() { - return (ArticleConnection) get("articles"); + public Double getPercentage() { + return (Double) get("percentage"); } - public QueryRoot setArticles(ArticleConnection arg) { - optimisticData.put(getKey("articles"), arg); + 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 { /** - * Fetch a specific `Blog` by one of its unique attributes. + * The checkout charge is a percentage of the product or variant price. */ + PERCENTAGE, - public Blog getBlog() { - return (Blog) get("blog"); + /** + * 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"; + } - public QueryRoot setBlog(Blog arg) { - optimisticData.put(getKey("blog"), arg); - return this; + case PRICE: { + return "PRICE"; + } + + default: { + return ""; + } + } } + } - /** - * Find a blog by its handle. - * - * @deprecated Use `blog` instead. - */ + public interface SellingPlanCheckoutChargeValueQueryDefinition { + void define(SellingPlanCheckoutChargeValueQuery _queryBuilder); + } - public Blog getBlogByHandle() { - return (Blog) get("blogByHandle"); + /** + * The portion of the price to be charged at checkout. + */ + public static class SellingPlanCheckoutChargeValueQuery extends Query { + SellingPlanCheckoutChargeValueQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("__typename"); } - public QueryRoot setBlogByHandle(Blog arg) { - optimisticData.put(getKey("blogByHandle"), arg); + public SellingPlanCheckoutChargeValueQuery onMoneyV2(MoneyV2QueryDefinition queryDef) { + startInlineFragment("MoneyV2"); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * List of the shop's blogs. - */ + public SellingPlanCheckoutChargeValueQuery onSellingPlanCheckoutChargePercentageValue(SellingPlanCheckoutChargePercentageValueQueryDefinition queryDef) { + startInlineFragment("SellingPlanCheckoutChargePercentageValue"); + queryDef.define(new SellingPlanCheckoutChargePercentageValueQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + } - public BlogConnection getBlogs() { - return (BlogConnection) get("blogs"); + 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 QueryRoot setBlogs(BlogConnection arg) { - optimisticData.put(getKey("blogs"), arg); - return this; + 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()); + } + } + } } - /** - * Retrieve a cart by its ID. For more information, refer to - * [Manage a cart with the Storefront API](https://shopify.dev/custom-storefronts/cart/manage). - */ + public static SellingPlanCheckoutChargeValue create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "MoneyV2": { + return new MoneyV2(fields); + } - public Cart getCart() { - return (Cart) get("cart"); + case "SellingPlanCheckoutChargePercentageValue": { + return new SellingPlanCheckoutChargePercentageValue(fields); + } + + default: { + return new UnknownSellingPlanCheckoutChargeValue(fields); + } + } } - public QueryRoot setCart(Cart arg) { - optimisticData.put(getKey("cart"), arg); - return this; + public String getGraphQlTypeName() { + return (String) get("__typename"); + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + default: return false; + } + } + } + + public interface SellingPlanConnectionQueryDefinition { + void define(SellingPlanConnectionQuery _queryBuilder); + } + + /** + * An auto-generated type for paginating through multiple SellingPlans. + */ + public static class SellingPlanConnectionQuery extends Query { + SellingPlanConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * Fetch a specific `Collection` by one of its unique attributes. + * A list of edges. */ + public SellingPlanConnectionQuery edges(SellingPlanEdgeQueryDefinition queryDef) { + startField("edges"); - public Collection getCollection() { - return (Collection) get("collection"); - } + _queryBuilder.append('{'); + queryDef.define(new SellingPlanEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); - public QueryRoot setCollection(Collection arg) { - optimisticData.put(getKey("collection"), arg); return this; } /** - * Find a collection by its handle. - * - * @deprecated Use `collection` instead. + * A list of the nodes contained in SellingPlanEdge. */ + public SellingPlanConnectionQuery nodes(SellingPlanQueryDefinition queryDef) { + startField("nodes"); - public Collection getCollectionByHandle() { - return (Collection) get("collectionByHandle"); - } + _queryBuilder.append('{'); + queryDef.define(new SellingPlanQuery(_queryBuilder)); + _queryBuilder.append('}'); - public QueryRoot setCollectionByHandle(Collection arg) { - optimisticData.put(getKey("collectionByHandle"), arg); return this; } /** - * List of the shop’s collections. + * Information to aid in pagination. */ + public SellingPlanConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - public CollectionConnection getCollections() { - return (CollectionConnection) get("collections"); - } + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); - public QueryRoot setCollections(CollectionConnection arg) { - optimisticData.put(getKey("collections"), arg); return this; } + } - /** - * Find a customer by its access token. - */ + /** + * An auto-generated type for paginating through multiple SellingPlans. + */ + public static class SellingPlanConnection extends AbstractResponse { + public SellingPlanConnection() { + } - public Customer getCustomer() { - return (Customer) get("customer"); + public SellingPlanConnection(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlanEdge(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlan(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public QueryRoot setCustomer(Customer arg) { - optimisticData.put(getKey("customer"), arg); - return this; + public String getGraphQlTypeName() { + return "SellingPlanConnection"; } /** - * Returns the localized experiences configured for the shop. + * A list of edges. */ - public Localization getLocalization() { - return (Localization) get("localization"); + public List getEdges() { + return (List) get("edges"); } - public QueryRoot setLocalization(Localization arg) { - optimisticData.put(getKey("localization"), arg); + public SellingPlanConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * List of the shop's locations that support in-store pickup. - * When sorting by distance, you must specify a location via the `near` argument. + * A list of the nodes contained in SellingPlanEdge. */ - public LocationConnection getLocations() { - return (LocationConnection) get("locations"); + public List getNodes() { + return (List) get("nodes"); } - public QueryRoot setLocations(LocationConnection arg) { - optimisticData.put(getKey("locations"), arg); + public SellingPlanConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * A storefront menu. + * Information to aid in pagination. */ - public Menu getMenu() { - return (Menu) get("menu"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public QueryRoot setMenu(Menu arg) { - optimisticData.put(getKey("menu"), arg); + public SellingPlanConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } - /** - * Fetch a specific Metaobject by one of its unique identifiers. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - public Metaobject getMetaobject() { - return (Metaobject) get("metaobject"); + case "nodes": return true; + + case "pageInfo": return true; + + default: return false; + } } + } - public QueryRoot setMetaobject(Metaobject arg) { - optimisticData.put(getKey("metaobject"), arg); - return this; + public interface SellingPlanEdgeQueryDefinition { + void define(SellingPlanEdgeQuery _queryBuilder); + } + + /** + * An auto-generated type which holds one SellingPlan and a cursor during pagination. + */ + public static class SellingPlanEdgeQuery extends Query { + SellingPlanEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * All active metaobjects for the shop. + * A cursor for use in pagination. */ + public SellingPlanEdgeQuery cursor() { + startField("cursor"); - public MetaobjectConnection getMetaobjects() { - return (MetaobjectConnection) get("metaobjects"); - } - - public QueryRoot setMetaobjects(MetaobjectConnection arg) { - optimisticData.put(getKey("metaobjects"), arg); return this; } /** - * Returns a specific node by ID. + * The item at the end of SellingPlanEdge. */ + public SellingPlanEdgeQuery node(SellingPlanQueryDefinition queryDef) { + startField("node"); - public Node getNode() { - return (Node) get("node"); - } + _queryBuilder.append('{'); + queryDef.define(new SellingPlanQuery(_queryBuilder)); + _queryBuilder.append('}'); - public QueryRoot setNode(Node arg) { - optimisticData.put(getKey("node"), arg); return this; } + } - /** - * Returns the list of nodes with the given IDs. - */ - - public List getNodes() { - return (List) get("nodes"); + /** + * An auto-generated type which holds one SellingPlan and a cursor during pagination. + */ + public static class SellingPlanEdge extends AbstractResponse { + public SellingPlanEdge() { } - public QueryRoot setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; - } + public SellingPlanEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); - /** - * Fetch a specific `Page` by one of its unique attributes. - */ + break; + } - public Page getPage() { - return (Page) get("page"); + case "node": { + responseData.put(key, new SellingPlan(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public QueryRoot setPage(Page arg) { - optimisticData.put(getKey("page"), arg); - return this; + public String getGraphQlTypeName() { + return "SellingPlanEdge"; } /** - * Find a page by its handle. - * - * @deprecated Use `page` instead. + * A cursor for use in pagination. */ - public Page getPageByHandle() { - return (Page) get("pageByHandle"); + public String getCursor() { + return (String) get("cursor"); } - public QueryRoot setPageByHandle(Page arg) { - optimisticData.put(getKey("pageByHandle"), arg); + public SellingPlanEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * List of the shop's pages. + * The item at the end of SellingPlanEdge. */ - public PageConnection getPages() { - return (PageConnection) get("pages"); + public SellingPlan getNode() { + return (SellingPlan) get("node"); } - public QueryRoot setPages(PageConnection arg) { - optimisticData.put(getKey("pages"), arg); + public SellingPlanEdge setNode(SellingPlan arg) { + optimisticData.put(getKey("node"), arg); return this; } - /** - * Fetch a specific `Product` by one of its unique attributes. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - public Product getProduct() { - return (Product) get("product"); + case "node": return true; + + default: return false; + } } + } - public QueryRoot setProduct(Product arg) { - optimisticData.put(getKey("product"), arg); - return this; + public interface SellingPlanFixedAmountPriceAdjustmentQueryDefinition { + void define(SellingPlanFixedAmountPriceAdjustmentQuery _queryBuilder); + } + + /** + * A fixed amount that's deducted from the original variant price. For example, $10.00 off. + */ + public static class SellingPlanFixedAmountPriceAdjustmentQuery extends Query { + SellingPlanFixedAmountPriceAdjustmentQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * Find a product by its handle. - * - * @deprecated Use `product` instead. + * The money value of the price adjustment. */ + public SellingPlanFixedAmountPriceAdjustmentQuery adjustmentAmount(MoneyV2QueryDefinition queryDef) { + startField("adjustmentAmount"); - public Product getProductByHandle() { - return (Product) get("productByHandle"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public QueryRoot setProductByHandle(Product arg) { - optimisticData.put(getKey("productByHandle"), arg); return this; } + } - /** - * Find recommended products related to a given `product_id`. - * To learn more about how recommendations are generated, see - * [*Showing product recommendations on product - * pages*](https://help.shopify.com/themes/development/recommended-products). - */ - - public List getProductRecommendations() { - return (List) get("productRecommendations"); + /** + * A fixed amount that's deducted from the original variant price. For example, $10.00 off. + */ + public static class SellingPlanFixedAmountPriceAdjustment extends AbstractResponse implements SellingPlanPriceAdjustmentValue { + public SellingPlanFixedAmountPriceAdjustment() { } - public QueryRoot setProductRecommendations(List arg) { - optimisticData.put(getKey("productRecommendations"), arg); - return this; - } + public SellingPlanFixedAmountPriceAdjustment(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "adjustmentAmount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - /** - * Tags added to products. - * Additional access scope required: unauthenticated_read_product_tags. - */ + break; + } - public StringConnection getProductTags() { - return (StringConnection) get("productTags"); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public QueryRoot setProductTags(StringConnection arg) { - optimisticData.put(getKey("productTags"), arg); - return this; + public String getGraphQlTypeName() { + return "SellingPlanFixedAmountPriceAdjustment"; } /** - * List of product types for the shop's products that are published to your app. + * The money value of the price adjustment. */ - public StringConnection getProductTypes() { - return (StringConnection) get("productTypes"); + public MoneyV2 getAdjustmentAmount() { + return (MoneyV2) get("adjustmentAmount"); } - public QueryRoot setProductTypes(StringConnection arg) { - optimisticData.put(getKey("productTypes"), arg); + public SellingPlanFixedAmountPriceAdjustment setAdjustmentAmount(MoneyV2 arg) { + optimisticData.put(getKey("adjustmentAmount"), arg); return this; } - /** - * List of the shop’s products. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "adjustmentAmount": return true; - public ProductConnection getProducts() { - return (ProductConnection) get("products"); + default: return false; + } } + } - public QueryRoot setProducts(ProductConnection arg) { - optimisticData.put(getKey("products"), arg); - return this; + public interface SellingPlanFixedPriceAdjustmentQueryDefinition { + void define(SellingPlanFixedPriceAdjustmentQuery _queryBuilder); + } + + /** + * A fixed price adjustment for a variant that's purchased with a selling plan. + */ + public static class SellingPlanFixedPriceAdjustmentQuery extends Query { + SellingPlanFixedPriceAdjustmentQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The list of public Storefront API versions, including supported, release candidate and unstable - * versions. + * A new price of the variant when it's purchased with the selling plan. */ + public SellingPlanFixedPriceAdjustmentQuery price(MoneyV2QueryDefinition queryDef) { + startField("price"); - public List getPublicApiVersions() { - return (List) get("publicApiVersions"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public QueryRoot setPublicApiVersions(List arg) { - optimisticData.put(getKey("publicApiVersions"), arg); return this; } + } - /** - * The shop associated with the storefront access token. - */ + /** + * A fixed price adjustment for a variant that's purchased with a selling plan. + */ + public static class SellingPlanFixedPriceAdjustment extends AbstractResponse implements SellingPlanPriceAdjustmentValue { + public SellingPlanFixedPriceAdjustment() { + } - public Shop getShop() { - return (Shop) get("shop"); + public SellingPlanFixedPriceAdjustment(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "price": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public QueryRoot setShop(Shop arg) { - optimisticData.put(getKey("shop"), arg); - return this; + public String getGraphQlTypeName() { + return "SellingPlanFixedPriceAdjustment"; } /** - * A list of redirects for a shop. + * A new price of the variant when it's purchased with the selling plan. */ - public UrlRedirectConnection getUrlRedirects() { - return (UrlRedirectConnection) get("urlRedirects"); + public MoneyV2 getPrice() { + return (MoneyV2) get("price"); } - public QueryRoot setUrlRedirects(UrlRedirectConnection arg) { - optimisticData.put(getKey("urlRedirects"), arg); + public SellingPlanFixedPriceAdjustment setPrice(MoneyV2 arg) { + optimisticData.put(getKey("price"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "articles": return true; - - case "blog": return true; - - case "blogByHandle": return true; - - case "blogs": return true; - - case "cart": return true; - - case "collection": return true; - - case "collectionByHandle": return true; - - case "collections": return true; - - case "customer": return true; - - case "localization": return true; - - case "locations": return true; - - case "menu": return true; - - case "metaobject": return true; + case "price": return true; - case "metaobjects": return true; + default: return false; + } + } + } - case "node": return false; + public interface SellingPlanGroupQueryDefinition { + void define(SellingPlanGroupQuery _queryBuilder); + } - case "nodes": return false; + /** + * Represents a selling method. For example, 'Subscribe and save' is a selling method where customers + * pay for goods or services per delivery. A selling plan group contains individual selling plans. + */ + public static class SellingPlanGroupQuery extends Query { + SellingPlanGroupQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - case "page": return true; + /** + * A display friendly name for the app that created the selling plan group. + */ + public SellingPlanGroupQuery appName() { + startField("appName"); - case "pageByHandle": return true; + return this; + } - case "pages": return true; + /** + * The name of the selling plan group. + */ + public SellingPlanGroupQuery name() { + startField("name"); - case "product": return true; + return this; + } - case "productByHandle": return true; + /** + * Represents the selling plan options available in the drop-down list in the storefront. For example, + * 'Delivery every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the + * product. + */ + public SellingPlanGroupQuery options(SellingPlanGroupOptionQueryDefinition queryDef) { + startField("options"); - case "productRecommendations": return true; + _queryBuilder.append('{'); + queryDef.define(new SellingPlanGroupOptionQuery(_queryBuilder)); + _queryBuilder.append('}'); - case "productTags": return true; + return this; + } - case "productTypes": return true; + public class SellingPlansArguments extends Arguments { + SellingPlansArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - case "products": return true; + /** + * Returns up to the first `n` elements from the list. + */ + public SellingPlansArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - case "publicApiVersions": return true; + /** + * Returns the elements that come after the specified cursor. + */ + public SellingPlansArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - case "shop": return true; + /** + * Returns up to the last `n` elements from the list. + */ + public SellingPlansArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - case "urlRedirects": return true; + /** + * Returns the elements that come before the specified cursor. + */ + public SellingPlansArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - default: return false; + /** + * Reverse the order of the underlying list. + */ + public SellingPlansArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; } } - } - - public interface SEOQueryDefinition { - void define(SEOQuery _queryBuilder); - } - /** - * SEO information. - */ - public static class SEOQuery extends Query { - SEOQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public interface SellingPlansArgumentsDefinition { + void define(SellingPlansArguments args); } /** - * The meta description. + * A list of selling plans in a selling plan group. A selling plan is a representation of how products + * and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of + * prepaid granola, delivered weekly'. */ - public SEOQuery description() { - startField("description"); - - return this; + public SellingPlanGroupQuery sellingPlans(SellingPlanConnectionQueryDefinition queryDef) { + return sellingPlans(args -> {}, queryDef); } /** - * The SEO title. + * A list of selling plans in a selling plan group. A selling plan is a representation of how products + * and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of + * prepaid granola, delivered weekly'. */ - public SEOQuery title() { - startField("title"); + public SellingPlanGroupQuery sellingPlans(SellingPlansArgumentsDefinition argsDef, SellingPlanConnectionQueryDefinition queryDef) { + startField("sellingPlans"); + + SellingPlansArguments args = new SellingPlansArguments(_queryBuilder); + argsDef.define(args); + SellingPlansArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new SellingPlanConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * SEO information. + * Represents a selling method. For example, 'Subscribe and save' is a selling method where customers + * pay for goods or services per delivery. A selling plan group contains individual selling plans. */ - public static class SEO extends AbstractResponse { - public SEO() { + public static class SellingPlanGroup extends AbstractResponse { + public SellingPlanGroup() { } - public SEO(JsonObject fields) throws SchemaViolationError { + public SellingPlanGroup(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "description": { + case "appName": { String optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = jsonAsString(field.getValue(), key); @@ -56689,13 +63935,25 @@ public SEO(JsonObject fields) throws SchemaViolationError { break; } - case "title": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "options": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlanGroupOption(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); + + break; + } + + case "sellingPlans": { + responseData.put(key, new SellingPlanConnection(jsonAsObject(field.getValue(), key))); break; } @@ -56712,103 +63970,126 @@ public SEO(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "SEO"; + return "SellingPlanGroup"; } /** - * The meta description. + * A display friendly name for the app that created the selling plan group. */ - public String getDescription() { - return (String) get("description"); + public String getAppName() { + return (String) get("appName"); } - public SEO setDescription(String arg) { - optimisticData.put(getKey("description"), arg); + public SellingPlanGroup setAppName(String arg) { + optimisticData.put(getKey("appName"), arg); return this; } /** - * The SEO title. + * The name of the selling plan group. */ - public String getTitle() { - return (String) get("title"); + public String getName() { + return (String) get("name"); } - public SEO setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public SellingPlanGroup setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } + + /** + * Represents the selling plan options available in the drop-down list in the storefront. For example, + * 'Delivery every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the + * product. + */ + + public List getOptions() { + return (List) get("options"); + } + + public SellingPlanGroup setOptions(List arg) { + optimisticData.put(getKey("options"), arg); + return this; + } + + /** + * A list of selling plans in a selling plan group. A selling plan is a representation of how products + * and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of + * prepaid granola, delivered weekly'. + */ + + public SellingPlanConnection getSellingPlans() { + return (SellingPlanConnection) get("sellingPlans"); + } + + public SellingPlanGroup setSellingPlans(SellingPlanConnection arg) { + optimisticData.put(getKey("sellingPlans"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "description": return false; + case "appName": return false; - case "title": return false; + case "name": return false; + + case "options": return true; + + case "sellingPlans": return true; default: return false; } } } - public interface ScriptDiscountApplicationQueryDefinition { - void define(ScriptDiscountApplicationQuery _queryBuilder); + public interface SellingPlanGroupConnectionQueryDefinition { + void define(SellingPlanGroupConnectionQuery _queryBuilder); } /** - * Script discount applications capture the intentions of a discount that - * was created by a Shopify Script. + * An auto-generated type for paginating through multiple SellingPlanGroups. */ - public static class ScriptDiscountApplicationQuery extends Query { - ScriptDiscountApplicationQuery(StringBuilder _queryBuilder) { + public static class SellingPlanGroupConnectionQuery extends Query { + SellingPlanGroupConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The method by which the discount's value is allocated to its entitled items. + * A list of edges. */ - public ScriptDiscountApplicationQuery allocationMethod() { - startField("allocationMethod"); - - return this; - } + public SellingPlanGroupConnectionQuery edges(SellingPlanGroupEdgeQueryDefinition queryDef) { + startField("edges"); - /** - * Which lines of targetType that the discount is allocated over. - */ - public ScriptDiscountApplicationQuery targetSelection() { - startField("targetSelection"); + _queryBuilder.append('{'); + queryDef.define(new SellingPlanGroupEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The type of line that the discount is applicable towards. + * A list of the nodes contained in SellingPlanGroupEdge. */ - public ScriptDiscountApplicationQuery targetType() { - startField("targetType"); - - return this; - } + public SellingPlanGroupConnectionQuery nodes(SellingPlanGroupQueryDefinition queryDef) { + startField("nodes"); - /** - * The title of the application as defined by the Script. - */ - public ScriptDiscountApplicationQuery title() { - startField("title"); + _queryBuilder.append('{'); + queryDef.define(new SellingPlanGroupQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The value of the discount application. + * Information to aid in pagination. */ - public ScriptDiscountApplicationQuery value(PricingValueQueryDefinition queryDef) { - startField("value"); + public SellingPlanGroupConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); _queryBuilder.append('{'); - queryDef.define(new PricingValueQuery(_queryBuilder)); + queryDef.define(new PageInfoQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -56816,44 +64097,41 @@ public ScriptDiscountApplicationQuery value(PricingValueQueryDefinition queryDef } /** - * Script discount applications capture the intentions of a discount that - * was created by a Shopify Script. + * An auto-generated type for paginating through multiple SellingPlanGroups. */ - public static class ScriptDiscountApplication extends AbstractResponse implements DiscountApplication { - public ScriptDiscountApplication() { + public static class SellingPlanGroupConnection extends AbstractResponse { + public SellingPlanGroupConnection() { } - public ScriptDiscountApplication(JsonObject fields) throws SchemaViolationError { + public SellingPlanGroupConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "allocationMethod": { - responseData.put(key, DiscountApplicationAllocationMethod.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlanGroupEdge(jsonAsObject(element1, key))); + } - case "targetSelection": { - responseData.put(key, DiscountApplicationTargetSelection.fromGraphQl(jsonAsString(field.getValue(), key))); + responseData.put(key, list1); break; } - case "targetType": { - responseData.put(key, DiscountApplicationTargetType.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SellingPlanGroup(jsonAsObject(element1, key))); + } - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + responseData.put(key, list1); break; } - case "value": { - responseData.put(key, UnknownPricingValue.create(jsonAsObject(field.getValue(), key))); + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } @@ -56870,144 +64148,116 @@ public ScriptDiscountApplication(JsonObject fields) throws SchemaViolationError } public String getGraphQlTypeName() { - return "ScriptDiscountApplication"; - } - - /** - * The method by which the discount's value is allocated to its entitled items. - */ - - public DiscountApplicationAllocationMethod getAllocationMethod() { - return (DiscountApplicationAllocationMethod) get("allocationMethod"); - } - - public ScriptDiscountApplication setAllocationMethod(DiscountApplicationAllocationMethod arg) { - optimisticData.put(getKey("allocationMethod"), arg); - return this; - } - - /** - * Which lines of targetType that the discount is allocated over. - */ - - public DiscountApplicationTargetSelection getTargetSelection() { - return (DiscountApplicationTargetSelection) get("targetSelection"); - } - - public ScriptDiscountApplication setTargetSelection(DiscountApplicationTargetSelection arg) { - optimisticData.put(getKey("targetSelection"), arg); - return this; + return "SellingPlanGroupConnection"; } /** - * The type of line that the discount is applicable towards. + * A list of edges. */ - public DiscountApplicationTargetType getTargetType() { - return (DiscountApplicationTargetType) get("targetType"); + public List getEdges() { + return (List) get("edges"); } - public ScriptDiscountApplication setTargetType(DiscountApplicationTargetType arg) { - optimisticData.put(getKey("targetType"), arg); + public SellingPlanGroupConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * The title of the application as defined by the Script. + * A list of the nodes contained in SellingPlanGroupEdge. */ - public String getTitle() { - return (String) get("title"); + public List getNodes() { + return (List) get("nodes"); } - public ScriptDiscountApplication setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public SellingPlanGroupConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); return this; } /** - * The value of the discount application. + * Information to aid in pagination. */ - public PricingValue getValue() { - return (PricingValue) get("value"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public ScriptDiscountApplication setValue(PricingValue arg) { - optimisticData.put(getKey("value"), arg); + public SellingPlanGroupConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "allocationMethod": return false; - - case "targetSelection": return false; - - case "targetType": return false; + case "edges": return true; - case "title": return false; + case "nodes": return true; - case "value": return false; + case "pageInfo": return true; default: return false; } } } - public interface SelectedOptionQueryDefinition { - void define(SelectedOptionQuery _queryBuilder); + public interface SellingPlanGroupEdgeQueryDefinition { + void define(SellingPlanGroupEdgeQuery _queryBuilder); } /** - * Properties used by customers to select a product variant. - * Products can have multiple options, like different sizes or colors. + * An auto-generated type which holds one SellingPlanGroup and a cursor during pagination. */ - public static class SelectedOptionQuery extends Query { - SelectedOptionQuery(StringBuilder _queryBuilder) { + public static class SellingPlanGroupEdgeQuery extends Query { + SellingPlanGroupEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The product option’s name. + * A cursor for use in pagination. */ - public SelectedOptionQuery name() { - startField("name"); + public SellingPlanGroupEdgeQuery cursor() { + startField("cursor"); return this; } /** - * The product option’s value. + * The item at the end of SellingPlanGroupEdge. */ - public SelectedOptionQuery value() { - startField("value"); + public SellingPlanGroupEdgeQuery node(SellingPlanGroupQueryDefinition queryDef) { + startField("node"); + + _queryBuilder.append('{'); + queryDef.define(new SellingPlanGroupQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * Properties used by customers to select a product variant. - * Products can have multiple options, like different sizes or colors. + * An auto-generated type which holds one SellingPlanGroup and a cursor during pagination. */ - public static class SelectedOption extends AbstractResponse { - public SelectedOption() { + public static class SellingPlanGroupEdge extends AbstractResponse { + public SellingPlanGroupEdge() { } - public SelectedOption(JsonObject fields) throws SchemaViolationError { + public SellingPlanGroupEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "name": { + case "cursor": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "value": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "node": { + responseData.put(key, new SellingPlanGroup(jsonAsObject(field.getValue(), key))); break; } @@ -57024,242 +64274,110 @@ public SelectedOption(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "SelectedOption"; + return "SellingPlanGroupEdge"; } /** - * The product option’s name. + * A cursor for use in pagination. */ - public String getName() { - return (String) get("name"); + public String getCursor() { + return (String) get("cursor"); } - public SelectedOption setName(String arg) { - optimisticData.put(getKey("name"), arg); + public SellingPlanGroupEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * The product option’s value. + * The item at the end of SellingPlanGroupEdge. */ - public String getValue() { - return (String) get("value"); + public SellingPlanGroup getNode() { + return (SellingPlanGroup) get("node"); } - public SelectedOption setValue(String arg) { - optimisticData.put(getKey("value"), arg); + public SellingPlanGroupEdge setNode(SellingPlanGroup arg) { + optimisticData.put(getKey("node"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "name": return false; + case "cursor": return false; - case "value": return false; + case "node": return true; default: return false; } } } - public static class SelectedOptionInput implements Serializable { - private String name; - - private String value; - - public SelectedOptionInput(String name, String value) { - this.name = name; - - this.value = value; - } - - public String getName() { - return name; - } - - public SelectedOptionInput setName(String name) { - this.name = name; - return this; - } - - public String getValue() { - return value; - } - - public SelectedOptionInput setValue(String value) { - this.value = value; - return this; - } - - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("name:"); - Query.appendQuotedString(_queryBuilder, name.toString()); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("value:"); - Query.appendQuotedString(_queryBuilder, value.toString()); - - _queryBuilder.append('}'); - } - } - - public interface SellingPlanQueryDefinition { - void define(SellingPlanQuery _queryBuilder); + public interface SellingPlanGroupOptionQueryDefinition { + void define(SellingPlanGroupOptionQuery _queryBuilder); } /** - * Represents how products and variants can be sold and purchased. + * Represents an option on a selling plan group that's available in the drop-down list in the + * storefront. + * Individual selling plans contribute their options to the associated selling plan group. For example, + * a selling plan group might have an option called `option1: Delivery every`. One selling plan in that + * group could contribute `option1: 2 weeks` with the pricing for that option, and another selling plan + * could contribute `option1: 4 weeks`, with different pricing. */ - public static class SellingPlanQuery extends Query { - SellingPlanQuery(StringBuilder _queryBuilder) { + public static class SellingPlanGroupOptionQuery extends Query { + SellingPlanGroupOptionQuery(StringBuilder _queryBuilder) { 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. - */ - public SellingPlanQuery description() { - startField("description"); - - return this; - } - - /** - * A globally-unique identifier. - */ - public SellingPlanQuery id() { - startField("id"); - - return this; - } - - /** - * The name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'. + * The name of the option. For example, 'Delivery every'. */ - public SellingPlanQuery name() { + public SellingPlanGroupOptionQuery name() { startField("name"); return this; } /** - * The selling plan options available in the drop-down list in the storefront. For example, 'Delivery - * every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the product. - * Individual selling plans contribute their options to the associated selling plan group. For example, - * a selling plan group might have an option called `option1: Delivery every`. One selling plan in that - * group could contribute `option1: 2 weeks` with the pricing for that option, and another selling plan - * could contribute `option1: 4 weeks`, with different pricing. - */ - public SellingPlanQuery options(SellingPlanOptionQueryDefinition queryDef) { - startField("options"); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanOptionQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The price adjustments that a selling plan makes when a variant is purchased with a selling plan. - */ - public SellingPlanQuery priceAdjustments(SellingPlanPriceAdjustmentQueryDefinition queryDef) { - startField("priceAdjustments"); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanPriceAdjustmentQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * Whether purchasing the selling plan will result in multiple deliveries. + * The values for the options specified by the selling plans in the selling plan group. For example, '1 + * week', '2 weeks', '3 weeks'. */ - public SellingPlanQuery recurringDeliveries() { - startField("recurringDeliveries"); + public SellingPlanGroupOptionQuery values() { + startField("values"); return this; } } /** - * Represents how products and variants can be sold and purchased. + * Represents an option on a selling plan group that's available in the drop-down list in the + * storefront. + * Individual selling plans contribute their options to the associated selling plan group. For example, + * a selling plan group might have an option called `option1: Delivery every`. One selling plan in that + * group could contribute `option1: 2 weeks` with the pricing for that option, and another selling plan + * could contribute `option1: 4 weeks`, with different pricing. */ - public static class SellingPlan extends AbstractResponse { - public SellingPlan() { + public static class SellingPlanGroupOption extends AbstractResponse { + public SellingPlanGroupOption() { } - public SellingPlan(JsonObject fields) throws SchemaViolationError { + public SellingPlanGroupOption(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "checkoutCharge": { - responseData.put(key, new SellingPlanCheckoutCharge(jsonAsObject(field.getValue(), key))); - - break; - } - - case "description": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - - break; - } - case "name": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "options": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanOption(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "priceAdjustments": { - List list1 = new ArrayList<>(); + case "values": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanPriceAdjustment(jsonAsObject(element1, key))); + list1.add(jsonAsString(element1, key)); } responseData.put(key, list1); @@ -57267,12 +64385,6 @@ public SellingPlan(JsonObject fields) throws SchemaViolationError { break; } - case "recurringDeliveries": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -57285,236 +64397,108 @@ public SellingPlan(JsonObject fields) throws SchemaViolationError { } 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. - */ - - public String getDescription() { - return (String) get("description"); - } - - public SellingPlan setDescription(String arg) { - optimisticData.put(getKey("description"), arg); - return this; - } - - /** - * A globally-unique identifier. - */ - - public ID getId() { - return (ID) get("id"); - } - - public SellingPlan setId(ID arg) { - optimisticData.put(getKey("id"), arg); - return this; + return "SellingPlanGroupOption"; } /** - * The name of the selling plan. For example, '6 weeks of prepaid granola, delivered weekly'. + * The name of the option. For example, 'Delivery every'. */ public String getName() { return (String) get("name"); } - public SellingPlan setName(String arg) { + public SellingPlanGroupOption setName(String arg) { optimisticData.put(getKey("name"), arg); return this; } /** - * The selling plan options available in the drop-down list in the storefront. For example, 'Delivery - * every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the product. - * Individual selling plans contribute their options to the associated selling plan group. For example, - * a selling plan group might have an option called `option1: Delivery every`. One selling plan in that - * group could contribute `option1: 2 weeks` with the pricing for that option, and another selling plan - * could contribute `option1: 4 weeks`, with different pricing. - */ - - public List getOptions() { - return (List) get("options"); - } - - public SellingPlan setOptions(List arg) { - optimisticData.put(getKey("options"), arg); - return this; - } - - /** - * The price adjustments that a selling plan makes when a variant is purchased with a selling plan. - */ - - public List getPriceAdjustments() { - return (List) get("priceAdjustments"); - } - - public SellingPlan setPriceAdjustments(List arg) { - optimisticData.put(getKey("priceAdjustments"), arg); - return this; - } - - /** - * Whether purchasing the selling plan will result in multiple deliveries. + * The values for the options specified by the selling plans in the selling plan group. For example, '1 + * week', '2 weeks', '3 weeks'. */ - public Boolean getRecurringDeliveries() { - return (Boolean) get("recurringDeliveries"); + public List getValues() { + return (List) get("values"); } - public SellingPlan setRecurringDeliveries(Boolean arg) { - optimisticData.put(getKey("recurringDeliveries"), arg); + public SellingPlanGroupOption setValues(List arg) { + optimisticData.put(getKey("values"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "checkoutCharge": return true; - - case "description": return false; - - case "id": return false; - case "name": return false; - case "options": return true; - - case "priceAdjustments": return true; - - case "recurringDeliveries": return false; + case "values": return false; default: return false; } } } - public interface SellingPlanAllocationQueryDefinition { - void define(SellingPlanAllocationQuery _queryBuilder); + public interface SellingPlanOptionQueryDefinition { + void define(SellingPlanOptionQuery _queryBuilder); } /** - * Represents an association between a variant and a selling plan. Selling plan allocations describe - * the options offered for each variant, and the price of the variant when purchased with a selling - * plan. + * An option provided by a Selling Plan. */ - public static class SellingPlanAllocationQuery extends Query { - SellingPlanAllocationQuery(StringBuilder _queryBuilder) { + public static class SellingPlanOptionQuery extends Query { + SellingPlanOptionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The checkout charge amount due for the purchase. - */ - public SellingPlanAllocationQuery checkoutChargeAmount(MoneyV2QueryDefinition queryDef) { - startField("checkoutChargeAmount"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * A list of price adjustments, with a maximum of two. When there are two, the first price adjustment - * goes into effect at the time of purchase, while the second one starts after a certain number of - * orders. A price adjustment represents how a selling plan affects pricing when a variant is purchased - * with a selling plan. Prices display in the customer's currency if the shop is configured for it. - */ - public SellingPlanAllocationQuery priceAdjustments(SellingPlanAllocationPriceAdjustmentQueryDefinition queryDef) { - startField("priceAdjustments"); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanAllocationPriceAdjustmentQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The remaining balance charge amount due for the purchase. + * The name of the option (ie "Delivery every"). */ - public SellingPlanAllocationQuery remainingBalanceChargeAmount(MoneyV2QueryDefinition queryDef) { - startField("remainingBalanceChargeAmount"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public SellingPlanOptionQuery name() { + startField("name"); return this; } /** - * A representation of how products and variants can be sold and purchased. For example, an individual - * selling plan could be '6 weeks of prepaid granola, delivered weekly'. + * The value of the option (ie "Month"). */ - public SellingPlanAllocationQuery sellingPlan(SellingPlanQueryDefinition queryDef) { - startField("sellingPlan"); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SellingPlanOptionQuery value() { + startField("value"); return this; } } /** - * Represents an association between a variant and a selling plan. Selling plan allocations describe - * the options offered for each variant, and the price of the variant when purchased with a selling - * plan. + * An option provided by a Selling Plan. */ - public static class SellingPlanAllocation extends AbstractResponse { - public SellingPlanAllocation() { + public static class SellingPlanOption extends AbstractResponse { + public SellingPlanOption() { } - public SellingPlanAllocation(JsonObject fields) throws SchemaViolationError { + public SellingPlanOption(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "checkoutChargeAmount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "priceAdjustments": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanAllocationPriceAdjustment(jsonAsObject(element1, key))); + case "name": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "remainingBalanceChargeAmount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } + case "value": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "sellingPlan": { - responseData.put(key, new SellingPlan(jsonAsObject(field.getValue(), key))); + responseData.put(key, optional1); break; } @@ -57531,168 +64515,195 @@ public SellingPlanAllocation(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "SellingPlanAllocation"; + return "SellingPlanOption"; } /** - * The checkout charge amount due for the purchase. + * The name of the option (ie "Delivery every"). */ - public MoneyV2 getCheckoutChargeAmount() { - return (MoneyV2) get("checkoutChargeAmount"); + public String getName() { + return (String) get("name"); } - public SellingPlanAllocation setCheckoutChargeAmount(MoneyV2 arg) { - optimisticData.put(getKey("checkoutChargeAmount"), arg); + public SellingPlanOption setName(String arg) { + optimisticData.put(getKey("name"), arg); return this; } /** - * A list of price adjustments, with a maximum of two. When there are two, the first price adjustment - * goes into effect at the time of purchase, while the second one starts after a certain number of - * orders. A price adjustment represents how a selling plan affects pricing when a variant is purchased - * with a selling plan. Prices display in the customer's currency if the shop is configured for it. + * The value of the option (ie "Month"). */ - public List getPriceAdjustments() { - return (List) get("priceAdjustments"); + public String getValue() { + return (String) get("value"); } - public SellingPlanAllocation setPriceAdjustments(List arg) { - optimisticData.put(getKey("priceAdjustments"), arg); + public SellingPlanOption setValue(String arg) { + optimisticData.put(getKey("value"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "name": return false; + + case "value": return false; + + default: return false; + } + } + } + + public interface SellingPlanPercentagePriceAdjustmentQueryDefinition { + void define(SellingPlanPercentagePriceAdjustmentQuery _queryBuilder); + } + + /** + * A percentage amount that's deducted from the original variant price. For example, 10% off. + */ + public static class SellingPlanPercentagePriceAdjustmentQuery extends Query { + SellingPlanPercentagePriceAdjustmentQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + /** - * The remaining balance charge amount due for the purchase. + * The percentage value of the price adjustment. */ + public SellingPlanPercentagePriceAdjustmentQuery adjustmentPercentage() { + startField("adjustmentPercentage"); - public MoneyV2 getRemainingBalanceChargeAmount() { - return (MoneyV2) get("remainingBalanceChargeAmount"); + return this; } + } - public SellingPlanAllocation setRemainingBalanceChargeAmount(MoneyV2 arg) { - optimisticData.put(getKey("remainingBalanceChargeAmount"), arg); - return this; + /** + * A percentage amount that's deducted from the original variant price. For example, 10% off. + */ + public static class SellingPlanPercentagePriceAdjustment extends AbstractResponse implements SellingPlanPriceAdjustmentValue { + public SellingPlanPercentagePriceAdjustment() { + } + + public SellingPlanPercentagePriceAdjustment(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "adjustmentPercentage": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "SellingPlanPercentagePriceAdjustment"; } /** - * A representation of how products and variants can be sold and purchased. For example, an individual - * selling plan could be '6 weeks of prepaid granola, delivered weekly'. + * The percentage value of the price adjustment. */ - public SellingPlan getSellingPlan() { - return (SellingPlan) get("sellingPlan"); + public Integer getAdjustmentPercentage() { + return (Integer) get("adjustmentPercentage"); } - public SellingPlanAllocation setSellingPlan(SellingPlan arg) { - optimisticData.put(getKey("sellingPlan"), arg); + public SellingPlanPercentagePriceAdjustment setAdjustmentPercentage(Integer arg) { + optimisticData.put(getKey("adjustmentPercentage"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "checkoutChargeAmount": return true; - - case "priceAdjustments": return true; - - case "remainingBalanceChargeAmount": return true; - - case "sellingPlan": return true; + case "adjustmentPercentage": return false; default: return false; } } } - public interface SellingPlanAllocationConnectionQueryDefinition { - void define(SellingPlanAllocationConnectionQuery _queryBuilder); + public interface SellingPlanPriceAdjustmentQueryDefinition { + void define(SellingPlanPriceAdjustmentQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple SellingPlanAllocations. + * Represents by how much the price of a variant associated with a selling plan is adjusted. Each + * variant can have up to two price adjustments. If a variant has multiple price adjustments, then the + * first price adjustment applies when the variant is initially purchased. The second price adjustment + * applies after a certain number of orders (specified by the `orderCount` field) are made. If a + * selling plan doesn't have any price adjustments, then the unadjusted price of the variant is the + * effective price. */ - public static class SellingPlanAllocationConnectionQuery extends Query { - SellingPlanAllocationConnectionQuery(StringBuilder _queryBuilder) { + public static class SellingPlanPriceAdjustmentQuery extends Query { + SellingPlanPriceAdjustmentQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A list of edges. - */ - public SellingPlanAllocationConnectionQuery edges(SellingPlanAllocationEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanAllocationEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * A list of the nodes contained in SellingPlanAllocationEdge. + * The type of price adjustment. An adjustment value can have one of three types: percentage, amount + * off, or a new price. */ - public SellingPlanAllocationConnectionQuery nodes(SellingPlanAllocationQueryDefinition queryDef) { - startField("nodes"); + public SellingPlanPriceAdjustmentQuery adjustmentValue(SellingPlanPriceAdjustmentValueQueryDefinition queryDef) { + startField("adjustmentValue"); _queryBuilder.append('{'); - queryDef.define(new SellingPlanAllocationQuery(_queryBuilder)); + queryDef.define(new SellingPlanPriceAdjustmentValueQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Information to aid in pagination. + * The number of orders that the price adjustment applies to. If the price adjustment always applies, + * then this field is `null`. */ - public SellingPlanAllocationConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SellingPlanPriceAdjustmentQuery orderCount() { + startField("orderCount"); return this; } } /** - * An auto-generated type for paginating through multiple SellingPlanAllocations. + * Represents by how much the price of a variant associated with a selling plan is adjusted. Each + * variant can have up to two price adjustments. If a variant has multiple price adjustments, then the + * first price adjustment applies when the variant is initially purchased. The second price adjustment + * applies after a certain number of orders (specified by the `orderCount` field) are made. If a + * selling plan doesn't have any price adjustments, then the unadjusted price of the variant is the + * effective price. */ - public static class SellingPlanAllocationConnection extends AbstractResponse { - public SellingPlanAllocationConnection() { + public static class SellingPlanPriceAdjustment extends AbstractResponse { + public SellingPlanPriceAdjustment() { } - public SellingPlanAllocationConnection(JsonObject fields) throws SchemaViolationError { + public SellingPlanPriceAdjustment(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanAllocationEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "adjustmentValue": { + responseData.put(key, UnknownSellingPlanPriceAdjustmentValue.create(jsonAsObject(field.getValue(), key))); break; } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanAllocation(jsonAsObject(element1, key))); + case "orderCount": { + Integer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsInteger(field.getValue(), key); } - responseData.put(key, list1); - - break; - } - - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + responseData.put(key, optional1); break; } @@ -57709,120 +64720,102 @@ public SellingPlanAllocationConnection(JsonObject fields) throws SchemaViolation } public String getGraphQlTypeName() { - return "SellingPlanAllocationConnection"; - } - - /** - * A list of edges. - */ - - public List getEdges() { - return (List) get("edges"); - } - - public SellingPlanAllocationConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; + return "SellingPlanPriceAdjustment"; } /** - * A list of the nodes contained in SellingPlanAllocationEdge. + * The type of price adjustment. An adjustment value can have one of three types: percentage, amount + * off, or a new price. */ - public List getNodes() { - return (List) get("nodes"); + public SellingPlanPriceAdjustmentValue getAdjustmentValue() { + return (SellingPlanPriceAdjustmentValue) get("adjustmentValue"); } - public SellingPlanAllocationConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + public SellingPlanPriceAdjustment setAdjustmentValue(SellingPlanPriceAdjustmentValue arg) { + optimisticData.put(getKey("adjustmentValue"), arg); return this; } /** - * Information to aid in pagination. + * The number of orders that the price adjustment applies to. If the price adjustment always applies, + * then this field is `null`. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public Integer getOrderCount() { + return (Integer) get("orderCount"); } - public SellingPlanAllocationConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public SellingPlanPriceAdjustment setOrderCount(Integer arg) { + optimisticData.put(getKey("orderCount"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return true; + case "adjustmentValue": return false; - case "pageInfo": return true; + case "orderCount": return false; default: return false; } } } - public interface SellingPlanAllocationEdgeQueryDefinition { - void define(SellingPlanAllocationEdgeQuery _queryBuilder); + public interface SellingPlanPriceAdjustmentValueQueryDefinition { + void define(SellingPlanPriceAdjustmentValueQuery _queryBuilder); } /** - * An auto-generated type which holds one SellingPlanAllocation and a cursor during pagination. + * Represents by how much the price of a variant associated with a selling plan is adjusted. Each + * variant can have up to two price adjustments. */ - public static class SellingPlanAllocationEdgeQuery extends Query { - SellingPlanAllocationEdgeQuery(StringBuilder _queryBuilder) { + public static class SellingPlanPriceAdjustmentValueQuery extends Query { + SellingPlanPriceAdjustmentValueQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - } - /** - * A cursor for use in pagination. - */ - public SellingPlanAllocationEdgeQuery cursor() { - startField("cursor"); + startField("__typename"); + } + public SellingPlanPriceAdjustmentValueQuery onSellingPlanFixedAmountPriceAdjustment(SellingPlanFixedAmountPriceAdjustmentQueryDefinition queryDef) { + startInlineFragment("SellingPlanFixedAmountPriceAdjustment"); + queryDef.define(new SellingPlanFixedAmountPriceAdjustmentQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } - /** - * The item at the end of SellingPlanAllocationEdge. - */ - public SellingPlanAllocationEdgeQuery node(SellingPlanAllocationQueryDefinition queryDef) { - startField("node"); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanAllocationQuery(_queryBuilder)); + public SellingPlanPriceAdjustmentValueQuery onSellingPlanFixedPriceAdjustment(SellingPlanFixedPriceAdjustmentQueryDefinition queryDef) { + startInlineFragment("SellingPlanFixedPriceAdjustment"); + queryDef.define(new SellingPlanFixedPriceAdjustmentQuery(_queryBuilder)); _queryBuilder.append('}'); - return this; } - } - /** - * An auto-generated type which holds one SellingPlanAllocation and a cursor during pagination. - */ - public static class SellingPlanAllocationEdge extends AbstractResponse { - public SellingPlanAllocationEdge() { + public SellingPlanPriceAdjustmentValueQuery onSellingPlanPercentagePriceAdjustment(SellingPlanPercentagePriceAdjustmentQueryDefinition queryDef) { + startInlineFragment("SellingPlanPercentagePriceAdjustment"); + queryDef.define(new SellingPlanPercentagePriceAdjustmentQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } + } - public SellingPlanAllocationEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "node": { - responseData.put(key, new SellingPlanAllocation(jsonAsObject(field.getValue(), key))); + public interface SellingPlanPriceAdjustmentValue { + String getGraphQlTypeName(); + } - break; - } + /** + * Represents by how much the price of a variant associated with a selling plan is adjusted. Each + * variant can have up to two price adjustments. + */ + public static class UnknownSellingPlanPriceAdjustmentValue extends AbstractResponse implements SellingPlanPriceAdjustmentValue { + public UnknownSellingPlanPriceAdjustmentValue() { + } + public UnknownSellingPlanPriceAdjustmentValue(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -57834,80 +64827,64 @@ public SellingPlanAllocationEdge(JsonObject fields) throws SchemaViolationError } } - public String getGraphQlTypeName() { - return "SellingPlanAllocationEdge"; - } - - /** - * A cursor for use in pagination. - */ - - public String getCursor() { - return (String) get("cursor"); - } + public static SellingPlanPriceAdjustmentValue create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "SellingPlanFixedAmountPriceAdjustment": { + return new SellingPlanFixedAmountPriceAdjustment(fields); + } - public SellingPlanAllocationEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; - } + case "SellingPlanFixedPriceAdjustment": { + return new SellingPlanFixedPriceAdjustment(fields); + } - /** - * The item at the end of SellingPlanAllocationEdge. - */ + case "SellingPlanPercentagePriceAdjustment": { + return new SellingPlanPercentagePriceAdjustment(fields); + } - public SellingPlanAllocation getNode() { - return (SellingPlanAllocation) get("node"); + default: { + return new UnknownSellingPlanPriceAdjustmentValue(fields); + } + } } - public SellingPlanAllocationEdge setNode(SellingPlanAllocation arg) { - optimisticData.put(getKey("node"), arg); - return this; + public String getGraphQlTypeName() { + return (String) get("__typename"); } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cursor": return false; - - case "node": return true; - default: return false; } } } - public interface SellingPlanAllocationPriceAdjustmentQueryDefinition { - void define(SellingPlanAllocationPriceAdjustmentQuery _queryBuilder); + public interface ShippingRateQueryDefinition { + void define(ShippingRateQuery _queryBuilder); } /** - * The resulting prices for variants when they're purchased with a specific selling plan. + * A shipping rate to be applied to a checkout. */ - public static class SellingPlanAllocationPriceAdjustmentQuery extends Query { - SellingPlanAllocationPriceAdjustmentQuery(StringBuilder _queryBuilder) { + public static class ShippingRateQuery extends Query { + ShippingRateQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The price of the variant when it's purchased without a selling plan for the same number of - * deliveries. For example, if a customer purchases 6 deliveries of $10.00 granola separately, then the - * price is 6 x $10.00 = $60.00. + * Human-readable unique identifier for this shipping rate. */ - public SellingPlanAllocationPriceAdjustmentQuery compareAtPrice(MoneyV2QueryDefinition queryDef) { - startField("compareAtPrice"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public ShippingRateQuery handle() { + startField("handle"); return this; } /** - * The effective price for a single delivery. For example, for a prepaid subscription plan that - * includes 6 deliveries at the price of $48.00, the per delivery price is $8.00. + * Price of this shipping rate. */ - public SellingPlanAllocationPriceAdjustmentQuery perDeliveryPrice(MoneyV2QueryDefinition queryDef) { - startField("perDeliveryPrice"); + public ShippingRateQuery price(MoneyV2QueryDefinition queryDef) { + startField("price"); _queryBuilder.append('{'); queryDef.define(new MoneyV2Query(_queryBuilder)); @@ -57917,12 +64894,13 @@ public SellingPlanAllocationPriceAdjustmentQuery perDeliveryPrice(MoneyV2QueryDe } /** - * The price of the variant when it's purchased with a selling plan For example, for a prepaid - * subscription plan that includes 6 deliveries of $10.00 granola, where the customer gets 20% off, the - * price is 6 x $10.00 x 0.80 = $48.00. + * Price of this shipping rate. + * + * @deprecated Use `price` instead. */ - public SellingPlanAllocationPriceAdjustmentQuery price(MoneyV2QueryDefinition queryDef) { - startField("price"); + @Deprecated + public ShippingRateQuery priceV2(MoneyV2QueryDefinition queryDef) { + startField("priceV2"); _queryBuilder.append('{'); queryDef.define(new MoneyV2Query(_queryBuilder)); @@ -57932,57 +64910,47 @@ public SellingPlanAllocationPriceAdjustmentQuery price(MoneyV2QueryDefinition qu } /** - * The resulting price per unit for the variant associated with the selling plan. If the variant isn't - * sold by quantity or measurement, then this field returns `null`. + * Title of this shipping rate. */ - public SellingPlanAllocationPriceAdjustmentQuery unitPrice(MoneyV2QueryDefinition queryDef) { - startField("unitPrice"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public ShippingRateQuery title() { + startField("title"); return this; } } /** - * The resulting prices for variants when they're purchased with a specific selling plan. + * A shipping rate to be applied to a checkout. */ - public static class SellingPlanAllocationPriceAdjustment extends AbstractResponse { - public SellingPlanAllocationPriceAdjustment() { + public static class ShippingRate extends AbstractResponse { + public ShippingRate() { } - public SellingPlanAllocationPriceAdjustment(JsonObject fields) throws SchemaViolationError { + public ShippingRate(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "compareAtPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "perDeliveryPrice": { + case "price": { responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "price": { + case "priceV2": { responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "unitPrice": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -57999,452 +64967,275 @@ public SellingPlanAllocationPriceAdjustment(JsonObject fields) throws SchemaViol } public String getGraphQlTypeName() { - return "SellingPlanAllocationPriceAdjustment"; + return "ShippingRate"; } /** - * The price of the variant when it's purchased without a selling plan for the same number of - * deliveries. For example, if a customer purchases 6 deliveries of $10.00 granola separately, then the - * price is 6 x $10.00 = $60.00. + * Human-readable unique identifier for this shipping rate. */ - public MoneyV2 getCompareAtPrice() { - return (MoneyV2) get("compareAtPrice"); + public String getHandle() { + return (String) get("handle"); } - public SellingPlanAllocationPriceAdjustment setCompareAtPrice(MoneyV2 arg) { - optimisticData.put(getKey("compareAtPrice"), arg); + public ShippingRate setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); return this; } /** - * The effective price for a single delivery. For example, for a prepaid subscription plan that - * includes 6 deliveries at the price of $48.00, the per delivery price is $8.00. + * Price of this shipping rate. */ - public MoneyV2 getPerDeliveryPrice() { - return (MoneyV2) get("perDeliveryPrice"); + public MoneyV2 getPrice() { + return (MoneyV2) get("price"); } - public SellingPlanAllocationPriceAdjustment setPerDeliveryPrice(MoneyV2 arg) { - optimisticData.put(getKey("perDeliveryPrice"), arg); + public ShippingRate setPrice(MoneyV2 arg) { + optimisticData.put(getKey("price"), arg); return this; } /** - * The price of the variant when it's purchased with a selling plan For example, for a prepaid - * subscription plan that includes 6 deliveries of $10.00 granola, where the customer gets 20% off, the - * price is 6 x $10.00 x 0.80 = $48.00. + * Price of this shipping rate. + * + * @deprecated Use `price` instead. */ - public MoneyV2 getPrice() { - return (MoneyV2) get("price"); + public MoneyV2 getPriceV2() { + return (MoneyV2) get("priceV2"); } - public SellingPlanAllocationPriceAdjustment setPrice(MoneyV2 arg) { - optimisticData.put(getKey("price"), arg); + public ShippingRate setPriceV2(MoneyV2 arg) { + optimisticData.put(getKey("priceV2"), arg); return this; } /** - * The resulting price per unit for the variant associated with the selling plan. If the variant isn't - * sold by quantity or measurement, then this field returns `null`. + * Title of this shipping rate. */ - public MoneyV2 getUnitPrice() { - return (MoneyV2) get("unitPrice"); + public String getTitle() { + return (String) get("title"); } - public SellingPlanAllocationPriceAdjustment setUnitPrice(MoneyV2 arg) { - optimisticData.put(getKey("unitPrice"), arg); + public ShippingRate setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "compareAtPrice": return true; - - case "perDeliveryPrice": return true; + case "handle": return false; case "price": return true; - case "unitPrice": return true; + case "priceV2": return true; + + case "title": return false; default: return false; } } } - public interface SellingPlanCheckoutChargeQueryDefinition { - void define(SellingPlanCheckoutChargeQuery _queryBuilder); + public interface ShopQueryDefinition { + void define(ShopQuery _queryBuilder); } /** - * The initial payment due for the purchase. + * Shop represents a collection of the general settings and information about the shop. */ - public static class SellingPlanCheckoutChargeQuery extends Query { - SellingPlanCheckoutChargeQuery(StringBuilder _queryBuilder) { + public static class ShopQuery extends Query { + ShopQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - } - /** - * The charge type for the checkout charge. - */ - public SellingPlanCheckoutChargeQuery type() { - startField("type"); - - return this; + startField("id"); } /** - * The charge value for the checkout charge. + * The shop's branding configuration. */ - public SellingPlanCheckoutChargeQuery value(SellingPlanCheckoutChargeValueQueryDefinition queryDef) { - startField("value"); + public ShopQuery brand(BrandQueryDefinition queryDef) { + startField("brand"); _queryBuilder.append('{'); - queryDef.define(new SellingPlanCheckoutChargeValueQuery(_queryBuilder)); + queryDef.define(new BrandQuery(_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. + * A description of the shop. */ + public ShopQuery description() { + startField("description"); - 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. + * Returns a metafield found by namespace and key. */ + public ShopQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { + startField("metafield"); - 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; + _queryBuilder.append("(namespace:"); + Query.appendQuotedString(_queryBuilder, namespace.toString()); - case "value": return false; + _queryBuilder.append(",key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); - default: return false; - } - } - } + _queryBuilder.append(')'); - public interface SellingPlanCheckoutChargePercentageValueQueryDefinition { - void define(SellingPlanCheckoutChargePercentageValueQuery _queryBuilder); - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - /** - * The percentage value of the price used for checkout charge. - */ - public static class SellingPlanCheckoutChargePercentageValueQuery extends Query { - SellingPlanCheckoutChargePercentageValueQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * The percentage value of the price used for checkout charge. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - 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; - } + public ShopQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); } } - } - - public String getGraphQlTypeName() { - return "SellingPlanCheckoutChargePercentageValue"; - } + _queryBuilder.append(']'); - /** - * The percentage value of the price used for checkout charge. - */ + _queryBuilder.append(')'); - public Double getPercentage() { - return (Double) get("percentage"); - } + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); - 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. + * A string representing the way currency is formatted when the currency isn’t specified. */ - PRICE, - - UNKNOWN_VALUE; - - public static SellingPlanCheckoutChargeType fromGraphQl(String value) { - if (value == null) { - return null; - } - - switch (value) { - case "PERCENTAGE": { - return PERCENTAGE; - } - - case "PRICE": { - return PRICE; - } + public ShopQuery moneyFormat() { + startField("moneyFormat"); - default: { - return UNKNOWN_VALUE; - } - } + return this; } - public String toString() { - switch (this) { - case PERCENTAGE: { - return "PERCENTAGE"; - } - case PRICE: { - return "PRICE"; - } + /** + * The shop’s name. + */ + public ShopQuery name() { + startField("name"); - default: { - return ""; - } - } + return this; } - } - - 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"); - } + /** + * Settings related to payments. + */ + public ShopQuery paymentSettings(PaymentSettingsQueryDefinition queryDef) { + startField("paymentSettings"); - public SellingPlanCheckoutChargeValueQuery onMoneyV2(MoneyV2QueryDefinition queryDef) { - startInlineFragment("MoneyV2"); - queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('{'); + queryDef.define(new PaymentSettingsQuery(_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 primary domain of the shop’s Online Store. + */ + public ShopQuery primaryDomain(DomainQueryDefinition queryDef) { + startField("primaryDomain"); - /** - * The portion of the price to be charged at checkout. - */ - public static class UnknownSellingPlanCheckoutChargeValue extends AbstractResponse implements SellingPlanCheckoutChargeValue { - public UnknownSellingPlanCheckoutChargeValue() { - } + _queryBuilder.append('{'); + queryDef.define(new DomainQuery(_queryBuilder)); + _queryBuilder.append('}'); - public UnknownSellingPlanCheckoutChargeValue(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + return this; } - 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); - } - } - } + /** + * The shop’s privacy policy. + */ + public ShopQuery privacyPolicy(ShopPolicyQueryDefinition queryDef) { + startField("privacyPolicy"); - public String getGraphQlTypeName() { - return (String) get("__typename"); - } + _queryBuilder.append('{'); + queryDef.define(new ShopPolicyQuery(_queryBuilder)); + _queryBuilder.append('}'); - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - default: return false; - } + return this; } - } - public interface SellingPlanConnectionQueryDefinition { - void define(SellingPlanConnectionQuery _queryBuilder); - } + /** + * The shop’s refund policy. + */ + public ShopQuery refundPolicy(ShopPolicyQueryDefinition queryDef) { + startField("refundPolicy"); - /** - * An auto-generated type for paginating through multiple SellingPlans. - */ - public static class SellingPlanConnectionQuery extends Query { - SellingPlanConnectionQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + _queryBuilder.append('{'); + queryDef.define(new ShopPolicyQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * A list of edges. + * The shop’s shipping policy. */ - public SellingPlanConnectionQuery edges(SellingPlanEdgeQueryDefinition queryDef) { - startField("edges"); + public ShopQuery shippingPolicy(ShopPolicyQueryDefinition queryDef) { + startField("shippingPolicy"); _queryBuilder.append('{'); - queryDef.define(new SellingPlanEdgeQuery(_queryBuilder)); + queryDef.define(new ShopPolicyQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in SellingPlanEdge. + * Countries that the shop ships to. */ - public SellingPlanConnectionQuery nodes(SellingPlanQueryDefinition queryDef) { - startField("nodes"); + public ShopQuery shipsToCountries() { + startField("shipsToCountries"); + + return this; + } + + /** + * The shop’s subscription policy. + */ + public ShopQuery subscriptionPolicy(ShopPolicyWithDefaultQueryDefinition queryDef) { + startField("subscriptionPolicy"); _queryBuilder.append('{'); - queryDef.define(new SellingPlanQuery(_queryBuilder)); + queryDef.define(new ShopPolicyWithDefaultQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * Information to aid in pagination. + * The shop’s terms of service. */ - public SellingPlanConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + public ShopQuery termsOfService(ShopPolicyQueryDefinition queryDef) { + startField("termsOfService"); _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); + queryDef.define(new ShopPolicyQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -58452,21 +65243,65 @@ public SellingPlanConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { } /** - * An auto-generated type for paginating through multiple SellingPlans. + * Shop represents a collection of the general settings and information about the shop. */ - public static class SellingPlanConnection extends AbstractResponse { - public SellingPlanConnection() { + public static class Shop extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { + public Shop() { } - public SellingPlanConnection(JsonObject fields) throws SchemaViolationError { + public Shop(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); + case "brand": { + Brand optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Brand(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "description": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "metafields": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanEdge(jsonAsObject(element1, key))); + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } + + list1.add(optional2); } responseData.put(key, list1); @@ -58474,10 +65309,67 @@ public SellingPlanConnection(JsonObject fields) throws SchemaViolationError { break; } - case "nodes": { - List list1 = new ArrayList<>(); + case "moneyFormat": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "paymentSettings": { + responseData.put(key, new PaymentSettings(jsonAsObject(field.getValue(), key))); + + break; + } + + case "primaryDomain": { + responseData.put(key, new Domain(jsonAsObject(field.getValue(), key))); + + break; + } + + case "privacyPolicy": { + ShopPolicy optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPolicy(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "refundPolicy": { + ShopPolicy optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPolicy(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "shippingPolicy": { + ShopPolicy optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPolicy(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "shipsToCountries": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlan(jsonAsObject(element1, key))); + list1.add(CountryCode.fromGraphQl(jsonAsString(element1, key))); } responseData.put(key, list1); @@ -58485,8 +65377,24 @@ public SellingPlanConnection(JsonObject fields) throws SchemaViolationError { break; } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "subscriptionPolicy": { + ShopPolicyWithDefault optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPolicyWithDefault(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "termsOfService": { + ShopPolicy optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPolicy(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } @@ -58502,518 +65410,378 @@ public SellingPlanConnection(JsonObject fields) throws SchemaViolationError { } } + public Shop(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "SellingPlanConnection"; + return "Shop"; } /** - * A list of edges. + * The shop's branding configuration. */ - public List getEdges() { - return (List) get("edges"); + public Brand getBrand() { + return (Brand) get("brand"); } - public SellingPlanConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); + public Shop setBrand(Brand arg) { + optimisticData.put(getKey("brand"), arg); return this; } /** - * A list of the nodes contained in SellingPlanEdge. + * A description of the shop. */ - public List getNodes() { - return (List) get("nodes"); + public String getDescription() { + return (String) get("description"); } - public SellingPlanConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + public Shop setDescription(String arg) { + optimisticData.put(getKey("description"), arg); return this; } /** - * Information to aid in pagination. + * A globally-unique identifier. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); - } - - public SellingPlanConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); - return this; + public ID getId() { + return (ID) get("id"); } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return true; - - case "pageInfo": return true; + /** + * Returns a metafield found by namespace and key. + */ - default: return false; - } + public Metafield getMetafield() { + return (Metafield) get("metafield"); } - } - - public interface SellingPlanEdgeQueryDefinition { - void define(SellingPlanEdgeQuery _queryBuilder); - } - /** - * An auto-generated type which holds one SellingPlan and a cursor during pagination. - */ - public static class SellingPlanEdgeQuery extends Query { - SellingPlanEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public Shop setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); + return this; } /** - * A cursor for use in pagination. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public SellingPlanEdgeQuery cursor() { - startField("cursor"); + public List getMetafields() { + return (List) get("metafields"); + } + + public Shop setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); return this; } /** - * The item at the end of SellingPlanEdge. + * A string representing the way currency is formatted when the currency isn’t specified. */ - public SellingPlanEdgeQuery node(SellingPlanQueryDefinition queryDef) { - startField("node"); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public String getMoneyFormat() { + return (String) get("moneyFormat"); } - } - /** - * An auto-generated type which holds one SellingPlan and a cursor during pagination. - */ - public static class SellingPlanEdge extends AbstractResponse { - public SellingPlanEdge() { + public Shop setMoneyFormat(String arg) { + optimisticData.put(getKey("moneyFormat"), arg); + return this; } - public SellingPlanEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * The shop’s name. + */ - break; - } + public String getName() { + return (String) get("name"); + } - case "node": { - responseData.put(key, new SellingPlan(jsonAsObject(field.getValue(), key))); + public Shop setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } - break; - } + /** + * Settings related to payments. + */ - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public PaymentSettings getPaymentSettings() { + return (PaymentSettings) get("paymentSettings"); } - public String getGraphQlTypeName() { - return "SellingPlanEdge"; + public Shop setPaymentSettings(PaymentSettings arg) { + optimisticData.put(getKey("paymentSettings"), arg); + return this; } /** - * A cursor for use in pagination. + * The primary domain of the shop’s Online Store. */ - public String getCursor() { - return (String) get("cursor"); + public Domain getPrimaryDomain() { + return (Domain) get("primaryDomain"); } - public SellingPlanEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public Shop setPrimaryDomain(Domain arg) { + optimisticData.put(getKey("primaryDomain"), arg); return this; } /** - * The item at the end of SellingPlanEdge. + * The shop’s privacy policy. */ - public SellingPlan getNode() { - return (SellingPlan) get("node"); + public ShopPolicy getPrivacyPolicy() { + return (ShopPolicy) get("privacyPolicy"); } - public SellingPlanEdge setNode(SellingPlan arg) { - optimisticData.put(getKey("node"), arg); + public Shop setPrivacyPolicy(ShopPolicy arg) { + optimisticData.put(getKey("privacyPolicy"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "cursor": return false; - - case "node": return true; + /** + * The shop’s refund policy. + */ - default: return false; - } + public ShopPolicy getRefundPolicy() { + return (ShopPolicy) get("refundPolicy"); } - } - public interface SellingPlanFixedAmountPriceAdjustmentQueryDefinition { - void define(SellingPlanFixedAmountPriceAdjustmentQuery _queryBuilder); - } - - /** - * A fixed amount that's deducted from the original variant price. For example, $10.00 off. - */ - public static class SellingPlanFixedAmountPriceAdjustmentQuery extends Query { - SellingPlanFixedAmountPriceAdjustmentQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public Shop setRefundPolicy(ShopPolicy arg) { + optimisticData.put(getKey("refundPolicy"), arg); + return this; } /** - * The money value of the price adjustment. + * The shop’s shipping policy. */ - public SellingPlanFixedAmountPriceAdjustmentQuery adjustmentAmount(MoneyV2QueryDefinition queryDef) { - startField("adjustmentAmount"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPolicy getShippingPolicy() { + return (ShopPolicy) get("shippingPolicy"); + } + public Shop setShippingPolicy(ShopPolicy arg) { + optimisticData.put(getKey("shippingPolicy"), arg); return this; } - } - /** - * A fixed amount that's deducted from the original variant price. For example, $10.00 off. - */ - public static class SellingPlanFixedAmountPriceAdjustment extends AbstractResponse implements SellingPlanPriceAdjustmentValue { - public SellingPlanFixedAmountPriceAdjustment() { + /** + * Countries that the shop ships to. + */ + + public List getShipsToCountries() { + return (List) get("shipsToCountries"); } - public SellingPlanFixedAmountPriceAdjustment(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "adjustmentAmount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + public Shop setShipsToCountries(List arg) { + optimisticData.put(getKey("shipsToCountries"), arg); + return this; + } - break; - } + /** + * The shop’s subscription policy. + */ - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + public ShopPolicyWithDefault getSubscriptionPolicy() { + return (ShopPolicyWithDefault) get("subscriptionPolicy"); } - public String getGraphQlTypeName() { - return "SellingPlanFixedAmountPriceAdjustment"; + public Shop setSubscriptionPolicy(ShopPolicyWithDefault arg) { + optimisticData.put(getKey("subscriptionPolicy"), arg); + return this; } /** - * The money value of the price adjustment. + * The shop’s terms of service. */ - public MoneyV2 getAdjustmentAmount() { - return (MoneyV2) get("adjustmentAmount"); + public ShopPolicy getTermsOfService() { + return (ShopPolicy) get("termsOfService"); } - public SellingPlanFixedAmountPriceAdjustment setAdjustmentAmount(MoneyV2 arg) { - optimisticData.put(getKey("adjustmentAmount"), arg); + public Shop setTermsOfService(ShopPolicy arg) { + optimisticData.put(getKey("termsOfService"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "adjustmentAmount": return true; + case "brand": return true; - default: return false; - } - } - } + case "description": return false; - public interface SellingPlanFixedPriceAdjustmentQueryDefinition { - void define(SellingPlanFixedPriceAdjustmentQuery _queryBuilder); - } + case "id": return false; - /** - * A fixed price adjustment for a variant that's purchased with a selling plan. - */ - public static class SellingPlanFixedPriceAdjustmentQuery extends Query { - SellingPlanFixedPriceAdjustmentQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case "metafield": return true; - /** - * A new price of the variant when it's purchased with the selling plan. - */ - public SellingPlanFixedPriceAdjustmentQuery price(MoneyV2QueryDefinition queryDef) { - startField("price"); + case "metafields": return true; - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + case "moneyFormat": return false; - return this; + case "name": return false; + + case "paymentSettings": return true; + + case "primaryDomain": return true; + + case "privacyPolicy": return true; + + case "refundPolicy": return true; + + case "shippingPolicy": return true; + + case "shipsToCountries": return false; + + case "subscriptionPolicy": return true; + + case "termsOfService": return true; + + default: return false; + } } } - /** - * A fixed price adjustment for a variant that's purchased with a selling plan. - */ - public static class SellingPlanFixedPriceAdjustment extends AbstractResponse implements SellingPlanPriceAdjustmentValue { - public SellingPlanFixedPriceAdjustment() { - } + public static class ShopPayWalletContentInput implements Serializable { + private MailingAddressInput billingAddress; - public SellingPlanFixedPriceAdjustment(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "price": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + private String sessionToken; - break; - } + public ShopPayWalletContentInput(MailingAddressInput billingAddress, String sessionToken) { + this.billingAddress = billingAddress; - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } + this.sessionToken = sessionToken; } - public String getGraphQlTypeName() { - return "SellingPlanFixedPriceAdjustment"; + public MailingAddressInput getBillingAddress() { + return billingAddress; } - /** - * A new price of the variant when it's purchased with the selling plan. - */ + public ShopPayWalletContentInput setBillingAddress(MailingAddressInput billingAddress) { + this.billingAddress = billingAddress; + return this; + } - public MoneyV2 getPrice() { - return (MoneyV2) get("price"); + public String getSessionToken() { + return sessionToken; } - public SellingPlanFixedPriceAdjustment setPrice(MoneyV2 arg) { - optimisticData.put(getKey("price"), arg); + public ShopPayWalletContentInput setSessionToken(String sessionToken) { + this.sessionToken = sessionToken; return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "price": return true; + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - default: return false; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("billingAddress:"); + billingAddress.appendTo(_queryBuilder); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("sessionToken:"); + Query.appendQuotedString(_queryBuilder, sessionToken.toString()); + + _queryBuilder.append('}'); } } - public interface SellingPlanGroupQueryDefinition { - void define(SellingPlanGroupQuery _queryBuilder); + public interface ShopPolicyQueryDefinition { + void define(ShopPolicyQuery _queryBuilder); } /** - * Represents a selling method. For example, 'Subscribe and save' is a selling method where customers - * pay for goods or services per delivery. A selling plan group contains individual selling plans. + * Policy that a merchant has configured for their store, such as their refund or privacy policy. */ - public static class SellingPlanGroupQuery extends Query { - SellingPlanGroupQuery(StringBuilder _queryBuilder) { + public static class ShopPolicyQuery extends Query { + ShopPolicyQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * A display friendly name for the app that created the selling plan group. + * Policy text, maximum size of 64kb. */ - public SellingPlanGroupQuery appName() { - startField("appName"); + public ShopPolicyQuery body() { + startField("body"); return this; } /** - * The name of the selling plan group. + * Policy’s handle. */ - public SellingPlanGroupQuery name() { - startField("name"); + public ShopPolicyQuery handle() { + startField("handle"); return this; } /** - * Represents the selling plan options available in the drop-down list in the storefront. For example, - * 'Delivery every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the - * product. + * Policy’s title. */ - public SellingPlanGroupQuery options(SellingPlanGroupOptionQueryDefinition queryDef) { - startField("options"); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanGroupOptionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPolicyQuery title() { + startField("title"); return this; } - public class SellingPlansArguments extends Arguments { - SellingPlansArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public SellingPlansArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come after the specified cursor. - */ - public SellingPlansArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Returns up to the last `n` elements from the list. - */ - public SellingPlansArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } - - /** - * Returns the elements that come before the specified cursor. - */ - public SellingPlansArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - - /** - * Reverse the order of the underlying list. - */ - public SellingPlansArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } - } - - public interface SellingPlansArgumentsDefinition { - void define(SellingPlansArguments args); - } - - /** - * A list of selling plans in a selling plan group. A selling plan is a representation of how products - * and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of - * prepaid granola, delivered weekly'. - */ - public SellingPlanGroupQuery sellingPlans(SellingPlanConnectionQueryDefinition queryDef) { - return sellingPlans(args -> {}, queryDef); - } - /** - * A list of selling plans in a selling plan group. A selling plan is a representation of how products - * and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of - * prepaid granola, delivered weekly'. + * Public URL to the policy. */ - public SellingPlanGroupQuery sellingPlans(SellingPlansArgumentsDefinition argsDef, SellingPlanConnectionQueryDefinition queryDef) { - startField("sellingPlans"); - - SellingPlansArguments args = new SellingPlansArguments(_queryBuilder); - argsDef.define(args); - SellingPlansArguments.end(args); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPolicyQuery url() { + startField("url"); return this; } } /** - * Represents a selling method. For example, 'Subscribe and save' is a selling method where customers - * pay for goods or services per delivery. A selling plan group contains individual selling plans. + * Policy that a merchant has configured for their store, such as their refund or privacy policy. */ - public static class SellingPlanGroup extends AbstractResponse { - public SellingPlanGroup() { + public static class ShopPolicy extends AbstractResponse implements Node { + public ShopPolicy() { } - public SellingPlanGroup(JsonObject fields) throws SchemaViolationError { + public ShopPolicy(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "appName": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "body": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "name": { + case "handle": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "options": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanGroupOption(jsonAsObject(element1, key))); - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - responseData.put(key, list1); + break; + } + + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "sellingPlans": { - responseData.put(key, new SellingPlanConnection(jsonAsObject(field.getValue(), key))); + case "url": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -59029,169 +65797,199 @@ public SellingPlanGroup(JsonObject fields) throws SchemaViolationError { } } + public ShopPolicy(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "SellingPlanGroup"; + return "ShopPolicy"; } /** - * A display friendly name for the app that created the selling plan group. + * Policy text, maximum size of 64kb. */ - public String getAppName() { - return (String) get("appName"); + public String getBody() { + return (String) get("body"); } - public SellingPlanGroup setAppName(String arg) { - optimisticData.put(getKey("appName"), arg); + public ShopPolicy setBody(String arg) { + optimisticData.put(getKey("body"), arg); return this; } /** - * The name of the selling plan group. + * Policy’s handle. */ - public String getName() { - return (String) get("name"); + public String getHandle() { + return (String) get("handle"); } - public SellingPlanGroup setName(String arg) { - optimisticData.put(getKey("name"), arg); + public ShopPolicy setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); return this; } /** - * Represents the selling plan options available in the drop-down list in the storefront. For example, - * 'Delivery every week' or 'Delivery every 2 weeks' specifies the delivery frequency options for the - * product. + * A globally-unique identifier. */ - public List getOptions() { - return (List) get("options"); + public ID getId() { + return (ID) get("id"); } - public SellingPlanGroup setOptions(List arg) { - optimisticData.put(getKey("options"), arg); + /** + * Policy’s title. + */ + + public String getTitle() { + return (String) get("title"); + } + + public ShopPolicy setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } /** - * A list of selling plans in a selling plan group. A selling plan is a representation of how products - * and variants can be sold and purchased. For example, an individual selling plan could be '6 weeks of - * prepaid granola, delivered weekly'. + * Public URL to the policy. */ - public SellingPlanConnection getSellingPlans() { - return (SellingPlanConnection) get("sellingPlans"); + public String getUrl() { + return (String) get("url"); } - public SellingPlanGroup setSellingPlans(SellingPlanConnection arg) { - optimisticData.put(getKey("sellingPlans"), arg); + public ShopPolicy setUrl(String arg) { + optimisticData.put(getKey("url"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "appName": return false; + case "body": return false; - case "name": return false; + case "handle": return false; - case "options": return true; + case "id": return false; - case "sellingPlans": return true; + case "title": return false; + + case "url": return false; default: return false; } } } - public interface SellingPlanGroupConnectionQueryDefinition { - void define(SellingPlanGroupConnectionQuery _queryBuilder); + public interface ShopPolicyWithDefaultQueryDefinition { + void define(ShopPolicyWithDefaultQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple SellingPlanGroups. + * A policy for the store that comes with a default value, such as a subscription policy. + * If the merchant hasn't configured a policy for their store, then the policy will return the default + * value. + * Otherwise, the policy will return the merchant-configured value. */ - public static class SellingPlanGroupConnectionQuery extends Query { - SellingPlanGroupConnectionQuery(StringBuilder _queryBuilder) { + public static class ShopPolicyWithDefaultQuery extends Query { + ShopPolicyWithDefaultQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A list of edges. + * The text of the policy. Maximum size: 64KB. */ - public SellingPlanGroupConnectionQuery edges(SellingPlanGroupEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanGroupEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPolicyWithDefaultQuery body() { + startField("body"); return this; } /** - * A list of the nodes contained in SellingPlanGroupEdge. + * The handle of the policy. */ - public SellingPlanGroupConnectionQuery nodes(SellingPlanGroupQueryDefinition queryDef) { - startField("nodes"); + public ShopPolicyWithDefaultQuery handle() { + startField("handle"); - _queryBuilder.append('{'); - queryDef.define(new SellingPlanGroupQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * The unique identifier of the policy. A default policy doesn't have an ID. + */ + public ShopPolicyWithDefaultQuery id() { + startField("id"); return this; } /** - * Information to aid in pagination. + * The title of the policy. */ - public SellingPlanGroupConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); + public ShopPolicyWithDefaultQuery title() { + startField("title"); - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * Public URL to the policy. + */ + public ShopPolicyWithDefaultQuery url() { + startField("url"); return this; } } /** - * An auto-generated type for paginating through multiple SellingPlanGroups. + * A policy for the store that comes with a default value, such as a subscription policy. + * If the merchant hasn't configured a policy for their store, then the policy will return the default + * value. + * Otherwise, the policy will return the merchant-configured value. */ - public static class SellingPlanGroupConnection extends AbstractResponse { - public SellingPlanGroupConnection() { + public static class ShopPolicyWithDefault extends AbstractResponse { + public ShopPolicyWithDefault() { } - public SellingPlanGroupConnection(JsonObject fields) throws SchemaViolationError { + public ShopPolicyWithDefault(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "edges": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanGroupEdge(jsonAsObject(element1, key))); - } + case "body": { + responseData.put(key, jsonAsString(field.getValue(), key)); - responseData.put(key, list1); + break; + } + + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SellingPlanGroup(jsonAsObject(element1, key))); + case "id": { + ID optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ID(jsonAsString(field.getValue(), key)); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "url": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -59208,239 +66006,166 @@ public SellingPlanGroupConnection(JsonObject fields) throws SchemaViolationError } public String getGraphQlTypeName() { - return "SellingPlanGroupConnection"; - } - - /** - * A list of edges. - */ - - public List getEdges() { - return (List) get("edges"); - } - - public SellingPlanGroupConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; + return "ShopPolicyWithDefault"; } /** - * A list of the nodes contained in SellingPlanGroupEdge. + * The text of the policy. Maximum size: 64KB. */ - public List getNodes() { - return (List) get("nodes"); + public String getBody() { + return (String) get("body"); } - public SellingPlanGroupConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); + public ShopPolicyWithDefault setBody(String arg) { + optimisticData.put(getKey("body"), arg); return this; } /** - * Information to aid in pagination. + * The handle of the policy. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public String getHandle() { + return (String) get("handle"); } - public SellingPlanGroupConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public ShopPolicyWithDefault setHandle(String arg) { + optimisticData.put(getKey("handle"), 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 SellingPlanGroupEdgeQueryDefinition { - void define(SellingPlanGroupEdgeQuery _queryBuilder); - } - - /** - * An auto-generated type which holds one SellingPlanGroup and a cursor during pagination. - */ - public static class SellingPlanGroupEdgeQuery extends Query { - SellingPlanGroupEdgeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - /** - * A cursor for use in pagination. + * The unique identifier of the policy. A default policy doesn't have an ID. */ - public SellingPlanGroupEdgeQuery cursor() { - startField("cursor"); - return this; + public ID getId() { + return (ID) get("id"); } - /** - * The item at the end of SellingPlanGroupEdge. - */ - public SellingPlanGroupEdgeQuery node(SellingPlanGroupQueryDefinition queryDef) { - startField("node"); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanGroupQuery(_queryBuilder)); - _queryBuilder.append('}'); - + public ShopPolicyWithDefault setId(ID arg) { + optimisticData.put(getKey("id"), arg); return this; } - } - - /** - * An auto-generated type which holds one SellingPlanGroup and a cursor during pagination. - */ - public static class SellingPlanGroupEdge extends AbstractResponse { - public SellingPlanGroupEdge() { - } - - public SellingPlanGroupEdge(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "node": { - responseData.put(key, new SellingPlanGroup(jsonAsObject(field.getValue(), key))); - - break; - } - - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - - public String getGraphQlTypeName() { - return "SellingPlanGroupEdge"; - } /** - * A cursor for use in pagination. + * The title of the policy. */ - public String getCursor() { - return (String) get("cursor"); + public String getTitle() { + return (String) get("title"); } - public SellingPlanGroupEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public ShopPolicyWithDefault setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } /** - * The item at the end of SellingPlanGroupEdge. + * Public URL to the policy. */ - public SellingPlanGroup getNode() { - return (SellingPlanGroup) get("node"); + public String getUrl() { + return (String) get("url"); } - public SellingPlanGroupEdge setNode(SellingPlanGroup arg) { - optimisticData.put(getKey("node"), arg); + public ShopPolicyWithDefault setUrl(String arg) { + optimisticData.put(getKey("url"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cursor": return false; + case "body": return false; - case "node": return true; + case "handle": return false; + + case "id": return false; + + case "title": return false; + + case "url": return false; default: return false; } } } - public interface SellingPlanGroupOptionQueryDefinition { - void define(SellingPlanGroupOptionQuery _queryBuilder); + public interface StoreAvailabilityQueryDefinition { + void define(StoreAvailabilityQuery _queryBuilder); } /** - * Represents an option on a selling plan group that's available in the drop-down list in the - * storefront. - * Individual selling plans contribute their options to the associated selling plan group. For example, - * a selling plan group might have an option called `option1: Delivery every`. One selling plan in that - * group could contribute `option1: 2 weeks` with the pricing for that option, and another selling plan - * could contribute `option1: 4 weeks`, with different pricing. + * The availability of a product variant at a particular location. + * Local pick-up must be enabled in the store's shipping settings, otherwise this will return an empty + * result. */ - public static class SellingPlanGroupOptionQuery extends Query { - SellingPlanGroupOptionQuery(StringBuilder _queryBuilder) { + public static class StoreAvailabilityQuery extends Query { + StoreAvailabilityQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The name of the option. For example, 'Delivery every'. + * Whether the product variant is in-stock at this location. */ - public SellingPlanGroupOptionQuery name() { - startField("name"); + public StoreAvailabilityQuery available() { + startField("available"); return this; } /** - * The values for the options specified by the selling plans in the selling plan group. For example, '1 - * week', '2 weeks', '3 weeks'. + * The location where this product variant is stocked at. */ - public SellingPlanGroupOptionQuery values() { - startField("values"); + public StoreAvailabilityQuery location(LocationQueryDefinition queryDef) { + startField("location"); + + _queryBuilder.append('{'); + queryDef.define(new LocationQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * Returns the estimated amount of time it takes for pickup to be ready (Example: Usually ready in 24 + * hours). + */ + public StoreAvailabilityQuery pickUpTime() { + startField("pickUpTime"); return this; } } /** - * Represents an option on a selling plan group that's available in the drop-down list in the - * storefront. - * Individual selling plans contribute their options to the associated selling plan group. For example, - * a selling plan group might have an option called `option1: Delivery every`. One selling plan in that - * group could contribute `option1: 2 weeks` with the pricing for that option, and another selling plan - * could contribute `option1: 4 weeks`, with different pricing. + * The availability of a product variant at a particular location. + * Local pick-up must be enabled in the store's shipping settings, otherwise this will return an empty + * result. */ - public static class SellingPlanGroupOption extends AbstractResponse { - public SellingPlanGroupOption() { + public static class StoreAvailability extends AbstractResponse { + public StoreAvailability() { } - public SellingPlanGroupOption(JsonObject fields) throws SchemaViolationError { + public StoreAvailability(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "available": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } - case "values": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } + case "location": { + responseData.put(key, new Location(jsonAsObject(field.getValue(), key))); - responseData.put(key, list1); + break; + } + + case "pickUpTime": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -59457,108 +66182,150 @@ public SellingPlanGroupOption(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "SellingPlanGroupOption"; + return "StoreAvailability"; } /** - * The name of the option. For example, 'Delivery every'. + * Whether the product variant is in-stock at this location. */ - public String getName() { - return (String) get("name"); + public Boolean getAvailable() { + return (Boolean) get("available"); } - public SellingPlanGroupOption setName(String arg) { - optimisticData.put(getKey("name"), arg); + public StoreAvailability setAvailable(Boolean arg) { + optimisticData.put(getKey("available"), arg); return this; } /** - * The values for the options specified by the selling plans in the selling plan group. For example, '1 - * week', '2 weeks', '3 weeks'. + * The location where this product variant is stocked at. */ - public List getValues() { - return (List) get("values"); + public Location getLocation() { + return (Location) get("location"); } - public SellingPlanGroupOption setValues(List arg) { - optimisticData.put(getKey("values"), arg); + public StoreAvailability setLocation(Location arg) { + optimisticData.put(getKey("location"), arg); + return this; + } + + /** + * Returns the estimated amount of time it takes for pickup to be ready (Example: Usually ready in 24 + * hours). + */ + + public String getPickUpTime() { + return (String) get("pickUpTime"); + } + + public StoreAvailability setPickUpTime(String arg) { + optimisticData.put(getKey("pickUpTime"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "name": return false; + case "available": return false; - case "values": return false; + case "location": return true; + + case "pickUpTime": return false; default: return false; } } } - public interface SellingPlanOptionQueryDefinition { - void define(SellingPlanOptionQuery _queryBuilder); + public interface StoreAvailabilityConnectionQueryDefinition { + void define(StoreAvailabilityConnectionQuery _queryBuilder); } /** - * An option provided by a Selling Plan. + * An auto-generated type for paginating through multiple StoreAvailabilities. */ - public static class SellingPlanOptionQuery extends Query { - SellingPlanOptionQuery(StringBuilder _queryBuilder) { + public static class StoreAvailabilityConnectionQuery extends Query { + StoreAvailabilityConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The name of the option (ie "Delivery every"). + * A list of edges. */ - public SellingPlanOptionQuery name() { - startField("name"); + public StoreAvailabilityConnectionQuery edges(StoreAvailabilityEdgeQueryDefinition queryDef) { + startField("edges"); + + _queryBuilder.append('{'); + queryDef.define(new StoreAvailabilityEdgeQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The value of the option (ie "Month"). + * A list of the nodes contained in StoreAvailabilityEdge. */ - public SellingPlanOptionQuery value() { - startField("value"); + public StoreAvailabilityConnectionQuery nodes(StoreAvailabilityQueryDefinition queryDef) { + startField("nodes"); + + _queryBuilder.append('{'); + queryDef.define(new StoreAvailabilityQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * Information to aid in pagination. + */ + public StoreAvailabilityConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); + + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * An option provided by a Selling Plan. + * An auto-generated type for paginating through multiple StoreAvailabilities. */ - public static class SellingPlanOption extends AbstractResponse { - public SellingPlanOption() { + public static class StoreAvailabilityConnection extends AbstractResponse { + public StoreAvailabilityConnection() { } - public SellingPlanOption(JsonObject fields) throws SchemaViolationError { + public StoreAvailabilityConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "name": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new StoreAvailabilityEdge(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "value": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + case "nodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new StoreAvailability(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); + + break; + } + + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } @@ -59575,82 +66342,116 @@ public SellingPlanOption(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "SellingPlanOption"; + return "StoreAvailabilityConnection"; } /** - * The name of the option (ie "Delivery every"). + * A list of edges. */ - public String getName() { - return (String) get("name"); + public List getEdges() { + return (List) get("edges"); } - public SellingPlanOption setName(String arg) { - optimisticData.put(getKey("name"), arg); + public StoreAvailabilityConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * The value of the option (ie "Month"). + * A list of the nodes contained in StoreAvailabilityEdge. */ - public String getValue() { - return (String) get("value"); + public List getNodes() { + return (List) get("nodes"); } - public SellingPlanOption setValue(String arg) { - optimisticData.put(getKey("value"), arg); + public StoreAvailabilityConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; + } + + /** + * Information to aid in pagination. + */ + + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } + + public StoreAvailabilityConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "name": return false; + case "edges": return true; - case "value": return false; + case "nodes": return true; + + case "pageInfo": return true; default: return false; } } } - public interface SellingPlanPercentagePriceAdjustmentQueryDefinition { - void define(SellingPlanPercentagePriceAdjustmentQuery _queryBuilder); + public interface StoreAvailabilityEdgeQueryDefinition { + void define(StoreAvailabilityEdgeQuery _queryBuilder); } /** - * A percentage amount that's deducted from the original variant price. For example, 10% off. + * An auto-generated type which holds one StoreAvailability and a cursor during pagination. */ - public static class SellingPlanPercentagePriceAdjustmentQuery extends Query { - SellingPlanPercentagePriceAdjustmentQuery(StringBuilder _queryBuilder) { + public static class StoreAvailabilityEdgeQuery extends Query { + StoreAvailabilityEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The percentage value of the price adjustment. + * A cursor for use in pagination. */ - public SellingPlanPercentagePriceAdjustmentQuery adjustmentPercentage() { - startField("adjustmentPercentage"); + public StoreAvailabilityEdgeQuery cursor() { + startField("cursor"); + + return this; + } + + /** + * The item at the end of StoreAvailabilityEdge. + */ + public StoreAvailabilityEdgeQuery node(StoreAvailabilityQueryDefinition queryDef) { + startField("node"); + + _queryBuilder.append('{'); + queryDef.define(new StoreAvailabilityQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * A percentage amount that's deducted from the original variant price. For example, 10% off. + * An auto-generated type which holds one StoreAvailability and a cursor during pagination. */ - public static class SellingPlanPercentagePriceAdjustment extends AbstractResponse implements SellingPlanPriceAdjustmentValue { - public SellingPlanPercentagePriceAdjustment() { + public static class StoreAvailabilityEdge extends AbstractResponse { + public StoreAvailabilityEdge() { } - public SellingPlanPercentagePriceAdjustment(JsonObject fields) throws SchemaViolationError { + public StoreAvailabilityEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "adjustmentPercentage": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "node": { + responseData.put(key, new StoreAvailability(jsonAsObject(field.getValue(), key))); break; } @@ -59667,103 +66468,110 @@ public SellingPlanPercentagePriceAdjustment(JsonObject fields) throws SchemaViol } public String getGraphQlTypeName() { - return "SellingPlanPercentagePriceAdjustment"; + return "StoreAvailabilityEdge"; } /** - * The percentage value of the price adjustment. + * A cursor for use in pagination. */ - public Integer getAdjustmentPercentage() { - return (Integer) get("adjustmentPercentage"); + public String getCursor() { + return (String) get("cursor"); } - public SellingPlanPercentagePriceAdjustment setAdjustmentPercentage(Integer arg) { - optimisticData.put(getKey("adjustmentPercentage"), arg); + public StoreAvailabilityEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); + return this; + } + + /** + * The item at the end of StoreAvailabilityEdge. + */ + + public StoreAvailability getNode() { + return (StoreAvailability) get("node"); + } + + public StoreAvailabilityEdge setNode(StoreAvailability arg) { + optimisticData.put(getKey("node"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "adjustmentPercentage": return false; + case "cursor": return false; + + case "node": return true; default: return false; } } } - public interface SellingPlanPriceAdjustmentQueryDefinition { - void define(SellingPlanPriceAdjustmentQuery _queryBuilder); + public interface StringConnectionQueryDefinition { + void define(StringConnectionQuery _queryBuilder); } /** - * Represents by how much the price of a variant associated with a selling plan is adjusted. Each - * variant can have up to two price adjustments. If a variant has multiple price adjustments, then the - * first price adjustment applies when the variant is initially purchased. The second price adjustment - * applies after a certain number of orders (specified by the `orderCount` field) are made. If a - * selling plan doesn't have any price adjustments, then the unadjusted price of the variant is the - * effective price. + * An auto-generated type for paginating through a list of Strings. */ - public static class SellingPlanPriceAdjustmentQuery extends Query { - SellingPlanPriceAdjustmentQuery(StringBuilder _queryBuilder) { + public static class StringConnectionQuery extends Query { + StringConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The type of price adjustment. An adjustment value can have one of three types: percentage, amount - * off, or a new price. + * A list of edges. */ - public SellingPlanPriceAdjustmentQuery adjustmentValue(SellingPlanPriceAdjustmentValueQueryDefinition queryDef) { - startField("adjustmentValue"); + public StringConnectionQuery edges(StringEdgeQueryDefinition queryDef) { + startField("edges"); _queryBuilder.append('{'); - queryDef.define(new SellingPlanPriceAdjustmentValueQuery(_queryBuilder)); + queryDef.define(new StringEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The number of orders that the price adjustment applies to. If the price adjustment always applies, - * then this field is `null`. + * Information to aid in pagination. */ - public SellingPlanPriceAdjustmentQuery orderCount() { - startField("orderCount"); + public StringConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); + + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * Represents by how much the price of a variant associated with a selling plan is adjusted. Each - * variant can have up to two price adjustments. If a variant has multiple price adjustments, then the - * first price adjustment applies when the variant is initially purchased. The second price adjustment - * applies after a certain number of orders (specified by the `orderCount` field) are made. If a - * selling plan doesn't have any price adjustments, then the unadjusted price of the variant is the - * effective price. + * An auto-generated type for paginating through a list of Strings. */ - public static class SellingPlanPriceAdjustment extends AbstractResponse { - public SellingPlanPriceAdjustment() { + public static class StringConnection extends AbstractResponse { + public StringConnection() { } - public SellingPlanPriceAdjustment(JsonObject fields) throws SchemaViolationError { + public StringConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "adjustmentValue": { - responseData.put(key, UnknownSellingPlanPriceAdjustmentValue.create(jsonAsObject(field.getValue(), key))); + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new StringEdge(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } - case "orderCount": { - Integer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); - } - - responseData.put(key, optional1); + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } @@ -59780,237 +66588,209 @@ public SellingPlanPriceAdjustment(JsonObject fields) throws SchemaViolationError } public String getGraphQlTypeName() { - return "SellingPlanPriceAdjustment"; + return "StringConnection"; } /** - * The type of price adjustment. An adjustment value can have one of three types: percentage, amount - * off, or a new price. + * A list of edges. */ - public SellingPlanPriceAdjustmentValue getAdjustmentValue() { - return (SellingPlanPriceAdjustmentValue) get("adjustmentValue"); + public List getEdges() { + return (List) get("edges"); } - public SellingPlanPriceAdjustment setAdjustmentValue(SellingPlanPriceAdjustmentValue arg) { - optimisticData.put(getKey("adjustmentValue"), arg); + public StringConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); return this; } /** - * The number of orders that the price adjustment applies to. If the price adjustment always applies, - * then this field is `null`. + * Information to aid in pagination. */ - public Integer getOrderCount() { - return (Integer) get("orderCount"); + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); } - public SellingPlanPriceAdjustment setOrderCount(Integer arg) { - optimisticData.put(getKey("orderCount"), arg); + public StringConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "adjustmentValue": return false; + case "edges": return true; - case "orderCount": return false; + case "pageInfo": return true; default: return false; } } } - public interface SellingPlanPriceAdjustmentValueQueryDefinition { - void define(SellingPlanPriceAdjustmentValueQuery _queryBuilder); + public interface StringEdgeQueryDefinition { + void define(StringEdgeQuery _queryBuilder); } /** - * Represents by how much the price of a variant associated with a selling plan is adjusted. Each - * variant can have up to two price adjustments. + * An auto-generated type which holds one String and a cursor during pagination. */ - public static class SellingPlanPriceAdjustmentValueQuery extends Query { - SellingPlanPriceAdjustmentValueQuery(StringBuilder _queryBuilder) { + public static class StringEdgeQuery extends Query { + StringEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("__typename"); } - public SellingPlanPriceAdjustmentValueQuery onSellingPlanFixedAmountPriceAdjustment(SellingPlanFixedAmountPriceAdjustmentQueryDefinition queryDef) { - startInlineFragment("SellingPlanFixedAmountPriceAdjustment"); - queryDef.define(new SellingPlanFixedAmountPriceAdjustmentQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; - } + /** + * A cursor for use in pagination. + */ + public StringEdgeQuery cursor() { + startField("cursor"); - public SellingPlanPriceAdjustmentValueQuery onSellingPlanFixedPriceAdjustment(SellingPlanFixedPriceAdjustmentQueryDefinition queryDef) { - startInlineFragment("SellingPlanFixedPriceAdjustment"); - queryDef.define(new SellingPlanFixedPriceAdjustmentQuery(_queryBuilder)); - _queryBuilder.append('}'); return this; } - public SellingPlanPriceAdjustmentValueQuery onSellingPlanPercentagePriceAdjustment(SellingPlanPercentagePriceAdjustmentQueryDefinition queryDef) { - startInlineFragment("SellingPlanPercentagePriceAdjustment"); - queryDef.define(new SellingPlanPercentagePriceAdjustmentQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * The item at the end of StringEdge. + */ + public StringEdgeQuery node() { + startField("node"); + return this; } } - public interface SellingPlanPriceAdjustmentValue { - String getGraphQlTypeName(); - } - /** - * Represents by how much the price of a variant associated with a selling plan is adjusted. Each - * variant can have up to two price adjustments. + * An auto-generated type which holds one String and a cursor during pagination. */ - public static class UnknownSellingPlanPriceAdjustmentValue extends AbstractResponse implements SellingPlanPriceAdjustmentValue { - public UnknownSellingPlanPriceAdjustmentValue() { + public static class StringEdge extends AbstractResponse { + public StringEdge() { } - public UnknownSellingPlanPriceAdjustmentValue(JsonObject fields) throws SchemaViolationError { + public StringEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "__typename": { + case "cursor": { responseData.put(key, jsonAsString(field.getValue(), key)); + break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - public static SellingPlanPriceAdjustmentValue create(JsonObject fields) throws SchemaViolationError { - String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); - switch (typeName) { - case "SellingPlanFixedAmountPriceAdjustment": { - return new SellingPlanFixedAmountPriceAdjustment(fields); - } - - case "SellingPlanFixedPriceAdjustment": { - return new SellingPlanFixedPriceAdjustment(fields); - } + case "node": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case "SellingPlanPercentagePriceAdjustment": { - return new SellingPlanPercentagePriceAdjustment(fields); - } + break; + } - default: { - return new UnknownSellingPlanPriceAdjustmentValue(fields); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } } } public String getGraphQlTypeName() { - return (String) get("__typename"); + return "StringEdge"; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - default: return false; - } - } - } + /** + * A cursor for use in pagination. + */ - public interface ShippingRateQueryDefinition { - void define(ShippingRateQuery _queryBuilder); - } + public String getCursor() { + return (String) get("cursor"); + } - /** - * A shipping rate to be applied to a checkout. - */ - public static class ShippingRateQuery extends Query { - ShippingRateQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public StringEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); + return this; } /** - * Human-readable unique identifier for this shipping rate. + * The item at the end of StringEdge. */ - public ShippingRateQuery handle() { - startField("handle"); + public String getNode() { + return (String) get("node"); + } + + public StringEdge setNode(String arg) { + optimisticData.put(getKey("node"), arg); return this; } - /** - * Price of this shipping rate. - */ - public ShippingRateQuery price(MoneyV2QueryDefinition queryDef) { - startField("price"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + case "node": return false; - return this; + default: return false; + } + } + } + + public interface SubmissionErrorQueryDefinition { + void define(SubmissionErrorQuery _queryBuilder); + } + + /** + * An error that occurred during cart submit for completion. + */ + public static class SubmissionErrorQuery extends Query { + SubmissionErrorQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * Price of this shipping rate. - * - * @deprecated Use `price` instead. + * The error code. */ - @Deprecated - public ShippingRateQuery priceV2(MoneyV2QueryDefinition queryDef) { - startField("priceV2"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public SubmissionErrorQuery code() { + startField("code"); return this; } /** - * Title of this shipping rate. + * The error message. */ - public ShippingRateQuery title() { - startField("title"); + public SubmissionErrorQuery message() { + startField("message"); return this; } } /** - * A shipping rate to be applied to a checkout. + * An error that occurred during cart submit for completion. */ - public static class ShippingRate extends AbstractResponse { - public ShippingRate() { + public static class SubmissionError extends AbstractResponse { + public SubmissionError() { } - public ShippingRate(JsonObject fields) throws SchemaViolationError { + public SubmissionError(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "handle": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "price": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "code": { + responseData.put(key, SubmissionErrorCode.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "priceV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } + case "message": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + responseData.put(key, optional1); break; } @@ -60027,1318 +66807,1038 @@ public ShippingRate(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "ShippingRate"; - } - - /** - * Human-readable unique identifier for this shipping rate. - */ - - public String getHandle() { - return (String) get("handle"); - } - - public ShippingRate setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); - return this; - } - - /** - * Price of this shipping rate. - */ - - public MoneyV2 getPrice() { - return (MoneyV2) get("price"); - } - - public ShippingRate setPrice(MoneyV2 arg) { - optimisticData.put(getKey("price"), arg); - return this; + return "SubmissionError"; } /** - * Price of this shipping rate. - * - * @deprecated Use `price` instead. + * The error code. */ - public MoneyV2 getPriceV2() { - return (MoneyV2) get("priceV2"); + public SubmissionErrorCode getCode() { + return (SubmissionErrorCode) get("code"); } - public ShippingRate setPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("priceV2"), arg); + public SubmissionError setCode(SubmissionErrorCode arg) { + optimisticData.put(getKey("code"), arg); return this; } /** - * Title of this shipping rate. + * The error message. */ - public String getTitle() { - return (String) get("title"); + public String getMessage() { + return (String) get("message"); } - public ShippingRate setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public SubmissionError setMessage(String arg) { + optimisticData.put(getKey("message"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "handle": return false; - - case "price": return true; - - case "priceV2": return true; + case "code": return false; - case "title": return false; + case "message": return false; default: return false; } } } - public interface ShopQueryDefinition { - void define(ShopQuery _queryBuilder); - } - /** - * Shop represents a collection of the general settings and information about the shop. + * The code of the error that occurred during cart submit for completion. */ - public static class ShopQuery extends Query { - ShopQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public enum SubmissionErrorCode { + BUYER_IDENTITY_EMAIL_IS_INVALID, - startField("id"); - } + BUYER_IDENTITY_EMAIL_REQUIRED, - /** - * The shop's branding configuration. - */ - public ShopQuery brand(BrandQueryDefinition queryDef) { - startField("brand"); + BUYER_IDENTITY_PHONE_IS_INVALID, - _queryBuilder.append('{'); - queryDef.define(new BrandQuery(_queryBuilder)); - _queryBuilder.append('}'); + DELIVERY_ADDRESS1_INVALID, - return this; - } + DELIVERY_ADDRESS1_REQUIRED, - /** - * A description of the shop. - */ - public ShopQuery description() { - startField("description"); + DELIVERY_ADDRESS1_TOO_LONG, - return this; - } + DELIVERY_ADDRESS2_INVALID, - /** - * Returns a metafield found by namespace and key. - */ - public ShopQuery metafield(String namespace, String key, MetafieldQueryDefinition queryDef) { - startField("metafield"); + DELIVERY_ADDRESS2_REQUIRED, - _queryBuilder.append("(namespace:"); - Query.appendQuotedString(_queryBuilder, namespace.toString()); + DELIVERY_ADDRESS2_TOO_LONG, - _queryBuilder.append(",key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); + DELIVERY_ADDRESS_REQUIRED, - _queryBuilder.append(')'); + DELIVERY_CITY_INVALID, - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + DELIVERY_CITY_REQUIRED, - return this; - } + DELIVERY_CITY_TOO_LONG, - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ - public ShopQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); + DELIVERY_COMPANY_INVALID, - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); + DELIVERY_COMPANY_REQUIRED, - _queryBuilder.append(')'); + DELIVERY_COMPANY_TOO_LONG, - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + DELIVERY_COUNTRY_REQUIRED, - return this; - } + DELIVERY_FIRST_NAME_INVALID, - /** - * A string representing the way currency is formatted when the currency isn’t specified. - */ - public ShopQuery moneyFormat() { - startField("moneyFormat"); + DELIVERY_FIRST_NAME_REQUIRED, - return this; - } + DELIVERY_FIRST_NAME_TOO_LONG, - /** - * The shop’s name. - */ - public ShopQuery name() { - startField("name"); + DELIVERY_INVALID_POSTAL_CODE_FOR_COUNTRY, - return this; - } + DELIVERY_INVALID_POSTAL_CODE_FOR_ZONE, - /** - * Settings related to payments. - */ - public ShopQuery paymentSettings(PaymentSettingsQueryDefinition queryDef) { - startField("paymentSettings"); + DELIVERY_LAST_NAME_INVALID, - _queryBuilder.append('{'); - queryDef.define(new PaymentSettingsQuery(_queryBuilder)); - _queryBuilder.append('}'); + DELIVERY_LAST_NAME_REQUIRED, - return this; - } + DELIVERY_LAST_NAME_TOO_LONG, - /** - * The primary domain of the shop’s Online Store. - */ - public ShopQuery primaryDomain(DomainQueryDefinition queryDef) { - startField("primaryDomain"); + DELIVERY_NO_DELIVERY_AVAILABLE, - _queryBuilder.append('{'); - queryDef.define(new DomainQuery(_queryBuilder)); - _queryBuilder.append('}'); + DELIVERY_NO_DELIVERY_AVAILABLE_FOR_MERCHANDISE_LINE, - return this; - } + DELIVERY_OPTIONS_PHONE_NUMBER_INVALID, - /** - * The shop’s privacy policy. - */ - public ShopQuery privacyPolicy(ShopPolicyQueryDefinition queryDef) { - startField("privacyPolicy"); + DELIVERY_OPTIONS_PHONE_NUMBER_REQUIRED, - _queryBuilder.append('{'); - queryDef.define(new ShopPolicyQuery(_queryBuilder)); - _queryBuilder.append('}'); + DELIVERY_PHONE_NUMBER_INVALID, - return this; - } + DELIVERY_PHONE_NUMBER_REQUIRED, - /** - * The shop’s refund policy. - */ - public ShopQuery refundPolicy(ShopPolicyQueryDefinition queryDef) { - startField("refundPolicy"); + DELIVERY_POSTAL_CODE_INVALID, - _queryBuilder.append('{'); - queryDef.define(new ShopPolicyQuery(_queryBuilder)); - _queryBuilder.append('}'); + DELIVERY_POSTAL_CODE_REQUIRED, - return this; - } + DELIVERY_ZONE_NOT_FOUND, - /** - * The shop’s shipping policy. - */ - public ShopQuery shippingPolicy(ShopPolicyQueryDefinition queryDef) { - startField("shippingPolicy"); + DELIVERY_ZONE_REQUIRED_FOR_COUNTRY, - _queryBuilder.append('{'); - queryDef.define(new ShopPolicyQuery(_queryBuilder)); - _queryBuilder.append('}'); + ERROR, - return this; - } + MERCHANDISE_LINE_LIMIT_REACHED, - /** - * Countries that the shop ships to. - */ - public ShopQuery shipsToCountries() { - startField("shipsToCountries"); + MERCHANDISE_NOT_APPLICABLE, - return this; - } + MERCHANDISE_NOT_ENOUGH_STOCK_AVAILABLE, - /** - * The shop’s subscription policy. - */ - public ShopQuery subscriptionPolicy(ShopPolicyWithDefaultQueryDefinition queryDef) { - startField("subscriptionPolicy"); + MERCHANDISE_OUT_OF_STOCK, - _queryBuilder.append('{'); - queryDef.define(new ShopPolicyWithDefaultQuery(_queryBuilder)); - _queryBuilder.append('}'); + MERCHANDISE_PRODUCT_NOT_PUBLISHED, - return this; - } + NO_DELIVERY_GROUP_SELECTED, - /** - * The shop’s terms of service. - */ - public ShopQuery termsOfService(ShopPolicyQueryDefinition queryDef) { - startField("termsOfService"); + PAYMENTS_ADDRESS1_INVALID, - _queryBuilder.append('{'); - queryDef.define(new ShopPolicyQuery(_queryBuilder)); - _queryBuilder.append('}'); + PAYMENTS_ADDRESS1_REQUIRED, - return this; - } - } + PAYMENTS_ADDRESS1_TOO_LONG, - /** - * Shop represents a collection of the general settings and information about the shop. - */ - public static class Shop extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { - public Shop() { - } + PAYMENTS_ADDRESS2_INVALID, - public Shop(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "brand": { - Brand optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Brand(jsonAsObject(field.getValue(), key)); - } + PAYMENTS_ADDRESS2_REQUIRED, - responseData.put(key, optional1); + PAYMENTS_ADDRESS2_TOO_LONG, - break; - } + PAYMENTS_BILLING_ADDRESS_ZONE_NOT_FOUND, - case "description": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + PAYMENTS_BILLING_ADDRESS_ZONE_REQUIRED_FOR_COUNTRY, - responseData.put(key, optional1); + PAYMENTS_CITY_INVALID, - break; - } + PAYMENTS_CITY_REQUIRED, - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + PAYMENTS_CITY_TOO_LONG, - break; - } + PAYMENTS_COMPANY_INVALID, - case "metafield": { - Metafield optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); - } + PAYMENTS_COMPANY_REQUIRED, - responseData.put(key, optional1); + PAYMENTS_COMPANY_TOO_LONG, - break; - } + PAYMENTS_COUNTRY_REQUIRED, - case "metafields": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - Metafield optional2 = null; - if (!element1.isJsonNull()) { - optional2 = new Metafield(jsonAsObject(element1, key)); - } + PAYMENTS_CREDIT_CARD_BASE_EXPIRED, - list1.add(optional2); - } + PAYMENTS_CREDIT_CARD_BASE_GATEWAY_NOT_SUPPORTED, - responseData.put(key, list1); + PAYMENTS_CREDIT_CARD_BASE_INVALID_START_DATE_OR_ISSUE_NUMBER_FOR_DEBIT, - break; - } + PAYMENTS_CREDIT_CARD_BRAND_NOT_SUPPORTED, - case "moneyFormat": { - responseData.put(key, jsonAsString(field.getValue(), key)); + PAYMENTS_CREDIT_CARD_FIRST_NAME_BLANK, - break; - } + PAYMENTS_CREDIT_CARD_GENERIC, - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + PAYMENTS_CREDIT_CARD_LAST_NAME_BLANK, - break; - } + PAYMENTS_CREDIT_CARD_MONTH_INCLUSION, - case "paymentSettings": { - responseData.put(key, new PaymentSettings(jsonAsObject(field.getValue(), key))); + PAYMENTS_CREDIT_CARD_NAME_INVALID, - break; - } + PAYMENTS_CREDIT_CARD_NUMBER_INVALID, - case "primaryDomain": { - responseData.put(key, new Domain(jsonAsObject(field.getValue(), key))); + PAYMENTS_CREDIT_CARD_NUMBER_INVALID_FORMAT, - break; - } + PAYMENTS_CREDIT_CARD_SESSION_ID, - case "privacyPolicy": { - ShopPolicy optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ShopPolicy(jsonAsObject(field.getValue(), key)); - } + PAYMENTS_CREDIT_CARD_VERIFICATION_VALUE_BLANK, - responseData.put(key, optional1); + PAYMENTS_CREDIT_CARD_VERIFICATION_VALUE_INVALID_FOR_CARD_TYPE, - break; - } + PAYMENTS_CREDIT_CARD_YEAR_EXPIRED, - case "refundPolicy": { - ShopPolicy optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ShopPolicy(jsonAsObject(field.getValue(), key)); - } + PAYMENTS_CREDIT_CARD_YEAR_INVALID_EXPIRY_YEAR, - responseData.put(key, optional1); + PAYMENTS_FIRST_NAME_INVALID, - break; - } + PAYMENTS_FIRST_NAME_REQUIRED, - case "shippingPolicy": { - ShopPolicy optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ShopPolicy(jsonAsObject(field.getValue(), key)); - } + PAYMENTS_FIRST_NAME_TOO_LONG, - responseData.put(key, optional1); + PAYMENTS_INVALID_POSTAL_CODE_FOR_COUNTRY, - break; - } + PAYMENTS_INVALID_POSTAL_CODE_FOR_ZONE, - case "shipsToCountries": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(CountryCode.fromGraphQl(jsonAsString(element1, key))); - } + PAYMENTS_LAST_NAME_INVALID, - responseData.put(key, list1); + PAYMENTS_LAST_NAME_REQUIRED, - break; - } + PAYMENTS_LAST_NAME_TOO_LONG, - case "subscriptionPolicy": { - ShopPolicyWithDefault optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ShopPolicyWithDefault(jsonAsObject(field.getValue(), key)); - } + PAYMENTS_METHOD_REQUIRED, - responseData.put(key, optional1); + PAYMENTS_METHOD_UNAVAILABLE, - break; - } + PAYMENTS_PHONE_NUMBER_INVALID, - case "termsOfService": { - ShopPolicy optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ShopPolicy(jsonAsObject(field.getValue(), key)); - } + PAYMENTS_PHONE_NUMBER_REQUIRED, - responseData.put(key, optional1); + PAYMENTS_POSTAL_CODE_INVALID, - break; - } + PAYMENTS_POSTAL_CODE_REQUIRED, - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } + PAYMENTS_SHOPIFY_PAYMENTS_REQUIRED, + + PAYMENTS_UNACCEPTABLE_PAYMENT_AMOUNT, + + PAYMENTS_WALLET_CONTENT_MISSING, + + TAXES_DELIVERY_GROUP_ID_NOT_FOUND, + + TAXES_LINE_ID_NOT_FOUND, + + TAXES_MUST_BE_DEFINED, + + UNKNOWN_VALUE; + + public static SubmissionErrorCode fromGraphQl(String value) { + if (value == null) { + return null; } - } - public Shop(ID id) { - this(); - optimisticData.put("id", id); - } + switch (value) { + case "BUYER_IDENTITY_EMAIL_IS_INVALID": { + return BUYER_IDENTITY_EMAIL_IS_INVALID; + } - public String getGraphQlTypeName() { - return "Shop"; - } + case "BUYER_IDENTITY_EMAIL_REQUIRED": { + return BUYER_IDENTITY_EMAIL_REQUIRED; + } - /** - * The shop's branding configuration. - */ + case "BUYER_IDENTITY_PHONE_IS_INVALID": { + return BUYER_IDENTITY_PHONE_IS_INVALID; + } - public Brand getBrand() { - return (Brand) get("brand"); - } + case "DELIVERY_ADDRESS1_INVALID": { + return DELIVERY_ADDRESS1_INVALID; + } - public Shop setBrand(Brand arg) { - optimisticData.put(getKey("brand"), arg); - return this; - } + case "DELIVERY_ADDRESS1_REQUIRED": { + return DELIVERY_ADDRESS1_REQUIRED; + } - /** - * A description of the shop. - */ + case "DELIVERY_ADDRESS1_TOO_LONG": { + return DELIVERY_ADDRESS1_TOO_LONG; + } - public String getDescription() { - return (String) get("description"); - } + case "DELIVERY_ADDRESS2_INVALID": { + return DELIVERY_ADDRESS2_INVALID; + } - public Shop setDescription(String arg) { - optimisticData.put(getKey("description"), arg); - return this; - } + case "DELIVERY_ADDRESS2_REQUIRED": { + return DELIVERY_ADDRESS2_REQUIRED; + } - /** - * A globally-unique identifier. - */ + case "DELIVERY_ADDRESS2_TOO_LONG": { + return DELIVERY_ADDRESS2_TOO_LONG; + } - public ID getId() { - return (ID) get("id"); - } + case "DELIVERY_ADDRESS_REQUIRED": { + return DELIVERY_ADDRESS_REQUIRED; + } - /** - * Returns a metafield found by namespace and key. - */ + case "DELIVERY_CITY_INVALID": { + return DELIVERY_CITY_INVALID; + } - public Metafield getMetafield() { - return (Metafield) get("metafield"); - } + case "DELIVERY_CITY_REQUIRED": { + return DELIVERY_CITY_REQUIRED; + } - public Shop setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); - return this; - } + case "DELIVERY_CITY_TOO_LONG": { + return DELIVERY_CITY_TOO_LONG; + } - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ + case "DELIVERY_COMPANY_INVALID": { + return DELIVERY_COMPANY_INVALID; + } - public List getMetafields() { - return (List) get("metafields"); - } + case "DELIVERY_COMPANY_REQUIRED": { + return DELIVERY_COMPANY_REQUIRED; + } - public Shop setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); - return this; - } + case "DELIVERY_COMPANY_TOO_LONG": { + return DELIVERY_COMPANY_TOO_LONG; + } - /** - * A string representing the way currency is formatted when the currency isn’t specified. - */ + case "DELIVERY_COUNTRY_REQUIRED": { + return DELIVERY_COUNTRY_REQUIRED; + } - public String getMoneyFormat() { - return (String) get("moneyFormat"); - } + case "DELIVERY_FIRST_NAME_INVALID": { + return DELIVERY_FIRST_NAME_INVALID; + } - public Shop setMoneyFormat(String arg) { - optimisticData.put(getKey("moneyFormat"), arg); - return this; - } + case "DELIVERY_FIRST_NAME_REQUIRED": { + return DELIVERY_FIRST_NAME_REQUIRED; + } - /** - * The shop’s name. - */ + case "DELIVERY_FIRST_NAME_TOO_LONG": { + return DELIVERY_FIRST_NAME_TOO_LONG; + } - public String getName() { - return (String) get("name"); - } + case "DELIVERY_INVALID_POSTAL_CODE_FOR_COUNTRY": { + return DELIVERY_INVALID_POSTAL_CODE_FOR_COUNTRY; + } - public Shop setName(String arg) { - optimisticData.put(getKey("name"), arg); - return this; - } + case "DELIVERY_INVALID_POSTAL_CODE_FOR_ZONE": { + return DELIVERY_INVALID_POSTAL_CODE_FOR_ZONE; + } - /** - * Settings related to payments. - */ + case "DELIVERY_LAST_NAME_INVALID": { + return DELIVERY_LAST_NAME_INVALID; + } - public PaymentSettings getPaymentSettings() { - return (PaymentSettings) get("paymentSettings"); - } + case "DELIVERY_LAST_NAME_REQUIRED": { + return DELIVERY_LAST_NAME_REQUIRED; + } - public Shop setPaymentSettings(PaymentSettings arg) { - optimisticData.put(getKey("paymentSettings"), arg); - return this; - } + case "DELIVERY_LAST_NAME_TOO_LONG": { + return DELIVERY_LAST_NAME_TOO_LONG; + } - /** - * The primary domain of the shop’s Online Store. - */ + case "DELIVERY_NO_DELIVERY_AVAILABLE": { + return DELIVERY_NO_DELIVERY_AVAILABLE; + } - public Domain getPrimaryDomain() { - return (Domain) get("primaryDomain"); - } + case "DELIVERY_NO_DELIVERY_AVAILABLE_FOR_MERCHANDISE_LINE": { + return DELIVERY_NO_DELIVERY_AVAILABLE_FOR_MERCHANDISE_LINE; + } - public Shop setPrimaryDomain(Domain arg) { - optimisticData.put(getKey("primaryDomain"), arg); - return this; - } + case "DELIVERY_OPTIONS_PHONE_NUMBER_INVALID": { + return DELIVERY_OPTIONS_PHONE_NUMBER_INVALID; + } - /** - * The shop’s privacy policy. - */ + case "DELIVERY_OPTIONS_PHONE_NUMBER_REQUIRED": { + return DELIVERY_OPTIONS_PHONE_NUMBER_REQUIRED; + } - public ShopPolicy getPrivacyPolicy() { - return (ShopPolicy) get("privacyPolicy"); - } + case "DELIVERY_PHONE_NUMBER_INVALID": { + return DELIVERY_PHONE_NUMBER_INVALID; + } - public Shop setPrivacyPolicy(ShopPolicy arg) { - optimisticData.put(getKey("privacyPolicy"), arg); - return this; - } + case "DELIVERY_PHONE_NUMBER_REQUIRED": { + return DELIVERY_PHONE_NUMBER_REQUIRED; + } - /** - * The shop’s refund policy. - */ + case "DELIVERY_POSTAL_CODE_INVALID": { + return DELIVERY_POSTAL_CODE_INVALID; + } - public ShopPolicy getRefundPolicy() { - return (ShopPolicy) get("refundPolicy"); - } + case "DELIVERY_POSTAL_CODE_REQUIRED": { + return DELIVERY_POSTAL_CODE_REQUIRED; + } - public Shop setRefundPolicy(ShopPolicy arg) { - optimisticData.put(getKey("refundPolicy"), arg); - return this; - } + case "DELIVERY_ZONE_NOT_FOUND": { + return DELIVERY_ZONE_NOT_FOUND; + } - /** - * The shop’s shipping policy. - */ + case "DELIVERY_ZONE_REQUIRED_FOR_COUNTRY": { + return DELIVERY_ZONE_REQUIRED_FOR_COUNTRY; + } - public ShopPolicy getShippingPolicy() { - return (ShopPolicy) get("shippingPolicy"); - } + case "ERROR": { + return ERROR; + } - public Shop setShippingPolicy(ShopPolicy arg) { - optimisticData.put(getKey("shippingPolicy"), arg); - return this; - } + case "MERCHANDISE_LINE_LIMIT_REACHED": { + return MERCHANDISE_LINE_LIMIT_REACHED; + } - /** - * Countries that the shop ships to. - */ + case "MERCHANDISE_NOT_APPLICABLE": { + return MERCHANDISE_NOT_APPLICABLE; + } - public List getShipsToCountries() { - return (List) get("shipsToCountries"); - } + case "MERCHANDISE_NOT_ENOUGH_STOCK_AVAILABLE": { + return MERCHANDISE_NOT_ENOUGH_STOCK_AVAILABLE; + } - public Shop setShipsToCountries(List arg) { - optimisticData.put(getKey("shipsToCountries"), arg); - return this; - } + case "MERCHANDISE_OUT_OF_STOCK": { + return MERCHANDISE_OUT_OF_STOCK; + } - /** - * The shop’s subscription policy. - */ + case "MERCHANDISE_PRODUCT_NOT_PUBLISHED": { + return MERCHANDISE_PRODUCT_NOT_PUBLISHED; + } - public ShopPolicyWithDefault getSubscriptionPolicy() { - return (ShopPolicyWithDefault) get("subscriptionPolicy"); - } + case "NO_DELIVERY_GROUP_SELECTED": { + return NO_DELIVERY_GROUP_SELECTED; + } - public Shop setSubscriptionPolicy(ShopPolicyWithDefault arg) { - optimisticData.put(getKey("subscriptionPolicy"), arg); - return this; - } + case "PAYMENTS_ADDRESS1_INVALID": { + return PAYMENTS_ADDRESS1_INVALID; + } - /** - * The shop’s terms of service. - */ + case "PAYMENTS_ADDRESS1_REQUIRED": { + return PAYMENTS_ADDRESS1_REQUIRED; + } - public ShopPolicy getTermsOfService() { - return (ShopPolicy) get("termsOfService"); - } + case "PAYMENTS_ADDRESS1_TOO_LONG": { + return PAYMENTS_ADDRESS1_TOO_LONG; + } - public Shop setTermsOfService(ShopPolicy arg) { - optimisticData.put(getKey("termsOfService"), arg); - return this; - } + case "PAYMENTS_ADDRESS2_INVALID": { + return PAYMENTS_ADDRESS2_INVALID; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "brand": return true; + case "PAYMENTS_ADDRESS2_REQUIRED": { + return PAYMENTS_ADDRESS2_REQUIRED; + } - case "description": return false; + case "PAYMENTS_ADDRESS2_TOO_LONG": { + return PAYMENTS_ADDRESS2_TOO_LONG; + } - case "id": return false; + case "PAYMENTS_BILLING_ADDRESS_ZONE_NOT_FOUND": { + return PAYMENTS_BILLING_ADDRESS_ZONE_NOT_FOUND; + } - case "metafield": return true; + case "PAYMENTS_BILLING_ADDRESS_ZONE_REQUIRED_FOR_COUNTRY": { + return PAYMENTS_BILLING_ADDRESS_ZONE_REQUIRED_FOR_COUNTRY; + } - case "metafields": return true; + case "PAYMENTS_CITY_INVALID": { + return PAYMENTS_CITY_INVALID; + } - case "moneyFormat": return false; + case "PAYMENTS_CITY_REQUIRED": { + return PAYMENTS_CITY_REQUIRED; + } - case "name": return false; + case "PAYMENTS_CITY_TOO_LONG": { + return PAYMENTS_CITY_TOO_LONG; + } - case "paymentSettings": return true; + case "PAYMENTS_COMPANY_INVALID": { + return PAYMENTS_COMPANY_INVALID; + } - case "primaryDomain": return true; + case "PAYMENTS_COMPANY_REQUIRED": { + return PAYMENTS_COMPANY_REQUIRED; + } - case "privacyPolicy": return true; + case "PAYMENTS_COMPANY_TOO_LONG": { + return PAYMENTS_COMPANY_TOO_LONG; + } - case "refundPolicy": return true; + case "PAYMENTS_COUNTRY_REQUIRED": { + return PAYMENTS_COUNTRY_REQUIRED; + } - case "shippingPolicy": return true; + case "PAYMENTS_CREDIT_CARD_BASE_EXPIRED": { + return PAYMENTS_CREDIT_CARD_BASE_EXPIRED; + } - case "shipsToCountries": return false; + case "PAYMENTS_CREDIT_CARD_BASE_GATEWAY_NOT_SUPPORTED": { + return PAYMENTS_CREDIT_CARD_BASE_GATEWAY_NOT_SUPPORTED; + } - case "subscriptionPolicy": return true; + case "PAYMENTS_CREDIT_CARD_BASE_INVALID_START_DATE_OR_ISSUE_NUMBER_FOR_DEBIT": { + return PAYMENTS_CREDIT_CARD_BASE_INVALID_START_DATE_OR_ISSUE_NUMBER_FOR_DEBIT; + } - case "termsOfService": return true; + case "PAYMENTS_CREDIT_CARD_BRAND_NOT_SUPPORTED": { + return PAYMENTS_CREDIT_CARD_BRAND_NOT_SUPPORTED; + } - default: return false; - } - } - } + case "PAYMENTS_CREDIT_CARD_FIRST_NAME_BLANK": { + return PAYMENTS_CREDIT_CARD_FIRST_NAME_BLANK; + } - public interface ShopPolicyQueryDefinition { - void define(ShopPolicyQuery _queryBuilder); - } + case "PAYMENTS_CREDIT_CARD_GENERIC": { + return PAYMENTS_CREDIT_CARD_GENERIC; + } - /** - * Policy that a merchant has configured for their store, such as their refund or privacy policy. - */ - public static class ShopPolicyQuery extends Query { - ShopPolicyQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + case "PAYMENTS_CREDIT_CARD_LAST_NAME_BLANK": { + return PAYMENTS_CREDIT_CARD_LAST_NAME_BLANK; + } - startField("id"); - } + case "PAYMENTS_CREDIT_CARD_MONTH_INCLUSION": { + return PAYMENTS_CREDIT_CARD_MONTH_INCLUSION; + } - /** - * Policy text, maximum size of 64kb. - */ - public ShopPolicyQuery body() { - startField("body"); + case "PAYMENTS_CREDIT_CARD_NAME_INVALID": { + return PAYMENTS_CREDIT_CARD_NAME_INVALID; + } - return this; - } + case "PAYMENTS_CREDIT_CARD_NUMBER_INVALID": { + return PAYMENTS_CREDIT_CARD_NUMBER_INVALID; + } - /** - * Policy’s handle. - */ - public ShopPolicyQuery handle() { - startField("handle"); + case "PAYMENTS_CREDIT_CARD_NUMBER_INVALID_FORMAT": { + return PAYMENTS_CREDIT_CARD_NUMBER_INVALID_FORMAT; + } - return this; - } + case "PAYMENTS_CREDIT_CARD_SESSION_ID": { + return PAYMENTS_CREDIT_CARD_SESSION_ID; + } - /** - * Policy’s title. - */ - public ShopPolicyQuery title() { - startField("title"); + case "PAYMENTS_CREDIT_CARD_VERIFICATION_VALUE_BLANK": { + return PAYMENTS_CREDIT_CARD_VERIFICATION_VALUE_BLANK; + } - return this; - } + case "PAYMENTS_CREDIT_CARD_VERIFICATION_VALUE_INVALID_FOR_CARD_TYPE": { + return PAYMENTS_CREDIT_CARD_VERIFICATION_VALUE_INVALID_FOR_CARD_TYPE; + } - /** - * Public URL to the policy. - */ - public ShopPolicyQuery url() { - startField("url"); + case "PAYMENTS_CREDIT_CARD_YEAR_EXPIRED": { + return PAYMENTS_CREDIT_CARD_YEAR_EXPIRED; + } - return this; - } - } + case "PAYMENTS_CREDIT_CARD_YEAR_INVALID_EXPIRY_YEAR": { + return PAYMENTS_CREDIT_CARD_YEAR_INVALID_EXPIRY_YEAR; + } - /** - * Policy that a merchant has configured for their store, such as their refund or privacy policy. - */ - public static class ShopPolicy extends AbstractResponse implements Node { - public ShopPolicy() { - } + case "PAYMENTS_FIRST_NAME_INVALID": { + return PAYMENTS_FIRST_NAME_INVALID; + } - public ShopPolicy(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "body": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "PAYMENTS_FIRST_NAME_REQUIRED": { + return PAYMENTS_FIRST_NAME_REQUIRED; + } - break; - } + case "PAYMENTS_FIRST_NAME_TOO_LONG": { + return PAYMENTS_FIRST_NAME_TOO_LONG; + } - case "handle": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "PAYMENTS_INVALID_POSTAL_CODE_FOR_COUNTRY": { + return PAYMENTS_INVALID_POSTAL_CODE_FOR_COUNTRY; + } - break; - } + case "PAYMENTS_INVALID_POSTAL_CODE_FOR_ZONE": { + return PAYMENTS_INVALID_POSTAL_CODE_FOR_ZONE; + } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case "PAYMENTS_LAST_NAME_INVALID": { + return PAYMENTS_LAST_NAME_INVALID; + } - break; - } + case "PAYMENTS_LAST_NAME_REQUIRED": { + return PAYMENTS_LAST_NAME_REQUIRED; + } - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "PAYMENTS_LAST_NAME_TOO_LONG": { + return PAYMENTS_LAST_NAME_TOO_LONG; + } - break; - } + case "PAYMENTS_METHOD_REQUIRED": { + return PAYMENTS_METHOD_REQUIRED; + } - case "url": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "PAYMENTS_METHOD_UNAVAILABLE": { + return PAYMENTS_METHOD_UNAVAILABLE; + } - break; - } + case "PAYMENTS_PHONE_NUMBER_INVALID": { + return PAYMENTS_PHONE_NUMBER_INVALID; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case "PAYMENTS_PHONE_NUMBER_REQUIRED": { + return PAYMENTS_PHONE_NUMBER_REQUIRED; } - } - } - public ShopPolicy(ID id) { - this(); - optimisticData.put("id", id); - } + case "PAYMENTS_POSTAL_CODE_INVALID": { + return PAYMENTS_POSTAL_CODE_INVALID; + } - public String getGraphQlTypeName() { - return "ShopPolicy"; - } + case "PAYMENTS_POSTAL_CODE_REQUIRED": { + return PAYMENTS_POSTAL_CODE_REQUIRED; + } - /** - * Policy text, maximum size of 64kb. - */ + case "PAYMENTS_SHOPIFY_PAYMENTS_REQUIRED": { + return PAYMENTS_SHOPIFY_PAYMENTS_REQUIRED; + } - public String getBody() { - return (String) get("body"); - } + case "PAYMENTS_UNACCEPTABLE_PAYMENT_AMOUNT": { + return PAYMENTS_UNACCEPTABLE_PAYMENT_AMOUNT; + } - public ShopPolicy setBody(String arg) { - optimisticData.put(getKey("body"), arg); - return this; - } + case "PAYMENTS_WALLET_CONTENT_MISSING": { + return PAYMENTS_WALLET_CONTENT_MISSING; + } - /** - * Policy’s handle. - */ + case "TAXES_DELIVERY_GROUP_ID_NOT_FOUND": { + return TAXES_DELIVERY_GROUP_ID_NOT_FOUND; + } - public String getHandle() { - return (String) get("handle"); - } + case "TAXES_LINE_ID_NOT_FOUND": { + return TAXES_LINE_ID_NOT_FOUND; + } - public ShopPolicy setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); - return this; + case "TAXES_MUST_BE_DEFINED": { + return TAXES_MUST_BE_DEFINED; + } + + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case BUYER_IDENTITY_EMAIL_IS_INVALID: { + return "BUYER_IDENTITY_EMAIL_IS_INVALID"; + } - /** - * A globally-unique identifier. - */ + case BUYER_IDENTITY_EMAIL_REQUIRED: { + return "BUYER_IDENTITY_EMAIL_REQUIRED"; + } - public ID getId() { - return (ID) get("id"); - } + case BUYER_IDENTITY_PHONE_IS_INVALID: { + return "BUYER_IDENTITY_PHONE_IS_INVALID"; + } - /** - * Policy’s title. - */ + case DELIVERY_ADDRESS1_INVALID: { + return "DELIVERY_ADDRESS1_INVALID"; + } - public String getTitle() { - return (String) get("title"); - } + case DELIVERY_ADDRESS1_REQUIRED: { + return "DELIVERY_ADDRESS1_REQUIRED"; + } - public ShopPolicy setTitle(String arg) { - optimisticData.put(getKey("title"), arg); - return this; - } + case DELIVERY_ADDRESS1_TOO_LONG: { + return "DELIVERY_ADDRESS1_TOO_LONG"; + } - /** - * Public URL to the policy. - */ + case DELIVERY_ADDRESS2_INVALID: { + return "DELIVERY_ADDRESS2_INVALID"; + } - public String getUrl() { - return (String) get("url"); - } + case DELIVERY_ADDRESS2_REQUIRED: { + return "DELIVERY_ADDRESS2_REQUIRED"; + } - public ShopPolicy setUrl(String arg) { - optimisticData.put(getKey("url"), arg); - return this; - } + case DELIVERY_ADDRESS2_TOO_LONG: { + return "DELIVERY_ADDRESS2_TOO_LONG"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "body": return false; + case DELIVERY_ADDRESS_REQUIRED: { + return "DELIVERY_ADDRESS_REQUIRED"; + } - case "handle": return false; + case DELIVERY_CITY_INVALID: { + return "DELIVERY_CITY_INVALID"; + } - case "id": return false; + case DELIVERY_CITY_REQUIRED: { + return "DELIVERY_CITY_REQUIRED"; + } - case "title": return false; + case DELIVERY_CITY_TOO_LONG: { + return "DELIVERY_CITY_TOO_LONG"; + } - case "url": return false; + case DELIVERY_COMPANY_INVALID: { + return "DELIVERY_COMPANY_INVALID"; + } - default: return false; - } - } - } + case DELIVERY_COMPANY_REQUIRED: { + return "DELIVERY_COMPANY_REQUIRED"; + } - public interface ShopPolicyWithDefaultQueryDefinition { - void define(ShopPolicyWithDefaultQuery _queryBuilder); - } + case DELIVERY_COMPANY_TOO_LONG: { + return "DELIVERY_COMPANY_TOO_LONG"; + } - /** - * A policy for the store that comes with a default value, such as a subscription policy. - * If the merchant hasn't configured a policy for their store, then the policy will return the default - * value. - * Otherwise, the policy will return the merchant-configured value. - */ - public static class ShopPolicyWithDefaultQuery extends Query { - ShopPolicyWithDefaultQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case DELIVERY_COUNTRY_REQUIRED: { + return "DELIVERY_COUNTRY_REQUIRED"; + } - /** - * The text of the policy. Maximum size: 64KB. - */ - public ShopPolicyWithDefaultQuery body() { - startField("body"); + case DELIVERY_FIRST_NAME_INVALID: { + return "DELIVERY_FIRST_NAME_INVALID"; + } - return this; - } + case DELIVERY_FIRST_NAME_REQUIRED: { + return "DELIVERY_FIRST_NAME_REQUIRED"; + } - /** - * The handle of the policy. - */ - public ShopPolicyWithDefaultQuery handle() { - startField("handle"); + case DELIVERY_FIRST_NAME_TOO_LONG: { + return "DELIVERY_FIRST_NAME_TOO_LONG"; + } - return this; - } + case DELIVERY_INVALID_POSTAL_CODE_FOR_COUNTRY: { + return "DELIVERY_INVALID_POSTAL_CODE_FOR_COUNTRY"; + } - /** - * The unique identifier of the policy. A default policy doesn't have an ID. - */ - public ShopPolicyWithDefaultQuery id() { - startField("id"); + case DELIVERY_INVALID_POSTAL_CODE_FOR_ZONE: { + return "DELIVERY_INVALID_POSTAL_CODE_FOR_ZONE"; + } - return this; - } + case DELIVERY_LAST_NAME_INVALID: { + return "DELIVERY_LAST_NAME_INVALID"; + } - /** - * The title of the policy. - */ - public ShopPolicyWithDefaultQuery title() { - startField("title"); + case DELIVERY_LAST_NAME_REQUIRED: { + return "DELIVERY_LAST_NAME_REQUIRED"; + } - return this; - } + case DELIVERY_LAST_NAME_TOO_LONG: { + return "DELIVERY_LAST_NAME_TOO_LONG"; + } - /** - * Public URL to the policy. - */ - public ShopPolicyWithDefaultQuery url() { - startField("url"); + case DELIVERY_NO_DELIVERY_AVAILABLE: { + return "DELIVERY_NO_DELIVERY_AVAILABLE"; + } - return this; - } - } + case DELIVERY_NO_DELIVERY_AVAILABLE_FOR_MERCHANDISE_LINE: { + return "DELIVERY_NO_DELIVERY_AVAILABLE_FOR_MERCHANDISE_LINE"; + } - /** - * A policy for the store that comes with a default value, such as a subscription policy. - * If the merchant hasn't configured a policy for their store, then the policy will return the default - * value. - * Otherwise, the policy will return the merchant-configured value. - */ - public static class ShopPolicyWithDefault extends AbstractResponse { - public ShopPolicyWithDefault() { - } + case DELIVERY_OPTIONS_PHONE_NUMBER_INVALID: { + return "DELIVERY_OPTIONS_PHONE_NUMBER_INVALID"; + } - public ShopPolicyWithDefault(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "body": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case DELIVERY_OPTIONS_PHONE_NUMBER_REQUIRED: { + return "DELIVERY_OPTIONS_PHONE_NUMBER_REQUIRED"; + } - break; - } + case DELIVERY_PHONE_NUMBER_INVALID: { + return "DELIVERY_PHONE_NUMBER_INVALID"; + } - case "handle": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case DELIVERY_PHONE_NUMBER_REQUIRED: { + return "DELIVERY_PHONE_NUMBER_REQUIRED"; + } - break; - } + case DELIVERY_POSTAL_CODE_INVALID: { + return "DELIVERY_POSTAL_CODE_INVALID"; + } - case "id": { - ID optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ID(jsonAsString(field.getValue(), key)); - } + case DELIVERY_POSTAL_CODE_REQUIRED: { + return "DELIVERY_POSTAL_CODE_REQUIRED"; + } - responseData.put(key, optional1); + case DELIVERY_ZONE_NOT_FOUND: { + return "DELIVERY_ZONE_NOT_FOUND"; + } - break; - } + case DELIVERY_ZONE_REQUIRED_FOR_COUNTRY: { + return "DELIVERY_ZONE_REQUIRED_FOR_COUNTRY"; + } - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case ERROR: { + return "ERROR"; + } - break; - } + case MERCHANDISE_LINE_LIMIT_REACHED: { + return "MERCHANDISE_LINE_LIMIT_REACHED"; + } - case "url": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case MERCHANDISE_NOT_APPLICABLE: { + return "MERCHANDISE_NOT_APPLICABLE"; + } - break; - } + case MERCHANDISE_NOT_ENOUGH_STOCK_AVAILABLE: { + return "MERCHANDISE_NOT_ENOUGH_STOCK_AVAILABLE"; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case MERCHANDISE_OUT_OF_STOCK: { + return "MERCHANDISE_OUT_OF_STOCK"; } - } - } - public String getGraphQlTypeName() { - return "ShopPolicyWithDefault"; - } + case MERCHANDISE_PRODUCT_NOT_PUBLISHED: { + return "MERCHANDISE_PRODUCT_NOT_PUBLISHED"; + } - /** - * The text of the policy. Maximum size: 64KB. - */ + case NO_DELIVERY_GROUP_SELECTED: { + return "NO_DELIVERY_GROUP_SELECTED"; + } - public String getBody() { - return (String) get("body"); - } + case PAYMENTS_ADDRESS1_INVALID: { + return "PAYMENTS_ADDRESS1_INVALID"; + } - public ShopPolicyWithDefault setBody(String arg) { - optimisticData.put(getKey("body"), arg); - return this; - } + case PAYMENTS_ADDRESS1_REQUIRED: { + return "PAYMENTS_ADDRESS1_REQUIRED"; + } - /** - * The handle of the policy. - */ + case PAYMENTS_ADDRESS1_TOO_LONG: { + return "PAYMENTS_ADDRESS1_TOO_LONG"; + } - public String getHandle() { - return (String) get("handle"); - } + case PAYMENTS_ADDRESS2_INVALID: { + return "PAYMENTS_ADDRESS2_INVALID"; + } - public ShopPolicyWithDefault setHandle(String arg) { - optimisticData.put(getKey("handle"), arg); - return this; - } + case PAYMENTS_ADDRESS2_REQUIRED: { + return "PAYMENTS_ADDRESS2_REQUIRED"; + } - /** - * The unique identifier of the policy. A default policy doesn't have an ID. - */ + case PAYMENTS_ADDRESS2_TOO_LONG: { + return "PAYMENTS_ADDRESS2_TOO_LONG"; + } - public ID getId() { - return (ID) get("id"); - } + case PAYMENTS_BILLING_ADDRESS_ZONE_NOT_FOUND: { + return "PAYMENTS_BILLING_ADDRESS_ZONE_NOT_FOUND"; + } - public ShopPolicyWithDefault setId(ID arg) { - optimisticData.put(getKey("id"), arg); - return this; - } + case PAYMENTS_BILLING_ADDRESS_ZONE_REQUIRED_FOR_COUNTRY: { + return "PAYMENTS_BILLING_ADDRESS_ZONE_REQUIRED_FOR_COUNTRY"; + } - /** - * The title of the policy. - */ + case PAYMENTS_CITY_INVALID: { + return "PAYMENTS_CITY_INVALID"; + } - public String getTitle() { - return (String) get("title"); - } + case PAYMENTS_CITY_REQUIRED: { + return "PAYMENTS_CITY_REQUIRED"; + } - public ShopPolicyWithDefault setTitle(String arg) { - optimisticData.put(getKey("title"), arg); - return this; - } + case PAYMENTS_CITY_TOO_LONG: { + return "PAYMENTS_CITY_TOO_LONG"; + } - /** - * Public URL to the policy. - */ + case PAYMENTS_COMPANY_INVALID: { + return "PAYMENTS_COMPANY_INVALID"; + } - public String getUrl() { - return (String) get("url"); - } + case PAYMENTS_COMPANY_REQUIRED: { + return "PAYMENTS_COMPANY_REQUIRED"; + } - public ShopPolicyWithDefault setUrl(String arg) { - optimisticData.put(getKey("url"), arg); - return this; - } + case PAYMENTS_COMPANY_TOO_LONG: { + return "PAYMENTS_COMPANY_TOO_LONG"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "body": return false; + case PAYMENTS_COUNTRY_REQUIRED: { + return "PAYMENTS_COUNTRY_REQUIRED"; + } - case "handle": return false; + case PAYMENTS_CREDIT_CARD_BASE_EXPIRED: { + return "PAYMENTS_CREDIT_CARD_BASE_EXPIRED"; + } - case "id": return false; + case PAYMENTS_CREDIT_CARD_BASE_GATEWAY_NOT_SUPPORTED: { + return "PAYMENTS_CREDIT_CARD_BASE_GATEWAY_NOT_SUPPORTED"; + } - case "title": return false; + case PAYMENTS_CREDIT_CARD_BASE_INVALID_START_DATE_OR_ISSUE_NUMBER_FOR_DEBIT: { + return "PAYMENTS_CREDIT_CARD_BASE_INVALID_START_DATE_OR_ISSUE_NUMBER_FOR_DEBIT"; + } - case "url": return false; + case PAYMENTS_CREDIT_CARD_BRAND_NOT_SUPPORTED: { + return "PAYMENTS_CREDIT_CARD_BRAND_NOT_SUPPORTED"; + } - default: return false; - } - } - } + case PAYMENTS_CREDIT_CARD_FIRST_NAME_BLANK: { + return "PAYMENTS_CREDIT_CARD_FIRST_NAME_BLANK"; + } - public interface StoreAvailabilityQueryDefinition { - void define(StoreAvailabilityQuery _queryBuilder); - } + case PAYMENTS_CREDIT_CARD_GENERIC: { + return "PAYMENTS_CREDIT_CARD_GENERIC"; + } - /** - * The availability of a product variant at a particular location. - * Local pick-up must be enabled in the store's shipping settings, otherwise this will return an empty - * result. - */ - public static class StoreAvailabilityQuery extends Query { - StoreAvailabilityQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } + case PAYMENTS_CREDIT_CARD_LAST_NAME_BLANK: { + return "PAYMENTS_CREDIT_CARD_LAST_NAME_BLANK"; + } - /** - * Whether the product variant is in-stock at this location. - */ - public StoreAvailabilityQuery available() { - startField("available"); + case PAYMENTS_CREDIT_CARD_MONTH_INCLUSION: { + return "PAYMENTS_CREDIT_CARD_MONTH_INCLUSION"; + } - return this; - } + case PAYMENTS_CREDIT_CARD_NAME_INVALID: { + return "PAYMENTS_CREDIT_CARD_NAME_INVALID"; + } - /** - * The location where this product variant is stocked at. - */ - public StoreAvailabilityQuery location(LocationQueryDefinition queryDef) { - startField("location"); + case PAYMENTS_CREDIT_CARD_NUMBER_INVALID: { + return "PAYMENTS_CREDIT_CARD_NUMBER_INVALID"; + } - _queryBuilder.append('{'); - queryDef.define(new LocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + case PAYMENTS_CREDIT_CARD_NUMBER_INVALID_FORMAT: { + return "PAYMENTS_CREDIT_CARD_NUMBER_INVALID_FORMAT"; + } - return this; - } + case PAYMENTS_CREDIT_CARD_SESSION_ID: { + return "PAYMENTS_CREDIT_CARD_SESSION_ID"; + } - /** - * Returns the estimated amount of time it takes for pickup to be ready (Example: Usually ready in 24 - * hours). - */ - public StoreAvailabilityQuery pickUpTime() { - startField("pickUpTime"); + case PAYMENTS_CREDIT_CARD_VERIFICATION_VALUE_BLANK: { + return "PAYMENTS_CREDIT_CARD_VERIFICATION_VALUE_BLANK"; + } - return this; - } - } + case PAYMENTS_CREDIT_CARD_VERIFICATION_VALUE_INVALID_FOR_CARD_TYPE: { + return "PAYMENTS_CREDIT_CARD_VERIFICATION_VALUE_INVALID_FOR_CARD_TYPE"; + } - /** - * The availability of a product variant at a particular location. - * Local pick-up must be enabled in the store's shipping settings, otherwise this will return an empty - * result. - */ - public static class StoreAvailability extends AbstractResponse { - public StoreAvailability() { - } + case PAYMENTS_CREDIT_CARD_YEAR_EXPIRED: { + return "PAYMENTS_CREDIT_CARD_YEAR_EXPIRED"; + } - public StoreAvailability(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "available": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + case PAYMENTS_CREDIT_CARD_YEAR_INVALID_EXPIRY_YEAR: { + return "PAYMENTS_CREDIT_CARD_YEAR_INVALID_EXPIRY_YEAR"; + } - break; - } + case PAYMENTS_FIRST_NAME_INVALID: { + return "PAYMENTS_FIRST_NAME_INVALID"; + } - case "location": { - responseData.put(key, new Location(jsonAsObject(field.getValue(), key))); + case PAYMENTS_FIRST_NAME_REQUIRED: { + return "PAYMENTS_FIRST_NAME_REQUIRED"; + } - break; - } + case PAYMENTS_FIRST_NAME_TOO_LONG: { + return "PAYMENTS_FIRST_NAME_TOO_LONG"; + } - case "pickUpTime": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case PAYMENTS_INVALID_POSTAL_CODE_FOR_COUNTRY: { + return "PAYMENTS_INVALID_POSTAL_CODE_FOR_COUNTRY"; + } - break; - } + case PAYMENTS_INVALID_POSTAL_CODE_FOR_ZONE: { + return "PAYMENTS_INVALID_POSTAL_CODE_FOR_ZONE"; + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + case PAYMENTS_LAST_NAME_INVALID: { + return "PAYMENTS_LAST_NAME_INVALID"; } - } - } - public String getGraphQlTypeName() { - return "StoreAvailability"; - } + case PAYMENTS_LAST_NAME_REQUIRED: { + return "PAYMENTS_LAST_NAME_REQUIRED"; + } - /** - * Whether the product variant is in-stock at this location. - */ + case PAYMENTS_LAST_NAME_TOO_LONG: { + return "PAYMENTS_LAST_NAME_TOO_LONG"; + } - public Boolean getAvailable() { - return (Boolean) get("available"); - } + case PAYMENTS_METHOD_REQUIRED: { + return "PAYMENTS_METHOD_REQUIRED"; + } - public StoreAvailability setAvailable(Boolean arg) { - optimisticData.put(getKey("available"), arg); - return this; - } + case PAYMENTS_METHOD_UNAVAILABLE: { + return "PAYMENTS_METHOD_UNAVAILABLE"; + } - /** - * The location where this product variant is stocked at. - */ + case PAYMENTS_PHONE_NUMBER_INVALID: { + return "PAYMENTS_PHONE_NUMBER_INVALID"; + } - public Location getLocation() { - return (Location) get("location"); - } + case PAYMENTS_PHONE_NUMBER_REQUIRED: { + return "PAYMENTS_PHONE_NUMBER_REQUIRED"; + } - public StoreAvailability setLocation(Location arg) { - optimisticData.put(getKey("location"), arg); - return this; - } + case PAYMENTS_POSTAL_CODE_INVALID: { + return "PAYMENTS_POSTAL_CODE_INVALID"; + } - /** - * Returns the estimated amount of time it takes for pickup to be ready (Example: Usually ready in 24 - * hours). - */ + case PAYMENTS_POSTAL_CODE_REQUIRED: { + return "PAYMENTS_POSTAL_CODE_REQUIRED"; + } - public String getPickUpTime() { - return (String) get("pickUpTime"); - } + case PAYMENTS_SHOPIFY_PAYMENTS_REQUIRED: { + return "PAYMENTS_SHOPIFY_PAYMENTS_REQUIRED"; + } - public StoreAvailability setPickUpTime(String arg) { - optimisticData.put(getKey("pickUpTime"), arg); - return this; - } + case PAYMENTS_UNACCEPTABLE_PAYMENT_AMOUNT: { + return "PAYMENTS_UNACCEPTABLE_PAYMENT_AMOUNT"; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "available": return false; + case PAYMENTS_WALLET_CONTENT_MISSING: { + return "PAYMENTS_WALLET_CONTENT_MISSING"; + } - case "location": return true; + case TAXES_DELIVERY_GROUP_ID_NOT_FOUND: { + return "TAXES_DELIVERY_GROUP_ID_NOT_FOUND"; + } - case "pickUpTime": return false; + case TAXES_LINE_ID_NOT_FOUND: { + return "TAXES_LINE_ID_NOT_FOUND"; + } - default: return false; + case TAXES_MUST_BE_DEFINED: { + return "TAXES_MUST_BE_DEFINED"; + } + + default: { + return ""; + } } } } - public interface StoreAvailabilityConnectionQueryDefinition { - void define(StoreAvailabilityConnectionQuery _queryBuilder); + public interface SubmitAlreadyAcceptedQueryDefinition { + void define(SubmitAlreadyAcceptedQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple StoreAvailabilities. + * Cart submit for checkout completion is successful. */ - public static class StoreAvailabilityConnectionQuery extends Query { - StoreAvailabilityConnectionQuery(StringBuilder _queryBuilder) { + public static class SubmitAlreadyAcceptedQuery extends Query { + SubmitAlreadyAcceptedQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A list of edges. - */ - public StoreAvailabilityConnectionQuery edges(StoreAvailabilityEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new StoreAvailabilityEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * A list of the nodes contained in StoreAvailabilityEdge. - */ - public StoreAvailabilityConnectionQuery nodes(StoreAvailabilityQueryDefinition queryDef) { - startField("nodes"); - - _queryBuilder.append('{'); - queryDef.define(new StoreAvailabilityQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * Information to aid in pagination. + * The id of the cart completion attempt that will be used for polling for the result. */ - public StoreAvailabilityConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SubmitAlreadyAcceptedQuery attemptId() { + startField("attemptId"); return this; } } /** - * An auto-generated type for paginating through multiple StoreAvailabilities. + * Cart submit for checkout completion is successful. */ - public static class StoreAvailabilityConnection extends AbstractResponse { - public StoreAvailabilityConnection() { + public static class SubmitAlreadyAccepted extends AbstractResponse implements CartSubmitForCompletionResult { + public SubmitAlreadyAccepted() { } - public StoreAvailabilityConnection(JsonObject fields) throws SchemaViolationError { + public SubmitAlreadyAccepted(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 StoreAvailabilityEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "nodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new StoreAvailability(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "attemptId": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -61355,90 +67855,60 @@ public StoreAvailabilityConnection(JsonObject fields) throws SchemaViolationErro } public String getGraphQlTypeName() { - return "StoreAvailabilityConnection"; - } - - /** - * A list of edges. - */ - - public List getEdges() { - return (List) get("edges"); - } - - public StoreAvailabilityConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; - } - - /** - * A list of the nodes contained in StoreAvailabilityEdge. - */ - - public List getNodes() { - return (List) get("nodes"); - } - - public StoreAvailabilityConnection setNodes(List arg) { - optimisticData.put(getKey("nodes"), arg); - return this; + return "SubmitAlreadyAccepted"; } /** - * Information to aid in pagination. + * The id of the cart completion attempt that will be used for polling for the result. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public String getAttemptId() { + return (String) get("attemptId"); } - public StoreAvailabilityConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public SubmitAlreadyAccepted setAttemptId(String arg) { + optimisticData.put(getKey("attemptId"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "edges": return true; - - case "nodes": return true; - - case "pageInfo": return true; + case "attemptId": return false; default: return false; } } } - public interface StoreAvailabilityEdgeQueryDefinition { - void define(StoreAvailabilityEdgeQuery _queryBuilder); + public interface SubmitFailedQueryDefinition { + void define(SubmitFailedQuery _queryBuilder); } /** - * An auto-generated type which holds one StoreAvailability and a cursor during pagination. + * Cart submit for checkout completion failed. */ - public static class StoreAvailabilityEdgeQuery extends Query { - StoreAvailabilityEdgeQuery(StringBuilder _queryBuilder) { + public static class SubmitFailedQuery extends Query { + SubmitFailedQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A cursor for use in pagination. + * The URL of the checkout for the cart. */ - public StoreAvailabilityEdgeQuery cursor() { - startField("cursor"); + public SubmitFailedQuery checkoutUrl() { + startField("checkoutUrl"); return this; } /** - * The item at the end of StoreAvailabilityEdge. + * The list of errors that occurred from executing the mutation. */ - public StoreAvailabilityEdgeQuery node(StoreAvailabilityQueryDefinition queryDef) { - startField("node"); + public SubmitFailedQuery errors(SubmissionErrorQueryDefinition queryDef) { + startField("errors"); _queryBuilder.append('{'); - queryDef.define(new StoreAvailabilityQuery(_queryBuilder)); + queryDef.define(new SubmissionErrorQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -61446,25 +67916,35 @@ public StoreAvailabilityEdgeQuery node(StoreAvailabilityQueryDefinition queryDef } /** - * An auto-generated type which holds one StoreAvailability and a cursor during pagination. + * Cart submit for checkout completion failed. */ - public static class StoreAvailabilityEdge extends AbstractResponse { - public StoreAvailabilityEdge() { + public static class SubmitFailed extends AbstractResponse implements CartSubmitForCompletionResult { + public SubmitFailed() { } - public StoreAvailabilityEdge(JsonObject fields) throws SchemaViolationError { + public SubmitFailed(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "cursor": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "checkoutUrl": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "node": { - responseData.put(key, new StoreAvailability(jsonAsObject(field.getValue(), key))); + case "errors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SubmissionError(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } @@ -61481,110 +67961,82 @@ public StoreAvailabilityEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "StoreAvailabilityEdge"; + return "SubmitFailed"; } /** - * A cursor for use in pagination. + * The URL of the checkout for the cart. */ - public String getCursor() { - return (String) get("cursor"); + public String getCheckoutUrl() { + return (String) get("checkoutUrl"); } - public StoreAvailabilityEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); + public SubmitFailed setCheckoutUrl(String arg) { + optimisticData.put(getKey("checkoutUrl"), arg); return this; } /** - * The item at the end of StoreAvailabilityEdge. + * The list of errors that occurred from executing the mutation. */ - public StoreAvailability getNode() { - return (StoreAvailability) get("node"); + public List getErrors() { + return (List) get("errors"); } - public StoreAvailabilityEdge setNode(StoreAvailability arg) { - optimisticData.put(getKey("node"), arg); + public SubmitFailed setErrors(List arg) { + optimisticData.put(getKey("errors"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cursor": return false; + case "checkoutUrl": return false; - case "node": return true; + case "errors": return true; default: return false; } } } - public interface StringConnectionQueryDefinition { - void define(StringConnectionQuery _queryBuilder); + public interface SubmitSuccessQueryDefinition { + void define(SubmitSuccessQuery _queryBuilder); } /** - * An auto-generated type for paginating through a list of Strings. + * Cart submit for checkout completion is already accepted. */ - public static class StringConnectionQuery extends Query { - StringConnectionQuery(StringBuilder _queryBuilder) { + public static class SubmitSuccessQuery extends Query { + SubmitSuccessQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A list of edges. - */ - public StringConnectionQuery edges(StringEdgeQueryDefinition queryDef) { - startField("edges"); - - _queryBuilder.append('{'); - queryDef.define(new StringEdgeQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * Information to aid in pagination. + * The id of the cart completion attempt that will be used for polling for the result. */ - public StringConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { - startField("pageInfo"); - - _queryBuilder.append('{'); - queryDef.define(new PageInfoQuery(_queryBuilder)); - _queryBuilder.append('}'); + public SubmitSuccessQuery attemptId() { + startField("attemptId"); return this; } } /** - * An auto-generated type for paginating through a list of Strings. + * Cart submit for checkout completion is already accepted. */ - public static class StringConnection extends AbstractResponse { - public StringConnection() { + public static class SubmitSuccess extends AbstractResponse implements CartSubmitForCompletionResult { + public SubmitSuccess() { } - public StringConnection(JsonObject fields) throws SchemaViolationError { + public SubmitSuccess(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 StringEdge(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "pageInfo": { - responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); + case "attemptId": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -61601,97 +68053,70 @@ public StringConnection(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "StringConnection"; - } - - /** - * A list of edges. - */ - - public List getEdges() { - return (List) get("edges"); - } - - public StringConnection setEdges(List arg) { - optimisticData.put(getKey("edges"), arg); - return this; + return "SubmitSuccess"; } /** - * Information to aid in pagination. + * The id of the cart completion attempt that will be used for polling for the result. */ - public PageInfo getPageInfo() { - return (PageInfo) get("pageInfo"); + public String getAttemptId() { + return (String) get("attemptId"); } - public StringConnection setPageInfo(PageInfo arg) { - optimisticData.put(getKey("pageInfo"), arg); + public SubmitSuccess setAttemptId(String arg) { + optimisticData.put(getKey("attemptId"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "edges": return true; - - case "pageInfo": return true; + case "attemptId": return false; default: return false; } } } - public interface StringEdgeQueryDefinition { - void define(StringEdgeQuery _queryBuilder); + public interface SubmitThrottledQueryDefinition { + void define(SubmitThrottledQuery _queryBuilder); } /** - * An auto-generated type which holds one String and a cursor during pagination. + * Cart submit for checkout completion is throttled. */ - public static class StringEdgeQuery extends Query { - StringEdgeQuery(StringBuilder _queryBuilder) { + public static class SubmitThrottledQuery extends Query { + SubmitThrottledQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * A cursor for use in pagination. - */ - public StringEdgeQuery cursor() { - startField("cursor"); - - return this; - } - - /** - * The item at the end of StringEdge. + * UTC date time string that indicates the time after which clients should make their next + * poll request. Any poll requests sent before this time will be ignored. Use this value to schedule + * the + * next poll request. */ - public StringEdgeQuery node() { - startField("node"); + public SubmitThrottledQuery pollAfter() { + startField("pollAfter"); return this; } } /** - * An auto-generated type which holds one String and a cursor during pagination. + * Cart submit for checkout completion is throttled. */ - public static class StringEdge extends AbstractResponse { - public StringEdge() { + public static class SubmitThrottled extends AbstractResponse implements CartSubmitForCompletionResult { + public SubmitThrottled() { } - public StringEdge(JsonObject fields) throws SchemaViolationError { + public SubmitThrottled(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, jsonAsString(field.getValue(), key)); + case "pollAfter": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); break; } @@ -61708,40 +68133,28 @@ public StringEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "StringEdge"; - } - - /** - * A cursor for use in pagination. - */ - - public String getCursor() { - return (String) get("cursor"); - } - - public StringEdge setCursor(String arg) { - optimisticData.put(getKey("cursor"), arg); - return this; + return "SubmitThrottled"; } /** - * The item at the end of StringEdge. + * UTC date time string that indicates the time after which clients should make their next + * poll request. Any poll requests sent before this time will be ignored. Use this value to schedule + * the + * next poll request. */ - public String getNode() { - return (String) get("node"); + public DateTime getPollAfter() { + return (DateTime) get("pollAfter"); } - public StringEdge setNode(String arg) { - optimisticData.put(getKey("node"), arg); + public SubmitThrottled setPollAfter(DateTime arg) { + optimisticData.put(getKey("pollAfter"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "cursor": return false; - - case "node": return false; + case "pollAfter": return false; default: return false; } @@ -63446,6 +69859,19 @@ public VideoQuery mediaContentType() { return this; } + /** + * The presentation for a media. + */ + public VideoQuery presentation(MediaPresentationQueryDefinition queryDef) { + startField("presentation"); + + _queryBuilder.append('{'); + queryDef.define(new MediaPresentationQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + /** * The preview image for the media. */ @@ -63508,6 +69934,17 @@ public Video(JsonObject fields) throws SchemaViolationError { break; } + case "presentation": { + MediaPresentation optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MediaPresentation(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + case "previewImage": { Image optional1 = null; if (!field.getValue().isJsonNull()) { @@ -63584,6 +70021,19 @@ public Video setMediaContentType(MediaContentType arg) { return this; } + /** + * The presentation for a media. + */ + + public MediaPresentation getPresentation() { + return (MediaPresentation) get("presentation"); + } + + public Video setPresentation(MediaPresentation arg) { + optimisticData.put(getKey("presentation"), arg); + return this; + } + /** * The preview image for the media. */ @@ -63618,6 +70068,8 @@ public boolean unwrapsToObject(String key) { case "mediaContentType": return false; + case "presentation": return true; + case "previewImage": return true; case "sources": return true;