diff --git a/openapi.json b/openapi.json index 64d1f0aa..67b90679 100644 --- a/openapi.json +++ b/openapi.json @@ -3526,7 +3526,8 @@ }, "x-scopes": [ "user.profile", - "user.profile_readonly" + "user.profile_readonly", + "members.read" ], "security": [ { @@ -3541,6 +3542,11 @@ "oauth2": [ "user.profile_readonly" ] + }, + { + "oauth2": [ + "members.read" + ] } ], "parameters": [ @@ -3822,7 +3828,7 @@ }, "x-permissions": [ { - "relation": "merchant_read", + "relation": "merchant.read", "object_type": "merchant", "object_id_param": "merchant_code" } @@ -5888,7 +5894,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -5898,7 +5904,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -5908,7 +5914,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -5918,7 +5924,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -6005,7 +6011,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -6015,7 +6021,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -6025,7 +6031,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -6035,7 +6041,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -6181,7 +6187,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -6191,7 +6197,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -6201,7 +6207,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -6211,7 +6217,7 @@ "content": { "application/problem+json": { "schema": { - "$ref": "#/components/schemas/ProblemV10" + "$ref": "#/components/schemas/Problem" } } } @@ -11742,7 +11748,7 @@ } } }, - "LineItemPriceV10": { + "SaleItemPrice": { "type": "object", "description": "Pricing for a single line, valid for every item type.\n\nMerges the standard amounts (with tax breakdown) and the final amounts (after\ndiscounts/modifiers).\n\nTotals and tax amounts can be negative for return-like operations (for example\na deposit with `operation_type` = `RETURN`).", "required": [ @@ -11861,7 +11867,7 @@ } } }, - "CategoryV10": { + "SaleItemCategory": { "type": "object", "description": "A category a line belongs to.", "required": [ @@ -12149,7 +12155,7 @@ } ] }, - "ItemReferencesV10": { + "SaleItemReferences": { "type": "object", "description": "Outward identifiers and links for a line, kept in one place rather than scattered\nper item type.", "properties": { @@ -12183,7 +12189,7 @@ } } }, - "FeatureValueTypeV10": { + "SaleItemFeatureValueType": { "type": "string", "description": "The data type of a feature value. The wire `value` is always a string and is parsed\naccording to this type.", "enum": [ @@ -12195,7 +12201,7 @@ ], "example": "TEXT" }, - "FeatureV10": { + "SaleItemFeature": { "type": "object", "description": "A named, typed characteristic of a line. New item types add data here instead of\na typed sub-object per type.\n\nExamples by item type (illustrative, not exhaustive):\n - DEPOSIT: `operation_type` = \"SALE\", `linked_line_id` = \"line-1\"\n - GIFT_CARD: `gift_card_reference` = \"GCMINGXPC5\"\n - CATALOG: `variant_name` = \"Large\", `item_id` / `variant_id` (TEXT),\n `reporting_category_id` = \"cat-...\"\n - FEE: `fee_type` = \"SHIPPING\" (required); optional `fee_id`,\n `value_absolute` or `value_percentage`, and per-type metadata\n features such as `delivery_name` / `tracking_reference` (shipping),\n `card_type` / `scheme` (surcharge), or `policy_id` (cancellation)\n - (future) SUBSCRIPTION: `billing_period` = \"P1M\", `renews_at` = \"2026-07-02\"\n\nConventional `FEE` feature keys:\n - `fee_type` (TEXT, required): `SHIPPING`, `SURCHARGE`, `SERVICE_CHARGE`, or\n `CANCELLATION`\n - `fee_id` (TEXT, optional): identifier of the fee definition\n - `value_absolute` (INTEGER, optional): configured absolute value in minor units\n of the sale currency (the charged amount is on `price`)\n - `value_percentage` (INTEGER, optional): configured percentage in minor units\n (1/100000; e.g. 10000 = 10%)\n - Per-type metadata (optional, TEXT unless noted): `delivery_name`,\n `tracking_reference` (shipping); `card_type`, `scheme` (surcharge);\n `policy_id` (cancellation)", "required": [ @@ -12211,7 +12217,7 @@ "example": "operation_type" }, "value_type": { - "$ref": "#/components/schemas/FeatureValueTypeV10" + "$ref": "#/components/schemas/SaleItemFeatureValueType" }, "value": { "type": "string", @@ -12221,7 +12227,7 @@ } } }, - "SaleLineItemV10": { + "SaleItem": { "type": "object", "description": "A single line of a sale.\n\nThe envelope (id, type, name, quantity, unit_of_measure, price) is stable and\ntype-agnostic: any consumer can render and total a line from these fields alone.\nType-specific data is in `features`. There is no per-type object and no discriminator,\nso a new item type does not change this schema.", "required": [ @@ -12241,7 +12247,7 @@ }, "type": { "type": "string", - "description": "Classifies a sale line. Not a schema subclass.\n\nKnown values: `CATALOG`, `DEPOSIT`, `GIFT_CARD`, `CUSTOM`, `FEE`.\n\n`FEE` lines represent merchant-charged fees on the sale (e.g. shipping, service\ncharge, surcharge, cancellation). They participate in sale totals like any other\nline; type-specific data is carried in `features` (see `Feature` for the\nconventional feature keys).\n\nThis is intentionally an open string, NOT a closed enum: new values are added\nover time as pure data and consumers MUST tolerate unknown values, rendering the\nline from the generic envelope (name, quantity, price, taxes) and reading any\nextra information from `features`.", + "description": "Classifies a sale line. Not a schema subclass.\n\nKnown values: `CATALOG`, `DEPOSIT`, `GIFT_CARD`, `CUSTOM`, `FEE`.\n\n`FEE` lines represent merchant-charged fees on the sale (e.g. shipping, service\ncharge, surcharge, cancellation). They participate in sale totals like any other\nline; type-specific data is carried in `features` (see `SaleItemFeature` for the\nconventional feature keys).\n\nThis is intentionally an open string, NOT a closed enum: new values are added\nover time as pure data and consumers MUST tolerate unknown values, rendering the\nline from the generic envelope (name, quantity, price, taxes) and reading any\nextra information from `features`.", "example": "CATALOG" }, "name": { @@ -12276,14 +12282,14 @@ "example": "extra hot" }, "price": { - "$ref": "#/components/schemas/LineItemPriceV10" + "$ref": "#/components/schemas/SaleItemPrice" }, "categories": { "type": "array", "description": "Categories the line belongs to. A shared optional structure available to any\nline; not a per-type field.\n", "maxItems": 1000, "items": { - "$ref": "#/components/schemas/CategoryV10" + "$ref": "#/components/schemas/SaleItemCategory" }, "example": [ { @@ -12302,14 +12308,14 @@ "example": [] }, "references": { - "$ref": "#/components/schemas/ItemReferencesV10" + "$ref": "#/components/schemas/SaleItemReferences" }, "features": { "type": "array", - "description": "Named, typed, type-specific data. New item types add their data here as\nfeatures instead of new schema variants. See `Feature` for per-type examples.\n", + "description": "Named, typed, type-specific data. New item types add their data here as\nfeatures instead of new schema variants. See `SaleItemFeature` for per-type examples.\n", "maxItems": 100, "items": { - "$ref": "#/components/schemas/FeatureV10" + "$ref": "#/components/schemas/SaleItemFeature" }, "example": [ { @@ -12321,9 +12327,9 @@ } } }, - "SalePriceV10": { + "SaleTotals": { "type": "object", - "description": "Sale-level pricing aggregate, parallel to `LineItemPrice` on each `SaleLineItem`.\n\nLine-level breakdown (unit price, line discounts, per-line taxes) lives on\n`items[].price`. This object holds the rolled-up totals and cart-level\nadjustments that consumers use for receipts and payment reconciliation.", + "description": "Sale-level pricing aggregate, parallel to `SaleItemPrice` on each `SaleItem`.\n\nLine-level breakdown (unit price, line discounts, per-line taxes) lives on\n`items[].price`. This object holds the rolled-up totals and cart-level\nadjustments that consumers use for receipts and payment reconciliation.", "required": [ "net_amount", "gross_amount", @@ -12424,7 +12430,7 @@ "channel" ] }, - "PublicCardV10": { + "SalePaymentCard": { "type": "object", "description": "Card brand, credit/debit processing type, and last four digits.", "required": [ @@ -12459,7 +12465,7 @@ } } }, - "PublicGiftCardPayment": { + "SaleGiftCardPayment": { "type": "object", "description": "Gift card used for this payment. Present when `method` is `gift_card` and the gift card\nid is known.\nGift card IDs use the format \"GC\" followed by 9 alphanumeric characters\n(e.g. GCZ3NTMB1V).", "properties": { @@ -12473,8 +12479,8 @@ "id" ] }, - "PublicPaymentV10": { - "title": "PublicPayment", + "SalePayment": { + "title": "SalePayment", "type": "object", "description": "Payment on a closed sale, for bookkeeping and reconciliation.\n\nAcquirer/processing cost is not on this object. Merchant-charged fees (shipping, service\ncharge, etc.) appear as `type: \"FEE\"` item lines in `Sale.items`.", "required": [ @@ -12533,10 +12539,10 @@ "maxLength": 20 }, "card": { - "$ref": "#/components/schemas/PublicCardV10" + "$ref": "#/components/schemas/SalePaymentCard" }, "gift_card": { - "$ref": "#/components/schemas/PublicGiftCardPayment" + "$ref": "#/components/schemas/SaleGiftCardPayment" }, "processed_at": { "type": "string", @@ -12546,7 +12552,7 @@ } } }, - "SaleStateV10": { + "SaleLifecycleState": { "type": "string", "description": "Lifecycle state of the sale.\nNon-finalised sales are never returned; only fully-paid sales.", "enum": [ @@ -12557,7 +12563,7 @@ "Sale": { "title": "Sale", "type": "object", - "description": "Core model of the Sales API. Returned by `GET /sales` and `GET /sales/{sale_id}`.\n\nNon-finalised sales are never returned; only fully-paid sales.\n\nItem lines are `SaleLineItem`. Merchant fees appear as `type: \"FEE\"` lines; extra fee data\nis in `features`.", + "description": "Core model of the Sales API. Returned by `GET /sales` and `GET /sales/{sale_id}`.\n\nNon-finalised sales are never returned; only fully-paid sales.\n\nItem lines are `SaleItem`. Merchant fees appear as `type: \"FEE\"` lines; extra fee data\nis in `features`.", "required": [ "id", "currency", @@ -12603,11 +12609,11 @@ "maxItems": 1000, "description": "The lines sold in this sale, in the order they were added to the cart.\nIncludes merchant fees (`type: \"FEE\"`) when present; fee details are in `features`.\n", "items": { - "$ref": "#/components/schemas/SaleLineItemV10" + "$ref": "#/components/schemas/SaleItem" } }, "price": { - "$ref": "#/components/schemas/SalePriceV10" + "$ref": "#/components/schemas/SaleTotals" }, "tax_mode": { "$ref": "#/components/schemas/TaxMode" @@ -12620,7 +12626,7 @@ "maxItems": 1000, "description": "Payments on this sale, in the order they were recorded.\n", "items": { - "$ref": "#/components/schemas/PublicPaymentV10" + "$ref": "#/components/schemas/SalePayment" }, "example": [ { @@ -12646,7 +12652,7 @@ "example": "2026-06-02T10:20:00Z" }, "state": { - "$ref": "#/components/schemas/SaleStateV10" + "$ref": "#/components/schemas/SaleLifecycleState" } } }, @@ -12671,43 +12677,7 @@ } } }, - "ProblemV10": { - "type": "object", - "description": "A RFC 9457 problem details object.\n\nAdditional properties specific to the problem type may be present.\n", - "required": [ - "type" - ], - "additionalProperties": true, - "properties": { - "type": { - "type": "string", - "format": "uri", - "description": "A URI reference that identifies the problem type.", - "example": "https://developer.sumup.com/problem/not-found" - }, - "title": { - "type": "string", - "description": "A short, human-readable summary of the problem type.", - "example": "Requested resource couldn't be found." - }, - "status": { - "type": "integer", - "description": "The HTTP status code generated by the origin server for this occurrence of the problem.", - "example": 404 - }, - "detail": { - "type": "string", - "description": "A human-readable explanation specific to this occurrence of the problem.", - "example": "The requested resource doesn't exist or does not belong to you." - }, - "instance": { - "type": "string", - "format": "uri", - "description": "A URI reference that identifies the specific occurrence of the problem." - } - } - }, - "PaymentStatusFilterV10": { + "SalePaymentStatusFilter": { "type": "string", "description": "Payment outcome filter value. Multi-select uses **OR** within this field; combined with\nother filters using **AND**.\nOnly fully-paid closed sales are exposed. Refunded original sales remain searchable as\n`PAID`; refunds are separate negative sales, not a `REFUNDED` sale-search outcome.", "enum": [ @@ -12716,7 +12686,7 @@ ], "example": "PAID" }, - "SalesChannelFilterV10": { + "SaleChannelFilter": { "type": "string", "description": "Sale channel filter value. Multi-select uses **OR** within this field.", "enum": [ @@ -12755,7 +12725,7 @@ "type": "array", "description": "Filters rows by sale lifecycle (`state`). Multiple values match any of them (**OR**).\nUses the same values as `Sale.state`. Non-finalised sales are never returned; only\nfully-paid sales.", "items": { - "$ref": "#/components/schemas/SaleStateV10" + "$ref": "#/components/schemas/SaleLifecycleState" }, "example": [ "CLOSED" @@ -12765,7 +12735,7 @@ "type": "array", "description": "Filters rows by payment outcome. Multiple values match any of them (**OR**). The search\nrow does not echo this value.", "items": { - "$ref": "#/components/schemas/PaymentStatusFilterV10" + "$ref": "#/components/schemas/SalePaymentStatusFilter" }, "example": [ "PAID" @@ -12775,7 +12745,7 @@ "type": "array", "description": "Sales channel filter. Multiple values match any of them (**OR**).", "items": { - "$ref": "#/components/schemas/SalesChannelFilterV10" + "$ref": "#/components/schemas/SaleChannelFilter" }, "example": [ "POS" @@ -12822,7 +12792,7 @@ "example": "d6f51684-519b-454c-bdb3-deeb05f52b92" }, "state": { - "$ref": "#/components/schemas/SaleStateV10" + "$ref": "#/components/schemas/SaleLifecycleState" }, "name": { "type": "string", diff --git a/src/main/java/com/sumup/sdk/models/FeatureValueTypeV10.java b/src/main/java/com/sumup/sdk/models/FeatureValueTypeV10.java deleted file mode 100644 index 57016815..00000000 --- a/src/main/java/com/sumup/sdk/models/FeatureValueTypeV10.java +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by sumup-java/codegen. DO NOT EDIT. -package com.sumup.sdk.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Objects; - -/** - * The data type of a feature value. The wire `value` is always a string and is parsed according to - * this type. - */ -public final class FeatureValueTypeV10 { - public static final FeatureValueTypeV10 TEXT = new FeatureValueTypeV10("TEXT"); - public static final FeatureValueTypeV10 INTEGER = new FeatureValueTypeV10("INTEGER"); - public static final FeatureValueTypeV10 DECIMAL = new FeatureValueTypeV10("DECIMAL"); - public static final FeatureValueTypeV10 DATE = new FeatureValueTypeV10("DATE"); - public static final FeatureValueTypeV10 BOOLEAN = new FeatureValueTypeV10("BOOLEAN"); - - private final String value; - - private FeatureValueTypeV10(String value) { - this.value = Objects.requireNonNull(value, "value"); - } - - /** - * Creates a FeatureValueTypeV10 for a value not yet known to this SDK version. - * - * @param value Wire value sent to or received from the API. - * @return Open enum value wrapping {@code value}. - */ - public static FeatureValueTypeV10 of(String value) { - return new FeatureValueTypeV10(value); - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return value; - } - - @JsonCreator - public static FeatureValueTypeV10 fromValue(String value) { - return value == null ? null : new FeatureValueTypeV10(value); - } - - @Override - public boolean equals(Object other) { - return this == other - || (other instanceof FeatureValueTypeV10 that && this.value.equals(that.value)); - } - - @Override - public int hashCode() { - return value.hashCode(); - } -} diff --git a/src/main/java/com/sumup/sdk/models/ItemReferencesV10CatalogSource.java b/src/main/java/com/sumup/sdk/models/ItemReferencesV10CatalogSource.java deleted file mode 100644 index dda20127..00000000 --- a/src/main/java/com/sumup/sdk/models/ItemReferencesV10CatalogSource.java +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by sumup-java/codegen. DO NOT EDIT. -package com.sumup.sdk.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Objects; - -/** The source of the catalog the line originates from. */ -public final class ItemReferencesV10CatalogSource { - public static final ItemReferencesV10CatalogSource SUMUP = - new ItemReferencesV10CatalogSource("SUMUP"); - public static final ItemReferencesV10CatalogSource EXTERNAL = - new ItemReferencesV10CatalogSource("EXTERNAL"); - - private final String value; - - private ItemReferencesV10CatalogSource(String value) { - this.value = Objects.requireNonNull(value, "value"); - } - - /** - * Creates a ItemReferencesV10CatalogSource for a value not yet known to this SDK version. - * - * @param value Wire value sent to or received from the API. - * @return Open enum value wrapping {@code value}. - */ - public static ItemReferencesV10CatalogSource of(String value) { - return new ItemReferencesV10CatalogSource(value); - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return value; - } - - @JsonCreator - public static ItemReferencesV10CatalogSource fromValue(String value) { - return value == null ? null : new ItemReferencesV10CatalogSource(value); - } - - @Override - public boolean equals(Object other) { - return this == other - || (other instanceof ItemReferencesV10CatalogSource that && this.value.equals(that.value)); - } - - @Override - public int hashCode() { - return value.hashCode(); - } -} diff --git a/src/main/java/com/sumup/sdk/models/ProblemV10.java b/src/main/java/com/sumup/sdk/models/ProblemV10.java deleted file mode 100644 index b4cf17a4..00000000 --- a/src/main/java/com/sumup/sdk/models/ProblemV10.java +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by sumup-java/codegen. DO NOT EDIT. -package com.sumup.sdk.models; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; -import java.util.Objects; - -/** - * A RFC 9457 problem details object. Additional properties specific to the problem type may be - * present. - */ -@JsonDeserialize(builder = ProblemV10.Builder.class) -public record ProblemV10( - /** A human-readable explanation specific to this occurrence of the problem. */ - String detail, - - /** A URI reference that identifies the specific occurrence of the problem. */ - String instance, - - /** The HTTP status code generated by the origin server for this occurrence of the problem. */ - Long status, - - /** A short, human-readable summary of the problem type. */ - String title, - - /** A URI reference that identifies the problem type. */ - String type, - - /** Additional fields not described by the fixed schema properties. */ - java.util.Map additionalProperties) { - public ProblemV10 { - additionalProperties = - additionalProperties == null - ? java.util.Map.of() - : java.util.Collections.unmodifiableMap( - new java.util.LinkedHashMap<>(additionalProperties)); - } - - @JsonAnyGetter - public java.util.Map additionalProperties() { - return additionalProperties; - } - - /** - * Creates a builder for ProblemV10. - * - * @return Builder that constructs immutable ProblemV10 instances. - */ - public static Builder builder() { - return new Builder(); - } - - /** Builder for ProblemV10 instances. */ - @JsonPOJOBuilder(withPrefix = "") - public static final class Builder { - private String detail; - private String instance; - private Long status; - private String title; - private String type; - private java.util.Map additionalProperties = new java.util.LinkedHashMap<>(); - - private Builder() {} - - /** - * Sets the value for {@code detail}. - * - * @param detail A human-readable explanation specific to this occurrence of the problem. - * @return This builder instance. - */ - public Builder detail(String detail) { - this.detail = detail; - return this; - } - - /** - * Sets the value for {@code instance}. - * - * @param instance A URI reference that identifies the specific occurrence of the problem. - * @return This builder instance. - */ - public Builder instance(String instance) { - this.instance = instance; - return this; - } - - /** - * Sets the value for {@code status}. - * - * @param status The HTTP status code generated by the origin server for this occurrence of the - * problem. - * @return This builder instance. - */ - public Builder status(Long status) { - this.status = status; - return this; - } - - /** - * Sets the value for {@code title}. - * - * @param title A short, human-readable summary of the problem type. - * @return This builder instance. - */ - public Builder title(String title) { - this.title = title; - return this; - } - - /** - * Sets the value for {@code type}. - * - * @param type A URI reference that identifies the problem type. - * @return This builder instance. - */ - public Builder type(String type) { - this.type = type; - return this; - } - - /** - * Sets the value for {@code additionalProperties}. - * - * @param additionalProperties Additional fields not described by the fixed schema properties. - * @return This builder instance. - */ - public Builder additionalProperties(java.util.Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - public Builder additionalProperty(String name, Object value) { - this.additionalProperties.put(name, value); - return this; - } - - /** - * Builds an immutable ProblemV10 instance. - * - * @return Immutable ProblemV10. - */ - public ProblemV10 build() { - return new ProblemV10( - detail, - instance, - status, - title, - Objects.requireNonNull(type, "type"), - additionalProperties); - } - } -} diff --git a/src/main/java/com/sumup/sdk/models/PublicPaymentV10Status.java b/src/main/java/com/sumup/sdk/models/PublicPaymentV10Status.java deleted file mode 100644 index 576699d3..00000000 --- a/src/main/java/com/sumup/sdk/models/PublicPaymentV10Status.java +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by sumup-java/codegen. DO NOT EDIT. -package com.sumup.sdk.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Objects; - -/** The status of the payment. */ -public final class PublicPaymentV10Status { - public static final PublicPaymentV10Status FAILED = new PublicPaymentV10Status("FAILED"); - public static final PublicPaymentV10Status SUCCESSFUL = new PublicPaymentV10Status("SUCCESSFUL"); - public static final PublicPaymentV10Status CANCELED = new PublicPaymentV10Status("CANCELED"); - - private final String value; - - private PublicPaymentV10Status(String value) { - this.value = Objects.requireNonNull(value, "value"); - } - - /** - * Creates a PublicPaymentV10Status for a value not yet known to this SDK version. - * - * @param value Wire value sent to or received from the API. - * @return Open enum value wrapping {@code value}. - */ - public static PublicPaymentV10Status of(String value) { - return new PublicPaymentV10Status(value); - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return value; - } - - @JsonCreator - public static PublicPaymentV10Status fromValue(String value) { - return value == null ? null : new PublicPaymentV10Status(value); - } - - @Override - public boolean equals(Object other) { - return this == other - || (other instanceof PublicPaymentV10Status that && this.value.equals(that.value)); - } - - @Override - public int hashCode() { - return value.hashCode(); - } -} diff --git a/src/main/java/com/sumup/sdk/models/Sale.java b/src/main/java/com/sumup/sdk/models/Sale.java index c5b1f5f1..e94361c8 100644 --- a/src/main/java/com/sumup/sdk/models/Sale.java +++ b/src/main/java/com/sumup/sdk/models/Sale.java @@ -5,8 +5,8 @@ /** * Core model of the Sales API. Returned by `GET /sales` and `GET /sales/{sale_id}`. Non-finalised - * sales are never returned; only fully-paid sales. Item lines are `SaleLineItem`. Merchant fees - * appear as `type: "FEE"` lines; extra fee data is in `features`. + * sales are never returned; only fully-paid sales. Item lines are `SaleItem`. Merchant fees appear + * as `type: "FEE"` lines; extra fee data is in `features`. */ public record Sale( /** Instant when the sale was closed. Always present: non-finalised sales are never returned. */ @@ -25,7 +25,7 @@ public record Sale( * The lines sold in this sale, in the order they were added to the cart. Includes merchant fees * (`type: "FEE"`) when present; fee details are in `features`. */ - java.util.List items, + java.util.List items, /** Human-readable name of the sale (not unique, not the sale id). */ String name, @@ -34,15 +34,15 @@ public record Sale( String note, /** Payments on this sale, in the order they were recorded. */ - java.util.List payments, + java.util.List payments, /** - * Sale-level pricing aggregate, parallel to `LineItemPrice` on each `SaleLineItem`. Line-level + * Sale-level pricing aggregate, parallel to `SaleItemPrice` on each `SaleItem`. Line-level * breakdown (unit price, line discounts, per-line taxes) lives on `items[].price`. This object * holds the rolled-up totals and cart-level adjustments that consumers use for receipts and * payment reconciliation. */ - com.sumup.sdk.models.SalePriceV10 price, + com.sumup.sdk.models.SaleTotals price, /** Information about the source of the sale. */ com.sumup.sdk.models.SaleSource source, @@ -50,7 +50,7 @@ public record Sale( /** * Lifecycle state of the sale. Non-finalised sales are never returned; only fully-paid sales. */ - com.sumup.sdk.models.SaleStateV10 state, + com.sumup.sdk.models.SaleLifecycleState state, /** * The tax mode used by merchant for displaying prices and calculating taxes: - NO_TAX: The @@ -83,13 +83,13 @@ public static final class Builder { private java.time.OffsetDateTime createdAt; private com.sumup.sdk.models.SalesActivityCurrency currency; private String id; - private java.util.List items; + private java.util.List items; private String name; private String note; - private java.util.List payments; - private com.sumup.sdk.models.SalePriceV10 price; + private java.util.List payments; + private com.sumup.sdk.models.SaleTotals price; private com.sumup.sdk.models.SaleSource source; - private com.sumup.sdk.models.SaleStateV10 state; + private com.sumup.sdk.models.SaleLifecycleState state; private com.sumup.sdk.models.TaxMode taxMode; private java.util.UUID userId; @@ -147,7 +147,7 @@ public Builder id(String id) { * merchant fees (`type: "FEE"`) when present; fee details are in `features`. * @return This builder instance. */ - public Builder items(java.util.List items) { + public Builder items(java.util.List items) { this.items = items; return this; } @@ -180,7 +180,7 @@ public Builder note(String note) { * @param payments Payments on this sale, in the order they were recorded. * @return This builder instance. */ - public Builder payments(java.util.List payments) { + public Builder payments(java.util.List payments) { this.payments = payments; return this; } @@ -188,13 +188,13 @@ public Builder payments(java.util.List pa /** * Sets the value for {@code price}. * - * @param price Sale-level pricing aggregate, parallel to `LineItemPrice` on each - * `SaleLineItem`. Line-level breakdown (unit price, line discounts, per-line taxes) lives - * on `items[].price`. This object holds the rolled-up totals and cart-level adjustments - * that consumers use for receipts and payment reconciliation. + * @param price Sale-level pricing aggregate, parallel to `SaleItemPrice` on each `SaleItem`. + * Line-level breakdown (unit price, line discounts, per-line taxes) lives on + * `items[].price`. This object holds the rolled-up totals and cart-level adjustments that + * consumers use for receipts and payment reconciliation. * @return This builder instance. */ - public Builder price(com.sumup.sdk.models.SalePriceV10 price) { + public Builder price(com.sumup.sdk.models.SaleTotals price) { this.price = price; return this; } @@ -217,7 +217,7 @@ public Builder source(com.sumup.sdk.models.SaleSource source) { * fully-paid sales. * @return This builder instance. */ - public Builder state(com.sumup.sdk.models.SaleStateV10 state) { + public Builder state(com.sumup.sdk.models.SaleLifecycleState state) { this.state = state; return this; } diff --git a/src/main/java/com/sumup/sdk/models/SaleChannelFilter.java b/src/main/java/com/sumup/sdk/models/SaleChannelFilter.java new file mode 100644 index 00000000..4ca49d36 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SaleChannelFilter.java @@ -0,0 +1,64 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; + +/** Sale channel filter value. Multi-select uses **OR** within this field. */ +public final class SaleChannelFilter { + public static final SaleChannelFilter POS = new SaleChannelFilter("POS"); + public static final SaleChannelFilter ONLINE_PAYMENTS = new SaleChannelFilter("ONLINE_PAYMENTS"); + public static final SaleChannelFilter KIOSK = new SaleChannelFilter("KIOSK"); + public static final SaleChannelFilter ONLINE_STORE = new SaleChannelFilter("ONLINE_STORE"); + public static final SaleChannelFilter SOLO = new SaleChannelFilter("SOLO"); + public static final SaleChannelFilter ORDER_AND_PAY = new SaleChannelFilter("ORDER_AND_PAY"); + public static final SaleChannelFilter INVOICE = new SaleChannelFilter("INVOICE"); + public static final SaleChannelFilter BOOKINGS = new SaleChannelFilter("BOOKINGS"); + public static final SaleChannelFilter ORDER_AGGREGATOR = + new SaleChannelFilter("ORDER_AGGREGATOR"); + public static final SaleChannelFilter SUBSCRIPTIONS = new SaleChannelFilter("SUBSCRIPTIONS"); + public static final SaleChannelFilter UNKNOWN = new SaleChannelFilter("UNKNOWN"); + + private final String value; + + private SaleChannelFilter(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a SaleChannelFilter for a value not yet known to this SDK version. + * + * @param value Wire value sent to or received from the API. + * @return Open enum value wrapping {@code value}. + */ + public static SaleChannelFilter of(String value) { + return new SaleChannelFilter(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static SaleChannelFilter fromValue(String value) { + return value == null ? null : new SaleChannelFilter(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof SaleChannelFilter that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/PublicGiftCardPayment.java b/src/main/java/com/sumup/sdk/models/SaleGiftCardPayment.java similarity index 68% rename from src/main/java/com/sumup/sdk/models/PublicGiftCardPayment.java rename to src/main/java/com/sumup/sdk/models/SaleGiftCardPayment.java index 84754e63..bce40891 100644 --- a/src/main/java/com/sumup/sdk/models/PublicGiftCardPayment.java +++ b/src/main/java/com/sumup/sdk/models/SaleGiftCardPayment.java @@ -7,21 +7,21 @@ * Gift card used for this payment. Present when `method` is `gift_card` and the gift card id is * known. Gift card IDs use the format "GC" followed by 9 alphanumeric characters (e.g. GCZ3NTMB1V). */ -public record PublicGiftCardPayment( +public record SaleGiftCardPayment( /** * Gift card identifier. Format "GC" followed by 9 alphanumeric characters (e.g. GCZ3NTMB1V). */ String id) { /** - * Creates a builder for PublicGiftCardPayment. + * Creates a builder for SaleGiftCardPayment. * - * @return Builder that constructs immutable PublicGiftCardPayment instances. + * @return Builder that constructs immutable SaleGiftCardPayment instances. */ public static Builder builder() { return new Builder(); } - /** Builder for PublicGiftCardPayment instances. */ + /** Builder for SaleGiftCardPayment instances. */ public static final class Builder { private String id; @@ -40,12 +40,12 @@ public Builder id(String id) { } /** - * Builds an immutable PublicGiftCardPayment instance. + * Builds an immutable SaleGiftCardPayment instance. * - * @return Immutable PublicGiftCardPayment. + * @return Immutable SaleGiftCardPayment. */ - public PublicGiftCardPayment build() { - return new PublicGiftCardPayment(Objects.requireNonNull(id, "id")); + public SaleGiftCardPayment build() { + return new SaleGiftCardPayment(Objects.requireNonNull(id, "id")); } } } diff --git a/src/main/java/com/sumup/sdk/models/SaleLineItemV10.java b/src/main/java/com/sumup/sdk/models/SaleItem.java similarity index 77% rename from src/main/java/com/sumup/sdk/models/SaleLineItemV10.java rename to src/main/java/com/sumup/sdk/models/SaleItem.java index 3890c04a..bc51a9f2 100644 --- a/src/main/java/com/sumup/sdk/models/SaleLineItemV10.java +++ b/src/main/java/com/sumup/sdk/models/SaleItem.java @@ -9,18 +9,18 @@ * Type-specific data is in `features`. There is no per-type object and no discriminator, so a new * item type does not change this schema. */ -public record SaleLineItemV10( +public record SaleItem( /** * Categories the line belongs to. A shared optional structure available to any line; not a * per-type field. */ - java.util.List categories, + java.util.List categories, /** * Named, typed, type-specific data. New item types add their data here as features instead of - * new schema variants. See `Feature` for per-type examples. + * new schema variants. See `SaleItemFeature` for per-type examples. */ - java.util.List features, + java.util.List features, /** Stable identifier of the line within the sale. Used for linking (e.g. deposits). */ String id, @@ -42,7 +42,7 @@ public record SaleLineItemV10( * breakdown) and the final amounts (after discounts/modifiers). Totals and tax amounts can be * negative for return-like operations (for example a deposit with `operation_type` = `RETURN`). */ - com.sumup.sdk.models.LineItemPriceV10 price, + com.sumup.sdk.models.SaleItemPrice price, /** The numerical value representing the quantity in the specified unit. */ Double quantity, @@ -51,46 +51,46 @@ public record SaleLineItemV10( * Outward identifiers and links for a line, kept in one place rather than scattered per item * type. */ - com.sumup.sdk.models.ItemReferencesV10 references, + com.sumup.sdk.models.SaleItemReferences references, /** The type of service for this line. */ - com.sumup.sdk.models.SaleLineItemV10ServiceType serviceType, + com.sumup.sdk.models.SaleItemServiceType serviceType, /** * Classifies a sale line. Not a schema subclass. Known values: `CATALOG`, `DEPOSIT`, * `GIFT_CARD`, `CUSTOM`, `FEE`. `FEE` lines represent merchant-charged fees on the sale (e.g. * shipping, service charge, surcharge, cancellation). They participate in sale totals like any - * other line; type-specific data is carried in `features` (see `Feature` for the conventional - * feature keys). This is intentionally an open string, NOT a closed enum: new values are added - * over time as pure data and consumers MUST tolerate unknown values, rendering the line from - * the generic envelope (name, quantity, price, taxes) and reading any extra information from - * `features`. + * other line; type-specific data is carried in `features` (see `SaleItemFeature` for the + * conventional feature keys). This is intentionally an open string, NOT a closed enum: new + * values are added over time as pure data and consumers MUST tolerate unknown values, rendering + * the line from the generic envelope (name, quantity, price, taxes) and reading any extra + * information from `features`. */ String type, /** The unit of measure of the item. */ com.sumup.sdk.models.UnitOfMeasure unitOfMeasure) { /** - * Creates a builder for SaleLineItemV10. + * Creates a builder for SaleItem. * - * @return Builder that constructs immutable SaleLineItemV10 instances. + * @return Builder that constructs immutable SaleItem instances. */ public static Builder builder() { return new Builder(); } - /** Builder for SaleLineItemV10 instances. */ + /** Builder for SaleItem instances. */ public static final class Builder { - private java.util.List categories; - private java.util.List features; + private java.util.List categories; + private java.util.List features; private String id; private java.util.List modifiers; private String name; private String note; - private com.sumup.sdk.models.LineItemPriceV10 price; + private com.sumup.sdk.models.SaleItemPrice price; private Double quantity; - private com.sumup.sdk.models.ItemReferencesV10 references; - private com.sumup.sdk.models.SaleLineItemV10ServiceType serviceType; + private com.sumup.sdk.models.SaleItemReferences references; + private com.sumup.sdk.models.SaleItemServiceType serviceType; private String type; private com.sumup.sdk.models.UnitOfMeasure unitOfMeasure; @@ -103,7 +103,7 @@ private Builder() {} * any line; not a per-type field. * @return This builder instance. */ - public Builder categories(java.util.List categories) { + public Builder categories(java.util.List categories) { this.categories = categories; return this; } @@ -112,10 +112,10 @@ public Builder categories(java.util.List categ * Sets the value for {@code features}. * * @param features Named, typed, type-specific data. New item types add their data here as - * features instead of new schema variants. See `Feature` for per-type examples. + * features instead of new schema variants. See `SaleItemFeature` for per-type examples. * @return This builder instance. */ - public Builder features(java.util.List features) { + public Builder features(java.util.List features) { this.features = features; return this; } @@ -174,7 +174,7 @@ public Builder note(String note) { * `operation_type` = `RETURN`). * @return This builder instance. */ - public Builder price(com.sumup.sdk.models.LineItemPriceV10 price) { + public Builder price(com.sumup.sdk.models.SaleItemPrice price) { this.price = price; return this; } @@ -197,7 +197,7 @@ public Builder quantity(Double quantity) { * scattered per item type. * @return This builder instance. */ - public Builder references(com.sumup.sdk.models.ItemReferencesV10 references) { + public Builder references(com.sumup.sdk.models.SaleItemReferences references) { this.references = references; return this; } @@ -208,7 +208,7 @@ public Builder references(com.sumup.sdk.models.ItemReferencesV10 references) { * @param serviceType The type of service for this line. * @return This builder instance. */ - public Builder serviceType(com.sumup.sdk.models.SaleLineItemV10ServiceType serviceType) { + public Builder serviceType(com.sumup.sdk.models.SaleItemServiceType serviceType) { this.serviceType = serviceType; return this; } @@ -220,10 +220,10 @@ public Builder serviceType(com.sumup.sdk.models.SaleLineItemV10ServiceType servi * `DEPOSIT`, `GIFT_CARD`, `CUSTOM`, `FEE`. `FEE` lines represent merchant-charged fees on * the sale (e.g. shipping, service charge, surcharge, cancellation). They participate in * sale totals like any other line; type-specific data is carried in `features` (see - * `Feature` for the conventional feature keys). This is intentionally an open string, NOT a - * closed enum: new values are added over time as pure data and consumers MUST tolerate - * unknown values, rendering the line from the generic envelope (name, quantity, price, - * taxes) and reading any extra information from `features`. + * `SaleItemFeature` for the conventional feature keys). This is intentionally an open + * string, NOT a closed enum: new values are added over time as pure data and consumers MUST + * tolerate unknown values, rendering the line from the generic envelope (name, quantity, + * price, taxes) and reading any extra information from `features`. * @return This builder instance. */ public Builder type(String type) { @@ -243,12 +243,12 @@ public Builder unitOfMeasure(com.sumup.sdk.models.UnitOfMeasure unitOfMeasure) { } /** - * Builds an immutable SaleLineItemV10 instance. + * Builds an immutable SaleItem instance. * - * @return Immutable SaleLineItemV10. + * @return Immutable SaleItem. */ - public SaleLineItemV10 build() { - return new SaleLineItemV10( + public SaleItem build() { + return new SaleItem( categories, features, Objects.requireNonNull(id, "id"), diff --git a/src/main/java/com/sumup/sdk/models/CategoryV10.java b/src/main/java/com/sumup/sdk/models/SaleItemCategory.java similarity index 74% rename from src/main/java/com/sumup/sdk/models/CategoryV10.java rename to src/main/java/com/sumup/sdk/models/SaleItemCategory.java index e5590ea1..2bb0628e 100644 --- a/src/main/java/com/sumup/sdk/models/CategoryV10.java +++ b/src/main/java/com/sumup/sdk/models/SaleItemCategory.java @@ -4,22 +4,22 @@ import java.util.Objects; /** A category a line belongs to. */ -public record CategoryV10( +public record SaleItemCategory( /** The category id. Usually a UUID, but not always (legacy cases). */ String id, /** The category name. */ String name) { /** - * Creates a builder for CategoryV10. + * Creates a builder for SaleItemCategory. * - * @return Builder that constructs immutable CategoryV10 instances. + * @return Builder that constructs immutable SaleItemCategory instances. */ public static Builder builder() { return new Builder(); } - /** Builder for CategoryV10 instances. */ + /** Builder for SaleItemCategory instances. */ public static final class Builder { private String id; private String name; @@ -49,12 +49,12 @@ public Builder name(String name) { } /** - * Builds an immutable CategoryV10 instance. + * Builds an immutable SaleItemCategory instance. * - * @return Immutable CategoryV10. + * @return Immutable SaleItemCategory. */ - public CategoryV10 build() { - return new CategoryV10( + public SaleItemCategory build() { + return new SaleItemCategory( Objects.requireNonNull(id, "id"), Objects.requireNonNull(name, "name")); } } diff --git a/src/main/java/com/sumup/sdk/models/FeatureV10.java b/src/main/java/com/sumup/sdk/models/SaleItemFeature.java similarity index 85% rename from src/main/java/com/sumup/sdk/models/FeatureV10.java rename to src/main/java/com/sumup/sdk/models/SaleItemFeature.java index 31b26698..ce313f9b 100644 --- a/src/main/java/com/sumup/sdk/models/FeatureV10.java +++ b/src/main/java/com/sumup/sdk/models/SaleItemFeature.java @@ -20,7 +20,7 @@ * noted): `delivery_name`, `tracking_reference` (shipping); `card_type`, `scheme` (surcharge); * `policy_id` (cancellation) */ -public record FeatureV10( +public record SaleItemFeature( /** The feature name/key. */ String name, @@ -35,21 +35,21 @@ public record FeatureV10( * The data type of a feature value. The wire `value` is always a string and is parsed according * to this type. */ - com.sumup.sdk.models.FeatureValueTypeV10 valueType) { + com.sumup.sdk.models.SaleItemFeatureValueType valueType) { /** - * Creates a builder for FeatureV10. + * Creates a builder for SaleItemFeature. * - * @return Builder that constructs immutable FeatureV10 instances. + * @return Builder that constructs immutable SaleItemFeature instances. */ public static Builder builder() { return new Builder(); } - /** Builder for FeatureV10 instances. */ + /** Builder for SaleItemFeature instances. */ public static final class Builder { private String name; private String value; - private com.sumup.sdk.models.FeatureValueTypeV10 valueType; + private com.sumup.sdk.models.SaleItemFeatureValueType valueType; private Builder() {} @@ -85,18 +85,18 @@ public Builder value(String value) { * parsed according to this type. * @return This builder instance. */ - public Builder valueType(com.sumup.sdk.models.FeatureValueTypeV10 valueType) { + public Builder valueType(com.sumup.sdk.models.SaleItemFeatureValueType valueType) { this.valueType = valueType; return this; } /** - * Builds an immutable FeatureV10 instance. + * Builds an immutable SaleItemFeature instance. * - * @return Immutable FeatureV10. + * @return Immutable SaleItemFeature. */ - public FeatureV10 build() { - return new FeatureV10( + public SaleItemFeature build() { + return new SaleItemFeature( Objects.requireNonNull(name, "name"), Objects.requireNonNull(value, "value"), Objects.requireNonNull(valueType, "valueType")); diff --git a/src/main/java/com/sumup/sdk/models/SaleItemFeatureValueType.java b/src/main/java/com/sumup/sdk/models/SaleItemFeatureValueType.java new file mode 100644 index 00000000..2240bce5 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SaleItemFeatureValueType.java @@ -0,0 +1,60 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; + +/** + * The data type of a feature value. The wire `value` is always a string and is parsed according to + * this type. + */ +public final class SaleItemFeatureValueType { + public static final SaleItemFeatureValueType TEXT = new SaleItemFeatureValueType("TEXT"); + public static final SaleItemFeatureValueType INTEGER = new SaleItemFeatureValueType("INTEGER"); + public static final SaleItemFeatureValueType DECIMAL = new SaleItemFeatureValueType("DECIMAL"); + public static final SaleItemFeatureValueType DATE = new SaleItemFeatureValueType("DATE"); + public static final SaleItemFeatureValueType BOOLEAN = new SaleItemFeatureValueType("BOOLEAN"); + + private final String value; + + private SaleItemFeatureValueType(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a SaleItemFeatureValueType for a value not yet known to this SDK version. + * + * @param value Wire value sent to or received from the API. + * @return Open enum value wrapping {@code value}. + */ + public static SaleItemFeatureValueType of(String value) { + return new SaleItemFeatureValueType(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static SaleItemFeatureValueType fromValue(String value) { + return value == null ? null : new SaleItemFeatureValueType(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof SaleItemFeatureValueType that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/LineItemPriceV10.java b/src/main/java/com/sumup/sdk/models/SaleItemPrice.java similarity index 94% rename from src/main/java/com/sumup/sdk/models/LineItemPriceV10.java rename to src/main/java/com/sumup/sdk/models/SaleItemPrice.java index c82e8f73..53383c7a 100644 --- a/src/main/java/com/sumup/sdk/models/LineItemPriceV10.java +++ b/src/main/java/com/sumup/sdk/models/SaleItemPrice.java @@ -8,7 +8,7 @@ * breakdown) and the final amounts (after discounts/modifiers). Totals and tax amounts can be * negative for return-like operations (for example a deposit with `operation_type` = `RETURN`). */ -public record LineItemPriceV10( +public record SaleItemPrice( /** * Discounts applied. Discount amounts do not affect `total_net_amount` / `total_gross_amount`; * they are reflected in the `*_final` amounts. @@ -48,15 +48,15 @@ public record LineItemPriceV10( */ Long unitAmount) { /** - * Creates a builder for LineItemPriceV10. + * Creates a builder for SaleItemPrice. * - * @return Builder that constructs immutable LineItemPriceV10 instances. + * @return Builder that constructs immutable SaleItemPrice instances. */ public static Builder builder() { return new Builder(); } - /** Builder for LineItemPriceV10 instances. */ + /** Builder for SaleItemPrice instances. */ public static final class Builder { private java.util.List discounts; private java.util.List taxes; @@ -165,12 +165,12 @@ public Builder unitAmount(Long unitAmount) { } /** - * Builds an immutable LineItemPriceV10 instance. + * Builds an immutable SaleItemPrice instance. * - * @return Immutable LineItemPriceV10. + * @return Immutable SaleItemPrice. */ - public LineItemPriceV10 build() { - return new LineItemPriceV10( + public SaleItemPrice build() { + return new SaleItemPrice( discounts, Objects.requireNonNull(taxes, "taxes"), Objects.requireNonNull(taxesFinal, "taxesFinal"), diff --git a/src/main/java/com/sumup/sdk/models/ItemReferencesV10.java b/src/main/java/com/sumup/sdk/models/SaleItemReferences.java similarity index 80% rename from src/main/java/com/sumup/sdk/models/ItemReferencesV10.java rename to src/main/java/com/sumup/sdk/models/SaleItemReferences.java index 007b1dfa..668e5c55 100644 --- a/src/main/java/com/sumup/sdk/models/ItemReferencesV10.java +++ b/src/main/java/com/sumup/sdk/models/SaleItemReferences.java @@ -4,7 +4,7 @@ /** * Outward identifiers and links for a line, kept in one place rather than scattered per item type. */ -public record ItemReferencesV10( +public record SaleItemReferences( /** * Reference to the backing catalog entity (item variant, deposit, ...), typically a URN such as * `urn:sumup:pos:variant:${MERCHANT_CODE}:${ITEM_ID}:${VARIANT_ID}` or @@ -15,7 +15,7 @@ public record ItemReferencesV10( String catalogReference, /** The source of the catalog the line originates from. */ - com.sumup.sdk.models.ItemReferencesV10CatalogSource catalogSource, + com.sumup.sdk.models.SaleItemReferencesCatalogSource catalogSource, /** An external reference id connecting this line to another system. */ String externalId, @@ -23,18 +23,18 @@ public record ItemReferencesV10( /** Stock keeping unit, enriched from the Catalog when available. */ String sku) { /** - * Creates a builder for ItemReferencesV10. + * Creates a builder for SaleItemReferences. * - * @return Builder that constructs immutable ItemReferencesV10 instances. + * @return Builder that constructs immutable SaleItemReferences instances. */ public static Builder builder() { return new Builder(); } - /** Builder for ItemReferencesV10 instances. */ + /** Builder for SaleItemReferences instances. */ public static final class Builder { private String catalogReference; - private com.sumup.sdk.models.ItemReferencesV10CatalogSource catalogSource; + private com.sumup.sdk.models.SaleItemReferencesCatalogSource catalogSource; private String externalId; private String sku; @@ -62,7 +62,7 @@ public Builder catalogReference(String catalogReference) { * @return This builder instance. */ public Builder catalogSource( - com.sumup.sdk.models.ItemReferencesV10CatalogSource catalogSource) { + com.sumup.sdk.models.SaleItemReferencesCatalogSource catalogSource) { this.catalogSource = catalogSource; return this; } @@ -90,12 +90,12 @@ public Builder sku(String sku) { } /** - * Builds an immutable ItemReferencesV10 instance. + * Builds an immutable SaleItemReferences instance. * - * @return Immutable ItemReferencesV10. + * @return Immutable SaleItemReferences. */ - public ItemReferencesV10 build() { - return new ItemReferencesV10(catalogReference, catalogSource, externalId, sku); + public SaleItemReferences build() { + return new SaleItemReferences(catalogReference, catalogSource, externalId, sku); } } } diff --git a/src/main/java/com/sumup/sdk/models/SaleItemReferencesCatalogSource.java b/src/main/java/com/sumup/sdk/models/SaleItemReferencesCatalogSource.java new file mode 100644 index 00000000..574dce35 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SaleItemReferencesCatalogSource.java @@ -0,0 +1,56 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; + +/** The source of the catalog the line originates from. */ +public final class SaleItemReferencesCatalogSource { + public static final SaleItemReferencesCatalogSource SUMUP = + new SaleItemReferencesCatalogSource("SUMUP"); + public static final SaleItemReferencesCatalogSource EXTERNAL = + new SaleItemReferencesCatalogSource("EXTERNAL"); + + private final String value; + + private SaleItemReferencesCatalogSource(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a SaleItemReferencesCatalogSource for a value not yet known to this SDK version. + * + * @param value Wire value sent to or received from the API. + * @return Open enum value wrapping {@code value}. + */ + public static SaleItemReferencesCatalogSource of(String value) { + return new SaleItemReferencesCatalogSource(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static SaleItemReferencesCatalogSource fromValue(String value) { + return value == null ? null : new SaleItemReferencesCatalogSource(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof SaleItemReferencesCatalogSource that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/SaleLineItemV10ServiceType.java b/src/main/java/com/sumup/sdk/models/SaleItemServiceType.java similarity index 51% rename from src/main/java/com/sumup/sdk/models/SaleLineItemV10ServiceType.java rename to src/main/java/com/sumup/sdk/models/SaleItemServiceType.java index 34143d54..c7abfbe2 100644 --- a/src/main/java/com/sumup/sdk/models/SaleLineItemV10ServiceType.java +++ b/src/main/java/com/sumup/sdk/models/SaleItemServiceType.java @@ -6,26 +6,24 @@ import java.util.Objects; /** The type of service for this line. */ -public final class SaleLineItemV10ServiceType { - public static final SaleLineItemV10ServiceType IN_HOUSE = - new SaleLineItemV10ServiceType("IN_HOUSE"); - public static final SaleLineItemV10ServiceType TAKE_AWAY = - new SaleLineItemV10ServiceType("TAKE_AWAY"); +public final class SaleItemServiceType { + public static final SaleItemServiceType IN_HOUSE = new SaleItemServiceType("IN_HOUSE"); + public static final SaleItemServiceType TAKE_AWAY = new SaleItemServiceType("TAKE_AWAY"); private final String value; - private SaleLineItemV10ServiceType(String value) { + private SaleItemServiceType(String value) { this.value = Objects.requireNonNull(value, "value"); } /** - * Creates a SaleLineItemV10ServiceType for a value not yet known to this SDK version. + * Creates a SaleItemServiceType for a value not yet known to this SDK version. * * @param value Wire value sent to or received from the API. * @return Open enum value wrapping {@code value}. */ - public static SaleLineItemV10ServiceType of(String value) { - return new SaleLineItemV10ServiceType(value); + public static SaleItemServiceType of(String value) { + return new SaleItemServiceType(value); } @JsonValue @@ -39,14 +37,14 @@ public String toString() { } @JsonCreator - public static SaleLineItemV10ServiceType fromValue(String value) { - return value == null ? null : new SaleLineItemV10ServiceType(value); + public static SaleItemServiceType fromValue(String value) { + return value == null ? null : new SaleItemServiceType(value); } @Override public boolean equals(Object other) { return this == other - || (other instanceof SaleLineItemV10ServiceType that && this.value.equals(that.value)); + || (other instanceof SaleItemServiceType that && this.value.equals(that.value)); } @Override diff --git a/src/main/java/com/sumup/sdk/models/SaleStateV10.java b/src/main/java/com/sumup/sdk/models/SaleLifecycleState.java similarity index 58% rename from src/main/java/com/sumup/sdk/models/SaleStateV10.java rename to src/main/java/com/sumup/sdk/models/SaleLifecycleState.java index c463c306..35e9b3a8 100644 --- a/src/main/java/com/sumup/sdk/models/SaleStateV10.java +++ b/src/main/java/com/sumup/sdk/models/SaleLifecycleState.java @@ -6,23 +6,23 @@ import java.util.Objects; /** Lifecycle state of the sale. Non-finalised sales are never returned; only fully-paid sales. */ -public final class SaleStateV10 { - public static final SaleStateV10 CLOSED = new SaleStateV10("CLOSED"); +public final class SaleLifecycleState { + public static final SaleLifecycleState CLOSED = new SaleLifecycleState("CLOSED"); private final String value; - private SaleStateV10(String value) { + private SaleLifecycleState(String value) { this.value = Objects.requireNonNull(value, "value"); } /** - * Creates a SaleStateV10 for a value not yet known to this SDK version. + * Creates a SaleLifecycleState for a value not yet known to this SDK version. * * @param value Wire value sent to or received from the API. * @return Open enum value wrapping {@code value}. */ - public static SaleStateV10 of(String value) { - return new SaleStateV10(value); + public static SaleLifecycleState of(String value) { + return new SaleLifecycleState(value); } @JsonValue @@ -36,13 +36,14 @@ public String toString() { } @JsonCreator - public static SaleStateV10 fromValue(String value) { - return value == null ? null : new SaleStateV10(value); + public static SaleLifecycleState fromValue(String value) { + return value == null ? null : new SaleLifecycleState(value); } @Override public boolean equals(Object other) { - return this == other || (other instanceof SaleStateV10 that && this.value.equals(that.value)); + return this == other + || (other instanceof SaleLifecycleState that && this.value.equals(that.value)); } @Override diff --git a/src/main/java/com/sumup/sdk/models/PublicPaymentV10.java b/src/main/java/com/sumup/sdk/models/SalePayment.java similarity index 87% rename from src/main/java/com/sumup/sdk/models/PublicPaymentV10.java rename to src/main/java/com/sumup/sdk/models/SalePayment.java index 3505d4c1..fa7c9cd2 100644 --- a/src/main/java/com/sumup/sdk/models/PublicPaymentV10.java +++ b/src/main/java/com/sumup/sdk/models/SalePayment.java @@ -8,7 +8,7 @@ * this object. Merchant-charged fees (shipping, service charge, etc.) appear as `type: "FEE"` item * lines in `Sale.items`. */ -public record PublicPaymentV10( +public record SalePayment( /** * The amount of the payment including tips. The value of the amount in minor units of * `Sale.currency`. @@ -24,14 +24,14 @@ public record PublicPaymentV10( String apmType, /** Card brand, credit/debit processing type, and last four digits. */ - com.sumup.sdk.models.PublicCardV10 card, + com.sumup.sdk.models.SalePaymentCard card, /** * Gift card used for this payment. Present when `method` is `gift_card` and the gift card id is * known. Gift card IDs use the format "GC" followed by 9 alphanumeric characters (e.g. * GCZ3NTMB1V). */ - com.sumup.sdk.models.PublicGiftCardPayment giftCard, + com.sumup.sdk.models.SaleGiftCardPayment giftCard, /** * Payment method on public sales read API v1.0. Digital wallets are first-class methods. Gift @@ -52,7 +52,7 @@ public record PublicPaymentV10( String reference, /** The status of the payment. */ - com.sumup.sdk.models.PublicPaymentV10Status status, + com.sumup.sdk.models.SalePaymentStatus status, /** * Payment operation type. This is distinct from the payment instrument in `method`. Values use @@ -61,24 +61,24 @@ public record PublicPaymentV10( */ String type) { /** - * Creates a builder for PublicPaymentV10. + * Creates a builder for SalePayment. * - * @return Builder that constructs immutable PublicPaymentV10 instances. + * @return Builder that constructs immutable SalePayment instances. */ public static Builder builder() { return new Builder(); } - /** Builder for PublicPaymentV10 instances. */ + /** Builder for SalePayment instances. */ public static final class Builder { private Long amount; private String apmType; - private com.sumup.sdk.models.PublicCardV10 card; - private com.sumup.sdk.models.PublicGiftCardPayment giftCard; + private com.sumup.sdk.models.SalePaymentCard card; + private com.sumup.sdk.models.SaleGiftCardPayment giftCard; private String method; private java.time.OffsetDateTime processedAt; private String reference; - private com.sumup.sdk.models.PublicPaymentV10Status status; + private com.sumup.sdk.models.SalePaymentStatus status; private String type; private Builder() {} @@ -115,7 +115,7 @@ public Builder apmType(String apmType) { * @param card Card brand, credit/debit processing type, and last four digits. * @return This builder instance. */ - public Builder card(com.sumup.sdk.models.PublicCardV10 card) { + public Builder card(com.sumup.sdk.models.SalePaymentCard card) { this.card = card; return this; } @@ -128,7 +128,7 @@ public Builder card(com.sumup.sdk.models.PublicCardV10 card) { * characters (e.g. GCZ3NTMB1V). * @return This builder instance. */ - public Builder giftCard(com.sumup.sdk.models.PublicGiftCardPayment giftCard) { + public Builder giftCard(com.sumup.sdk.models.SaleGiftCardPayment giftCard) { this.giftCard = giftCard; return this; } @@ -179,7 +179,7 @@ public Builder reference(String reference) { * @param status The status of the payment. * @return This builder instance. */ - public Builder status(com.sumup.sdk.models.PublicPaymentV10Status status) { + public Builder status(com.sumup.sdk.models.SalePaymentStatus status) { this.status = status; return this; } @@ -198,12 +198,12 @@ public Builder type(String type) { } /** - * Builds an immutable PublicPaymentV10 instance. + * Builds an immutable SalePayment instance. * - * @return Immutable PublicPaymentV10. + * @return Immutable SalePayment. */ - public PublicPaymentV10 build() { - return new PublicPaymentV10( + public SalePayment build() { + return new SalePayment( Objects.requireNonNull(amount, "amount"), apmType, card, diff --git a/src/main/java/com/sumup/sdk/models/PublicCardV10.java b/src/main/java/com/sumup/sdk/models/SalePaymentCard.java similarity index 80% rename from src/main/java/com/sumup/sdk/models/PublicCardV10.java rename to src/main/java/com/sumup/sdk/models/SalePaymentCard.java index 854c260a..a1d0c73d 100644 --- a/src/main/java/com/sumup/sdk/models/PublicCardV10.java +++ b/src/main/java/com/sumup/sdk/models/SalePaymentCard.java @@ -4,7 +4,7 @@ import java.util.Objects; /** Card brand, credit/debit processing type, and last four digits. */ -public record PublicCardV10( +public record SalePaymentCard( /** * The brand of the card. Input is case-insensitive; the canonical form is lowercase snake_case. * **VALUES**: [amex, cup, diners, discover, elo, elv, hipercard, jcb, maestro, mastercard, @@ -20,21 +20,21 @@ public record PublicCardV10( * Credit or debit processing choice, not brand or funding. `unknown` when unavailable; * prepaid/voucher are not processing types. */ - com.sumup.sdk.models.PublicCardV10Type type) { + com.sumup.sdk.models.SalePaymentCardType type) { /** - * Creates a builder for PublicCardV10. + * Creates a builder for SalePaymentCard. * - * @return Builder that constructs immutable PublicCardV10 instances. + * @return Builder that constructs immutable SalePaymentCard instances. */ public static Builder builder() { return new Builder(); } - /** Builder for PublicCardV10 instances. */ + /** Builder for SalePaymentCard instances. */ public static final class Builder { private String brand; private String last4Digits; - private com.sumup.sdk.models.PublicCardV10Type type; + private com.sumup.sdk.models.SalePaymentCardType type; private Builder() {} @@ -70,18 +70,18 @@ public Builder last4Digits(String last4Digits) { * unavailable; prepaid/voucher are not processing types. * @return This builder instance. */ - public Builder type(com.sumup.sdk.models.PublicCardV10Type type) { + public Builder type(com.sumup.sdk.models.SalePaymentCardType type) { this.type = type; return this; } /** - * Builds an immutable PublicCardV10 instance. + * Builds an immutable SalePaymentCard instance. * - * @return Immutable PublicCardV10. + * @return Immutable SalePaymentCard. */ - public PublicCardV10 build() { - return new PublicCardV10( + public SalePaymentCard build() { + return new SalePaymentCard( Objects.requireNonNull(brand, "brand"), Objects.requireNonNull(last4Digits, "last4Digits"), Objects.requireNonNull(type, "type")); diff --git a/src/main/java/com/sumup/sdk/models/PublicCardV10Type.java b/src/main/java/com/sumup/sdk/models/SalePaymentCardType.java similarity index 54% rename from src/main/java/com/sumup/sdk/models/PublicCardV10Type.java rename to src/main/java/com/sumup/sdk/models/SalePaymentCardType.java index 38683acc..b6dd60ed 100644 --- a/src/main/java/com/sumup/sdk/models/PublicCardV10Type.java +++ b/src/main/java/com/sumup/sdk/models/SalePaymentCardType.java @@ -9,25 +9,25 @@ * Credit or debit processing choice, not brand or funding. `unknown` when unavailable; * prepaid/voucher are not processing types. */ -public final class PublicCardV10Type { - public static final PublicCardV10Type CREDIT = new PublicCardV10Type("credit"); - public static final PublicCardV10Type DEBIT = new PublicCardV10Type("debit"); - public static final PublicCardV10Type UNKNOWN = new PublicCardV10Type("unknown"); +public final class SalePaymentCardType { + public static final SalePaymentCardType CREDIT = new SalePaymentCardType("credit"); + public static final SalePaymentCardType DEBIT = new SalePaymentCardType("debit"); + public static final SalePaymentCardType UNKNOWN = new SalePaymentCardType("unknown"); private final String value; - private PublicCardV10Type(String value) { + private SalePaymentCardType(String value) { this.value = Objects.requireNonNull(value, "value"); } /** - * Creates a PublicCardV10Type for a value not yet known to this SDK version. + * Creates a SalePaymentCardType for a value not yet known to this SDK version. * * @param value Wire value sent to or received from the API. * @return Open enum value wrapping {@code value}. */ - public static PublicCardV10Type of(String value) { - return new PublicCardV10Type(value); + public static SalePaymentCardType of(String value) { + return new SalePaymentCardType(value); } @JsonValue @@ -41,14 +41,14 @@ public String toString() { } @JsonCreator - public static PublicCardV10Type fromValue(String value) { - return value == null ? null : new PublicCardV10Type(value); + public static SalePaymentCardType fromValue(String value) { + return value == null ? null : new SalePaymentCardType(value); } @Override public boolean equals(Object other) { return this == other - || (other instanceof PublicCardV10Type that && this.value.equals(that.value)); + || (other instanceof SalePaymentCardType that && this.value.equals(that.value)); } @Override diff --git a/src/main/java/com/sumup/sdk/models/SalePaymentStatus.java b/src/main/java/com/sumup/sdk/models/SalePaymentStatus.java new file mode 100644 index 00000000..5c1a79a6 --- /dev/null +++ b/src/main/java/com/sumup/sdk/models/SalePaymentStatus.java @@ -0,0 +1,55 @@ +// Code generated by sumup-java/codegen. DO NOT EDIT. +package com.sumup.sdk.models; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; + +/** The status of the payment. */ +public final class SalePaymentStatus { + public static final SalePaymentStatus FAILED = new SalePaymentStatus("FAILED"); + public static final SalePaymentStatus SUCCESSFUL = new SalePaymentStatus("SUCCESSFUL"); + public static final SalePaymentStatus CANCELED = new SalePaymentStatus("CANCELED"); + + private final String value; + + private SalePaymentStatus(String value) { + this.value = Objects.requireNonNull(value, "value"); + } + + /** + * Creates a SalePaymentStatus for a value not yet known to this SDK version. + * + * @param value Wire value sent to or received from the API. + * @return Open enum value wrapping {@code value}. + */ + public static SalePaymentStatus of(String value) { + return new SalePaymentStatus(value); + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return value; + } + + @JsonCreator + public static SalePaymentStatus fromValue(String value) { + return value == null ? null : new SalePaymentStatus(value); + } + + @Override + public boolean equals(Object other) { + return this == other + || (other instanceof SalePaymentStatus that && this.value.equals(that.value)); + } + + @Override + public int hashCode() { + return value.hashCode(); + } +} diff --git a/src/main/java/com/sumup/sdk/models/PaymentStatusFilterV10.java b/src/main/java/com/sumup/sdk/models/SalePaymentStatusFilter.java similarity index 59% rename from src/main/java/com/sumup/sdk/models/PaymentStatusFilterV10.java rename to src/main/java/com/sumup/sdk/models/SalePaymentStatusFilter.java index 1bc8072e..704565d8 100644 --- a/src/main/java/com/sumup/sdk/models/PaymentStatusFilterV10.java +++ b/src/main/java/com/sumup/sdk/models/SalePaymentStatusFilter.java @@ -10,25 +10,25 @@ * filters using **AND**. Only fully-paid closed sales are exposed. Refunded original sales remain * searchable as `PAID`; refunds are separate negative sales, not a `REFUNDED` sale-search outcome. */ -public final class PaymentStatusFilterV10 { - public static final PaymentStatusFilterV10 PAID = new PaymentStatusFilterV10("PAID"); - public static final PaymentStatusFilterV10 CHARGED_BACK = - new PaymentStatusFilterV10("CHARGED_BACK"); +public final class SalePaymentStatusFilter { + public static final SalePaymentStatusFilter PAID = new SalePaymentStatusFilter("PAID"); + public static final SalePaymentStatusFilter CHARGED_BACK = + new SalePaymentStatusFilter("CHARGED_BACK"); private final String value; - private PaymentStatusFilterV10(String value) { + private SalePaymentStatusFilter(String value) { this.value = Objects.requireNonNull(value, "value"); } /** - * Creates a PaymentStatusFilterV10 for a value not yet known to this SDK version. + * Creates a SalePaymentStatusFilter for a value not yet known to this SDK version. * * @param value Wire value sent to or received from the API. * @return Open enum value wrapping {@code value}. */ - public static PaymentStatusFilterV10 of(String value) { - return new PaymentStatusFilterV10(value); + public static SalePaymentStatusFilter of(String value) { + return new SalePaymentStatusFilter(value); } @JsonValue @@ -42,14 +42,14 @@ public String toString() { } @JsonCreator - public static PaymentStatusFilterV10 fromValue(String value) { - return value == null ? null : new PaymentStatusFilterV10(value); + public static SalePaymentStatusFilter fromValue(String value) { + return value == null ? null : new SalePaymentStatusFilter(value); } @Override public boolean equals(Object other) { return this == other - || (other instanceof PaymentStatusFilterV10 that && this.value.equals(that.value)); + || (other instanceof SalePaymentStatusFilter that && this.value.equals(that.value)); } @Override diff --git a/src/main/java/com/sumup/sdk/models/SaleSearchItem.java b/src/main/java/com/sumup/sdk/models/SaleSearchItem.java index 9550d3d0..da42485e 100644 --- a/src/main/java/com/sumup/sdk/models/SaleSearchItem.java +++ b/src/main/java/com/sumup/sdk/models/SaleSearchItem.java @@ -26,7 +26,7 @@ public record SaleSearchItem( /** * Lifecycle state of the sale. Non-finalised sales are never returned; only fully-paid sales. */ - com.sumup.sdk.models.SaleStateV10 state, + com.sumup.sdk.models.SaleLifecycleState state, /** Checkout tax mode for the sale. Same values as `Sale.tax_mode`. */ com.sumup.sdk.models.TaxMode taxMode, @@ -59,7 +59,7 @@ public static final class Builder { private com.sumup.sdk.models.SalesActivityCurrency currency; private String id; private String name; - private com.sumup.sdk.models.SaleStateV10 state; + private com.sumup.sdk.models.SaleLifecycleState state; private com.sumup.sdk.models.TaxMode taxMode; private Long totalAmount; private java.util.UUID userId; @@ -130,7 +130,7 @@ public Builder name(String name) { * fully-paid sales. * @return This builder instance. */ - public Builder state(com.sumup.sdk.models.SaleStateV10 state) { + public Builder state(com.sumup.sdk.models.SaleLifecycleState state) { this.state = state; return this; } diff --git a/src/main/java/com/sumup/sdk/models/SaleSearchRequest.java b/src/main/java/com/sumup/sdk/models/SaleSearchRequest.java index e1d67f39..bfad261a 100644 --- a/src/main/java/com/sumup/sdk/models/SaleSearchRequest.java +++ b/src/main/java/com/sumup/sdk/models/SaleSearchRequest.java @@ -24,17 +24,17 @@ public record SaleSearchRequest( * Filters rows by payment outcome. Multiple values match any of them (**OR**). The search row * does not echo this value. */ - java.util.List paymentStatuses, + java.util.List paymentStatuses, /** * Filters rows by sale lifecycle (`state`). Multiple values match any of them (**OR**). Uses * the same values as `Sale.state`. Non-finalised sales are never returned; only fully-paid * sales. */ - java.util.List saleStatuses, + java.util.List saleStatuses, /** Sales channel filter. Multiple values match any of them (**OR**). */ - java.util.List salesChannels, + java.util.List salesChannels, /** Sale created **on or after** this instant (inclusive). */ java.time.OffsetDateTime startDate) { @@ -52,9 +52,9 @@ public static final class Builder { private java.time.OffsetDateTime endDate; private Long paginationLimit; private String paginationToken; - private java.util.List paymentStatuses; - private java.util.List saleStatuses; - private java.util.List salesChannels; + private java.util.List paymentStatuses; + private java.util.List saleStatuses; + private java.util.List salesChannels; private java.time.OffsetDateTime startDate; private Builder() {} @@ -101,7 +101,7 @@ public Builder paginationToken(String paginationToken) { * @return This builder instance. */ public Builder paymentStatuses( - java.util.List paymentStatuses) { + java.util.List paymentStatuses) { this.paymentStatuses = paymentStatuses; return this; } @@ -114,7 +114,8 @@ public Builder paymentStatuses( * returned; only fully-paid sales. * @return This builder instance. */ - public Builder saleStatuses(java.util.List saleStatuses) { + public Builder saleStatuses( + java.util.List saleStatuses) { this.saleStatuses = saleStatuses; return this; } @@ -126,7 +127,7 @@ public Builder saleStatuses(java.util.List sa * @return This builder instance. */ public Builder salesChannels( - java.util.List salesChannels) { + java.util.List salesChannels) { this.salesChannels = salesChannels; return this; } diff --git a/src/main/java/com/sumup/sdk/models/SalePriceV10.java b/src/main/java/com/sumup/sdk/models/SaleTotals.java similarity index 89% rename from src/main/java/com/sumup/sdk/models/SalePriceV10.java rename to src/main/java/com/sumup/sdk/models/SaleTotals.java index 3e4ff196..bb623c98 100644 --- a/src/main/java/com/sumup/sdk/models/SalePriceV10.java +++ b/src/main/java/com/sumup/sdk/models/SaleTotals.java @@ -4,12 +4,12 @@ import java.util.Objects; /** - * Sale-level pricing aggregate, parallel to `LineItemPrice` on each `SaleLineItem`. Line-level + * Sale-level pricing aggregate, parallel to `SaleItemPrice` on each `SaleItem`. Line-level * breakdown (unit price, line discounts, per-line taxes) lives on `items[].price`. This object * holds the rolled-up totals and cart-level adjustments that consumers use for receipts and payment * reconciliation. */ -public record SalePriceV10( +public record SaleTotals( /** * Discounts applied at cart level. Item-level discounts remain on `items[].price.discounts`. */ @@ -35,15 +35,15 @@ public record SalePriceV10( */ java.util.List taxes) { /** - * Creates a builder for SalePriceV10. + * Creates a builder for SaleTotals. * - * @return Builder that constructs immutable SalePriceV10 instances. + * @return Builder that constructs immutable SaleTotals instances. */ public static Builder builder() { return new Builder(); } - /** Builder for SalePriceV10 instances. */ + /** Builder for SaleTotals instances. */ public static final class Builder { private java.util.List cartDiscounts; private Long grossAmount; @@ -104,12 +104,12 @@ public Builder taxes(java.util.List taxes) { } /** - * Builds an immutable SalePriceV10 instance. + * Builds an immutable SaleTotals instance. * - * @return Immutable SalePriceV10. + * @return Immutable SaleTotals. */ - public SalePriceV10 build() { - return new SalePriceV10( + public SaleTotals build() { + return new SaleTotals( cartDiscounts, Objects.requireNonNull(grossAmount, "grossAmount"), Objects.requireNonNull(netAmount, "netAmount"), diff --git a/src/main/java/com/sumup/sdk/models/SalesChannelFilterV10.java b/src/main/java/com/sumup/sdk/models/SalesChannelFilterV10.java deleted file mode 100644 index 9ffa8f54..00000000 --- a/src/main/java/com/sumup/sdk/models/SalesChannelFilterV10.java +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by sumup-java/codegen. DO NOT EDIT. -package com.sumup.sdk.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Objects; - -/** Sale channel filter value. Multi-select uses **OR** within this field. */ -public final class SalesChannelFilterV10 { - public static final SalesChannelFilterV10 POS = new SalesChannelFilterV10("POS"); - public static final SalesChannelFilterV10 ONLINE_PAYMENTS = - new SalesChannelFilterV10("ONLINE_PAYMENTS"); - public static final SalesChannelFilterV10 KIOSK = new SalesChannelFilterV10("KIOSK"); - public static final SalesChannelFilterV10 ONLINE_STORE = - new SalesChannelFilterV10("ONLINE_STORE"); - public static final SalesChannelFilterV10 SOLO = new SalesChannelFilterV10("SOLO"); - public static final SalesChannelFilterV10 ORDER_AND_PAY = - new SalesChannelFilterV10("ORDER_AND_PAY"); - public static final SalesChannelFilterV10 INVOICE = new SalesChannelFilterV10("INVOICE"); - public static final SalesChannelFilterV10 BOOKINGS = new SalesChannelFilterV10("BOOKINGS"); - public static final SalesChannelFilterV10 ORDER_AGGREGATOR = - new SalesChannelFilterV10("ORDER_AGGREGATOR"); - public static final SalesChannelFilterV10 SUBSCRIPTIONS = - new SalesChannelFilterV10("SUBSCRIPTIONS"); - public static final SalesChannelFilterV10 UNKNOWN = new SalesChannelFilterV10("UNKNOWN"); - - private final String value; - - private SalesChannelFilterV10(String value) { - this.value = Objects.requireNonNull(value, "value"); - } - - /** - * Creates a SalesChannelFilterV10 for a value not yet known to this SDK version. - * - * @param value Wire value sent to or received from the API. - * @return Open enum value wrapping {@code value}. - */ - public static SalesChannelFilterV10 of(String value) { - return new SalesChannelFilterV10(value); - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return value; - } - - @JsonCreator - public static SalesChannelFilterV10 fromValue(String value) { - return value == null ? null : new SalesChannelFilterV10(value); - } - - @Override - public boolean equals(Object other) { - return this == other - || (other instanceof SalesChannelFilterV10 that && this.value.equals(that.value)); - } - - @Override - public int hashCode() { - return value.hashCode(); - } -}