@@ -20,10 +20,18 @@ class Item implements SerializableInterface, JsonSerializable
2020
2121 const MANDATORY_ENUM_ANOTHER_OPTION = 'another option ' ;
2222
23+ const MANDATORY_NULLABLE_ENUM_ONE_OPTION = 'one option ' ;
24+
25+ const MANDATORY_NULLABLE_ENUM_ANOTHER_OPTION = 'another option ' ;
26+
2327 const OPTIONAL_ENUM_ONE_OPTION = 'one option ' ;
2428
2529 const OPTIONAL_ENUM_ANOTHER_OPTION = 'another option ' ;
2630
31+ const OPTIONAL_NULLABLE_ENUM_ONE_OPTION = 'one option ' ;
32+
33+ const OPTIONAL_NULLABLE_ENUM_ANOTHER_OPTION = 'another option ' ;
34+
2735 /** @var int */
2836 private $ mandatoryInteger ;
2937
@@ -33,6 +41,15 @@ class Item implements SerializableInterface, JsonSerializable
3341 /** @var string */
3442 private $ mandatoryEnum ;
3543
44+ /** @var int */
45+ private $ mandatoryIntEnum ;
46+
47+ /** @var string|null */
48+ private $ mandatoryNullableEnum ;
49+
50+ /** @var int|null */
51+ private $ mandatoryNullableIntEnum ;
52+
3653 /** @var DateTimeInterface */
3754 private $ mandatoryDate ;
3855
@@ -77,6 +94,12 @@ class Item implements SerializableInterface, JsonSerializable
7794 /** @var int|null */
7895 private $ optionalIntEnum ;
7996
97+ /** @var string|null */
98+ private $ optionalNullableEnum ;
99+
100+ /** @var int|null */
101+ private $ optionalNullableIntEnum ;
102+
80103 /** @var DateTimeInterface|null */
81104 private $ optionalDate ;
82105
@@ -129,9 +152,11 @@ class Item implements SerializableInterface, JsonSerializable
129152 private $ optionalNullableStringWithMinMaxLength ;
130153
131154 /** @var array */
132- private $ optionalPropertyChanged = ['optionalInteger ' => false , 'optionalString ' => false , 'optionalEnum ' => false , 'optionalIntEnum ' => false , 'optionalDate ' => false , 'optionalNullableDate ' => false , 'optionalFloat ' => false , 'optionalBoolean ' => false , 'optionalNullableBoolean ' => false , 'optionalArray ' => false , 'optionalNullableArray ' => false , 'optionalMixedArray ' => false , 'optionalArrayWithMinMaxItems ' => false , 'optionalStringWithMinMaxLength ' => false , 'optionalStringWithPattern ' => false , 'optionalIntegerBetweenIncluded ' => false , 'optionalIntegerBetweenExcluded ' => false , 'optionalNumberBetweenIncluded ' => false , 'optionalNumberBetweenExcluded ' => false , 'optionalObject ' => false , 'optionalNullableStringWithMinMaxLength ' => false ];
155+ private $ optionalPropertyChanged = ['optionalInteger ' => false , 'optionalString ' => false , 'optionalEnum ' => false , 'optionalIntEnum ' => false , 'optionalNullableEnum ' => false , ' optionalNullableIntEnum ' => false , ' optionalDate ' => false , 'optionalNullableDate ' => false , 'optionalFloat ' => false , 'optionalBoolean ' => false , 'optionalNullableBoolean ' => false , 'optionalArray ' => false , 'optionalNullableArray ' => false , 'optionalMixedArray ' => false , 'optionalArrayWithMinMaxItems ' => false , 'optionalStringWithMinMaxLength ' => false , 'optionalStringWithPattern ' => false , 'optionalIntegerBetweenIncluded ' => false , 'optionalIntegerBetweenExcluded ' => false , 'optionalNumberBetweenIncluded ' => false , 'optionalNumberBetweenExcluded ' => false , 'optionalObject ' => false , 'optionalNullableStringWithMinMaxLength ' => false ];
133156
134157 /**
158+ * @param string|null $mandatoryNullableEnum
159+ * @param int|null $mandatoryNullableIntEnum
135160 * @param DateTimeInterface|null $mandatoryNullableDate
136161 * @param string[] $mandatoryArray
137162 * @param string[] $mandatoryArrayWithMinItems
@@ -140,7 +165,7 @@ class Item implements SerializableInterface, JsonSerializable
140165 *
141166 * @throws RequestValidationException
142167 */
143- public function __construct (int $ mandatoryInteger , string $ mandatoryString , string $ mandatoryEnum , DateTimeInterface $ mandatoryDate , $ mandatoryNullableDate , float $ mandatoryFloat , bool $ mandatoryBoolean , array $ mandatoryArray , array $ mandatoryArrayWithMinItems , ItemMandatoryObject $ mandatoryObject , $ mandatoryNullableObjectWithAllOf , $ mandatoryMixed , MandatoryAnyOf $ mandatoryAnyOf , $ mandatoryNullableStringWithMinMaxLength )
168+ public function __construct (int $ mandatoryInteger , string $ mandatoryString , string $ mandatoryEnum , int $ mandatoryIntEnum , $ mandatoryNullableEnum , $ mandatoryNullableIntEnum , DateTimeInterface $ mandatoryDate , $ mandatoryNullableDate , float $ mandatoryFloat , bool $ mandatoryBoolean , array $ mandatoryArray , array $ mandatoryArrayWithMinItems , ItemMandatoryObject $ mandatoryObject , $ mandatoryNullableObjectWithAllOf , $ mandatoryMixed , MandatoryAnyOf $ mandatoryAnyOf , $ mandatoryNullableStringWithMinMaxLength )
144169 {
145170 if (count ($ mandatoryArrayWithMinItems ) < 1 ) {
146171 throw new RequestValidationException (sprintf ('Invalid %s value. Expected min items: `1`. ' , 'mandatoryArrayWithMinItems ' ));
@@ -154,6 +179,9 @@ public function __construct(int $mandatoryInteger, string $mandatoryString, stri
154179 $ this ->mandatoryInteger = $ mandatoryInteger ;
155180 $ this ->mandatoryString = $ mandatoryString ;
156181 $ this ->mandatoryEnum = $ mandatoryEnum ;
182+ $ this ->mandatoryIntEnum = $ mandatoryIntEnum ;
183+ $ this ->mandatoryNullableEnum = $ mandatoryNullableEnum ;
184+ $ this ->mandatoryNullableIntEnum = $ mandatoryNullableIntEnum ;
157185 $ this ->mandatoryDate = $ mandatoryDate ;
158186 $ this ->mandatoryNullableDate = $ mandatoryNullableDate ;
159187 $ this ->mandatoryFloat = $ mandatoryFloat ;
@@ -199,6 +227,28 @@ public function setOptionalIntEnum(int $optionalIntEnum): self
199227 return $ this ;
200228 }
201229
230+ /**
231+ * @param string|null $optionalNullableEnum
232+ */
233+ public function setOptionalNullableEnum ($ optionalNullableEnum ): self
234+ {
235+ $ this ->optionalNullableEnum = $ optionalNullableEnum ;
236+ $ this ->optionalPropertyChanged ['optionalNullableEnum ' ] = true ;
237+
238+ return $ this ;
239+ }
240+
241+ /**
242+ * @param int|null $optionalNullableIntEnum
243+ */
244+ public function setOptionalNullableIntEnum ($ optionalNullableIntEnum ): self
245+ {
246+ $ this ->optionalNullableIntEnum = $ optionalNullableIntEnum ;
247+ $ this ->optionalPropertyChanged ['optionalNullableIntEnum ' ] = true ;
248+
249+ return $ this ;
250+ }
251+
202252 public function setOptionalDate (DateTimeInterface $ optionalDate ): self
203253 {
204254 $ this ->optionalDate = $ optionalDate ;
@@ -443,6 +493,16 @@ public function hasOptionalIntEnum(): bool
443493 return $ this ->optionalPropertyChanged ['optionalIntEnum ' ];
444494 }
445495
496+ public function hasOptionalNullableEnum (): bool
497+ {
498+ return $ this ->optionalPropertyChanged ['optionalNullableEnum ' ];
499+ }
500+
501+ public function hasOptionalNullableIntEnum (): bool
502+ {
503+ return $ this ->optionalPropertyChanged ['optionalNullableIntEnum ' ];
504+ }
505+
446506 public function hasOptionalDate (): bool
447507 {
448508 return $ this ->optionalPropertyChanged ['optionalDate ' ];
@@ -543,6 +603,27 @@ public function getMandatoryEnum(): string
543603 return $ this ->mandatoryEnum ;
544604 }
545605
606+ public function getMandatoryIntEnum (): int
607+ {
608+ return $ this ->mandatoryIntEnum ;
609+ }
610+
611+ /**
612+ * @return string|null
613+ */
614+ public function getMandatoryNullableEnum ()
615+ {
616+ return $ this ->mandatoryNullableEnum ;
617+ }
618+
619+ /**
620+ * @return int|null
621+ */
622+ public function getMandatoryNullableIntEnum ()
623+ {
624+ return $ this ->mandatoryNullableIntEnum ;
625+ }
626+
546627 public function getMandatoryDate (): DateTimeInterface
547628 {
548629 return $ this ->mandatoryDate ;
@@ -645,6 +726,22 @@ public function getOptionalIntEnum()
645726 return $ this ->optionalIntEnum ;
646727 }
647728
729+ /**
730+ * @return string|null
731+ */
732+ public function getOptionalNullableEnum ()
733+ {
734+ return $ this ->optionalNullableEnum ;
735+ }
736+
737+ /**
738+ * @return int|null
739+ */
740+ public function getOptionalNullableIntEnum ()
741+ {
742+ return $ this ->optionalNullableIntEnum ;
743+ }
744+
648745 /**
649746 * @return DateTimeInterface|null
650747 */
@@ -787,6 +884,9 @@ public function toArray(): array
787884 $ fields ['mandatoryInteger ' ] = $ this ->mandatoryInteger ;
788885 $ fields ['mandatoryString ' ] = $ this ->mandatoryString ;
789886 $ fields ['mandatoryEnum ' ] = $ this ->mandatoryEnum ;
887+ $ fields ['mandatoryIntEnum ' ] = $ this ->mandatoryIntEnum ;
888+ $ fields ['mandatoryNullableEnum ' ] = $ this ->mandatoryNullableEnum ;
889+ $ fields ['mandatoryNullableIntEnum ' ] = $ this ->mandatoryNullableIntEnum ;
790890 $ fields ['mandatoryDate ' ] = $ this ->mandatoryDate ->format (DATE_RFC3339 );
791891 $ fields ['mandatoryNullableDate ' ] = $ this ->mandatoryNullableDate !== null ? $ this ->mandatoryNullableDate ->format (DATE_RFC3339 ) : null ;
792892 $ fields ['mandatoryFloat ' ] = $ this ->mandatoryFloat ;
@@ -810,6 +910,12 @@ public function toArray(): array
810910 if ($ this ->hasOptionalIntEnum ()) {
811911 $ fields ['optionalIntEnum ' ] = $ this ->optionalIntEnum ;
812912 }
913+ if ($ this ->hasOptionalNullableEnum ()) {
914+ $ fields ['optionalNullableEnum ' ] = $ this ->optionalNullableEnum ;
915+ }
916+ if ($ this ->hasOptionalNullableIntEnum ()) {
917+ $ fields ['optionalNullableIntEnum ' ] = $ this ->optionalNullableIntEnum ;
918+ }
813919 if ($ this ->hasOptionalDate ()) {
814920 $ fields ['optionalDate ' ] = $ this ->optionalDate ->format (DATE_RFC3339 );
815921 }
0 commit comments