From 194f58a0d639eb318f7a06c10ccef3e9e81ff1a0 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 2 Apr 2024 13:44:17 +0000 Subject: [PATCH 1/2] Update schema (auto-generated) --- .../java/com/shopify/buy3/Storefront.java | 6114 ++++++++++++----- 1 file changed, 4414 insertions(+), 1700 deletions(-) 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 73af62d0..c9c55137 100644 --- a/MobileBuy/buy3/src/main/java/com/shopify/buy3/Storefront.java +++ b/MobileBuy/buy3/src/main/java/com/shopify/buy3/Storefront.java @@ -25,7 +25,7 @@ import java.util.*; public class Storefront { - public static final String API_VERSION = "2024-01"; + public static final String API_VERSION = "2024-04"; public static QueryRootQuery query(QueryRootQueryDefinition queryDef) { return query(Collections.emptyList(), queryDef); @@ -136,6 +136,8 @@ public static class InContextDirective extends Directive { public ID preferredLocationId; + public BuyerInput buyer; + public InContextDirective() { super("inContext"); } @@ -162,6 +164,12 @@ public String toString() { Query.appendQuotedString(_queryBuilder, preferredLocationId.toString()); } + if (buyer != null) { + _queryBuilder.append(", "); + _queryBuilder.append("buyer:"); + buyer.appendTo(_queryBuilder); + } + _queryBuilder.append(")"); return _queryBuilder.toString(); } @@ -4930,6 +4938,69 @@ public boolean unwrapsToObject(String key) { } } + public static class BuyerInput implements Serializable { + private String customerAccessToken; + + private Input companyLocationId = Input.undefined(); + + public BuyerInput(String customerAccessToken) { + this.customerAccessToken = customerAccessToken; + } + + public String getCustomerAccessToken() { + return customerAccessToken; + } + + public BuyerInput setCustomerAccessToken(String customerAccessToken) { + this.customerAccessToken = customerAccessToken; + return this; + } + + public ID getCompanyLocationId() { + return companyLocationId.getValue(); + } + + public Input getCompanyLocationIdInput() { + return companyLocationId; + } + + public BuyerInput setCompanyLocationId(ID companyLocationId) { + this.companyLocationId = Input.optional(companyLocationId); + return this; + } + + public BuyerInput setCompanyLocationIdInput(Input companyLocationId) { + if (companyLocationId == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.companyLocationId = companyLocationId; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("customerAccessToken:"); + Query.appendQuotedString(_queryBuilder, customerAccessToken.toString()); + + if (this.companyLocationId.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("companyLocationId:"); + if (companyLocationId.getValue() != null) { + Query.appendQuotedString(_queryBuilder, companyLocationId.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + _queryBuilder.append('}'); + } + } + /** * Card brand, such as Visa or Mastercard, which can be used for payments. */ @@ -6207,6 +6278,19 @@ public CartBuyerIdentityQuery phone() { return this; } + /** + * The purchasing company associated with the cart. + */ + public CartBuyerIdentityQuery purchasingCompany(PurchasingCompanyQueryDefinition queryDef) { + startField("purchasingCompany"); + + _queryBuilder.append('{'); + queryDef.define(new PurchasingCompanyQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + /** * A set of wallet preferences tied to the buyer that is interacting with the cart. * Preferences can be used to populate relevant payment fields in the checkout flow. @@ -6285,6 +6369,17 @@ public CartBuyerIdentity(JsonObject fields) throws SchemaViolationError { break; } + case "purchasingCompany": { + PurchasingCompany optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new PurchasingCompany(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + case "walletPreferences": { List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { @@ -6378,6 +6473,19 @@ public CartBuyerIdentity setPhone(String arg) { return this; } + /** + * The purchasing company associated with the cart. + */ + + public PurchasingCompany getPurchasingCompany() { + return (PurchasingCompany) get("purchasingCompany"); + } + + public CartBuyerIdentity setPurchasingCompany(PurchasingCompany arg) { + optimisticData.put(getKey("purchasingCompany"), 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. @@ -6404,6 +6512,8 @@ public boolean unwrapsToObject(String key) { case "phone": return false; + case "purchasingCompany": return true; + case "walletPreferences": return false; default: return false; @@ -6416,6 +6526,8 @@ public static class CartBuyerIdentityInput implements Serializable { private Input phone = Input.undefined(); + private Input companyLocationId = Input.undefined(); + private Input countryCode = Input.undefined(); private Input customerAccessToken = Input.undefined(); @@ -6466,6 +6578,27 @@ public CartBuyerIdentityInput setPhoneInput(Input phone) { return this; } + public ID getCompanyLocationId() { + return companyLocationId.getValue(); + } + + public Input getCompanyLocationIdInput() { + return companyLocationId; + } + + public CartBuyerIdentityInput setCompanyLocationId(ID companyLocationId) { + this.companyLocationId = Input.optional(companyLocationId); + return this; + } + + public CartBuyerIdentityInput setCompanyLocationIdInput(Input companyLocationId) { + if (companyLocationId == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.companyLocationId = companyLocationId; + return this; + } + public CountryCode getCountryCode() { return countryCode.getValue(); } @@ -6576,6 +6709,17 @@ public void appendTo(StringBuilder _queryBuilder) { } } + if (this.companyLocationId.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("companyLocationId:"); + if (companyLocationId.getValue() != null) { + Query.appendQuotedString(_queryBuilder, companyLocationId.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + if (this.countryCode.isDefined()) { _queryBuilder.append(separator); separator = ","; @@ -8333,6 +8477,15 @@ public CartDeliveryGroupQuery deliveryOptions(CartDeliveryOptionQueryDefinition return this; } + /** + * The type of merchandise in the delivery group. + */ + public CartDeliveryGroupQuery groupType() { + startField("groupType"); + + return this; + } + /** * The ID for the delivery group. */ @@ -8392,6 +8545,12 @@ public CartDeliveryGroup(JsonObject fields) throws SchemaViolationError { break; } + case "groupType": { + responseData.put(key, CartDeliveryGroupType.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + case "id": { responseData.put(key, new ID(jsonAsString(field.getValue(), key))); @@ -8463,6 +8622,19 @@ public CartDeliveryGroup setDeliveryOptions(List arg) { return this; } + /** + * The type of merchandise in the delivery group. + */ + + public CartDeliveryGroupType getGroupType() { + return (CartDeliveryGroupType) get("groupType"); + } + + public CartDeliveryGroup setGroupType(CartDeliveryGroupType arg) { + optimisticData.put(getKey("groupType"), arg); + return this; + } + /** * The ID for the delivery group. */ @@ -8497,6 +8669,8 @@ public boolean unwrapsToObject(String key) { case "deliveryOptions": return true; + case "groupType": return false; + case "id": return false; case "selectedDeliveryOption": return true; @@ -8776,6 +8950,60 @@ public boolean unwrapsToObject(String key) { } } + /** + * Defines what type of merchandise is in the delivery group. + */ + public enum CartDeliveryGroupType { + /** + * The delivery group only contains merchandise that is either a one time purchase or a first delivery + * of + * subscription merchandise. + */ + ONE_TIME_PURCHASE, + + /** + * The delivery group only contains subscription merchandise. + */ + SUBSCRIPTION, + + UNKNOWN_VALUE; + + public static CartDeliveryGroupType fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "ONE_TIME_PURCHASE": { + return ONE_TIME_PURCHASE; + } + + case "SUBSCRIPTION": { + return SUBSCRIPTION; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case ONE_TIME_PURCHASE: { + return "ONE_TIME_PURCHASE"; + } + + case SUBSCRIPTION: { + return "SUBSCRIPTION"; + } + + default: { + return ""; + } + } + } + } + public interface CartDeliveryOptionQueryDefinition { void define(CartDeliveryOptionQuery _queryBuilder); } @@ -9470,11 +9698,46 @@ public boolean unwrapsToObject(String key) { * Possible error codes that can be returned by `CartUserError`. */ public enum CartErrorCode { + /** + * The specified address field contains emojis. + */ + ADDRESS_FIELD_CONTAINS_EMOJIS, + + /** + * The specified address field contains HTML tags. + */ + ADDRESS_FIELD_CONTAINS_HTML_TAGS, + + /** + * The specified address field contains a URL. + */ + ADDRESS_FIELD_CONTAINS_URL, + + /** + * The specified address field does not match the expected pattern. + */ + ADDRESS_FIELD_DOES_NOT_MATCH_EXPECTED_PATTERN, + + /** + * The specified address field is required. + */ + ADDRESS_FIELD_IS_REQUIRED, + + /** + * The specified address field is too long. + */ + ADDRESS_FIELD_IS_TOO_LONG, + /** * The input value is invalid. */ INVALID, + /** + * Company location not found or not allowed. + */ + INVALID_COMPANY_LOCATION, + /** * Delivery group was not found in cart. */ @@ -9485,6 +9748,11 @@ public enum CartErrorCode { */ INVALID_DELIVERY_OPTION, + /** + * The quantity must be a multiple of the specified increment. + */ + INVALID_INCREMENT, + /** * Merchandise line was not found in cart. */ @@ -9505,11 +9773,36 @@ public enum CartErrorCode { */ INVALID_PAYMENT_EMPTY_CART, + /** + * The given zip code is invalid for the provided country. + */ + INVALID_ZIP_CODE_FOR_COUNTRY, + + /** + * The given zip code is invalid for the provided province. + */ + INVALID_ZIP_CODE_FOR_PROVINCE, + /** * The input value should be less than the maximum value allowed. */ LESS_THAN, + /** + * The quantity must be below the specified maximum for the item. + */ + MAXIMUM_EXCEEDED, + + /** + * The quantity must be above the specified minimum for the item. + */ + MINIMUM_NOT_MET, + + /** + * The customer access token is required when setting a company location. + */ + MISSING_CUSTOMER_ACCESS_TOKEN, + /** * Missing discount code. */ @@ -9525,11 +9818,26 @@ public enum CartErrorCode { */ PAYMENT_METHOD_NOT_SUPPORTED, + /** + * The given province cannot be found. + */ + PROVINCE_NOT_FOUND, + + /** + * A general error occurred during address validation. + */ + UNSPECIFIED_ADDRESS_ERROR, + /** * Validation failed. */ VALIDATION_CUSTOM, + /** + * The given zip code is unsupported. + */ + ZIP_CODE_NOT_SUPPORTED, + UNKNOWN_VALUE; public static CartErrorCode fromGraphQl(String value) { @@ -9538,10 +9846,38 @@ public static CartErrorCode fromGraphQl(String value) { } switch (value) { + case "ADDRESS_FIELD_CONTAINS_EMOJIS": { + return ADDRESS_FIELD_CONTAINS_EMOJIS; + } + + case "ADDRESS_FIELD_CONTAINS_HTML_TAGS": { + return ADDRESS_FIELD_CONTAINS_HTML_TAGS; + } + + case "ADDRESS_FIELD_CONTAINS_URL": { + return ADDRESS_FIELD_CONTAINS_URL; + } + + case "ADDRESS_FIELD_DOES_NOT_MATCH_EXPECTED_PATTERN": { + return ADDRESS_FIELD_DOES_NOT_MATCH_EXPECTED_PATTERN; + } + + case "ADDRESS_FIELD_IS_REQUIRED": { + return ADDRESS_FIELD_IS_REQUIRED; + } + + case "ADDRESS_FIELD_IS_TOO_LONG": { + return ADDRESS_FIELD_IS_TOO_LONG; + } + case "INVALID": { return INVALID; } + case "INVALID_COMPANY_LOCATION": { + return INVALID_COMPANY_LOCATION; + } + case "INVALID_DELIVERY_GROUP": { return INVALID_DELIVERY_GROUP; } @@ -9550,6 +9886,10 @@ public static CartErrorCode fromGraphQl(String value) { return INVALID_DELIVERY_OPTION; } + case "INVALID_INCREMENT": { + return INVALID_INCREMENT; + } + case "INVALID_MERCHANDISE_LINE": { return INVALID_MERCHANDISE_LINE; } @@ -9566,10 +9906,30 @@ public static CartErrorCode fromGraphQl(String value) { return INVALID_PAYMENT_EMPTY_CART; } + case "INVALID_ZIP_CODE_FOR_COUNTRY": { + return INVALID_ZIP_CODE_FOR_COUNTRY; + } + + case "INVALID_ZIP_CODE_FOR_PROVINCE": { + return INVALID_ZIP_CODE_FOR_PROVINCE; + } + case "LESS_THAN": { return LESS_THAN; } + case "MAXIMUM_EXCEEDED": { + return MAXIMUM_EXCEEDED; + } + + case "MINIMUM_NOT_MET": { + return MINIMUM_NOT_MET; + } + + case "MISSING_CUSTOMER_ACCESS_TOKEN": { + return MISSING_CUSTOMER_ACCESS_TOKEN; + } + case "MISSING_DISCOUNT_CODE": { return MISSING_DISCOUNT_CODE; } @@ -9582,10 +9942,22 @@ public static CartErrorCode fromGraphQl(String value) { return PAYMENT_METHOD_NOT_SUPPORTED; } + case "PROVINCE_NOT_FOUND": { + return PROVINCE_NOT_FOUND; + } + + case "UNSPECIFIED_ADDRESS_ERROR": { + return UNSPECIFIED_ADDRESS_ERROR; + } + case "VALIDATION_CUSTOM": { return VALIDATION_CUSTOM; } + case "ZIP_CODE_NOT_SUPPORTED": { + return ZIP_CODE_NOT_SUPPORTED; + } + default: { return UNKNOWN_VALUE; } @@ -9593,10 +9965,38 @@ public static CartErrorCode fromGraphQl(String value) { } public String toString() { switch (this) { + case ADDRESS_FIELD_CONTAINS_EMOJIS: { + return "ADDRESS_FIELD_CONTAINS_EMOJIS"; + } + + case ADDRESS_FIELD_CONTAINS_HTML_TAGS: { + return "ADDRESS_FIELD_CONTAINS_HTML_TAGS"; + } + + case ADDRESS_FIELD_CONTAINS_URL: { + return "ADDRESS_FIELD_CONTAINS_URL"; + } + + case ADDRESS_FIELD_DOES_NOT_MATCH_EXPECTED_PATTERN: { + return "ADDRESS_FIELD_DOES_NOT_MATCH_EXPECTED_PATTERN"; + } + + case ADDRESS_FIELD_IS_REQUIRED: { + return "ADDRESS_FIELD_IS_REQUIRED"; + } + + case ADDRESS_FIELD_IS_TOO_LONG: { + return "ADDRESS_FIELD_IS_TOO_LONG"; + } + case INVALID: { return "INVALID"; } + case INVALID_COMPANY_LOCATION: { + return "INVALID_COMPANY_LOCATION"; + } + case INVALID_DELIVERY_GROUP: { return "INVALID_DELIVERY_GROUP"; } @@ -9605,6 +10005,10 @@ public String toString() { return "INVALID_DELIVERY_OPTION"; } + case INVALID_INCREMENT: { + return "INVALID_INCREMENT"; + } + case INVALID_MERCHANDISE_LINE: { return "INVALID_MERCHANDISE_LINE"; } @@ -9621,10 +10025,30 @@ public String toString() { return "INVALID_PAYMENT_EMPTY_CART"; } + case INVALID_ZIP_CODE_FOR_COUNTRY: { + return "INVALID_ZIP_CODE_FOR_COUNTRY"; + } + + case INVALID_ZIP_CODE_FOR_PROVINCE: { + return "INVALID_ZIP_CODE_FOR_PROVINCE"; + } + case LESS_THAN: { return "LESS_THAN"; } + case MAXIMUM_EXCEEDED: { + return "MAXIMUM_EXCEEDED"; + } + + case MINIMUM_NOT_MET: { + return "MINIMUM_NOT_MET"; + } + + case MISSING_CUSTOMER_ACCESS_TOKEN: { + return "MISSING_CUSTOMER_ACCESS_TOKEN"; + } + case MISSING_DISCOUNT_CODE: { return "MISSING_DISCOUNT_CODE"; } @@ -9637,10 +10061,22 @@ public String toString() { return "PAYMENT_METHOD_NOT_SUPPORTED"; } + case PROVINCE_NOT_FOUND: { + return "PROVINCE_NOT_FOUND"; + } + + case UNSPECIFIED_ADDRESS_ERROR: { + return "UNSPECIFIED_ADDRESS_ERROR"; + } + case VALIDATION_CUSTOM: { return "VALIDATION_CUSTOM"; } + case ZIP_CODE_NOT_SUPPORTED: { + return "ZIP_CODE_NOT_SUPPORTED"; + } + default: { return ""; } @@ -13101,6 +13537,8 @@ public interface CheckoutQueryDefinition { /** * A container for all the information required to checkout items and pay. + * The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please + * see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ public static class CheckoutQuery extends Query { CheckoutQuery(StringBuilder _queryBuilder) { @@ -13652,6 +14090,8 @@ public CheckoutQuery webUrl() { /** * A container for all the information required to checkout items and pay. + * The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please + * see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ public static class Checkout extends AbstractResponse implements Node { public Checkout() { @@ -21338,138 +21778,153 @@ public boolean unwrapsToObject(String key) { } } - public interface CompletePaymentChallengeQueryDefinition { - void define(CompletePaymentChallengeQuery _queryBuilder); + public interface CompanyQueryDefinition { + void define(CompanyQuery _queryBuilder); } /** - * The action for the 3DS payment redirect. + * Represents information about a company which is also a customer of the shop. */ - public static class CompletePaymentChallengeQuery extends Query { - CompletePaymentChallengeQuery(StringBuilder _queryBuilder) { + public static class CompanyQuery extends Query { + CompanyQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * The URL for the 3DS payment redirect. + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * was created in Shopify. */ - public CompletePaymentChallengeQuery redirectUrl() { - startField("redirectUrl"); + public CompanyQuery createdAt() { + startField("createdAt"); return this; } - } - - /** - * The action for the 3DS payment redirect. - */ - public static class CompletePaymentChallenge extends AbstractResponse implements CartCompletionAction { - public CompletePaymentChallenge() { - } - 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); - } + /** + * A unique externally-supplied ID for the company. + */ + public CompanyQuery externalId() { + startField("externalId"); - responseData.put(key, optional1); + return this; + } - break; - } + public class MetafieldArguments extends Arguments { + MetafieldArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + /** + * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. + */ + public MetafieldArguments namespace(String value) { + if (value != null) { + startArgument("namespace"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } } - public String getGraphQlTypeName() { - return "CompletePaymentChallenge"; + public interface MetafieldArgumentsDefinition { + void define(MetafieldArguments args); } /** - * The URL for the 3DS payment redirect. + * Returns a metafield found by namespace and key. */ - - public String getRedirectUrl() { - return (String) get("redirectUrl"); + public CompanyQuery metafield(String key, MetafieldQueryDefinition queryDef) { + return metafield(key, args -> {}, queryDef); } - public CompletePaymentChallenge setRedirectUrl(String arg) { - optimisticData.put(getKey("redirectUrl"), arg); + /** + * Returns a metafield found by namespace and key. + */ + public CompanyQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { + startField("metafield"); + + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + argsDef.define(new MetafieldArguments(_queryBuilder)); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "redirectUrl": return false; + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ + public CompanyQuery 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(']'); - public interface CompletionErrorQueryDefinition { - void define(CompletionErrorQuery _queryBuilder); - } + _queryBuilder.append(')'); - /** - * An error that occurred during a cart completion attempt. - */ - public static class CompletionErrorQuery extends Query { - CompletionErrorQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * The error code. + * The name of the company. */ - public CompletionErrorQuery code() { - startField("code"); + public CompanyQuery name() { + startField("name"); return this; } /** - * The error message. + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * was last modified. */ - public CompletionErrorQuery message() { - startField("message"); + public CompanyQuery updatedAt() { + startField("updatedAt"); return this; } } /** - * An error that occurred during a cart completion attempt. + * Represents information about a company which is also a customer of the shop. */ - public static class CompletionError extends AbstractResponse { - public CompletionError() { + public static class Company extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { + public Company() { } - public CompletionError(JsonObject fields) throws SchemaViolationError { + public Company(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "code": { - responseData.put(key, CompletionErrorCode.fromGraphQl(jsonAsString(field.getValue(), key))); + case "createdAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); break; } - case "message": { + case "externalId": { String optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = jsonAsString(field.getValue(), key); @@ -21480,6 +21935,51 @@ public CompletionError(JsonObject fields) throws SchemaViolationError { 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 "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -21491,409 +21991,531 @@ public CompletionError(JsonObject fields) throws SchemaViolationError { } } + public Company(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "CompletionError"; + return "Company"; } /** - * The error code. + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * was created in Shopify. */ - public CompletionErrorCode getCode() { - return (CompletionErrorCode) get("code"); + public DateTime getCreatedAt() { + return (DateTime) get("createdAt"); } - public CompletionError setCode(CompletionErrorCode arg) { - optimisticData.put(getKey("code"), arg); + public Company setCreatedAt(DateTime arg) { + optimisticData.put(getKey("createdAt"), arg); return this; } /** - * The error message. + * A unique externally-supplied ID for the company. */ - public String getMessage() { - return (String) get("message"); + public String getExternalId() { + return (String) get("externalId"); } - public CompletionError setMessage(String arg) { - optimisticData.put(getKey("message"), arg); + public Company setExternalId(String arg) { + optimisticData.put(getKey("externalId"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "code": return false; + /** + * A globally-unique ID. + */ - case "message": return false; + public ID getId() { + return (ID) get("id"); + } - default: return false; - } + /** + * Returns a metafield found by namespace and key. + */ + + public Metafield getMetafield() { + return (Metafield) get("metafield"); } - } - /** - * The code of the error that occurred during a cart completion attempt. - */ - public enum CompletionErrorCode { - ERROR, + public Company setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); + return this; + } - INVENTORY_RESERVATION_ERROR, + /** + * The metafields associated with the resource matching the supplied list of namespaces and keys. + */ - PAYMENT_AMOUNT_TOO_SMALL, + public List getMetafields() { + return (List) get("metafields"); + } - PAYMENT_CALL_ISSUER, + public Company setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); + return this; + } - PAYMENT_CARD_DECLINED, + /** + * The name of the company. + */ - PAYMENT_ERROR, + public String getName() { + return (String) get("name"); + } - PAYMENT_GATEWAY_NOT_ENABLED_ERROR, + public Company setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } - PAYMENT_INSUFFICIENT_FUNDS, + /** + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * was last modified. + */ - PAYMENT_INVALID_BILLING_ADDRESS, + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); + } - PAYMENT_INVALID_CREDIT_CARD, + public Company setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); + return this; + } - PAYMENT_INVALID_CURRENCY, + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "createdAt": return false; - PAYMENT_INVALID_PAYMENT_METHOD, + case "externalId": return false; - PAYMENT_TRANSIENT_ERROR, + case "id": return false; - UNKNOWN_VALUE; + case "metafield": return true; - public static CompletionErrorCode fromGraphQl(String value) { - if (value == null) { - return null; - } + case "metafields": return true; - switch (value) { - case "ERROR": { - return ERROR; - } + case "name": return false; - case "INVENTORY_RESERVATION_ERROR": { - return INVENTORY_RESERVATION_ERROR; - } + case "updatedAt": return false; - case "PAYMENT_AMOUNT_TOO_SMALL": { - return PAYMENT_AMOUNT_TOO_SMALL; - } + default: return false; + } + } + } - case "PAYMENT_CALL_ISSUER": { - return PAYMENT_CALL_ISSUER; - } + public interface CompanyContactQueryDefinition { + void define(CompanyContactQuery _queryBuilder); + } - case "PAYMENT_CARD_DECLINED": { - return PAYMENT_CARD_DECLINED; - } + /** + * A company's main point of contact. + */ + public static class CompanyContactQuery extends Query { + CompanyContactQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); - case "PAYMENT_ERROR": { - return PAYMENT_ERROR; - } + startField("id"); + } - case "PAYMENT_GATEWAY_NOT_ENABLED_ERROR": { - return PAYMENT_GATEWAY_NOT_ENABLED_ERROR; - } + /** + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * contact was created in Shopify. + */ + public CompanyContactQuery createdAt() { + startField("createdAt"); - case "PAYMENT_INSUFFICIENT_FUNDS": { - return PAYMENT_INSUFFICIENT_FUNDS; - } + return this; + } - case "PAYMENT_INVALID_BILLING_ADDRESS": { - return PAYMENT_INVALID_BILLING_ADDRESS; - } + /** + * The company contact's locale (language). + */ + public CompanyContactQuery locale() { + startField("locale"); - case "PAYMENT_INVALID_CREDIT_CARD": { - return PAYMENT_INVALID_CREDIT_CARD; - } + return this; + } - case "PAYMENT_INVALID_CURRENCY": { - return PAYMENT_INVALID_CURRENCY; - } + /** + * The company contact's job title. + */ + public CompanyContactQuery title() { + startField("title"); - case "PAYMENT_INVALID_PAYMENT_METHOD": { - return PAYMENT_INVALID_PAYMENT_METHOD; - } + return this; + } - case "PAYMENT_TRANSIENT_ERROR": { - return PAYMENT_TRANSIENT_ERROR; - } + /** + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * contact was last modified. + */ + public CompanyContactQuery updatedAt() { + startField("updatedAt"); - default: { - return UNKNOWN_VALUE; - } - } + return this; } - public String toString() { - switch (this) { - case ERROR: { - return "ERROR"; - } + } - case INVENTORY_RESERVATION_ERROR: { - return "INVENTORY_RESERVATION_ERROR"; - } + /** + * A company's main point of contact. + */ + public static class CompanyContact extends AbstractResponse implements Node { + public CompanyContact() { + } - case PAYMENT_AMOUNT_TOO_SMALL: { - return "PAYMENT_AMOUNT_TOO_SMALL"; - } + public CompanyContact(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "createdAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - case PAYMENT_CALL_ISSUER: { - return "PAYMENT_CALL_ISSUER"; - } + break; + } - case PAYMENT_CARD_DECLINED: { - return "PAYMENT_CARD_DECLINED"; - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - case PAYMENT_ERROR: { - return "PAYMENT_ERROR"; - } + break; + } - case PAYMENT_GATEWAY_NOT_ENABLED_ERROR: { - return "PAYMENT_GATEWAY_NOT_ENABLED_ERROR"; - } + case "locale": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case PAYMENT_INSUFFICIENT_FUNDS: { - return "PAYMENT_INSUFFICIENT_FUNDS"; - } + responseData.put(key, optional1); - case PAYMENT_INVALID_BILLING_ADDRESS: { - return "PAYMENT_INVALID_BILLING_ADDRESS"; - } + break; + } - case PAYMENT_INVALID_CREDIT_CARD: { - return "PAYMENT_INVALID_CREDIT_CARD"; - } + case "title": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case PAYMENT_INVALID_CURRENCY: { - return "PAYMENT_INVALID_CURRENCY"; - } + responseData.put(key, optional1); - case PAYMENT_INVALID_PAYMENT_METHOD: { - return "PAYMENT_INVALID_PAYMENT_METHOD"; - } + break; + } - case PAYMENT_TRANSIENT_ERROR: { - return "PAYMENT_TRANSIENT_ERROR"; - } + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - default: { - return ""; + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } } } - } - - public interface ComponentizableCartLineQueryDefinition { - void define(ComponentizableCartLineQuery _queryBuilder); - } - /** - * Represents information about the grouped merchandise in the cart. - */ - public static class ComponentizableCartLineQuery extends Query { - ComponentizableCartLineQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + public CompanyContact(ID id) { + this(); + optimisticData.put("id", id); + } - startField("id"); + public String getGraphQlTypeName() { + return "CompanyContact"; } /** - * An attribute associated with the cart line. + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * contact was created in Shopify. */ - public ComponentizableCartLineQuery 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('}'); + public DateTime getCreatedAt() { + return (DateTime) get("createdAt"); + } + public CompanyContact setCreatedAt(DateTime arg) { + optimisticData.put(getKey("createdAt"), arg); return this; } /** - * The attributes associated with the cart line. Attributes are represented as key-value pairs. + * A globally-unique ID. */ - public ComponentizableCartLineQuery attributes(AttributeQueryDefinition queryDef) { - startField("attributes"); - - _queryBuilder.append('{'); - queryDef.define(new AttributeQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public ID getId() { + return (ID) get("id"); } /** - * 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 company contact's locale (language). */ - public ComponentizableCartLineQuery cost(CartLineCostQueryDefinition queryDef) { - startField("cost"); - _queryBuilder.append('{'); - queryDef.define(new CartLineCostQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getLocale() { + return (String) get("locale"); + } + public CompanyContact setLocale(String arg) { + optimisticData.put(getKey("locale"), arg); return this; } /** - * The discounts that have been applied to the cart line. + * The company contact's job title. */ - public ComponentizableCartLineQuery discountAllocations(CartDiscountAllocationQueryDefinition queryDef) { - startField("discountAllocations"); - _queryBuilder.append('{'); - queryDef.define(new CartDiscountAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + public String getTitle() { + return (String) get("title"); + } + public CompanyContact setTitle(String arg) { + optimisticData.put(getKey("title"), 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 date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * contact was last modified. */ - @Deprecated - public ComponentizableCartLineQuery estimatedCost(CartLineEstimatedCostQueryDefinition queryDef) { - startField("estimatedCost"); - _queryBuilder.append('{'); - queryDef.define(new CartLineEstimatedCostQuery(_queryBuilder)); - _queryBuilder.append('}'); + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); + } + public CompanyContact setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); return this; } - /** - * The components of the line item. - */ - public ComponentizableCartLineQuery lineComponents(CartLineQueryDefinition queryDef) { - startField("lineComponents"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "createdAt": return false; + + case "id": return false; + + case "locale": return false; + + case "title": return false; + + case "updatedAt": return false; + + default: return false; + } + } + } + + public interface CompanyLocationQueryDefinition { + void define(CompanyLocationQuery _queryBuilder); + } + + /** + * A company's location. + */ + public static class CompanyLocationQuery extends Query { + CompanyLocationQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); + } + + /** + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * location was created in Shopify. + */ + public CompanyLocationQuery createdAt() { + startField("createdAt"); + + return this; + } + + /** + * A unique externally-supplied ID for the company. + */ + public CompanyLocationQuery externalId() { + startField("externalId"); + + return this; + } + + /** + * The preferred locale of the company location. + */ + public CompanyLocationQuery locale() { + startField("locale"); + + return this; + } + + public class MetafieldArguments extends Arguments { + MetafieldArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); + } + + /** + * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. + */ + public MetafieldArguments namespace(String value) { + if (value != null) { + startArgument("namespace"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + } + + public interface MetafieldArgumentsDefinition { + void define(MetafieldArguments args); + } + + /** + * Returns a metafield found by namespace and key. + */ + public CompanyLocationQuery metafield(String key, MetafieldQueryDefinition queryDef) { + return metafield(key, args -> {}, queryDef); + } + + /** + * Returns a metafield found by namespace and key. + */ + public CompanyLocationQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { + startField("metafield"); + + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + argsDef.define(new MetafieldArguments(_queryBuilder)); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new CartLineQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The merchandise that the buyer intends to purchase. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public ComponentizableCartLineQuery merchandise(MerchandiseQueryDefinition queryDef) { - startField("merchandise"); + public CompanyLocationQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { + startField("metafields"); + + _queryBuilder.append("(identifiers:"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (HasMetafieldsIdentifier item1 : identifiers) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new MerchandiseQuery(_queryBuilder)); + queryDef.define(new MetafieldQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The quantity of the merchandise that the customer intends to purchase. + * The name of the company location. */ - public ComponentizableCartLineQuery quantity() { - startField("quantity"); + public CompanyLocationQuery name() { + startField("name"); 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 date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * location was last modified. */ - public ComponentizableCartLineQuery sellingPlanAllocation(SellingPlanAllocationQueryDefinition queryDef) { - startField("sellingPlanAllocation"); - - _queryBuilder.append('{'); - queryDef.define(new SellingPlanAllocationQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CompanyLocationQuery updatedAt() { + startField("updatedAt"); return this; } } /** - * Represents information about the grouped merchandise in the cart. + * A company's location. */ - public static class ComponentizableCartLine extends AbstractResponse implements BaseCartLine, Node { - public ComponentizableCartLine() { + public static class CompanyLocation extends AbstractResponse implements HasMetafields, MetafieldParentResource, Node { + public CompanyLocation() { } - public ComponentizableCartLine(JsonObject fields) throws SchemaViolationError { + public CompanyLocation(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "attribute": { - Attribute optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Attribute(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "createdAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); break; } - case "attributes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new Attribute(jsonAsObject(element1, key))); + case "externalId": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); } - responseData.put(key, list1); + responseData.put(key, optional1); break; } - case "cost": { - responseData.put(key, new CartLineCost(jsonAsObject(field.getValue(), key))); + case "id": { + responseData.put(key, new ID(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 "locale": { + 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 "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + responseData.put(key, optional1); break; } - case "lineComponents": { - List list1 = new ArrayList<>(); + case "metafields": { + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new CartLine(jsonAsObject(element1, key))); + Metafield optional2 = null; + if (!element1.isJsonNull()) { + optional2 = new Metafield(jsonAsObject(element1, key)); + } + + list1.add(optional2); } responseData.put(key, list1); @@ -21901,25 +22523,14 @@ public ComponentizableCartLine(JsonObject fields) throws SchemaViolationError { break; } - case "merchandise": { - responseData.put(key, UnknownMerchandise.create(jsonAsObject(field.getValue(), key))); - - break; - } - - case "quantity": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "sellingPlanAllocation": { - SellingPlanAllocation optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new SellingPlanAllocation(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); break; } @@ -21935,290 +22546,274 @@ public ComponentizableCartLine(JsonObject fields) throws SchemaViolationError { } } - public ComponentizableCartLine(ID id) { + public CompanyLocation(ID id) { this(); optimisticData.put("id", id); } public String getGraphQlTypeName() { - return "ComponentizableCartLine"; - } - - /** - * An attribute associated with the cart line. - */ - - public Attribute getAttribute() { - return (Attribute) get("attribute"); - } - - public ComponentizableCartLine setAttribute(Attribute arg) { - optimisticData.put(getKey("attribute"), arg); - return this; + return "CompanyLocation"; } /** - * The attributes associated with the cart line. Attributes are represented as key-value pairs. + * The date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * location was created in Shopify. */ - public List getAttributes() { - return (List) get("attributes"); + public DateTime getCreatedAt() { + return (DateTime) get("createdAt"); } - public ComponentizableCartLine setAttributes(List arg) { - optimisticData.put(getKey("attributes"), arg); + public CompanyLocation setCreatedAt(DateTime arg) { + optimisticData.put(getKey("createdAt"), 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. + * A unique externally-supplied ID for the company. */ - public CartLineCost getCost() { - return (CartLineCost) get("cost"); + public String getExternalId() { + return (String) get("externalId"); } - public ComponentizableCartLine setCost(CartLineCost arg) { - optimisticData.put(getKey("cost"), arg); + public CompanyLocation setExternalId(String arg) { + optimisticData.put(getKey("externalId"), arg); return this; } /** - * The discounts that have been applied to the cart line. + * A globally-unique ID. */ - public List getDiscountAllocations() { - return (List) get("discountAllocations"); - } - - public ComponentizableCartLine setDiscountAllocations(List arg) { - optimisticData.put(getKey("discountAllocations"), arg); - return this; + public ID getId() { + return (ID) get("id"); } /** - * 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 preferred locale of the company location. */ - public CartLineEstimatedCost getEstimatedCost() { - return (CartLineEstimatedCost) get("estimatedCost"); + public String getLocale() { + return (String) get("locale"); } - public ComponentizableCartLine setEstimatedCost(CartLineEstimatedCost arg) { - optimisticData.put(getKey("estimatedCost"), arg); + public CompanyLocation setLocale(String arg) { + optimisticData.put(getKey("locale"), arg); return this; } /** - * A globally-unique ID. - */ - - public ID getId() { - return (ID) get("id"); - } - - /** - * The components of the line item. + * Returns a metafield found by namespace and key. */ - public List getLineComponents() { - return (List) get("lineComponents"); + public Metafield getMetafield() { + return (Metafield) get("metafield"); } - public ComponentizableCartLine setLineComponents(List arg) { - optimisticData.put(getKey("lineComponents"), arg); + public CompanyLocation setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); return this; } /** - * The merchandise that the buyer intends to purchase. + * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public Merchandise getMerchandise() { - return (Merchandise) get("merchandise"); + public List getMetafields() { + return (List) get("metafields"); } - public ComponentizableCartLine setMerchandise(Merchandise arg) { - optimisticData.put(getKey("merchandise"), arg); + public CompanyLocation setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); return this; } /** - * The quantity of the merchandise that the customer intends to purchase. + * The name of the company location. */ - public Integer getQuantity() { - return (Integer) get("quantity"); + public String getName() { + return (String) get("name"); } - public ComponentizableCartLine setQuantity(Integer arg) { - optimisticData.put(getKey("quantity"), arg); + public CompanyLocation setName(String arg) { + optimisticData.put(getKey("name"), arg); 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 date and time ([ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601)) at which the company + * location was last modified. */ - public SellingPlanAllocation getSellingPlanAllocation() { - return (SellingPlanAllocation) get("sellingPlanAllocation"); + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); } - public ComponentizableCartLine setSellingPlanAllocation(SellingPlanAllocation arg) { - optimisticData.put(getKey("sellingPlanAllocation"), arg); + public CompanyLocation 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 "cost": return true; - - case "discountAllocations": return false; + case "createdAt": return false; - case "estimatedCost": return true; + case "externalId": return false; case "id": return false; - case "lineComponents": return true; + case "locale": return false; - case "merchandise": return false; + case "metafield": return true; - case "quantity": return false; + case "metafields": return true; - case "sellingPlanAllocation": return true; + case "name": return false; + + case "updatedAt": return false; default: return false; } } } - public interface CountryQueryDefinition { - void define(CountryQuery _queryBuilder); + public interface CompletePaymentChallengeQueryDefinition { + void define(CompletePaymentChallengeQuery _queryBuilder); } /** - * A country. + * The action for the 3DS payment redirect. */ - public static class CountryQuery extends Query { - CountryQuery(StringBuilder _queryBuilder) { + public static class CompletePaymentChallengeQuery extends Query { + CompletePaymentChallengeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The languages available for the country. + * The URL for the 3DS payment redirect. */ - public CountryQuery availableLanguages(LanguageQueryDefinition queryDef) { - startField("availableLanguages"); - - _queryBuilder.append('{'); - queryDef.define(new LanguageQuery(_queryBuilder)); - _queryBuilder.append('}'); + public CompletePaymentChallengeQuery redirectUrl() { + startField("redirectUrl"); return this; } + } - /** - * The currency of the country. - */ - public CountryQuery currency(CurrencyQueryDefinition queryDef) { - startField("currency"); + /** + * The action for the 3DS payment redirect. + */ + public static class CompletePaymentChallenge extends AbstractResponse implements CartCompletionAction { + public CompletePaymentChallenge() { + } - _queryBuilder.append('{'); - queryDef.define(new CurrencyQuery(_queryBuilder)); - _queryBuilder.append('}'); + 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); + } - return this; + 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 "CompletePaymentChallenge"; } /** - * The ISO code of the country. + * The URL for the 3DS payment redirect. */ - public CountryQuery isoCode() { - startField("isoCode"); + public String getRedirectUrl() { + return (String) get("redirectUrl"); + } + + public CompletePaymentChallenge setRedirectUrl(String arg) { + optimisticData.put(getKey("redirectUrl"), arg); return this; } - /** - * The market that includes this country. - */ - public CountryQuery market(MarketQueryDefinition queryDef) { - startField("market"); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "redirectUrl": return false; - _queryBuilder.append('{'); - queryDef.define(new MarketQuery(_queryBuilder)); - _queryBuilder.append('}'); + default: return false; + } + } + } - return this; + public interface CompletionErrorQueryDefinition { + void define(CompletionErrorQuery _queryBuilder); + } + + /** + * An error that occurred during a cart completion attempt. + */ + public static class CompletionErrorQuery extends Query { + CompletionErrorQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The name of the country. + * The error code. */ - public CountryQuery name() { - startField("name"); + public CompletionErrorQuery code() { + startField("code"); return this; } /** - * The unit system used in the country. + * The error message. */ - public CountryQuery unitSystem() { - startField("unitSystem"); + public CompletionErrorQuery message() { + startField("message"); return this; } } /** - * A country. + * An error that occurred during a cart completion attempt. */ - public static class Country extends AbstractResponse { - public Country() { + public static class CompletionError extends AbstractResponse { + public CompletionError() { } - public Country(JsonObject fields) throws SchemaViolationError { + public CompletionError(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "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))); + case "code": { + responseData.put(key, CompletionErrorCode.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "market": { - Market optional1 = null; + case "message": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new Market(jsonAsObject(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -22226,18 +22821,6 @@ public Country(JsonObject fields) throws SchemaViolationError { 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; @@ -22250,54 +22833,812 @@ public Country(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "Country"; + return "CompletionError"; } /** - * The languages available for the country. + * The error code. */ - public List getAvailableLanguages() { - return (List) get("availableLanguages"); + public CompletionErrorCode getCode() { + return (CompletionErrorCode) get("code"); } - public Country setAvailableLanguages(List arg) { - optimisticData.put(getKey("availableLanguages"), arg); + public CompletionError setCode(CompletionErrorCode arg) { + optimisticData.put(getKey("code"), arg); return this; } /** - * The currency of the country. + * The error message. */ - public Currency getCurrency() { - return (Currency) get("currency"); + public String getMessage() { + return (String) get("message"); } - public Country setCurrency(Currency arg) { - optimisticData.put(getKey("currency"), arg); + public CompletionError setMessage(String arg) { + optimisticData.put(getKey("message"), arg); return this; } - /** - * The ISO code of the country. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "code": return false; - public CountryCode getIsoCode() { - return (CountryCode) get("isoCode"); - } + case "message": return false; - public Country setIsoCode(CountryCode arg) { - optimisticData.put(getKey("isoCode"), arg); - return this; + default: return false; + } } + } - /** - * The market that includes this country. - */ + /** + * The code of the error that occurred during a cart completion attempt. + */ + public enum CompletionErrorCode { + ERROR, - public Market getMarket() { - return (Market) get("market"); + INVENTORY_RESERVATION_ERROR, + + PAYMENT_AMOUNT_TOO_SMALL, + + PAYMENT_CALL_ISSUER, + + PAYMENT_CARD_DECLINED, + + PAYMENT_ERROR, + + PAYMENT_GATEWAY_NOT_ENABLED_ERROR, + + PAYMENT_INSUFFICIENT_FUNDS, + + PAYMENT_INVALID_BILLING_ADDRESS, + + PAYMENT_INVALID_CREDIT_CARD, + + PAYMENT_INVALID_CURRENCY, + + PAYMENT_INVALID_PAYMENT_METHOD, + + PAYMENT_TRANSIENT_ERROR, + + UNKNOWN_VALUE; + + public static CompletionErrorCode fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "ERROR": { + return ERROR; + } + + case "INVENTORY_RESERVATION_ERROR": { + return INVENTORY_RESERVATION_ERROR; + } + + case "PAYMENT_AMOUNT_TOO_SMALL": { + return PAYMENT_AMOUNT_TOO_SMALL; + } + + case "PAYMENT_CALL_ISSUER": { + return PAYMENT_CALL_ISSUER; + } + + case "PAYMENT_CARD_DECLINED": { + return PAYMENT_CARD_DECLINED; + } + + case "PAYMENT_ERROR": { + return PAYMENT_ERROR; + } + + case "PAYMENT_GATEWAY_NOT_ENABLED_ERROR": { + return PAYMENT_GATEWAY_NOT_ENABLED_ERROR; + } + + case "PAYMENT_INSUFFICIENT_FUNDS": { + return PAYMENT_INSUFFICIENT_FUNDS; + } + + case "PAYMENT_INVALID_BILLING_ADDRESS": { + return PAYMENT_INVALID_BILLING_ADDRESS; + } + + case "PAYMENT_INVALID_CREDIT_CARD": { + return PAYMENT_INVALID_CREDIT_CARD; + } + + case "PAYMENT_INVALID_CURRENCY": { + return PAYMENT_INVALID_CURRENCY; + } + + case "PAYMENT_INVALID_PAYMENT_METHOD": { + return PAYMENT_INVALID_PAYMENT_METHOD; + } + + case "PAYMENT_TRANSIENT_ERROR": { + return PAYMENT_TRANSIENT_ERROR; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case ERROR: { + return "ERROR"; + } + + case INVENTORY_RESERVATION_ERROR: { + return "INVENTORY_RESERVATION_ERROR"; + } + + case PAYMENT_AMOUNT_TOO_SMALL: { + return "PAYMENT_AMOUNT_TOO_SMALL"; + } + + case PAYMENT_CALL_ISSUER: { + return "PAYMENT_CALL_ISSUER"; + } + + case PAYMENT_CARD_DECLINED: { + return "PAYMENT_CARD_DECLINED"; + } + + case PAYMENT_ERROR: { + return "PAYMENT_ERROR"; + } + + case PAYMENT_GATEWAY_NOT_ENABLED_ERROR: { + return "PAYMENT_GATEWAY_NOT_ENABLED_ERROR"; + } + + case PAYMENT_INSUFFICIENT_FUNDS: { + return "PAYMENT_INSUFFICIENT_FUNDS"; + } + + case PAYMENT_INVALID_BILLING_ADDRESS: { + return "PAYMENT_INVALID_BILLING_ADDRESS"; + } + + case PAYMENT_INVALID_CREDIT_CARD: { + return "PAYMENT_INVALID_CREDIT_CARD"; + } + + case PAYMENT_INVALID_CURRENCY: { + return "PAYMENT_INVALID_CURRENCY"; + } + + case PAYMENT_INVALID_PAYMENT_METHOD: { + return "PAYMENT_INVALID_PAYMENT_METHOD"; + } + + case PAYMENT_TRANSIENT_ERROR: { + return "PAYMENT_TRANSIENT_ERROR"; + } + + default: { + return ""; + } + } + } + } + + public interface ComponentizableCartLineQueryDefinition { + void define(ComponentizableCartLineQuery _queryBuilder); + } + + /** + * Represents information about the grouped merchandise in the cart. + */ + public static class ComponentizableCartLineQuery extends Query { + ComponentizableCartLineQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); + } + + /** + * An attribute associated with the cart line. + */ + public ComponentizableCartLineQuery 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 ComponentizableCartLineQuery 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 ComponentizableCartLineQuery 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 ComponentizableCartLineQuery 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 ComponentizableCartLineQuery estimatedCost(CartLineEstimatedCostQueryDefinition queryDef) { + startField("estimatedCost"); + + _queryBuilder.append('{'); + queryDef.define(new CartLineEstimatedCostQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The components of the line item. + */ + public ComponentizableCartLineQuery lineComponents(CartLineQueryDefinition queryDef) { + startField("lineComponents"); + + _queryBuilder.append('{'); + queryDef.define(new CartLineQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The merchandise that the buyer intends to purchase. + */ + public ComponentizableCartLineQuery merchandise(MerchandiseQueryDefinition queryDef) { + startField("merchandise"); + + _queryBuilder.append('{'); + queryDef.define(new MerchandiseQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The quantity of the merchandise that the customer intends to purchase. + */ + public ComponentizableCartLineQuery quantity() { + startField("quantity"); + + return this; + } + + /** + * The selling plan associated with the cart line and the effect that each selling plan has on variants + * when they're purchased. + */ + public ComponentizableCartLineQuery sellingPlanAllocation(SellingPlanAllocationQueryDefinition queryDef) { + startField("sellingPlanAllocation"); + + _queryBuilder.append('{'); + queryDef.define(new SellingPlanAllocationQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * Represents information about the grouped merchandise in the cart. + */ + public static class ComponentizableCartLine extends AbstractResponse implements BaseCartLine, Node { + public ComponentizableCartLine() { + } + + public ComponentizableCartLine(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "attribute": { + Attribute optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Attribute(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "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))); + + break; + } + + case "discountAllocations": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(UnknownCartDiscountAllocation.create(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "estimatedCost": { + responseData.put(key, new CartLineEstimatedCost(jsonAsObject(field.getValue(), key))); + + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "lineComponents": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartLine(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + 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; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public ComponentizableCartLine(ID id) { + this(); + optimisticData.put("id", id); + } + + public String getGraphQlTypeName() { + return "ComponentizableCartLine"; + } + + /** + * An attribute associated with the cart line. + */ + + public Attribute getAttribute() { + return (Attribute) get("attribute"); + } + + public ComponentizableCartLine setAttribute(Attribute arg) { + optimisticData.put(getKey("attribute"), arg); + return this; + } + + /** + * The attributes associated with the cart line. Attributes are represented as key-value pairs. + */ + + public List getAttributes() { + return (List) get("attributes"); + } + + public ComponentizableCartLine setAttributes(List arg) { + optimisticData.put(getKey("attributes"), arg); + return this; + } + + /** + * The cost of the merchandise that the buyer will pay for at checkout. The costs are subject to change + * and changes will be reflected at checkout. + */ + + public CartLineCost getCost() { + return (CartLineCost) get("cost"); + } + + public ComponentizableCartLine setCost(CartLineCost arg) { + optimisticData.put(getKey("cost"), arg); + return this; + } + + /** + * The discounts that have been applied to the cart line. + */ + + public List getDiscountAllocations() { + return (List) get("discountAllocations"); + } + + public ComponentizableCartLine setDiscountAllocations(List arg) { + optimisticData.put(getKey("discountAllocations"), 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. + */ + + public CartLineEstimatedCost getEstimatedCost() { + return (CartLineEstimatedCost) get("estimatedCost"); + } + + public ComponentizableCartLine setEstimatedCost(CartLineEstimatedCost arg) { + optimisticData.put(getKey("estimatedCost"), arg); + return this; + } + + /** + * A globally-unique ID. + */ + + public ID getId() { + return (ID) get("id"); + } + + /** + * The components of the line item. + */ + + public List getLineComponents() { + return (List) get("lineComponents"); + } + + public ComponentizableCartLine setLineComponents(List arg) { + optimisticData.put(getKey("lineComponents"), arg); + return this; + } + + /** + * The merchandise that the buyer intends to purchase. + */ + + public Merchandise getMerchandise() { + return (Merchandise) get("merchandise"); + } + + public ComponentizableCartLine setMerchandise(Merchandise arg) { + optimisticData.put(getKey("merchandise"), arg); + return this; + } + + /** + * The quantity of the merchandise that the customer intends to purchase. + */ + + public Integer getQuantity() { + return (Integer) get("quantity"); + } + + public ComponentizableCartLine setQuantity(Integer arg) { + optimisticData.put(getKey("quantity"), arg); + return this; + } + + /** + * The selling plan associated with the cart line and the effect that each selling plan has on variants + * when they're purchased. + */ + + public SellingPlanAllocation getSellingPlanAllocation() { + return (SellingPlanAllocation) get("sellingPlanAllocation"); + } + + public ComponentizableCartLine setSellingPlanAllocation(SellingPlanAllocation arg) { + optimisticData.put(getKey("sellingPlanAllocation"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "attribute": return true; + + case "attributes": return true; + + case "cost": return true; + + case "discountAllocations": return false; + + case "estimatedCost": return true; + + case "id": return false; + + case "lineComponents": return true; + + case "merchandise": return false; + + case "quantity": return false; + + case "sellingPlanAllocation": return true; + + default: return false; + } + } + } + + public interface CountryQueryDefinition { + void define(CountryQuery _queryBuilder); + } + + /** + * A country. + */ + public static class CountryQuery extends Query { + CountryQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The languages available for the country. + */ + public CountryQuery availableLanguages(LanguageQueryDefinition queryDef) { + startField("availableLanguages"); + + _queryBuilder.append('{'); + queryDef.define(new LanguageQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The currency of the country. + */ + public CountryQuery currency(CurrencyQueryDefinition queryDef) { + startField("currency"); + + _queryBuilder.append('{'); + queryDef.define(new CurrencyQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The ISO code of the country. + */ + public CountryQuery isoCode() { + startField("isoCode"); + + return this; + } + + /** + * The market that includes this country. + */ + public CountryQuery market(MarketQueryDefinition queryDef) { + startField("market"); + + _queryBuilder.append('{'); + queryDef.define(new MarketQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The name of the country. + */ + public CountryQuery name() { + startField("name"); + + return this; + } + + /** + * The unit system used in the country. + */ + public CountryQuery unitSystem() { + startField("unitSystem"); + + 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) { @@ -28516,7 +29857,10 @@ public CustomerQuery id() { /** * The customer's most recently updated, incomplete checkout. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public CustomerQuery lastIncompleteCheckout(CheckoutQueryDefinition queryDef) { startField("lastIncompleteCheckout"); @@ -29051,6 +30395,8 @@ public Customer setId(ID arg) { /** * The customer's most recently updated, incomplete checkout. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ public Checkout getLastIncompleteCheckout() { @@ -32849,6 +34195,8 @@ public boolean unwrapsToObject(String key) { public static class DeliveryAddressInput implements Serializable { private Input deliveryAddress = Input.undefined(); + private Input deliveryAddressValidationStrategy = Input.undefined(); + private Input customerAddressId = Input.undefined(); public MailingAddressInput getDeliveryAddress() { @@ -32872,6 +34220,27 @@ public DeliveryAddressInput setDeliveryAddressInput(Input d return this; } + public DeliveryAddressValidationStrategy getDeliveryAddressValidationStrategy() { + return deliveryAddressValidationStrategy.getValue(); + } + + public Input getDeliveryAddressValidationStrategyInput() { + return deliveryAddressValidationStrategy; + } + + public DeliveryAddressInput setDeliveryAddressValidationStrategy(DeliveryAddressValidationStrategy deliveryAddressValidationStrategy) { + this.deliveryAddressValidationStrategy = Input.optional(deliveryAddressValidationStrategy); + return this; + } + + public DeliveryAddressInput setDeliveryAddressValidationStrategyInput(Input deliveryAddressValidationStrategy) { + if (deliveryAddressValidationStrategy == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.deliveryAddressValidationStrategy = deliveryAddressValidationStrategy; + return this; + } + public ID getCustomerAddressId() { return customerAddressId.getValue(); } @@ -32908,6 +34277,17 @@ public void appendTo(StringBuilder _queryBuilder) { } } + if (this.deliveryAddressValidationStrategy.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("deliveryAddressValidationStrategy:"); + if (deliveryAddressValidationStrategy.getValue() != null) { + _queryBuilder.append(deliveryAddressValidationStrategy.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + if (this.customerAddressId.isDefined()) { _queryBuilder.append(separator); separator = ","; @@ -32923,6 +34303,60 @@ public void appendTo(StringBuilder _queryBuilder) { } } + /** + * Defines the types of available validation strategies for delivery addresses. + */ + public enum DeliveryAddressValidationStrategy { + /** + * Only the country code is validated. + */ + COUNTRY_CODE_ONLY, + + /** + * Strict validation is performed, i.e. all fields in the address are validated + * according to Shopify's checkout rules. If the address fails validation, the cart will not be + * updated. + */ + STRICT, + + UNKNOWN_VALUE; + + public static DeliveryAddressValidationStrategy fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "COUNTRY_CODE_ONLY": { + return COUNTRY_CODE_ONLY; + } + + case "STRICT": { + return STRICT; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case COUNTRY_CODE_ONLY: { + return "COUNTRY_CODE_ONLY"; + } + + case STRICT: { + return "STRICT"; + } + + default: { + return ""; + } + } + } + } + /** * List of different delivery method types. */ @@ -34853,6 +36287,16 @@ public FilterQuery label() { return this; } + /** + * Describes how to present the filter values. + * Returns a value only for filters of type `LIST`. Returns null for other types. + */ + public FilterQuery presentation() { + startField("presentation"); + + return this; + } + /** * An enumeration that denotes the type of data this filter represents. */ @@ -34900,6 +36344,17 @@ public Filter(JsonObject fields) throws SchemaViolationError { break; } + case "presentation": { + FilterPresentation optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = FilterPresentation.fromGraphQl(jsonAsString(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + case "type": { responseData.put(key, FilterType.fromGraphQl(jsonAsString(field.getValue(), key))); @@ -34958,6 +36413,20 @@ public Filter setLabel(String arg) { return this; } + /** + * Describes how to present the filter values. + * Returns a value only for filters of type `LIST`. Returns null for other types. + */ + + public FilterPresentation getPresentation() { + return (FilterPresentation) get("presentation"); + } + + public Filter setPresentation(FilterPresentation arg) { + optimisticData.put(getKey("presentation"), arg); + return this; + } + /** * An enumeration that denotes the type of data this filter represents. */ @@ -34990,6 +36459,8 @@ public boolean unwrapsToObject(String key) { case "label": return false; + case "presentation": return false; + case "type": return false; case "values": return true; @@ -34999,6 +36470,71 @@ public boolean unwrapsToObject(String key) { } } + /** + * Defines how to present the filter values, specifies the presentation of the filter. + */ + public enum FilterPresentation { + /** + * Image presentation, filter values display an image. + */ + IMAGE, + + /** + * Swatch presentation, filter values display color or image patterns. + */ + SWATCH, + + /** + * Text presentation, no additional visual display for filter values. + */ + TEXT, + + UNKNOWN_VALUE; + + public static FilterPresentation fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "IMAGE": { + return IMAGE; + } + + case "SWATCH": { + return SWATCH; + } + + case "TEXT": { + return TEXT; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case IMAGE: { + return "IMAGE"; + } + + case SWATCH: { + return "SWATCH"; + } + + case TEXT: { + return "TEXT"; + } + + default: { + return ""; + } + } + } + } + /** * The type of data that the filter group represents. * For more information, refer to [Filter products in a collection with the Storefront API] @@ -35096,6 +36632,19 @@ public FilterValueQuery id() { return this; } + /** + * The visual representation when the filter's presentation is `IMAGE`. + */ + public FilterValueQuery image(MediaImageQueryDefinition queryDef) { + startField("image"); + + _queryBuilder.append('{'); + queryDef.define(new MediaImageQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + /** * An input object that can be used to filter by this value on the parent field. * The value is provided as a helper for building dynamic filtering UI. For @@ -35116,6 +36665,19 @@ public FilterValueQuery label() { return this; } + + /** + * The visual representation when the filter's presentation is `SWATCH`. + */ + public FilterValueQuery swatch(SwatchQueryDefinition queryDef) { + startField("swatch"); + + _queryBuilder.append('{'); + queryDef.define(new SwatchQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } } /** @@ -35142,6 +36704,17 @@ public FilterValue(JsonObject fields) throws SchemaViolationError { break; } + case "image": { + MediaImage optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MediaImage(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + case "input": { responseData.put(key, jsonAsString(field.getValue(), key)); @@ -35154,6 +36727,17 @@ public FilterValue(JsonObject fields) throws SchemaViolationError { break; } + case "swatch": { + Swatch optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Swatch(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -35195,6 +36779,19 @@ public FilterValue setId(String arg) { return this; } + /** + * The visual representation when the filter's presentation is `IMAGE`. + */ + + public MediaImage getImage() { + return (MediaImage) get("image"); + } + + public FilterValue setImage(MediaImage arg) { + optimisticData.put(getKey("image"), arg); + return this; + } + /** * An input object that can be used to filter by this value on the parent field. * The value is provided as a helper for building dynamic filtering UI. For @@ -35224,16 +36821,33 @@ public FilterValue setLabel(String arg) { return this; } + /** + * The visual representation when the filter's presentation is `SWATCH`. + */ + + public Swatch getSwatch() { + return (Swatch) get("swatch"); + } + + public FilterValue setSwatch(Swatch arg) { + optimisticData.put(getKey("swatch"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "count": return false; case "id": return false; + case "image": return true; + case "input": return false; case "label": return false; + case "swatch": return true; + default: return false; } } @@ -36420,6 +38034,20 @@ public HasMetafieldsQuery onCollection(CollectionQueryDefinition queryDef) { return this; } + public HasMetafieldsQuery onCompany(CompanyQueryDefinition queryDef) { + startInlineFragment("Company"); + queryDef.define(new CompanyQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public HasMetafieldsQuery onCompanyLocation(CompanyLocationQueryDefinition queryDef) { + startInlineFragment("CompanyLocation"); + queryDef.define(new CompanyLocationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + public HasMetafieldsQuery onCustomer(CustomerQueryDefinition queryDef) { startInlineFragment("Customer"); queryDef.define(new CustomerQuery(_queryBuilder)); @@ -36554,6 +38182,14 @@ public static HasMetafields create(JsonObject fields) throws SchemaViolationErro return new Collection(fields); } + case "Company": { + return new Company(fields); + } + + case "CompanyLocation": { + return new CompanyLocation(fields); + } + case "Customer": { return new Customer(fields); } @@ -45660,6 +47296,20 @@ public MetafieldParentResourceQuery onCollection(CollectionQueryDefinition query return this; } + public MetafieldParentResourceQuery onCompany(CompanyQueryDefinition queryDef) { + startInlineFragment("Company"); + queryDef.define(new CompanyQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public MetafieldParentResourceQuery onCompanyLocation(CompanyLocationQueryDefinition queryDef) { + startInlineFragment("CompanyLocation"); + queryDef.define(new CompanyLocationQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + public MetafieldParentResourceQuery onCustomer(CustomerQueryDefinition queryDef) { startInlineFragment("Customer"); queryDef.define(new CustomerQuery(_queryBuilder)); @@ -45763,6 +47413,14 @@ public static MetafieldParentResource create(JsonObject fields) throws SchemaVio return new Collection(fields); } + case "Company": { + return new Company(fields); + } + + case "CompanyLocation": { + return new CompanyLocation(fields); + } + case "Customer": { return new Customer(fields); } @@ -45854,6 +47512,13 @@ public MetafieldReferenceQuery onMetaobject(MetaobjectQueryDefinition queryDef) return this; } + public MetafieldReferenceQuery onModel3d(Model3dQueryDefinition queryDef) { + startInlineFragment("Model3d"); + queryDef.define(new Model3dQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + public MetafieldReferenceQuery onPage(PageQueryDefinition queryDef) { startInlineFragment("Page"); queryDef.define(new PageQuery(_queryBuilder)); @@ -45929,6 +47594,10 @@ public static MetafieldReference create(JsonObject fields) throws SchemaViolatio return new Metaobject(fields); } + case "Model3d": { + return new Model3d(fields); + } + case "Page": { return new Page(fields); } @@ -47689,7 +49358,7 @@ public Model3dQuery sources(Model3dSourceQueryDefinition queryDef) { /** * Represents a Shopify hosted 3D model. */ - public static class Model3d extends AbstractResponse implements Media, Node { + public static class Model3d extends AbstractResponse implements Media, MetafieldReference, Node { public Model3d() { } @@ -48495,44 +50164,17 @@ public MutationQuery cartMetafieldsSet(List metafields, 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; - } - } - - public interface CartNoteUpdateArgumentsDefinition { - void define(CartNoteUpdateArguments args); - } - - /** - * Updates the note on the cart. - */ - public MutationQuery cartNoteUpdate(ID cartId, CartNoteUpdatePayloadQueryDefinition queryDef) { - return cartNoteUpdate(cartId, args -> {}, queryDef); - } - /** * Updates the note on the cart. */ - public MutationQuery cartNoteUpdate(ID cartId, CartNoteUpdateArgumentsDefinition argsDef, CartNoteUpdatePayloadQueryDefinition queryDef) { + public MutationQuery cartNoteUpdate(ID cartId, String note, CartNoteUpdatePayloadQueryDefinition queryDef) { startField("cartNoteUpdate"); _queryBuilder.append("(cartId:"); Query.appendQuotedString(_queryBuilder, cartId.toString()); - argsDef.define(new CartNoteUpdateArguments(_queryBuilder)); + _queryBuilder.append(",note:"); + Query.appendQuotedString(_queryBuilder, note.toString()); _queryBuilder.append(')'); @@ -48617,7 +50259,10 @@ public MutationQuery cartSubmitForCompletion(ID cartId, String attemptToken, Car /** * Updates the attributes of a checkout if `allowPartialAddresses` is `true`. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public MutationQuery checkoutAttributesUpdateV2(ID checkoutId, CheckoutAttributesUpdateV2Input input, CheckoutAttributesUpdateV2PayloadQueryDefinition queryDef) { startField("checkoutAttributesUpdateV2"); @@ -48639,7 +50284,10 @@ public MutationQuery checkoutAttributesUpdateV2(ID checkoutId, CheckoutAttribute /** * Completes a checkout without providing payment information. You can use this mutation for free items * or items whose purchase price is covered by a gift card. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public MutationQuery checkoutCompleteFree(ID checkoutId, CheckoutCompleteFreePayloadQueryDefinition queryDef) { startField("checkoutCompleteFree"); @@ -48659,7 +50307,10 @@ public MutationQuery checkoutCompleteFree(ID checkoutId, CheckoutCompleteFreePay * Completes a checkout using a credit card token from Shopify's card vault. Before you can complete * checkouts using CheckoutCompleteWithCreditCardV2, you need to [_request payment * processing_](https://shopify.dev/apps/channels/getting-started#request-payment-processing). + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public MutationQuery checkoutCompleteWithCreditCardV2(ID checkoutId, CreditCardPaymentInputV2 payment, CheckoutCompleteWithCreditCardV2PayloadQueryDefinition queryDef) { startField("checkoutCompleteWithCreditCardV2"); @@ -48680,7 +50331,10 @@ public MutationQuery checkoutCompleteWithCreditCardV2(ID checkoutId, CreditCardP /** * Completes a checkout with a tokenized payment. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public MutationQuery checkoutCompleteWithTokenizedPaymentV3(ID checkoutId, TokenizedPaymentInputV3 payment, CheckoutCompleteWithTokenizedPaymentV3PayloadQueryDefinition queryDef) { startField("checkoutCompleteWithTokenizedPaymentV3"); @@ -48722,6 +50376,8 @@ public interface CheckoutCreateArgumentsDefinition { /** * Creates a new checkout. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ public MutationQuery checkoutCreate(CheckoutCreateInput input, CheckoutCreatePayloadQueryDefinition queryDef) { return checkoutCreate(input, args -> {}, queryDef); @@ -48729,7 +50385,10 @@ public MutationQuery checkoutCreate(CheckoutCreateInput input, CheckoutCreatePay /** * Creates a new checkout. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public MutationQuery checkoutCreate(CheckoutCreateInput input, CheckoutCreateArgumentsDefinition argsDef, CheckoutCreatePayloadQueryDefinition queryDef) { startField("checkoutCreate"); @@ -48749,7 +50408,10 @@ public MutationQuery checkoutCreate(CheckoutCreateInput input, CheckoutCreateArg /** * Associates a customer to the checkout. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public MutationQuery checkoutCustomerAssociateV2(ID checkoutId, String customerAccessToken, CheckoutCustomerAssociateV2PayloadQueryDefinition queryDef) { startField("checkoutCustomerAssociateV2"); @@ -48770,7 +50432,10 @@ public MutationQuery checkoutCustomerAssociateV2(ID checkoutId, String customerA /** * Disassociates the current checkout customer from the checkout. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public MutationQuery checkoutCustomerDisassociateV2(ID checkoutId, CheckoutCustomerDisassociateV2PayloadQueryDefinition queryDef) { startField("checkoutCustomerDisassociateV2"); @@ -48788,7 +50453,10 @@ public MutationQuery checkoutCustomerDisassociateV2(ID checkoutId, CheckoutCusto /** * Applies a discount to an existing checkout using a discount code. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public MutationQuery checkoutDiscountCodeApplyV2(String discountCode, ID checkoutId, CheckoutDiscountCodeApplyV2PayloadQueryDefinition queryDef) { startField("checkoutDiscountCodeApplyV2"); @@ -48809,7 +50477,10 @@ public MutationQuery checkoutDiscountCodeApplyV2(String discountCode, ID checkou /** * Removes the applied discounts from an existing checkout. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public MutationQuery checkoutDiscountCodeRemove(ID checkoutId, CheckoutDiscountCodeRemovePayloadQueryDefinition queryDef) { startField("checkoutDiscountCodeRemove"); @@ -48827,7 +50498,10 @@ public MutationQuery checkoutDiscountCodeRemove(ID checkoutId, CheckoutDiscountC /** * Updates the email on an existing checkout. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public MutationQuery checkoutEmailUpdateV2(ID checkoutId, String email, CheckoutEmailUpdateV2PayloadQueryDefinition queryDef) { startField("checkoutEmailUpdateV2"); @@ -48848,7 +50522,10 @@ public MutationQuery checkoutEmailUpdateV2(ID checkoutId, String email, Checkout /** * Removes an applied gift card from the checkout. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public MutationQuery checkoutGiftCardRemoveV2(ID appliedGiftCardId, ID checkoutId, CheckoutGiftCardRemoveV2PayloadQueryDefinition queryDef) { startField("checkoutGiftCardRemoveV2"); @@ -48869,7 +50546,10 @@ public MutationQuery checkoutGiftCardRemoveV2(ID appliedGiftCardId, ID checkoutI /** * Appends gift cards to an existing checkout. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public MutationQuery checkoutGiftCardsAppend(List giftCardCodes, ID checkoutId, CheckoutGiftCardsAppendPayloadQueryDefinition queryDef) { startField("checkoutGiftCardsAppend"); @@ -48899,7 +50579,10 @@ public MutationQuery checkoutGiftCardsAppend(List giftCardCodes, ID chec /** * Adds a list of line items to a checkout. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public MutationQuery checkoutLineItemsAdd(List lineItems, ID checkoutId, CheckoutLineItemsAddPayloadQueryDefinition queryDef) { startField("checkoutLineItemsAdd"); @@ -48929,7 +50612,10 @@ public MutationQuery checkoutLineItemsAdd(List lineItems, /** * Removes line items from an existing checkout. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public MutationQuery checkoutLineItemsRemove(ID checkoutId, List lineItemIds, CheckoutLineItemsRemovePayloadQueryDefinition queryDef) { startField("checkoutLineItemsRemove"); @@ -48959,7 +50645,10 @@ public MutationQuery checkoutLineItemsRemove(ID checkoutId, List lineItemIds /** * Sets a list of line items to a checkout. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public MutationQuery checkoutLineItemsReplace(List lineItems, ID checkoutId, CheckoutLineItemsReplacePayloadQueryDefinition queryDef) { startField("checkoutLineItemsReplace"); @@ -48989,7 +50678,10 @@ public MutationQuery checkoutLineItemsReplace(List lineIt /** * Updates line items on a checkout. + * + * @deprecated The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information. */ + @Deprecated public MutationQuery checkoutLineItemsUpdate(ID checkoutId, List lineItems, CheckoutLineItemsUpdatePayloadQueryDefinition queryDef) { startField("checkoutLineItemsUpdate"); @@ -49019,7 +50711,10 @@ public MutationQuery checkoutLineItemsUpdate(ID checkoutId, List { + ProductOptionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); + } + + /** + * The product option’s name. + */ + public ProductOptionQuery name() { + startField("name"); + + return this; + } + + /** + * The corresponding value to the product option name. + */ + public ProductOptionQuery values() { + startField("values"); + + return this; + } + } + + /** + * Product property names like "Size", "Color", and "Material" that the customers can select. + * Variants are selected based on permutations of these options. + * 255 characters limit each. + */ + public static class ProductOption extends AbstractResponse implements Node { + public ProductOption() { + } + + public 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))); + + 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; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public ProductOption(ID id) { + this(); + optimisticData.put("id", id); + } + + public String getGraphQlTypeName() { + return "ProductOption"; + } + + /** + * A globally-unique ID. + */ + + public ID getId() { + return (ID) get("id"); + } + + /** + * 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 "id": return false; + + case "name": return false; + + case "values": return false; + + default: return false; + } + } + } + + public interface ProductPriceRangeQueryDefinition { + void define(ProductPriceRangeQuery _queryBuilder); + } + + /** + * The price range of the product. + */ + public static class ProductPriceRangeQuery extends Query { + ProductPriceRangeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The highest variant's price. + */ + public ProductPriceRangeQuery maxVariantPrice(MoneyV2QueryDefinition queryDef) { + startField("maxVariantPrice"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The lowest variant's price. + */ + public ProductPriceRangeQuery minVariantPrice(MoneyV2QueryDefinition queryDef) { + startField("minVariantPrice"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * The price range of the product. + */ + public static class ProductPriceRange extends AbstractResponse { + public ProductPriceRange() { + } + + 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; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "ProductPriceRange"; + } + + /** + * The highest variant's price. + */ + + public MoneyV2 getMaxVariantPrice() { + return (MoneyV2) get("maxVariantPrice"); + } + + 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; + } + } + } + + /** + * The recommendation intent that is used to generate product recommendations. + * You can use intent to generate product recommendations according to different strategies. + */ + public enum ProductRecommendationIntent { + /** + * Offer customers products that are complementary to a product for which recommendations are to be + * fetched. An example is add-on products that display in a Pair it with section. + */ + COMPLEMENTARY, + + /** + * Offer customers a mix of products that are similar or complementary to a product for which + * recommendations are to be fetched. An example is substitutable products that display in a You may + * also like section. + */ + RELATED, + + UNKNOWN_VALUE; + + public static ProductRecommendationIntent fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "COMPLEMENTARY": { + return COMPLEMENTARY; + } + + case "RELATED": { + return RELATED; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case COMPLEMENTARY: { + return "COMPLEMENTARY"; + } + + case RELATED: { + return "RELATED"; + } + + default: { + return ""; + } + } + } + } + + /** + * The set of valid sort keys for the Product query. + */ + public enum ProductSortKeys { + /** + * Sort by the `best_selling` value. + */ + BEST_SELLING, + + /** + * Sort by the `created_at` value. + */ + CREATED_AT, + + /** + * Sort by the `id` value. + */ + ID, + + /** + * Sort by the `price` value. + */ + PRICE, + + /** + * Sort by the `product_type` value. + */ + PRODUCT_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. */ - CREATED_AT, + RELEVANCE, /** - * Sort by the `id` value. + * Sort by the `title` value. */ - ID, + TITLE, /** - * Sort by the `position` value. + * Sort by the `updated_at` value. */ - POSITION, + UPDATED_AT, /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. + * Sort by the `vendor` value. */ - RELEVANCE, + VENDOR, UNKNOWN_VALUE; - public static ProductImageSortKeys fromGraphQl(String value) { + public static ProductSortKeys fromGraphQl(String value) { if (value == null) { return null; } switch (value) { + case "BEST_SELLING": { + return BEST_SELLING; + } + case "CREATED_AT": { return CREATED_AT; } @@ -59251,14 +61502,30 @@ public static ProductImageSortKeys fromGraphQl(String value) { return ID; } - case "POSITION": { - return POSITION; + case "PRICE": { + return PRICE; + } + + case "PRODUCT_TYPE": { + return PRODUCT_TYPE; } case "RELEVANCE": { return RELEVANCE; } + case "TITLE": { + return TITLE; + } + + case "UPDATED_AT": { + return UPDATED_AT; + } + + case "VENDOR": { + return VENDOR; + } + default: { return UNKNOWN_VALUE; } @@ -59266,6 +61533,10 @@ public static ProductImageSortKeys fromGraphQl(String value) { } public String toString() { switch (this) { + case BEST_SELLING: { + return "BEST_SELLING"; + } + case CREATED_AT: { return "CREATED_AT"; } @@ -59274,14 +61545,30 @@ public String toString() { return "ID"; } - case POSITION: { - return "POSITION"; + case PRICE: { + return "PRICE"; + } + + case PRODUCT_TYPE: { + return "PRODUCT_TYPE"; } case RELEVANCE: { return "RELEVANCE"; } + case TITLE: { + return "TITLE"; + } + + case UPDATED_AT: { + return "UPDATED_AT"; + } + + case VENDOR: { + return "VENDOR"; + } + default: { return ""; } @@ -59289,228 +61576,556 @@ public String toString() { } } + public interface ProductVariantQueryDefinition { + void define(ProductVariantQuery _queryBuilder); + } + /** - * The set of valid sort keys for the ProductMedia query. + * A product variant represents a different version of a product, such as differing sizes or differing + * colors. */ - public enum ProductMediaSortKeys { + public static class ProductVariantQuery extends Query { + ProductVariantQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); + } + /** - * Sort by the `id` value. + * Indicates if the product variant is available for sale. */ - ID, + public ProductVariantQuery availableForSale() { + startField("availableForSale"); + + return this; + } /** - * Sort by the `position` value. + * The barcode (for example, ISBN, UPC, or GTIN) associated with the variant. */ - POSITION, + public ProductVariantQuery barcode() { + startField("barcode"); + + 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 compare at price of the variant. This can be used to mark a variant as on sale, when + * `compareAtPrice` is higher than `price`. */ - RELEVANCE, + public ProductVariantQuery compareAtPrice(MoneyV2QueryDefinition queryDef) { + startField("compareAtPrice"); - UNKNOWN_VALUE; + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public static ProductMediaSortKeys fromGraphQl(String value) { - if (value == null) { - return null; + 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"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * Whether a product is out of stock but still available for purchase (used for backorders). + */ + public ProductVariantQuery currentlyNotInStock() { + startField("currentlyNotInStock"); + + 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 ImageQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + public class MetafieldArguments extends Arguments { + MetafieldArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, false); } - switch (value) { - case "ID": { - return ID; + /** + * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. + */ + public MetafieldArguments namespace(String value) { + if (value != null) { + startArgument("namespace"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } + } - case "POSITION": { - return POSITION; - } + public interface MetafieldArgumentsDefinition { + void define(MetafieldArguments args); + } - case "RELEVANCE": { - return RELEVANCE; - } + /** + * Returns a metafield found by namespace and key. + */ + public ProductVariantQuery metafield(String key, MetafieldQueryDefinition queryDef) { + return metafield(key, args -> {}, queryDef); + } - default: { - return UNKNOWN_VALUE; + /** + * Returns a metafield found by namespace and key. + */ + public ProductVariantQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { + startField("metafield"); + + _queryBuilder.append("(key:"); + Query.appendQuotedString(_queryBuilder, key.toString()); + + argsDef.define(new MetafieldArguments(_queryBuilder)); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new MetafieldQuery(_queryBuilder)); + _queryBuilder.append('}'); + + 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"); + + _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 String toString() { - switch (this) { - case ID: { - return "ID"; + + /** + * The product variant’s price. + */ + public ProductVariantQuery price(MoneyV2QueryDefinition queryDef) { + startField("price"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The product variant’s price. + * + * @deprecated Use `price` instead. + */ + @Deprecated + public ProductVariantQuery priceV2(MoneyV2QueryDefinition queryDef) { + startField("priceV2"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The product object that the product variant belongs to. + */ + public ProductVariantQuery product(ProductQueryDefinition queryDef) { + startField("product"); + + _queryBuilder.append('{'); + queryDef.define(new ProductQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The total sellable quantity of the variant for online sales channels. + */ + public ProductVariantQuery quantityAvailable() { + startField("quantityAvailable"); + + return this; + } + + public class QuantityPriceBreaksArguments extends Arguments { + QuantityPriceBreaksArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * Returns up to the first `n` elements from the list. + */ + public QuantityPriceBreaksArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); } + return this; + } - case POSITION: { - return "POSITION"; + /** + * Returns the elements that come after the specified cursor. + */ + public QuantityPriceBreaksArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; + } - case RELEVANCE: { - return "RELEVANCE"; + /** + * Returns up to the last `n` elements from the list. + */ + public QuantityPriceBreaksArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); } + return this; + } - default: { - return ""; + /** + * Returns the elements that come before the specified cursor. + */ + public QuantityPriceBreaksArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } } - } - public interface ProductOptionQueryDefinition { - void define(ProductOptionQuery _queryBuilder); - } + public interface QuantityPriceBreaksArgumentsDefinition { + void define(QuantityPriceBreaksArguments args); + } - /** - * 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); + /** + * A list of quantity breaks for the product variant. + */ + public ProductVariantQuery quantityPriceBreaks(QuantityPriceBreakConnectionQueryDefinition queryDef) { + return quantityPriceBreaks(args -> {}, queryDef); + } - startField("id"); + /** + * A list of quantity breaks for the product variant. + */ + public ProductVariantQuery quantityPriceBreaks(QuantityPriceBreaksArgumentsDefinition argsDef, QuantityPriceBreakConnectionQueryDefinition queryDef) { + startField("quantityPriceBreaks"); + + QuantityPriceBreaksArguments args = new QuantityPriceBreaksArguments(_queryBuilder); + argsDef.define(args); + QuantityPriceBreaksArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new QuantityPriceBreakConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } /** - * The product option’s name. + * The quantity rule for the product variant in a given context. */ - public ProductOptionQuery name() { - startField("name"); + public ProductVariantQuery quantityRule(QuantityRuleQueryDefinition queryDef) { + startField("quantityRule"); + + _queryBuilder.append('{'); + queryDef.define(new QuantityRuleQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The corresponding value to the product option name. + * Whether a customer needs to provide a shipping address when placing an order for the product + * variant. */ - public ProductOptionQuery values() { - startField("values"); + public ProductVariantQuery requiresShipping() { + startField("requiresShipping"); 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() { + /** + * List of product options applied to the variant. + */ + public ProductVariantQuery selectedOptions(SelectedOptionQueryDefinition queryDef) { + startField("selectedOptions"); + + _queryBuilder.append('{'); + queryDef.define(new SelectedOptionQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; } - 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))); + public class SellingPlanAllocationsArguments extends Arguments { + SellingPlanAllocationsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } - break; - } + /** + * Returns up to the first `n` elements from the list. + */ + public SellingPlanAllocationsArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - case "name": { - responseData.put(key, jsonAsString(field.getValue(), key)); + /** + * Returns the elements that come after the specified cursor. + */ + public SellingPlanAllocationsArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - break; - } + /** + * Returns up to the last `n` elements from the list. + */ + public SellingPlanAllocationsArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Returns the elements that come before the specified cursor. + */ + public SellingPlanAllocationsArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } + + /** + * Reverse the order of the underlying list. + */ + public SellingPlanAllocationsArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } + } + + public interface SellingPlanAllocationsArgumentsDefinition { + void define(SellingPlanAllocationsArguments 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. + */ + public ProductVariantQuery sellingPlanAllocations(SellingPlanAllocationConnectionQueryDefinition queryDef) { + return sellingPlanAllocations(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. + */ + public ProductVariantQuery sellingPlanAllocations(SellingPlanAllocationsArgumentsDefinition argsDef, SellingPlanAllocationConnectionQueryDefinition queryDef) { + startField("sellingPlanAllocations"); + + SellingPlanAllocationsArguments args = new SellingPlanAllocationsArguments(_queryBuilder); + argsDef.define(args); + SellingPlanAllocationsArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new SellingPlanAllocationConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The SKU (stock keeping unit) associated with the variant. + */ + public ProductVariantQuery sku() { + startField("sku"); + + return this; + } + + public class StoreAvailabilityArguments extends Arguments { + StoreAvailabilityArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * Used to sort results based on proximity to the provided location. + */ + public StoreAvailabilityArguments near(GeoCoordinateInput value) { + if (value != null) { + startArgument("near"); + value.appendTo(_queryBuilder); + } + return this; + } - case "values": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } + /** + * Returns up to the first `n` elements from the list. + */ + public StoreAvailabilityArguments first(Integer value) { + if (value != null) { + startArgument("first"); + _queryBuilder.append(value); + } + return this; + } - responseData.put(key, list1); + /** + * Returns the elements that come after the specified cursor. + */ + public StoreAvailabilityArguments after(String value) { + if (value != null) { + startArgument("after"); + Query.appendQuotedString(_queryBuilder, value.toString()); + } + return this; + } - break; - } + /** + * Returns up to the last `n` elements from the list. + */ + public StoreAvailabilityArguments last(Integer value) { + if (value != null) { + startArgument("last"); + _queryBuilder.append(value); + } + return this; + } - case "__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 StoreAvailabilityArguments before(String value) { + if (value != null) { + startArgument("before"); + Query.appendQuotedString(_queryBuilder, value.toString()); } + return this; } - } - public ProductOption(ID id) { - this(); - optimisticData.put("id", id); + /** + * Reverse the order of the underlying list. + */ + public StoreAvailabilityArguments reverse(Boolean value) { + if (value != null) { + startArgument("reverse"); + _queryBuilder.append(value); + } + return this; + } } - public String getGraphQlTypeName() { - return "ProductOption"; + public interface StoreAvailabilityArgumentsDefinition { + void define(StoreAvailabilityArguments args); } /** - * A globally-unique ID. + * The in-store pickup availability of this variant by location. */ - - public ID getId() { - return (ID) get("id"); + public ProductVariantQuery storeAvailability(StoreAvailabilityConnectionQueryDefinition queryDef) { + return storeAvailability(args -> {}, queryDef); } /** - * The product option’s name. + * The in-store pickup availability of this variant by location. */ + public ProductVariantQuery storeAvailability(StoreAvailabilityArgumentsDefinition argsDef, StoreAvailabilityConnectionQueryDefinition queryDef) { + startField("storeAvailability"); - public String getName() { - return (String) get("name"); - } + StoreAvailabilityArguments args = new StoreAvailabilityArguments(_queryBuilder); + argsDef.define(args); + StoreAvailabilityArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new StoreAvailabilityConnectionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ProductOption setName(String arg) { - optimisticData.put(getKey("name"), arg); return this; } /** - * The corresponding value to the product option name. + * Whether tax is charged when the product variant is sold. */ + public ProductVariantQuery taxable() { + startField("taxable"); - 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 "id": return false; - - case "name": return false; - - case "values": return false; - - default: return false; - } - } - } - - public interface ProductPriceRangeQueryDefinition { - void define(ProductPriceRangeQuery _queryBuilder); - } + /** + * The product variant’s title. + */ + public ProductVariantQuery title() { + startField("title"); - /** - * The price range of the product. - */ - public static class ProductPriceRangeQuery extends Query { - ProductPriceRangeQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * The highest variant's price. + * The unit price value for the variant based on the variant's measurement. */ - public ProductPriceRangeQuery maxVariantPrice(MoneyV2QueryDefinition queryDef) { - startField("maxVariantPrice"); + public ProductVariantQuery unitPrice(MoneyV2QueryDefinition queryDef) { + startField("unitPrice"); _queryBuilder.append('{'); queryDef.define(new MoneyV2Query(_queryBuilder)); @@ -59520,325 +62135,314 @@ public ProductPriceRangeQuery maxVariantPrice(MoneyV2QueryDefinition queryDef) { } /** - * The lowest variant's price. + * The unit price measurement for the variant. */ - public ProductPriceRangeQuery minVariantPrice(MoneyV2QueryDefinition queryDef) { - startField("minVariantPrice"); + public ProductVariantQuery unitPriceMeasurement(UnitPriceMeasurementQueryDefinition queryDef) { + startField("unitPriceMeasurement"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + 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; + } } /** - * The price range of the product. + * A product variant represents a different version of a product, such as differing sizes or differing + * colors. */ - public static class ProductPriceRange extends AbstractResponse { - public ProductPriceRange() { + public static class ProductVariant extends AbstractResponse implements HasMetafields, Merchandise, MetafieldParentResource, MetafieldReference, Node { + public ProductVariant() { } - public ProductPriceRange(JsonObject fields) throws SchemaViolationError { + public ProductVariant(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "maxVariantPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "availableForSale": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } - case "minVariantPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "barcode": { + 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)); + case "compareAtPrice": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); + + case "compareAtPriceV2": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; } - } - } - } - public String getGraphQlTypeName() { - return "ProductPriceRange"; - } + case "currentlyNotInStock": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - /** - * The highest variant's price. - */ + break; + } - public MoneyV2 getMaxVariantPrice() { - return (MoneyV2) get("maxVariantPrice"); - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - public ProductPriceRange setMaxVariantPrice(MoneyV2 arg) { - optimisticData.put(getKey("maxVariantPrice"), arg); - return this; - } + break; + } - /** - * The lowest variant's price. - */ + case "image": { + Image optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Image(jsonAsObject(field.getValue(), key)); + } - public MoneyV2 getMinVariantPrice() { - return (MoneyV2) get("minVariantPrice"); - } + responseData.put(key, optional1); - public ProductPriceRange setMinVariantPrice(MoneyV2 arg) { - optimisticData.put(getKey("minVariantPrice"), arg); - return this; - } + break; + } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "maxVariantPrice": return true; + case "metafield": { + Metafield optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + } - case "minVariantPrice": return true; + responseData.put(key, optional1); - default: return false; - } - } - } + break; + } - /** - * The recommendation intent that is used to generate product recommendations. - * You can use intent to generate product recommendations according to different strategies. - */ - public enum ProductRecommendationIntent { - /** - * Offer customers products that are complementary to a product for which recommendations are to be - * fetched. An example is add-on products that display in a Pair it with section. - */ - COMPLEMENTARY, + 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)); + } - /** - * Offer customers a mix of products that are similar or complementary to a product for which - * recommendations are to be fetched. An example is substitutable products that display in a You may - * also like section. - */ - RELATED, + list1.add(optional2); + } - UNKNOWN_VALUE; + responseData.put(key, list1); - public static ProductRecommendationIntent fromGraphQl(String value) { - if (value == null) { - return null; - } + break; + } - switch (value) { - case "COMPLEMENTARY": { - return COMPLEMENTARY; - } + case "price": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - case "RELATED": { - return RELATED; - } + break; + } - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case COMPLEMENTARY: { - return "COMPLEMENTARY"; - } + case "priceV2": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - case RELATED: { - return "RELATED"; - } + break; + } - default: { - return ""; - } - } - } - } + case "product": { + responseData.put(key, new Product(jsonAsObject(field.getValue(), key))); - /** - * The set of valid sort keys for the Product query. - */ - public enum ProductSortKeys { - /** - * Sort by the `best_selling` value. - */ - BEST_SELLING, + break; + } - /** - * Sort by the `created_at` value. - */ - CREATED_AT, + case "quantityAvailable": { + Integer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsInteger(field.getValue(), key); + } - /** - * Sort by the `id` value. - */ - ID, + responseData.put(key, optional1); - /** - * Sort by the `price` value. - */ - PRICE, + break; + } - /** - * Sort by the `product_type` value. - */ - PRODUCT_TYPE, + case "quantityPriceBreaks": { + responseData.put(key, new QuantityPriceBreakConnection(jsonAsObject(field.getValue(), key))); - /** - * Sort by relevance to the search terms when the `query` parameter is specified on the connection. - * Don't use this sort key when no search query is specified. - */ - RELEVANCE, + break; + } - /** - * Sort by the `title` value. - */ - TITLE, + case "quantityRule": { + responseData.put(key, new QuantityRule(jsonAsObject(field.getValue(), key))); - /** - * Sort by the `updated_at` value. - */ - UPDATED_AT, + break; + } - /** - * Sort by the `vendor` value. - */ - VENDOR, + case "requiresShipping": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - UNKNOWN_VALUE; + break; + } - public static ProductSortKeys fromGraphQl(String value) { - if (value == null) { - return null; - } + case "selectedOptions": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new SelectedOption(jsonAsObject(element1, key))); + } - switch (value) { - case "BEST_SELLING": { - return BEST_SELLING; - } + responseData.put(key, list1); - case "CREATED_AT": { - return CREATED_AT; - } + break; + } - case "ID": { - return ID; - } + case "sellingPlanAllocations": { + responseData.put(key, new SellingPlanAllocationConnection(jsonAsObject(field.getValue(), key))); - case "PRICE": { - return PRICE; - } + break; + } - case "PRODUCT_TYPE": { - return PRODUCT_TYPE; - } + case "sku": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - case "RELEVANCE": { - return RELEVANCE; - } + responseData.put(key, optional1); - case "TITLE": { - return TITLE; - } + break; + } - case "UPDATED_AT": { - return UPDATED_AT; - } + case "storeAvailability": { + responseData.put(key, new StoreAvailabilityConnection(jsonAsObject(field.getValue(), key))); - case "VENDOR": { - return VENDOR; - } + break; + } - default: { - return UNKNOWN_VALUE; - } - } - } - public String toString() { - switch (this) { - case BEST_SELLING: { - return "BEST_SELLING"; - } + case "taxable": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); - case CREATED_AT: { - return "CREATED_AT"; - } + break; + } - case ID: { - return "ID"; - } + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); - case PRICE: { - return "PRICE"; - } + break; + } - case PRODUCT_TYPE: { - return "PRODUCT_TYPE"; - } + case "unitPrice": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } - case RELEVANCE: { - return "RELEVANCE"; - } + responseData.put(key, optional1); + + break; + } + + case "unitPriceMeasurement": { + UnitPriceMeasurement optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new UnitPriceMeasurement(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "weight": { + Double optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsDouble(field.getValue(), key); + } + + responseData.put(key, optional1); - case TITLE: { - return "TITLE"; - } + break; + } - case UPDATED_AT: { - return "UPDATED_AT"; - } + case "weightUnit": { + responseData.put(key, WeightUnit.fromGraphQl(jsonAsString(field.getValue(), key))); - case VENDOR: { - return "VENDOR"; - } + break; + } - default: { - return ""; + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } } } - } - - 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); + public ProductVariant(ID id) { + this(); + optimisticData.put("id", id); + } - startField("id"); + public String getGraphQlTypeName() { + return "ProductVariant"; } /** * Indicates if the product variant is available for sale. */ - public ProductVariantQuery availableForSale() { - startField("availableForSale"); + 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 ProductVariantQuery barcode() { - startField("barcode"); + public String getBarcode() { + return (String) get("barcode"); + } + + public ProductVariant setBarcode(String arg) { + optimisticData.put(getKey("barcode"), arg); return this; } @@ -59846,13 +62450,13 @@ public ProductVariantQuery barcode() { * 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('}'); + public MoneyV2 getCompareAtPrice() { + return (MoneyV2) get("compareAtPrice"); + } + public ProductVariant setCompareAtPrice(MoneyV2 arg) { + optimisticData.put(getKey("compareAtPrice"), arg); return this; } @@ -59862,125 +62466,87 @@ public ProductVariantQuery compareAtPrice(MoneyV2QueryDefinition queryDef) { * * @deprecated Use `compareAtPrice` instead. */ - @Deprecated - public ProductVariantQuery compareAtPriceV2(MoneyV2QueryDefinition queryDef) { - startField("compareAtPriceV2"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getCompareAtPriceV2() { + return (MoneyV2) get("compareAtPriceV2"); + } + public ProductVariant setCompareAtPriceV2(MoneyV2 arg) { + optimisticData.put(getKey("compareAtPriceV2"), arg); return this; } /** * Whether a product is out of stock but still available for purchase (used for backorders). */ - public ProductVariantQuery currentlyNotInStock() { - startField("currentlyNotInStock"); + public Boolean getCurrentlyNotInStock() { + return (Boolean) get("currentlyNotInStock"); + } + + public ProductVariant setCurrentlyNotInStock(Boolean arg) { + optimisticData.put(getKey("currentlyNotInStock"), arg); return this; } /** - * Image associated with the product variant. This field falls back to the product image if no image is - * available. + * A globally-unique ID. */ - public ProductVariantQuery image(ImageQueryDefinition queryDef) { - startField("image"); - - _queryBuilder.append('{'); - queryDef.define(new ImageQuery(_queryBuilder)); - _queryBuilder.append('}'); - return this; + public ID getId() { + return (ID) get("id"); } - public class MetafieldArguments extends Arguments { - MetafieldArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, false); - } - - /** - * The container the metafield belongs to. If omitted, the app-reserved namespace will be used. - */ - public MetafieldArguments namespace(String value) { - if (value != null) { - startArgument("namespace"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } - } + /** + * Image associated with the product variant. This field falls back to the product image if no image is + * available. + */ - public interface MetafieldArgumentsDefinition { - void define(MetafieldArguments args); + public Image getImage() { + return (Image) get("image"); } - /** - * Returns a metafield found by namespace and key. - */ - public ProductVariantQuery metafield(String key, MetafieldQueryDefinition queryDef) { - return metafield(key, args -> {}, queryDef); + public ProductVariant setImage(Image arg) { + optimisticData.put(getKey("image"), arg); + return this; } /** * Returns a metafield found by namespace and key. */ - public ProductVariantQuery metafield(String key, MetafieldArgumentsDefinition argsDef, MetafieldQueryDefinition queryDef) { - startField("metafield"); - - _queryBuilder.append("(key:"); - Query.appendQuotedString(_queryBuilder, key.toString()); - - argsDef.define(new MetafieldArguments(_queryBuilder)); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Metafield getMetafield() { + return (Metafield) get("metafield"); + } + public ProductVariant setMetafield(Metafield arg) { + optimisticData.put(getKey("metafield"), arg); return this; } /** * The metafields associated with the resource matching the supplied list of namespaces and keys. */ - public ProductVariantQuery metafields(List identifiers, MetafieldQueryDefinition queryDef) { - startField("metafields"); - - _queryBuilder.append("(identifiers:"); - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (HasMetafieldsIdentifier item1 : identifiers) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - - _queryBuilder.append(')'); - _queryBuilder.append('{'); - queryDef.define(new MetafieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + public List getMetafields() { + return (List) get("metafields"); + } + public ProductVariant setMetafields(List arg) { + optimisticData.put(getKey("metafields"), arg); return this; } /** * The product variant’s price. */ - public ProductVariantQuery price(MoneyV2QueryDefinition queryDef) { - startField("price"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public MoneyV2 getPrice() { + return (MoneyV2) get("price"); + } + public ProductVariant setPrice(MoneyV2 arg) { + optimisticData.put(getKey("price"), arg); return this; } @@ -59989,420 +62555,351 @@ public ProductVariantQuery price(MoneyV2QueryDefinition queryDef) { * * @deprecated Use `price` instead. */ - @Deprecated - public ProductVariantQuery priceV2(MoneyV2QueryDefinition queryDef) { - startField("priceV2"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + 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 ProductVariantQuery product(ProductQueryDefinition queryDef) { - startField("product"); - _queryBuilder.append('{'); - queryDef.define(new ProductQuery(_queryBuilder)); - _queryBuilder.append('}'); + 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 ProductVariantQuery quantityAvailable() { - startField("quantityAvailable"); + 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. + * A list of quantity breaks for the product variant. */ - public ProductVariantQuery requiresShipping() { - startField("requiresShipping"); + public QuantityPriceBreakConnection getQuantityPriceBreaks() { + return (QuantityPriceBreakConnection) get("quantityPriceBreaks"); + } + + public ProductVariant setQuantityPriceBreaks(QuantityPriceBreakConnection arg) { + optimisticData.put(getKey("quantityPriceBreaks"), arg); return this; } /** - * List of product options applied to the variant. + * The quantity rule for the product variant in a given context. */ - public ProductVariantQuery selectedOptions(SelectedOptionQueryDefinition queryDef) { - startField("selectedOptions"); - _queryBuilder.append('{'); - queryDef.define(new SelectedOptionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public QuantityRule getQuantityRule() { + return (QuantityRule) get("quantityRule"); + } + public ProductVariant setQuantityRule(QuantityRule arg) { + optimisticData.put(getKey("quantityRule"), arg); return this; } - public class SellingPlanAllocationsArguments extends Arguments { - SellingPlanAllocationsArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } - - /** - * Returns up to the first `n` elements from the list. - */ - public SellingPlanAllocationsArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + /** + * Whether a customer needs to provide a shipping address when placing an order for the product + * variant. + */ - /** - * Returns the elements that come after the specified cursor. - */ - public SellingPlanAllocationsArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public Boolean getRequiresShipping() { + return (Boolean) get("requiresShipping"); + } - /** - * Returns up to the last `n` elements from the list. - */ - public SellingPlanAllocationsArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + public ProductVariant setRequiresShipping(Boolean arg) { + optimisticData.put(getKey("requiresShipping"), arg); + return this; + } - /** - * Returns the elements that come before the specified cursor. - */ - public SellingPlanAllocationsArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + /** + * List of product options applied to the variant. + */ - /** - * Reverse the order of the underlying list. - */ - public SellingPlanAllocationsArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + public List getSelectedOptions() { + return (List) get("selectedOptions"); } - public interface SellingPlanAllocationsArgumentsDefinition { - void define(SellingPlanAllocationsArguments args); + 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. */ - public ProductVariantQuery sellingPlanAllocations(SellingPlanAllocationConnectionQueryDefinition queryDef) { - return sellingPlanAllocations(args -> {}, queryDef); + + public SellingPlanAllocationConnection getSellingPlanAllocations() { + return (SellingPlanAllocationConnection) get("sellingPlanAllocations"); + } + + public ProductVariant setSellingPlanAllocations(SellingPlanAllocationConnection arg) { + optimisticData.put(getKey("sellingPlanAllocations"), arg); + return this; } /** - * Represents an association between a variant and a selling plan. Selling plan allocations describe - * which selling plans are available for each variant, and what their impact is on pricing. + * The SKU (stock keeping unit) associated with the variant. */ - public ProductVariantQuery sellingPlanAllocations(SellingPlanAllocationsArgumentsDefinition argsDef, SellingPlanAllocationConnectionQueryDefinition queryDef) { - startField("sellingPlanAllocations"); - SellingPlanAllocationsArguments args = new SellingPlanAllocationsArguments(_queryBuilder); - argsDef.define(args); - SellingPlanAllocationsArguments.end(args); + public String getSku() { + return (String) get("sku"); + } - _queryBuilder.append('{'); - queryDef.define(new SellingPlanAllocationConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ProductVariant setSku(String arg) { + optimisticData.put(getKey("sku"), arg); + return this; + } + + /** + * The in-store pickup availability of this variant by location. + */ + + public StoreAvailabilityConnection getStoreAvailability() { + return (StoreAvailabilityConnection) get("storeAvailability"); + } + public ProductVariant setStoreAvailability(StoreAvailabilityConnection arg) { + optimisticData.put(getKey("storeAvailability"), arg); return this; } /** - * The SKU (stock keeping unit) associated with the variant. + * Whether tax is charged when the product variant is sold. */ - public ProductVariantQuery sku() { - startField("sku"); + public Boolean getTaxable() { + return (Boolean) get("taxable"); + } + + public ProductVariant setTaxable(Boolean arg) { + optimisticData.put(getKey("taxable"), arg); return this; } - public class StoreAvailabilityArguments extends Arguments { - StoreAvailabilityArguments(StringBuilder _queryBuilder) { - super(_queryBuilder, true); - } + /** + * The product variant’s title. + */ - /** - * Used to sort results based on proximity to the provided location. - */ - public StoreAvailabilityArguments near(GeoCoordinateInput value) { - if (value != null) { - startArgument("near"); - value.appendTo(_queryBuilder); - } - return this; - } + public String getTitle() { + return (String) get("title"); + } - /** - * Returns up to the first `n` elements from the list. - */ - public StoreAvailabilityArguments first(Integer value) { - if (value != null) { - startArgument("first"); - _queryBuilder.append(value); - } - return this; - } + public ProductVariant setTitle(String arg) { + optimisticData.put(getKey("title"), arg); + return this; + } - /** - * Returns the elements that come after the specified cursor. - */ - public StoreAvailabilityArguments after(String value) { - if (value != null) { - startArgument("after"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + /** + * The unit price value for the variant based on the variant's measurement. + */ - /** - * Returns up to the last `n` elements from the list. - */ - public StoreAvailabilityArguments last(Integer value) { - if (value != null) { - startArgument("last"); - _queryBuilder.append(value); - } - return this; - } + public MoneyV2 getUnitPrice() { + return (MoneyV2) get("unitPrice"); + } - /** - * Returns the elements that come before the specified cursor. - */ - public StoreAvailabilityArguments before(String value) { - if (value != null) { - startArgument("before"); - Query.appendQuotedString(_queryBuilder, value.toString()); - } - return this; - } + public ProductVariant setUnitPrice(MoneyV2 arg) { + optimisticData.put(getKey("unitPrice"), arg); + return this; + } - /** - * Reverse the order of the underlying list. - */ - public StoreAvailabilityArguments reverse(Boolean value) { - if (value != null) { - startArgument("reverse"); - _queryBuilder.append(value); - } - return this; - } + /** + * The unit price measurement for the variant. + */ + + public UnitPriceMeasurement getUnitPriceMeasurement() { + return (UnitPriceMeasurement) get("unitPriceMeasurement"); } - public interface StoreAvailabilityArgumentsDefinition { - void define(StoreAvailabilityArguments args); + public ProductVariant setUnitPriceMeasurement(UnitPriceMeasurement arg) { + optimisticData.put(getKey("unitPriceMeasurement"), arg); + return this; } /** - * The in-store pickup availability of this variant by location. + * The weight of the product variant in the unit system specified with `weight_unit`. */ - public ProductVariantQuery storeAvailability(StoreAvailabilityConnectionQueryDefinition queryDef) { - return storeAvailability(args -> {}, queryDef); + + public Double getWeight() { + return (Double) get("weight"); + } + + public ProductVariant setWeight(Double arg) { + optimisticData.put(getKey("weight"), arg); + return this; } /** - * The in-store pickup availability of this variant by location. + * Unit of measurement for weight. */ - public ProductVariantQuery storeAvailability(StoreAvailabilityArgumentsDefinition argsDef, StoreAvailabilityConnectionQueryDefinition queryDef) { - startField("storeAvailability"); - StoreAvailabilityArguments args = new StoreAvailabilityArguments(_queryBuilder); - argsDef.define(args); - StoreAvailabilityArguments.end(args); + 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 "quantityPriceBreaks": return true; + + case "quantityRule": return true; + + case "requiresShipping": return false; + + case "selectedOptions": return true; + + case "sellingPlanAllocations": return true; + + case "sku": return false; + + case "storeAvailability": return true; + + case "taxable": return false; + + case "title": return false; + + case "unitPrice": return true; - _queryBuilder.append('{'); - queryDef.define(new StoreAvailabilityConnectionQuery(_queryBuilder)); - _queryBuilder.append('}'); + case "unitPriceMeasurement": return true; - return this; - } + case "weight": return false; - /** - * Whether tax is charged when the product variant is sold. - */ - public ProductVariantQuery taxable() { - startField("taxable"); + case "weightUnit": return false; - return this; + default: return false; + } } + } - /** - * The product variant’s title. - */ - public ProductVariantQuery title() { - startField("title"); + public interface ProductVariantConnectionQueryDefinition { + void define(ProductVariantConnectionQuery _queryBuilder); + } - return this; + /** + * An auto-generated type for paginating through multiple ProductVariants. + */ + public static class ProductVariantConnectionQuery extends Query { + ProductVariantConnectionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The unit price value for the variant based on the variant's measurement. + * A list of edges. */ - public ProductVariantQuery unitPrice(MoneyV2QueryDefinition queryDef) { - startField("unitPrice"); + public ProductVariantConnectionQuery edges(ProductVariantEdgeQueryDefinition queryDef) { + startField("edges"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new ProductVariantEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The unit price measurement for the variant. + * A list of the nodes contained in ProductVariantEdge. */ - public ProductVariantQuery unitPriceMeasurement(UnitPriceMeasurementQueryDefinition queryDef) { - startField("unitPriceMeasurement"); + public ProductVariantConnectionQuery nodes(ProductVariantQueryDefinition queryDef) { + startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new UnitPriceMeasurementQuery(_queryBuilder)); + queryDef.define(new ProductVariantQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The weight of the product variant in the unit system specified with `weight_unit`. + * Information to aid in pagination. */ - public ProductVariantQuery weight() { - startField("weight"); - - return this; - } + public ProductVariantConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + startField("pageInfo"); - /** - * Unit of measurement for weight. - */ - public ProductVariantQuery weightUnit() { - startField("weightUnit"); + _queryBuilder.append('{'); + queryDef.define(new PageInfoQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * A product variant represents a different version of a product, such as differing sizes or differing - * colors. + * An auto-generated type for paginating through multiple ProductVariants. */ - public static class ProductVariant extends AbstractResponse implements HasMetafields, Merchandise, MetafieldParentResource, MetafieldReference, Node { - public ProductVariant() { + public static class ProductVariantConnection extends AbstractResponse { + public ProductVariantConnection() { } - public ProductVariant(JsonObject fields) throws SchemaViolationError { + public ProductVariantConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "availableForSale": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "barcode": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "compareAtPrice": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "compareAtPriceV2": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "currentlyNotInStock": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } - - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - - break; - } - - case "image": { - Image optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Image(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "metafield": { - Metafield optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new Metafield(jsonAsObject(field.getValue(), key)); + case "edges": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ProductVariantEdge(jsonAsObject(element1, key))); } - responseData.put(key, optional1); + responseData.put(key, list1); break; } - case "metafields": { - List list1 = new ArrayList<>(); + case "nodes": { + 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 ProductVariant(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -60410,122 +62907,134 @@ public ProductVariant(JsonObject fields) throws SchemaViolationError { break; } - case "price": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "priceV2": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "pageInfo": { + responseData.put(key, new PageInfo(jsonAsObject(field.getValue(), key))); break; } - case "product": { - responseData.put(key, new Product(jsonAsObject(field.getValue(), key))); - + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - - case "quantityAvailable": { - Integer optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsInteger(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; + default: { + throw new SchemaViolationError(this, key, field.getValue()); } + } + } + } - case "requiresShipping": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); - - break; - } + public String getGraphQlTypeName() { + return "ProductVariantConnection"; + } - case "selectedOptions": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new SelectedOption(jsonAsObject(element1, key))); - } + /** + * A list of edges. + */ - responseData.put(key, list1); + public List getEdges() { + return (List) get("edges"); + } - break; - } + public ProductVariantConnection setEdges(List arg) { + optimisticData.put(getKey("edges"), arg); + return this; + } - case "sellingPlanAllocations": { - responseData.put(key, new SellingPlanAllocationConnection(jsonAsObject(field.getValue(), key))); + /** + * A list of the nodes contained in ProductVariantEdge. + */ - break; - } + public List getNodes() { + return (List) get("nodes"); + } - case "sku": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } + public ProductVariantConnection setNodes(List arg) { + optimisticData.put(getKey("nodes"), arg); + return this; + } - responseData.put(key, optional1); + /** + * Information to aid in pagination. + */ - break; - } + public PageInfo getPageInfo() { + return (PageInfo) get("pageInfo"); + } - case "storeAvailability": { - responseData.put(key, new StoreAvailabilityConnection(jsonAsObject(field.getValue(), key))); + public ProductVariantConnection setPageInfo(PageInfo arg) { + optimisticData.put(getKey("pageInfo"), arg); + return this; + } - break; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "edges": return true; - case "taxable": { - responseData.put(key, jsonAsBoolean(field.getValue(), key)); + case "nodes": return true; - break; - } + case "pageInfo": return true; - case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + default: return false; + } + } + } - break; - } + public interface ProductVariantEdgeQueryDefinition { + void define(ProductVariantEdgeQuery _queryBuilder); + } - case "unitPrice": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } + /** + * An auto-generated type which holds one ProductVariant and a cursor during pagination. + */ + public static class ProductVariantEdgeQuery extends Query { + ProductVariantEdgeQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - responseData.put(key, optional1); + /** + * A cursor for use in pagination. + */ + public ProductVariantEdgeQuery cursor() { + startField("cursor"); - break; - } + return this; + } - case "unitPriceMeasurement": { - UnitPriceMeasurement optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new UnitPriceMeasurement(jsonAsObject(field.getValue(), key)); - } + /** + * The item at the end of ProductVariantEdge. + */ + public ProductVariantEdgeQuery node(ProductVariantQueryDefinition queryDef) { + startField("node"); - responseData.put(key, optional1); + _queryBuilder.append('{'); + queryDef.define(new ProductVariantQuery(_queryBuilder)); + _queryBuilder.append('}'); - break; - } + return this; + } + } - case "weight": { - Double optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsDouble(field.getValue(), key); - } + /** + * An auto-generated type which holds one ProductVariant and a cursor during pagination. + */ + public static class ProductVariantEdge extends AbstractResponse { + public ProductVariantEdge() { + } - responseData.put(key, optional1); + public ProductVariantEdge(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "cursor": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "weightUnit": { - responseData.put(key, WeightUnit.fromGraphQl(jsonAsString(field.getValue(), key))); + case "node": { + responseData.put(key, new ProductVariant(jsonAsObject(field.getValue(), key))); break; } @@ -60541,419 +63050,439 @@ public ProductVariant(JsonObject fields) throws SchemaViolationError { } } - public ProductVariant(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "ProductVariant"; + return "ProductVariantEdge"; } /** - * Indicates if the product variant is available for sale. + * A cursor for use in pagination. */ - public Boolean getAvailableForSale() { - return (Boolean) get("availableForSale"); + public String getCursor() { + return (String) get("cursor"); } - public ProductVariant setAvailableForSale(Boolean arg) { - optimisticData.put(getKey("availableForSale"), arg); + public ProductVariantEdge setCursor(String arg) { + optimisticData.put(getKey("cursor"), arg); return this; } /** - * The barcode (for example, ISBN, UPC, or GTIN) associated with the variant. + * The item at the end of ProductVariantEdge. */ - public String getBarcode() { - return (String) get("barcode"); + public ProductVariant getNode() { + return (ProductVariant) get("node"); } - public ProductVariant setBarcode(String arg) { - optimisticData.put(getKey("barcode"), arg); + public ProductVariantEdge setNode(ProductVariant arg) { + optimisticData.put(getKey("node"), arg); return this; } - /** - * The compare at price of the variant. This can be used to mark a variant as on sale, when - * `compareAtPrice` is higher than `price`. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "cursor": return false; - public MoneyV2 getCompareAtPrice() { - return (MoneyV2) get("compareAtPrice"); - } + case "node": return true; - public ProductVariant setCompareAtPrice(MoneyV2 arg) { - optimisticData.put(getKey("compareAtPrice"), arg); - return this; + default: return false; + } } + } + /** + * The set of valid sort keys for the ProductVariant query. + */ + public enum ProductVariantSortKeys { /** - * 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. + * Sort by the `id` value. */ - - public MoneyV2 getCompareAtPriceV2() { - return (MoneyV2) get("compareAtPriceV2"); - } - - public ProductVariant setCompareAtPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("compareAtPriceV2"), arg); - return this; - } + ID, /** - * Whether a product is out of stock but still available for purchase (used for backorders). + * Sort by the `position` value. */ - - public Boolean getCurrentlyNotInStock() { - return (Boolean) get("currentlyNotInStock"); - } - - public ProductVariant setCurrentlyNotInStock(Boolean arg) { - optimisticData.put(getKey("currentlyNotInStock"), arg); - return this; - } + POSITION, /** - * A globally-unique ID. + * Sort by relevance to the search terms when the `query` parameter is specified on the connection. + * Don't use this sort key when no search query is specified. */ + RELEVANCE, - public ID getId() { - return (ID) get("id"); - } + /** + * Sort by the `sku` value. + */ + SKU, /** - * Image associated with the product variant. This field falls back to the product image if no image is - * available. + * Sort by the `title` value. */ + TITLE, - public Image getImage() { - return (Image) get("image"); - } + UNKNOWN_VALUE; - public ProductVariant setImage(Image arg) { - optimisticData.put(getKey("image"), arg); - return this; - } + public static ProductVariantSortKeys fromGraphQl(String value) { + if (value == null) { + return null; + } - /** - * Returns a metafield found by namespace and key. - */ + switch (value) { + case "ID": { + return ID; + } - public Metafield getMetafield() { - return (Metafield) get("metafield"); - } + case "POSITION": { + return POSITION; + } - public ProductVariant setMetafield(Metafield arg) { - optimisticData.put(getKey("metafield"), arg); - return this; - } + case "RELEVANCE": { + return RELEVANCE; + } - /** - * The metafields associated with the resource matching the supplied list of namespaces and keys. - */ + case "SKU": { + return SKU; + } - public List getMetafields() { - return (List) get("metafields"); - } + case "TITLE": { + return TITLE; + } - public ProductVariant setMetafields(List arg) { - optimisticData.put(getKey("metafields"), arg); - return this; + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case ID: { + return "ID"; + } - /** - * The product variant’s price. - */ + case POSITION: { + return "POSITION"; + } - public MoneyV2 getPrice() { - return (MoneyV2) get("price"); + case RELEVANCE: { + return "RELEVANCE"; + } + + case SKU: { + return "SKU"; + } + + case TITLE: { + return "TITLE"; + } + + default: { + return ""; + } + } } + } - public ProductVariant setPrice(MoneyV2 arg) { - optimisticData.put(getKey("price"), arg); - return this; + public interface PurchasingCompanyQueryDefinition { + void define(PurchasingCompanyQuery _queryBuilder); + } + + /** + * Represents information about the buyer that is interacting with the cart. + */ + public static class PurchasingCompanyQuery extends Query { + PurchasingCompanyQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The product variant’s price. - * - * @deprecated Use `price` instead. + * The company associated to the order or draft order. */ + public PurchasingCompanyQuery company(CompanyQueryDefinition queryDef) { + startField("company"); - public MoneyV2 getPriceV2() { - return (MoneyV2) get("priceV2"); - } + _queryBuilder.append('{'); + queryDef.define(new CompanyQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ProductVariant setPriceV2(MoneyV2 arg) { - optimisticData.put(getKey("priceV2"), arg); return this; } /** - * The product object that the product variant belongs to. + * The company contact associated to the order or draft order. */ + public PurchasingCompanyQuery contact(CompanyContactQueryDefinition queryDef) { + startField("contact"); - public Product getProduct() { - return (Product) get("product"); - } + _queryBuilder.append('{'); + queryDef.define(new CompanyContactQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ProductVariant setProduct(Product arg) { - optimisticData.put(getKey("product"), arg); return this; } /** - * The total sellable quantity of the variant for online sales channels. + * The company location associated to the order or draft order. */ + public PurchasingCompanyQuery location(CompanyLocationQueryDefinition queryDef) { + startField("location"); - public Integer getQuantityAvailable() { - return (Integer) get("quantityAvailable"); - } + _queryBuilder.append('{'); + queryDef.define(new CompanyLocationQuery(_queryBuilder)); + _queryBuilder.append('}'); - 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"); + /** + * Represents information about the buyer that is interacting with the cart. + */ + public static class PurchasingCompany extends AbstractResponse { + public PurchasingCompany() { } - public ProductVariant setRequiresShipping(Boolean arg) { - optimisticData.put(getKey("requiresShipping"), arg); - return this; - } + public PurchasingCompany(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "company": { + responseData.put(key, new Company(jsonAsObject(field.getValue(), key))); - /** - * List of product options applied to the variant. - */ + break; + } - public List getSelectedOptions() { - return (List) get("selectedOptions"); + case "contact": { + CompanyContact optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new CompanyContact(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "location": { + responseData.put(key, new CompanyLocation(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public ProductVariant setSelectedOptions(List arg) { - optimisticData.put(getKey("selectedOptions"), arg); - return this; + public String getGraphQlTypeName() { + return "PurchasingCompany"; } /** - * Represents an association between a variant and a selling plan. Selling plan allocations describe - * which selling plans are available for each variant, and what their impact is on pricing. + * The company associated to the order or draft order. */ - public SellingPlanAllocationConnection getSellingPlanAllocations() { - return (SellingPlanAllocationConnection) get("sellingPlanAllocations"); + public Company getCompany() { + return (Company) get("company"); } - public ProductVariant setSellingPlanAllocations(SellingPlanAllocationConnection arg) { - optimisticData.put(getKey("sellingPlanAllocations"), arg); + public PurchasingCompany setCompany(Company arg) { + optimisticData.put(getKey("company"), arg); return this; } /** - * The SKU (stock keeping unit) associated with the variant. + * The company contact associated to the order or draft order. */ - public String getSku() { - return (String) get("sku"); + public CompanyContact getContact() { + return (CompanyContact) get("contact"); } - public ProductVariant setSku(String arg) { - optimisticData.put(getKey("sku"), arg); + public PurchasingCompany setContact(CompanyContact arg) { + optimisticData.put(getKey("contact"), arg); return this; } /** - * The in-store pickup availability of this variant by location. + * The company location associated to the order or draft order. */ - public StoreAvailabilityConnection getStoreAvailability() { - return (StoreAvailabilityConnection) get("storeAvailability"); + public CompanyLocation getLocation() { + return (CompanyLocation) get("location"); } - public ProductVariant setStoreAvailability(StoreAvailabilityConnection arg) { - optimisticData.put(getKey("storeAvailability"), arg); + public PurchasingCompany setLocation(CompanyLocation arg) { + optimisticData.put(getKey("location"), arg); return this; } - /** - * Whether tax is charged when the product variant is sold. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "company": return true; - public Boolean getTaxable() { - return (Boolean) get("taxable"); + case "contact": return true; + + case "location": return true; + + default: return false; + } } + } - public ProductVariant setTaxable(Boolean arg) { - optimisticData.put(getKey("taxable"), arg); - return this; + public interface QuantityPriceBreakQueryDefinition { + void define(QuantityPriceBreakQuery _queryBuilder); + } + + /** + * Quantity price breaks lets you offer different rates that are based on the + * amount of a specific variant being ordered. + */ + public static class QuantityPriceBreakQuery extends Query { + QuantityPriceBreakQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The product variant’s title. + * Minimum quantity required to reach new quantity break price. */ + public QuantityPriceBreakQuery minimumQuantity() { + startField("minimumQuantity"); - public String getTitle() { - return (String) get("title"); - } - - public ProductVariant setTitle(String arg) { - optimisticData.put(getKey("title"), arg); return this; } /** - * The unit price value for the variant based on the variant's measurement. + * The price of variant after reaching the minimum quanity. */ + public QuantityPriceBreakQuery price(MoneyV2QueryDefinition queryDef) { + startField("price"); - public MoneyV2 getUnitPrice() { - return (MoneyV2) get("unitPrice"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public ProductVariant setUnitPrice(MoneyV2 arg) { - optimisticData.put(getKey("unitPrice"), arg); return this; } + } + + /** + * Quantity price breaks lets you offer different rates that are based on the + * amount of a specific variant being ordered. + */ + public static class QuantityPriceBreak extends AbstractResponse { + public QuantityPriceBreak() { + } - /** - * The unit price measurement for the variant. - */ + public QuantityPriceBreak(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "minimumQuantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); - public UnitPriceMeasurement getUnitPriceMeasurement() { - return (UnitPriceMeasurement) get("unitPriceMeasurement"); + break; + } + + case "price": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } } - public ProductVariant setUnitPriceMeasurement(UnitPriceMeasurement arg) { - optimisticData.put(getKey("unitPriceMeasurement"), arg); - return this; + public String getGraphQlTypeName() { + return "QuantityPriceBreak"; } /** - * The weight of the product variant in the unit system specified with `weight_unit`. + * Minimum quantity required to reach new quantity break price. */ - public Double getWeight() { - return (Double) get("weight"); + public Integer getMinimumQuantity() { + return (Integer) get("minimumQuantity"); } - public ProductVariant setWeight(Double arg) { - optimisticData.put(getKey("weight"), arg); + public QuantityPriceBreak setMinimumQuantity(Integer arg) { + optimisticData.put(getKey("minimumQuantity"), arg); return this; } /** - * Unit of measurement for weight. + * The price of variant after reaching the minimum quanity. */ - public WeightUnit getWeightUnit() { - return (WeightUnit) get("weightUnit"); + public MoneyV2 getPrice() { + return (MoneyV2) get("price"); } - public ProductVariant setWeightUnit(WeightUnit arg) { - optimisticData.put(getKey("weightUnit"), arg); + public QuantityPriceBreak setPrice(MoneyV2 arg) { + optimisticData.put(getKey("price"), 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 "minimumQuantity": return false; 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 "taxable": return false; - - case "title": return false; - - case "unitPrice": return true; - - case "unitPriceMeasurement": return true; - - case "weight": return false; - - case "weightUnit": return false; - default: return false; } } } - public interface ProductVariantConnectionQueryDefinition { - void define(ProductVariantConnectionQuery _queryBuilder); + public interface QuantityPriceBreakConnectionQueryDefinition { + void define(QuantityPriceBreakConnectionQuery _queryBuilder); } /** - * An auto-generated type for paginating through multiple ProductVariants. + * An auto-generated type for paginating through multiple QuantityPriceBreaks. */ - public static class ProductVariantConnectionQuery extends Query { - ProductVariantConnectionQuery(StringBuilder _queryBuilder) { + public static class QuantityPriceBreakConnectionQuery extends Query { + QuantityPriceBreakConnectionQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A list of edges. */ - public ProductVariantConnectionQuery edges(ProductVariantEdgeQueryDefinition queryDef) { + public QuantityPriceBreakConnectionQuery edges(QuantityPriceBreakEdgeQueryDefinition queryDef) { startField("edges"); _queryBuilder.append('{'); - queryDef.define(new ProductVariantEdgeQuery(_queryBuilder)); + queryDef.define(new QuantityPriceBreakEdgeQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * A list of the nodes contained in ProductVariantEdge. + * A list of the nodes contained in QuantityPriceBreakEdge. */ - public ProductVariantConnectionQuery nodes(ProductVariantQueryDefinition queryDef) { + public QuantityPriceBreakConnectionQuery nodes(QuantityPriceBreakQueryDefinition queryDef) { startField("nodes"); _queryBuilder.append('{'); - queryDef.define(new ProductVariantQuery(_queryBuilder)); + queryDef.define(new QuantityPriceBreakQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -60962,7 +63491,7 @@ public ProductVariantConnectionQuery nodes(ProductVariantQueryDefinition queryDe /** * Information to aid in pagination. */ - public ProductVariantConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { + public QuantityPriceBreakConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { startField("pageInfo"); _queryBuilder.append('{'); @@ -60974,21 +63503,21 @@ public ProductVariantConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) } /** - * An auto-generated type for paginating through multiple ProductVariants. + * An auto-generated type for paginating through multiple QuantityPriceBreaks. */ - public static class ProductVariantConnection extends AbstractResponse { - public ProductVariantConnection() { + public static class QuantityPriceBreakConnection extends AbstractResponse { + public QuantityPriceBreakConnection() { } - public ProductVariantConnection(JsonObject fields) throws SchemaViolationError { + public QuantityPriceBreakConnection(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { case "edges": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ProductVariantEdge(jsonAsObject(element1, key))); + list1.add(new QuantityPriceBreakEdge(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -60997,9 +63526,9 @@ public ProductVariantConnection(JsonObject fields) throws SchemaViolationError { } case "nodes": { - List list1 = new ArrayList<>(); + List list1 = new ArrayList<>(); for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ProductVariant(jsonAsObject(element1, key))); + list1.add(new QuantityPriceBreak(jsonAsObject(element1, key))); } responseData.put(key, list1); @@ -61025,31 +63554,31 @@ public ProductVariantConnection(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "ProductVariantConnection"; + return "QuantityPriceBreakConnection"; } /** * A list of edges. */ - public List getEdges() { - return (List) get("edges"); + public List getEdges() { + return (List) get("edges"); } - public ProductVariantConnection setEdges(List arg) { + public QuantityPriceBreakConnection setEdges(List arg) { optimisticData.put(getKey("edges"), arg); return this; } /** - * A list of the nodes contained in ProductVariantEdge. + * A list of the nodes contained in QuantityPriceBreakEdge. */ - public List getNodes() { - return (List) get("nodes"); + public List getNodes() { + return (List) get("nodes"); } - public ProductVariantConnection setNodes(List arg) { + public QuantityPriceBreakConnection setNodes(List arg) { optimisticData.put(getKey("nodes"), arg); return this; } @@ -61062,7 +63591,7 @@ public PageInfo getPageInfo() { return (PageInfo) get("pageInfo"); } - public ProductVariantConnection setPageInfo(PageInfo arg) { + public QuantityPriceBreakConnection setPageInfo(PageInfo arg) { optimisticData.put(getKey("pageInfo"), arg); return this; } @@ -61080,35 +63609,35 @@ public boolean unwrapsToObject(String key) { } } - public interface ProductVariantEdgeQueryDefinition { - void define(ProductVariantEdgeQuery _queryBuilder); + public interface QuantityPriceBreakEdgeQueryDefinition { + void define(QuantityPriceBreakEdgeQuery _queryBuilder); } /** - * An auto-generated type which holds one ProductVariant and a cursor during pagination. + * An auto-generated type which holds one QuantityPriceBreak and a cursor during pagination. */ - public static class ProductVariantEdgeQuery extends Query { - ProductVariantEdgeQuery(StringBuilder _queryBuilder) { + public static class QuantityPriceBreakEdgeQuery extends Query { + QuantityPriceBreakEdgeQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** * A cursor for use in pagination. */ - public ProductVariantEdgeQuery cursor() { + public QuantityPriceBreakEdgeQuery cursor() { startField("cursor"); return this; } /** - * The item at the end of ProductVariantEdge. + * The item at the end of QuantityPriceBreakEdge. */ - public ProductVariantEdgeQuery node(ProductVariantQueryDefinition queryDef) { + public QuantityPriceBreakEdgeQuery node(QuantityPriceBreakQueryDefinition queryDef) { startField("node"); _queryBuilder.append('{'); - queryDef.define(new ProductVariantQuery(_queryBuilder)); + queryDef.define(new QuantityPriceBreakQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -61116,13 +63645,13 @@ public ProductVariantEdgeQuery node(ProductVariantQueryDefinition queryDef) { } /** - * An auto-generated type which holds one ProductVariant and a cursor during pagination. + * An auto-generated type which holds one QuantityPriceBreak and a cursor during pagination. */ - public static class ProductVariantEdge extends AbstractResponse { - public ProductVariantEdge() { + public static class QuantityPriceBreakEdge extends AbstractResponse { + public QuantityPriceBreakEdge() { } - public ProductVariantEdge(JsonObject fields) throws SchemaViolationError { + public QuantityPriceBreakEdge(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); @@ -61134,7 +63663,7 @@ public ProductVariantEdge(JsonObject fields) throws SchemaViolationError { } case "node": { - responseData.put(key, new ProductVariant(jsonAsObject(field.getValue(), key))); + responseData.put(key, new QuantityPriceBreak(jsonAsObject(field.getValue(), key))); break; } @@ -61151,7 +63680,7 @@ public ProductVariantEdge(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "ProductVariantEdge"; + return "QuantityPriceBreakEdge"; } /** @@ -61162,20 +63691,20 @@ public String getCursor() { return (String) get("cursor"); } - public ProductVariantEdge setCursor(String arg) { + public QuantityPriceBreakEdge setCursor(String arg) { optimisticData.put(getKey("cursor"), arg); return this; } /** - * The item at the end of ProductVariantEdge. + * The item at the end of QuantityPriceBreakEdge. */ - public ProductVariant getNode() { - return (ProductVariant) get("node"); + public QuantityPriceBreak getNode() { + return (QuantityPriceBreak) get("node"); } - public ProductVariantEdge setNode(ProductVariant arg) { + public QuantityPriceBreakEdge setNode(QuantityPriceBreak arg) { optimisticData.put(getKey("node"), arg); return this; } @@ -61191,94 +63720,158 @@ public boolean unwrapsToObject(String key) { } } + public interface QuantityRuleQueryDefinition { + void define(QuantityRuleQuery _queryBuilder); + } + /** - * The set of valid sort keys for the ProductVariant query. + * The quantity rule for the product variant in a given context. */ - public enum ProductVariantSortKeys { - /** - * Sort by the `id` value. - */ - ID, + public static class QuantityRuleQuery extends Query { + QuantityRuleQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } /** - * Sort by the `position` value. + * The value that specifies the quantity increment between minimum and maximum of the rule. + * Only quantities divisible by this value will be considered valid. + * The increment must be lower than or equal to the minimum and the maximum, and both minimum and + * maximum + * must be divisible by this value. */ - POSITION, + public QuantityRuleQuery increment() { + startField("increment"); - /** - * 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, + return this; + } /** - * Sort by the `sku` value. + * An optional value that defines the highest allowed quantity purchased by the customer. + * If defined, maximum must be lower than or equal to the minimum and must be a multiple of the + * increment. */ - SKU, + public QuantityRuleQuery maximum() { + startField("maximum"); + + return this; + } /** - * Sort by the `title` value. + * The value that defines the lowest allowed quantity purchased by the customer. + * The minimum must be a multiple of the quantity rule's increment. */ - TITLE, + public QuantityRuleQuery minimum() { + startField("minimum"); - UNKNOWN_VALUE; + return this; + } + } - public static ProductVariantSortKeys fromGraphQl(String value) { - if (value == null) { - return null; - } + /** + * The quantity rule for the product variant in a given context. + */ + public static class QuantityRule extends AbstractResponse { + public QuantityRule() { + } - switch (value) { - case "ID": { - return ID; - } + public QuantityRule(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "increment": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); - case "POSITION": { - return POSITION; - } + break; + } - case "RELEVANCE": { - return RELEVANCE; - } + case "maximum": { + Integer optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsInteger(field.getValue(), key); + } - case "SKU": { - return SKU; - } + responseData.put(key, optional1); - case "TITLE": { - return TITLE; - } + break; + } - default: { - return UNKNOWN_VALUE; + case "minimum": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } } } - public String toString() { - switch (this) { - case ID: { - return "ID"; - } - case POSITION: { - return "POSITION"; - } + public String getGraphQlTypeName() { + return "QuantityRule"; + } - case RELEVANCE: { - return "RELEVANCE"; - } + /** + * The value that specifies the quantity increment between minimum and maximum of the rule. + * Only quantities divisible by this value will be considered valid. + * The increment must be lower than or equal to the minimum and the maximum, and both minimum and + * maximum + * must be divisible by this value. + */ - case SKU: { - return "SKU"; - } + public Integer getIncrement() { + return (Integer) get("increment"); + } - case TITLE: { - return "TITLE"; - } + public QuantityRule setIncrement(Integer arg) { + optimisticData.put(getKey("increment"), arg); + return this; + } - default: { - return ""; - } + /** + * An optional value that defines the highest allowed quantity purchased by the customer. + * If defined, maximum must be lower than or equal to the minimum and must be a multiple of the + * increment. + */ + + public Integer getMaximum() { + return (Integer) get("maximum"); + } + + public QuantityRule setMaximum(Integer arg) { + optimisticData.put(getKey("maximum"), arg); + return this; + } + + /** + * The value that defines the lowest allowed quantity purchased by the customer. + * The minimum must be a multiple of the quantity rule's increment. + */ + + public Integer getMinimum() { + return (Integer) get("minimum"); + } + + public QuantityRule setMinimum(Integer arg) { + optimisticData.put(getKey("minimum"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "increment": return false; + + case "maximum": return false; + + case "minimum": return false; + + default: return false; } } } @@ -62978,7 +65571,7 @@ public SearchArguments types(List value) { } /** - * Specifies how unavailable products are displayed in the search results. + * Specifies how unavailable products or variants are displayed in the search results. */ public SearchArguments unavailableProducts(SearchUnavailableProductsType value) { if (value != null) { @@ -71574,6 +74167,127 @@ public boolean unwrapsToObject(String key) { } } + public interface SwatchQueryDefinition { + void define(SwatchQuery _queryBuilder); + } + + /** + * Color and image for visual representation. + */ + public static class SwatchQuery extends Query { + SwatchQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The swatch color. + */ + public SwatchQuery color() { + startField("color"); + + return this; + } + + /** + * The swatch image. + */ + public SwatchQuery image(MediaImageQueryDefinition queryDef) { + startField("image"); + + _queryBuilder.append('{'); + queryDef.define(new MediaImageQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * Color and image for visual representation. + */ + public static class Swatch extends AbstractResponse { + public Swatch() { + } + + public Swatch(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "color": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "image": { + 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()); + } + } + } + } + + public String getGraphQlTypeName() { + return "Swatch"; + } + + /** + * The swatch color. + */ + + public String getColor() { + return (String) get("color"); + } + + public Swatch setColor(String arg) { + optimisticData.put(getKey("color"), arg); + return this; + } + + /** + * The swatch image. + */ + + public MediaImage getImage() { + return (MediaImage) get("image"); + } + + public Swatch setImage(MediaImage arg) { + optimisticData.put(getKey("image"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "color": return false; + + case "image": return true; + + default: return false; + } + } + } + public static class TokenizedPaymentInputV3 implements Serializable { private MoneyInput paymentAmount; From 962246515f003faf0a8e45d0058fd5a0f207d668 Mon Sep 17 00:00:00 2001 From: Jonathan Baker Date: Tue, 2 Apr 2024 09:48:35 -0400 Subject: [PATCH 2/2] Version Bump: 17.0.0 --- MobileBuy/buy3/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MobileBuy/buy3/gradle.properties b/MobileBuy/buy3/gradle.properties index 99d59046..8729ff43 100644 --- a/MobileBuy/buy3/gradle.properties +++ b/MobileBuy/buy3/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=16.3.0 +VERSION_NAME=17.0.0 POM_ARTIFACT_ID=buy3 POM_GROUP_ID=com.shopify.mobilebuysdk