|
16 | 16 | use AlwaysOpen\OxylabsApi\DTOs\Google\GoogleShoppingPricingResponse; |
17 | 17 | use AlwaysOpen\OxylabsApi\DTOs\Google\GoogleShoppingProductRequest; |
18 | 18 | use AlwaysOpen\OxylabsApi\DTOs\Google\GoogleShoppingProductResponse; |
| 19 | +use AlwaysOpen\OxylabsApi\DTOs\Google\Url\GoogleUrlRequest; |
| 20 | +use AlwaysOpen\OxylabsApi\DTOs\Google\Url\GoogleUrlResponse; |
19 | 21 | use AlwaysOpen\OxylabsApi\DTOs\GoogleSearchRequest; |
20 | 22 | use AlwaysOpen\OxylabsApi\DTOs\PushPullBatchJobResponse; |
21 | 23 | use AlwaysOpen\OxylabsApi\DTOs\PushPullJob; |
@@ -504,4 +506,32 @@ public function getWalmartProductResult( |
504 | 506 |
|
505 | 507 | return WalmartProductResponse::from($response); |
506 | 508 | } |
| 509 | + |
| 510 | + /** |
| 511 | + * @throws RuntimeException |
| 512 | + */ |
| 513 | + public function googleUrl( |
| 514 | + GoogleUrlRequest $request, |
| 515 | + ?int $allowedRetries = null, |
| 516 | + bool $logResponseBody = true, |
| 517 | + ): PushPullJob { |
| 518 | + return $this->makePostRequest(OxylabsApi::TARGET_GOOGLE, $request->toArray(), $allowedRetries, $logResponseBody); |
| 519 | + } |
| 520 | + |
| 521 | + /** |
| 522 | + * @throws Throwable |
| 523 | + * @throws ConnectionException |
| 524 | + */ |
| 525 | + public function getGoogleUrlResult( |
| 526 | + string $job_id, |
| 527 | + bool $check_status = false, |
| 528 | + int $status_check_limit = 5, |
| 529 | + int $status_wait_seconds = 3, |
| 530 | + ?string $type = 'parsed', |
| 531 | + bool $logResponseBody = true, |
| 532 | + ): GoogleUrlResponse { |
| 533 | + $response = $this->getPushPullResults($job_id, $check_status, $status_check_limit, $status_wait_seconds, $type, $logResponseBody); |
| 534 | + |
| 535 | + return GoogleUrlResponse::from($response); |
| 536 | + } |
507 | 537 | } |
0 commit comments