88
99namespace Commercetools \Api \Models \ShippingMethod ;
1010
11+ use Commercetools \Api \Models \Common \LocalizedString ;
12+ use Commercetools \Api \Models \Common \LocalizedStringModel ;
1113use Commercetools \Base \DateTimeImmutableCollection ;
1214use Commercetools \Base \JsonObject ;
1315use Commercetools \Base \JsonObjectModel ;
@@ -26,7 +28,7 @@ final class ShippingMethodSetLocalizedDescriptionActionModel extends JsonObjectM
2628 protected $ action ;
2729
2830 /**
29- * @var ?string
31+ * @var ?LocalizedString
3032 */
3133 protected $ localizedDescription ;
3234
@@ -35,7 +37,7 @@ final class ShippingMethodSetLocalizedDescriptionActionModel extends JsonObjectM
3537 * @psalm-suppress MissingParamType
3638 */
3739 public function __construct (
38- ?string $ localizedDescription = null
40+ ?LocalizedString $ localizedDescription = null
3941 ) {
4042 $ this ->localizedDescription = $ localizedDescription ;
4143 $ this ->action = static ::DISCRIMINATOR_VALUE ;
@@ -59,27 +61,28 @@ public function getAction()
5961 }
6062
6163 /**
62- * @return null|string
64+ * @return null|LocalizedString
6365 */
6466 public function getLocalizedDescription ()
6567 {
6668 if (is_null ($ this ->localizedDescription )) {
67- /** @psalm-var ? string $data */
69+ /** @psalm-var stdClass|array< string, mixed>|null $data */
6870 $ data = $ this ->raw (self ::FIELD_LOCALIZED_DESCRIPTION );
6971 if (is_null ($ data )) {
7072 return null ;
7173 }
72- $ this ->localizedDescription = (string ) $ data ;
74+
75+ $ this ->localizedDescription = LocalizedStringModel::of ($ data );
7376 }
7477
7578 return $ this ->localizedDescription ;
7679 }
7780
7881
7982 /**
80- * @param ?string $localizedDescription
83+ * @param ?LocalizedString $localizedDescription
8184 */
82- public function setLocalizedDescription (?string $ localizedDescription ): void
85+ public function setLocalizedDescription (?LocalizedString $ localizedDescription ): void
8386 {
8487 $ this ->localizedDescription = $ localizedDescription ;
8588 }
0 commit comments