diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4799c40a..7f223918 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: echo "API_VERSION=$API_VERSION" >> $GITHUB_ENV - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: true @@ -23,9 +23,10 @@ jobs: uses: ruby/setup-ruby@v1 - name: Install JDK 1.8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 1.8 + java-version: 8 + distribution: temurin server-id: github # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file @@ -51,7 +52,7 @@ jobs: git commit -m "Update schema (auto-generated)" git push --set-upstream --force origin "$API_VERSION-auto-generated" - - uses: actions/github-script@0.9.0 + - uses: actions/github-script@v7 with: script: | const today = new Date(); diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index a161a892..9f65f382 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -15,7 +15,7 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: true @@ -23,9 +23,10 @@ jobs: uses: ruby/setup-ruby@v1 - name: Install JDK 1.8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 1.8 + java-version: 8 + distribution: temurin - name: Publish Package working-directory: ./MobileBuy diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54b1ccec..89644567 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,10 +9,10 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Create Draft Release - uses: actions/github-script@0.9.0 + uses: actions/github-script@v7 with: script: | const today = new Date(); @@ -20,7 +20,7 @@ jobs: const mm = String(today.getMonth() + 1).padStart(2, '0'); const api_version = yyyy + '-' + mm; const notes = `Updates the Mobile Buy SDK for Android with support for the \`${api_version}\` version of the Shopify Storefront API.\n\nFor more details about the changes, please see the [release notes](https://shopify.dev/api/release-notes/${api_version}#graphql-storefront-api-changes).` - github.repos.createRelease({ + github.rest.repos.createRelease({ owner: context.repo.owner, repo: context.repo.repo, name: `X.X.X [${api_version}]`, diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7c14bd5f..f05023c3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,7 +14,7 @@ jobs: echo "API_VERSION=$API_VERSION" >> $GITHUB_ENV - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: true @@ -22,9 +22,10 @@ jobs: uses: ruby/setup-ruby@v1 - name: Install JDK 1.8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 1.8 + java-version: 8 + distribution: temurin server-id: github # Value of the distributionManagement/repository/id field of the pom.xml settings-path: ${{ github.workspace }} # location for the settings.xml file diff --git a/MobileBuy/buy3/gradle.properties b/MobileBuy/buy3/gradle.properties index 4debe90d..757d256c 100644 --- a/MobileBuy/buy3/gradle.properties +++ b/MobileBuy/buy3/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=18.0.0 +VERSION_NAME=18.1.0 POM_ARTIFACT_ID=buy3 POM_GROUP_ID=com.shopify.mobilebuysdk diff --git a/MobileBuy/buy3/src/main/java/com/shopify/buy3/Storefront.java b/MobileBuy/buy3/src/main/java/com/shopify/buy3/Storefront.java index d4360559..a693601e 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-07"; + public static final String API_VERSION = "2024-10"; public static QueryRootQuery query(QueryRootQueryDefinition queryDef) { return query(Collections.emptyList(), queryDef); @@ -1231,8 +1231,13 @@ public ArticleQuery title() { } /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * URL parameters to be added to a page URL to track the origin of on-site search traffic for + * [analytics + * reporting](https://help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/defaul + * t-reports/behaviour-reports). Returns a result when accessed through the + * [search](https://shopify.dev/docs/api/storefront/current/queries/search) or + * [predictiveSearch](https://shopify.dev/docs/api/storefront/current/queries/predictiveSearch) + * queries, otherwise returns null. */ public ArticleQuery trackingParameters() { startField("trackingParameters"); @@ -1675,8 +1680,13 @@ public Article setTitle(String arg) { } /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * URL parameters to be added to a page URL to track the origin of on-site search traffic for + * [analytics + * reporting](https://help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/defaul + * t-reports/behaviour-reports). Returns a result when accessed through the + * [search](https://shopify.dev/docs/api/storefront/current/queries/search) or + * [predictiveSearch](https://shopify.dev/docs/api/storefront/current/queries/predictiveSearch) + * queries, otherwise returns null. */ public String getTrackingParameters() { @@ -2328,7 +2338,7 @@ public interface AttributeQueryDefinition { } /** - * Represents a generic custom attribute. + * Represents a generic custom attribute, such as whether an order is a customer's first. */ public static class AttributeQuery extends Query { AttributeQuery(StringBuilder _queryBuilder) { @@ -2336,7 +2346,7 @@ public static class AttributeQuery extends Query { } /** - * Key or name of the attribute. + * The key or name of the attribute. For example, `"customersFirstOrder"`. */ public AttributeQuery key() { startField("key"); @@ -2345,7 +2355,7 @@ public AttributeQuery key() { } /** - * Value of the attribute. + * The value of the attribute. For example, `"true"`. */ public AttributeQuery value() { startField("value"); @@ -2355,7 +2365,7 @@ public AttributeQuery value() { } /** - * Represents a generic custom attribute. + * Represents a generic custom attribute, such as whether an order is a customer's first. */ public static class Attribute extends AbstractResponse { public Attribute() { @@ -2399,7 +2409,7 @@ public String getGraphQlTypeName() { } /** - * Key or name of the attribute. + * The key or name of the attribute. For example, `"customersFirstOrder"`. */ public String getKey() { @@ -2412,7 +2422,7 @@ public Attribute setKey(String arg) { } /** - * Value of the attribute. + * The value of the attribute. For example, `"true"`. */ public String getValue() { @@ -5944,6 +5954,19 @@ public CartAttributesUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition return this; } + + /** + * A list of warnings that occurred during the mutation. + */ + public CartAttributesUpdatePayloadQuery warnings(CartWarningQueryDefinition queryDef) { + startField("warnings"); + + _queryBuilder.append('{'); + queryDef.define(new CartWarningQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } } /** @@ -5980,6 +6003,17 @@ public CartAttributesUpdatePayload(JsonObject fields) throws SchemaViolationErro break; } + case "warnings": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartWarning(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -6021,12 +6055,27 @@ public CartAttributesUpdatePayload setUserErrors(List arg) { return this; } + /** + * A list of warnings that occurred during the mutation. + */ + + public List getWarnings() { + return (List) get("warnings"); + } + + public CartAttributesUpdatePayload setWarnings(List arg) { + optimisticData.put(getKey("warnings"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "cart": return true; case "userErrors": return true; + case "warnings": return true; + default: return false; } } @@ -6210,6 +6259,19 @@ public CartBillingAddressUpdatePayloadQuery userErrors(CartUserErrorQueryDefinit return this; } + + /** + * A list of warnings that occurred during the mutation. + */ + public CartBillingAddressUpdatePayloadQuery warnings(CartWarningQueryDefinition queryDef) { + startField("warnings"); + + _queryBuilder.append('{'); + queryDef.define(new CartWarningQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } } /** @@ -6246,6 +6308,17 @@ public CartBillingAddressUpdatePayload(JsonObject fields) throws SchemaViolation break; } + case "warnings": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartWarning(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -6287,12 +6360,27 @@ public CartBillingAddressUpdatePayload setUserErrors(List arg) { return this; } + /** + * A list of warnings that occurred during the mutation. + */ + + public List getWarnings() { + return (List) get("warnings"); + } + + public CartBillingAddressUpdatePayload setWarnings(List arg) { + optimisticData.put(getKey("warnings"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "cart": return true; case "userErrors": return true; + case "warnings": return true; + default: return false; } } @@ -6907,6 +6995,19 @@ public CartBuyerIdentityUpdatePayloadQuery userErrors(CartUserErrorQueryDefiniti return this; } + + /** + * A list of warnings that occurred during the mutation. + */ + public CartBuyerIdentityUpdatePayloadQuery warnings(CartWarningQueryDefinition queryDef) { + startField("warnings"); + + _queryBuilder.append('{'); + queryDef.define(new CartWarningQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } } /** @@ -6943,6 +7044,17 @@ public CartBuyerIdentityUpdatePayload(JsonObject fields) throws SchemaViolationE break; } + case "warnings": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartWarning(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -6984,12 +7096,27 @@ public CartBuyerIdentityUpdatePayload setUserErrors(List arg) { return this; } + /** + * A list of warnings that occurred during the mutation. + */ + + public List getWarnings() { + return (List) get("warnings"); + } + + public CartBuyerIdentityUpdatePayload setWarnings(List arg) { + optimisticData.put(getKey("warnings"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "cart": return true; case "userErrors": return true; + case "warnings": return true; + default: return false; } } @@ -8264,6 +8391,19 @@ public CartCreatePayloadQuery userErrors(CartUserErrorQueryDefinition queryDef) return this; } + + /** + * A list of warnings that occurred during the mutation. + */ + public CartCreatePayloadQuery warnings(CartWarningQueryDefinition queryDef) { + startField("warnings"); + + _queryBuilder.append('{'); + queryDef.define(new CartWarningQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } } /** @@ -8300,6 +8440,17 @@ public CartCreatePayload(JsonObject fields) throws SchemaViolationError { break; } + case "warnings": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartWarning(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -8341,12 +8492,27 @@ public CartCreatePayload setUserErrors(List arg) { return this; } + /** + * A list of warnings that occurred during the mutation. + */ + + public List getWarnings() { + return (List) get("warnings"); + } + + public CartCreatePayload setWarnings(List arg) { + optimisticData.put(getKey("warnings"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "cart": return true; case "userErrors": return true; + case "warnings": return true; + default: return false; } } @@ -9771,7 +9937,7 @@ public static class CartDeliveryPreferenceInput implements Serializable { private Input> pickupHandle = Input.undefined(); - private Input> coordinates = Input.undefined(); + private Input coordinates = Input.undefined(); public List getDeliveryMethod() { return deliveryMethod.getValue(); @@ -9815,20 +9981,20 @@ public CartDeliveryPreferenceInput setPickupHandleInput(Input> pick return this; } - public List getCoordinates() { + public CartDeliveryCoordinatesPreferenceInput getCoordinates() { return coordinates.getValue(); } - public Input> getCoordinatesInput() { + public Input getCoordinatesInput() { return coordinates; } - public CartDeliveryPreferenceInput setCoordinates(List coordinates) { + public CartDeliveryPreferenceInput setCoordinates(CartDeliveryCoordinatesPreferenceInput coordinates) { this.coordinates = Input.optional(coordinates); return this; } - public CartDeliveryPreferenceInput setCoordinatesInput(Input> coordinates) { + public CartDeliveryPreferenceInput setCoordinatesInput(Input coordinates) { if (coordinates == null) { throw new IllegalArgumentException("Input can not be null"); } @@ -9885,16 +10051,7 @@ public void appendTo(StringBuilder _queryBuilder) { separator = ","; _queryBuilder.append("coordinates:"); if (coordinates.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (CartDeliveryCoordinatesPreferenceInput item1 : coordinates.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); + coordinates.getValue().appendTo(_queryBuilder); } else { _queryBuilder.append("null"); } @@ -10292,6 +10449,19 @@ public CartDiscountCodesUpdatePayloadQuery userErrors(CartUserErrorQueryDefiniti return this; } + + /** + * A list of warnings that occurred during the mutation. + */ + public CartDiscountCodesUpdatePayloadQuery warnings(CartWarningQueryDefinition queryDef) { + startField("warnings"); + + _queryBuilder.append('{'); + queryDef.define(new CartWarningQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } } /** @@ -10328,6 +10498,17 @@ public CartDiscountCodesUpdatePayload(JsonObject fields) throws SchemaViolationE break; } + case "warnings": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartWarning(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -10369,12 +10550,27 @@ public CartDiscountCodesUpdatePayload setUserErrors(List arg) { return this; } + /** + * A list of warnings that occurred during the mutation. + */ + + public List getWarnings() { + return (List) get("warnings"); + } + + public CartDiscountCodesUpdatePayload setWarnings(List arg) { + optimisticData.put(getKey("warnings"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "cart": return true; case "userErrors": return true; + case "warnings": return true; + default: return false; } } @@ -11086,6 +11282,19 @@ public CartGiftCardCodesUpdatePayloadQuery userErrors(CartUserErrorQueryDefiniti return this; } + + /** + * A list of warnings that occurred during the mutation. + */ + public CartGiftCardCodesUpdatePayloadQuery warnings(CartWarningQueryDefinition queryDef) { + startField("warnings"); + + _queryBuilder.append('{'); + queryDef.define(new CartWarningQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } } /** @@ -11122,6 +11331,17 @@ public CartGiftCardCodesUpdatePayload(JsonObject fields) throws SchemaViolationE break; } + case "warnings": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartWarning(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -11163,12 +11383,27 @@ public CartGiftCardCodesUpdatePayload setUserErrors(List arg) { return this; } + /** + * A list of warnings that occurred during the mutation. + */ + + public List getWarnings() { + return (List) get("warnings"); + } + + public CartGiftCardCodesUpdatePayload setWarnings(List arg) { + optimisticData.put(getKey("warnings"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "cart": return true; case "userErrors": return true; + case "warnings": return true; + default: return false; } } @@ -12632,6 +12867,19 @@ public CartLinesAddPayloadQuery userErrors(CartUserErrorQueryDefinition queryDef return this; } + + /** + * A list of warnings that occurred during the mutation. + */ + public CartLinesAddPayloadQuery warnings(CartWarningQueryDefinition queryDef) { + startField("warnings"); + + _queryBuilder.append('{'); + queryDef.define(new CartWarningQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } } /** @@ -12668,6 +12916,17 @@ public CartLinesAddPayload(JsonObject fields) throws SchemaViolationError { break; } + case "warnings": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartWarning(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -12709,12 +12968,27 @@ public CartLinesAddPayload setUserErrors(List arg) { return this; } + /** + * A list of warnings that occurred during the mutation. + */ + + public List getWarnings() { + return (List) get("warnings"); + } + + public CartLinesAddPayload setWarnings(List arg) { + optimisticData.put(getKey("warnings"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "cart": return true; case "userErrors": return true; + case "warnings": return true; + default: return false; } } @@ -12757,6 +13031,19 @@ public CartLinesRemovePayloadQuery userErrors(CartUserErrorQueryDefinition query return this; } + + /** + * A list of warnings that occurred during the mutation. + */ + public CartLinesRemovePayloadQuery warnings(CartWarningQueryDefinition queryDef) { + startField("warnings"); + + _queryBuilder.append('{'); + queryDef.define(new CartWarningQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } } /** @@ -12793,6 +13080,17 @@ public CartLinesRemovePayload(JsonObject fields) throws SchemaViolationError { break; } + case "warnings": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartWarning(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -12834,12 +13132,27 @@ public CartLinesRemovePayload setUserErrors(List arg) { return this; } + /** + * A list of warnings that occurred during the mutation. + */ + + public List getWarnings() { + return (List) get("warnings"); + } + + public CartLinesRemovePayload setWarnings(List arg) { + optimisticData.put(getKey("warnings"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "cart": return true; case "userErrors": return true; + case "warnings": return true; + default: return false; } } @@ -12882,6 +13195,19 @@ public CartLinesUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition query return this; } + + /** + * A list of warnings that occurred during the mutation. + */ + public CartLinesUpdatePayloadQuery warnings(CartWarningQueryDefinition queryDef) { + startField("warnings"); + + _queryBuilder.append('{'); + queryDef.define(new CartWarningQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } } /** @@ -12918,6 +13244,17 @@ public CartLinesUpdatePayload(JsonObject fields) throws SchemaViolationError { break; } + case "warnings": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartWarning(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -12959,12 +13296,27 @@ public CartLinesUpdatePayload setUserErrors(List arg) { return this; } + /** + * A list of warnings that occurred during the mutation. + */ + + public List getWarnings() { + return (List) get("warnings"); + } + + public CartLinesUpdatePayload setWarnings(List arg) { + optimisticData.put(getKey("warnings"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "cart": return true; case "userErrors": return true; + case "warnings": return true; + default: return false; } } @@ -13388,6 +13740,19 @@ public CartNoteUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition queryD return this; } + + /** + * A list of warnings that occurred during the mutation. + */ + public CartNoteUpdatePayloadQuery warnings(CartWarningQueryDefinition queryDef) { + startField("warnings"); + + _queryBuilder.append('{'); + queryDef.define(new CartWarningQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } } /** @@ -13424,6 +13789,17 @@ public CartNoteUpdatePayload(JsonObject fields) throws SchemaViolationError { break; } + case "warnings": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartWarning(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -13465,12 +13841,27 @@ public CartNoteUpdatePayload setUserErrors(List arg) { return this; } + /** + * A list of warnings that occurred during the mutation. + */ + + public List getWarnings() { + return (List) get("warnings"); + } + + public CartNoteUpdatePayload setWarnings(List arg) { + optimisticData.put(getKey("warnings"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "cart": return true; case "userErrors": return true; + case "warnings": return true; + default: return false; } } @@ -13678,6 +14069,19 @@ public CartPaymentUpdatePayloadQuery userErrors(CartUserErrorQueryDefinition que return this; } + + /** + * A list of warnings that occurred during the mutation. + */ + public CartPaymentUpdatePayloadQuery warnings(CartWarningQueryDefinition queryDef) { + startField("warnings"); + + _queryBuilder.append('{'); + queryDef.define(new CartWarningQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } } /** @@ -13714,6 +14118,17 @@ public CartPaymentUpdatePayload(JsonObject fields) throws SchemaViolationError { break; } + case "warnings": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartWarning(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -13755,12 +14170,27 @@ public CartPaymentUpdatePayload setUserErrors(List arg) { return this; } + /** + * A list of warnings that occurred during the mutation. + */ + + public List getWarnings() { + return (List) get("warnings"); + } + + public CartPaymentUpdatePayload setWarnings(List arg) { + optimisticData.put(getKey("warnings"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "cart": return true; case "userErrors": return true; + case "warnings": return true; + default: return false; } } @@ -13899,24 +14329,24 @@ public boolean unwrapsToObject(String key) { } public static class CartPreferencesInput implements Serializable { - private Input> delivery = Input.undefined(); + private Input delivery = Input.undefined(); private Input> wallet = Input.undefined(); - public List getDelivery() { + public CartDeliveryPreferenceInput getDelivery() { return delivery.getValue(); } - public Input> getDeliveryInput() { + public Input getDeliveryInput() { return delivery; } - public CartPreferencesInput setDelivery(List delivery) { + public CartPreferencesInput setDelivery(CartDeliveryPreferenceInput delivery) { this.delivery = Input.optional(delivery); return this; } - public CartPreferencesInput setDeliveryInput(Input> delivery) { + public CartPreferencesInput setDeliveryInput(Input delivery) { if (delivery == null) { throw new IllegalArgumentException("Input can not be null"); } @@ -13954,16 +14384,7 @@ public void appendTo(StringBuilder _queryBuilder) { separator = ","; _queryBuilder.append("delivery:"); if (delivery.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (CartDeliveryPreferenceInput item1 : delivery.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); + delivery.getValue().appendTo(_queryBuilder); } else { _queryBuilder.append("null"); } @@ -14077,6 +14498,19 @@ public CartSelectedDeliveryOptionsUpdatePayloadQuery userErrors(CartUserErrorQue return this; } + + /** + * A list of warnings that occurred during the mutation. + */ + public CartSelectedDeliveryOptionsUpdatePayloadQuery warnings(CartWarningQueryDefinition queryDef) { + startField("warnings"); + + _queryBuilder.append('{'); + queryDef.define(new CartWarningQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } } /** @@ -14113,6 +14547,17 @@ public CartSelectedDeliveryOptionsUpdatePayload(JsonObject fields) throws Schema break; } + case "warnings": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new CartWarning(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -14154,12 +14599,27 @@ public CartSelectedDeliveryOptionsUpdatePayload setUserErrors(List getWarnings() { + return (List) get("warnings"); + } + + public CartSelectedDeliveryOptionsUpdatePayload setWarnings(List arg) { + optimisticData.put(getKey("warnings"), arg); + return this; + } + public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { case "cart": return true; case "userErrors": return true; + case "warnings": return true; + default: return false; } } @@ -14625,6 +15085,208 @@ public void appendTo(StringBuilder _queryBuilder) { } } + public interface CartWarningQueryDefinition { + void define(CartWarningQuery _queryBuilder); + } + + /** + * A warning that occurred during a cart mutation. + */ + public static class CartWarningQuery extends Query { + CartWarningQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The code of the warning. + */ + public CartWarningQuery code() { + startField("code"); + + return this; + } + + /** + * The message text of the warning. + */ + public CartWarningQuery message() { + startField("message"); + + return this; + } + + /** + * The target of the warning. + */ + public CartWarningQuery target() { + startField("target"); + + return this; + } + } + + /** + * A warning that occurred during a cart mutation. + */ + public static class CartWarning extends AbstractResponse { + public CartWarning() { + } + + public CartWarning(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, CartWarningCode.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "message": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "target": { + responseData.put(key, new ID(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 "CartWarning"; + } + + /** + * The code of the warning. + */ + + public CartWarningCode getCode() { + return (CartWarningCode) get("code"); + } + + public CartWarning setCode(CartWarningCode arg) { + optimisticData.put(getKey("code"), arg); + return this; + } + + /** + * The message text of the warning. + */ + + public String getMessage() { + return (String) get("message"); + } + + public CartWarning setMessage(String arg) { + optimisticData.put(getKey("message"), arg); + return this; + } + + /** + * The target of the warning. + */ + + public ID getTarget() { + return (ID) get("target"); + } + + public CartWarning setTarget(ID arg) { + optimisticData.put(getKey("target"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "code": return false; + + case "message": return false; + + case "target": return false; + + default: return false; + } + } + } + + /** + * The code for the cart warning. + */ + public enum CartWarningCode { + /** + * The merchandise does not have enough stock. + */ + MERCHANDISE_NOT_ENOUGH_STOCK, + + /** + * The merchandise is out of stock. + */ + MERCHANDISE_OUT_OF_STOCK, + + /** + * Gift cards are not available as a payment method. + */ + PAYMENTS_GIFT_CARDS_UNAVAILABLE, + + UNKNOWN_VALUE; + + public static CartWarningCode fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "MERCHANDISE_NOT_ENOUGH_STOCK": { + return MERCHANDISE_NOT_ENOUGH_STOCK; + } + + case "MERCHANDISE_OUT_OF_STOCK": { + return MERCHANDISE_OUT_OF_STOCK; + } + + case "PAYMENTS_GIFT_CARDS_UNAVAILABLE": { + return PAYMENTS_GIFT_CARDS_UNAVAILABLE; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case MERCHANDISE_NOT_ENOUGH_STOCK: { + return "MERCHANDISE_NOT_ENOUGH_STOCK"; + } + + case MERCHANDISE_OUT_OF_STOCK: { + return "MERCHANDISE_OUT_OF_STOCK"; + } + + case PAYMENTS_GIFT_CARDS_UNAVAILABLE: { + return "PAYMENTS_GIFT_CARDS_UNAVAILABLE"; + } + + default: { + return ""; + } + } + } + } + public interface CollectionQueryDefinition { void define(CollectionQuery _queryBuilder); } @@ -14942,8 +15604,13 @@ public CollectionQuery title() { } /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * URL parameters to be added to a page URL to track the origin of on-site search traffic for + * [analytics + * reporting](https://help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/defaul + * t-reports/behaviour-reports). Returns a result when accessed through the + * [search](https://shopify.dev/docs/api/storefront/current/queries/search) or + * [predictiveSearch](https://shopify.dev/docs/api/storefront/current/queries/predictiveSearch) + * queries, otherwise returns null. */ public CollectionQuery trackingParameters() { startField("trackingParameters"); @@ -15243,8 +15910,13 @@ public Collection setTitle(String arg) { } /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * URL parameters to be added to a page URL to track the origin of on-site search traffic for + * [analytics + * reporting](https://help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/defaul + * t-reports/behaviour-reports). Returns a result when accessed through the + * [search](https://shopify.dev/docs/api/storefront/current/queries/search) or + * [predictiveSearch](https://shopify.dev/docs/api/storefront/current/queries/predictiveSearch) + * queries, otherwise returns null. */ public String getTrackingParameters() { @@ -17918,6 +18590,165 @@ public boolean unwrapsToObject(String key) { } } + public interface CountQueryDefinition { + void define(CountQuery _queryBuilder); + } + + /** + * Details for count of elements. + */ + public static class CountQuery extends Query { + CountQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * Count of elements. + */ + public CountQuery count() { + startField("count"); + + return this; + } + + /** + * Precision of count, how exact is the value. + */ + public CountQuery precision() { + startField("precision"); + + return this; + } + } + + /** + * Details for count of elements. + */ + public static class Count extends AbstractResponse { + public Count() { + } + + public Count(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "count": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); + + break; + } + + case "precision": { + responseData.put(key, CountPrecision.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 "Count"; + } + + /** + * Count of elements. + */ + + public Integer getCount() { + return (Integer) get("count"); + } + + public Count setCount(Integer arg) { + optimisticData.put(getKey("count"), arg); + return this; + } + + /** + * Precision of count, how exact is the value. + */ + + public CountPrecision getPrecision() { + return (CountPrecision) get("precision"); + } + + public Count setPrecision(CountPrecision arg) { + optimisticData.put(getKey("precision"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "count": return false; + + case "precision": return false; + + default: return false; + } + } + } + + /** + * The precision of the value returned by a count field. + */ + public enum CountPrecision { + /** + * The count is at least the value. A limit was reached. + */ + AT_LEAST, + + /** + * The count is exactly the value. + */ + EXACT, + + UNKNOWN_VALUE; + + public static CountPrecision fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "AT_LEAST": { + return AT_LEAST; + } + + case "EXACT": { + return EXACT; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case AT_LEAST: { + return "AT_LEAST"; + } + + case EXACT: { + return "EXACT"; + } + + default: { + return ""; + } + } + } + } + public interface CountryQueryDefinition { void define(CountryQuery _queryBuilder); } @@ -33483,7 +34314,7 @@ public boolean unwrapsToObject(String key) { } /** - * ISO 639-1 language codes supported by Shopify. + * Language codes supported by Shopify. */ public enum LanguageCode { /** @@ -40324,6 +41155,11 @@ public enum MenuItemType { */ COLLECTIONS, + /** + * A customer account page link. + */ + CUSTOMER_ACCOUNT_PAGE, + /** * A frontpage link. */ @@ -40387,6 +41223,10 @@ public static MenuItemType fromGraphQl(String value) { return COLLECTIONS; } + case "CUSTOMER_ACCOUNT_PAGE": { + return CUSTOMER_ACCOUNT_PAGE; + } + case "FRONTPAGE": { return FRONTPAGE; } @@ -40442,6 +41282,10 @@ public String toString() { return "COLLECTIONS"; } + case CUSTOMER_ACCOUNT_PAGE: { + return "CUSTOMER_ACCOUNT_PAGE"; + } + case FRONTPAGE: { return "FRONTPAGE"; } @@ -44152,10 +44996,13 @@ public MutationQuery cartGiftCardCodesUpdate(ID cartId, List giftCardCod /** * Adds a merchandise line to the cart. */ - public MutationQuery cartLinesAdd(List lines, ID cartId, CartLinesAddPayloadQueryDefinition queryDef) { + public MutationQuery cartLinesAdd(ID cartId, List lines, CartLinesAddPayloadQueryDefinition queryDef) { startField("cartLinesAdd"); - _queryBuilder.append("(lines:"); + _queryBuilder.append("(cartId:"); + Query.appendQuotedString(_queryBuilder, cartId.toString()); + + _queryBuilder.append(",lines:"); _queryBuilder.append('['); { String listSeperator1 = ""; @@ -44167,9 +45014,6 @@ public MutationQuery cartLinesAdd(List lines, ID cartId, CartLine } _queryBuilder.append(']'); - _queryBuilder.append(",cartId:"); - Query.appendQuotedString(_queryBuilder, cartId.toString()); - _queryBuilder.append(')'); _queryBuilder.append('{'); @@ -45916,6 +46760,27 @@ public NodeQuery onShop(ShopQueryDefinition queryDef) { return this; } + public NodeQuery onShopPayInstallmentsFinancingPlan(ShopPayInstallmentsFinancingPlanQueryDefinition queryDef) { + startInlineFragment("ShopPayInstallmentsFinancingPlan"); + queryDef.define(new ShopPayInstallmentsFinancingPlanQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public NodeQuery onShopPayInstallmentsFinancingPlanTerm(ShopPayInstallmentsFinancingPlanTermQueryDefinition queryDef) { + startInlineFragment("ShopPayInstallmentsFinancingPlanTerm"); + queryDef.define(new ShopPayInstallmentsFinancingPlanTermQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public NodeQuery onShopPayInstallmentsProductVariantPricing(ShopPayInstallmentsProductVariantPricingQueryDefinition queryDef) { + startInlineFragment("ShopPayInstallmentsProductVariantPricing"); + queryDef.define(new ShopPayInstallmentsProductVariantPricingQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + public NodeQuery onShopPolicy(ShopPolicyQueryDefinition queryDef) { startInlineFragment("ShopPolicy"); queryDef.define(new ShopPolicyQuery(_queryBuilder)); @@ -45923,6 +46788,13 @@ public NodeQuery onShopPolicy(ShopPolicyQueryDefinition queryDef) { return this; } + public NodeQuery onTaxonomyCategory(TaxonomyCategoryQueryDefinition queryDef) { + startInlineFragment("TaxonomyCategory"); + queryDef.define(new TaxonomyCategoryQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + public NodeQuery onUrlRedirect(UrlRedirectQueryDefinition queryDef) { startInlineFragment("UrlRedirect"); queryDef.define(new UrlRedirectQuery(_queryBuilder)); @@ -46099,10 +46971,26 @@ public static Node create(JsonObject fields) throws SchemaViolationError { return new Shop(fields); } + case "ShopPayInstallmentsFinancingPlan": { + return new ShopPayInstallmentsFinancingPlan(fields); + } + + case "ShopPayInstallmentsFinancingPlanTerm": { + return new ShopPayInstallmentsFinancingPlanTerm(fields); + } + + case "ShopPayInstallmentsProductVariantPricing": { + return new ShopPayInstallmentsProductVariantPricing(fields); + } + case "ShopPolicy": { return new ShopPolicy(fields); } + case "TaxonomyCategory": { + return new TaxonomyCategory(fields); + } + case "UrlRedirect": { return new UrlRedirect(fields); } @@ -46436,7 +47324,8 @@ public OrderQuery currentTotalTax(MoneyV2QueryDefinition queryDef) { } /** - * A list of the custom attributes added to the order. + * A list of the custom attributes added to the order. For example, whether an order is a customer's + * first. */ public OrderQuery customAttributes(AttributeQueryDefinition queryDef) { startField("customAttributes"); @@ -47560,7 +48449,8 @@ public Order setCurrentTotalTax(MoneyV2 arg) { } /** - * A list of the custom attributes added to the order. + * A list of the custom attributes added to the order. For example, whether an order is a customer's + * first. */ public List getCustomAttributes() { @@ -49575,8 +50465,13 @@ public PageQuery title() { } /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * URL parameters to be added to a page URL to track the origin of on-site search traffic for + * [analytics + * reporting](https://help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/defaul + * t-reports/behaviour-reports). Returns a result when accessed through the + * [search](https://shopify.dev/docs/api/storefront/current/queries/search) or + * [predictiveSearch](https://shopify.dev/docs/api/storefront/current/queries/predictiveSearch) + * queries, otherwise returns null. */ public PageQuery trackingParameters() { startField("trackingParameters"); @@ -49856,8 +50751,13 @@ public Page setTitle(String arg) { } /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * URL parameters to be added to a page URL to track the origin of on-site search traffic for + * [analytics + * reporting](https://help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/defaul + * t-reports/behaviour-reports). Returns a result when accessed through the + * [search](https://shopify.dev/docs/api/storefront/current/queries/search) or + * [predictiveSearch](https://shopify.dev/docs/api/storefront/current/queries/predictiveSearch) + * queries, otherwise returns null. */ public String getTrackingParameters() { @@ -50445,6 +51345,124 @@ public String toString() { } } + public interface PaginatedSitemapResourcesQueryDefinition { + void define(PaginatedSitemapResourcesQuery _queryBuilder); + } + + /** + * Type for paginating through multiple sitemap's resources. + */ + public static class PaginatedSitemapResourcesQuery extends Query { + PaginatedSitemapResourcesQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * Whether there are more pages to fetch following the current page. + */ + public PaginatedSitemapResourcesQuery hasNextPage() { + startField("hasNextPage"); + + return this; + } + + /** + * List of sitemap resources for the current page. + * Note: The number of items varies between 0 and 250 per page. + */ + public PaginatedSitemapResourcesQuery items(SitemapResourceInterfaceQueryDefinition queryDef) { + startField("items"); + + _queryBuilder.append('{'); + queryDef.define(new SitemapResourceInterfaceQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + } + + /** + * Type for paginating through multiple sitemap's resources. + */ + public static class PaginatedSitemapResources extends AbstractResponse { + public PaginatedSitemapResources() { + } + + public PaginatedSitemapResources(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "hasNextPage": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); + + break; + } + + case "items": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(UnknownSitemapResourceInterface.create(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "PaginatedSitemapResources"; + } + + /** + * Whether there are more pages to fetch following the current page. + */ + + public Boolean getHasNextPage() { + return (Boolean) get("hasNextPage"); + } + + public PaginatedSitemapResources setHasNextPage(Boolean arg) { + optimisticData.put(getKey("hasNextPage"), arg); + return this; + } + + /** + * List of sitemap resources for the current page. + * Note: The number of items varies between 0 and 250 per page. + */ + + public List getItems() { + return (List) get("items"); + } + + public PaginatedSitemapResources setItems(List arg) { + optimisticData.put(getKey("items"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "hasNextPage": return false; + + case "items": return false; + + default: return false; + } + } + } + public interface PaymentSettingsQueryDefinition { void define(PaymentSettingsQuery _queryBuilder); } @@ -50458,7 +51476,7 @@ public static class PaymentSettingsQuery extends Query { } /** - * List of the card brands which the shop accepts. + * List of the card brands which the business entity accepts. */ public PaymentSettingsQuery acceptedCardBrands() { startField("acceptedCardBrands"); @@ -50476,7 +51494,8 @@ public PaymentSettingsQuery cardVaultUrl() { } /** - * The country where the shop is located. + * The country where the shop is located. When multiple business entities operate within the shop, then + * this will represent the country of the business entity that's serving the specified buyer context. */ public PaymentSettingsQuery countryCode() { startField("countryCode"); @@ -50513,7 +51532,7 @@ public PaymentSettingsQuery shopifyPaymentsAccountId() { } /** - * List of the digital wallets which the shop supports. + * List of the digital wallets which the business entity supports. */ public PaymentSettingsQuery supportedDigitalWallets() { startField("supportedDigitalWallets"); @@ -50612,7 +51631,7 @@ public String getGraphQlTypeName() { } /** - * List of the card brands which the shop accepts. + * List of the card brands which the business entity accepts. */ public List getAcceptedCardBrands() { @@ -50638,7 +51657,8 @@ public PaymentSettings setCardVaultUrl(String arg) { } /** - * The country where the shop is located. + * The country where the shop is located. When multiple business entities operate within the shop, then + * this will represent the country of the business entity that's serving the specified buyer context. */ public CountryCode getCountryCode() { @@ -50691,7 +51711,7 @@ public PaymentSettings setShopifyPaymentsAccountId(String arg) { } /** - * List of the digital wallets which the shop supports. + * List of the digital wallets which the business entity supports. */ public List getSupportedDigitalWallets() { @@ -51434,6 +52454,103 @@ public static class ProductQuery extends Query { startField("id"); } + public class AdjacentVariantsArguments extends Arguments { + AdjacentVariantsArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * The input fields used for a selected option. + * The input must not contain more than `250` values. + */ + public AdjacentVariantsArguments selectedOptions(List value) { + if (value != null) { + startArgument("selectedOptions"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (SelectedOptionInput item1 : value) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } + return this; + } + + /** + * Whether to ignore product options that are not present on the requested product. + */ + public AdjacentVariantsArguments ignoreUnknownOptions(Boolean value) { + if (value != null) { + startArgument("ignoreUnknownOptions"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Whether to perform case insensitive match on option names and values. + */ + public AdjacentVariantsArguments caseInsensitiveMatch(Boolean value) { + if (value != null) { + startArgument("caseInsensitiveMatch"); + _queryBuilder.append(value); + } + return this; + } + } + + public interface AdjacentVariantsArgumentsDefinition { + void define(AdjacentVariantsArguments args); + } + + /** + * A list of variants whose selected options differ with the provided selected options by one, ordered + * by variant id. + * If selected options are not provided, adjacent variants to the first available variant is returned. + * Note that this field returns an array of variants. In most cases, the number of variants in this + * array will be low. + * However, with a low number of options and a high number of values per option, the number of variants + * returned + * here can be high. In such cases, it recommended to avoid using this field. + * This list of variants can be used in combination with the `options` field to build a rich variant + * picker that + * includes variant availability or other variant information. + */ + public ProductQuery adjacentVariants(ProductVariantQueryDefinition queryDef) { + return adjacentVariants(args -> {}, queryDef); + } + + /** + * A list of variants whose selected options differ with the provided selected options by one, ordered + * by variant id. + * If selected options are not provided, adjacent variants to the first available variant is returned. + * Note that this field returns an array of variants. In most cases, the number of variants in this + * array will be low. + * However, with a low number of options and a high number of values per option, the number of variants + * returned + * here can be high. In such cases, it recommended to avoid using this field. + * This list of variants can be used in combination with the `options` field to build a rich variant + * picker that + * includes variant availability or other variant information. + */ + public ProductQuery adjacentVariants(AdjacentVariantsArgumentsDefinition argsDef, ProductVariantQueryDefinition queryDef) { + startField("adjacentVariants"); + + AdjacentVariantsArguments args = new AdjacentVariantsArguments(_queryBuilder); + argsDef.define(args); + AdjacentVariantsArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new ProductVariantQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + /** * Indicates if at least one product variant is available for sale. */ @@ -51443,6 +52560,19 @@ public ProductQuery availableForSale() { return this; } + /** + * The taxonomy category for the product. + */ + public ProductQuery category(TaxonomyCategoryQueryDefinition queryDef) { + startField("category"); + + _queryBuilder.append('{'); + queryDef.define(new TaxonomyCategoryQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + public class CollectionsArguments extends Arguments { CollectionsArguments(StringBuilder _queryBuilder) { super(_queryBuilder, true); @@ -51604,6 +52734,69 @@ public ProductQuery descriptionHtml() { return this; } + /** + * An encoded string containing all option value combinations + * with a corresponding variant that is currently available for sale. + * Integers represent option and values: + * [0,1] represents option_value at array index 0 for the option at array index 0 + * `:`, `,`, ` ` and `-` are control characters. + * `:` indicates a new option. ex: 0:1 indicates value 0 for the option in position 1, value 1 for the + * option in position 2. + * `,` indicates the end of a repeated prefix, mulitple consecutive commas indicate the end of multiple + * repeated prefixes. + * ` ` indicates a gap in the sequence of option values. ex: 0 4 indicates option values in position 0 + * and 4 are present. + * `-` indicates a continuous range of option values. ex: 0 1-3 4 + * Decoding process: + * Example options: [Size, Color, Material] + * Example values: [[Small, Medium, Large], [Red, Blue], [Cotton, Wool]] + * Example encoded string: "0:0:0,1:0-1,,1:0:0-1,1:1,,2:0:1,1:0,," + * Step 1: Expand ranges into the numbers they represent: "0:0:0,1:0 1,,1:0:0 1,1:1,,2:0:1,1:0,," + * Step 2: Expand repeated prefixes: "0:0:0,0:1:0 1,1:0:0 1,1:1:1,2:0:1,2:1:0," + * Step 3: Expand shared prefixes so data is encoded as a string: + * "0:0:0,0:1:0,0:1:1,1:0:0,1:0:1,1:1:1,2:0:1,2:1:0," + * Step 4: Map to options + option values to determine existing variants: + * [Small, Red, Cotton] (0:0:0), [Small, Blue, Cotton] (0:1:0), [Small, Blue, Wool] (0:1:1), + * [Medium, Red, Cotton] (1:0:0), [Medium, Red, Wool] (1:0:1), [Medium, Blue, Wool] (1:1:1), + * [Large, Red, Wool] (2:0:1), [Large, Blue, Cotton] (2:1:0). + */ + public ProductQuery encodedVariantAvailability() { + startField("encodedVariantAvailability"); + + return this; + } + + /** + * An encoded string containing all option value combinations with a corresponding variant. + * Integers represent option and values: + * [0,1] represents option_value at array index 0 for the option at array index 0 + * `:`, `,`, ` ` and `-` are control characters. + * `:` indicates a new option. ex: 0:1 indicates value 0 for the option in position 1, value 1 for the + * option in position 2. + * `,` indicates the end of a repeated prefix, mulitple consecutive commas indicate the end of multiple + * repeated prefixes. + * ` ` indicates a gap in the sequence of option values. ex: 0 4 indicates option values in position 0 + * and 4 are present. + * `-` indicates a continuous range of option values. ex: 0 1-3 4 + * Decoding process: + * Example options: [Size, Color, Material] + * Example values: [[Small, Medium, Large], [Red, Blue], [Cotton, Wool]] + * Example encoded string: "0:0:0,1:0-1,,1:0:0-1,1:1,,2:0:1,1:0,," + * Step 1: Expand ranges into the numbers they represent: "0:0:0,1:0 1,,1:0:0 1,1:1,,2:0:1,1:0,," + * Step 2: Expand repeated prefixes: "0:0:0,0:1:0 1,1:0:0 1,1:1:1,2:0:1,2:1:0," + * Step 3: Expand shared prefixes so data is encoded as a string: + * "0:0:0,0:1:0,0:1:1,1:0:0,1:0:1,1:1:1,2:0:1,2:1:0," + * Step 4: Map to options + option values to determine existing variants: + * [Small, Red, Cotton] (0:0:0), [Small, Blue, Cotton] (0:1:0), [Small, Blue, Wool] (0:1:1), + * [Medium, Red, Cotton] (1:0:0), [Medium, Red, Wool] (1:0:1), [Medium, Blue, Wool] (1:1:1), + * [Large, Red, Wool] (2:0:1), [Large, Blue, Cotton] (2:1:0). + */ + public ProductQuery encodedVariantExistence() { + startField("encodedVariantExistence"); + + return this; + } + /** * The featured image for the product. * This field is functionally equivalent to `images(first: 1)`. @@ -51913,8 +53106,8 @@ public ProductQuery metafields(List identifiers, Metafi } /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. + * The URL used for viewing the resource on the shop's Online Store. Returns + * `null` if the resource is currently not published to the Online Store sales channel. */ public ProductQuery onlineStoreUrl() { startField("onlineStoreUrl"); @@ -52007,6 +53200,89 @@ public ProductQuery requiresSellingPlan() { return this; } + public class SelectedOrFirstAvailableVariantArguments extends Arguments { + SelectedOrFirstAvailableVariantArguments(StringBuilder _queryBuilder) { + super(_queryBuilder, true); + } + + /** + * The input fields used for a selected option. + * The input must not contain more than `250` values. + */ + public SelectedOrFirstAvailableVariantArguments selectedOptions(List value) { + if (value != null) { + startArgument("selectedOptions"); + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (SelectedOptionInput item1 : value) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } + return this; + } + + /** + * Whether to ignore unknown product options. + */ + public SelectedOrFirstAvailableVariantArguments ignoreUnknownOptions(Boolean value) { + if (value != null) { + startArgument("ignoreUnknownOptions"); + _queryBuilder.append(value); + } + return this; + } + + /** + * Whether to perform case insensitive match on option names and values. + */ + public SelectedOrFirstAvailableVariantArguments caseInsensitiveMatch(Boolean value) { + if (value != null) { + startArgument("caseInsensitiveMatch"); + _queryBuilder.append(value); + } + return this; + } + } + + public interface SelectedOrFirstAvailableVariantArgumentsDefinition { + void define(SelectedOrFirstAvailableVariantArguments args); + } + + /** + * Find an active product variant based on selected options, availability or the first variant. + * All arguments are optional. If no selected options are provided, the first available variant is + * returned. + * If no variants are available, the first variant is returned. + */ + public ProductQuery selectedOrFirstAvailableVariant(ProductVariantQueryDefinition queryDef) { + return selectedOrFirstAvailableVariant(args -> {}, queryDef); + } + + /** + * Find an active product variant based on selected options, availability or the first variant. + * All arguments are optional. If no selected options are provided, the first available variant is + * returned. + * If no variants are available, the first variant is returned. + */ + public ProductQuery selectedOrFirstAvailableVariant(SelectedOrFirstAvailableVariantArgumentsDefinition argsDef, ProductVariantQueryDefinition queryDef) { + startField("selectedOrFirstAvailableVariant"); + + SelectedOrFirstAvailableVariantArguments args = new SelectedOrFirstAvailableVariantArguments(_queryBuilder); + argsDef.define(args); + SelectedOrFirstAvailableVariantArguments.end(args); + + _queryBuilder.append('{'); + queryDef.define(new ProductVariantQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + public class SellingPlanGroupsArguments extends Arguments { SellingPlanGroupsArguments(StringBuilder _queryBuilder) { super(_queryBuilder, true); @@ -52142,8 +53418,13 @@ public ProductQuery totalInventory() { } /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * URL parameters to be added to a page URL to track the origin of on-site search traffic for + * [analytics + * reporting](https://help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/defaul + * t-reports/behaviour-reports). Returns a result when accessed through the + * [search](https://shopify.dev/docs/api/storefront/current/queries/search) or + * [predictiveSearch](https://shopify.dev/docs/api/storefront/current/queries/predictiveSearch) + * queries, otherwise returns null. */ public ProductQuery trackingParameters() { startField("trackingParameters"); @@ -52335,6 +53616,19 @@ public ProductQuery variants(VariantsArgumentsDefinition argsDef, ProductVariant return this; } + /** + * The total count of variants for this product. + */ + public ProductQuery variantsCount(CountQueryDefinition queryDef) { + startField("variantsCount"); + + _queryBuilder.append('{'); + queryDef.define(new CountQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + /** * The product’s vendor name. */ @@ -52361,12 +53655,34 @@ public Product(JsonObject fields) throws SchemaViolationError { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { + case "adjacentVariants": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ProductVariant(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + case "availableForSale": { responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } + case "category": { + TaxonomyCategory optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new TaxonomyCategory(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + case "collections": { responseData.put(key, new CollectionConnection(jsonAsObject(field.getValue(), key))); @@ -52397,6 +53713,28 @@ public Product(JsonObject fields) throws SchemaViolationError { break; } + case "encodedVariantAvailability": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "encodedVariantExistence": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + case "featuredImage": { Image optional1 = null; if (!field.getValue().isJsonNull()) { @@ -52511,6 +53849,17 @@ public Product(JsonObject fields) throws SchemaViolationError { break; } + case "selectedOrFirstAvailableVariant": { + ProductVariant optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ProductVariant(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + case "sellingPlanGroups": { responseData.put(key, new SellingPlanGroupConnection(jsonAsObject(field.getValue(), key))); @@ -52585,6 +53934,17 @@ public Product(JsonObject fields) throws SchemaViolationError { break; } + case "variantsCount": { + Count optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Count(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + case "vendor": { responseData.put(key, jsonAsString(field.getValue(), key)); @@ -52611,6 +53971,29 @@ public String getGraphQlTypeName() { return "Product"; } + /** + * A list of variants whose selected options differ with the provided selected options by one, ordered + * by variant id. + * If selected options are not provided, adjacent variants to the first available variant is returned. + * Note that this field returns an array of variants. In most cases, the number of variants in this + * array will be low. + * However, with a low number of options and a high number of values per option, the number of variants + * returned + * here can be high. In such cases, it recommended to avoid using this field. + * This list of variants can be used in combination with the `options` field to build a rich variant + * picker that + * includes variant availability or other variant information. + */ + + public List getAdjacentVariants() { + return (List) get("adjacentVariants"); + } + + public Product setAdjacentVariants(List arg) { + optimisticData.put(getKey("adjacentVariants"), arg); + return this; + } + /** * Indicates if at least one product variant is available for sale. */ @@ -52624,6 +54007,19 @@ public Product setAvailableForSale(Boolean arg) { return this; } + /** + * The taxonomy category for the product. + */ + + public TaxonomyCategory getCategory() { + return (TaxonomyCategory) get("category"); + } + + public Product setCategory(TaxonomyCategory arg) { + optimisticData.put(getKey("category"), arg); + return this; + } + /** * List of collections a product belongs to. */ @@ -52689,6 +54085,77 @@ public Product setDescriptionHtml(String arg) { return this; } + /** + * An encoded string containing all option value combinations + * with a corresponding variant that is currently available for sale. + * Integers represent option and values: + * [0,1] represents option_value at array index 0 for the option at array index 0 + * `:`, `,`, ` ` and `-` are control characters. + * `:` indicates a new option. ex: 0:1 indicates value 0 for the option in position 1, value 1 for the + * option in position 2. + * `,` indicates the end of a repeated prefix, mulitple consecutive commas indicate the end of multiple + * repeated prefixes. + * ` ` indicates a gap in the sequence of option values. ex: 0 4 indicates option values in position 0 + * and 4 are present. + * `-` indicates a continuous range of option values. ex: 0 1-3 4 + * Decoding process: + * Example options: [Size, Color, Material] + * Example values: [[Small, Medium, Large], [Red, Blue], [Cotton, Wool]] + * Example encoded string: "0:0:0,1:0-1,,1:0:0-1,1:1,,2:0:1,1:0,," + * Step 1: Expand ranges into the numbers they represent: "0:0:0,1:0 1,,1:0:0 1,1:1,,2:0:1,1:0,," + * Step 2: Expand repeated prefixes: "0:0:0,0:1:0 1,1:0:0 1,1:1:1,2:0:1,2:1:0," + * Step 3: Expand shared prefixes so data is encoded as a string: + * "0:0:0,0:1:0,0:1:1,1:0:0,1:0:1,1:1:1,2:0:1,2:1:0," + * Step 4: Map to options + option values to determine existing variants: + * [Small, Red, Cotton] (0:0:0), [Small, Blue, Cotton] (0:1:0), [Small, Blue, Wool] (0:1:1), + * [Medium, Red, Cotton] (1:0:0), [Medium, Red, Wool] (1:0:1), [Medium, Blue, Wool] (1:1:1), + * [Large, Red, Wool] (2:0:1), [Large, Blue, Cotton] (2:1:0). + */ + + public String getEncodedVariantAvailability() { + return (String) get("encodedVariantAvailability"); + } + + public Product setEncodedVariantAvailability(String arg) { + optimisticData.put(getKey("encodedVariantAvailability"), arg); + return this; + } + + /** + * An encoded string containing all option value combinations with a corresponding variant. + * Integers represent option and values: + * [0,1] represents option_value at array index 0 for the option at array index 0 + * `:`, `,`, ` ` and `-` are control characters. + * `:` indicates a new option. ex: 0:1 indicates value 0 for the option in position 1, value 1 for the + * option in position 2. + * `,` indicates the end of a repeated prefix, mulitple consecutive commas indicate the end of multiple + * repeated prefixes. + * ` ` indicates a gap in the sequence of option values. ex: 0 4 indicates option values in position 0 + * and 4 are present. + * `-` indicates a continuous range of option values. ex: 0 1-3 4 + * Decoding process: + * Example options: [Size, Color, Material] + * Example values: [[Small, Medium, Large], [Red, Blue], [Cotton, Wool]] + * Example encoded string: "0:0:0,1:0-1,,1:0:0-1,1:1,,2:0:1,1:0,," + * Step 1: Expand ranges into the numbers they represent: "0:0:0,1:0 1,,1:0:0 1,1:1,,2:0:1,1:0,," + * Step 2: Expand repeated prefixes: "0:0:0,0:1:0 1,1:0:0 1,1:1:1,2:0:1,2:1:0," + * Step 3: Expand shared prefixes so data is encoded as a string: + * "0:0:0,0:1:0,0:1:1,1:0:0,1:0:1,1:1:1,2:0:1,2:1:0," + * Step 4: Map to options + option values to determine existing variants: + * [Small, Red, Cotton] (0:0:0), [Small, Blue, Cotton] (0:1:0), [Small, Blue, Wool] (0:1:1), + * [Medium, Red, Cotton] (1:0:0), [Medium, Red, Wool] (1:0:1), [Medium, Blue, Wool] (1:1:1), + * [Large, Red, Wool] (2:0:1), [Large, Blue, Cotton] (2:1:0). + */ + + public String getEncodedVariantExistence() { + return (String) get("encodedVariantExistence"); + } + + public Product setEncodedVariantExistence(String arg) { + optimisticData.put(getKey("encodedVariantExistence"), arg); + return this; + } + /** * The featured image for the product. * This field is functionally equivalent to `images(first: 1)`. @@ -52791,8 +54258,8 @@ public Product setMetafields(List arg) { } /** - * The URL used for viewing the resource on the shop's Online Store. Returns `null` if the resource is - * currently not published to the Online Store sales channel. + * The URL used for viewing the resource on the shop's Online Store. Returns + * `null` if the resource is currently not published to the Online Store sales channel. */ public String getOnlineStoreUrl() { @@ -52869,6 +54336,22 @@ public Product setRequiresSellingPlan(Boolean arg) { return this; } + /** + * Find an active product variant based on selected options, availability or the first variant. + * All arguments are optional. If no selected options are provided, the first available variant is + * returned. + * If no variants are available, the first variant is returned. + */ + + public ProductVariant getSelectedOrFirstAvailableVariant() { + return (ProductVariant) get("selectedOrFirstAvailableVariant"); + } + + public Product setSelectedOrFirstAvailableVariant(ProductVariant arg) { + optimisticData.put(getKey("selectedOrFirstAvailableVariant"), arg); + return this; + } + /** * A list of a product's available selling plan groups. A selling plan group represents a selling * method. For example, 'Subscribe and save' is a selling method where customers pay for goods or @@ -52938,8 +54421,13 @@ public Product setTotalInventory(Integer arg) { } /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * URL parameters to be added to a page URL to track the origin of on-site search traffic for + * [analytics + * reporting](https://help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/defaul + * t-reports/behaviour-reports). Returns a result when accessed through the + * [search](https://shopify.dev/docs/api/storefront/current/queries/search) or + * [predictiveSearch](https://shopify.dev/docs/api/storefront/current/queries/predictiveSearch) + * queries, otherwise returns null. */ public String getTrackingParameters() { @@ -52995,6 +54483,19 @@ public Product setVariants(ProductVariantConnection arg) { return this; } + /** + * The total count of variants for this product. + */ + + public Count getVariantsCount() { + return (Count) get("variantsCount"); + } + + public Product setVariantsCount(Count arg) { + optimisticData.put(getKey("variantsCount"), arg); + return this; + } + /** * The product’s vendor name. */ @@ -53010,8 +54511,12 @@ public Product setVendor(String arg) { public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { + case "adjacentVariants": return true; + case "availableForSale": return false; + case "category": return true; + case "collections": return true; case "compareAtPriceRange": return true; @@ -53022,6 +54527,10 @@ public boolean unwrapsToObject(String key) { case "descriptionHtml": return false; + case "encodedVariantAvailability": return false; + + case "encodedVariantExistence": return false; + case "featuredImage": return true; case "handle": return false; @@ -53050,6 +54559,8 @@ public boolean unwrapsToObject(String key) { case "requiresSellingPlan": return false; + case "selectedOrFirstAvailableVariant": return true; + case "sellingPlanGroups": return true; case "seo": return true; @@ -53068,6 +54579,8 @@ public boolean unwrapsToObject(String key) { case "variants": return true; + case "variantsCount": return true; + case "vendor": return false; default: return false; @@ -54138,6 +55651,21 @@ public static class ProductOptionValueQuery extends Query'2020-10-21T23:39:20Z'`
- `created_at: - `created_at:<=2024` | + * | product_type | Filter by a comma-separated list of [product + * types](https://help.shopify.com/en/manual/products/details/product-type). | | | + * `product_type:snowboard` | + * | tag | Filter products by the product + * [`tags`](https://shopify.dev/docs/api/storefront/latest/objects/Product#field-tags) field. | | | + * `tag:my_tag` | + * | tag_not | Filter by products that don't have the specified product + * [tags](https://shopify.dev/docs/api/storefront/latest/objects/Product#field-tags). | | | + * `tag_not:my_tag` | + * | title | Filter by the product + * [`title`](https://shopify.dev/docs/api/storefront/latest/objects/Product#field-title) field. | | | + * `title:The Minimal Snowboard` | + * | updated_at | Filter by the date and time when the product was last updated. | | | - + * `updated_at:>'2020-10-21T23:39:20Z'`
- `updated_at: - `updated_at:<=2024` | + * | variants.price | Filter by the price of the product's variants. | + * | vendor | Filter by the product + * [`vendor`](https://shopify.dev/docs/api/storefront/latest/objects/Product#field-vendor) field. | | | + * - `vendor:Snowdevil`
- `vendor:Snowdevil OR vendor:Icedevil` | + * Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax). */ public ProductsArguments query(String value) { if (value != null) { @@ -59160,16 +60780,16 @@ public interface ProductsArgumentsDefinition { } /** - * List of the shop’s products. For storefront search, use [`search` - * query](https://shopify.dev/docs/api/storefront/latest/queries/search). + * Returns a list of the shop's products. For storefront search, use the + * [`search`](https://shopify.dev/docs/api/storefront/latest/queries/search) query. */ public QueryRootQuery products(ProductConnectionQueryDefinition queryDef) { return products(args -> {}, queryDef); } /** - * List of the shop’s products. For storefront search, use [`search` - * query](https://shopify.dev/docs/api/storefront/latest/queries/search). + * Returns a list of the shop's products. For storefront search, use the + * [`search`](https://shopify.dev/docs/api/storefront/latest/queries/search) query. */ public QueryRootQuery products(ProductsArgumentsDefinition argsDef, ProductConnectionQueryDefinition queryDef) { startField("products"); @@ -59379,6 +60999,24 @@ public QueryRootQuery shop(ShopQueryDefinition queryDef) { return this; } + /** + * Contains all fields required to generate sitemaps. + */ + public QueryRootQuery sitemap(SitemapType type, SitemapQueryDefinition queryDef) { + startField("sitemap"); + + _queryBuilder.append("(type:"); + _queryBuilder.append(type.toString()); + + _queryBuilder.append(')'); + + _queryBuilder.append('{'); + queryDef.define(new SitemapQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + public class UrlRedirectsArguments extends Arguments { UrlRedirectsArguments(StringBuilder _queryBuilder) { super(_queryBuilder, true); @@ -59705,6 +61343,12 @@ public QueryRoot(JsonObject fields) throws SchemaViolationError { break; } + case "paymentSettings": { + responseData.put(key, new PaymentSettings(jsonAsObject(field.getValue(), key))); + + break; + } + case "predictiveSearch": { PredictiveSearchResult optional1 = null; if (!field.getValue().isJsonNull()) { @@ -59795,6 +61439,12 @@ public QueryRoot(JsonObject fields) throws SchemaViolationError { break; } + case "sitemap": { + responseData.put(key, new Sitemap(jsonAsObject(field.getValue(), key))); + + break; + } + case "urlRedirects": { responseData.put(key, new UrlRedirectConnection(jsonAsObject(field.getValue(), key))); @@ -60100,6 +61750,19 @@ public QueryRoot setPages(PageConnection arg) { return this; } + /** + * Settings related to payments. + */ + + public PaymentSettings getPaymentSettings() { + return (PaymentSettings) get("paymentSettings"); + } + + public QueryRoot setPaymentSettings(PaymentSettings arg) { + optimisticData.put(getKey("paymentSettings"), arg); + return this; + } + /** * List of the predictive search results. */ @@ -60185,8 +61848,8 @@ public QueryRoot setProductTypes(StringConnection arg) { } /** - * List of the shop’s products. For storefront search, use [`search` - * query](https://shopify.dev/docs/api/storefront/latest/queries/search). + * Returns a list of the shop's products. For storefront search, use the + * [`search`](https://shopify.dev/docs/api/storefront/latest/queries/search) query. */ public ProductConnection getProducts() { @@ -60238,6 +61901,19 @@ public QueryRoot setShop(Shop arg) { return this; } + /** + * Contains all fields required to generate sitemaps. + */ + + public Sitemap getSitemap() { + return (Sitemap) get("sitemap"); + } + + public QueryRoot setSitemap(Sitemap arg) { + optimisticData.put(getKey("sitemap"), arg); + return this; + } + /** * A list of redirects for a shop. */ @@ -60295,6 +61971,8 @@ public boolean unwrapsToObject(String key) { case "pages": return true; + case "paymentSettings": return true; + case "predictiveSearch": return true; case "product": return true; @@ -60315,6 +61993,8 @@ public boolean unwrapsToObject(String key) { case "shop": return true; + case "sitemap": return true; + case "urlRedirects": return true; default: return false; @@ -60725,8 +62405,13 @@ public SearchQuerySuggestionQuery text() { } /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * URL parameters to be added to a page URL to track the origin of on-site search traffic for + * [analytics + * reporting](https://help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/defaul + * t-reports/behaviour-reports). Returns a result when accessed through the + * [search](https://shopify.dev/docs/api/storefront/current/queries/search) or + * [predictiveSearch](https://shopify.dev/docs/api/storefront/current/queries/predictiveSearch) + * queries, otherwise returns null. */ public SearchQuerySuggestionQuery trackingParameters() { startField("trackingParameters"); @@ -60812,8 +62497,13 @@ public SearchQuerySuggestion setText(String arg) { } /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * URL parameters to be added to a page URL to track the origin of on-site search traffic for + * [analytics + * reporting](https://help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/defaul + * t-reports/behaviour-reports). Returns a result when accessed through the + * [search](https://shopify.dev/docs/api/storefront/current/queries/search) or + * [predictiveSearch](https://shopify.dev/docs/api/storefront/current/queries/predictiveSearch) + * queries, otherwise returns null. */ public String getTrackingParameters() { @@ -65412,6 +67102,19 @@ public ShopQuery shipsToCountries() { return this; } + /** + * The Shop Pay Installments pricing information for the shop. + */ + public ShopQuery shopPayInstallmentsPricing(ShopPayInstallmentsPricingQueryDefinition queryDef) { + startField("shopPayInstallmentsPricing"); + + _queryBuilder.append('{'); + queryDef.define(new ShopPayInstallmentsPricingQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + /** * The shop’s subscription policy. */ @@ -65574,6 +67277,17 @@ public Shop(JsonObject fields) throws SchemaViolationError { break; } + case "shopPayInstallmentsPricing": { + ShopPayInstallmentsPricing optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPayInstallmentsPricing(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + case "subscriptionPolicy": { ShopPolicyWithDefault optional1 = null; if (!field.getValue().isJsonNull()) { @@ -65780,6 +67494,19 @@ public Shop setShipsToCountries(List arg) { return this; } + /** + * The Shop Pay Installments pricing information for the shop. + */ + + public ShopPayInstallmentsPricing getShopPayInstallmentsPricing() { + return (ShopPayInstallmentsPricing) get("shopPayInstallmentsPricing"); + } + + public Shop setShopPayInstallmentsPricing(ShopPayInstallmentsPricing arg) { + optimisticData.put(getKey("shopPayInstallmentsPricing"), arg); + return this; + } + /** * The shop’s subscription policy. */ @@ -65834,6 +67561,8 @@ public boolean unwrapsToObject(String key) { case "shipsToCountries": return false; + case "shopPayInstallmentsPricing": return true; + case "subscriptionPolicy": return true; case "termsOfService": return true; @@ -65843,289 +67572,324 @@ public boolean unwrapsToObject(String key) { } } - public interface ShopPayPaymentRequestQueryDefinition { - void define(ShopPayPaymentRequestQuery _queryBuilder); + public interface ShopPayInstallmentsFinancingPlanQueryDefinition { + void define(ShopPayInstallmentsFinancingPlanQuery _queryBuilder); } /** - * Represents a Shop Pay payment request. + * The financing plan in Shop Pay Installments. */ - public static class ShopPayPaymentRequestQuery extends Query { - ShopPayPaymentRequestQuery(StringBuilder _queryBuilder) { + public static class ShopPayInstallmentsFinancingPlanQuery extends Query { + ShopPayInstallmentsFinancingPlanQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * The delivery methods for the payment request. + * The maximum price to qualify for the financing plan. */ - public ShopPayPaymentRequestQuery deliveryMethods(ShopPayPaymentRequestDeliveryMethodQueryDefinition queryDef) { - startField("deliveryMethods"); + public ShopPayInstallmentsFinancingPlanQuery maxPrice(MoneyV2QueryDefinition queryDef) { + startField("maxPrice"); _queryBuilder.append('{'); - queryDef.define(new ShopPayPaymentRequestDeliveryMethodQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The discount codes for the payment request. + * The minimum price to qualify for the financing plan. */ - public ShopPayPaymentRequestQuery discountCodes() { - startField("discountCodes"); + public ShopPayInstallmentsFinancingPlanQuery minPrice(MoneyV2QueryDefinition queryDef) { + startField("minPrice"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The discounts for the payment request order. + * The terms of the financing plan. */ - public ShopPayPaymentRequestQuery discounts(ShopPayPaymentRequestDiscountQueryDefinition queryDef) { - startField("discounts"); + public ShopPayInstallmentsFinancingPlanQuery terms(ShopPayInstallmentsFinancingPlanTermQueryDefinition queryDef) { + startField("terms"); _queryBuilder.append('{'); - queryDef.define(new ShopPayPaymentRequestDiscountQuery(_queryBuilder)); + queryDef.define(new ShopPayInstallmentsFinancingPlanTermQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } + } - /** - * The line items for the payment request. - */ - public ShopPayPaymentRequestQuery lineItems(ShopPayPaymentRequestLineItemQueryDefinition queryDef) { - startField("lineItems"); + /** + * The financing plan in Shop Pay Installments. + */ + public static class ShopPayInstallmentsFinancingPlan extends AbstractResponse implements Node { + public ShopPayInstallmentsFinancingPlan() { + } - _queryBuilder.append('{'); - queryDef.define(new ShopPayPaymentRequestLineItemQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPayInstallmentsFinancingPlan(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))); - return this; + break; + } + + case "maxPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "minPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "terms": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ShopPayInstallmentsFinancingPlanTerm(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public ShopPayInstallmentsFinancingPlan(ID id) { + this(); + optimisticData.put("id", id); + } + + public String getGraphQlTypeName() { + return "ShopPayInstallmentsFinancingPlan"; } /** - * The locale for the payment request. + * A globally-unique ID. */ - public ShopPayPaymentRequestQuery locale() { - startField("locale"); - return this; + public ID getId() { + return (ID) get("id"); } /** - * The presentment currency for the payment request. + * The maximum price to qualify for the financing plan. */ - public ShopPayPaymentRequestQuery presentmentCurrency() { - startField("presentmentCurrency"); + public MoneyV2 getMaxPrice() { + return (MoneyV2) get("maxPrice"); + } + + public ShopPayInstallmentsFinancingPlan setMaxPrice(MoneyV2 arg) { + optimisticData.put(getKey("maxPrice"), arg); return this; } /** - * The delivery method type for the payment request. + * The minimum price to qualify for the financing plan. */ - public ShopPayPaymentRequestQuery selectedDeliveryMethodType() { - startField("selectedDeliveryMethodType"); + public MoneyV2 getMinPrice() { + return (MoneyV2) get("minPrice"); + } + + public ShopPayInstallmentsFinancingPlan setMinPrice(MoneyV2 arg) { + optimisticData.put(getKey("minPrice"), arg); return this; } /** - * The shipping address for the payment request. + * The terms of the financing plan. */ - public ShopPayPaymentRequestQuery shippingAddress(ShopPayPaymentRequestContactFieldQueryDefinition queryDef) { - startField("shippingAddress"); - _queryBuilder.append('{'); - queryDef.define(new ShopPayPaymentRequestContactFieldQuery(_queryBuilder)); - _queryBuilder.append('}'); + public List getTerms() { + return (List) get("terms"); + } + public ShopPayInstallmentsFinancingPlan setTerms(List arg) { + optimisticData.put(getKey("terms"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "id": return false; + + case "maxPrice": return true; + + case "minPrice": return true; + + case "terms": return true; + + default: return false; + } + } + } + + /** + * The payment frequency for a Shop Pay Installments Financing Plan. + */ + public enum ShopPayInstallmentsFinancingPlanFrequency { /** - * The shipping lines for the payment request. + * Monthly payment frequency. */ - public ShopPayPaymentRequestQuery shippingLines(ShopPayPaymentRequestShippingLineQueryDefinition queryDef) { - startField("shippingLines"); + MONTHLY, - _queryBuilder.append('{'); - queryDef.define(new ShopPayPaymentRequestShippingLineQuery(_queryBuilder)); - _queryBuilder.append('}'); + /** + * Weekly payment frequency. + */ + WEEKLY, - return this; + UNKNOWN_VALUE; + + public static ShopPayInstallmentsFinancingPlanFrequency fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "MONTHLY": { + return MONTHLY; + } + + case "WEEKLY": { + return WEEKLY; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case MONTHLY: { + return "MONTHLY"; + } + + case WEEKLY: { + return "WEEKLY"; + } + + default: { + return ""; + } + } + } + } + + public interface ShopPayInstallmentsFinancingPlanTermQueryDefinition { + void define(ShopPayInstallmentsFinancingPlanTermQuery _queryBuilder); + } + + /** + * The terms of the financing plan in Shop Pay Installments. + */ + public static class ShopPayInstallmentsFinancingPlanTermQuery extends Query { + ShopPayInstallmentsFinancingPlanTermQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); } /** - * The subtotal amount for the payment request. + * The annual percentage rate (APR) of the financing plan. */ - public ShopPayPaymentRequestQuery subtotal(MoneyV2QueryDefinition queryDef) { - startField("subtotal"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPayInstallmentsFinancingPlanTermQuery apr() { + startField("apr"); return this; } /** - * The total amount for the payment request. + * The payment frequency for the financing plan. */ - public ShopPayPaymentRequestQuery total(MoneyV2QueryDefinition queryDef) { - startField("total"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPayInstallmentsFinancingPlanTermQuery frequency() { + startField("frequency"); return this; } /** - * The total shipping price for the payment request. + * The number of installments for the financing plan. */ - public ShopPayPaymentRequestQuery totalShippingPrice(ShopPayPaymentRequestTotalShippingPriceQueryDefinition queryDef) { - startField("totalShippingPrice"); + public ShopPayInstallmentsFinancingPlanTermQuery installmentsCount(CountQueryDefinition queryDef) { + startField("installmentsCount"); _queryBuilder.append('{'); - queryDef.define(new ShopPayPaymentRequestTotalShippingPriceQuery(_queryBuilder)); + queryDef.define(new CountQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The total tax for the payment request. + * The type of loan for the financing plan. */ - public ShopPayPaymentRequestQuery totalTax(MoneyV2QueryDefinition queryDef) { - startField("totalTax"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPayInstallmentsFinancingPlanTermQuery loanType() { + startField("loanType"); return this; } } /** - * Represents a Shop Pay payment request. + * The terms of the financing plan in Shop Pay Installments. */ - public static class ShopPayPaymentRequest extends AbstractResponse { - public ShopPayPaymentRequest() { + public static class ShopPayInstallmentsFinancingPlanTerm extends AbstractResponse implements Node { + public ShopPayInstallmentsFinancingPlanTerm() { } - public ShopPayPaymentRequest(JsonObject fields) throws SchemaViolationError { + public ShopPayInstallmentsFinancingPlanTerm(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "deliveryMethods": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ShopPayPaymentRequestDeliveryMethod(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "discountCodes": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(jsonAsString(element1, key)); - } - - responseData.put(key, list1); - - break; - } - - case "discounts": { - List optional1 = null; - if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ShopPayPaymentRequestDiscount(jsonAsObject(element1, key))); - } - - optional1 = list1; - } - - responseData.put(key, optional1); - - break; - } - - case "lineItems": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ShopPayPaymentRequestLineItem(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); - - break; - } - - case "locale": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "presentmentCurrency": { - responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "selectedDeliveryMethodType": { - responseData.put(key, ShopPayPaymentRequestDeliveryMethodType.fromGraphQl(jsonAsString(field.getValue(), key))); - - break; - } - - case "shippingAddress": { - ShopPayPaymentRequestContactField optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ShopPayPaymentRequestContactField(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "shippingLines": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ShopPayPaymentRequestShippingLine(jsonAsObject(element1, key))); - } - - responseData.put(key, list1); + case "apr": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); break; } - case "subtotal": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "frequency": { + responseData.put(key, ShopPayInstallmentsFinancingPlanFrequency.fromGraphQl(jsonAsString(field.getValue(), key))); break; } - case "total": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); break; } - case "totalShippingPrice": { - ShopPayPaymentRequestTotalShippingPrice optional1 = null; + case "installmentsCount": { + Count optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new ShopPayPaymentRequestTotalShippingPrice(jsonAsObject(field.getValue(), key)); + optional1 = new Count(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -66133,13 +67897,8 @@ public ShopPayPaymentRequest(JsonObject fields) throws SchemaViolationError { break; } - case "totalTax": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); + case "loanType": { + responseData.put(key, ShopPayInstallmentsLoan.fromGraphQl(jsonAsString(field.getValue(), key))); break; } @@ -66155,414 +67914,423 @@ public ShopPayPaymentRequest(JsonObject fields) throws SchemaViolationError { } } + public ShopPayInstallmentsFinancingPlanTerm(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "ShopPayPaymentRequest"; + return "ShopPayInstallmentsFinancingPlanTerm"; } /** - * The delivery methods for the payment request. + * The annual percentage rate (APR) of the financing plan. */ - public List getDeliveryMethods() { - return (List) get("deliveryMethods"); + public Integer getApr() { + return (Integer) get("apr"); } - public ShopPayPaymentRequest setDeliveryMethods(List arg) { - optimisticData.put(getKey("deliveryMethods"), arg); + public ShopPayInstallmentsFinancingPlanTerm setApr(Integer arg) { + optimisticData.put(getKey("apr"), arg); return this; } /** - * The discount codes for the payment request. + * The payment frequency for the financing plan. */ - public List getDiscountCodes() { - return (List) get("discountCodes"); + public ShopPayInstallmentsFinancingPlanFrequency getFrequency() { + return (ShopPayInstallmentsFinancingPlanFrequency) get("frequency"); } - public ShopPayPaymentRequest setDiscountCodes(List arg) { - optimisticData.put(getKey("discountCodes"), arg); + public ShopPayInstallmentsFinancingPlanTerm setFrequency(ShopPayInstallmentsFinancingPlanFrequency arg) { + optimisticData.put(getKey("frequency"), arg); return this; } /** - * The discounts for the payment request order. + * A globally-unique ID. */ - public List getDiscounts() { - return (List) get("discounts"); - } - - public ShopPayPaymentRequest setDiscounts(List arg) { - optimisticData.put(getKey("discounts"), arg); - return this; + public ID getId() { + return (ID) get("id"); } /** - * The line items for the payment request. + * The number of installments for the financing plan. */ - public List getLineItems() { - return (List) get("lineItems"); + public Count getInstallmentsCount() { + return (Count) get("installmentsCount"); } - public ShopPayPaymentRequest setLineItems(List arg) { - optimisticData.put(getKey("lineItems"), arg); + public ShopPayInstallmentsFinancingPlanTerm setInstallmentsCount(Count arg) { + optimisticData.put(getKey("installmentsCount"), arg); return this; } /** - * The locale for the payment request. + * The type of loan for the financing plan. */ - public String getLocale() { - return (String) get("locale"); + public ShopPayInstallmentsLoan getLoanType() { + return (ShopPayInstallmentsLoan) get("loanType"); } - public ShopPayPaymentRequest setLocale(String arg) { - optimisticData.put(getKey("locale"), arg); + public ShopPayInstallmentsFinancingPlanTerm setLoanType(ShopPayInstallmentsLoan arg) { + optimisticData.put(getKey("loanType"), arg); return this; } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "apr": return false; + + case "frequency": return false; + + case "id": return false; + + case "installmentsCount": return true; + + case "loanType": return false; + + default: return false; + } + } + } + + /** + * The loan type for a Shop Pay Installments Financing Plan Term. + */ + public enum ShopPayInstallmentsLoan { + /** + * An interest-bearing loan type. + */ + INTEREST, + /** - * The presentment currency for the payment request. + * A split-pay loan type. */ + SPLIT_PAY, - public CurrencyCode getPresentmentCurrency() { - return (CurrencyCode) get("presentmentCurrency"); + /** + * A zero-percent loan type. + */ + ZERO_PERCENT, + + UNKNOWN_VALUE; + + public static ShopPayInstallmentsLoan fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "INTEREST": { + return INTEREST; + } + + case "SPLIT_PAY": { + return SPLIT_PAY; + } + + case "ZERO_PERCENT": { + return ZERO_PERCENT; + } + + default: { + return UNKNOWN_VALUE; + } + } } + public String toString() { + switch (this) { + case INTEREST: { + return "INTEREST"; + } - public ShopPayPaymentRequest setPresentmentCurrency(CurrencyCode arg) { - optimisticData.put(getKey("presentmentCurrency"), arg); - return this; + case SPLIT_PAY: { + return "SPLIT_PAY"; + } + + case ZERO_PERCENT: { + return "ZERO_PERCENT"; + } + + default: { + return ""; + } + } + } + } + + public interface ShopPayInstallmentsPricingQueryDefinition { + void define(ShopPayInstallmentsPricingQuery _queryBuilder); + } + + /** + * The result for a Shop Pay Installments pricing request. + */ + public static class ShopPayInstallmentsPricingQuery extends Query { + ShopPayInstallmentsPricingQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The delivery method type for the payment request. + * The financing plans available for the given price range. */ + public ShopPayInstallmentsPricingQuery financingPlans(ShopPayInstallmentsFinancingPlanQueryDefinition queryDef) { + startField("financingPlans"); - public ShopPayPaymentRequestDeliveryMethodType getSelectedDeliveryMethodType() { - return (ShopPayPaymentRequestDeliveryMethodType) get("selectedDeliveryMethodType"); - } + _queryBuilder.append('{'); + queryDef.define(new ShopPayInstallmentsFinancingPlanQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ShopPayPaymentRequest setSelectedDeliveryMethodType(ShopPayPaymentRequestDeliveryMethodType arg) { - optimisticData.put(getKey("selectedDeliveryMethodType"), arg); return this; } /** - * The shipping address for the payment request. + * The maximum price to qualify for financing. */ + public ShopPayInstallmentsPricingQuery maxPrice(MoneyV2QueryDefinition queryDef) { + startField("maxPrice"); - public ShopPayPaymentRequestContactField getShippingAddress() { - return (ShopPayPaymentRequestContactField) get("shippingAddress"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public ShopPayPaymentRequest setShippingAddress(ShopPayPaymentRequestContactField arg) { - optimisticData.put(getKey("shippingAddress"), arg); return this; } /** - * The shipping lines for the payment request. + * The minimum price to qualify for financing. */ + public ShopPayInstallmentsPricingQuery minPrice(MoneyV2QueryDefinition queryDef) { + startField("minPrice"); - public List getShippingLines() { - return (List) get("shippingLines"); - } + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); - public ShopPayPaymentRequest setShippingLines(List arg) { - optimisticData.put(getKey("shippingLines"), arg); return this; } + } - /** - * The subtotal amount for the payment request. - */ + /** + * The result for a Shop Pay Installments pricing request. + */ + public static class ShopPayInstallmentsPricing extends AbstractResponse { + public ShopPayInstallmentsPricing() { + } - public MoneyV2 getSubtotal() { - return (MoneyV2) get("subtotal"); + public ShopPayInstallmentsPricing(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "financingPlans": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ShopPayInstallmentsFinancingPlan(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "maxPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "minPrice": { + 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 ShopPayPaymentRequest setSubtotal(MoneyV2 arg) { - optimisticData.put(getKey("subtotal"), arg); - return this; + public String getGraphQlTypeName() { + return "ShopPayInstallmentsPricing"; } /** - * The total amount for the payment request. + * The financing plans available for the given price range. */ - public MoneyV2 getTotal() { - return (MoneyV2) get("total"); + public List getFinancingPlans() { + return (List) get("financingPlans"); } - public ShopPayPaymentRequest setTotal(MoneyV2 arg) { - optimisticData.put(getKey("total"), arg); + public ShopPayInstallmentsPricing setFinancingPlans(List arg) { + optimisticData.put(getKey("financingPlans"), arg); return this; } /** - * The total shipping price for the payment request. + * The maximum price to qualify for financing. */ - public ShopPayPaymentRequestTotalShippingPrice getTotalShippingPrice() { - return (ShopPayPaymentRequestTotalShippingPrice) get("totalShippingPrice"); + public MoneyV2 getMaxPrice() { + return (MoneyV2) get("maxPrice"); } - public ShopPayPaymentRequest setTotalShippingPrice(ShopPayPaymentRequestTotalShippingPrice arg) { - optimisticData.put(getKey("totalShippingPrice"), arg); + public ShopPayInstallmentsPricing setMaxPrice(MoneyV2 arg) { + optimisticData.put(getKey("maxPrice"), arg); return this; } /** - * The total tax for the payment request. + * The minimum price to qualify for financing. */ - public MoneyV2 getTotalTax() { - return (MoneyV2) get("totalTax"); + public MoneyV2 getMinPrice() { + return (MoneyV2) get("minPrice"); } - public ShopPayPaymentRequest setTotalTax(MoneyV2 arg) { - optimisticData.put(getKey("totalTax"), arg); + public ShopPayInstallmentsPricing setMinPrice(MoneyV2 arg) { + optimisticData.put(getKey("minPrice"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "deliveryMethods": return true; - - case "discountCodes": return false; - - case "discounts": return true; - - case "lineItems": return true; - - case "locale": return false; - - case "presentmentCurrency": return false; - - case "selectedDeliveryMethodType": return false; - - case "shippingAddress": return true; - - case "shippingLines": return true; - - case "subtotal": return true; - - case "total": return true; + case "financingPlans": return true; - case "totalShippingPrice": return true; + case "maxPrice": return true; - case "totalTax": return true; + case "minPrice": return true; default: return false; } } } - public interface ShopPayPaymentRequestContactFieldQueryDefinition { - void define(ShopPayPaymentRequestContactFieldQuery _queryBuilder); + public interface ShopPayInstallmentsProductVariantPricingQueryDefinition { + void define(ShopPayInstallmentsProductVariantPricingQuery _queryBuilder); } /** - * Represents a contact field for a Shop Pay payment request. + * The shop pay installments pricing information for a product variant. */ - public static class ShopPayPaymentRequestContactFieldQuery extends Query { - ShopPayPaymentRequestContactFieldQuery(StringBuilder _queryBuilder) { + public static class ShopPayInstallmentsProductVariantPricingQuery extends Query { + ShopPayInstallmentsProductVariantPricingQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - } - - /** - * The first address line of the contact field. - */ - public ShopPayPaymentRequestContactFieldQuery address1() { - startField("address1"); - - return this; - } - - /** - * The second address line of the contact field. - */ - public ShopPayPaymentRequestContactFieldQuery address2() { - startField("address2"); - - return this; - } - - /** - * The city of the contact field. - */ - public ShopPayPaymentRequestContactFieldQuery city() { - startField("city"); - return this; + startField("id"); } /** - * The company name of the contact field. + * Whether the product variant is available. */ - public ShopPayPaymentRequestContactFieldQuery companyName() { - startField("companyName"); + public ShopPayInstallmentsProductVariantPricingQuery available() { + startField("available"); return this; } /** - * The country of the contact field. + * Whether the product variant is eligible for Shop Pay Installments. */ - public ShopPayPaymentRequestContactFieldQuery countryCode() { - startField("countryCode"); + public ShopPayInstallmentsProductVariantPricingQuery eligible() { + startField("eligible"); return this; } /** - * The email of the contact field. + * The full price of the product variant. */ - public ShopPayPaymentRequestContactFieldQuery email() { - startField("email"); - - return this; - } + public ShopPayInstallmentsProductVariantPricingQuery fullPrice(MoneyV2QueryDefinition queryDef) { + startField("fullPrice"); - /** - * The first name of the contact field. - */ - public ShopPayPaymentRequestContactFieldQuery firstName() { - startField("firstName"); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The first name of the contact field. + * The number of payment terms available for the product variant. */ - public ShopPayPaymentRequestContactFieldQuery lastName() { - startField("lastName"); - - return this; - } + public ShopPayInstallmentsProductVariantPricingQuery installmentsCount(CountQueryDefinition queryDef) { + startField("installmentsCount"); - /** - * The phone number of the contact field. - */ - public ShopPayPaymentRequestContactFieldQuery phone() { - startField("phone"); + _queryBuilder.append('{'); + queryDef.define(new CountQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The postal code of the contact field. + * The price per term for the product variant. */ - public ShopPayPaymentRequestContactFieldQuery postalCode() { - startField("postalCode"); - - return this; - } + public ShopPayInstallmentsProductVariantPricingQuery pricePerTerm(MoneyV2QueryDefinition queryDef) { + startField("pricePerTerm"); - /** - * The province of the contact field. - */ - public ShopPayPaymentRequestContactFieldQuery provinceCode() { - startField("provinceCode"); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * Represents a contact field for a Shop Pay payment request. + * The shop pay installments pricing information for a product variant. */ - public static class ShopPayPaymentRequestContactField extends AbstractResponse { - public ShopPayPaymentRequestContactField() { + public static class ShopPayInstallmentsProductVariantPricing extends AbstractResponse implements Node { + public ShopPayInstallmentsProductVariantPricing() { } - public ShopPayPaymentRequestContactField(JsonObject fields) throws SchemaViolationError { + public ShopPayInstallmentsProductVariantPricing(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "address1": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "address2": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "city": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "companyName": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "countryCode": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - - case "email": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "available": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } - case "firstName": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "eligible": { + responseData.put(key, jsonAsBoolean(field.getValue(), key)); break; } - case "lastName": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "fullPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "phone": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); break; } - case "postalCode": { - String optional1 = null; + case "installmentsCount": { + Count optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new Count(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -66570,13 +68338,8 @@ public ShopPayPaymentRequestContactField(JsonObject fields) throws SchemaViolati break; } - case "provinceCode": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "pricePerTerm": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } @@ -66592,290 +68355,316 @@ public ShopPayPaymentRequestContactField(JsonObject fields) throws SchemaViolati } } + public ShopPayInstallmentsProductVariantPricing(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "ShopPayPaymentRequestContactField"; + return "ShopPayInstallmentsProductVariantPricing"; } /** - * The first address line of the contact field. + * Whether the product variant is available. */ - public String getAddress1() { - return (String) get("address1"); + public Boolean getAvailable() { + return (Boolean) get("available"); } - public ShopPayPaymentRequestContactField setAddress1(String arg) { - optimisticData.put(getKey("address1"), arg); + public ShopPayInstallmentsProductVariantPricing setAvailable(Boolean arg) { + optimisticData.put(getKey("available"), arg); return this; } /** - * The second address line of the contact field. + * Whether the product variant is eligible for Shop Pay Installments. */ - public String getAddress2() { - return (String) get("address2"); + public Boolean getEligible() { + return (Boolean) get("eligible"); } - public ShopPayPaymentRequestContactField setAddress2(String arg) { - optimisticData.put(getKey("address2"), arg); + public ShopPayInstallmentsProductVariantPricing setEligible(Boolean arg) { + optimisticData.put(getKey("eligible"), arg); return this; } /** - * The city of the contact field. + * The full price of the product variant. */ - public String getCity() { - return (String) get("city"); + public MoneyV2 getFullPrice() { + return (MoneyV2) get("fullPrice"); } - public ShopPayPaymentRequestContactField setCity(String arg) { - optimisticData.put(getKey("city"), arg); + public ShopPayInstallmentsProductVariantPricing setFullPrice(MoneyV2 arg) { + optimisticData.put(getKey("fullPrice"), arg); return this; } /** - * The company name of the contact field. + * The ID of the product variant. */ - public String getCompanyName() { - return (String) get("companyName"); - } - - public ShopPayPaymentRequestContactField setCompanyName(String arg) { - optimisticData.put(getKey("companyName"), arg); - return this; + public ID getId() { + return (ID) get("id"); } /** - * The country of the contact field. + * The number of payment terms available for the product variant. */ - public String getCountryCode() { - return (String) get("countryCode"); + public Count getInstallmentsCount() { + return (Count) get("installmentsCount"); } - public ShopPayPaymentRequestContactField setCountryCode(String arg) { - optimisticData.put(getKey("countryCode"), arg); + public ShopPayInstallmentsProductVariantPricing setInstallmentsCount(Count arg) { + optimisticData.put(getKey("installmentsCount"), arg); return this; } /** - * The email of the contact field. + * The price per term for the product variant. */ - public String getEmail() { - return (String) get("email"); + public MoneyV2 getPricePerTerm() { + return (MoneyV2) get("pricePerTerm"); } - public ShopPayPaymentRequestContactField setEmail(String arg) { - optimisticData.put(getKey("email"), arg); + public ShopPayInstallmentsProductVariantPricing setPricePerTerm(MoneyV2 arg) { + optimisticData.put(getKey("pricePerTerm"), arg); return this; } - /** - * The first name of the contact field. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "available": return false; - public String getFirstName() { - return (String) get("firstName"); + case "eligible": return false; + + case "fullPrice": return true; + + case "id": return false; + + case "installmentsCount": return true; + + case "pricePerTerm": return true; + + default: return false; + } } + } - public ShopPayPaymentRequestContactField setFirstName(String arg) { - optimisticData.put(getKey("firstName"), arg); - return this; + public interface ShopPayPaymentRequestQueryDefinition { + void define(ShopPayPaymentRequestQuery _queryBuilder); + } + + /** + * Represents a Shop Pay payment request. + */ + public static class ShopPayPaymentRequestQuery extends Query { + ShopPayPaymentRequestQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The first name of the contact field. + * The delivery methods for the payment request. */ + public ShopPayPaymentRequestQuery deliveryMethods(ShopPayPaymentRequestDeliveryMethodQueryDefinition queryDef) { + startField("deliveryMethods"); - public String getLastName() { - return (String) get("lastName"); - } + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestDeliveryMethodQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ShopPayPaymentRequestContactField setLastName(String arg) { - optimisticData.put(getKey("lastName"), arg); return this; } /** - * The phone number of the contact field. + * The discount codes for the payment request. */ + public ShopPayPaymentRequestQuery discountCodes() { + startField("discountCodes"); - public String getPhone() { - return (String) get("phone"); - } - - public ShopPayPaymentRequestContactField setPhone(String arg) { - optimisticData.put(getKey("phone"), arg); return this; } /** - * The postal code of the contact field. + * The discounts for the payment request order. */ + public ShopPayPaymentRequestQuery discounts(ShopPayPaymentRequestDiscountQueryDefinition queryDef) { + startField("discounts"); - public String getPostalCode() { - return (String) get("postalCode"); - } + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestDiscountQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ShopPayPaymentRequestContactField setPostalCode(String arg) { - optimisticData.put(getKey("postalCode"), arg); return this; } /** - * The province of the contact field. + * The line items for the payment request. */ + public ShopPayPaymentRequestQuery lineItems(ShopPayPaymentRequestLineItemQueryDefinition queryDef) { + startField("lineItems"); - public String getProvinceCode() { - return (String) get("provinceCode"); - } + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestLineItemQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ShopPayPaymentRequestContactField setProvinceCode(String arg) { - optimisticData.put(getKey("provinceCode"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "address1": return false; - - case "address2": return false; - - case "city": return false; - - case "companyName": return false; - - case "countryCode": return false; - - case "email": return false; - - case "firstName": return false; - - case "lastName": return false; - - case "phone": return false; - - case "postalCode": return false; - - case "provinceCode": return false; + /** + * The locale for the payment request. + */ + public ShopPayPaymentRequestQuery locale() { + startField("locale"); - default: return false; - } + return this; } - } - public interface ShopPayPaymentRequestDeliveryMethodQueryDefinition { - void define(ShopPayPaymentRequestDeliveryMethodQuery _queryBuilder); - } + /** + * The presentment currency for the payment request. + */ + public ShopPayPaymentRequestQuery presentmentCurrency() { + startField("presentmentCurrency"); - /** - * Represents a delivery method for a Shop Pay payment request. - */ - public static class ShopPayPaymentRequestDeliveryMethodQuery extends Query { - ShopPayPaymentRequestDeliveryMethodQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * The amount for the delivery method. + * The delivery method type for the payment request. */ - public ShopPayPaymentRequestDeliveryMethodQuery amount(MoneyV2QueryDefinition queryDef) { - startField("amount"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPayPaymentRequestQuery selectedDeliveryMethodType() { + startField("selectedDeliveryMethodType"); return this; } /** - * The code of the delivery method. + * The shipping address for the payment request. */ - public ShopPayPaymentRequestDeliveryMethodQuery code() { - startField("code"); + public ShopPayPaymentRequestQuery shippingAddress(ShopPayPaymentRequestContactFieldQueryDefinition queryDef) { + startField("shippingAddress"); + + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestContactFieldQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The detail about when the delivery may be expected. + * The shipping lines for the payment request. */ - public ShopPayPaymentRequestDeliveryMethodQuery deliveryExpectationLabel() { - startField("deliveryExpectationLabel"); + public ShopPayPaymentRequestQuery shippingLines(ShopPayPaymentRequestShippingLineQueryDefinition queryDef) { + startField("shippingLines"); + + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestShippingLineQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The detail of the delivery method. + * The subtotal amount for the payment request. */ - public ShopPayPaymentRequestDeliveryMethodQuery detail() { - startField("detail"); + public ShopPayPaymentRequestQuery subtotal(MoneyV2QueryDefinition queryDef) { + startField("subtotal"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The label of the delivery method. + * The total amount for the payment request. */ - public ShopPayPaymentRequestDeliveryMethodQuery label() { - startField("label"); + public ShopPayPaymentRequestQuery total(MoneyV2QueryDefinition queryDef) { + startField("total"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The maximum delivery date for the delivery method. + * The total shipping price for the payment request. */ - public ShopPayPaymentRequestDeliveryMethodQuery maxDeliveryDate() { - startField("maxDeliveryDate"); + public ShopPayPaymentRequestQuery totalShippingPrice(ShopPayPaymentRequestTotalShippingPriceQueryDefinition queryDef) { + startField("totalShippingPrice"); + + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestTotalShippingPriceQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The minimum delivery date for the delivery method. + * The total tax for the payment request. */ - public ShopPayPaymentRequestDeliveryMethodQuery minDeliveryDate() { - startField("minDeliveryDate"); + public ShopPayPaymentRequestQuery totalTax(MoneyV2QueryDefinition queryDef) { + startField("totalTax"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * Represents a delivery method for a Shop Pay payment request. + * Represents a Shop Pay payment request. */ - public static class ShopPayPaymentRequestDeliveryMethod extends AbstractResponse { - public ShopPayPaymentRequestDeliveryMethod() { + public static class ShopPayPaymentRequest extends AbstractResponse { + public ShopPayPaymentRequest() { } - public ShopPayPaymentRequestDeliveryMethod(JsonObject fields) throws SchemaViolationError { + public ShopPayPaymentRequest(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "amount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "deliveryMethods": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ShopPayPaymentRequestDeliveryMethod(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } - case "code": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "discountCodes": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(jsonAsString(element1, key)); + } + + responseData.put(key, list1); break; } - case "deliveryExpectationLabel": { - String optional1 = null; + case "discounts": { + List optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ShopPayPaymentRequestDiscount(jsonAsObject(element1, key))); + } + + optional1 = list1; } responseData.put(key, optional1); @@ -66883,10 +68672,39 @@ public ShopPayPaymentRequestDeliveryMethod(JsonObject fields) throws SchemaViola break; } - case "detail": { - String optional1 = null; + case "lineItems": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ShopPayPaymentRequestLineItem(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "locale": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "presentmentCurrency": { + responseData.put(key, CurrencyCode.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "selectedDeliveryMethodType": { + responseData.put(key, ShopPayPaymentRequestDeliveryMethodType.fromGraphQl(jsonAsString(field.getValue(), key))); + + break; + } + + case "shippingAddress": { + ShopPayPaymentRequestContactField optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new ShopPayPaymentRequestContactField(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -66894,16 +68712,33 @@ public ShopPayPaymentRequestDeliveryMethod(JsonObject fields) throws SchemaViola break; } - case "label": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "shippingLines": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ShopPayPaymentRequestShippingLine(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); break; } - case "maxDeliveryDate": { - String optional1 = null; + case "subtotal": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "total": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "totalShippingPrice": { + ShopPayPaymentRequestTotalShippingPrice optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new ShopPayPaymentRequestTotalShippingPrice(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -66911,10 +68746,10 @@ public ShopPayPaymentRequestDeliveryMethod(JsonObject fields) throws SchemaViola break; } - case "minDeliveryDate": { - String optional1 = null; + case "totalTax": { + MoneyV2 optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -66934,652 +68769,723 @@ public ShopPayPaymentRequestDeliveryMethod(JsonObject fields) throws SchemaViola } public String getGraphQlTypeName() { - return "ShopPayPaymentRequestDeliveryMethod"; + return "ShopPayPaymentRequest"; } /** - * The amount for the delivery method. + * The delivery methods for the payment request. */ - public MoneyV2 getAmount() { - return (MoneyV2) get("amount"); + public List getDeliveryMethods() { + return (List) get("deliveryMethods"); } - public ShopPayPaymentRequestDeliveryMethod setAmount(MoneyV2 arg) { - optimisticData.put(getKey("amount"), arg); + public ShopPayPaymentRequest setDeliveryMethods(List arg) { + optimisticData.put(getKey("deliveryMethods"), arg); return this; } /** - * The code of the delivery method. + * The discount codes for the payment request. */ - public String getCode() { - return (String) get("code"); + public List getDiscountCodes() { + return (List) get("discountCodes"); } - public ShopPayPaymentRequestDeliveryMethod setCode(String arg) { - optimisticData.put(getKey("code"), arg); + public ShopPayPaymentRequest setDiscountCodes(List arg) { + optimisticData.put(getKey("discountCodes"), arg); return this; } /** - * The detail about when the delivery may be expected. + * The discounts for the payment request order. */ - public String getDeliveryExpectationLabel() { - return (String) get("deliveryExpectationLabel"); + public List getDiscounts() { + return (List) get("discounts"); } - public ShopPayPaymentRequestDeliveryMethod setDeliveryExpectationLabel(String arg) { - optimisticData.put(getKey("deliveryExpectationLabel"), arg); + public ShopPayPaymentRequest setDiscounts(List arg) { + optimisticData.put(getKey("discounts"), arg); return this; } /** - * The detail of the delivery method. + * The line items for the payment request. */ - public String getDetail() { - return (String) get("detail"); + public List getLineItems() { + return (List) get("lineItems"); } - public ShopPayPaymentRequestDeliveryMethod setDetail(String arg) { - optimisticData.put(getKey("detail"), arg); + public ShopPayPaymentRequest setLineItems(List arg) { + optimisticData.put(getKey("lineItems"), arg); return this; } /** - * The label of the delivery method. + * The locale for the payment request. */ - public String getLabel() { - return (String) get("label"); + public String getLocale() { + return (String) get("locale"); } - public ShopPayPaymentRequestDeliveryMethod setLabel(String arg) { - optimisticData.put(getKey("label"), arg); + public ShopPayPaymentRequest setLocale(String arg) { + optimisticData.put(getKey("locale"), arg); return this; } /** - * The maximum delivery date for the delivery method. + * The presentment currency for the payment request. */ - public String getMaxDeliveryDate() { - return (String) get("maxDeliveryDate"); + public CurrencyCode getPresentmentCurrency() { + return (CurrencyCode) get("presentmentCurrency"); } - public ShopPayPaymentRequestDeliveryMethod setMaxDeliveryDate(String arg) { - optimisticData.put(getKey("maxDeliveryDate"), arg); + public ShopPayPaymentRequest setPresentmentCurrency(CurrencyCode arg) { + optimisticData.put(getKey("presentmentCurrency"), arg); return this; } /** - * The minimum delivery date for the delivery method. + * The delivery method type for the payment request. */ - public String getMinDeliveryDate() { - return (String) get("minDeliveryDate"); + public ShopPayPaymentRequestDeliveryMethodType getSelectedDeliveryMethodType() { + return (ShopPayPaymentRequestDeliveryMethodType) get("selectedDeliveryMethodType"); } - public ShopPayPaymentRequestDeliveryMethod setMinDeliveryDate(String arg) { - optimisticData.put(getKey("minDeliveryDate"), arg); + public ShopPayPaymentRequest setSelectedDeliveryMethodType(ShopPayPaymentRequestDeliveryMethodType arg) { + optimisticData.put(getKey("selectedDeliveryMethodType"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "amount": return true; - - case "code": return false; - - case "deliveryExpectationLabel": return false; - - case "detail": return false; - - case "label": return false; - - case "maxDeliveryDate": return false; - - case "minDeliveryDate": return false; + /** + * The shipping address for the payment request. + */ - default: return false; - } + public ShopPayPaymentRequestContactField getShippingAddress() { + return (ShopPayPaymentRequestContactField) get("shippingAddress"); } - } - public static class ShopPayPaymentRequestDeliveryMethodInput implements Serializable { - private Input code = Input.undefined(); - - private Input label = Input.undefined(); - - private Input detail = Input.undefined(); - - private Input amount = Input.undefined(); - - private Input minDeliveryDate = Input.undefined(); - - private Input maxDeliveryDate = Input.undefined(); - - private Input deliveryExpectationLabel = Input.undefined(); - - public String getCode() { - return code.getValue(); + public ShopPayPaymentRequest setShippingAddress(ShopPayPaymentRequestContactField arg) { + optimisticData.put(getKey("shippingAddress"), arg); + return this; } - public Input getCodeInput() { - return code; - } + /** + * The shipping lines for the payment request. + */ - public ShopPayPaymentRequestDeliveryMethodInput setCode(String code) { - this.code = Input.optional(code); - return this; + public List getShippingLines() { + return (List) get("shippingLines"); } - public ShopPayPaymentRequestDeliveryMethodInput setCodeInput(Input code) { - if (code == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.code = code; + public ShopPayPaymentRequest setShippingLines(List arg) { + optimisticData.put(getKey("shippingLines"), arg); return this; } - public String getLabel() { - return label.getValue(); - } + /** + * The subtotal amount for the payment request. + */ - public Input getLabelInput() { - return label; + public MoneyV2 getSubtotal() { + return (MoneyV2) get("subtotal"); } - public ShopPayPaymentRequestDeliveryMethodInput setLabel(String label) { - this.label = Input.optional(label); + public ShopPayPaymentRequest setSubtotal(MoneyV2 arg) { + optimisticData.put(getKey("subtotal"), arg); return this; } - public ShopPayPaymentRequestDeliveryMethodInput setLabelInput(Input label) { - if (label == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.label = label; - return this; - } + /** + * The total amount for the payment request. + */ - public String getDetail() { - return detail.getValue(); + public MoneyV2 getTotal() { + return (MoneyV2) get("total"); } - public Input getDetailInput() { - return detail; + public ShopPayPaymentRequest setTotal(MoneyV2 arg) { + optimisticData.put(getKey("total"), arg); + return this; } - public ShopPayPaymentRequestDeliveryMethodInput setDetail(String detail) { - this.detail = Input.optional(detail); - return this; + /** + * The total shipping price for the payment request. + */ + + public ShopPayPaymentRequestTotalShippingPrice getTotalShippingPrice() { + return (ShopPayPaymentRequestTotalShippingPrice) get("totalShippingPrice"); } - public ShopPayPaymentRequestDeliveryMethodInput setDetailInput(Input detail) { - if (detail == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.detail = detail; + public ShopPayPaymentRequest setTotalShippingPrice(ShopPayPaymentRequestTotalShippingPrice arg) { + optimisticData.put(getKey("totalShippingPrice"), arg); return this; } - public MoneyInput getAmount() { - return amount.getValue(); - } + /** + * The total tax for the payment request. + */ - public Input getAmountInput() { - return amount; + public MoneyV2 getTotalTax() { + return (MoneyV2) get("totalTax"); } - public ShopPayPaymentRequestDeliveryMethodInput setAmount(MoneyInput amount) { - this.amount = Input.optional(amount); + public ShopPayPaymentRequest setTotalTax(MoneyV2 arg) { + optimisticData.put(getKey("totalTax"), arg); return this; } - public ShopPayPaymentRequestDeliveryMethodInput setAmountInput(Input amount) { - if (amount == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.amount = amount; - return this; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "deliveryMethods": return true; - public String getMinDeliveryDate() { - return minDeliveryDate.getValue(); - } + case "discountCodes": return false; - public Input getMinDeliveryDateInput() { - return minDeliveryDate; - } + case "discounts": return true; - public ShopPayPaymentRequestDeliveryMethodInput setMinDeliveryDate(String minDeliveryDate) { - this.minDeliveryDate = Input.optional(minDeliveryDate); - return this; - } + case "lineItems": return true; - public ShopPayPaymentRequestDeliveryMethodInput setMinDeliveryDateInput(Input minDeliveryDate) { - if (minDeliveryDate == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.minDeliveryDate = minDeliveryDate; - return this; - } + case "locale": return false; - public String getMaxDeliveryDate() { - return maxDeliveryDate.getValue(); - } + case "presentmentCurrency": return false; - public Input getMaxDeliveryDateInput() { - return maxDeliveryDate; - } + case "selectedDeliveryMethodType": return false; - public ShopPayPaymentRequestDeliveryMethodInput setMaxDeliveryDate(String maxDeliveryDate) { - this.maxDeliveryDate = Input.optional(maxDeliveryDate); - return this; - } + case "shippingAddress": return true; - public ShopPayPaymentRequestDeliveryMethodInput setMaxDeliveryDateInput(Input maxDeliveryDate) { - if (maxDeliveryDate == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.maxDeliveryDate = maxDeliveryDate; - return this; - } + case "shippingLines": return true; - public String getDeliveryExpectationLabel() { - return deliveryExpectationLabel.getValue(); - } + case "subtotal": return true; - public Input getDeliveryExpectationLabelInput() { - return deliveryExpectationLabel; - } + case "total": return true; - public ShopPayPaymentRequestDeliveryMethodInput setDeliveryExpectationLabel(String deliveryExpectationLabel) { - this.deliveryExpectationLabel = Input.optional(deliveryExpectationLabel); - return this; - } + case "totalShippingPrice": return true; - public ShopPayPaymentRequestDeliveryMethodInput setDeliveryExpectationLabelInput(Input deliveryExpectationLabel) { - if (deliveryExpectationLabel == null) { - throw new IllegalArgumentException("Input can not be null"); + case "totalTax": return true; + + default: return false; } - this.deliveryExpectationLabel = deliveryExpectationLabel; - return this; } + } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - if (this.code.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("code:"); - if (code.getValue() != null) { - Query.appendQuotedString(_queryBuilder, code.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + public interface ShopPayPaymentRequestContactFieldQueryDefinition { + void define(ShopPayPaymentRequestContactFieldQuery _queryBuilder); + } - if (this.label.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("label:"); - if (label.getValue() != null) { - Query.appendQuotedString(_queryBuilder, label.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + /** + * Represents a contact field for a Shop Pay payment request. + */ + public static class ShopPayPaymentRequestContactFieldQuery extends Query { + ShopPayPaymentRequestContactFieldQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } - if (this.detail.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("detail:"); - if (detail.getValue() != null) { - Query.appendQuotedString(_queryBuilder, detail.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + /** + * The first address line of the contact field. + */ + public ShopPayPaymentRequestContactFieldQuery address1() { + startField("address1"); - if (this.amount.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("amount:"); - if (amount.getValue() != null) { - amount.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); - } - } + return this; + } - if (this.minDeliveryDate.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("minDeliveryDate:"); - if (minDeliveryDate.getValue() != null) { - Query.appendQuotedString(_queryBuilder, minDeliveryDate.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + /** + * The second address line of the contact field. + */ + public ShopPayPaymentRequestContactFieldQuery address2() { + startField("address2"); - if (this.maxDeliveryDate.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("maxDeliveryDate:"); - if (maxDeliveryDate.getValue() != null) { - Query.appendQuotedString(_queryBuilder, maxDeliveryDate.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + return this; + } - if (this.deliveryExpectationLabel.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("deliveryExpectationLabel:"); - if (deliveryExpectationLabel.getValue() != null) { - Query.appendQuotedString(_queryBuilder, deliveryExpectationLabel.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + /** + * The city of the contact field. + */ + public ShopPayPaymentRequestContactFieldQuery city() { + startField("city"); - _queryBuilder.append('}'); + return this; } - } - /** - * Represents the delivery method type for a Shop Pay payment request. - */ - public enum ShopPayPaymentRequestDeliveryMethodType { /** - * The delivery method type is pickup. + * The company name of the contact field. */ - PICKUP, + public ShopPayPaymentRequestContactFieldQuery companyName() { + startField("companyName"); + + return this; + } /** - * The delivery method type is shipping. + * The country of the contact field. */ - SHIPPING, + public ShopPayPaymentRequestContactFieldQuery countryCode() { + startField("countryCode"); - UNKNOWN_VALUE; + return this; + } - public static ShopPayPaymentRequestDeliveryMethodType fromGraphQl(String value) { - if (value == null) { - return null; - } + /** + * The email of the contact field. + */ + public ShopPayPaymentRequestContactFieldQuery email() { + startField("email"); - switch (value) { - case "PICKUP": { - return PICKUP; - } + return this; + } - case "SHIPPING": { - return SHIPPING; - } + /** + * The first name of the contact field. + */ + public ShopPayPaymentRequestContactFieldQuery firstName() { + startField("firstName"); - default: { - return UNKNOWN_VALUE; - } - } + return this; } - public String toString() { - switch (this) { - case PICKUP: { - return "PICKUP"; - } - case SHIPPING: { - return "SHIPPING"; - } + /** + * The first name of the contact field. + */ + public ShopPayPaymentRequestContactFieldQuery lastName() { + startField("lastName"); - default: { - return ""; - } - } + return this; } - } - public interface ShopPayPaymentRequestDiscountQueryDefinition { - void define(ShopPayPaymentRequestDiscountQuery _queryBuilder); - } + /** + * The phone number of the contact field. + */ + public ShopPayPaymentRequestContactFieldQuery phone() { + startField("phone"); - /** - * Represents a discount for a Shop Pay payment request. - */ - public static class ShopPayPaymentRequestDiscountQuery extends Query { - ShopPayPaymentRequestDiscountQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + return this; } /** - * The amount of the discount. + * The postal code of the contact field. */ - public ShopPayPaymentRequestDiscountQuery amount(MoneyV2QueryDefinition queryDef) { - startField("amount"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPayPaymentRequestContactFieldQuery postalCode() { + startField("postalCode"); return this; } /** - * The label of the discount. + * The province of the contact field. */ - public ShopPayPaymentRequestDiscountQuery label() { - startField("label"); + public ShopPayPaymentRequestContactFieldQuery provinceCode() { + startField("provinceCode"); return this; } } /** - * Represents a discount for a Shop Pay payment request. + * Represents a contact field for a Shop Pay payment request. */ - public static class ShopPayPaymentRequestDiscount extends AbstractResponse { - public ShopPayPaymentRequestDiscount() { + public static class ShopPayPaymentRequestContactField extends AbstractResponse { + public ShopPayPaymentRequestContactField() { } - public ShopPayPaymentRequestDiscount(JsonObject fields) throws SchemaViolationError { + public ShopPayPaymentRequestContactField(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "amount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "address1": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "label": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "address2": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "__typename": { + case "city": { responseData.put(key, jsonAsString(field.getValue(), key)); + break; } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } - } - } - } - public String getGraphQlTypeName() { - return "ShopPayPaymentRequestDiscount"; - } + case "companyName": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - /** - * The amount of the discount. - */ + responseData.put(key, optional1); - public MoneyV2 getAmount() { - return (MoneyV2) get("amount"); - } + break; + } - public ShopPayPaymentRequestDiscount setAmount(MoneyV2 arg) { - optimisticData.put(getKey("amount"), arg); - return this; - } + case "countryCode": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "email": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "firstName": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "lastName": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "phone": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "postalCode": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "provinceCode": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "ShopPayPaymentRequestContactField"; + } /** - * The label of the discount. + * The first address line of the contact field. */ - public String getLabel() { - return (String) get("label"); + public String getAddress1() { + return (String) get("address1"); } - public ShopPayPaymentRequestDiscount setLabel(String arg) { - optimisticData.put(getKey("label"), arg); + public ShopPayPaymentRequestContactField setAddress1(String arg) { + optimisticData.put(getKey("address1"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "amount": return true; + /** + * The second address line of the contact field. + */ - case "label": return false; + public String getAddress2() { + return (String) get("address2"); + } - default: return false; - } + public ShopPayPaymentRequestContactField setAddress2(String arg) { + optimisticData.put(getKey("address2"), arg); + return this; } - } - public static class ShopPayPaymentRequestDiscountInput implements Serializable { - private Input label = Input.undefined(); + /** + * The city of the contact field. + */ - private Input amount = Input.undefined(); + public String getCity() { + return (String) get("city"); + } - public String getLabel() { - return label.getValue(); + public ShopPayPaymentRequestContactField setCity(String arg) { + optimisticData.put(getKey("city"), arg); + return this; } - public Input getLabelInput() { - return label; + /** + * The company name of the contact field. + */ + + public String getCompanyName() { + return (String) get("companyName"); } - public ShopPayPaymentRequestDiscountInput setLabel(String label) { - this.label = Input.optional(label); + public ShopPayPaymentRequestContactField setCompanyName(String arg) { + optimisticData.put(getKey("companyName"), arg); return this; } - public ShopPayPaymentRequestDiscountInput setLabelInput(Input label) { - if (label == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.label = label; + /** + * The country of the contact field. + */ + + public String getCountryCode() { + return (String) get("countryCode"); + } + + public ShopPayPaymentRequestContactField setCountryCode(String arg) { + optimisticData.put(getKey("countryCode"), arg); return this; } - public MoneyInput getAmount() { - return amount.getValue(); + /** + * The email of the contact field. + */ + + public String getEmail() { + return (String) get("email"); } - public Input getAmountInput() { - return amount; + public ShopPayPaymentRequestContactField setEmail(String arg) { + optimisticData.put(getKey("email"), arg); + return this; } - public ShopPayPaymentRequestDiscountInput setAmount(MoneyInput amount) { - this.amount = Input.optional(amount); + /** + * The first name of the contact field. + */ + + public String getFirstName() { + return (String) get("firstName"); + } + + public ShopPayPaymentRequestContactField setFirstName(String arg) { + optimisticData.put(getKey("firstName"), arg); return this; } - public ShopPayPaymentRequestDiscountInput setAmountInput(Input amount) { - if (amount == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.amount = amount; + /** + * The first name of the contact field. + */ + + public String getLastName() { + return (String) get("lastName"); + } + + public ShopPayPaymentRequestContactField setLastName(String arg) { + optimisticData.put(getKey("lastName"), arg); return this; } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + /** + * The phone number of the contact field. + */ - if (this.label.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("label:"); - if (label.getValue() != null) { - Query.appendQuotedString(_queryBuilder, label.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + public String getPhone() { + return (String) get("phone"); + } - if (this.amount.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("amount:"); - if (amount.getValue() != null) { - amount.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); - } - } + public ShopPayPaymentRequestContactField setPhone(String arg) { + optimisticData.put(getKey("phone"), arg); + return this; + } - _queryBuilder.append('}'); + /** + * The postal code of the contact field. + */ + + public String getPostalCode() { + return (String) get("postalCode"); + } + + public ShopPayPaymentRequestContactField setPostalCode(String arg) { + optimisticData.put(getKey("postalCode"), arg); + return this; + } + + /** + * The province of the contact field. + */ + + public String getProvinceCode() { + return (String) get("provinceCode"); + } + + public ShopPayPaymentRequestContactField setProvinceCode(String arg) { + optimisticData.put(getKey("provinceCode"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "address1": return false; + + case "address2": return false; + + case "city": return false; + + case "companyName": return false; + + case "countryCode": return false; + + case "email": return false; + + case "firstName": return false; + + case "lastName": return false; + + case "phone": return false; + + case "postalCode": return false; + + case "provinceCode": return false; + + default: return false; + } } } - public interface ShopPayPaymentRequestImageQueryDefinition { - void define(ShopPayPaymentRequestImageQuery _queryBuilder); + public interface ShopPayPaymentRequestDeliveryMethodQueryDefinition { + void define(ShopPayPaymentRequestDeliveryMethodQuery _queryBuilder); } /** - * Represents an image for a Shop Pay payment request line item. + * Represents a delivery method for a Shop Pay payment request. */ - public static class ShopPayPaymentRequestImageQuery extends Query { - ShopPayPaymentRequestImageQuery(StringBuilder _queryBuilder) { + public static class ShopPayPaymentRequestDeliveryMethodQuery extends Query { + ShopPayPaymentRequestDeliveryMethodQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The alt text of the image. + * The amount for the delivery method. */ - public ShopPayPaymentRequestImageQuery alt() { - startField("alt"); + public ShopPayPaymentRequestDeliveryMethodQuery amount(MoneyV2QueryDefinition queryDef) { + startField("amount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The source URL of the image. + * The code of the delivery method. */ - public ShopPayPaymentRequestImageQuery url() { - startField("url"); + public ShopPayPaymentRequestDeliveryMethodQuery code() { + startField("code"); + + return this; + } + + /** + * The detail about when the delivery may be expected. + */ + public ShopPayPaymentRequestDeliveryMethodQuery deliveryExpectationLabel() { + startField("deliveryExpectationLabel"); + + return this; + } + + /** + * The detail of the delivery method. + */ + public ShopPayPaymentRequestDeliveryMethodQuery detail() { + startField("detail"); + + return this; + } + + /** + * The label of the delivery method. + */ + public ShopPayPaymentRequestDeliveryMethodQuery label() { + startField("label"); + + return this; + } + + /** + * The maximum delivery date for the delivery method. + */ + public ShopPayPaymentRequestDeliveryMethodQuery maxDeliveryDate() { + startField("maxDeliveryDate"); + + return this; + } + + /** + * The minimum delivery date for the delivery method. + */ + public ShopPayPaymentRequestDeliveryMethodQuery minDeliveryDate() { + startField("minDeliveryDate"); return this; } } /** - * Represents an image for a Shop Pay payment request line item. + * Represents a delivery method for a Shop Pay payment request. */ - public static class ShopPayPaymentRequestImage extends AbstractResponse { - public ShopPayPaymentRequestImage() { + public static class ShopPayPaymentRequestDeliveryMethod extends AbstractResponse { + public ShopPayPaymentRequestDeliveryMethod() { } - public ShopPayPaymentRequestImage(JsonObject fields) throws SchemaViolationError { + public ShopPayPaymentRequestDeliveryMethod(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "alt": { + case "amount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "code": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "deliveryExpectationLabel": { String optional1 = null; if (!field.getValue().isJsonNull()) { optional1 = jsonAsString(field.getValue(), key); @@ -67590,12 +69496,45 @@ public ShopPayPaymentRequestImage(JsonObject fields) throws SchemaViolationError break; } - case "url": { + case "detail": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "label": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } + case "maxDeliveryDate": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "minDeliveryDate": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + case "__typename": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -67608,368 +69547,1910 @@ public ShopPayPaymentRequestImage(JsonObject fields) throws SchemaViolationError } public String getGraphQlTypeName() { - return "ShopPayPaymentRequestImage"; + return "ShopPayPaymentRequestDeliveryMethod"; } /** - * The alt text of the image. + * The amount for the delivery method. */ - public String getAlt() { - return (String) get("alt"); + public MoneyV2 getAmount() { + return (MoneyV2) get("amount"); } - public ShopPayPaymentRequestImage setAlt(String arg) { - optimisticData.put(getKey("alt"), arg); + public ShopPayPaymentRequestDeliveryMethod setAmount(MoneyV2 arg) { + optimisticData.put(getKey("amount"), arg); return this; } /** - * The source URL of the image. + * The code of the delivery method. */ - public String getUrl() { - return (String) get("url"); + public String getCode() { + return (String) get("code"); } - public ShopPayPaymentRequestImage setUrl(String arg) { - optimisticData.put(getKey("url"), arg); + public ShopPayPaymentRequestDeliveryMethod setCode(String arg) { + optimisticData.put(getKey("code"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "alt": return false; + /** + * The detail about when the delivery may be expected. + */ - case "url": return false; + public String getDeliveryExpectationLabel() { + return (String) get("deliveryExpectationLabel"); + } - default: return false; - } + public ShopPayPaymentRequestDeliveryMethod setDeliveryExpectationLabel(String arg) { + optimisticData.put(getKey("deliveryExpectationLabel"), arg); + return this; } - } - public static class ShopPayPaymentRequestImageInput implements Serializable { - private String url; + /** + * The detail of the delivery method. + */ - private Input alt = Input.undefined(); + public String getDetail() { + return (String) get("detail"); + } - public ShopPayPaymentRequestImageInput(String url) { - this.url = url; + public ShopPayPaymentRequestDeliveryMethod setDetail(String arg) { + optimisticData.put(getKey("detail"), arg); + return this; } - public String getUrl() { - return url; + /** + * The label of the delivery method. + */ + + public String getLabel() { + return (String) get("label"); } - public ShopPayPaymentRequestImageInput setUrl(String url) { - this.url = url; + public ShopPayPaymentRequestDeliveryMethod setLabel(String arg) { + optimisticData.put(getKey("label"), arg); return this; } - public String getAlt() { - return alt.getValue(); + /** + * The maximum delivery date for the delivery method. + */ + + public String getMaxDeliveryDate() { + return (String) get("maxDeliveryDate"); } - public Input getAltInput() { - return alt; + public ShopPayPaymentRequestDeliveryMethod setMaxDeliveryDate(String arg) { + optimisticData.put(getKey("maxDeliveryDate"), arg); + return this; + } + + /** + * The minimum delivery date for the delivery method. + */ + + public String getMinDeliveryDate() { + return (String) get("minDeliveryDate"); + } + + public ShopPayPaymentRequestDeliveryMethod setMinDeliveryDate(String arg) { + optimisticData.put(getKey("minDeliveryDate"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "amount": return true; + + case "code": return false; + + case "deliveryExpectationLabel": return false; + + case "detail": return false; + + case "label": return false; + + case "maxDeliveryDate": return false; + + case "minDeliveryDate": return false; + + default: return false; + } + } + } + + public static class ShopPayPaymentRequestDeliveryMethodInput implements Serializable { + private Input code = Input.undefined(); + + private Input label = Input.undefined(); + + private Input detail = Input.undefined(); + + private Input amount = Input.undefined(); + + private Input minDeliveryDate = Input.undefined(); + + private Input maxDeliveryDate = Input.undefined(); + + private Input deliveryExpectationLabel = Input.undefined(); + + public String getCode() { + return code.getValue(); + } + + public Input getCodeInput() { + return code; + } + + public ShopPayPaymentRequestDeliveryMethodInput setCode(String code) { + this.code = Input.optional(code); + return this; + } + + public ShopPayPaymentRequestDeliveryMethodInput setCodeInput(Input code) { + if (code == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.code = code; + return this; + } + + public String getLabel() { + return label.getValue(); + } + + public Input getLabelInput() { + return label; + } + + public ShopPayPaymentRequestDeliveryMethodInput setLabel(String label) { + this.label = Input.optional(label); + return this; + } + + public ShopPayPaymentRequestDeliveryMethodInput setLabelInput(Input label) { + if (label == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.label = label; + return this; + } + + public String getDetail() { + return detail.getValue(); + } + + public Input getDetailInput() { + return detail; + } + + public ShopPayPaymentRequestDeliveryMethodInput setDetail(String detail) { + this.detail = Input.optional(detail); + return this; + } + + public ShopPayPaymentRequestDeliveryMethodInput setDetailInput(Input detail) { + if (detail == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.detail = detail; + return this; + } + + public MoneyInput getAmount() { + return amount.getValue(); + } + + public Input getAmountInput() { + return amount; + } + + public ShopPayPaymentRequestDeliveryMethodInput setAmount(MoneyInput amount) { + this.amount = Input.optional(amount); + return this; + } + + public ShopPayPaymentRequestDeliveryMethodInput setAmountInput(Input amount) { + if (amount == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.amount = amount; + return this; + } + + public String getMinDeliveryDate() { + return minDeliveryDate.getValue(); + } + + public Input getMinDeliveryDateInput() { + return minDeliveryDate; + } + + public ShopPayPaymentRequestDeliveryMethodInput setMinDeliveryDate(String minDeliveryDate) { + this.minDeliveryDate = Input.optional(minDeliveryDate); + return this; + } + + public ShopPayPaymentRequestDeliveryMethodInput setMinDeliveryDateInput(Input minDeliveryDate) { + if (minDeliveryDate == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.minDeliveryDate = minDeliveryDate; + return this; + } + + public String getMaxDeliveryDate() { + return maxDeliveryDate.getValue(); + } + + public Input getMaxDeliveryDateInput() { + return maxDeliveryDate; + } + + public ShopPayPaymentRequestDeliveryMethodInput setMaxDeliveryDate(String maxDeliveryDate) { + this.maxDeliveryDate = Input.optional(maxDeliveryDate); + return this; + } + + public ShopPayPaymentRequestDeliveryMethodInput setMaxDeliveryDateInput(Input maxDeliveryDate) { + if (maxDeliveryDate == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.maxDeliveryDate = maxDeliveryDate; + return this; + } + + public String getDeliveryExpectationLabel() { + return deliveryExpectationLabel.getValue(); + } + + public Input getDeliveryExpectationLabelInput() { + return deliveryExpectationLabel; + } + + public ShopPayPaymentRequestDeliveryMethodInput setDeliveryExpectationLabel(String deliveryExpectationLabel) { + this.deliveryExpectationLabel = Input.optional(deliveryExpectationLabel); + return this; + } + + public ShopPayPaymentRequestDeliveryMethodInput setDeliveryExpectationLabelInput(Input deliveryExpectationLabel) { + if (deliveryExpectationLabel == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.deliveryExpectationLabel = deliveryExpectationLabel; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + if (this.code.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("code:"); + if (code.getValue() != null) { + Query.appendQuotedString(_queryBuilder, code.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.label.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("label:"); + if (label.getValue() != null) { + Query.appendQuotedString(_queryBuilder, label.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.detail.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("detail:"); + if (detail.getValue() != null) { + Query.appendQuotedString(_queryBuilder, detail.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.amount.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("amount:"); + if (amount.getValue() != null) { + amount.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + if (this.minDeliveryDate.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("minDeliveryDate:"); + if (minDeliveryDate.getValue() != null) { + Query.appendQuotedString(_queryBuilder, minDeliveryDate.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.maxDeliveryDate.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("maxDeliveryDate:"); + if (maxDeliveryDate.getValue() != null) { + Query.appendQuotedString(_queryBuilder, maxDeliveryDate.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.deliveryExpectationLabel.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("deliveryExpectationLabel:"); + if (deliveryExpectationLabel.getValue() != null) { + Query.appendQuotedString(_queryBuilder, deliveryExpectationLabel.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + _queryBuilder.append('}'); + } + } + + /** + * Represents the delivery method type for a Shop Pay payment request. + */ + public enum ShopPayPaymentRequestDeliveryMethodType { + /** + * The delivery method type is pickup. + */ + PICKUP, + + /** + * The delivery method type is shipping. + */ + SHIPPING, + + UNKNOWN_VALUE; + + public static ShopPayPaymentRequestDeliveryMethodType fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "PICKUP": { + return PICKUP; + } + + case "SHIPPING": { + return SHIPPING; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case PICKUP: { + return "PICKUP"; + } + + case SHIPPING: { + return "SHIPPING"; + } + + default: { + return ""; + } + } + } + } + + public interface ShopPayPaymentRequestDiscountQueryDefinition { + void define(ShopPayPaymentRequestDiscountQuery _queryBuilder); + } + + /** + * Represents a discount for a Shop Pay payment request. + */ + public static class ShopPayPaymentRequestDiscountQuery extends Query { + ShopPayPaymentRequestDiscountQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The amount of the discount. + */ + public ShopPayPaymentRequestDiscountQuery amount(MoneyV2QueryDefinition queryDef) { + startField("amount"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The label of the discount. + */ + public ShopPayPaymentRequestDiscountQuery label() { + startField("label"); + + return this; + } + } + + /** + * Represents a discount for a Shop Pay payment request. + */ + public static class ShopPayPaymentRequestDiscount extends AbstractResponse { + public ShopPayPaymentRequestDiscount() { + } + + public ShopPayPaymentRequestDiscount(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "amount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "label": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "ShopPayPaymentRequestDiscount"; + } + + /** + * The amount of the discount. + */ + + public MoneyV2 getAmount() { + return (MoneyV2) get("amount"); + } + + public ShopPayPaymentRequestDiscount setAmount(MoneyV2 arg) { + optimisticData.put(getKey("amount"), arg); + return this; + } + + /** + * The label of the discount. + */ + + public String getLabel() { + return (String) get("label"); + } + + public ShopPayPaymentRequestDiscount setLabel(String arg) { + optimisticData.put(getKey("label"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "amount": return true; + + case "label": return false; + + default: return false; + } + } + } + + public static class ShopPayPaymentRequestDiscountInput implements Serializable { + private Input label = Input.undefined(); + + private Input amount = Input.undefined(); + + public String getLabel() { + return label.getValue(); + } + + public Input getLabelInput() { + return label; + } + + public ShopPayPaymentRequestDiscountInput setLabel(String label) { + this.label = Input.optional(label); + return this; + } + + public ShopPayPaymentRequestDiscountInput setLabelInput(Input label) { + if (label == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.label = label; + return this; + } + + public MoneyInput getAmount() { + return amount.getValue(); + } + + public Input getAmountInput() { + return amount; + } + + public ShopPayPaymentRequestDiscountInput setAmount(MoneyInput amount) { + this.amount = Input.optional(amount); + return this; + } + + public ShopPayPaymentRequestDiscountInput setAmountInput(Input amount) { + if (amount == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.amount = amount; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + if (this.label.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("label:"); + if (label.getValue() != null) { + Query.appendQuotedString(_queryBuilder, label.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.amount.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("amount:"); + if (amount.getValue() != null) { + amount.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + _queryBuilder.append('}'); + } + } + + public interface ShopPayPaymentRequestImageQueryDefinition { + void define(ShopPayPaymentRequestImageQuery _queryBuilder); + } + + /** + * Represents an image for a Shop Pay payment request line item. + */ + public static class ShopPayPaymentRequestImageQuery extends Query { + ShopPayPaymentRequestImageQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The alt text of the image. + */ + public ShopPayPaymentRequestImageQuery alt() { + startField("alt"); + + return this; + } + + /** + * The source URL of the image. + */ + public ShopPayPaymentRequestImageQuery url() { + startField("url"); + + return this; + } + } + + /** + * Represents an image for a Shop Pay payment request line item. + */ + public static class ShopPayPaymentRequestImage extends AbstractResponse { + public ShopPayPaymentRequestImage() { + } + + public ShopPayPaymentRequestImage(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "alt": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "url": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "ShopPayPaymentRequestImage"; + } + + /** + * The alt text of the image. + */ + + public String getAlt() { + return (String) get("alt"); + } + + public ShopPayPaymentRequestImage setAlt(String arg) { + optimisticData.put(getKey("alt"), arg); + return this; + } + + /** + * The source URL of the image. + */ + + public String getUrl() { + return (String) get("url"); + } + + public ShopPayPaymentRequestImage setUrl(String arg) { + optimisticData.put(getKey("url"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "alt": return false; + + case "url": return false; + + default: return false; + } + } + } + + public static class ShopPayPaymentRequestImageInput implements Serializable { + private String url; + + private Input alt = Input.undefined(); + + public ShopPayPaymentRequestImageInput(String url) { + this.url = url; + } + + public String getUrl() { + return url; + } + + public ShopPayPaymentRequestImageInput setUrl(String url) { + this.url = url; + return this; + } + + public String getAlt() { + return alt.getValue(); + } + + public Input getAltInput() { + return alt; + } + + public ShopPayPaymentRequestImageInput setAlt(String alt) { + this.alt = Input.optional(alt); + return this; + } + + public ShopPayPaymentRequestImageInput setAltInput(Input alt) { + if (alt == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.alt = alt; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("url:"); + Query.appendQuotedString(_queryBuilder, url.toString()); + + if (this.alt.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("alt:"); + if (alt.getValue() != null) { + Query.appendQuotedString(_queryBuilder, alt.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + _queryBuilder.append('}'); + } + } + + public static class ShopPayPaymentRequestInput implements Serializable { + private MoneyInput total; + + private MoneyInput subtotal; + + private String locale; + + private CurrencyCode presentmentCurrency; + + private Input> discountCodes = Input.undefined(); + + private Input> lineItems = Input.undefined(); + + private Input> shippingLines = Input.undefined(); + + private Input> discounts = Input.undefined(); + + private Input totalShippingPrice = Input.undefined(); + + private Input totalTax = Input.undefined(); + + private Input> deliveryMethods = Input.undefined(); + + private Input selectedDeliveryMethodType = Input.undefined(); + + private Input paymentMethod = Input.undefined(); + + public ShopPayPaymentRequestInput(MoneyInput total, MoneyInput subtotal, String locale, CurrencyCode presentmentCurrency) { + this.total = total; + + this.subtotal = subtotal; + + this.locale = locale; + + this.presentmentCurrency = presentmentCurrency; + } + + public MoneyInput getTotal() { + return total; + } + + public ShopPayPaymentRequestInput setTotal(MoneyInput total) { + this.total = total; + return this; + } + + public MoneyInput getSubtotal() { + return subtotal; + } + + public ShopPayPaymentRequestInput setSubtotal(MoneyInput subtotal) { + this.subtotal = subtotal; + return this; + } + + public String getLocale() { + return locale; + } + + public ShopPayPaymentRequestInput setLocale(String locale) { + this.locale = locale; + return this; + } + + public CurrencyCode getPresentmentCurrency() { + return presentmentCurrency; + } + + public ShopPayPaymentRequestInput setPresentmentCurrency(CurrencyCode presentmentCurrency) { + this.presentmentCurrency = presentmentCurrency; + return this; + } + + public List getDiscountCodes() { + return discountCodes.getValue(); + } + + public Input> getDiscountCodesInput() { + return discountCodes; + } + + public ShopPayPaymentRequestInput setDiscountCodes(List discountCodes) { + this.discountCodes = Input.optional(discountCodes); + return this; + } + + public ShopPayPaymentRequestInput setDiscountCodesInput(Input> discountCodes) { + if (discountCodes == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.discountCodes = discountCodes; + return this; + } + + public List getLineItems() { + return lineItems.getValue(); + } + + public Input> getLineItemsInput() { + return lineItems; + } + + public ShopPayPaymentRequestInput setLineItems(List lineItems) { + this.lineItems = Input.optional(lineItems); + return this; + } + + public ShopPayPaymentRequestInput setLineItemsInput(Input> lineItems) { + if (lineItems == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.lineItems = lineItems; + return this; + } + + public List getShippingLines() { + return shippingLines.getValue(); + } + + public Input> getShippingLinesInput() { + return shippingLines; + } + + public ShopPayPaymentRequestInput setShippingLines(List shippingLines) { + this.shippingLines = Input.optional(shippingLines); + return this; + } + + public ShopPayPaymentRequestInput setShippingLinesInput(Input> shippingLines) { + if (shippingLines == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.shippingLines = shippingLines; + return this; + } + + public List getDiscounts() { + return discounts.getValue(); + } + + public Input> getDiscountsInput() { + return discounts; + } + + public ShopPayPaymentRequestInput setDiscounts(List discounts) { + this.discounts = Input.optional(discounts); + return this; + } + + public ShopPayPaymentRequestInput setDiscountsInput(Input> discounts) { + if (discounts == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.discounts = discounts; + return this; + } + + public ShopPayPaymentRequestTotalShippingPriceInput getTotalShippingPrice() { + return totalShippingPrice.getValue(); + } + + public Input getTotalShippingPriceInput() { + return totalShippingPrice; + } + + public ShopPayPaymentRequestInput setTotalShippingPrice(ShopPayPaymentRequestTotalShippingPriceInput totalShippingPrice) { + this.totalShippingPrice = Input.optional(totalShippingPrice); + return this; + } + + public ShopPayPaymentRequestInput setTotalShippingPriceInput(Input totalShippingPrice) { + if (totalShippingPrice == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.totalShippingPrice = totalShippingPrice; + return this; + } + + public MoneyInput getTotalTax() { + return totalTax.getValue(); + } + + public Input getTotalTaxInput() { + return totalTax; + } + + public ShopPayPaymentRequestInput setTotalTax(MoneyInput totalTax) { + this.totalTax = Input.optional(totalTax); + return this; + } + + public ShopPayPaymentRequestInput setTotalTaxInput(Input totalTax) { + if (totalTax == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.totalTax = totalTax; + return this; + } + + public List getDeliveryMethods() { + return deliveryMethods.getValue(); + } + + public Input> getDeliveryMethodsInput() { + return deliveryMethods; + } + + public ShopPayPaymentRequestInput setDeliveryMethods(List deliveryMethods) { + this.deliveryMethods = Input.optional(deliveryMethods); + return this; + } + + public ShopPayPaymentRequestInput setDeliveryMethodsInput(Input> deliveryMethods) { + if (deliveryMethods == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.deliveryMethods = deliveryMethods; + return this; + } + + public ShopPayPaymentRequestDeliveryMethodType getSelectedDeliveryMethodType() { + return selectedDeliveryMethodType.getValue(); + } + + public Input getSelectedDeliveryMethodTypeInput() { + return selectedDeliveryMethodType; + } + + public ShopPayPaymentRequestInput setSelectedDeliveryMethodType(ShopPayPaymentRequestDeliveryMethodType selectedDeliveryMethodType) { + this.selectedDeliveryMethodType = Input.optional(selectedDeliveryMethodType); + return this; + } + + public ShopPayPaymentRequestInput setSelectedDeliveryMethodTypeInput(Input selectedDeliveryMethodType) { + if (selectedDeliveryMethodType == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.selectedDeliveryMethodType = selectedDeliveryMethodType; + return this; + } + + public String getPaymentMethod() { + return paymentMethod.getValue(); + } + + public Input getPaymentMethodInput() { + return paymentMethod; + } + + public ShopPayPaymentRequestInput setPaymentMethod(String paymentMethod) { + this.paymentMethod = Input.optional(paymentMethod); + return this; + } + + public ShopPayPaymentRequestInput setPaymentMethodInput(Input paymentMethod) { + if (paymentMethod == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.paymentMethod = paymentMethod; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("total:"); + total.appendTo(_queryBuilder); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("subtotal:"); + subtotal.appendTo(_queryBuilder); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("locale:"); + Query.appendQuotedString(_queryBuilder, locale.toString()); + + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("presentmentCurrency:"); + _queryBuilder.append(presentmentCurrency.toString()); + + if (this.discountCodes.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("discountCodes:"); + if (discountCodes.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (String item1 : discountCodes.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + Query.appendQuotedString(_queryBuilder, item1.toString()); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } + + if (this.lineItems.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("lineItems:"); + if (lineItems.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ShopPayPaymentRequestLineItemInput item1 : lineItems.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } + + if (this.shippingLines.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("shippingLines:"); + if (shippingLines.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ShopPayPaymentRequestShippingLineInput item1 : shippingLines.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } + + if (this.discounts.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("discounts:"); + if (discounts.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ShopPayPaymentRequestDiscountInput item1 : discounts.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } + + if (this.totalShippingPrice.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("totalShippingPrice:"); + if (totalShippingPrice.getValue() != null) { + totalShippingPrice.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + if (this.totalTax.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("totalTax:"); + if (totalTax.getValue() != null) { + totalTax.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + if (this.deliveryMethods.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("deliveryMethods:"); + if (deliveryMethods.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ShopPayPaymentRequestDeliveryMethodInput item1 : deliveryMethods.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } + + if (this.selectedDeliveryMethodType.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("selectedDeliveryMethodType:"); + if (selectedDeliveryMethodType.getValue() != null) { + _queryBuilder.append(selectedDeliveryMethodType.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + if (this.paymentMethod.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("paymentMethod:"); + if (paymentMethod.getValue() != null) { + Query.appendQuotedString(_queryBuilder, paymentMethod.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } + + _queryBuilder.append('}'); + } + } + + public interface ShopPayPaymentRequestLineItemQueryDefinition { + void define(ShopPayPaymentRequestLineItemQuery _queryBuilder); + } + + /** + * Represents a line item for a Shop Pay payment request. + */ + public static class ShopPayPaymentRequestLineItemQuery extends Query { + ShopPayPaymentRequestLineItemQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * The final item price for the line item. + */ + public ShopPayPaymentRequestLineItemQuery finalItemPrice(MoneyV2QueryDefinition queryDef) { + startField("finalItemPrice"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The final line price for the line item. + */ + public ShopPayPaymentRequestLineItemQuery finalLinePrice(MoneyV2QueryDefinition queryDef) { + startField("finalLinePrice"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The image of the line item. + */ + public ShopPayPaymentRequestLineItemQuery image(ShopPayPaymentRequestImageQueryDefinition queryDef) { + startField("image"); + + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestImageQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The item discounts for the line item. + */ + public ShopPayPaymentRequestLineItemQuery itemDiscounts(ShopPayPaymentRequestDiscountQueryDefinition queryDef) { + startField("itemDiscounts"); + + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestDiscountQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The label of the line item. + */ + public ShopPayPaymentRequestLineItemQuery label() { + startField("label"); + + return this; + } + + /** + * The line discounts for the line item. + */ + public ShopPayPaymentRequestLineItemQuery lineDiscounts(ShopPayPaymentRequestDiscountQueryDefinition queryDef) { + startField("lineDiscounts"); + + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestDiscountQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The original item price for the line item. + */ + public ShopPayPaymentRequestLineItemQuery originalItemPrice(MoneyV2QueryDefinition queryDef) { + startField("originalItemPrice"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The original line price for the line item. + */ + public ShopPayPaymentRequestLineItemQuery originalLinePrice(MoneyV2QueryDefinition queryDef) { + startField("originalLinePrice"); + + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The quantity of the line item. + */ + public ShopPayPaymentRequestLineItemQuery quantity() { + startField("quantity"); + + return this; + } + + /** + * Whether the line item requires shipping. + */ + public ShopPayPaymentRequestLineItemQuery requiresShipping() { + startField("requiresShipping"); + + return this; + } + + /** + * The SKU of the line item. + */ + public ShopPayPaymentRequestLineItemQuery sku() { + startField("sku"); + + return this; + } + } + + /** + * Represents a line item for a Shop Pay payment request. + */ + public static class ShopPayPaymentRequestLineItem extends AbstractResponse { + public ShopPayPaymentRequestLineItem() { + } + + public ShopPayPaymentRequestLineItem(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "finalItemPrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "finalLinePrice": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + + break; + } + + case "image": { + ShopPayPaymentRequestImage optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPayPaymentRequestImage(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "itemDiscounts": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ShopPayPaymentRequestDiscount(jsonAsObject(element1, key))); + } + + optional1 = list1; + } + + responseData.put(key, optional1); + + break; + } + + case "label": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "lineDiscounts": { + List optional1 = null; + if (!field.getValue().isJsonNull()) { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ShopPayPaymentRequestDiscount(jsonAsObject(element1, key))); + } + + optional1 = list1; + } + + responseData.put(key, optional1); + + break; + } + + case "originalItemPrice": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "originalLinePrice": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "quantity": { + responseData.put(key, jsonAsInteger(field.getValue(), key)); + + break; + } + + case "requiresShipping": { + Boolean optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsBoolean(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "sku": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "ShopPayPaymentRequestLineItem"; + } + + /** + * The final item price for the line item. + */ + + public MoneyV2 getFinalItemPrice() { + return (MoneyV2) get("finalItemPrice"); + } + + public ShopPayPaymentRequestLineItem setFinalItemPrice(MoneyV2 arg) { + optimisticData.put(getKey("finalItemPrice"), arg); + return this; + } + + /** + * The final line price for the line item. + */ + + public MoneyV2 getFinalLinePrice() { + return (MoneyV2) get("finalLinePrice"); + } + + public ShopPayPaymentRequestLineItem setFinalLinePrice(MoneyV2 arg) { + optimisticData.put(getKey("finalLinePrice"), arg); + return this; + } + + /** + * The image of the line item. + */ + + public ShopPayPaymentRequestImage getImage() { + return (ShopPayPaymentRequestImage) get("image"); + } + + public ShopPayPaymentRequestLineItem setImage(ShopPayPaymentRequestImage arg) { + optimisticData.put(getKey("image"), arg); + return this; + } + + /** + * The item discounts for the line item. + */ + + public List getItemDiscounts() { + return (List) get("itemDiscounts"); + } + + public ShopPayPaymentRequestLineItem setItemDiscounts(List arg) { + optimisticData.put(getKey("itemDiscounts"), arg); + return this; + } + + /** + * The label of the line item. + */ + + public String getLabel() { + return (String) get("label"); + } + + public ShopPayPaymentRequestLineItem setLabel(String arg) { + optimisticData.put(getKey("label"), arg); + return this; + } + + /** + * The line discounts for the line item. + */ + + public List getLineDiscounts() { + return (List) get("lineDiscounts"); + } + + public ShopPayPaymentRequestLineItem setLineDiscounts(List arg) { + optimisticData.put(getKey("lineDiscounts"), arg); + return this; + } + + /** + * The original item price for the line item. + */ + + public MoneyV2 getOriginalItemPrice() { + return (MoneyV2) get("originalItemPrice"); + } + + public ShopPayPaymentRequestLineItem setOriginalItemPrice(MoneyV2 arg) { + optimisticData.put(getKey("originalItemPrice"), arg); + return this; + } + + /** + * The original line price for the line item. + */ + + public MoneyV2 getOriginalLinePrice() { + return (MoneyV2) get("originalLinePrice"); + } + + public ShopPayPaymentRequestLineItem setOriginalLinePrice(MoneyV2 arg) { + optimisticData.put(getKey("originalLinePrice"), arg); + return this; + } + + /** + * The quantity of the line item. + */ + + public Integer getQuantity() { + return (Integer) get("quantity"); + } + + public ShopPayPaymentRequestLineItem setQuantity(Integer arg) { + optimisticData.put(getKey("quantity"), arg); + return this; + } + + /** + * Whether the line item requires shipping. + */ + + public Boolean getRequiresShipping() { + return (Boolean) get("requiresShipping"); + } + + public ShopPayPaymentRequestLineItem setRequiresShipping(Boolean arg) { + optimisticData.put(getKey("requiresShipping"), arg); + return this; } - public ShopPayPaymentRequestImageInput setAlt(String alt) { - this.alt = Input.optional(alt); - return this; + /** + * The SKU of the line item. + */ + + public String getSku() { + return (String) get("sku"); } - public ShopPayPaymentRequestImageInput setAltInput(Input alt) { - if (alt == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.alt = alt; + public ShopPayPaymentRequestLineItem setSku(String arg) { + optimisticData.put(getKey("sku"), arg); return this; } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "finalItemPrice": return true; - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("url:"); - Query.appendQuotedString(_queryBuilder, url.toString()); + case "finalLinePrice": return true; - if (this.alt.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("alt:"); - if (alt.getValue() != null) { - Query.appendQuotedString(_queryBuilder, alt.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + case "image": return true; - _queryBuilder.append('}'); - } - } + case "itemDiscounts": return true; - public static class ShopPayPaymentRequestInput implements Serializable { - private MoneyInput total; + case "label": return false; - private MoneyInput subtotal; + case "lineDiscounts": return true; - private String locale; + case "originalItemPrice": return true; - private CurrencyCode presentmentCurrency; + case "originalLinePrice": return true; - private Input> discountCodes = Input.undefined(); + case "quantity": return false; - private Input> lineItems = Input.undefined(); + case "requiresShipping": return false; - private Input> shippingLines = Input.undefined(); + case "sku": return false; - private Input> discounts = Input.undefined(); + default: return false; + } + } + } - private Input totalShippingPrice = Input.undefined(); + public static class ShopPayPaymentRequestLineItemInput implements Serializable { + private int quantity; - private Input totalTax = Input.undefined(); + private Input label = Input.undefined(); - private Input> deliveryMethods = Input.undefined(); + private Input sku = Input.undefined(); - private Input selectedDeliveryMethodType = Input.undefined(); + private Input requiresShipping = Input.undefined(); - private Input paymentMethod = Input.undefined(); + private Input image = Input.undefined(); - public ShopPayPaymentRequestInput(MoneyInput total, MoneyInput subtotal, String locale, CurrencyCode presentmentCurrency) { - this.total = total; + private Input originalLinePrice = Input.undefined(); - this.subtotal = subtotal; + private Input finalLinePrice = Input.undefined(); - this.locale = locale; + private Input> lineDiscounts = Input.undefined(); - this.presentmentCurrency = presentmentCurrency; - } + private Input originalItemPrice = Input.undefined(); - public MoneyInput getTotal() { - return total; - } + private Input finalItemPrice = Input.undefined(); - public ShopPayPaymentRequestInput setTotal(MoneyInput total) { - this.total = total; - return this; + private Input> itemDiscounts = Input.undefined(); + + public ShopPayPaymentRequestLineItemInput(int quantity) { + this.quantity = quantity; } - public MoneyInput getSubtotal() { - return subtotal; + public int getQuantity() { + return quantity; } - public ShopPayPaymentRequestInput setSubtotal(MoneyInput subtotal) { - this.subtotal = subtotal; + public ShopPayPaymentRequestLineItemInput setQuantity(int quantity) { + this.quantity = quantity; return this; } - public String getLocale() { - return locale; + public String getLabel() { + return label.getValue(); } - public ShopPayPaymentRequestInput setLocale(String locale) { - this.locale = locale; - return this; + public Input getLabelInput() { + return label; } - public CurrencyCode getPresentmentCurrency() { - return presentmentCurrency; + public ShopPayPaymentRequestLineItemInput setLabel(String label) { + this.label = Input.optional(label); + return this; } - public ShopPayPaymentRequestInput setPresentmentCurrency(CurrencyCode presentmentCurrency) { - this.presentmentCurrency = presentmentCurrency; + public ShopPayPaymentRequestLineItemInput setLabelInput(Input label) { + if (label == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.label = label; return this; } - public List getDiscountCodes() { - return discountCodes.getValue(); + public String getSku() { + return sku.getValue(); } - public Input> getDiscountCodesInput() { - return discountCodes; + public Input getSkuInput() { + return sku; } - public ShopPayPaymentRequestInput setDiscountCodes(List discountCodes) { - this.discountCodes = Input.optional(discountCodes); + public ShopPayPaymentRequestLineItemInput setSku(String sku) { + this.sku = Input.optional(sku); return this; } - public ShopPayPaymentRequestInput setDiscountCodesInput(Input> discountCodes) { - if (discountCodes == null) { + public ShopPayPaymentRequestLineItemInput setSkuInput(Input sku) { + if (sku == null) { throw new IllegalArgumentException("Input can not be null"); } - this.discountCodes = discountCodes; + this.sku = sku; return this; } - public List getLineItems() { - return lineItems.getValue(); + public Boolean getRequiresShipping() { + return requiresShipping.getValue(); } - public Input> getLineItemsInput() { - return lineItems; + public Input getRequiresShippingInput() { + return requiresShipping; } - public ShopPayPaymentRequestInput setLineItems(List lineItems) { - this.lineItems = Input.optional(lineItems); + public ShopPayPaymentRequestLineItemInput setRequiresShipping(Boolean requiresShipping) { + this.requiresShipping = Input.optional(requiresShipping); return this; } - public ShopPayPaymentRequestInput setLineItemsInput(Input> lineItems) { - if (lineItems == null) { + public ShopPayPaymentRequestLineItemInput setRequiresShippingInput(Input requiresShipping) { + if (requiresShipping == null) { throw new IllegalArgumentException("Input can not be null"); } - this.lineItems = lineItems; + this.requiresShipping = requiresShipping; return this; } - public List getShippingLines() { - return shippingLines.getValue(); + public ShopPayPaymentRequestImageInput getImage() { + return image.getValue(); } - public Input> getShippingLinesInput() { - return shippingLines; + public Input getImageInput() { + return image; } - public ShopPayPaymentRequestInput setShippingLines(List shippingLines) { - this.shippingLines = Input.optional(shippingLines); + public ShopPayPaymentRequestLineItemInput setImage(ShopPayPaymentRequestImageInput image) { + this.image = Input.optional(image); return this; } - public ShopPayPaymentRequestInput setShippingLinesInput(Input> shippingLines) { - if (shippingLines == null) { + public ShopPayPaymentRequestLineItemInput setImageInput(Input image) { + if (image == null) { throw new IllegalArgumentException("Input can not be null"); } - this.shippingLines = shippingLines; + this.image = image; return this; } - public List getDiscounts() { - return discounts.getValue(); + public MoneyInput getOriginalLinePrice() { + return originalLinePrice.getValue(); } - public Input> getDiscountsInput() { - return discounts; + public Input getOriginalLinePriceInput() { + return originalLinePrice; } - public ShopPayPaymentRequestInput setDiscounts(List discounts) { - this.discounts = Input.optional(discounts); + public ShopPayPaymentRequestLineItemInput setOriginalLinePrice(MoneyInput originalLinePrice) { + this.originalLinePrice = Input.optional(originalLinePrice); return this; } - public ShopPayPaymentRequestInput setDiscountsInput(Input> discounts) { - if (discounts == null) { + public ShopPayPaymentRequestLineItemInput setOriginalLinePriceInput(Input originalLinePrice) { + if (originalLinePrice == null) { throw new IllegalArgumentException("Input can not be null"); } - this.discounts = discounts; + this.originalLinePrice = originalLinePrice; return this; } - public ShopPayPaymentRequestTotalShippingPriceInput getTotalShippingPrice() { - return totalShippingPrice.getValue(); + public MoneyInput getFinalLinePrice() { + return finalLinePrice.getValue(); } - public Input getTotalShippingPriceInput() { - return totalShippingPrice; + public Input getFinalLinePriceInput() { + return finalLinePrice; } - public ShopPayPaymentRequestInput setTotalShippingPrice(ShopPayPaymentRequestTotalShippingPriceInput totalShippingPrice) { - this.totalShippingPrice = Input.optional(totalShippingPrice); + public ShopPayPaymentRequestLineItemInput setFinalLinePrice(MoneyInput finalLinePrice) { + this.finalLinePrice = Input.optional(finalLinePrice); return this; } - public ShopPayPaymentRequestInput setTotalShippingPriceInput(Input totalShippingPrice) { - if (totalShippingPrice == null) { + public ShopPayPaymentRequestLineItemInput setFinalLinePriceInput(Input finalLinePrice) { + if (finalLinePrice == null) { throw new IllegalArgumentException("Input can not be null"); } - this.totalShippingPrice = totalShippingPrice; + this.finalLinePrice = finalLinePrice; return this; } - public MoneyInput getTotalTax() { - return totalTax.getValue(); + public List getLineDiscounts() { + return lineDiscounts.getValue(); } - public Input getTotalTaxInput() { - return totalTax; + public Input> getLineDiscountsInput() { + return lineDiscounts; } - public ShopPayPaymentRequestInput setTotalTax(MoneyInput totalTax) { - this.totalTax = Input.optional(totalTax); + public ShopPayPaymentRequestLineItemInput setLineDiscounts(List lineDiscounts) { + this.lineDiscounts = Input.optional(lineDiscounts); return this; } - public ShopPayPaymentRequestInput setTotalTaxInput(Input totalTax) { - if (totalTax == null) { + public ShopPayPaymentRequestLineItemInput setLineDiscountsInput(Input> lineDiscounts) { + if (lineDiscounts == null) { throw new IllegalArgumentException("Input can not be null"); } - this.totalTax = totalTax; + this.lineDiscounts = lineDiscounts; return this; } - public List getDeliveryMethods() { - return deliveryMethods.getValue(); + public MoneyInput getOriginalItemPrice() { + return originalItemPrice.getValue(); } - public Input> getDeliveryMethodsInput() { - return deliveryMethods; + public Input getOriginalItemPriceInput() { + return originalItemPrice; } - public ShopPayPaymentRequestInput setDeliveryMethods(List deliveryMethods) { - this.deliveryMethods = Input.optional(deliveryMethods); + public ShopPayPaymentRequestLineItemInput setOriginalItemPrice(MoneyInput originalItemPrice) { + this.originalItemPrice = Input.optional(originalItemPrice); return this; } - public ShopPayPaymentRequestInput setDeliveryMethodsInput(Input> deliveryMethods) { - if (deliveryMethods == null) { + public ShopPayPaymentRequestLineItemInput setOriginalItemPriceInput(Input originalItemPrice) { + if (originalItemPrice == null) { throw new IllegalArgumentException("Input can not be null"); } - this.deliveryMethods = deliveryMethods; + this.originalItemPrice = originalItemPrice; return this; } - public ShopPayPaymentRequestDeliveryMethodType getSelectedDeliveryMethodType() { - return selectedDeliveryMethodType.getValue(); + public MoneyInput getFinalItemPrice() { + return finalItemPrice.getValue(); } - public Input getSelectedDeliveryMethodTypeInput() { - return selectedDeliveryMethodType; + public Input getFinalItemPriceInput() { + return finalItemPrice; } - public ShopPayPaymentRequestInput setSelectedDeliveryMethodType(ShopPayPaymentRequestDeliveryMethodType selectedDeliveryMethodType) { - this.selectedDeliveryMethodType = Input.optional(selectedDeliveryMethodType); + public ShopPayPaymentRequestLineItemInput setFinalItemPrice(MoneyInput finalItemPrice) { + this.finalItemPrice = Input.optional(finalItemPrice); return this; } - public ShopPayPaymentRequestInput setSelectedDeliveryMethodTypeInput(Input selectedDeliveryMethodType) { - if (selectedDeliveryMethodType == null) { + public ShopPayPaymentRequestLineItemInput setFinalItemPriceInput(Input finalItemPrice) { + if (finalItemPrice == null) { throw new IllegalArgumentException("Input can not be null"); } - this.selectedDeliveryMethodType = selectedDeliveryMethodType; + this.finalItemPrice = finalItemPrice; return this; } - public String getPaymentMethod() { - return paymentMethod.getValue(); + public List getItemDiscounts() { + return itemDiscounts.getValue(); } - public Input getPaymentMethodInput() { - return paymentMethod; + public Input> getItemDiscountsInput() { + return itemDiscounts; } - public ShopPayPaymentRequestInput setPaymentMethod(String paymentMethod) { - this.paymentMethod = Input.optional(paymentMethod); + public ShopPayPaymentRequestLineItemInput setItemDiscounts(List itemDiscounts) { + this.itemDiscounts = Input.optional(itemDiscounts); return this; } - public ShopPayPaymentRequestInput setPaymentMethodInput(Input paymentMethod) { - if (paymentMethod == null) { + public ShopPayPaymentRequestLineItemInput setItemDiscountsInput(Input> itemDiscounts) { + if (itemDiscounts == null) { throw new IllegalArgumentException("Input can not be null"); } - this.paymentMethod = paymentMethod; + this.itemDiscounts = itemDiscounts; return this; } @@ -67979,135 +71460,84 @@ public void appendTo(StringBuilder _queryBuilder) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("total:"); - total.appendTo(_queryBuilder); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("subtotal:"); - subtotal.appendTo(_queryBuilder); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("locale:"); - Query.appendQuotedString(_queryBuilder, locale.toString()); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("presentmentCurrency:"); - _queryBuilder.append(presentmentCurrency.toString()); + _queryBuilder.append("quantity:"); + _queryBuilder.append(quantity); - if (this.discountCodes.isDefined()) { + if (this.label.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("discountCodes:"); - if (discountCodes.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (String item1 : discountCodes.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - Query.appendQuotedString(_queryBuilder, item1.toString()); - } - } - _queryBuilder.append(']'); + _queryBuilder.append("label:"); + if (label.getValue() != null) { + Query.appendQuotedString(_queryBuilder, label.getValue().toString()); } else { _queryBuilder.append("null"); } } - if (this.lineItems.isDefined()) { + if (this.sku.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("lineItems:"); - if (lineItems.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (ShopPayPaymentRequestLineItemInput item1 : lineItems.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); + _queryBuilder.append("sku:"); + if (sku.getValue() != null) { + Query.appendQuotedString(_queryBuilder, sku.getValue().toString()); } else { _queryBuilder.append("null"); } } - if (this.shippingLines.isDefined()) { + if (this.requiresShipping.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("shippingLines:"); - if (shippingLines.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (ShopPayPaymentRequestShippingLineInput item1 : shippingLines.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); + _queryBuilder.append("requiresShipping:"); + if (requiresShipping.getValue() != null) { + _queryBuilder.append(requiresShipping.getValue()); } else { _queryBuilder.append("null"); } } - if (this.discounts.isDefined()) { + if (this.image.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("discounts:"); - if (discounts.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (ShopPayPaymentRequestDiscountInput item1 : discounts.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); + _queryBuilder.append("image:"); + if (image.getValue() != null) { + image.getValue().appendTo(_queryBuilder); } else { _queryBuilder.append("null"); } } - if (this.totalShippingPrice.isDefined()) { + if (this.originalLinePrice.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("totalShippingPrice:"); - if (totalShippingPrice.getValue() != null) { - totalShippingPrice.getValue().appendTo(_queryBuilder); + _queryBuilder.append("originalLinePrice:"); + if (originalLinePrice.getValue() != null) { + originalLinePrice.getValue().appendTo(_queryBuilder); } else { _queryBuilder.append("null"); } } - if (this.totalTax.isDefined()) { + if (this.finalLinePrice.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("totalTax:"); - if (totalTax.getValue() != null) { - totalTax.getValue().appendTo(_queryBuilder); + _queryBuilder.append("finalLinePrice:"); + if (finalLinePrice.getValue() != null) { + finalLinePrice.getValue().appendTo(_queryBuilder); } else { _queryBuilder.append("null"); } } - if (this.deliveryMethods.isDefined()) { + if (this.lineDiscounts.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("deliveryMethods:"); - if (deliveryMethods.getValue() != null) { + _queryBuilder.append("lineDiscounts:"); + if (lineDiscounts.getValue() != null) { _queryBuilder.append('['); { String listSeperator1 = ""; - for (ShopPayPaymentRequestDeliveryMethodInput item1 : deliveryMethods.getValue()) { + for (ShopPayPaymentRequestDiscountInput item1 : lineDiscounts.getValue()) { _queryBuilder.append(listSeperator1); listSeperator1 = ","; item1.appendTo(_queryBuilder); @@ -68119,291 +71549,122 @@ public void appendTo(StringBuilder _queryBuilder) { } } - if (this.selectedDeliveryMethodType.isDefined()) { + if (this.originalItemPrice.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("selectedDeliveryMethodType:"); - if (selectedDeliveryMethodType.getValue() != null) { - _queryBuilder.append(selectedDeliveryMethodType.getValue().toString()); + _queryBuilder.append("originalItemPrice:"); + if (originalItemPrice.getValue() != null) { + originalItemPrice.getValue().appendTo(_queryBuilder); } else { _queryBuilder.append("null"); } } - if (this.paymentMethod.isDefined()) { + if (this.finalItemPrice.isDefined()) { _queryBuilder.append(separator); separator = ","; - _queryBuilder.append("paymentMethod:"); - if (paymentMethod.getValue() != null) { - Query.appendQuotedString(_queryBuilder, paymentMethod.getValue().toString()); + _queryBuilder.append("finalItemPrice:"); + if (finalItemPrice.getValue() != null) { + finalItemPrice.getValue().appendTo(_queryBuilder); } else { _queryBuilder.append("null"); } } - _queryBuilder.append('}'); - } - } - - public interface ShopPayPaymentRequestLineItemQueryDefinition { - void define(ShopPayPaymentRequestLineItemQuery _queryBuilder); - } - - /** - * Represents a line item for a Shop Pay payment request. - */ - public static class ShopPayPaymentRequestLineItemQuery extends Query { - ShopPayPaymentRequestLineItemQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); - } - - /** - * The final item price for the line item. - */ - public ShopPayPaymentRequestLineItemQuery finalItemPrice(MoneyV2QueryDefinition queryDef) { - startField("finalItemPrice"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The final line price for the line item. - */ - public ShopPayPaymentRequestLineItemQuery finalLinePrice(MoneyV2QueryDefinition queryDef) { - startField("finalLinePrice"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The image of the line item. - */ - public ShopPayPaymentRequestLineItemQuery image(ShopPayPaymentRequestImageQueryDefinition queryDef) { - startField("image"); - - _queryBuilder.append('{'); - queryDef.define(new ShopPayPaymentRequestImageQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The item discounts for the line item. - */ - public ShopPayPaymentRequestLineItemQuery itemDiscounts(ShopPayPaymentRequestDiscountQueryDefinition queryDef) { - startField("itemDiscounts"); - - _queryBuilder.append('{'); - queryDef.define(new ShopPayPaymentRequestDiscountQuery(_queryBuilder)); - _queryBuilder.append('}'); - - return this; - } - - /** - * The label of the line item. - */ - public ShopPayPaymentRequestLineItemQuery label() { - startField("label"); - - return this; - } - - /** - * The line discounts for the line item. - */ - public ShopPayPaymentRequestLineItemQuery lineDiscounts(ShopPayPaymentRequestDiscountQueryDefinition queryDef) { - startField("lineDiscounts"); + if (this.itemDiscounts.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("itemDiscounts:"); + if (itemDiscounts.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ShopPayPaymentRequestDiscountInput item1 : itemDiscounts.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } + } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } - _queryBuilder.append('{'); - queryDef.define(new ShopPayPaymentRequestDiscountQuery(_queryBuilder)); _queryBuilder.append('}'); - - return this; } + } - /** - * The original item price for the line item. - */ - public ShopPayPaymentRequestLineItemQuery originalItemPrice(MoneyV2QueryDefinition queryDef) { - startField("originalItemPrice"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public interface ShopPayPaymentRequestReceiptQueryDefinition { + void define(ShopPayPaymentRequestReceiptQuery _queryBuilder); + } - return this; + /** + * Represents a receipt for a Shop Pay payment request. + */ + public static class ShopPayPaymentRequestReceiptQuery extends Query { + ShopPayPaymentRequestReceiptQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The original line price for the line item. + * The payment request object. */ - public ShopPayPaymentRequestLineItemQuery originalLinePrice(MoneyV2QueryDefinition queryDef) { - startField("originalLinePrice"); + public ShopPayPaymentRequestReceiptQuery paymentRequest(ShopPayPaymentRequestQueryDefinition queryDef) { + startField("paymentRequest"); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new ShopPayPaymentRequestQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The quantity of the line item. - */ - public ShopPayPaymentRequestLineItemQuery quantity() { - startField("quantity"); - - return this; - } - - /** - * Whether the line item requires shipping. + * The processing status. */ - public ShopPayPaymentRequestLineItemQuery requiresShipping() { - startField("requiresShipping"); + public ShopPayPaymentRequestReceiptQuery processingStatusType() { + startField("processingStatusType"); return this; } /** - * The SKU of the line item. + * The token of the receipt. */ - public ShopPayPaymentRequestLineItemQuery sku() { - startField("sku"); + public ShopPayPaymentRequestReceiptQuery token() { + startField("token"); return this; } } /** - * Represents a line item for a Shop Pay payment request. + * Represents a receipt for a Shop Pay payment request. */ - public static class ShopPayPaymentRequestLineItem extends AbstractResponse { - public ShopPayPaymentRequestLineItem() { + public static class ShopPayPaymentRequestReceipt extends AbstractResponse { + public ShopPayPaymentRequestReceipt() { } - public ShopPayPaymentRequestLineItem(JsonObject fields) throws SchemaViolationError { + public ShopPayPaymentRequestReceipt(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "finalItemPrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "finalLinePrice": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); - - break; - } - - case "image": { - ShopPayPaymentRequestImage optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ShopPayPaymentRequestImage(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "itemDiscounts": { - List optional1 = null; - if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ShopPayPaymentRequestDiscount(jsonAsObject(element1, key))); - } - - optional1 = list1; - } - - responseData.put(key, optional1); + case "paymentRequest": { + responseData.put(key, new ShopPayPaymentRequest(jsonAsObject(field.getValue(), key))); break; } - case "label": { + case "processingStatusType": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "lineDiscounts": { - List optional1 = null; - if (!field.getValue().isJsonNull()) { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ShopPayPaymentRequestDiscount(jsonAsObject(element1, key))); - } - - optional1 = list1; - } - - responseData.put(key, optional1); - - break; - } - - case "originalItemPrice": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "originalLinePrice": { - MoneyV2 optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); - } - - responseData.put(key, optional1); - - break; - } - - case "quantity": { - responseData.put(key, jsonAsInteger(field.getValue(), key)); - - break; - } - - case "requiresShipping": { - Boolean optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsBoolean(field.getValue(), key); - } - - responseData.put(key, optional1); - - break; - } - - case "sku": { - String optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = jsonAsString(field.getValue(), key); - } - - responseData.put(key, optional1); + case "token": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -68420,637 +71681,551 @@ public ShopPayPaymentRequestLineItem(JsonObject fields) throws SchemaViolationEr } public String getGraphQlTypeName() { - return "ShopPayPaymentRequestLineItem"; + return "ShopPayPaymentRequestReceipt"; } /** - * The final item price for the line item. + * The payment request object. */ - public MoneyV2 getFinalItemPrice() { - return (MoneyV2) get("finalItemPrice"); + public ShopPayPaymentRequest getPaymentRequest() { + return (ShopPayPaymentRequest) get("paymentRequest"); } - public ShopPayPaymentRequestLineItem setFinalItemPrice(MoneyV2 arg) { - optimisticData.put(getKey("finalItemPrice"), arg); + public ShopPayPaymentRequestReceipt setPaymentRequest(ShopPayPaymentRequest arg) { + optimisticData.put(getKey("paymentRequest"), arg); return this; } /** - * The final line price for the line item. + * The processing status. */ - public MoneyV2 getFinalLinePrice() { - return (MoneyV2) get("finalLinePrice"); + public String getProcessingStatusType() { + return (String) get("processingStatusType"); } - public ShopPayPaymentRequestLineItem setFinalLinePrice(MoneyV2 arg) { - optimisticData.put(getKey("finalLinePrice"), arg); + public ShopPayPaymentRequestReceipt setProcessingStatusType(String arg) { + optimisticData.put(getKey("processingStatusType"), arg); return this; } /** - * The image of the line item. + * The token of the receipt. */ - public ShopPayPaymentRequestImage getImage() { - return (ShopPayPaymentRequestImage) get("image"); + public String getToken() { + return (String) get("token"); } - public ShopPayPaymentRequestLineItem setImage(ShopPayPaymentRequestImage arg) { - optimisticData.put(getKey("image"), arg); + public ShopPayPaymentRequestReceipt setToken(String arg) { + optimisticData.put(getKey("token"), arg); return this; } - /** - * The item discounts for the line item. - */ + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "paymentRequest": return true; - public List getItemDiscounts() { - return (List) get("itemDiscounts"); + case "processingStatusType": return false; + + case "token": return false; + + default: return false; + } } + } - public ShopPayPaymentRequestLineItem setItemDiscounts(List arg) { - optimisticData.put(getKey("itemDiscounts"), arg); - return this; + public interface ShopPayPaymentRequestSessionQueryDefinition { + void define(ShopPayPaymentRequestSessionQuery _queryBuilder); + } + + /** + * Represents a Shop Pay payment request session. + */ + public static class ShopPayPaymentRequestSessionQuery extends Query { + ShopPayPaymentRequestSessionQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } /** - * The label of the line item. + * The checkout URL of the Shop Pay payment request session. */ + public ShopPayPaymentRequestSessionQuery checkoutUrl() { + startField("checkoutUrl"); - public String getLabel() { - return (String) get("label"); - } - - public ShopPayPaymentRequestLineItem setLabel(String arg) { - optimisticData.put(getKey("label"), arg); return this; } /** - * The line discounts for the line item. + * The payment request associated with the Shop Pay payment request session. */ + public ShopPayPaymentRequestSessionQuery paymentRequest(ShopPayPaymentRequestQueryDefinition queryDef) { + startField("paymentRequest"); - public List getLineDiscounts() { - return (List) get("lineDiscounts"); - } + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ShopPayPaymentRequestLineItem setLineDiscounts(List arg) { - optimisticData.put(getKey("lineDiscounts"), arg); return this; } /** - * The original item price for the line item. + * The source identifier of the Shop Pay payment request session. */ + public ShopPayPaymentRequestSessionQuery sourceIdentifier() { + startField("sourceIdentifier"); - public MoneyV2 getOriginalItemPrice() { - return (MoneyV2) get("originalItemPrice"); + return this; } - public ShopPayPaymentRequestLineItem setOriginalItemPrice(MoneyV2 arg) { - optimisticData.put(getKey("originalItemPrice"), arg); + /** + * The token of the Shop Pay payment request session. + */ + public ShopPayPaymentRequestSessionQuery token() { + startField("token"); + return this; } + } + + /** + * Represents a Shop Pay payment request session. + */ + public static class ShopPayPaymentRequestSession extends AbstractResponse { + public ShopPayPaymentRequestSession() { + } + + public ShopPayPaymentRequestSession(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "checkoutUrl": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "paymentRequest": { + responseData.put(key, new ShopPayPaymentRequest(jsonAsObject(field.getValue(), key))); + + break; + } + + case "sourceIdentifier": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "token": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public String getGraphQlTypeName() { + return "ShopPayPaymentRequestSession"; + } /** - * The original line price for the line item. + * The checkout URL of the Shop Pay payment request session. */ - public MoneyV2 getOriginalLinePrice() { - return (MoneyV2) get("originalLinePrice"); + public String getCheckoutUrl() { + return (String) get("checkoutUrl"); } - public ShopPayPaymentRequestLineItem setOriginalLinePrice(MoneyV2 arg) { - optimisticData.put(getKey("originalLinePrice"), arg); + public ShopPayPaymentRequestSession setCheckoutUrl(String arg) { + optimisticData.put(getKey("checkoutUrl"), arg); return this; } /** - * The quantity of the line item. + * The payment request associated with the Shop Pay payment request session. */ - public Integer getQuantity() { - return (Integer) get("quantity"); + public ShopPayPaymentRequest getPaymentRequest() { + return (ShopPayPaymentRequest) get("paymentRequest"); } - public ShopPayPaymentRequestLineItem setQuantity(Integer arg) { - optimisticData.put(getKey("quantity"), arg); + public ShopPayPaymentRequestSession setPaymentRequest(ShopPayPaymentRequest arg) { + optimisticData.put(getKey("paymentRequest"), arg); return this; } /** - * Whether the line item requires shipping. + * The source identifier of the Shop Pay payment request session. */ - public Boolean getRequiresShipping() { - return (Boolean) get("requiresShipping"); + public String getSourceIdentifier() { + return (String) get("sourceIdentifier"); } - public ShopPayPaymentRequestLineItem setRequiresShipping(Boolean arg) { - optimisticData.put(getKey("requiresShipping"), arg); + public ShopPayPaymentRequestSession setSourceIdentifier(String arg) { + optimisticData.put(getKey("sourceIdentifier"), arg); return this; } /** - * The SKU of the line item. + * The token of the Shop Pay payment request session. */ - public String getSku() { - return (String) get("sku"); + public String getToken() { + return (String) get("token"); } - public ShopPayPaymentRequestLineItem setSku(String arg) { - optimisticData.put(getKey("sku"), arg); + public ShopPayPaymentRequestSession setToken(String arg) { + optimisticData.put(getKey("token"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "finalItemPrice": return true; - - case "finalLinePrice": return true; - - case "image": return true; - - case "itemDiscounts": return true; - - case "label": return false; - - case "lineDiscounts": return true; - - case "originalItemPrice": return true; - - case "originalLinePrice": return true; + case "checkoutUrl": return false; - case "quantity": return false; + case "paymentRequest": return true; - case "requiresShipping": return false; + case "sourceIdentifier": return false; - case "sku": return false; + case "token": return false; default: return false; } } } - public static class ShopPayPaymentRequestLineItemInput implements Serializable { - private int quantity; - - private Input label = Input.undefined(); - - private Input sku = Input.undefined(); - - private Input requiresShipping = Input.undefined(); - - private Input image = Input.undefined(); - - private Input originalLinePrice = Input.undefined(); - - private Input finalLinePrice = Input.undefined(); - - private Input> lineDiscounts = Input.undefined(); - - private Input originalItemPrice = Input.undefined(); - - private Input finalItemPrice = Input.undefined(); - - private Input> itemDiscounts = Input.undefined(); + public interface ShopPayPaymentRequestSessionCreatePayloadQueryDefinition { + void define(ShopPayPaymentRequestSessionCreatePayloadQuery _queryBuilder); + } - public ShopPayPaymentRequestLineItemInput(int quantity) { - this.quantity = quantity; + /** + * Return type for `shopPayPaymentRequestSessionCreate` mutation. + */ + public static class ShopPayPaymentRequestSessionCreatePayloadQuery extends Query { + ShopPayPaymentRequestSessionCreatePayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } - public int getQuantity() { - return quantity; - } + /** + * The new Shop Pay payment request session object. + */ + public ShopPayPaymentRequestSessionCreatePayloadQuery shopPayPaymentRequestSession(ShopPayPaymentRequestSessionQueryDefinition queryDef) { + startField("shopPayPaymentRequestSession"); - public ShopPayPaymentRequestLineItemInput setQuantity(int quantity) { - this.quantity = quantity; - return this; - } + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestSessionQuery(_queryBuilder)); + _queryBuilder.append('}'); - public String getLabel() { - return label.getValue(); + return this; } - public Input getLabelInput() { - return label; - } + /** + * Error codes for failed Shop Pay payment request session mutations. + */ + public ShopPayPaymentRequestSessionCreatePayloadQuery userErrors(UserErrorsShopPayPaymentRequestSessionUserErrorsQueryDefinition queryDef) { + startField("userErrors"); - public ShopPayPaymentRequestLineItemInput setLabel(String label) { - this.label = Input.optional(label); - return this; - } + _queryBuilder.append('{'); + queryDef.define(new UserErrorsShopPayPaymentRequestSessionUserErrorsQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ShopPayPaymentRequestLineItemInput setLabelInput(Input label) { - if (label == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.label = label; return this; } + } - public String getSku() { - return sku.getValue(); + /** + * Return type for `shopPayPaymentRequestSessionCreate` mutation. + */ + public static class ShopPayPaymentRequestSessionCreatePayload extends AbstractResponse { + public ShopPayPaymentRequestSessionCreatePayload() { } - public Input getSkuInput() { - return sku; - } + public ShopPayPaymentRequestSessionCreatePayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "shopPayPaymentRequestSession": { + ShopPayPaymentRequestSession optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPayPaymentRequestSession(jsonAsObject(field.getValue(), key)); + } - public ShopPayPaymentRequestLineItemInput setSku(String sku) { - this.sku = Input.optional(sku); - return this; - } + responseData.put(key, optional1); - public ShopPayPaymentRequestLineItemInput setSkuInput(Input sku) { - if (sku == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.sku = sku; - return this; - } + break; + } - public Boolean getRequiresShipping() { - return requiresShipping.getValue(); - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserErrorsShopPayPaymentRequestSessionUserErrors(jsonAsObject(element1, key))); + } - public Input getRequiresShippingInput() { - return requiresShipping; - } + responseData.put(key, list1); - public ShopPayPaymentRequestLineItemInput setRequiresShipping(Boolean requiresShipping) { - this.requiresShipping = Input.optional(requiresShipping); - return this; - } + break; + } - public ShopPayPaymentRequestLineItemInput setRequiresShippingInput(Input requiresShipping) { - if (requiresShipping == null) { - throw new IllegalArgumentException("Input can not be null"); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } } - this.requiresShipping = requiresShipping; - return this; } - public ShopPayPaymentRequestImageInput getImage() { - return image.getValue(); + public String getGraphQlTypeName() { + return "ShopPayPaymentRequestSessionCreatePayload"; } - public Input getImageInput() { - return image; - } + /** + * The new Shop Pay payment request session object. + */ - public ShopPayPaymentRequestLineItemInput setImage(ShopPayPaymentRequestImageInput image) { - this.image = Input.optional(image); - return this; + public ShopPayPaymentRequestSession getShopPayPaymentRequestSession() { + return (ShopPayPaymentRequestSession) get("shopPayPaymentRequestSession"); } - public ShopPayPaymentRequestLineItemInput setImageInput(Input image) { - if (image == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.image = image; + public ShopPayPaymentRequestSessionCreatePayload setShopPayPaymentRequestSession(ShopPayPaymentRequestSession arg) { + optimisticData.put(getKey("shopPayPaymentRequestSession"), arg); return this; } - public MoneyInput getOriginalLinePrice() { - return originalLinePrice.getValue(); - } + /** + * Error codes for failed Shop Pay payment request session mutations. + */ - public Input getOriginalLinePriceInput() { - return originalLinePrice; + public List getUserErrors() { + return (List) get("userErrors"); } - public ShopPayPaymentRequestLineItemInput setOriginalLinePrice(MoneyInput originalLinePrice) { - this.originalLinePrice = Input.optional(originalLinePrice); + public ShopPayPaymentRequestSessionCreatePayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); return this; } - public ShopPayPaymentRequestLineItemInput setOriginalLinePriceInput(Input originalLinePrice) { - if (originalLinePrice == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.originalLinePrice = originalLinePrice; - return this; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "shopPayPaymentRequestSession": return true; - public MoneyInput getFinalLinePrice() { - return finalLinePrice.getValue(); - } + case "userErrors": return true; - public Input getFinalLinePriceInput() { - return finalLinePrice; + default: return false; + } } + } - public ShopPayPaymentRequestLineItemInput setFinalLinePrice(MoneyInput finalLinePrice) { - this.finalLinePrice = Input.optional(finalLinePrice); - return this; - } + public interface ShopPayPaymentRequestSessionSubmitPayloadQueryDefinition { + void define(ShopPayPaymentRequestSessionSubmitPayloadQuery _queryBuilder); + } - public ShopPayPaymentRequestLineItemInput setFinalLinePriceInput(Input finalLinePrice) { - if (finalLinePrice == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.finalLinePrice = finalLinePrice; - return this; + /** + * Return type for `shopPayPaymentRequestSessionSubmit` mutation. + */ + public static class ShopPayPaymentRequestSessionSubmitPayloadQuery extends Query { + ShopPayPaymentRequestSessionSubmitPayloadQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } - public List getLineDiscounts() { - return lineDiscounts.getValue(); - } + /** + * The checkout on which the payment was applied. + */ + public ShopPayPaymentRequestSessionSubmitPayloadQuery paymentRequestReceipt(ShopPayPaymentRequestReceiptQueryDefinition queryDef) { + startField("paymentRequestReceipt"); - public Input> getLineDiscountsInput() { - return lineDiscounts; - } + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestReceiptQuery(_queryBuilder)); + _queryBuilder.append('}'); - public ShopPayPaymentRequestLineItemInput setLineDiscounts(List lineDiscounts) { - this.lineDiscounts = Input.optional(lineDiscounts); return this; } - public ShopPayPaymentRequestLineItemInput setLineDiscountsInput(Input> lineDiscounts) { - if (lineDiscounts == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.lineDiscounts = lineDiscounts; + /** + * Error codes for failed Shop Pay payment request session mutations. + */ + public ShopPayPaymentRequestSessionSubmitPayloadQuery userErrors(UserErrorsShopPayPaymentRequestSessionUserErrorsQueryDefinition queryDef) { + startField("userErrors"); + + _queryBuilder.append('{'); + queryDef.define(new UserErrorsShopPayPaymentRequestSessionUserErrorsQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; } + } - public MoneyInput getOriginalItemPrice() { - return originalItemPrice.getValue(); + /** + * Return type for `shopPayPaymentRequestSessionSubmit` mutation. + */ + public static class ShopPayPaymentRequestSessionSubmitPayload extends AbstractResponse { + public ShopPayPaymentRequestSessionSubmitPayload() { } - public Input getOriginalItemPriceInput() { - return originalItemPrice; - } + public ShopPayPaymentRequestSessionSubmitPayload(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "paymentRequestReceipt": { + ShopPayPaymentRequestReceipt optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ShopPayPaymentRequestReceipt(jsonAsObject(field.getValue(), key)); + } - public ShopPayPaymentRequestLineItemInput setOriginalItemPrice(MoneyInput originalItemPrice) { - this.originalItemPrice = Input.optional(originalItemPrice); - return this; - } + responseData.put(key, optional1); - public ShopPayPaymentRequestLineItemInput setOriginalItemPriceInput(Input originalItemPrice) { - if (originalItemPrice == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.originalItemPrice = originalItemPrice; - return this; - } + break; + } - public MoneyInput getFinalItemPrice() { - return finalItemPrice.getValue(); - } + case "userErrors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new UserErrorsShopPayPaymentRequestSessionUserErrors(jsonAsObject(element1, key))); + } - public Input getFinalItemPriceInput() { - return finalItemPrice; - } + responseData.put(key, list1); - public ShopPayPaymentRequestLineItemInput setFinalItemPrice(MoneyInput finalItemPrice) { - this.finalItemPrice = Input.optional(finalItemPrice); - return this; - } + break; + } - public ShopPayPaymentRequestLineItemInput setFinalItemPriceInput(Input finalItemPrice) { - if (finalItemPrice == null) { - throw new IllegalArgumentException("Input can not be null"); + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } } - this.finalItemPrice = finalItemPrice; - return this; } - public List getItemDiscounts() { - return itemDiscounts.getValue(); + public String getGraphQlTypeName() { + return "ShopPayPaymentRequestSessionSubmitPayload"; } - public Input> getItemDiscountsInput() { - return itemDiscounts; - } + /** + * The checkout on which the payment was applied. + */ - public ShopPayPaymentRequestLineItemInput setItemDiscounts(List itemDiscounts) { - this.itemDiscounts = Input.optional(itemDiscounts); - return this; + public ShopPayPaymentRequestReceipt getPaymentRequestReceipt() { + return (ShopPayPaymentRequestReceipt) get("paymentRequestReceipt"); } - public ShopPayPaymentRequestLineItemInput setItemDiscountsInput(Input> itemDiscounts) { - if (itemDiscounts == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.itemDiscounts = itemDiscounts; + public ShopPayPaymentRequestSessionSubmitPayload setPaymentRequestReceipt(ShopPayPaymentRequestReceipt arg) { + optimisticData.put(getKey("paymentRequestReceipt"), arg); return this; } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("quantity:"); - _queryBuilder.append(quantity); - - if (this.label.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("label:"); - if (label.getValue() != null) { - Query.appendQuotedString(_queryBuilder, label.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.sku.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("sku:"); - if (sku.getValue() != null) { - Query.appendQuotedString(_queryBuilder, sku.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.requiresShipping.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("requiresShipping:"); - if (requiresShipping.getValue() != null) { - _queryBuilder.append(requiresShipping.getValue()); - } else { - _queryBuilder.append("null"); - } - } - - if (this.image.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("image:"); - if (image.getValue() != null) { - image.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); - } - } - - if (this.originalLinePrice.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("originalLinePrice:"); - if (originalLinePrice.getValue() != null) { - originalLinePrice.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); - } - } + /** + * Error codes for failed Shop Pay payment request session mutations. + */ - if (this.finalLinePrice.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("finalLinePrice:"); - if (finalLinePrice.getValue() != null) { - finalLinePrice.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); - } - } + public List getUserErrors() { + return (List) get("userErrors"); + } - if (this.lineDiscounts.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("lineDiscounts:"); - if (lineDiscounts.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (ShopPayPaymentRequestDiscountInput item1 : lineDiscounts.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - } else { - _queryBuilder.append("null"); - } - } + public ShopPayPaymentRequestSessionSubmitPayload setUserErrors(List arg) { + optimisticData.put(getKey("userErrors"), arg); + return this; + } - if (this.originalItemPrice.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("originalItemPrice:"); - if (originalItemPrice.getValue() != null) { - originalItemPrice.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); - } - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "paymentRequestReceipt": return true; - if (this.finalItemPrice.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("finalItemPrice:"); - if (finalItemPrice.getValue() != null) { - finalItemPrice.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); - } - } + case "userErrors": return true; - if (this.itemDiscounts.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("itemDiscounts:"); - if (itemDiscounts.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (ShopPayPaymentRequestDiscountInput item1 : itemDiscounts.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } - } - _queryBuilder.append(']'); - } else { - _queryBuilder.append("null"); - } + default: return false; } - - _queryBuilder.append('}'); } } - public interface ShopPayPaymentRequestReceiptQueryDefinition { - void define(ShopPayPaymentRequestReceiptQuery _queryBuilder); + public interface ShopPayPaymentRequestShippingLineQueryDefinition { + void define(ShopPayPaymentRequestShippingLineQuery _queryBuilder); } /** - * Represents a receipt for a Shop Pay payment request. + * Represents a shipping line for a Shop Pay payment request. */ - public static class ShopPayPaymentRequestReceiptQuery extends Query { - ShopPayPaymentRequestReceiptQuery(StringBuilder _queryBuilder) { + public static class ShopPayPaymentRequestShippingLineQuery extends Query { + ShopPayPaymentRequestShippingLineQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The payment request object. + * The amount for the shipping line. */ - public ShopPayPaymentRequestReceiptQuery paymentRequest(ShopPayPaymentRequestQueryDefinition queryDef) { - startField("paymentRequest"); + public ShopPayPaymentRequestShippingLineQuery amount(MoneyV2QueryDefinition queryDef) { + startField("amount"); _queryBuilder.append('{'); - queryDef.define(new ShopPayPaymentRequestQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The processing status. + * The code of the shipping line. */ - public ShopPayPaymentRequestReceiptQuery processingStatusType() { - startField("processingStatusType"); + public ShopPayPaymentRequestShippingLineQuery code() { + startField("code"); return this; } /** - * The token of the receipt. + * The label of the shipping line. */ - public ShopPayPaymentRequestReceiptQuery token() { - startField("token"); + public ShopPayPaymentRequestShippingLineQuery label() { + startField("label"); return this; } } /** - * Represents a receipt for a Shop Pay payment request. + * Represents a shipping line for a Shop Pay payment request. */ - public static class ShopPayPaymentRequestReceipt extends AbstractResponse { - public ShopPayPaymentRequestReceipt() { + public static class ShopPayPaymentRequestShippingLine extends AbstractResponse { + public ShopPayPaymentRequestShippingLine() { } - public ShopPayPaymentRequestReceipt(JsonObject fields) throws SchemaViolationError { + public ShopPayPaymentRequestShippingLine(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "paymentRequest": { - responseData.put(key, new ShopPayPaymentRequest(jsonAsObject(field.getValue(), key))); + case "amount": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "processingStatusType": { + case "code": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "token": { + case "label": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -69068,146 +72243,260 @@ public ShopPayPaymentRequestReceipt(JsonObject fields) throws SchemaViolationErr } public String getGraphQlTypeName() { - return "ShopPayPaymentRequestReceipt"; + return "ShopPayPaymentRequestShippingLine"; } /** - * The payment request object. + * The amount for the shipping line. */ - public ShopPayPaymentRequest getPaymentRequest() { - return (ShopPayPaymentRequest) get("paymentRequest"); + public MoneyV2 getAmount() { + return (MoneyV2) get("amount"); } - public ShopPayPaymentRequestReceipt setPaymentRequest(ShopPayPaymentRequest arg) { - optimisticData.put(getKey("paymentRequest"), arg); + public ShopPayPaymentRequestShippingLine setAmount(MoneyV2 arg) { + optimisticData.put(getKey("amount"), arg); return this; } /** - * The processing status. + * The code of the shipping line. */ - public String getProcessingStatusType() { - return (String) get("processingStatusType"); + public String getCode() { + return (String) get("code"); } - public ShopPayPaymentRequestReceipt setProcessingStatusType(String arg) { - optimisticData.put(getKey("processingStatusType"), arg); + public ShopPayPaymentRequestShippingLine setCode(String arg) { + optimisticData.put(getKey("code"), arg); return this; } /** - * The token of the receipt. + * The label of the shipping line. */ - public String getToken() { - return (String) get("token"); + public String getLabel() { + return (String) get("label"); } - public ShopPayPaymentRequestReceipt setToken(String arg) { - optimisticData.put(getKey("token"), arg); + public ShopPayPaymentRequestShippingLine setLabel(String arg) { + optimisticData.put(getKey("label"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "paymentRequest": return true; + case "amount": return true; - case "processingStatusType": return false; + case "code": return false; + + case "label": return false; + + default: return false; + } + } + } + + public static class ShopPayPaymentRequestShippingLineInput implements Serializable { + private Input code = Input.undefined(); + + private Input label = Input.undefined(); + + private Input amount = Input.undefined(); + + public String getCode() { + return code.getValue(); + } + + public Input getCodeInput() { + return code; + } + + public ShopPayPaymentRequestShippingLineInput setCode(String code) { + this.code = Input.optional(code); + return this; + } + + public ShopPayPaymentRequestShippingLineInput setCodeInput(Input code) { + if (code == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.code = code; + return this; + } + + public String getLabel() { + return label.getValue(); + } + + public Input getLabelInput() { + return label; + } + + public ShopPayPaymentRequestShippingLineInput setLabel(String label) { + this.label = Input.optional(label); + return this; + } + + public ShopPayPaymentRequestShippingLineInput setLabelInput(Input label) { + if (label == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.label = label; + return this; + } + + public MoneyInput getAmount() { + return amount.getValue(); + } + + public Input getAmountInput() { + return amount; + } + + public ShopPayPaymentRequestShippingLineInput setAmount(MoneyInput amount) { + this.amount = Input.optional(amount); + return this; + } + + public ShopPayPaymentRequestShippingLineInput setAmountInput(Input amount) { + if (amount == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.amount = amount; + return this; + } + + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); + + if (this.code.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("code:"); + if (code.getValue() != null) { + Query.appendQuotedString(_queryBuilder, code.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - case "token": return false; + if (this.label.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("label:"); + if (label.getValue() != null) { + Query.appendQuotedString(_queryBuilder, label.getValue().toString()); + } else { + _queryBuilder.append("null"); + } + } - default: return false; + if (this.amount.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("amount:"); + if (amount.getValue() != null) { + amount.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } } + + _queryBuilder.append('}'); } } - public interface ShopPayPaymentRequestSessionQueryDefinition { - void define(ShopPayPaymentRequestSessionQuery _queryBuilder); + public interface ShopPayPaymentRequestTotalShippingPriceQueryDefinition { + void define(ShopPayPaymentRequestTotalShippingPriceQuery _queryBuilder); } /** - * Represents a Shop Pay payment request session. + * Represents a shipping total for a Shop Pay payment request. */ - public static class ShopPayPaymentRequestSessionQuery extends Query { - ShopPayPaymentRequestSessionQuery(StringBuilder _queryBuilder) { + public static class ShopPayPaymentRequestTotalShippingPriceQuery extends Query { + ShopPayPaymentRequestTotalShippingPriceQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The checkout URL of the Shop Pay payment request session. + * The discounts for the shipping total. */ - public ShopPayPaymentRequestSessionQuery checkoutUrl() { - startField("checkoutUrl"); + public ShopPayPaymentRequestTotalShippingPriceQuery discounts(ShopPayPaymentRequestDiscountQueryDefinition queryDef) { + startField("discounts"); + + _queryBuilder.append('{'); + queryDef.define(new ShopPayPaymentRequestDiscountQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * The payment request associated with the Shop Pay payment request session. + * The final total for the shipping total. */ - public ShopPayPaymentRequestSessionQuery paymentRequest(ShopPayPaymentRequestQueryDefinition queryDef) { - startField("paymentRequest"); + public ShopPayPaymentRequestTotalShippingPriceQuery finalTotal(MoneyV2QueryDefinition queryDef) { + startField("finalTotal"); _queryBuilder.append('{'); - queryDef.define(new ShopPayPaymentRequestQuery(_queryBuilder)); + queryDef.define(new MoneyV2Query(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The source identifier of the Shop Pay payment request session. + * The original total for the shipping total. */ - public ShopPayPaymentRequestSessionQuery sourceIdentifier() { - startField("sourceIdentifier"); - - return this; - } + public ShopPayPaymentRequestTotalShippingPriceQuery originalTotal(MoneyV2QueryDefinition queryDef) { + startField("originalTotal"); - /** - * The token of the Shop Pay payment request session. - */ - public ShopPayPaymentRequestSessionQuery token() { - startField("token"); + _queryBuilder.append('{'); + queryDef.define(new MoneyV2Query(_queryBuilder)); + _queryBuilder.append('}'); return this; } } /** - * Represents a Shop Pay payment request session. + * Represents a shipping total for a Shop Pay payment request. */ - public static class ShopPayPaymentRequestSession extends AbstractResponse { - public ShopPayPaymentRequestSession() { + public static class ShopPayPaymentRequestTotalShippingPrice extends AbstractResponse { + public ShopPayPaymentRequestTotalShippingPrice() { } - public ShopPayPaymentRequestSession(JsonObject fields) throws SchemaViolationError { + public ShopPayPaymentRequestTotalShippingPrice(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "checkoutUrl": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } + case "discounts": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new ShopPayPaymentRequestDiscount(jsonAsObject(element1, key))); + } - case "paymentRequest": { - responseData.put(key, new ShopPayPaymentRequest(jsonAsObject(field.getValue(), key))); + responseData.put(key, list1); break; } - case "sourceIdentifier": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "finalTotal": { + responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); break; } - case "token": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "originalTotal": { + MoneyV2 optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } @@ -69224,270 +72513,317 @@ public ShopPayPaymentRequestSession(JsonObject fields) throws SchemaViolationErr } public String getGraphQlTypeName() { - return "ShopPayPaymentRequestSession"; - } - - /** - * The checkout URL of the Shop Pay payment request session. - */ - - public String getCheckoutUrl() { - return (String) get("checkoutUrl"); - } - - public ShopPayPaymentRequestSession setCheckoutUrl(String arg) { - optimisticData.put(getKey("checkoutUrl"), arg); - return this; + return "ShopPayPaymentRequestTotalShippingPrice"; } /** - * The payment request associated with the Shop Pay payment request session. + * The discounts for the shipping total. */ - public ShopPayPaymentRequest getPaymentRequest() { - return (ShopPayPaymentRequest) get("paymentRequest"); + public List getDiscounts() { + return (List) get("discounts"); } - public ShopPayPaymentRequestSession setPaymentRequest(ShopPayPaymentRequest arg) { - optimisticData.put(getKey("paymentRequest"), arg); + public ShopPayPaymentRequestTotalShippingPrice setDiscounts(List arg) { + optimisticData.put(getKey("discounts"), arg); return this; } /** - * The source identifier of the Shop Pay payment request session. + * The final total for the shipping total. */ - public String getSourceIdentifier() { - return (String) get("sourceIdentifier"); + public MoneyV2 getFinalTotal() { + return (MoneyV2) get("finalTotal"); } - public ShopPayPaymentRequestSession setSourceIdentifier(String arg) { - optimisticData.put(getKey("sourceIdentifier"), arg); + public ShopPayPaymentRequestTotalShippingPrice setFinalTotal(MoneyV2 arg) { + optimisticData.put(getKey("finalTotal"), arg); return this; } /** - * The token of the Shop Pay payment request session. + * The original total for the shipping total. */ - public String getToken() { - return (String) get("token"); + public MoneyV2 getOriginalTotal() { + return (MoneyV2) get("originalTotal"); } - public ShopPayPaymentRequestSession setToken(String arg) { - optimisticData.put(getKey("token"), arg); + public ShopPayPaymentRequestTotalShippingPrice setOriginalTotal(MoneyV2 arg) { + optimisticData.put(getKey("originalTotal"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "checkoutUrl": return false; - - case "paymentRequest": return true; + case "discounts": return true; - case "sourceIdentifier": return false; + case "finalTotal": return true; - case "token": return false; + case "originalTotal": return true; default: return false; } } } - public interface ShopPayPaymentRequestSessionCreatePayloadQueryDefinition { - void define(ShopPayPaymentRequestSessionCreatePayloadQuery _queryBuilder); - } + public static class ShopPayPaymentRequestTotalShippingPriceInput implements Serializable { + private Input> discounts = Input.undefined(); - /** - * Return type for `shopPayPaymentRequestSessionCreate` mutation. - */ - public static class ShopPayPaymentRequestSessionCreatePayloadQuery extends Query { - ShopPayPaymentRequestSessionCreatePayloadQuery(StringBuilder _queryBuilder) { - super(_queryBuilder); + private Input originalTotal = Input.undefined(); + + private Input finalTotal = Input.undefined(); + + public List getDiscounts() { + return discounts.getValue(); } - /** - * The new Shop Pay payment request session object. - */ - public ShopPayPaymentRequestSessionCreatePayloadQuery shopPayPaymentRequestSession(ShopPayPaymentRequestSessionQueryDefinition queryDef) { - startField("shopPayPaymentRequestSession"); + public Input> getDiscountsInput() { + return discounts; + } - _queryBuilder.append('{'); - queryDef.define(new ShopPayPaymentRequestSessionQuery(_queryBuilder)); - _queryBuilder.append('}'); + public ShopPayPaymentRequestTotalShippingPriceInput setDiscounts(List discounts) { + this.discounts = Input.optional(discounts); + return this; + } + public ShopPayPaymentRequestTotalShippingPriceInput setDiscountsInput(Input> discounts) { + if (discounts == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.discounts = discounts; return this; } - /** - * Error codes for failed Shop Pay payment request session mutations. - */ - public ShopPayPaymentRequestSessionCreatePayloadQuery userErrors(UserErrorsShopPayPaymentRequestSessionUserErrorsQueryDefinition queryDef) { - startField("userErrors"); + public MoneyInput getOriginalTotal() { + return originalTotal.getValue(); + } - _queryBuilder.append('{'); - queryDef.define(new UserErrorsShopPayPaymentRequestSessionUserErrorsQuery(_queryBuilder)); - _queryBuilder.append('}'); + public Input getOriginalTotalInput() { + return originalTotal; + } + public ShopPayPaymentRequestTotalShippingPriceInput setOriginalTotal(MoneyInput originalTotal) { + this.originalTotal = Input.optional(originalTotal); return this; } - } - /** - * Return type for `shopPayPaymentRequestSessionCreate` mutation. - */ - public static class ShopPayPaymentRequestSessionCreatePayload extends AbstractResponse { - public ShopPayPaymentRequestSessionCreatePayload() { + public ShopPayPaymentRequestTotalShippingPriceInput setOriginalTotalInput(Input originalTotal) { + if (originalTotal == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.originalTotal = originalTotal; + return this; } - public ShopPayPaymentRequestSessionCreatePayload(JsonObject fields) throws SchemaViolationError { - for (Map.Entry field : fields.entrySet()) { - String key = field.getKey(); - String fieldName = getFieldName(key); - switch (fieldName) { - case "shopPayPaymentRequestSession": { - ShopPayPaymentRequestSession optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ShopPayPaymentRequestSession(jsonAsObject(field.getValue(), key)); - } + public MoneyInput getFinalTotal() { + return finalTotal.getValue(); + } - responseData.put(key, optional1); + public Input getFinalTotalInput() { + return finalTotal; + } - break; - } + public ShopPayPaymentRequestTotalShippingPriceInput setFinalTotal(MoneyInput finalTotal) { + this.finalTotal = Input.optional(finalTotal); + return this; + } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserErrorsShopPayPaymentRequestSessionUserErrors(jsonAsObject(element1, key))); - } + public ShopPayPaymentRequestTotalShippingPriceInput setFinalTotalInput(Input finalTotal) { + if (finalTotal == null) { + throw new IllegalArgumentException("Input can not be null"); + } + this.finalTotal = finalTotal; + return this; + } - responseData.put(key, list1); + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - break; + if (this.discounts.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("discounts:"); + if (discounts.getValue() != null) { + _queryBuilder.append('['); + { + String listSeperator1 = ""; + for (ShopPayPaymentRequestDiscountInput item1 : discounts.getValue()) { + _queryBuilder.append(listSeperator1); + listSeperator1 = ","; + item1.appendTo(_queryBuilder); + } } + _queryBuilder.append(']'); + } else { + _queryBuilder.append("null"); + } + } - case "__typename": { - responseData.put(key, jsonAsString(field.getValue(), key)); - break; - } - default: { - throw new SchemaViolationError(this, key, field.getValue()); - } + if (this.originalTotal.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("originalTotal:"); + if (originalTotal.getValue() != null) { + originalTotal.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); } } - } - public String getGraphQlTypeName() { - return "ShopPayPaymentRequestSessionCreatePayload"; + if (this.finalTotal.isDefined()) { + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("finalTotal:"); + if (finalTotal.getValue() != null) { + finalTotal.getValue().appendTo(_queryBuilder); + } else { + _queryBuilder.append("null"); + } + } + + _queryBuilder.append('}'); } + } - /** - * The new Shop Pay payment request session object. - */ + public static class ShopPayWalletContentInput implements Serializable { + private MailingAddressInput billingAddress; - public ShopPayPaymentRequestSession getShopPayPaymentRequestSession() { - return (ShopPayPaymentRequestSession) get("shopPayPaymentRequestSession"); + private String sessionToken; + + public ShopPayWalletContentInput(MailingAddressInput billingAddress, String sessionToken) { + this.billingAddress = billingAddress; + + this.sessionToken = sessionToken; } - public ShopPayPaymentRequestSessionCreatePayload setShopPayPaymentRequestSession(ShopPayPaymentRequestSession arg) { - optimisticData.put(getKey("shopPayPaymentRequestSession"), arg); - return this; + public MailingAddressInput getBillingAddress() { + return billingAddress; } - /** - * Error codes for failed Shop Pay payment request session mutations. - */ + public ShopPayWalletContentInput setBillingAddress(MailingAddressInput billingAddress) { + this.billingAddress = billingAddress; + return this; + } - public List getUserErrors() { - return (List) get("userErrors"); + public String getSessionToken() { + return sessionToken; } - public ShopPayPaymentRequestSessionCreatePayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public ShopPayWalletContentInput setSessionToken(String sessionToken) { + this.sessionToken = sessionToken; return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "shopPayPaymentRequestSession": return true; + public void appendTo(StringBuilder _queryBuilder) { + String separator = ""; + _queryBuilder.append('{'); - case "userErrors": return true; + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("billingAddress:"); + billingAddress.appendTo(_queryBuilder); - default: return false; - } + _queryBuilder.append(separator); + separator = ","; + _queryBuilder.append("sessionToken:"); + Query.appendQuotedString(_queryBuilder, sessionToken.toString()); + + _queryBuilder.append('}'); } } - public interface ShopPayPaymentRequestSessionSubmitPayloadQueryDefinition { - void define(ShopPayPaymentRequestSessionSubmitPayloadQuery _queryBuilder); + public interface ShopPolicyQueryDefinition { + void define(ShopPolicyQuery _queryBuilder); } /** - * Return type for `shopPayPaymentRequestSessionSubmit` mutation. + * Policy that a merchant has configured for their store, such as their refund or privacy policy. */ - public static class ShopPayPaymentRequestSessionSubmitPayloadQuery extends Query { - ShopPayPaymentRequestSessionSubmitPayloadQuery(StringBuilder _queryBuilder) { + public static class ShopPolicyQuery extends Query { + ShopPolicyQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("id"); } /** - * The checkout on which the payment was applied. + * Policy text, maximum size of 64kb. */ - public ShopPayPaymentRequestSessionSubmitPayloadQuery paymentRequestReceipt(ShopPayPaymentRequestReceiptQueryDefinition queryDef) { - startField("paymentRequestReceipt"); + public ShopPolicyQuery body() { + startField("body"); - _queryBuilder.append('{'); - queryDef.define(new ShopPayPaymentRequestReceiptQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * Policy’s handle. + */ + public ShopPolicyQuery handle() { + startField("handle"); return this; } /** - * Error codes for failed Shop Pay payment request session mutations. + * Policy’s title. */ - public ShopPayPaymentRequestSessionSubmitPayloadQuery userErrors(UserErrorsShopPayPaymentRequestSessionUserErrorsQueryDefinition queryDef) { - startField("userErrors"); + public ShopPolicyQuery title() { + startField("title"); - _queryBuilder.append('{'); - queryDef.define(new UserErrorsShopPayPaymentRequestSessionUserErrorsQuery(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * Public URL to the policy. + */ + public ShopPolicyQuery url() { + startField("url"); return this; } } /** - * Return type for `shopPayPaymentRequestSessionSubmit` mutation. + * Policy that a merchant has configured for their store, such as their refund or privacy policy. */ - public static class ShopPayPaymentRequestSessionSubmitPayload extends AbstractResponse { - public ShopPayPaymentRequestSessionSubmitPayload() { + public static class ShopPolicy extends AbstractResponse implements MenuItemResource, Node { + public ShopPolicy() { } - public ShopPayPaymentRequestSessionSubmitPayload(JsonObject fields) throws SchemaViolationError { + public ShopPolicy(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "paymentRequestReceipt": { - ShopPayPaymentRequestReceipt optional1 = null; - if (!field.getValue().isJsonNull()) { - optional1 = new ShopPayPaymentRequestReceipt(jsonAsObject(field.getValue(), key)); - } + case "body": { + responseData.put(key, jsonAsString(field.getValue(), key)); - responseData.put(key, optional1); + break; + } + + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "userErrors": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new UserErrorsShopPayPaymentRequestSessionUserErrors(jsonAsObject(element1, key))); - } + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); - responseData.put(key, list1); + break; + } + + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "url": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } @@ -69503,116 +72839,198 @@ public ShopPayPaymentRequestSessionSubmitPayload(JsonObject fields) throws Schem } } + public ShopPolicy(ID id) { + this(); + optimisticData.put("id", id); + } + public String getGraphQlTypeName() { - return "ShopPayPaymentRequestSessionSubmitPayload"; + return "ShopPolicy"; } /** - * The checkout on which the payment was applied. + * Policy text, maximum size of 64kb. */ - public ShopPayPaymentRequestReceipt getPaymentRequestReceipt() { - return (ShopPayPaymentRequestReceipt) get("paymentRequestReceipt"); + public String getBody() { + return (String) get("body"); } - public ShopPayPaymentRequestSessionSubmitPayload setPaymentRequestReceipt(ShopPayPaymentRequestReceipt arg) { - optimisticData.put(getKey("paymentRequestReceipt"), arg); + public ShopPolicy setBody(String arg) { + optimisticData.put(getKey("body"), arg); return this; } /** - * Error codes for failed Shop Pay payment request session mutations. + * Policy’s handle. */ - public List getUserErrors() { - return (List) get("userErrors"); + public String getHandle() { + return (String) get("handle"); } - public ShopPayPaymentRequestSessionSubmitPayload setUserErrors(List arg) { - optimisticData.put(getKey("userErrors"), arg); + public ShopPolicy setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); + return this; + } + + /** + * A globally-unique ID. + */ + + public ID getId() { + return (ID) get("id"); + } + + /** + * Policy’s title. + */ + + public String getTitle() { + return (String) get("title"); + } + + public ShopPolicy setTitle(String arg) { + optimisticData.put(getKey("title"), arg); + return this; + } + + /** + * Public URL to the policy. + */ + + public String getUrl() { + return (String) get("url"); + } + + public ShopPolicy setUrl(String arg) { + optimisticData.put(getKey("url"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "paymentRequestReceipt": return true; + case "body": return false; - case "userErrors": return true; + case "handle": return false; + + case "id": return false; + + case "title": return false; + + case "url": return false; default: return false; } } } - public interface ShopPayPaymentRequestShippingLineQueryDefinition { - void define(ShopPayPaymentRequestShippingLineQuery _queryBuilder); + public interface ShopPolicyWithDefaultQueryDefinition { + void define(ShopPolicyWithDefaultQuery _queryBuilder); } /** - * Represents a shipping line for a Shop Pay payment request. + * A policy for the store that comes with a default value, such as a subscription policy. + * If the merchant hasn't configured a policy for their store, then the policy will return the default + * value. + * Otherwise, the policy will return the merchant-configured value. */ - public static class ShopPayPaymentRequestShippingLineQuery extends Query { - ShopPayPaymentRequestShippingLineQuery(StringBuilder _queryBuilder) { + public static class ShopPolicyWithDefaultQuery extends Query { + ShopPolicyWithDefaultQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The amount for the shipping line. + * The text of the policy. Maximum size: 64KB. */ - public ShopPayPaymentRequestShippingLineQuery amount(MoneyV2QueryDefinition queryDef) { - startField("amount"); + public ShopPolicyWithDefaultQuery body() { + startField("body"); - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + return this; + } + + /** + * The handle of the policy. + */ + public ShopPolicyWithDefaultQuery handle() { + startField("handle"); return this; } /** - * The code of the shipping line. + * The unique ID of the policy. A default policy doesn't have an ID. */ - public ShopPayPaymentRequestShippingLineQuery code() { - startField("code"); + public ShopPolicyWithDefaultQuery id() { + startField("id"); return this; } /** - * The label of the shipping line. + * The title of the policy. */ - public ShopPayPaymentRequestShippingLineQuery label() { - startField("label"); + public ShopPolicyWithDefaultQuery title() { + startField("title"); + + return this; + } + + /** + * Public URL to the policy. + */ + public ShopPolicyWithDefaultQuery url() { + startField("url"); return this; } } /** - * Represents a shipping line for a Shop Pay payment request. + * A policy for the store that comes with a default value, such as a subscription policy. + * If the merchant hasn't configured a policy for their store, then the policy will return the default + * value. + * Otherwise, the policy will return the merchant-configured value. */ - public static class ShopPayPaymentRequestShippingLine extends AbstractResponse { - public ShopPayPaymentRequestShippingLine() { + public static class ShopPolicyWithDefault extends AbstractResponse { + public ShopPolicyWithDefault() { } - public ShopPayPaymentRequestShippingLine(JsonObject fields) throws SchemaViolationError { + public ShopPolicyWithDefault(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "amount": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + case "body": { + responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "code": { + case "handle": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "label": { + case "id": { + ID optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new ID(jsonAsString(field.getValue(), key)); + } + + responseData.put(key, optional1); + + break; + } + + case "title": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "url": { responseData.put(key, jsonAsString(field.getValue(), key)); break; @@ -69630,218 +73048,133 @@ public ShopPayPaymentRequestShippingLine(JsonObject fields) throws SchemaViolati } public String getGraphQlTypeName() { - return "ShopPayPaymentRequestShippingLine"; + return "ShopPolicyWithDefault"; } /** - * The amount for the shipping line. + * The text of the policy. Maximum size: 64KB. */ - public MoneyV2 getAmount() { - return (MoneyV2) get("amount"); + public String getBody() { + return (String) get("body"); } - public ShopPayPaymentRequestShippingLine setAmount(MoneyV2 arg) { - optimisticData.put(getKey("amount"), arg); + public ShopPolicyWithDefault setBody(String arg) { + optimisticData.put(getKey("body"), arg); return this; } /** - * The code of the shipping line. + * The handle of the policy. */ - public String getCode() { - return (String) get("code"); + public String getHandle() { + return (String) get("handle"); } - public ShopPayPaymentRequestShippingLine setCode(String arg) { - optimisticData.put(getKey("code"), arg); + public ShopPolicyWithDefault setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); return this; } /** - * The label of the shipping line. + * The unique ID of the policy. A default policy doesn't have an ID. */ - public String getLabel() { - return (String) get("label"); + public ID getId() { + return (ID) get("id"); } - public ShopPayPaymentRequestShippingLine setLabel(String arg) { - optimisticData.put(getKey("label"), arg); + public ShopPolicyWithDefault setId(ID arg) { + optimisticData.put(getKey("id"), arg); return this; } - public boolean unwrapsToObject(String key) { - switch (getFieldName(key)) { - case "amount": return true; - - case "code": return false; - - case "label": return false; - - default: return false; - } - } - } - - public static class ShopPayPaymentRequestShippingLineInput implements Serializable { - private Input code = Input.undefined(); - - private Input label = Input.undefined(); - - private Input amount = Input.undefined(); - - public String getCode() { - return code.getValue(); - } - - public Input getCodeInput() { - return code; - } + /** + * The title of the policy. + */ - public ShopPayPaymentRequestShippingLineInput setCode(String code) { - this.code = Input.optional(code); - return this; + public String getTitle() { + return (String) get("title"); } - public ShopPayPaymentRequestShippingLineInput setCodeInput(Input code) { - if (code == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.code = code; + public ShopPolicyWithDefault setTitle(String arg) { + optimisticData.put(getKey("title"), arg); return this; } - public String getLabel() { - return label.getValue(); - } - - public Input getLabelInput() { - return label; - } + /** + * Public URL to the policy. + */ - public ShopPayPaymentRequestShippingLineInput setLabel(String label) { - this.label = Input.optional(label); - return this; + public String getUrl() { + return (String) get("url"); } - public ShopPayPaymentRequestShippingLineInput setLabelInput(Input label) { - if (label == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.label = label; + public ShopPolicyWithDefault setUrl(String arg) { + optimisticData.put(getKey("url"), arg); return this; } - public MoneyInput getAmount() { - return amount.getValue(); - } - - public Input getAmountInput() { - return amount; - } - - public ShopPayPaymentRequestShippingLineInput setAmount(MoneyInput amount) { - this.amount = Input.optional(amount); - return this; - } + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "body": return false; - public ShopPayPaymentRequestShippingLineInput setAmountInput(Input amount) { - if (amount == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.amount = amount; - return this; - } + case "handle": return false; - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + case "id": return false; - if (this.code.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("code:"); - if (code.getValue() != null) { - Query.appendQuotedString(_queryBuilder, code.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + case "title": return false; - if (this.label.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("label:"); - if (label.getValue() != null) { - Query.appendQuotedString(_queryBuilder, label.getValue().toString()); - } else { - _queryBuilder.append("null"); - } - } + case "url": return false; - if (this.amount.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("amount:"); - if (amount.getValue() != null) { - amount.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); - } + default: return false; } - - _queryBuilder.append('}'); } } - public interface ShopPayPaymentRequestTotalShippingPriceQueryDefinition { - void define(ShopPayPaymentRequestTotalShippingPriceQuery _queryBuilder); + public interface SitemapQueryDefinition { + void define(SitemapQuery _queryBuilder); } /** - * Represents a shipping total for a Shop Pay payment request. + * Contains all fields required to generate sitemaps. */ - public static class ShopPayPaymentRequestTotalShippingPriceQuery extends Query { - ShopPayPaymentRequestTotalShippingPriceQuery(StringBuilder _queryBuilder) { + public static class SitemapQuery extends Query { + SitemapQuery(StringBuilder _queryBuilder) { super(_queryBuilder); } /** - * The discounts for the shipping total. + * The number of sitemap's pages for a given type. */ - public ShopPayPaymentRequestTotalShippingPriceQuery discounts(ShopPayPaymentRequestDiscountQueryDefinition queryDef) { - startField("discounts"); + public SitemapQuery pagesCount(CountQueryDefinition queryDef) { + startField("pagesCount"); _queryBuilder.append('{'); - queryDef.define(new ShopPayPaymentRequestDiscountQuery(_queryBuilder)); + queryDef.define(new CountQuery(_queryBuilder)); _queryBuilder.append('}'); return this; } /** - * The final total for the shipping total. + * A list of sitemap's resources for a given type. + * Important Notes: + * - The number of items per page varies from 0 to 250. + * - Empty pages (0 items) may occur and do not necessarily indicate the end of results. + * - Always check `hasNextPage` to determine if more pages are available. */ - public ShopPayPaymentRequestTotalShippingPriceQuery finalTotal(MoneyV2QueryDefinition queryDef) { - startField("finalTotal"); - - _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); - _queryBuilder.append('}'); + public SitemapQuery resources(int page, PaginatedSitemapResourcesQueryDefinition queryDef) { + startField("resources"); - return this; - } + _queryBuilder.append("(page:"); + _queryBuilder.append(page); - /** - * The original total for the shipping total. - */ - public ShopPayPaymentRequestTotalShippingPriceQuery originalTotal(MoneyV2QueryDefinition queryDef) { - startField("originalTotal"); + _queryBuilder.append(')'); _queryBuilder.append('{'); - queryDef.define(new MoneyV2Query(_queryBuilder)); + queryDef.define(new PaginatedSitemapResourcesQuery(_queryBuilder)); _queryBuilder.append('}'); return this; @@ -69849,38 +73182,32 @@ public ShopPayPaymentRequestTotalShippingPriceQuery originalTotal(MoneyV2QueryDe } /** - * Represents a shipping total for a Shop Pay payment request. + * Contains all fields required to generate sitemaps. */ - public static class ShopPayPaymentRequestTotalShippingPrice extends AbstractResponse { - public ShopPayPaymentRequestTotalShippingPrice() { + public static class Sitemap extends AbstractResponse { + public Sitemap() { } - public ShopPayPaymentRequestTotalShippingPrice(JsonObject fields) throws SchemaViolationError { + public Sitemap(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "discounts": { - List list1 = new ArrayList<>(); - for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { - list1.add(new ShopPayPaymentRequestDiscount(jsonAsObject(element1, key))); + case "pagesCount": { + Count optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new Count(jsonAsObject(field.getValue(), key)); } - responseData.put(key, list1); - - break; - } - - case "finalTotal": { - responseData.put(key, new MoneyV2(jsonAsObject(field.getValue(), key))); + responseData.put(key, optional1); break; } - case "originalTotal": { - MoneyV2 optional1 = null; + case "resources": { + PaginatedSitemapResources optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new MoneyV2(jsonAsObject(field.getValue(), key)); + optional1 = new PaginatedSitemapResources(jsonAsObject(field.getValue(), key)); } responseData.put(key, optional1); @@ -69900,317 +73227,292 @@ public ShopPayPaymentRequestTotalShippingPrice(JsonObject fields) throws SchemaV } public String getGraphQlTypeName() { - return "ShopPayPaymentRequestTotalShippingPrice"; - } - - /** - * The discounts for the shipping total. - */ - - public List getDiscounts() { - return (List) get("discounts"); - } - - public ShopPayPaymentRequestTotalShippingPrice setDiscounts(List arg) { - optimisticData.put(getKey("discounts"), arg); - return this; + return "Sitemap"; } /** - * The final total for the shipping total. + * The number of sitemap's pages for a given type. */ - public MoneyV2 getFinalTotal() { - return (MoneyV2) get("finalTotal"); + public Count getPagesCount() { + return (Count) get("pagesCount"); } - public ShopPayPaymentRequestTotalShippingPrice setFinalTotal(MoneyV2 arg) { - optimisticData.put(getKey("finalTotal"), arg); + public Sitemap setPagesCount(Count arg) { + optimisticData.put(getKey("pagesCount"), arg); return this; } /** - * The original total for the shipping total. + * A list of sitemap's resources for a given type. + * Important Notes: + * - The number of items per page varies from 0 to 250. + * - Empty pages (0 items) may occur and do not necessarily indicate the end of results. + * - Always check `hasNextPage` to determine if more pages are available. */ - public MoneyV2 getOriginalTotal() { - return (MoneyV2) get("originalTotal"); + public PaginatedSitemapResources getResources() { + return (PaginatedSitemapResources) get("resources"); } - public ShopPayPaymentRequestTotalShippingPrice setOriginalTotal(MoneyV2 arg) { - optimisticData.put(getKey("originalTotal"), arg); + public Sitemap setResources(PaginatedSitemapResources arg) { + optimisticData.put(getKey("resources"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "discounts": return true; + case "pagesCount": return true; - case "finalTotal": return true; - - case "originalTotal": return true; + case "resources": return true; default: return false; } } } - public static class ShopPayPaymentRequestTotalShippingPriceInput implements Serializable { - private Input> discounts = Input.undefined(); - - private Input originalTotal = Input.undefined(); - - private Input finalTotal = Input.undefined(); + public interface SitemapImageQueryDefinition { + void define(SitemapImageQuery _queryBuilder); + } - public List getDiscounts() { - return discounts.getValue(); + /** + * Represents a sitemap's image. + */ + public static class SitemapImageQuery extends Query { + SitemapImageQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); } - public Input> getDiscountsInput() { - return discounts; - } + /** + * Image's alt text. + */ + public SitemapImageQuery alt() { + startField("alt"); - public ShopPayPaymentRequestTotalShippingPriceInput setDiscounts(List discounts) { - this.discounts = Input.optional(discounts); return this; } - public ShopPayPaymentRequestTotalShippingPriceInput setDiscountsInput(Input> discounts) { - if (discounts == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.discounts = discounts; - return this; - } + /** + * Path to the image. + */ + public SitemapImageQuery filepath() { + startField("filepath"); - public MoneyInput getOriginalTotal() { - return originalTotal.getValue(); + return this; } - public Input getOriginalTotalInput() { - return originalTotal; - } + /** + * The date and time when the image was updated. + */ + public SitemapImageQuery updatedAt() { + startField("updatedAt"); - public ShopPayPaymentRequestTotalShippingPriceInput setOriginalTotal(MoneyInput originalTotal) { - this.originalTotal = Input.optional(originalTotal); return this; } + } - public ShopPayPaymentRequestTotalShippingPriceInput setOriginalTotalInput(Input originalTotal) { - if (originalTotal == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.originalTotal = originalTotal; - return this; + /** + * Represents a sitemap's image. + */ + public static class SitemapImage extends AbstractResponse { + public SitemapImage() { } - public MoneyInput getFinalTotal() { - return finalTotal.getValue(); - } + public SitemapImage(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "alt": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - public Input getFinalTotalInput() { - return finalTotal; - } + responseData.put(key, optional1); - public ShopPayPaymentRequestTotalShippingPriceInput setFinalTotal(MoneyInput finalTotal) { - this.finalTotal = Input.optional(finalTotal); - return this; - } + break; + } - public ShopPayPaymentRequestTotalShippingPriceInput setFinalTotalInput(Input finalTotal) { - if (finalTotal == null) { - throw new IllegalArgumentException("Input can not be null"); - } - this.finalTotal = finalTotal; - return this; - } + case "filepath": { + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); + responseData.put(key, optional1); - if (this.discounts.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("discounts:"); - if (discounts.getValue() != null) { - _queryBuilder.append('['); - { - String listSeperator1 = ""; - for (ShopPayPaymentRequestDiscountInput item1 : discounts.getValue()) { - _queryBuilder.append(listSeperator1); - listSeperator1 = ","; - item1.appendTo(_queryBuilder); - } + break; } - _queryBuilder.append(']'); - } else { - _queryBuilder.append("null"); - } - } - if (this.originalTotal.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("originalTotal:"); - if (originalTotal.getValue() != null) { - originalTotal.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); - } - } + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); - if (this.finalTotal.isDefined()) { - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("finalTotal:"); - if (finalTotal.getValue() != null) { - finalTotal.getValue().appendTo(_queryBuilder); - } else { - _queryBuilder.append("null"); + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } } } - - _queryBuilder.append('}'); } - } - public static class ShopPayWalletContentInput implements Serializable { - private MailingAddressInput billingAddress; + public String getGraphQlTypeName() { + return "SitemapImage"; + } - private String sessionToken; + /** + * Image's alt text. + */ - public ShopPayWalletContentInput(MailingAddressInput billingAddress, String sessionToken) { - this.billingAddress = billingAddress; + public String getAlt() { + return (String) get("alt"); + } - this.sessionToken = sessionToken; + public SitemapImage setAlt(String arg) { + optimisticData.put(getKey("alt"), arg); + return this; } - public MailingAddressInput getBillingAddress() { - return billingAddress; + /** + * Path to the image. + */ + + public String getFilepath() { + return (String) get("filepath"); } - public ShopPayWalletContentInput setBillingAddress(MailingAddressInput billingAddress) { - this.billingAddress = billingAddress; + public SitemapImage setFilepath(String arg) { + optimisticData.put(getKey("filepath"), arg); return this; } - public String getSessionToken() { - return sessionToken; + /** + * The date and time when the image was updated. + */ + + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); } - public ShopPayWalletContentInput setSessionToken(String sessionToken) { - this.sessionToken = sessionToken; + public SitemapImage setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); return this; } - public void appendTo(StringBuilder _queryBuilder) { - String separator = ""; - _queryBuilder.append('{'); - - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("billingAddress:"); - billingAddress.appendTo(_queryBuilder); + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "alt": return false; - _queryBuilder.append(separator); - separator = ","; - _queryBuilder.append("sessionToken:"); - Query.appendQuotedString(_queryBuilder, sessionToken.toString()); + case "filepath": return false; - _queryBuilder.append('}'); + case "updatedAt": return false; + + default: return false; + } } } - public interface ShopPolicyQueryDefinition { - void define(ShopPolicyQuery _queryBuilder); + public interface SitemapResourceQueryDefinition { + void define(SitemapResourceQuery _queryBuilder); } /** - * Policy that a merchant has configured for their store, such as their refund or privacy policy. + * Represents a sitemap resource that is not a metaobject. */ - public static class ShopPolicyQuery extends Query { - ShopPolicyQuery(StringBuilder _queryBuilder) { + public static class SitemapResourceQuery extends Query { + SitemapResourceQuery(StringBuilder _queryBuilder) { super(_queryBuilder); - - startField("id"); } /** - * Policy text, maximum size of 64kb. + * Resource's handle. */ - public ShopPolicyQuery body() { - startField("body"); + public SitemapResourceQuery handle() { + startField("handle"); return this; } /** - * Policy’s handle. + * Resource's image. */ - public ShopPolicyQuery handle() { - startField("handle"); + public SitemapResourceQuery image(SitemapImageQueryDefinition queryDef) { + startField("image"); + + _queryBuilder.append('{'); + queryDef.define(new SitemapImageQuery(_queryBuilder)); + _queryBuilder.append('}'); return this; } /** - * Policy’s title. + * Resource's title. */ - public ShopPolicyQuery title() { + public SitemapResourceQuery title() { startField("title"); return this; } /** - * Public URL to the policy. + * The date and time when the resource was updated. */ - public ShopPolicyQuery url() { - startField("url"); + public SitemapResourceQuery updatedAt() { + startField("updatedAt"); return this; } } /** - * Policy that a merchant has configured for their store, such as their refund or privacy policy. + * Represents a sitemap resource that is not a metaobject. */ - public static class ShopPolicy extends AbstractResponse implements MenuItemResource, Node { - public ShopPolicy() { + public static class SitemapResource extends AbstractResponse implements SitemapResourceInterface { + public SitemapResource() { } - public ShopPolicy(JsonObject fields) throws SchemaViolationError { + public SitemapResource(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "body": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - case "handle": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "id": { - responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + case "image": { + SitemapImage optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = new SitemapImage(jsonAsObject(field.getValue(), key)); + } + + responseData.put(key, optional1); break; } case "title": { - responseData.put(key, jsonAsString(field.getValue(), key)); + String optional1 = null; + if (!field.getValue().isJsonNull()) { + optional1 = jsonAsString(field.getValue(), key); + } + + responseData.put(key, optional1); break; } - case "url": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); break; } @@ -70226,184 +73528,302 @@ public ShopPolicy(JsonObject fields) throws SchemaViolationError { } } - public ShopPolicy(ID id) { - this(); - optimisticData.put("id", id); - } - public String getGraphQlTypeName() { - return "ShopPolicy"; - } - - /** - * Policy text, maximum size of 64kb. - */ - - public String getBody() { - return (String) get("body"); - } - - public ShopPolicy setBody(String arg) { - optimisticData.put(getKey("body"), arg); - return this; + return "SitemapResource"; } /** - * Policy’s handle. + * Resource's handle. */ public String getHandle() { return (String) get("handle"); } - public ShopPolicy setHandle(String arg) { + public SitemapResource setHandle(String arg) { optimisticData.put(getKey("handle"), arg); return this; } /** - * A globally-unique ID. + * Resource's image. */ - public ID getId() { - return (ID) get("id"); + public SitemapImage getImage() { + return (SitemapImage) get("image"); + } + + public SitemapResource setImage(SitemapImage arg) { + optimisticData.put(getKey("image"), arg); + return this; } /** - * Policy’s title. + * Resource's title. */ public String getTitle() { return (String) get("title"); } - public ShopPolicy setTitle(String arg) { + public SitemapResource setTitle(String arg) { optimisticData.put(getKey("title"), arg); return this; } /** - * Public URL to the policy. + * The date and time when the resource was updated. */ - public String getUrl() { - return (String) get("url"); + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); } - public ShopPolicy setUrl(String arg) { - optimisticData.put(getKey("url"), arg); + public SitemapResource setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "body": return false; - case "handle": return false; - case "id": return false; + case "image": return true; case "title": return false; - case "url": return false; + case "updatedAt": return false; default: return false; } } } - public interface ShopPolicyWithDefaultQueryDefinition { - void define(ShopPolicyWithDefaultQuery _queryBuilder); + public interface SitemapResourceInterfaceQueryDefinition { + void define(SitemapResourceInterfaceQuery _queryBuilder); } /** - * A policy for the store that comes with a default value, such as a subscription policy. - * If the merchant hasn't configured a policy for their store, then the policy will return the default - * value. - * Otherwise, the policy will return the merchant-configured value. + * Represents the common fields for all sitemap resource types. */ - public static class ShopPolicyWithDefaultQuery extends Query { - ShopPolicyWithDefaultQuery(StringBuilder _queryBuilder) { + public static class SitemapResourceInterfaceQuery extends Query { + SitemapResourceInterfaceQuery(StringBuilder _queryBuilder) { super(_queryBuilder); + + startField("__typename"); } /** - * The text of the policy. Maximum size: 64KB. + * Resource's handle. */ - public ShopPolicyWithDefaultQuery body() { - startField("body"); + public SitemapResourceInterfaceQuery handle() { + startField("handle"); return this; } /** - * The handle of the policy. + * The date and time when the resource was updated. */ - public ShopPolicyWithDefaultQuery handle() { + public SitemapResourceInterfaceQuery updatedAt() { + startField("updatedAt"); + + return this; + } + + public SitemapResourceInterfaceQuery onSitemapResource(SitemapResourceQueryDefinition queryDef) { + startInlineFragment("SitemapResource"); + queryDef.define(new SitemapResourceQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + + public SitemapResourceInterfaceQuery onSitemapResourceMetaobject(SitemapResourceMetaobjectQueryDefinition queryDef) { + startInlineFragment("SitemapResourceMetaobject"); + queryDef.define(new SitemapResourceMetaobjectQuery(_queryBuilder)); + _queryBuilder.append('}'); + return this; + } + } + + public interface SitemapResourceInterface { + String getGraphQlTypeName(); + + String getHandle(); + + DateTime getUpdatedAt(); + } + + /** + * Represents the common fields for all sitemap resource types. + */ + public static class UnknownSitemapResourceInterface extends AbstractResponse implements SitemapResourceInterface { + public UnknownSitemapResourceInterface() { + } + + public UnknownSitemapResourceInterface(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "handle": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public static SitemapResourceInterface create(JsonObject fields) throws SchemaViolationError { + String typeName = fields.getAsJsonPrimitive("__typename").getAsString(); + switch (typeName) { + case "SitemapResource": { + return new SitemapResource(fields); + } + + case "SitemapResourceMetaobject": { + return new SitemapResourceMetaobject(fields); + } + + default: { + return new UnknownSitemapResourceInterface(fields); + } + } + } + + public String getGraphQlTypeName() { + return (String) get("__typename"); + } + + /** + * Resource's handle. + */ + + public String getHandle() { + return (String) get("handle"); + } + + public UnknownSitemapResourceInterface setHandle(String arg) { + optimisticData.put(getKey("handle"), arg); + return this; + } + + /** + * The date and time when the resource was updated. + */ + + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); + } + + public UnknownSitemapResourceInterface setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "handle": return false; + + case "updatedAt": return false; + + default: return false; + } + } + } + + public interface SitemapResourceMetaobjectQueryDefinition { + void define(SitemapResourceMetaobjectQuery _queryBuilder); + } + + /** + * A SitemapResourceMetaobject represents a metaobject with + * [the `renderable` + * capability](https://shopify.dev/docs/apps/build/custom-data/metaobjects/use-metaobject-capabilities# + * render-metaobjects-as-web-pages). + */ + public static class SitemapResourceMetaobjectQuery extends Query { + SitemapResourceMetaobjectQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + } + + /** + * Resource's handle. + */ + public SitemapResourceMetaobjectQuery handle() { startField("handle"); return this; } /** - * The unique ID of the policy. A default policy doesn't have an ID. + * The URL handle for accessing pages of this metaobject type in the Online Store. */ - public ShopPolicyWithDefaultQuery id() { - startField("id"); + public SitemapResourceMetaobjectQuery onlineStoreUrlHandle() { + startField("onlineStoreUrlHandle"); return this; } /** - * The title of the policy. + * The type of the metaobject. Defines the namespace of its associated metafields. */ - public ShopPolicyWithDefaultQuery title() { - startField("title"); + public SitemapResourceMetaobjectQuery type() { + startField("type"); return this; } /** - * Public URL to the policy. + * The date and time when the resource was updated. */ - public ShopPolicyWithDefaultQuery url() { - startField("url"); + public SitemapResourceMetaobjectQuery updatedAt() { + startField("updatedAt"); return this; } } /** - * A policy for the store that comes with a default value, such as a subscription policy. - * If the merchant hasn't configured a policy for their store, then the policy will return the default - * value. - * Otherwise, the policy will return the merchant-configured value. + * A SitemapResourceMetaobject represents a metaobject with + * [the `renderable` + * capability](https://shopify.dev/docs/apps/build/custom-data/metaobjects/use-metaobject-capabilities# + * render-metaobjects-as-web-pages). */ - public static class ShopPolicyWithDefault extends AbstractResponse { - public ShopPolicyWithDefault() { + public static class SitemapResourceMetaobject extends AbstractResponse implements SitemapResourceInterface { + public SitemapResourceMetaobject() { } - public ShopPolicyWithDefault(JsonObject fields) throws SchemaViolationError { + public SitemapResourceMetaobject(JsonObject fields) throws SchemaViolationError { for (Map.Entry field : fields.entrySet()) { String key = field.getKey(); String fieldName = getFieldName(key); switch (fieldName) { - case "body": { - responseData.put(key, jsonAsString(field.getValue(), key)); - - break; - } - case "handle": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "id": { - ID optional1 = null; + case "onlineStoreUrlHandle": { + String optional1 = null; if (!field.getValue().isJsonNull()) { - optional1 = new ID(jsonAsString(field.getValue(), key)); + optional1 = jsonAsString(field.getValue(), key); } responseData.put(key, optional1); @@ -70411,14 +73831,14 @@ public ShopPolicyWithDefault(JsonObject fields) throws SchemaViolationError { break; } - case "title": { + case "type": { responseData.put(key, jsonAsString(field.getValue(), key)); break; } - case "url": { - responseData.put(key, jsonAsString(field.getValue(), key)); + case "updatedAt": { + responseData.put(key, Utils.parseDateTime(jsonAsString(field.getValue(), key))); break; } @@ -70435,91 +73855,184 @@ public ShopPolicyWithDefault(JsonObject fields) throws SchemaViolationError { } public String getGraphQlTypeName() { - return "ShopPolicyWithDefault"; - } - - /** - * The text of the policy. Maximum size: 64KB. - */ - - public String getBody() { - return (String) get("body"); - } - - public ShopPolicyWithDefault setBody(String arg) { - optimisticData.put(getKey("body"), arg); - return this; + return "SitemapResourceMetaobject"; } /** - * The handle of the policy. + * Resource's handle. */ public String getHandle() { return (String) get("handle"); } - public ShopPolicyWithDefault setHandle(String arg) { + public SitemapResourceMetaobject setHandle(String arg) { optimisticData.put(getKey("handle"), arg); return this; } /** - * The unique ID of the policy. A default policy doesn't have an ID. + * The URL handle for accessing pages of this metaobject type in the Online Store. */ - public ID getId() { - return (ID) get("id"); + public String getOnlineStoreUrlHandle() { + return (String) get("onlineStoreUrlHandle"); } - public ShopPolicyWithDefault setId(ID arg) { - optimisticData.put(getKey("id"), arg); + public SitemapResourceMetaobject setOnlineStoreUrlHandle(String arg) { + optimisticData.put(getKey("onlineStoreUrlHandle"), arg); return this; } /** - * The title of the policy. + * The type of the metaobject. Defines the namespace of its associated metafields. */ - public String getTitle() { - return (String) get("title"); + public String getType() { + return (String) get("type"); } - public ShopPolicyWithDefault setTitle(String arg) { - optimisticData.put(getKey("title"), arg); + public SitemapResourceMetaobject setType(String arg) { + optimisticData.put(getKey("type"), arg); return this; } /** - * Public URL to the policy. + * The date and time when the resource was updated. */ - public String getUrl() { - return (String) get("url"); + public DateTime getUpdatedAt() { + return (DateTime) get("updatedAt"); } - public ShopPolicyWithDefault setUrl(String arg) { - optimisticData.put(getKey("url"), arg); + public SitemapResourceMetaobject setUpdatedAt(DateTime arg) { + optimisticData.put(getKey("updatedAt"), arg); return this; } public boolean unwrapsToObject(String key) { switch (getFieldName(key)) { - case "body": return false; - case "handle": return false; - case "id": return false; + case "onlineStoreUrlHandle": return false; - case "title": return false; + case "type": return false; - case "url": return false; + case "updatedAt": return false; default: return false; } } } + /** + * The types of resources potentially present in a sitemap. + */ + public enum SitemapType { + /** + * Articles present in the sitemap. + */ + ARTICLE, + + /** + * Blogs present in the sitemap. + */ + BLOG, + + /** + * Collections present in the sitemap. + */ + COLLECTION, + + /** + * Metaobjects present in the sitemap. Only metaobject types with the + * [`renderable` + * capability](https://shopify.dev/docs/apps/build/custom-data/metaobjects/use-metaobject-capabilities# + * render-metaobjects-as-web-pages) + * are included in sitemap. + */ + METAOBJECT, + + /** + * Pages present in the sitemap. + */ + PAGE, + + /** + * Products present in the sitemap. + */ + PRODUCT, + + UNKNOWN_VALUE; + + public static SitemapType fromGraphQl(String value) { + if (value == null) { + return null; + } + + switch (value) { + case "ARTICLE": { + return ARTICLE; + } + + case "BLOG": { + return BLOG; + } + + case "COLLECTION": { + return COLLECTION; + } + + case "METAOBJECT": { + return METAOBJECT; + } + + case "PAGE": { + return PAGE; + } + + case "PRODUCT": { + return PRODUCT; + } + + default: { + return UNKNOWN_VALUE; + } + } + } + public String toString() { + switch (this) { + case ARTICLE: { + return "ARTICLE"; + } + + case BLOG: { + return "BLOG"; + } + + case COLLECTION: { + return "COLLECTION"; + } + + case METAOBJECT: { + return "METAOBJECT"; + } + + case PAGE: { + return "PAGE"; + } + + case PRODUCT: { + return "PRODUCT"; + } + + default: { + return ""; + } + } + } + } + public interface StoreAvailabilityQueryDefinition { void define(StoreAvailabilityQuery _queryBuilder); } @@ -70972,7 +74485,7 @@ public interface StringConnectionQueryDefinition { } /** - * An auto-generated type for paginating through a list of Strings. + * An auto-generated type for paginating through multiple Strings. */ public static class StringConnectionQuery extends Query { StringConnectionQuery(StringBuilder _queryBuilder) { @@ -71007,7 +74520,7 @@ public StringConnectionQuery pageInfo(PageInfoQueryDefinition queryDef) { } /** - * An auto-generated type for paginating through a list of Strings. + * An auto-generated type for paginating through multiple Strings. */ public static class StringConnection extends AbstractResponse { public StringConnection() { @@ -72741,6 +76254,145 @@ public boolean unwrapsToObject(String key) { } } + public interface TaxonomyCategoryQueryDefinition { + void define(TaxonomyCategoryQuery _queryBuilder); + } + + /** + * The taxonomy category for the product. + */ + public static class TaxonomyCategoryQuery extends Query { + TaxonomyCategoryQuery(StringBuilder _queryBuilder) { + super(_queryBuilder); + + startField("id"); + } + + /** + * All parent nodes of the current taxonomy category. + */ + public TaxonomyCategoryQuery ancestors(TaxonomyCategoryQueryDefinition queryDef) { + startField("ancestors"); + + _queryBuilder.append('{'); + queryDef.define(new TaxonomyCategoryQuery(_queryBuilder)); + _queryBuilder.append('}'); + + return this; + } + + /** + * The localized name of the taxonomy category. + */ + public TaxonomyCategoryQuery name() { + startField("name"); + + return this; + } + } + + /** + * The taxonomy category for the product. + */ + public static class TaxonomyCategory extends AbstractResponse implements Node { + public TaxonomyCategory() { + } + + public TaxonomyCategory(JsonObject fields) throws SchemaViolationError { + for (Map.Entry field : fields.entrySet()) { + String key = field.getKey(); + String fieldName = getFieldName(key); + switch (fieldName) { + case "ancestors": { + List list1 = new ArrayList<>(); + for (JsonElement element1 : jsonAsArray(field.getValue(), key)) { + list1.add(new TaxonomyCategory(jsonAsObject(element1, key))); + } + + responseData.put(key, list1); + + break; + } + + case "id": { + responseData.put(key, new ID(jsonAsString(field.getValue(), key))); + + break; + } + + case "name": { + responseData.put(key, jsonAsString(field.getValue(), key)); + + break; + } + + case "__typename": { + responseData.put(key, jsonAsString(field.getValue(), key)); + break; + } + default: { + throw new SchemaViolationError(this, key, field.getValue()); + } + } + } + } + + public TaxonomyCategory(ID id) { + this(); + optimisticData.put("id", id); + } + + public String getGraphQlTypeName() { + return "TaxonomyCategory"; + } + + /** + * All parent nodes of the current taxonomy category. + */ + + public List getAncestors() { + return (List) get("ancestors"); + } + + public TaxonomyCategory setAncestors(List arg) { + optimisticData.put(getKey("ancestors"), arg); + return this; + } + + /** + * A static identifier for the taxonomy category. + */ + + public ID getId() { + return (ID) get("id"); + } + + /** + * The localized name of the taxonomy category. + */ + + public String getName() { + return (String) get("name"); + } + + public TaxonomyCategory setName(String arg) { + optimisticData.put(getKey("name"), arg); + return this; + } + + public boolean unwrapsToObject(String key) { + switch (getFieldName(key)) { + case "ancestors": return true; + + case "id": return false; + + case "name": return false; + + default: return false; + } + } + } + public interface TrackableQueryDefinition { void define(TrackableQuery _queryBuilder); } @@ -72756,8 +76408,13 @@ public static class TrackableQuery extends Query { } /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * URL parameters to be added to a page URL to track the origin of on-site search traffic for + * [analytics + * reporting](https://help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/defaul + * t-reports/behaviour-reports). Returns a result when accessed through the + * [search](https://shopify.dev/docs/api/storefront/current/queries/search) or + * [predictiveSearch](https://shopify.dev/docs/api/storefront/current/queries/predictiveSearch) + * queries, otherwise returns null. */ public TrackableQuery trackingParameters() { startField("trackingParameters"); @@ -72875,8 +76532,13 @@ public String getGraphQlTypeName() { } /** - * A URL parameters to be added to a page URL when it is linked from a GraphQL result. This allows for - * tracking the origin of the traffic. + * URL parameters to be added to a page URL to track the origin of on-site search traffic for + * [analytics + * reporting](https://help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/defaul + * t-reports/behaviour-reports). Returns a result when accessed through the + * [search](https://shopify.dev/docs/api/storefront/current/queries/search) or + * [predictiveSearch](https://shopify.dev/docs/api/storefront/current/queries/predictiveSearch) + * queries, otherwise returns null. */ public String getTrackingParameters() { @@ -73932,7 +77594,7 @@ public interface UserErrorsShopPayPaymentRequestSessionUserErrorsQueryDefinition } /** - * Represents an error that happens during execution of a customer mutation. + * Error codes for failed Shop Pay payment request session mutations. */ public static class UserErrorsShopPayPaymentRequestSessionUserErrorsQuery extends Query { UserErrorsShopPayPaymentRequestSessionUserErrorsQuery(StringBuilder _queryBuilder) { @@ -73968,7 +77630,7 @@ public UserErrorsShopPayPaymentRequestSessionUserErrorsQuery message() { } /** - * Represents an error that happens during execution of a customer mutation. + * Error codes for failed Shop Pay payment request session mutations. */ public static class UserErrorsShopPayPaymentRequestSessionUserErrors extends AbstractResponse implements DisplayableError { public UserErrorsShopPayPaymentRequestSessionUserErrors() {