commercetools-sdk-php-v2
The commercetools platform, import-api and PHP sdks generated from our api reference.
ParcelMeasurementsUpdatedMessagePayloadModel.php
1 <?php
2 
3 declare(strict_types=1);
10 
17 use stdClass;
18 
23 {
24  public const DISCRIMINATOR_VALUE = 'ParcelMeasurementsUpdated';
29  protected $type;
30 
35  protected $deliveryId;
36 
41  protected $parcelId;
42 
47  protected $measurements;
48 
53  protected $shippingKey;
54 
55 
59  public function __construct(
60  ?string $deliveryId = null,
61  ?string $parcelId = null,
63  ?string $shippingKey = null,
64  ?string $type = null
65  ) {
66  $this->deliveryId = $deliveryId;
67  $this->parcelId = $parcelId;
68  $this->measurements = $measurements;
69  $this->shippingKey = $shippingKey;
70  $this->type = $type ?? self::DISCRIMINATOR_VALUE;
71  }
72 
77  public function getType()
78  {
79  if (is_null($this->type)) {
81  $data = $this->raw(self::FIELD_TYPE);
82  if (is_null($data)) {
83  return null;
84  }
85  $this->type = (string) $data;
86  }
87 
88  return $this->type;
89  }
90 
97  public function getDeliveryId()
98  {
99  if (is_null($this->deliveryId)) {
101  $data = $this->raw(self::FIELD_DELIVERY_ID);
102  if (is_null($data)) {
103  return null;
104  }
105  $this->deliveryId = (string) $data;
106  }
107 
108  return $this->deliveryId;
109  }
110 
117  public function getParcelId()
118  {
119  if (is_null($this->parcelId)) {
121  $data = $this->raw(self::FIELD_PARCEL_ID);
122  if (is_null($data)) {
123  return null;
124  }
125  $this->parcelId = (string) $data;
126  }
127 
128  return $this->parcelId;
129  }
130 
137  public function getMeasurements()
138  {
139  if (is_null($this->measurements)) {
141  $data = $this->raw(self::FIELD_MEASUREMENTS);
142  if (is_null($data)) {
143  return null;
144  }
145 
146  $this->measurements = ParcelMeasurementsModel::of($data);
147  }
148 
149  return $this->measurements;
150  }
151 
158  public function getShippingKey()
159  {
160  if (is_null($this->shippingKey)) {
162  $data = $this->raw(self::FIELD_SHIPPING_KEY);
163  if (is_null($data)) {
164  return null;
165  }
166  $this->shippingKey = (string) $data;
167  }
168 
169  return $this->shippingKey;
170  }
171 
172 
176  public function setDeliveryId(?string $deliveryId): void
177  {
178  $this->deliveryId = $deliveryId;
179  }
180 
184  public function setParcelId(?string $parcelId): void
185  {
186  $this->parcelId = $parcelId;
187  }
188 
193  {
194  $this->measurements = $measurements;
195  }
196 
200  public function setShippingKey(?string $shippingKey): void
201  {
202  $this->shippingKey = $shippingKey;
203  }
204 }
__construct(?string $deliveryId=null, ?string $parcelId=null, ?ParcelMeasurements $measurements=null, ?string $shippingKey=null, ?string $type=null)