Skip to content

Commit 3973ab6

Browse files
algolia-botmillotp
andcommitted
feat(specs): add notification settings to tasks [skip-bc] (generated)
algolia/api-clients-automation#4297 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
1 parent c08b842 commit 3973ab6

File tree

8 files changed

+959
-12
lines changed

8 files changed

+959
-12
lines changed

lib/Api/IngestionClient.php

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,8 @@ public function createSource($sourceCreate, $requestOptions = [])
250250
* - $taskCreate['failureThreshold'] => (int) Maximum accepted percentage of failures for a task run to finish successfully.
251251
* - $taskCreate['input'] => (array)
252252
* - $taskCreate['cursor'] => (string) Date of the last cursor in RFC 3339 format.
253+
* - $taskCreate['notifications'] => (array)
254+
* - $taskCreate['policies'] => (array)
253255
*
254256
* @see TaskCreate
255257
*
@@ -1541,21 +1543,22 @@ public function listSources($itemsPerPage = null, $page = null, $type = null, $a
15411543
* - deleteIndex
15421544
* - editSettings
15431545
*
1544-
* @param int $itemsPerPage Number of items per page. (optional, default to 10)
1545-
* @param int $page Page number of the paginated API response. (optional)
1546-
* @param array $action Actions for filtering the list of tasks. (optional)
1547-
* @param bool $enabled Whether to filter the list of tasks by the `enabled` status. (optional)
1548-
* @param array $sourceID Source IDs for filtering the list of tasks. (optional)
1549-
* @param array $sourceType Filters the tasks with the specified source type. (optional)
1550-
* @param array $destinationID Destination IDs for filtering the list of tasks. (optional)
1551-
* @param array $triggerType Type of task trigger for filtering the list of tasks. (optional)
1552-
* @param array $sort Property by which to sort the list of tasks. (optional)
1553-
* @param array $order Sort order of the response, ascending or descending. (optional)
1554-
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
1546+
* @param int $itemsPerPage Number of items per page. (optional, default to 10)
1547+
* @param int $page Page number of the paginated API response. (optional)
1548+
* @param array $action Actions for filtering the list of tasks. (optional)
1549+
* @param bool $enabled Whether to filter the list of tasks by the `enabled` status. (optional)
1550+
* @param array $sourceID Source IDs for filtering the list of tasks. (optional)
1551+
* @param array $sourceType Filters the tasks with the specified source type. (optional)
1552+
* @param array $destinationID Destination IDs for filtering the list of tasks. (optional)
1553+
* @param array $triggerType Type of task trigger for filtering the list of tasks. (optional)
1554+
* @param bool $withEmailNotifications If specified, the response only includes tasks with notifications.email.enabled set to this value. (optional)
1555+
* @param array $sort Property by which to sort the list of tasks. (optional)
1556+
* @param array $order Sort order of the response, ascending or descending. (optional)
1557+
* @param array $requestOptions the requestOptions to send along with the query, they will be merged with the transporter requestOptions
15551558
*
15561559
* @return \Algolia\AlgoliaSearch\Model\Ingestion\ListTasksResponse|array<string, mixed>
15571560
*/
1558-
public function listTasks($itemsPerPage = null, $page = null, $action = null, $enabled = null, $sourceID = null, $sourceType = null, $destinationID = null, $triggerType = null, $sort = null, $order = null, $requestOptions = [])
1561+
public function listTasks($itemsPerPage = null, $page = null, $action = null, $enabled = null, $sourceID = null, $sourceType = null, $destinationID = null, $triggerType = null, $withEmailNotifications = null, $sort = null, $order = null, $requestOptions = [])
15591562
{
15601563
$resourcePath = '/2/tasks';
15611564
$queryParameters = [];
@@ -1609,6 +1612,10 @@ public function listTasks($itemsPerPage = null, $page = null, $action = null, $e
16091612
$queryParameters['triggerType'] = $triggerType;
16101613
}
16111614

1615+
if (null !== $withEmailNotifications) {
1616+
$queryParameters['withEmailNotifications'] = $withEmailNotifications;
1617+
}
1618+
16121619
if (null !== $sort) {
16131620
$queryParameters['sort'] = $sort;
16141621
}
@@ -2422,6 +2429,8 @@ public function updateSource($sourceID, $sourceUpdate, $requestOptions = [])
24222429
* - $taskUpdate['input'] => (array)
24232430
* - $taskUpdate['enabled'] => (bool) Whether the task is enabled.
24242431
* - $taskUpdate['failureThreshold'] => (int) Maximum accepted percentage of failures for a task run to finish successfully.
2432+
* - $taskUpdate['notifications'] => (array)
2433+
* - $taskUpdate['policies'] => (array)
24252434
*
24262435
* @see TaskUpdate
24272436
*
Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
<?php
2+
3+
// 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.
4+
5+
namespace Algolia\AlgoliaSearch\Model\Ingestion;
6+
7+
use Algolia\AlgoliaSearch\Model\AbstractModel;
8+
use Algolia\AlgoliaSearch\Model\ModelInterface;
9+
10+
/**
11+
* EmailNotifications Class Doc Comment.
12+
*
13+
* @category Class
14+
*/
15+
class EmailNotifications extends AbstractModel implements ModelInterface, \ArrayAccess, \JsonSerializable
16+
{
17+
/**
18+
* Array of property to type mappings. Used for (de)serialization.
19+
*
20+
* @var string[]
21+
*/
22+
protected static $modelTypes = [
23+
'enabled' => 'bool',
24+
];
25+
26+
/**
27+
* Array of property to format mappings. Used for (de)serialization.
28+
*
29+
* @var string[]
30+
*/
31+
protected static $modelFormats = [
32+
'enabled' => null,
33+
];
34+
35+
/**
36+
* Array of attributes where the key is the local name,
37+
* and the value is the original name.
38+
*
39+
* @var string[]
40+
*/
41+
protected static $attributeMap = [
42+
'enabled' => 'enabled',
43+
];
44+
45+
/**
46+
* Array of attributes to setter functions (for deserialization of responses).
47+
*
48+
* @var string[]
49+
*/
50+
protected static $setters = [
51+
'enabled' => 'setEnabled',
52+
];
53+
54+
/**
55+
* Array of attributes to getter functions (for serialization of requests).
56+
*
57+
* @var string[]
58+
*/
59+
protected static $getters = [
60+
'enabled' => 'getEnabled',
61+
];
62+
63+
/**
64+
* Associative array for storing property values.
65+
*
66+
* @var mixed[]
67+
*/
68+
protected $container = [];
69+
70+
/**
71+
* Constructor.
72+
*
73+
* @param mixed[] $data Associated array of property values
74+
*/
75+
public function __construct(?array $data = null)
76+
{
77+
if (isset($data['enabled'])) {
78+
$this->container['enabled'] = $data['enabled'];
79+
}
80+
}
81+
82+
/**
83+
* Array of attributes where the key is the local name,
84+
* and the value is the original name.
85+
*
86+
* @return array
87+
*/
88+
public static function attributeMap()
89+
{
90+
return self::$attributeMap;
91+
}
92+
93+
/**
94+
* Array of property to type mappings. Used for (de)serialization.
95+
*
96+
* @return array
97+
*/
98+
public static function modelTypes()
99+
{
100+
return self::$modelTypes;
101+
}
102+
103+
/**
104+
* Array of property to format mappings. Used for (de)serialization.
105+
*
106+
* @return array
107+
*/
108+
public static function modelFormats()
109+
{
110+
return self::$modelFormats;
111+
}
112+
113+
/**
114+
* Array of attributes to setter functions (for deserialization of responses).
115+
*
116+
* @return array
117+
*/
118+
public static function setters()
119+
{
120+
return self::$setters;
121+
}
122+
123+
/**
124+
* Array of attributes to getter functions (for serialization of requests).
125+
*
126+
* @return array
127+
*/
128+
public static function getters()
129+
{
130+
return self::$getters;
131+
}
132+
133+
/**
134+
* Show all the invalid properties with reasons.
135+
*
136+
* @return array invalid properties with reasons
137+
*/
138+
public function listInvalidProperties()
139+
{
140+
return [];
141+
}
142+
143+
/**
144+
* Validate all the properties in the model
145+
* return true if all passed.
146+
*
147+
* @return bool True if all properties are valid
148+
*/
149+
public function valid()
150+
{
151+
return 0 === count($this->listInvalidProperties());
152+
}
153+
154+
/**
155+
* Gets enabled.
156+
*
157+
* @return null|bool
158+
*/
159+
public function getEnabled()
160+
{
161+
return $this->container['enabled'] ?? null;
162+
}
163+
164+
/**
165+
* Sets enabled.
166+
*
167+
* @param null|bool $enabled whether to send email notifications, note that this doesn't prevent the task from being blocked
168+
*
169+
* @return self
170+
*/
171+
public function setEnabled($enabled)
172+
{
173+
$this->container['enabled'] = $enabled;
174+
175+
return $this;
176+
}
177+
178+
/**
179+
* Returns true if offset exists. False otherwise.
180+
*
181+
* @param int $offset Offset
182+
*/
183+
public function offsetExists($offset): bool
184+
{
185+
return isset($this->container[$offset]);
186+
}
187+
188+
/**
189+
* Gets offset.
190+
*
191+
* @param int $offset Offset
192+
*
193+
* @return null|mixed
194+
*/
195+
public function offsetGet($offset): mixed
196+
{
197+
return $this->container[$offset] ?? null;
198+
}
199+
200+
/**
201+
* Sets value based on offset.
202+
*
203+
* @param null|int $offset Offset
204+
* @param mixed $value Value to be set
205+
*/
206+
public function offsetSet($offset, $value): void
207+
{
208+
if (is_null($offset)) {
209+
$this->container[] = $value;
210+
} else {
211+
$this->container[$offset] = $value;
212+
}
213+
}
214+
215+
/**
216+
* Unsets offset.
217+
*
218+
* @param int $offset Offset
219+
*/
220+
public function offsetUnset($offset): void
221+
{
222+
unset($this->container[$offset]);
223+
}
224+
}

0 commit comments

Comments
 (0)