diff --git a/.spec-sha256 b/.spec-sha256 index 3c42680..ebd3a33 100644 --- a/.spec-sha256 +++ b/.spec-sha256 @@ -1 +1 @@ -d95f1962bb73a3e9792c2de01bd086edce7d3c1371ece42f7c4f12032cd29e17 +06a7c92e23df7c44f8898a2b18abec43aa5c14b8f12ea10e1ce65a94a14a0fb4 diff --git a/README.md b/README.md index bd77f86..c4f6588 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ client.conversations().list(null, null, null, null, null, null, "BUYER_ID", null // Writes (API key with items:write / conversations:write); the last argument, optional, is the Idempotency-Key. client.items().create(new ItemCreateRequest().name("Jacket")); // items().update(42, new ItemUpdateRequest()...) patches client.items().publish(42, new PublishRequest().accountIds(List.of(accountId))); +client.items().publish(42, new PublishRequest().accountIds(List.of(accountId)).scheduledAt(OffsetDateTime.parse("2026-11-02T10:00:00Z"))); // publish, priceDrop and republish take an optional scheduledAt, at most 30 days ahead; without it they run now client.conversations().sendMessage(conversationId, new SendMessageRequest().text("Hello!")); // Webhooks (webhooks:read / webhooks:write): endpoints, endpoint, createEndpoint, updateEndpoint, deleteEndpoint, secret, diff --git a/src/main/java/com/controlresell/sdk/ControlResell.java b/src/main/java/com/controlresell/sdk/ControlResell.java index cf92ea5..0533c1e 100644 --- a/src/main/java/com/controlresell/sdk/ControlResell.java +++ b/src/main/java/com/controlresell/sdk/ControlResell.java @@ -254,7 +254,7 @@ public void delete(long id) { }); } - /** Schedules the publication of an item on the given accounts, with a random {@code Idempotency-Key}. */ + /** Schedules the publication of an item on the given accounts, now or at {@code request.scheduledAt(...)} (at most 30 days ahead), with a random {@code Idempotency-Key}. */ public ScheduledAction publish(long id, PublishRequest request) { return publish(id, request, null); } /** Schedules the publication of an item on the given accounts; {@code idempotencyKey} may be {@code null}. */ @@ -263,7 +263,7 @@ public ScheduledAction publish(long id, PublishRequest request, String idempoten return call(false, h -> api.publishItem(id, key, request)); } - /** Schedules a price drop of the item's listings, with a random {@code Idempotency-Key}. */ + /** Schedules a price drop of the item's listings, now or at {@code request.scheduledAt(...)} (at most 30 days ahead), with a random {@code Idempotency-Key}. */ public ScheduledAction priceDrop(long id, PriceDropRequest request) { return priceDrop(id, request, null); } /** Schedules a price drop of the item's listings; {@code idempotencyKey} may be {@code null}. */ @@ -272,7 +272,7 @@ public ScheduledAction priceDrop(long id, PriceDropRequest request, String idemp return call(false, h -> api.dropItemPrice(id, key, request)); } - /** Schedules the republication of an item, with a random {@code Idempotency-Key}; {@code request} may be {@code null} (every account the item is listed on). */ + /** Schedules the republication of an item, now or at {@code request.scheduledAt(...)} (at most 30 days ahead), with a random {@code Idempotency-Key}; {@code request} may be {@code null} (every account the item is listed on, now). */ public ScheduledAction republish(long id, RepublishRequest request) { return republish(id, request, null); } /** Schedules the republication of an item; {@code request} and {@code idempotencyKey} may be {@code null}. */ diff --git a/src/main/java/com/controlresell/sdk/generated/api/ConversationsApi.java b/src/main/java/com/controlresell/sdk/generated/api/ConversationsApi.java index bfb367f..da18a8b 100644 --- a/src/main/java/com/controlresell/sdk/generated/api/ConversationsApi.java +++ b/src/main/java/com/controlresell/sdk/generated/api/ConversationsApi.java @@ -445,7 +445,7 @@ private HttpRequest.Builder listConversationMessagesRequestBuilder(@jakarta.anno /** * List the seller's conversations - * The conversations with buyers on the seller's marketplace accounts, latest activity first, one page at a time. A conversation that receives a message while you read moves to the head: read again from the first page to see it. Pass the `nextCursor` of a page as `cursor` with the same filters (a cursor reused with other filters is an `invalid_cursor`). `from` and `to` go straight to a period of the last message: `from` is inclusive, `to` exclusive, and the period is read page by page like the whole list. `buyerId`, `itemId` and `offerStatus` combine with the other filters (AND): `buyerId` is the buyer's identifier on the marketplace (a conversation's `buyerId`); `itemId` keeps the conversations about the item, through their transactions on the marketplace (a conversation the marketplace ties to no listing of the item is not found); `offerStatus` keeps those with at least one offer currently at that status, and with `itemId` that same offer is on the item. An `itemId` that is not one of the seller's items answers an empty page. Requires `conversations:read`. + * The conversations with buyers on the seller's marketplace accounts, latest activity first, one page at a time. A conversation that receives a message while you read moves to the head: read again from the first page to see it. Pass the `nextCursor` of a page as `cursor` with the same filters (a cursor reused with other filters is an `invalid_cursor`). `from` and `to` go straight to a period of the last message: `from` is inclusive, `to` exclusive, and the period is read page by page like the whole list. `buyerId`, `itemId` and `offerStatus` combine with the other filters (AND): `buyerId` is the buyer's identifier on the marketplace (a conversation's `buyerId`); `itemId` keeps the conversations about the item, through their transactions on the marketplace (a conversation the marketplace ties to no listing of the item is not found); `offerStatus` keeps those with at least one offer currently at that status; with `itemId`, that offer is on the item through its own transaction, and an offer with no transaction of its own counts when the conversation's transactions carry the item (so the result is approximate for such an offer: it can be an offer about another item of the same conversation). An `itemId` that is not one of the seller's items answers an empty page. Requires `conversations:read`. * @param limit Page size, 1 to 100 (50 by default). (optional, default to 50) * @param cursor The `nextCursor` of the previous page. (optional) * @param unread `true`: only conversations with an unread buyer message; `false`: the others. (optional) @@ -454,7 +454,7 @@ private HttpRequest.Builder listConversationMessagesRequestBuilder(@jakarta.anno * @param to Only the conversations whose last message is before this instant (exclusive), ISO-8601 with its offset; after `from`. (optional) * @param buyerId Only the conversations with this buyer, by their identifier on the marketplace (a conversation's or a favorite's `buyerId`). (optional) * @param itemId Only the conversations about this item of the seller (`GET /items`), through their transactions on the marketplace. (optional) - * @param offerStatus Only the conversations with at least one offer currently at this status: `PENDING`, `ACCEPTED`, `REJECTED` or `CANCELED`; with `itemId`, an offer on that item. (optional) + * @param offerStatus Only the conversations with at least one offer currently at this status: `PENDING`, `ACCEPTED`, `REJECTED` or `CANCELED`; with `itemId`, an offer on that item (approximate for an offer with no transaction of its own: the conversation's transactions then carry the item). (optional) * @return ConversationPage * @throws ApiException if fails to make API call */ @@ -464,7 +464,7 @@ public ConversationPage listConversations(@jakarta.annotation.Nullable Integer l /** * List the seller's conversations - * The conversations with buyers on the seller's marketplace accounts, latest activity first, one page at a time. A conversation that receives a message while you read moves to the head: read again from the first page to see it. Pass the `nextCursor` of a page as `cursor` with the same filters (a cursor reused with other filters is an `invalid_cursor`). `from` and `to` go straight to a period of the last message: `from` is inclusive, `to` exclusive, and the period is read page by page like the whole list. `buyerId`, `itemId` and `offerStatus` combine with the other filters (AND): `buyerId` is the buyer's identifier on the marketplace (a conversation's `buyerId`); `itemId` keeps the conversations about the item, through their transactions on the marketplace (a conversation the marketplace ties to no listing of the item is not found); `offerStatus` keeps those with at least one offer currently at that status, and with `itemId` that same offer is on the item. An `itemId` that is not one of the seller's items answers an empty page. Requires `conversations:read`. + * The conversations with buyers on the seller's marketplace accounts, latest activity first, one page at a time. A conversation that receives a message while you read moves to the head: read again from the first page to see it. Pass the `nextCursor` of a page as `cursor` with the same filters (a cursor reused with other filters is an `invalid_cursor`). `from` and `to` go straight to a period of the last message: `from` is inclusive, `to` exclusive, and the period is read page by page like the whole list. `buyerId`, `itemId` and `offerStatus` combine with the other filters (AND): `buyerId` is the buyer's identifier on the marketplace (a conversation's `buyerId`); `itemId` keeps the conversations about the item, through their transactions on the marketplace (a conversation the marketplace ties to no listing of the item is not found); `offerStatus` keeps those with at least one offer currently at that status; with `itemId`, that offer is on the item through its own transaction, and an offer with no transaction of its own counts when the conversation's transactions carry the item (so the result is approximate for such an offer: it can be an offer about another item of the same conversation). An `itemId` that is not one of the seller's items answers an empty page. Requires `conversations:read`. * @param limit Page size, 1 to 100 (50 by default). (optional, default to 50) * @param cursor The `nextCursor` of the previous page. (optional) * @param unread `true`: only conversations with an unread buyer message; `false`: the others. (optional) @@ -473,7 +473,7 @@ public ConversationPage listConversations(@jakarta.annotation.Nullable Integer l * @param to Only the conversations whose last message is before this instant (exclusive), ISO-8601 with its offset; after `from`. (optional) * @param buyerId Only the conversations with this buyer, by their identifier on the marketplace (a conversation's or a favorite's `buyerId`). (optional) * @param itemId Only the conversations about this item of the seller (`GET /items`), through their transactions on the marketplace. (optional) - * @param offerStatus Only the conversations with at least one offer currently at this status: `PENDING`, `ACCEPTED`, `REJECTED` or `CANCELED`; with `itemId`, an offer on that item. (optional) + * @param offerStatus Only the conversations with at least one offer currently at this status: `PENDING`, `ACCEPTED`, `REJECTED` or `CANCELED`; with `itemId`, an offer on that item (approximate for an offer with no transaction of its own: the conversation's transactions then carry the item). (optional) * @param headers Optional headers to include in the request * @return ConversationPage * @throws ApiException if fails to make API call @@ -485,7 +485,7 @@ public ConversationPage listConversations(@jakarta.annotation.Nullable Integer l /** * List the seller's conversations - * The conversations with buyers on the seller's marketplace accounts, latest activity first, one page at a time. A conversation that receives a message while you read moves to the head: read again from the first page to see it. Pass the `nextCursor` of a page as `cursor` with the same filters (a cursor reused with other filters is an `invalid_cursor`). `from` and `to` go straight to a period of the last message: `from` is inclusive, `to` exclusive, and the period is read page by page like the whole list. `buyerId`, `itemId` and `offerStatus` combine with the other filters (AND): `buyerId` is the buyer's identifier on the marketplace (a conversation's `buyerId`); `itemId` keeps the conversations about the item, through their transactions on the marketplace (a conversation the marketplace ties to no listing of the item is not found); `offerStatus` keeps those with at least one offer currently at that status, and with `itemId` that same offer is on the item. An `itemId` that is not one of the seller's items answers an empty page. Requires `conversations:read`. + * The conversations with buyers on the seller's marketplace accounts, latest activity first, one page at a time. A conversation that receives a message while you read moves to the head: read again from the first page to see it. Pass the `nextCursor` of a page as `cursor` with the same filters (a cursor reused with other filters is an `invalid_cursor`). `from` and `to` go straight to a period of the last message: `from` is inclusive, `to` exclusive, and the period is read page by page like the whole list. `buyerId`, `itemId` and `offerStatus` combine with the other filters (AND): `buyerId` is the buyer's identifier on the marketplace (a conversation's `buyerId`); `itemId` keeps the conversations about the item, through their transactions on the marketplace (a conversation the marketplace ties to no listing of the item is not found); `offerStatus` keeps those with at least one offer currently at that status; with `itemId`, that offer is on the item through its own transaction, and an offer with no transaction of its own counts when the conversation's transactions carry the item (so the result is approximate for such an offer: it can be an offer about another item of the same conversation). An `itemId` that is not one of the seller's items answers an empty page. Requires `conversations:read`. * @param limit Page size, 1 to 100 (50 by default). (optional, default to 50) * @param cursor The `nextCursor` of the previous page. (optional) * @param unread `true`: only conversations with an unread buyer message; `false`: the others. (optional) @@ -494,7 +494,7 @@ public ConversationPage listConversations(@jakarta.annotation.Nullable Integer l * @param to Only the conversations whose last message is before this instant (exclusive), ISO-8601 with its offset; after `from`. (optional) * @param buyerId Only the conversations with this buyer, by their identifier on the marketplace (a conversation's or a favorite's `buyerId`). (optional) * @param itemId Only the conversations about this item of the seller (`GET /items`), through their transactions on the marketplace. (optional) - * @param offerStatus Only the conversations with at least one offer currently at this status: `PENDING`, `ACCEPTED`, `REJECTED` or `CANCELED`; with `itemId`, an offer on that item. (optional) + * @param offerStatus Only the conversations with at least one offer currently at this status: `PENDING`, `ACCEPTED`, `REJECTED` or `CANCELED`; with `itemId`, an offer on that item (approximate for an offer with no transaction of its own: the conversation's transactions then carry the item). (optional) * @return ApiResponse<ConversationPage> * @throws ApiException if fails to make API call */ @@ -504,7 +504,7 @@ public ApiResponse listConversationsWithHttpInfo(@jakarta.anno /** * List the seller's conversations - * The conversations with buyers on the seller's marketplace accounts, latest activity first, one page at a time. A conversation that receives a message while you read moves to the head: read again from the first page to see it. Pass the `nextCursor` of a page as `cursor` with the same filters (a cursor reused with other filters is an `invalid_cursor`). `from` and `to` go straight to a period of the last message: `from` is inclusive, `to` exclusive, and the period is read page by page like the whole list. `buyerId`, `itemId` and `offerStatus` combine with the other filters (AND): `buyerId` is the buyer's identifier on the marketplace (a conversation's `buyerId`); `itemId` keeps the conversations about the item, through their transactions on the marketplace (a conversation the marketplace ties to no listing of the item is not found); `offerStatus` keeps those with at least one offer currently at that status, and with `itemId` that same offer is on the item. An `itemId` that is not one of the seller's items answers an empty page. Requires `conversations:read`. + * The conversations with buyers on the seller's marketplace accounts, latest activity first, one page at a time. A conversation that receives a message while you read moves to the head: read again from the first page to see it. Pass the `nextCursor` of a page as `cursor` with the same filters (a cursor reused with other filters is an `invalid_cursor`). `from` and `to` go straight to a period of the last message: `from` is inclusive, `to` exclusive, and the period is read page by page like the whole list. `buyerId`, `itemId` and `offerStatus` combine with the other filters (AND): `buyerId` is the buyer's identifier on the marketplace (a conversation's `buyerId`); `itemId` keeps the conversations about the item, through their transactions on the marketplace (a conversation the marketplace ties to no listing of the item is not found); `offerStatus` keeps those with at least one offer currently at that status; with `itemId`, that offer is on the item through its own transaction, and an offer with no transaction of its own counts when the conversation's transactions carry the item (so the result is approximate for such an offer: it can be an offer about another item of the same conversation). An `itemId` that is not one of the seller's items answers an empty page. Requires `conversations:read`. * @param limit Page size, 1 to 100 (50 by default). (optional, default to 50) * @param cursor The `nextCursor` of the previous page. (optional) * @param unread `true`: only conversations with an unread buyer message; `false`: the others. (optional) @@ -513,7 +513,7 @@ public ApiResponse listConversationsWithHttpInfo(@jakarta.anno * @param to Only the conversations whose last message is before this instant (exclusive), ISO-8601 with its offset; after `from`. (optional) * @param buyerId Only the conversations with this buyer, by their identifier on the marketplace (a conversation's or a favorite's `buyerId`). (optional) * @param itemId Only the conversations about this item of the seller (`GET /items`), through their transactions on the marketplace. (optional) - * @param offerStatus Only the conversations with at least one offer currently at this status: `PENDING`, `ACCEPTED`, `REJECTED` or `CANCELED`; with `itemId`, an offer on that item. (optional) + * @param offerStatus Only the conversations with at least one offer currently at this status: `PENDING`, `ACCEPTED`, `REJECTED` or `CANCELED`; with `itemId`, an offer on that item (approximate for an offer with no transaction of its own: the conversation's transactions then carry the item). (optional) * @param headers Optional headers to include in the request * @return ApiResponse<ConversationPage> * @throws ApiException if fails to make API call diff --git a/src/main/java/com/controlresell/sdk/generated/api/ItemsApi.java b/src/main/java/com/controlresell/sdk/generated/api/ItemsApi.java index 56abe6d..0b4f3e4 100644 --- a/src/main/java/com/controlresell/sdk/generated/api/ItemsApi.java +++ b/src/main/java/com/controlresell/sdk/generated/api/ItemsApi.java @@ -412,7 +412,7 @@ private HttpRequest.Builder deleteItemRequestBuilder(@jakarta.annotation.Nonnull /** * Lower the price of an item's listings - * Schedules a price drop of the item's existing listings, now, like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`. + * Schedules a price drop of the item's existing listings, now or at `scheduledAt` (at most 30 days ahead), like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`. * @param id The item's identifier, a number. (required) * @param idempotencyKey 1 to 255 characters, unique per write: a retry with the same key and the same request answers the first response again (`Idempotent-Replayed: true`), without running the write twice. (required) * @param priceDropRequest (required) @@ -425,7 +425,7 @@ public ScheduledAction dropItemPrice(@jakarta.annotation.Nonnull Long id, @jakar /** * Lower the price of an item's listings - * Schedules a price drop of the item's existing listings, now, like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`. + * Schedules a price drop of the item's existing listings, now or at `scheduledAt` (at most 30 days ahead), like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`. * @param id The item's identifier, a number. (required) * @param idempotencyKey 1 to 255 characters, unique per write: a retry with the same key and the same request answers the first response again (`Idempotent-Replayed: true`), without running the write twice. (required) * @param priceDropRequest (required) @@ -440,7 +440,7 @@ public ScheduledAction dropItemPrice(@jakarta.annotation.Nonnull Long id, @jakar /** * Lower the price of an item's listings - * Schedules a price drop of the item's existing listings, now, like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`. + * Schedules a price drop of the item's existing listings, now or at `scheduledAt` (at most 30 days ahead), like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`. * @param id The item's identifier, a number. (required) * @param idempotencyKey 1 to 255 characters, unique per write: a retry with the same key and the same request answers the first response again (`Idempotent-Replayed: true`), without running the write twice. (required) * @param priceDropRequest (required) @@ -453,7 +453,7 @@ public ApiResponse dropItemPriceWithHttpInfo(@jakarta.annotatio /** * Lower the price of an item's listings - * Schedules a price drop of the item's existing listings, now, like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`. + * Schedules a price drop of the item's existing listings, now or at `scheduledAt` (at most 30 days ahead), like the price drop of the app: the listings are updated, not republished. `value` is what is removed from each listing's current price, never the new price. Without `accountIds`, every account the item is online on. Requires `items:write` and an `Idempotency-Key`. * @param id The item's identifier, a number. (required) * @param idempotencyKey 1 to 255 characters, unique per write: a retry with the same key and the same request answers the first response again (`Idempotent-Replayed: true`), without running the write twice. (required) * @param priceDropRequest (required) @@ -937,7 +937,7 @@ private HttpRequest.Builder listItemsRequestBuilder(@jakarta.annotation.Nullable /** * Publish an item on the seller's accounts - * Schedules the publication of one item of the seller's stock on the given marketplace accounts, now. The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item (\"list it on eBay\"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`. + * Schedules the publication of one item of the seller's stock on the given marketplace accounts, now or at `scheduledAt` (at most 30 days ahead). The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item (\"list it on eBay\"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`. * @param id The item's identifier, a number. (required) * @param idempotencyKey 1 to 255 characters, unique per write: a retry with the same key and the same request answers the first response again (`Idempotent-Replayed: true`), without running the write twice. (required) * @param publishRequest (required) @@ -950,7 +950,7 @@ public ScheduledAction publishItem(@jakarta.annotation.Nonnull Long id, @jakarta /** * Publish an item on the seller's accounts - * Schedules the publication of one item of the seller's stock on the given marketplace accounts, now. The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item (\"list it on eBay\"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`. + * Schedules the publication of one item of the seller's stock on the given marketplace accounts, now or at `scheduledAt` (at most 30 days ahead). The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item (\"list it on eBay\"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`. * @param id The item's identifier, a number. (required) * @param idempotencyKey 1 to 255 characters, unique per write: a retry with the same key and the same request answers the first response again (`Idempotent-Replayed: true`), without running the write twice. (required) * @param publishRequest (required) @@ -965,7 +965,7 @@ public ScheduledAction publishItem(@jakarta.annotation.Nonnull Long id, @jakarta /** * Publish an item on the seller's accounts - * Schedules the publication of one item of the seller's stock on the given marketplace accounts, now. The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item (\"list it on eBay\"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`. + * Schedules the publication of one item of the seller's stock on the given marketplace accounts, now or at `scheduledAt` (at most 30 days ahead). The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item (\"list it on eBay\"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`. * @param id The item's identifier, a number. (required) * @param idempotencyKey 1 to 255 characters, unique per write: a retry with the same key and the same request answers the first response again (`Idempotent-Replayed: true`), without running the write twice. (required) * @param publishRequest (required) @@ -978,7 +978,7 @@ public ApiResponse publishItemWithHttpInfo(@jakarta.annotation. /** * Publish an item on the seller's accounts - * Schedules the publication of one item of the seller's stock on the given marketplace accounts, now. The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item (\"list it on eBay\"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`. + * Schedules the publication of one item of the seller's stock on the given marketplace accounts, now or at `scheduledAt` (at most 30 days ahead). The publication runs on the account's browser: read its result on `GET /items/{id}/listings`. To cross-list an item (\"list it on eBay\"), call this route with that account: this API never relays a marketplace's own API. Publishing one item on several accounts of the same marketplace risks a strike from it: name only the accounts you mean. Requires `items:write` and an `Idempotency-Key`. * @param id The item's identifier, a number. (required) * @param idempotencyKey 1 to 255 characters, unique per write: a retry with the same key and the same request answers the first response again (`Idempotent-Replayed: true`), without running the write twice. (required) * @param publishRequest (required) @@ -1080,7 +1080,7 @@ private HttpRequest.Builder publishItemRequestBuilder(@jakarta.annotation.Nonnul /** * Republish an item on the seller's accounts - * Schedules the republication of one item of the seller's stock, now, exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`. This API never relays a marketplace's own API (Vinted, eBay…): every write runs a ControlResell use case on an item of the seller's stock. To cross-list an item on another account or marketplace (\"list it on eBay\"), call `POST /items/{id}/publish` with that account. Requires `items:write` and an `Idempotency-Key`; costs 5 units of the rate limit. + * Schedules the republication of one item of the seller's stock, now or at `scheduledAt` (at most 30 days ahead), exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`. This API never relays a marketplace's own API (Vinted, eBay…): every write runs a ControlResell use case on an item of the seller's stock. To cross-list an item on another account or marketplace (\"list it on eBay\"), call `POST /items/{id}/publish` with that account. Requires `items:write` and an `Idempotency-Key`; costs 5 units of the rate limit. * @param id The item's identifier, a number. (required) * @param idempotencyKey 1 to 255 characters, unique per write: a retry with the same key and the same request answers the first response again (`Idempotent-Replayed: true`), without running the write twice. (required) * @param republishRequest (optional) @@ -1093,7 +1093,7 @@ public ScheduledAction republishItem(@jakarta.annotation.Nonnull Long id, @jakar /** * Republish an item on the seller's accounts - * Schedules the republication of one item of the seller's stock, now, exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`. This API never relays a marketplace's own API (Vinted, eBay…): every write runs a ControlResell use case on an item of the seller's stock. To cross-list an item on another account or marketplace (\"list it on eBay\"), call `POST /items/{id}/publish` with that account. Requires `items:write` and an `Idempotency-Key`; costs 5 units of the rate limit. + * Schedules the republication of one item of the seller's stock, now or at `scheduledAt` (at most 30 days ahead), exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`. This API never relays a marketplace's own API (Vinted, eBay…): every write runs a ControlResell use case on an item of the seller's stock. To cross-list an item on another account or marketplace (\"list it on eBay\"), call `POST /items/{id}/publish` with that account. Requires `items:write` and an `Idempotency-Key`; costs 5 units of the rate limit. * @param id The item's identifier, a number. (required) * @param idempotencyKey 1 to 255 characters, unique per write: a retry with the same key and the same request answers the first response again (`Idempotent-Replayed: true`), without running the write twice. (required) * @param republishRequest (optional) @@ -1108,7 +1108,7 @@ public ScheduledAction republishItem(@jakarta.annotation.Nonnull Long id, @jakar /** * Republish an item on the seller's accounts - * Schedules the republication of one item of the seller's stock, now, exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`. This API never relays a marketplace's own API (Vinted, eBay…): every write runs a ControlResell use case on an item of the seller's stock. To cross-list an item on another account or marketplace (\"list it on eBay\"), call `POST /items/{id}/publish` with that account. Requires `items:write` and an `Idempotency-Key`; costs 5 units of the rate limit. + * Schedules the republication of one item of the seller's stock, now or at `scheduledAt` (at most 30 days ahead), exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`. This API never relays a marketplace's own API (Vinted, eBay…): every write runs a ControlResell use case on an item of the seller's stock. To cross-list an item on another account or marketplace (\"list it on eBay\"), call `POST /items/{id}/publish` with that account. Requires `items:write` and an `Idempotency-Key`; costs 5 units of the rate limit. * @param id The item's identifier, a number. (required) * @param idempotencyKey 1 to 255 characters, unique per write: a retry with the same key and the same request answers the first response again (`Idempotent-Replayed: true`), without running the write twice. (required) * @param republishRequest (optional) @@ -1121,7 +1121,7 @@ public ApiResponse republishItemWithHttpInfo(@jakarta.annotatio /** * Republish an item on the seller's accounts - * Schedules the republication of one item of the seller's stock, now, exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`. This API never relays a marketplace's own API (Vinted, eBay…): every write runs a ControlResell use case on an item of the seller's stock. To cross-list an item on another account or marketplace (\"list it on eBay\"), call `POST /items/{id}/publish` with that account. Requires `items:write` and an `Idempotency-Key`; costs 5 units of the rate limit. + * Schedules the republication of one item of the seller's stock, now or at `scheduledAt` (at most 30 days ahead), exactly as the app and the MCP tool `republish_items` do: ControlResell deletes the listing and publishes it again from the item it holds, with the same safeguards (republication pace, publication guards). eBay, Shopify and Etsy do not republish: their accounts are refused (`republish_not_supported`). Without `accountIds`, every account the item is listed on. The republication runs on the account's browser: read its result on `GET /items/{id}/listings`. This API never relays a marketplace's own API (Vinted, eBay…): every write runs a ControlResell use case on an item of the seller's stock. To cross-list an item on another account or marketplace (\"list it on eBay\"), call `POST /items/{id}/publish` with that account. Requires `items:write` and an `Idempotency-Key`; costs 5 units of the rate limit. * @param id The item's identifier, a number. (required) * @param idempotencyKey 1 to 255 characters, unique per write: a retry with the same key and the same request answers the first response again (`Idempotent-Replayed: true`), without running the write twice. (required) * @param republishRequest (optional) diff --git a/src/main/java/com/controlresell/sdk/generated/model/PriceDropRequest.java b/src/main/java/com/controlresell/sdk/generated/model/PriceDropRequest.java index df3fed1..037805c 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/PriceDropRequest.java +++ b/src/main/java/com/controlresell/sdk/generated/model/PriceDropRequest.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -44,7 +45,8 @@ PriceDropRequest.JSON_PROPERTY_VALUE, PriceDropRequest.JSON_PROPERTY_ROUND_TYPE, PriceDropRequest.JSON_PROPERTY_ROUND_STEP, - PriceDropRequest.JSON_PROPERTY_ACCOUNT_IDS + PriceDropRequest.JSON_PROPERTY_ACCOUNT_IDS, + PriceDropRequest.JSON_PROPERTY_SCHEDULED_AT }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0") public class PriceDropRequest { @@ -65,6 +67,9 @@ public class PriceDropRequest { public static final String JSON_PROPERTY_ACCOUNT_IDS = "accountIds"; private JsonNullable> accountIds = JsonNullable.>undefined(); + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private JsonNullable scheduledAt = JsonNullable.undefined(); + public PriceDropRequest() { } @@ -224,6 +229,38 @@ public void setAccountIds(@jakarta.annotation.Nullable List accountIds) { } + public PriceDropRequest scheduledAt(@jakarta.annotation.Nullable OffsetDateTime scheduledAt) { + this.scheduledAt = JsonNullable.of(scheduledAt); + return this; + } + + /** + * Get scheduledAt + * @return scheduledAt + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OffsetDateTime getScheduledAt() { + return scheduledAt.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_SCHEDULED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getScheduledAt_JsonNullable() { + return scheduledAt; + } + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + public void setScheduledAt_JsonNullable(JsonNullable scheduledAt) { + this.scheduledAt = scheduledAt; + } + + public void setScheduledAt(@jakarta.annotation.Nullable OffsetDateTime scheduledAt) { + this.scheduledAt = JsonNullable.of(scheduledAt); + } + + /** * Return true if this PriceDropRequest object is equal to o. */ @@ -240,7 +277,8 @@ public boolean equals(Object o) { Objects.equals(this.value, priceDropRequest.value) && equalsNullable(this.roundType, priceDropRequest.roundType) && equalsNullable(this.roundStep, priceDropRequest.roundStep) && - equalsNullable(this.accountIds, priceDropRequest.accountIds); + equalsNullable(this.accountIds, priceDropRequest.accountIds) && + equalsNullable(this.scheduledAt, priceDropRequest.scheduledAt); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -249,7 +287,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(type, value, hashCodeNullable(roundType), hashCodeNullable(roundStep), hashCodeNullable(accountIds)); + return Objects.hash(type, value, hashCodeNullable(roundType), hashCodeNullable(roundStep), hashCodeNullable(accountIds), hashCodeNullable(scheduledAt)); } private static int hashCodeNullable(JsonNullable a) { @@ -268,6 +306,7 @@ public String toString() { sb.append(" roundType: ").append(toIndentedString(roundType)).append("\n"); sb.append(" roundStep: ").append(toIndentedString(roundStep)).append("\n"); sb.append(" accountIds: ").append(toIndentedString(accountIds)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -343,6 +382,11 @@ public String toUrlQueryString(String prefix) { } } + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sscheduledAt%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getScheduledAt())))); + } + return joiner.toString(); } } diff --git a/src/main/java/com/controlresell/sdk/generated/model/PublishRequest.java b/src/main/java/com/controlresell/sdk/generated/model/PublishRequest.java index b603ebb..fa84ee6 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/PublishRequest.java +++ b/src/main/java/com/controlresell/sdk/generated/model/PublishRequest.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -41,7 +42,8 @@ */ @JsonPropertyOrder({ PublishRequest.JSON_PROPERTY_ACCOUNT_IDS, - PublishRequest.JSON_PROPERTY_CANCEL_BEFORE_PROCEEDING + PublishRequest.JSON_PROPERTY_CANCEL_BEFORE_PROCEEDING, + PublishRequest.JSON_PROPERTY_SCHEDULED_AT }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0") public class PublishRequest { @@ -52,6 +54,9 @@ public class PublishRequest { public static final String JSON_PROPERTY_CANCEL_BEFORE_PROCEEDING = "cancelBeforeProceeding"; private JsonNullable cancelBeforeProceeding = JsonNullable.undefined(); + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private JsonNullable scheduledAt = JsonNullable.undefined(); + public PublishRequest() { } @@ -119,6 +124,38 @@ public void setCancelBeforeProceeding(@jakarta.annotation.Nullable Boolean cance } + public PublishRequest scheduledAt(@jakarta.annotation.Nullable OffsetDateTime scheduledAt) { + this.scheduledAt = JsonNullable.of(scheduledAt); + return this; + } + + /** + * Get scheduledAt + * @return scheduledAt + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OffsetDateTime getScheduledAt() { + return scheduledAt.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_SCHEDULED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getScheduledAt_JsonNullable() { + return scheduledAt; + } + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + public void setScheduledAt_JsonNullable(JsonNullable scheduledAt) { + this.scheduledAt = scheduledAt; + } + + public void setScheduledAt(@jakarta.annotation.Nullable OffsetDateTime scheduledAt) { + this.scheduledAt = JsonNullable.of(scheduledAt); + } + + /** * Return true if this PublishRequest object is equal to o. */ @@ -132,7 +169,8 @@ public boolean equals(Object o) { } PublishRequest publishRequest = (PublishRequest) o; return Objects.equals(this.accountIds, publishRequest.accountIds) && - equalsNullable(this.cancelBeforeProceeding, publishRequest.cancelBeforeProceeding); + equalsNullable(this.cancelBeforeProceeding, publishRequest.cancelBeforeProceeding) && + equalsNullable(this.scheduledAt, publishRequest.scheduledAt); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -141,7 +179,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(accountIds, hashCodeNullable(cancelBeforeProceeding)); + return Objects.hash(accountIds, hashCodeNullable(cancelBeforeProceeding), hashCodeNullable(scheduledAt)); } private static int hashCodeNullable(JsonNullable a) { @@ -157,6 +195,7 @@ public String toString() { sb.append("class PublishRequest {\n"); sb.append(" accountIds: ").append(toIndentedString(accountIds)).append("\n"); sb.append(" cancelBeforeProceeding: ").append(toIndentedString(cancelBeforeProceeding)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -217,6 +256,11 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format(java.util.Locale.ROOT, "%scancelBeforeProceeding%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCancelBeforeProceeding())))); } + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sscheduledAt%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getScheduledAt())))); + } + return joiner.toString(); } } diff --git a/src/main/java/com/controlresell/sdk/generated/model/RepublishRequest.java b/src/main/java/com/controlresell/sdk/generated/model/RepublishRequest.java index ea2f690..10166db 100644 --- a/src/main/java/com/controlresell/sdk/generated/model/RepublishRequest.java +++ b/src/main/java/com/controlresell/sdk/generated/model/RepublishRequest.java @@ -25,6 +25,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import com.fasterxml.jackson.annotation.JsonValue; +import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -44,7 +45,8 @@ RepublishRequest.JSON_PROPERTY_ACCOUNT_IDS, RepublishRequest.JSON_PROPERTY_PRICE_DROP, RepublishRequest.JSON_PROPERTY_PRICE_VARIATION, - RepublishRequest.JSON_PROPERTY_ALLOW_IF_DELETED + RepublishRequest.JSON_PROPERTY_ALLOW_IF_DELETED, + RepublishRequest.JSON_PROPERTY_SCHEDULED_AT }) @jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0") public class RepublishRequest { @@ -60,6 +62,9 @@ public class RepublishRequest { public static final String JSON_PROPERTY_ALLOW_IF_DELETED = "allowIfDeleted"; private JsonNullable allowIfDeleted = JsonNullable.undefined(); + public static final String JSON_PROPERTY_SCHEDULED_AT = "scheduledAt"; + private JsonNullable scheduledAt = JsonNullable.undefined(); + public RepublishRequest() { } @@ -203,6 +208,38 @@ public void setAllowIfDeleted(@jakarta.annotation.Nullable Boolean allowIfDelete } + public RepublishRequest scheduledAt(@jakarta.annotation.Nullable OffsetDateTime scheduledAt) { + this.scheduledAt = JsonNullable.of(scheduledAt); + return this; + } + + /** + * Get scheduledAt + * @return scheduledAt + */ + @jakarta.annotation.Nullable + @JsonIgnore + public OffsetDateTime getScheduledAt() { + return scheduledAt.orElse(null); + } + + @JsonProperty(value = JSON_PROPERTY_SCHEDULED_AT, required = false) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public JsonNullable getScheduledAt_JsonNullable() { + return scheduledAt; + } + + @JsonProperty(JSON_PROPERTY_SCHEDULED_AT) + public void setScheduledAt_JsonNullable(JsonNullable scheduledAt) { + this.scheduledAt = scheduledAt; + } + + public void setScheduledAt(@jakarta.annotation.Nullable OffsetDateTime scheduledAt) { + this.scheduledAt = JsonNullable.of(scheduledAt); + } + + /** * Return true if this RepublishRequest object is equal to o. */ @@ -218,7 +255,8 @@ public boolean equals(Object o) { return equalsNullable(this.accountIds, republishRequest.accountIds) && equalsNullable(this.priceDrop, republishRequest.priceDrop) && equalsNullable(this.priceVariation, republishRequest.priceVariation) && - equalsNullable(this.allowIfDeleted, republishRequest.allowIfDeleted); + equalsNullable(this.allowIfDeleted, republishRequest.allowIfDeleted) && + equalsNullable(this.scheduledAt, republishRequest.scheduledAt); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -227,7 +265,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(hashCodeNullable(accountIds), hashCodeNullable(priceDrop), hashCodeNullable(priceVariation), hashCodeNullable(allowIfDeleted)); + return Objects.hash(hashCodeNullable(accountIds), hashCodeNullable(priceDrop), hashCodeNullable(priceVariation), hashCodeNullable(allowIfDeleted), hashCodeNullable(scheduledAt)); } private static int hashCodeNullable(JsonNullable a) { @@ -245,6 +283,7 @@ public String toString() { sb.append(" priceDrop: ").append(toIndentedString(priceDrop)).append("\n"); sb.append(" priceVariation: ").append(toIndentedString(priceVariation)).append("\n"); sb.append(" allowIfDeleted: ").append(toIndentedString(allowIfDeleted)).append("\n"); + sb.append(" scheduledAt: ").append(toIndentedString(scheduledAt)).append("\n"); sb.append("}"); return sb.toString(); } @@ -315,6 +354,11 @@ public String toUrlQueryString(String prefix) { joiner.add(String.format(java.util.Locale.ROOT, "%sallowIfDeleted%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getAllowIfDeleted())))); } + // add `scheduledAt` to the URL query string + if (getScheduledAt() != null) { + joiner.add(String.format(java.util.Locale.ROOT, "%sscheduledAt%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getScheduledAt())))); + } + return joiner.toString(); } } diff --git a/src/test/java/com/controlresell/sdk/ControlResellTest.java b/src/test/java/com/controlresell/sdk/ControlResellTest.java index 1e1eaf6..1b5ceb2 100644 --- a/src/test/java/com/controlresell/sdk/ControlResellTest.java +++ b/src/test/java/com/controlresell/sdk/ControlResellTest.java @@ -231,6 +231,18 @@ void priceDropPostsToThePriceDropRoute() throws Exception { assertTrue(bodies.get(0).contains("\"PERCENT\""), bodies.get(0)); } + @Test + void publishPriceDropAndRepublishSendScheduledAt() throws Exception { + ControlResell sdk = client(n -> new Reply(202, ACTION)); + var at = java.time.OffsetDateTime.parse("2026-11-02T10:00:00Z"); + sdk.items().publish(7, new com.controlresell.sdk.generated.model.PublishRequest().scheduledAt(at)); + sdk.items().priceDrop(7, new com.controlresell.sdk.generated.model.PriceDropRequest().type("PERCENT").value("10").scheduledAt(at)); + sdk.items().republish(7, new com.controlresell.sdk.generated.model.RepublishRequest().scheduledAt(at)); + for (String body : bodies) { + assertTrue(body.contains("\"scheduledAt\":\"2026-11-02T10:00:00Z\""), body); + } + } + @Test void deleteResolvesOn204AndThrowsATypedErrorOn409() throws Exception { ControlResell sdk = client(n -> n == 1 ? new Reply(204, "") : new Reply(409, envelope("item_still_listed")));