Skip to content

Commit 3687670

Browse files
author
scrapebadger-bot
committed
chore: regenerate SDK from OpenAPI spec
1 parent 30003d3 commit 3687670

5 files changed

Lines changed: 256 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ Class | Method | HTTP request | Description
273273
*EBayApi* | [**ebayKeywordSuggestions**](docs/EBayApi.md#ebayKeywordSuggestions) | **GET** /v1/ebay/autocomplete | Keyword suggestions
274274
*EBayApi* | [**ebayListCategories**](docs/EBayApi.md#ebayListCategories) | **GET** /v1/ebay/categories | List categories
275275
*EBayApi* | [**ebayListMarkets**](docs/EBayApi.md#ebayListMarkets) | **GET** /v1/ebay/markets | List markets
276+
*EBayApi* | [**ebaySearchByImage**](docs/EBayApi.md#ebaySearchByImage) | **POST** /v1/ebay/search/by-image | Search by image
276277
*EBayApi* | [**ebaySearchListings**](docs/EBayApi.md#ebaySearchListings) | **GET** /v1/ebay/search | Search listings
277278
*FacebookApi* | [**facebookBrowseAMarketplaceCategory**](docs/FacebookApi.md#facebookBrowseAMarketplaceCategory) | **GET** /v1/facebook/marketplace/category/{category} | Browse a Marketplace category
278279
*FacebookApi* | [**facebookGetAMarketplaceItem**](docs/FacebookApi.md#facebookGetAMarketplaceItem) | **GET** /v1/facebook/marketplace/item/{item_id} | Get a Marketplace item

api/openapi.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4895,6 +4895,45 @@ paths:
48954895
- eBay
48964896
x-accepts:
48974897
- application/json
4898+
/v1/ebay/search/by-image:
4899+
post:
4900+
description: |-
4901+
Search active listings by image, the way eBay's camera icon does.
4902+
4903+
No ``sort_by``: eBay ignores it on a visual results page.
4904+
operationId: ebay_search_by_image
4905+
requestBody:
4906+
content:
4907+
application/json:
4908+
schema:
4909+
additionalProperties: {}
4910+
description: "{\"image_url\": \"https://…/photo.jpg\", \"domain\": \"\
4911+
com\"} — or send the picture itself as {\"image_base64\": \"<base64\
4912+
\ JPEG/PNG>\"}. Exactly one of the two. Also accepts category_id,\
4913+
\ page, per_page, condition, buying_format, min_price, max_price,\
4914+
\ free_shipping, location and language."
4915+
title: Body
4916+
required: true
4917+
responses:
4918+
"200":
4919+
content:
4920+
application/json:
4921+
schema: {}
4922+
description: Successful Response
4923+
"422":
4924+
content:
4925+
application/json:
4926+
schema:
4927+
$ref: '#/components/schemas/HTTPValidationError'
4928+
description: Validation Error
4929+
security:
4930+
- ApiKeyAuth: []
4931+
summary: Search by image
4932+
tags:
4933+
- eBay
4934+
x-content-type: application/json
4935+
x-accepts:
4936+
- application/json
48984937
/v1/ebay/sellers/{username}:
48994938
get:
49004939
description: Get an eBay seller's public profile.

docs/EBayApi.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ All URIs are relative to *https://scrapebadger.com*
1616
| [**ebayKeywordSuggestions**](EBayApi.md#ebayKeywordSuggestions) | **GET** /v1/ebay/autocomplete | Keyword suggestions |
1717
| [**ebayListCategories**](EBayApi.md#ebayListCategories) | **GET** /v1/ebay/categories | List categories |
1818
| [**ebayListMarkets**](EBayApi.md#ebayListMarkets) | **GET** /v1/ebay/markets | List markets |
19+
| [**ebaySearchByImage**](EBayApi.md#ebaySearchByImage) | **POST** /v1/ebay/search/by-image | Search by image |
1920
| [**ebaySearchListings**](EBayApi.md#ebaySearchListings) | **GET** /v1/ebay/search | Search listings |
2021

2122

@@ -893,6 +894,76 @@ This endpoint does not need any parameter.
893894
|-------------|-------------|------------------|
894895
| **200** | Successful Response | - |
895896

897+
<a id="ebaySearchByImage"></a>
898+
# **ebaySearchByImage**
899+
> Object ebaySearchByImage(requestBody)
900+
901+
Search by image
902+
903+
Search active listings by image, the way eBay&#39;s camera icon does. No &#x60;&#x60;sort_by&#x60;&#x60;: eBay ignores it on a visual results page.
904+
905+
### Example
906+
```java
907+
// Import classes:
908+
import com.scrapebadger.client.ApiClient;
909+
import com.scrapebadger.client.ApiException;
910+
import com.scrapebadger.client.Configuration;
911+
import com.scrapebadger.client.auth.*;
912+
import com.scrapebadger.client.models.*;
913+
import com.scrapebadger.client.api.EBayApi;
914+
915+
public class Example {
916+
public static void main(String[] args) {
917+
ApiClient defaultClient = Configuration.getDefaultApiClient();
918+
defaultClient.setBasePath("https://scrapebadger.com");
919+
920+
// Configure API key authorization: ApiKeyAuth
921+
ApiKeyAuth ApiKeyAuth = (ApiKeyAuth) defaultClient.getAuthentication("ApiKeyAuth");
922+
ApiKeyAuth.setApiKey("YOUR API KEY");
923+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
924+
//ApiKeyAuth.setApiKeyPrefix("Token");
925+
926+
EBayApi apiInstance = new EBayApi(defaultClient);
927+
Map<String, Object> requestBody = null; // Map<String, Object> |
928+
try {
929+
Object result = apiInstance.ebaySearchByImage(requestBody);
930+
System.out.println(result);
931+
} catch (ApiException e) {
932+
System.err.println("Exception when calling EBayApi#ebaySearchByImage");
933+
System.err.println("Status code: " + e.getCode());
934+
System.err.println("Reason: " + e.getResponseBody());
935+
System.err.println("Response headers: " + e.getResponseHeaders());
936+
e.printStackTrace();
937+
}
938+
}
939+
}
940+
```
941+
942+
### Parameters
943+
944+
| Name | Type | Description | Notes |
945+
|------------- | ------------- | ------------- | -------------|
946+
| **requestBody** | [**Map&lt;String, Object&gt;**](Object.md)| | |
947+
948+
### Return type
949+
950+
**Object**
951+
952+
### Authorization
953+
954+
[ApiKeyAuth](../README.md#ApiKeyAuth)
955+
956+
### HTTP request headers
957+
958+
- **Content-Type**: application/json
959+
- **Accept**: application/json
960+
961+
### HTTP response details
962+
| Status code | Description | Response headers |
963+
|-------------|-------------|------------------|
964+
| **200** | Successful Response | - |
965+
| **422** | Validation Error | - |
966+
896967
<a id="ebaySearchListings"></a>
897968
# **ebaySearchListings**
898969
> Object ebaySearchListings(query, domain, categoryId, page, perPage, sortBy, condition, buyingFormat, minPrice, maxPrice, freeShipping, location, language)

src/main/java/com/scrapebadger/client/api/EBayApi.java

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,6 +1811,137 @@ public okhttp3.Call ebayListMarketsAsync(final ApiCallback<Object> _callback) th
18111811
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
18121812
return localVarCall;
18131813
}
1814+
/**
1815+
* Build call for ebaySearchByImage
1816+
* @param requestBody (required)
1817+
* @param _callback Callback for upload/download progress
1818+
* @return Call to execute
1819+
* @throws ApiException If fail to serialize the request body object
1820+
* @http.response.details
1821+
<table border="1">
1822+
<caption>Response Details</caption>
1823+
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
1824+
<tr><td> 200 </td><td> Successful Response </td><td> - </td></tr>
1825+
<tr><td> 422 </td><td> Validation Error </td><td> - </td></tr>
1826+
</table>
1827+
*/
1828+
public okhttp3.Call ebaySearchByImageCall(Map<String, Object> requestBody, final ApiCallback _callback) throws ApiException {
1829+
String basePath = null;
1830+
// Operation Servers
1831+
String[] localBasePaths = new String[] { };
1832+
1833+
// Determine Base Path to Use
1834+
if (localCustomBaseUrl != null){
1835+
basePath = localCustomBaseUrl;
1836+
} else if ( localBasePaths.length > 0 ) {
1837+
basePath = localBasePaths[localHostIndex];
1838+
} else {
1839+
basePath = null;
1840+
}
1841+
1842+
Object localVarPostBody = requestBody;
1843+
1844+
// create path and map variables
1845+
String localVarPath = "/v1/ebay/search/by-image";
1846+
1847+
List<Pair> localVarQueryParams = new ArrayList<Pair>();
1848+
List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();
1849+
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
1850+
Map<String, String> localVarCookieParams = new HashMap<String, String>();
1851+
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
1852+
1853+
final String[] localVarAccepts = {
1854+
"application/json"
1855+
};
1856+
final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);
1857+
if (localVarAccept != null) {
1858+
localVarHeaderParams.put("Accept", localVarAccept);
1859+
}
1860+
1861+
final String[] localVarContentTypes = {
1862+
"application/json"
1863+
};
1864+
final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
1865+
if (localVarContentType != null) {
1866+
localVarHeaderParams.put("Content-Type", localVarContentType);
1867+
}
1868+
1869+
String[] localVarAuthNames = new String[] { "ApiKeyAuth" };
1870+
return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);
1871+
}
1872+
1873+
@SuppressWarnings("rawtypes")
1874+
private okhttp3.Call ebaySearchByImageValidateBeforeCall(Map<String, Object> requestBody, final ApiCallback _callback) throws ApiException {
1875+
// verify the required parameter 'requestBody' is set
1876+
if (requestBody == null) {
1877+
throw new ApiException("Missing the required parameter 'requestBody' when calling ebaySearchByImage(Async)");
1878+
}
1879+
1880+
return ebaySearchByImageCall(requestBody, _callback);
1881+
1882+
}
1883+
1884+
/**
1885+
* Search by image
1886+
* Search active listings by image, the way eBay&#39;s camera icon does. No &#x60;&#x60;sort_by&#x60;&#x60;: eBay ignores it on a visual results page.
1887+
* @param requestBody (required)
1888+
* @return Object
1889+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1890+
* @http.response.details
1891+
<table border="1">
1892+
<caption>Response Details</caption>
1893+
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
1894+
<tr><td> 200 </td><td> Successful Response </td><td> - </td></tr>
1895+
<tr><td> 422 </td><td> Validation Error </td><td> - </td></tr>
1896+
</table>
1897+
*/
1898+
public Object ebaySearchByImage(Map<String, Object> requestBody) throws ApiException {
1899+
ApiResponse<Object> localVarResp = ebaySearchByImageWithHttpInfo(requestBody);
1900+
return localVarResp.getData();
1901+
}
1902+
1903+
/**
1904+
* Search by image
1905+
* Search active listings by image, the way eBay&#39;s camera icon does. No &#x60;&#x60;sort_by&#x60;&#x60;: eBay ignores it on a visual results page.
1906+
* @param requestBody (required)
1907+
* @return ApiResponse&lt;Object&gt;
1908+
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
1909+
* @http.response.details
1910+
<table border="1">
1911+
<caption>Response Details</caption>
1912+
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
1913+
<tr><td> 200 </td><td> Successful Response </td><td> - </td></tr>
1914+
<tr><td> 422 </td><td> Validation Error </td><td> - </td></tr>
1915+
</table>
1916+
*/
1917+
public ApiResponse<Object> ebaySearchByImageWithHttpInfo(Map<String, Object> requestBody) throws ApiException {
1918+
okhttp3.Call localVarCall = ebaySearchByImageValidateBeforeCall(requestBody, null);
1919+
Type localVarReturnType = new TypeToken<Object>(){}.getType();
1920+
return localVarApiClient.execute(localVarCall, localVarReturnType);
1921+
}
1922+
1923+
/**
1924+
* Search by image (asynchronously)
1925+
* Search active listings by image, the way eBay&#39;s camera icon does. No &#x60;&#x60;sort_by&#x60;&#x60;: eBay ignores it on a visual results page.
1926+
* @param requestBody (required)
1927+
* @param _callback The callback to be executed when the API call finishes
1928+
* @return The request call
1929+
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
1930+
* @http.response.details
1931+
<table border="1">
1932+
<caption>Response Details</caption>
1933+
<tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr>
1934+
<tr><td> 200 </td><td> Successful Response </td><td> - </td></tr>
1935+
<tr><td> 422 </td><td> Validation Error </td><td> - </td></tr>
1936+
</table>
1937+
*/
1938+
public okhttp3.Call ebaySearchByImageAsync(Map<String, Object> requestBody, final ApiCallback<Object> _callback) throws ApiException {
1939+
1940+
okhttp3.Call localVarCall = ebaySearchByImageValidateBeforeCall(requestBody, _callback);
1941+
Type localVarReturnType = new TypeToken<Object>(){}.getType();
1942+
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
1943+
return localVarCall;
1944+
}
18141945
/**
18151946
* Build call for ebaySearchListings
18161947
* @param query Search keywords (required)

src/test/java/com/scrapebadger/client/api/EBayApiTest.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,20 @@ public void ebayListMarketsTest() throws ApiException {
223223
// TODO: test validations
224224
}
225225

226+
/**
227+
* Search by image
228+
*
229+
* Search active listings by image, the way eBay&#39;s camera icon does. No &#x60;&#x60;sort_by&#x60;&#x60;: eBay ignores it on a visual results page.
230+
*
231+
* @throws ApiException if the Api call fails
232+
*/
233+
@Test
234+
public void ebaySearchByImageTest() throws ApiException {
235+
Map<String, Object> requestBody = null;
236+
Object response = api.ebaySearchByImage(requestBody);
237+
// TODO: test validations
238+
}
239+
226240
/**
227241
* Search listings
228242
*

0 commit comments

Comments
 (0)