Skip to content

Commit 3e40de4

Browse files
author
scrapebadger-bot
committed
chore: regenerate SDK from OpenAPI spec
1 parent 91528c7 commit 3e40de4

4 files changed

Lines changed: 72 additions & 32 deletions

File tree

api/openapi.yaml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9299,18 +9299,30 @@ paths:
92999299
/v1/google/shopping/offers:
93009300
get:
93019301
description: |-
9302-
Resolve a barcode to a product via Google web search, then return its
9303-
Google Shopping seller offers (source + price per merchant).
9302+
Google Shopping seller offers (source + price + link per merchant) for a
9303+
product identified either by ``barcode`` (resolved via Google web search) or
9304+
by its Google Shopping ``catalog_id`` (read straight off Google's product
9305+
page, all seller pages fetched in parallel).
93049306
operationId: google_multi_seller_offers_by_barcode
93059307
parameters:
93069308
- description: Product barcode — GTIN-8 / UPC-A / EAN-13 / GTIN-14
93079309
explode: true
93089310
in: query
93099311
name: barcode
9310-
required: true
9312+
required: false
93119313
schema:
9312-
description: Product barcode — GTIN-8 / UPC-A / EAN-13 / GTIN-14
9313-
title: Barcode
9314+
nullable: true
9315+
type: string
9316+
style: form
9317+
- description: "Google Shopping catalogid (the `catalog_id` on /shopping/search\
9318+
\ tiles, or `prds=catalogid:<id>` in a Google Shopping URL). Alternative\
9319+
\ to `barcode`; exactly one of the two is required"
9320+
explode: true
9321+
in: query
9322+
name: catalog_id
9323+
required: false
9324+
schema:
9325+
nullable: true
93149326
type: string
93159327
style: form
93169328
- description: Country code (ISO 3166 alpha-2)
@@ -9333,6 +9345,17 @@ paths:
93339345
title: Hl
93349346
type: string
93359347
style: form
9348+
- description: Google domain
9349+
explode: true
9350+
in: query
9351+
name: domain
9352+
required: false
9353+
schema:
9354+
default: google.com
9355+
description: Google domain
9356+
title: Domain
9357+
type: string
9358+
style: form
93369359
responses:
93379360
"200":
93389361
content:

