Skip to content

Commit

Permalink
feat(specs): add runSource endpoint (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#3453

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Pierre Millot <pierre.millot@algolia.com>
  • Loading branch information
algolia-bot and millotp committed Aug 2, 2024
1 parent fd41bc8 commit 5df3fdf
Show file tree
Hide file tree
Showing 4 changed files with 670 additions and 0 deletions.
48 changes: 48 additions & 0 deletions lib/Api/IngestionClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Algolia\AlgoliaSearch\Model\Ingestion\DestinationCreate;
use Algolia\AlgoliaSearch\Model\Ingestion\DestinationSearch;
use Algolia\AlgoliaSearch\Model\Ingestion\DestinationUpdate;
use Algolia\AlgoliaSearch\Model\Ingestion\RunSourcePayload;
use Algolia\AlgoliaSearch\Model\Ingestion\SourceCreate;
use Algolia\AlgoliaSearch\Model\Ingestion\SourceSearch;
use Algolia\AlgoliaSearch\Model\Ingestion\SourceUpdate;
Expand Down Expand Up @@ -1823,6 +1824,53 @@ public function pushTask($taskID, $batchWriteParams, $requestOptions = [])
return $this->sendRequest('POST', $resourcePath, $headers, $queryParameters, $httpBody, $requestOptions);
}

/**
* Runs all tasks linked to a source, only available for Shopify sources. It will create 1 run per task.
*
* Required API Key ACLs:
* - addObject
* - deleteIndex
* - editSettings
*
* @param string $sourceID Unique identifier of a source. (required)
* @param array $runSourcePayload (optional)
* - $runSourcePayload['indexToInclude'] => (array) List of index names to include in reidexing/update.
* - $runSourcePayload['indexToExclude'] => (array) List of index names to exclude in reidexing/update.
* - $runSourcePayload['entityIDs'] => (array) List of entityID to update.
* - $runSourcePayload['entityType'] => (array)
*
* @see RunSourcePayload
*
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
*
* @return \Algolia\AlgoliaSearch\Model\Ingestion\RunSourceResponse|array<string, mixed>
*/
public function runSource($sourceID, $runSourcePayload = null, $requestOptions = [])
{
// verify the required parameter 'sourceID' is set
if (!isset($sourceID)) {
throw new \InvalidArgumentException(
'Parameter `sourceID` is required when calling `runSource`.'
);
}

$resourcePath = '/1/sources/{sourceID}/run';
$queryParameters = [];
$headers = [];
$httpBody = isset($runSourcePayload) ? $runSourcePayload : [];

// path params
if (null !== $sourceID) {
$resourcePath = str_replace(
'{sourceID}',
ObjectSerializer::toPathValue($sourceID),
$resourcePath
);
}

return $this->sendRequest('POST', $resourcePath, $headers, $queryParameters, $httpBody, $requestOptions);
}

/**
* Runs a task. You can check the status of task runs with the observability endpoints.
*
Expand Down
35 changes: 35 additions & 0 deletions lib/Model/Ingestion/EntityType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT.

namespace Algolia\AlgoliaSearch\Model\Ingestion;

/**
* EntityType Class Doc Comment.
*
* @category Class
*
* @description Type of entity to update.
*/
class EntityType
{
/**
* Possible values of this enum.
*/
public const PRODUCT = 'product';

public const COLLECTION = 'collection';

/**
* Gets allowable values of the enum.
*
* @return string[]
*/
public static function getAllowableEnumValues()
{
return [
self::PRODUCT,
self::COLLECTION,
];
}
}
Loading

0 comments on commit 5df3fdf

Please sign in to comment.