Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .spec-sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
41311cb64247613fcc1634a63a1804e344c71873d665fc58af33e053a5f919f1
d95f1962bb73a3e9792c2de01bd086edce7d3c1371ece42f7c4f12032cd29e17
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,28 @@ for (Item item : client.items().listAll(null, false, null)) {
for (Order order : client.orders().listAll(null, "to_send", null, null, null, null)) {
System.out.println(order.getId()); // needs the orders:read scope; also orders().get(id), orders().labels(id)
}
for (CatalogBrand brand : client.catalogs().brandsAll(null, "nik")) {
System.out.println(brand.getId() + " " + brand.getName()); // the identifiers an item is written with (items:read): categories, category, categoryFields, brands, sizes, colors, conditions, packageSizes, materials
}

for (Favorite favorite : client.favorites().listAll(null, null, 42L, null, null)) {
System.out.println(favorite.getBuyerId()); // the buyers who favorited a listing (items:read); also favorites().listAllItem(42, ...), list, listItem
}
client.conversations().list(null, null, null, null, null, null, "BUYER_ID", null, "PENDING"); // buyerId, itemId and offerStatus filter the conversations

// 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.conversations().sendMessage(conversationId, new SendMessageRequest().text("Hello!"));

// Webhooks (webhooks:read / webhooks:write): endpoints, endpoint, createEndpoint, updateEndpoint, deleteEndpoint, secret,
// rotateSecret, test, deliveries, retryDelivery, recover, eventTypes; eventsAll catches up the last 7 days.
CreatedWebhookEndpoint created = client.webhooks().createEndpoint(
new WebhookEndpointCreateRequest().url("https://example.com/hooks").eventTypes(List.of("item.sold")));
System.out.println(created.getSecret()); // the signing secret, shown once (webhooks().secret(id) reads it again)
for (WebhookEvent event : client.webhooks().eventsAll(null, null, List.of("item.sold"))) {
System.out.println(event.getType() + " " + event.getData().get("itemId"));
}
```

On `ItemUpdateRequest`, a nullable field left unset is not sent, and one set to `null` (`.sellingPlaceId(null)`) is sent as an explicit `null`, which clears it on the API. A list is replaced as a whole: send an empty list to empty it.
Expand Down
280 changes: 278 additions & 2 deletions src/main/java/com/controlresell/sdk/ControlResell.java

Large diffs are not rendered by default.

1,393 changes: 1,393 additions & 0 deletions src/main/java/com/controlresell/sdk/generated/api/CatalogsApi.java

Large diffs are not rendered by default.

Large diffs are not rendered by default.

481 changes: 481 additions & 0 deletions src/main/java/com/controlresell/sdk/generated/api/FavoritesApi.java

Large diffs are not rendered by default.

1,844 changes: 1,844 additions & 0 deletions src/main/java/com/controlresell/sdk/generated/api/WebhooksApi.java

Large diffs are not rendered by default.

220 changes: 220 additions & 0 deletions src/main/java/com/controlresell/sdk/generated/model/CatalogBrand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
/*
* ControlResell public API
* The public API of ControlResell. Every error answers `{\"error\": {\"code\", \"message\", \"params\", \"requestId\"}}`; a `POST` takes an `Idempotency-Key` header.
*
* The version of the OpenAPI document: 1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


package com.controlresell.sdk.generated.model;

import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.StringJoiner;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;


import com.controlresell.sdk.generated.ApiClient;
/**
* CatalogBrand
*/
@JsonPropertyOrder({
CatalogBrand.JSON_PROPERTY_ID,
CatalogBrand.JSON_PROPERTY_NAME,
CatalogBrand.JSON_PROPERTY_CUSTOM
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.26.0")
public class CatalogBrand {
public static final String JSON_PROPERTY_ID = "id";
@jakarta.annotation.Nonnull
private Long id;

public static final String JSON_PROPERTY_NAME = "name";
@jakarta.annotation.Nonnull
private String name;

public static final String JSON_PROPERTY_CUSTOM = "custom";
@jakarta.annotation.Nonnull
private Boolean custom;

public CatalogBrand() {
}

public CatalogBrand id(@jakarta.annotation.Nonnull Long id) {
this.id = id;
return this;
}

/**
* Get id
* @return id
*/
@jakarta.annotation.Nonnull
@JsonProperty(value = JSON_PROPERTY_ID, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public Long getId() {
return id;
}


@JsonProperty(value = JSON_PROPERTY_ID, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setId(@jakarta.annotation.Nonnull Long id) {
this.id = id;
}


public CatalogBrand name(@jakarta.annotation.Nonnull String name) {
this.name = name;
return this;
}

/**
* Get name
* @return name
*/
@jakarta.annotation.Nonnull
@JsonProperty(value = JSON_PROPERTY_NAME, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getName() {
return name;
}


@JsonProperty(value = JSON_PROPERTY_NAME, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setName(@jakarta.annotation.Nonnull String name) {
this.name = name;
}


public CatalogBrand custom(@jakarta.annotation.Nonnull Boolean custom) {
this.custom = custom;
return this;
}

/**
* Get custom
* @return custom
*/
@jakarta.annotation.Nonnull
@JsonProperty(value = JSON_PROPERTY_CUSTOM, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public Boolean getCustom() {
return custom;
}


@JsonProperty(value = JSON_PROPERTY_CUSTOM, required = true)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setCustom(@jakarta.annotation.Nonnull Boolean custom) {
this.custom = custom;
}


/**
* Return true if this CatalogBrand object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CatalogBrand catalogBrand = (CatalogBrand) o;
return Objects.equals(this.id, catalogBrand.id) &&
Objects.equals(this.name, catalogBrand.name) &&
Objects.equals(this.custom, catalogBrand.custom);
}

@Override
public int hashCode() {
return Objects.hash(id, name, custom);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CatalogBrand {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" custom: ").append(toIndentedString(custom)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
return o == null ? "null" : o.toString().replace("\n", "\n ");
}

/**
* Convert the instance into URL query string.
*
* @return URL query string
*/
public String toUrlQueryString() {
return toUrlQueryString(null);
}

/**
* Convert the instance into URL query string.
*
* @param prefix prefix of the query string
* @return URL query string
*/
public String toUrlQueryString(String prefix) {
String suffix = "";
String containerSuffix = "";
String containerPrefix = "";
if (prefix == null) {
// style=form, explode=true, e.g. /pet?name=cat&type=manx
prefix = "";
} else {
// deepObject style e.g. /pet?id[name]=cat&id[type]=manx
prefix = prefix + "[";
suffix = "]";
containerSuffix = "]";
containerPrefix = "[";
}

StringJoiner joiner = new StringJoiner("&");

// add `id` to the URL query string
if (getId() != null) {
joiner.add(String.format(java.util.Locale.ROOT, "%sid%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getId()))));
}

// add `name` to the URL query string
if (getName() != null) {
joiner.add(String.format(java.util.Locale.ROOT, "%sname%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getName()))));
}

// add `custom` to the URL query string
if (getCustom() != null) {
joiner.add(String.format(java.util.Locale.ROOT, "%scustom%s=%s", prefix, suffix, ApiClient.urlEncode(ApiClient.valueToString(getCustom()))));
}

return joiner.toString();
}
}

Loading
Loading