docs/GoogleApi.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,11 +1769,11 @@ public class Example {
17691769

17701770
<a id="googleMultiSellerOffersByBarcode"></a>
17711771
# **googleMultiSellerOffersByBarcode**
1772-
> Object googleMultiSellerOffersByBarcode(barcode, gl, hl)
1772+
> Object googleMultiSellerOffersByBarcode(barcode, catalogId, gl, hl, domain)
17731773
17741774
Multi-seller offers by barcode
17751775

1776-
Resolve a barcode to a product via Google web search, then return its Google Shopping seller offers (source + price per merchant).
1776+
Google Shopping seller offers (source + price + link per merchant) for a product identified either by &#x60;&#x60;barcode&#x60;&#x60; (resolved via Google web search) or by its Google Shopping &#x60;&#x60;catalog_id&#x60;&#x60; (read straight off Google&#39;s product page, all seller pages fetched in parallel).
17771777

17781778
### Example
17791779
```java
@@ -1798,10 +1798,12 @@ public class Example {
17981798

17991799
GoogleApi apiInstance = new GoogleApi(defaultClient);
18001800
String barcode = "barcode_example"; // String | Product barcode — GTIN-8 / UPC-A / EAN-13 / GTIN-14
1801+
String catalogId = "catalogId_example"; // String | Google Shopping catalogid (the `catalog_id` on /shopping/search tiles, or `prds=catalogid:<id>` in a Google Shopping URL). Alternative to `barcode`; exactly one of the two is required
18011802
String gl = "gl_example"; // String | Country code (ISO 3166 alpha-2)
18021803
String hl = "en"; // String | Language code
1804+
String domain = "google.com"; // String | Google domain
18031805
try {
1804-
Object result = apiInstance.googleMultiSellerOffersByBarcode(barcode, gl, hl);
1806+
Object result = apiInstance.googleMultiSellerOffersByBarcode(barcode, catalogId, gl, hl, domain);
18051807
System.out.println(result);
18061808
} catch (ApiException e) {
18071809
System.err.println("Exception when calling GoogleApi#googleMultiSellerOffersByBarcode");
@@ -1818,9 +1820,11 @@ public class Example {
18181820

18191821
| Name | Type | Description | Notes |
18201822
|------------- | ------------- | ------------- | -------------|
1821-
| **barcode** | **String**| Product barcode — GTIN-8 / UPC-A / EAN-13 / GTIN-14 | |
1823+
| **barcode** | **String**| Product barcode — GTIN-8 / UPC-A / EAN-13 / GTIN-14 | [optional] |
1824+
| **catalogId** | **String**| Google Shopping catalogid (the &#x60;catalog_id&#x60; on /shopping/search tiles, or &#x60;prds&#x3D;catalogid:&lt;id&gt;&#x60; in a Google Shopping URL). Alternative to &#x60;barcode&#x60;; exactly one of the two is required | [optional] |
18221825
| **gl** | **String**| Country code (ISO 3166 alpha-2) | [optional] |
18231826
| **hl** | **String**| Language code | [optional] [default to en] |
1827+
| **domain** | **String**| Google domain | [optional] [default to google.com] |
18241828

18251829
### Return type
18261830

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

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3847,9 +3847,11 @@ public okhttp3.Call googleInterestOverTimeAsync(String q, String geo, String dat
38473847
}
38483848
/**
38493849
* Build call for googleMultiSellerOffersByBarcode
3850-
* @param barcode Product barcode — GTIN-8 / UPC-A / EAN-13 / GTIN-14 (required)
3850+
* @param barcode Product barcode — GTIN-8 / UPC-A / EAN-13 / GTIN-14 (optional)
3851+
* @param catalogId Google Shopping catalogid (the &#x60;catalog_id&#x60; on /shopping/search tiles, or &#x60;prds&#x3D;catalogid:&lt;id&gt;&#x60; in a Google Shopping URL). Alternative to &#x60;barcode&#x60;; exactly one of the two is required (optional)
38513852
* @param gl Country code (ISO 3166 alpha-2) (optional)
38523853
* @param hl Language code (optional, default to en)
3854+
* @param domain Google domain (optional, default to google.com)
38533855
* @param _callback Callback for upload/download progress
38543856
* @return Call to execute
38553857
* @throws ApiException If fail to serialize the request body object
@@ -3861,7 +3863,7 @@ public okhttp3.Call googleInterestOverTimeAsync(String q, String geo, String dat
38613863
<tr><td> 422 </td><td> Validation Error </td><td> - </td></tr>
38623864
</table>
38633865
*/
3864-
public okhttp3.Call googleMultiSellerOffersByBarcodeCall(String barcode, String gl, String hl, final ApiCallback _callback) throws ApiException {
3866+
public okhttp3.Call googleMultiSellerOffersByBarcodeCall(String barcode, String catalogId, String gl, String hl, String domain, final ApiCallback _callback) throws ApiException {
38653867
String basePath = null;
38663868
// Operation Servers
38673869
String[] localBasePaths = new String[] { };
@@ -3890,6 +3892,10 @@ public okhttp3.Call googleMultiSellerOffersByBarcodeCall(String barcode, String
38903892
localVarQueryParams.addAll(localVarApiClient.parameterToPair("barcode", barcode));
38913893
}
38923894

3895+
if (catalogId != null) {
3896+
localVarQueryParams.addAll(localVarApiClient.parameterToPair("catalog_id", catalogId));
3897+
}
3898+
38933899
if (gl != null) {
38943900
localVarQueryParams.addAll(localVarApiClient.parameterToPair("gl", gl));
38953901
}
@@ -3898,6 +3904,10 @@ public okhttp3.Call googleMultiSellerOffersByBarcodeCall(String barcode, String
38983904
localVarQueryParams.addAll(localVarApiClient.parameterToPair("hl", hl));
38993905
}
39003906

3907+
if (domain != null) {
3908+
localVarQueryParams.addAll(localVarApiClient.parameterToPair("domain", domain));
3909+
}
3910+
39013911
final String[] localVarAccepts = {
39023912
"application/json"
39033913
};
@@ -3918,22 +3928,19 @@ public okhttp3.Call googleMultiSellerOffersByBarcodeCall(String barcode, String
39183928
}
39193929

39203930
@SuppressWarnings("rawtypes")
3921-
private okhttp3.Call googleMultiSellerOffersByBarcodeValidateBeforeCall(String barcode, String gl, String hl, final ApiCallback _callback) throws ApiException {
3922-
// verify the required parameter 'barcode' is set
3923-
if (barcode == null) {
3924-
throw new ApiException("Missing the required parameter 'barcode' when calling googleMultiSellerOffersByBarcode(Async)");
3925-
}
3926-
3927-
return googleMultiSellerOffersByBarcodeCall(barcode, gl, hl, _callback);
3931+
private okhttp3.Call googleMultiSellerOffersByBarcodeValidateBeforeCall(String barcode, String catalogId, String gl, String hl, String domain, final ApiCallback _callback) throws ApiException {
3932+
return googleMultiSellerOffersByBarcodeCall(barcode, catalogId, gl, hl, domain, _callback);
39283933

39293934
}
39303935

39313936
/**
39323937
* Multi-seller offers by barcode
3933-
* Resolve a barcode to a product via Google web search, then return its Google Shopping seller offers (source + price per merchant).
3934-
* @param barcode Product barcode — GTIN-8 / UPC-A / EAN-13 / GTIN-14 (required)
3938+
* Google Shopping seller offers (source + price + link per merchant) for a product identified either by &#x60;&#x60;barcode&#x60;&#x60; (resolved via Google web search) or by its Google Shopping &#x60;&#x60;catalog_id&#x60;&#x60; (read straight off Google&#39;s product page, all seller pages fetched in parallel).
3939+
* @param barcode Product barcode — GTIN-8 / UPC-A / EAN-13 / GTIN-14 (optional)
3940+
* @param catalogId Google Shopping catalogid (the &#x60;catalog_id&#x60; on /shopping/search tiles, or &#x60;prds&#x3D;catalogid:&lt;id&gt;&#x60; in a Google Shopping URL). Alternative to &#x60;barcode&#x60;; exactly one of the two is required (optional)
39353941
* @param gl Country code (ISO 3166 alpha-2) (optional)
39363942
* @param hl Language code (optional, default to en)
3943+
* @param domain Google domain (optional, default to google.com)
39373944
* @return Object
39383945
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
39393946
* @http.response.details
@@ -3944,17 +3951,19 @@ private okhttp3.Call googleMultiSellerOffersByBarcodeValidateBeforeCall(String b
39443951
<tr><td> 422 </td><td> Validation Error </td><td> - </td></tr>
39453952
</table>
39463953
*/
3947-
public Object googleMultiSellerOffersByBarcode(String barcode, String gl, String hl) throws ApiException {
3948-
ApiResponse<Object> localVarResp = googleMultiSellerOffersByBarcodeWithHttpInfo(barcode, gl, hl);
3954+
public Object googleMultiSellerOffersByBarcode(String barcode, String catalogId, String gl, String hl, String domain) throws ApiException {
3955+
ApiResponse<Object> localVarResp = googleMultiSellerOffersByBarcodeWithHttpInfo(barcode, catalogId, gl, hl, domain);
39493956
return localVarResp.getData();
39503957
}
39513958

39523959
/**
39533960
* Multi-seller offers by barcode
3954-
* Resolve a barcode to a product via Google web search, then return its Google Shopping seller offers (source + price per merchant).
3955-
* @param barcode Product barcode — GTIN-8 / UPC-A / EAN-13 / GTIN-14 (required)
3961+
* Google Shopping seller offers (source + price + link per merchant) for a product identified either by &#x60;&#x60;barcode&#x60;&#x60; (resolved via Google web search) or by its Google Shopping &#x60;&#x60;catalog_id&#x60;&#x60; (read straight off Google&#39;s product page, all seller pages fetched in parallel).
3962+
* @param barcode Product barcode — GTIN-8 / UPC-A / EAN-13 / GTIN-14 (optional)
3963+
* @param catalogId Google Shopping catalogid (the &#x60;catalog_id&#x60; on /shopping/search tiles, or &#x60;prds&#x3D;catalogid:&lt;id&gt;&#x60; in a Google Shopping URL). Alternative to &#x60;barcode&#x60;; exactly one of the two is required (optional)
39563964
* @param gl Country code (ISO 3166 alpha-2) (optional)
39573965
* @param hl Language code (optional, default to en)
3966+
* @param domain Google domain (optional, default to google.com)
39583967
* @return ApiResponse&lt;Object&gt;
39593968
* @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
39603969
* @http.response.details
@@ -3965,18 +3974,20 @@ public Object googleMultiSellerOffersByBarcode(String barcode, String gl, String
39653974
<tr><td> 422 </td><td> Validation Error </td><td> - </td></tr>
39663975
</table>
39673976
*/
3968-
public ApiResponse<Object> googleMultiSellerOffersByBarcodeWithHttpInfo(String barcode, String gl, String hl) throws ApiException {
3969-
okhttp3.Call localVarCall = googleMultiSellerOffersByBarcodeValidateBeforeCall(barcode, gl, hl, null);
3977+
public ApiResponse<Object> googleMultiSellerOffersByBarcodeWithHttpInfo(String barcode, String catalogId, String gl, String hl, String domain) throws ApiException {
3978+
okhttp3.Call localVarCall = googleMultiSellerOffersByBarcodeValidateBeforeCall(barcode, catalogId, gl, hl, domain, null);
39703979
Type localVarReturnType = new TypeToken<Object>(){}.getType();
39713980
return localVarApiClient.execute(localVarCall, localVarReturnType);
39723981
}
39733982

39743983
/**
39753984
* Multi-seller offers by barcode (asynchronously)
3976-
* Resolve a barcode to a product via Google web search, then return its Google Shopping seller offers (source + price per merchant).
3977-
* @param barcode Product barcode — GTIN-8 / UPC-A / EAN-13 / GTIN-14 (required)
3985+
* Google Shopping seller offers (source + price + link per merchant) for a product identified either by &#x60;&#x60;barcode&#x60;&#x60; (resolved via Google web search) or by its Google Shopping &#x60;&#x60;catalog_id&#x60;&#x60; (read straight off Google&#39;s product page, all seller pages fetched in parallel).
3986+
* @param barcode Product barcode — GTIN-8 / UPC-A / EAN-13 / GTIN-14 (optional)
3987+
* @param catalogId Google Shopping catalogid (the &#x60;catalog_id&#x60; on /shopping/search tiles, or &#x60;prds&#x3D;catalogid:&lt;id&gt;&#x60; in a Google Shopping URL). Alternative to &#x60;barcode&#x60;; exactly one of the two is required (optional)
39783988
* @param gl Country code (ISO 3166 alpha-2) (optional)
39793989
* @param hl Language code (optional, default to en)
3990+
* @param domain Google domain (optional, default to google.com)
39803991
* @param _callback The callback to be executed when the API call finishes
39813992
* @return The request call
39823993
* @throws ApiException If fail to process the API call, e.g. serializing the request body object
@@ -3988,9 +3999,9 @@ public ApiResponse<Object> googleMultiSellerOffersByBarcodeWithHttpInfo(String b
39883999
<tr><td> 422 </td><td> Validation Error </td><td> - </td></tr>
39894000
</table>
39904001
*/
3991-
public okhttp3.Call googleMultiSellerOffersByBarcodeAsync(String barcode, String gl, String hl, final ApiCallback<Object> _callback) throws ApiException {
4002+
public okhttp3.Call googleMultiSellerOffersByBarcodeAsync(String barcode, String catalogId, String gl, String hl, String domain, final ApiCallback<Object> _callback) throws ApiException {
39924003

3993-
okhttp3.Call localVarCall = googleMultiSellerOffersByBarcodeValidateBeforeCall(barcode, gl, hl, _callback);
4004+
okhttp3.Call localVarCall = googleMultiSellerOffersByBarcodeValidateBeforeCall(barcode, catalogId, gl, hl, domain, _callback);
39944005
Type localVarReturnType = new TypeToken<Object>(){}.getType();
39954006
localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback);
39964007
return localVarCall;

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,16 +429,18 @@ public void googleInterestOverTimeTest() throws ApiException {
429429
/**
430430
* Multi-seller offers by barcode
431431
*
432-
* Resolve a barcode to a product via Google web search, then return its Google Shopping seller offers (source + price per merchant).
432+
* Google Shopping seller offers (source + price + link per merchant) for a product identified either by &#x60;&#x60;barcode&#x60;&#x60; (resolved via Google web search) or by its Google Shopping &#x60;&#x60;catalog_id&#x60;&#x60; (read straight off Google&#39;s product page, all seller pages fetched in parallel).
433433
*
434434
* @throws ApiException if the Api call fails
435435
*/
436436
@Test
437437
public void googleMultiSellerOffersByBarcodeTest() throws ApiException {
438438
String barcode = null;
439+
String catalogId = null;
439440
String gl = null;
440441
String hl = null;
441-
Object response = api.googleMultiSellerOffersByBarcode(barcode, gl, hl);
442+
String domain = null;
443+
Object response = api.googleMultiSellerOffersByBarcode(barcode, catalogId, gl, hl, domain);
442444
// TODO: test validations
443445
}
444446

0 commit comments

Comments
 (0)