| 1 |
<?php |
| 2 |
|
| 3 |
namespace Square\Labor\Shifts\Requests; |
| 4 |
|
| 5 |
use Square\Core\Json\JsonSerializableType; |
| 6 |
use Square\Core\Json\JsonProperty; |
| 7 |
use Square\Types\Shift; |
| 8 |
|
| 9 |
class CreateShiftRequest extends JsonSerializableType |
| 10 |
{ |
| 11 |
/** |
| 12 |
* @var ?string $idempotencyKey A unique string value to ensure the idempotency of the operation. |
| 13 |
*/ |
| 14 |
#[JsonProperty('idempotency_key')] |
| 15 |
private ?string $idempotencyKey; |
| 16 |
|
| 17 |
/** |
| 18 |
* @var Shift $shift The `Shift` to be created. |
| 19 |
*/ |
| 20 |
#[JsonProperty('shift')] |
| 21 |
private Shift $shift; |
| 22 |
|
| 23 |
/** |
| 24 |
* @param array{ |
| 25 |
* shift: Shift, |
| 26 |
* idempotencyKey?: ?string, |
| 27 |
* } $values |
| 28 |
*/ |
| 29 |
public function __construct( |
| 30 |
array $values, |
| 31 |
) { |
| 32 |
$this->idempotencyKey = $values['idempotencyKey'] ?? null; |
| 33 |
$this->shift = $values['shift']; |
| 34 |
} |
| 35 |
|
| 36 |
/** |
| 37 |
* @return ?string |
| 38 |
*/ |
| 39 |
public function getIdempotencyKey(): ?string |
| 40 |
{ |
| 41 |
return $this->idempotencyKey; |
| 42 |
} |
| 43 |
|
| 44 |
/** |
| 45 |
* @param ?string $value |
| 46 |
*/ |
| 47 |
public function setIdempotencyKey(?string $value = null): self |
| 48 |
{ |
| 49 |
$this->idempotencyKey = $value; |
| 50 |
return $this; |
| 51 |
} |
| 52 |
|
| 53 |
/** |
| 54 |
* @return Shift |
| 55 |
*/ |
| 56 |
public function getShift(): Shift |
| 57 |
{ |
| 58 |
return $this->shift; |
| 59 |
} |
| 60 |
|
| 61 |
/** |
| 62 |
* @param Shift $value |
| 63 |
*/ |
| 64 |
public function setShift(Shift $value): self |
| 65 |
{ |
| 66 |
$this->shift = $value; |
| 67 |
return $this; |
| 68 |
} |
| 69 |
} |
| 70 |
|