Skip to content

Commit 10b0991

Browse files
[11.6] Add parameters to addVariable on group level (#676)
* Add parameters to addVariable on group level Like masked * Explicitly only allow the supported parameters, fixed typo, fixed phpdoc notation * Update Groups.php Co-authored-by: Graham Campbell <[email protected]>
1 parent ea09dc7 commit 10b0991

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/Api/Groups.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,15 @@ public function variable($group_id, string $key)
396396
* @param string $key
397397
* @param string $value
398398
* @param bool|null $protected
399+
* @param array $parameters {
400+
*
401+
* @var string $masked true or false
402+
* @var string $variable_type env_var (default) or file
403+
* }
399404
*
400405
* @return mixed
401406
*/
402-
public function addVariable($group_id, string $key, string $value, ?bool $protected = null)
407+
public function addVariable($group_id, string $key, string $value, ?bool $protected = null, array $parameters = [])
403408
{
404409
$payload = [
405410
'key' => $key,
@@ -409,6 +414,14 @@ public function addVariable($group_id, string $key, string $value, ?bool $protec
409414
if ($protected) {
410415
$payload['protected'] = $protected;
411416
}
417+
418+
if (isset($parameters['masked']) {
419+
$payload['masked'] = $parameters['masked'];
420+
}
421+
422+
if (isset($parameters['variable_type']) {
423+
$payload['variable_type'] = $parameters['variable_type'];
424+
}
412425

413426
return $this->post('groups/'.self::encodePath($group_id).'/variables', $payload);
414427
}

0 commit comments

Comments
 (0)