Add methods to create slots
This commit is contained in:
@ -57,6 +57,26 @@ class SlotDbClient
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function createSlot(string $slotId, string $slotName, array $props = []): array
|
||||||
|
{
|
||||||
|
$slot = [
|
||||||
|
'slot' => $slotId,
|
||||||
|
'name' => $slotName,
|
||||||
|
'props' => $props
|
||||||
|
];
|
||||||
|
$res = $this->post("/slots", [ $slot ]);
|
||||||
|
var_dump((string)$res->getBody());
|
||||||
|
$data = json_decode($res->getBody(), true);
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function createMultipleSlots($slots): array
|
||||||
|
{
|
||||||
|
$res = $this->post("/slots", $slots);
|
||||||
|
$data = json_decode($res->getBody(), true);
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update properties for the slot $slotId, return new properties
|
* Update properties for the slot $slotId, return new properties
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user