commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
DeliveryRemovedMessagePayloadModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
17 use stdClass;
18 
23 {
24  public const DISCRIMINATOR_VALUE = 'DeliveryRemoved';
29  protected $type;
30 
35  protected $delivery;
36 
41  protected $shippingKey;
42 
43 
47  public function __construct(
48  ?Delivery $delivery = null,
49  ?string $shippingKey = null,
50  ?string $type = null
51  ) {
52  $this->delivery = $delivery;
53  $this->shippingKey = $shippingKey;
54  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
55  }
56 
61  public function getType()
62  {
63  if (is_null($this->type)) {
65  $data = $this->raw(self::FIELD_TYPE);
66  if (is_null($data)) {
67  return null;
68  }
69  $this->type = (string) $data;
70  }
71 
72  return $this->type;
73  }
74 
81  public function getDelivery()
82  {
83  if (is_null($this->delivery)) {
85  $data = $this->raw(self::FIELD_DELIVERY);
86  if (is_null($data)) {
87  return null;
88  }
89 
90  $this->delivery = DeliveryModel::of($data);
91  }
92 
93  return $this->delivery;
94  }
95 
102  public function getShippingKey()
103  {
104  if (is_null($this->shippingKey)) {
106  $data = $this->raw(self::FIELD_SHIPPING_KEY);
107  if (is_null($data)) {
108  return null;
109  }
110  $this->shippingKey = (string) $data;
111  }
112 
113  return $this->shippingKey;
114  }
115 
116 
120  public function setDelivery(?Delivery $delivery): void
121  {
122  $this->delivery = $delivery;
123  }
124 
128  public function setShippingKey(?string $shippingKey): void
129  {
130  $this->shippingKey = $shippingKey;
131  }
132 }
__construct(?Delivery $delivery=null, ?string $shippingKey=null, ?string $type=null)