11<?php
22/*
33 * --------------------------------------------------------------------------------------------------------------------
4- * <copyright company="Aspose Pty Ltd" file="DocConvertOptions .php">
4+ * <copyright company="Aspose Pty Ltd" file="CadConvertOptions .php">
55 * Copyright (c) Aspose Pty Ltd
66 * </copyright>
77 * <summary>
3030use \GroupDocs \Conversion \ObjectSerializer ;
3131
3232/*
33- * DocConvertOptions
33+ * CadConvertOptions
3434 *
35- * @description Doc convert options
35+ * @description Options for to Cad conversion
3636 */
37- class DocConvertOptions extends WordProcessingConvertOptions
37+ class CadConvertOptions extends ConvertOptions
3838{
3939 const DISCRIMINATOR = null ;
4040
@@ -43,15 +43,17 @@ class DocConvertOptions extends WordProcessingConvertOptions
4343 *
4444 * @var string
4545 */
46- protected static $ swaggerModelName = "DocConvertOptions " ;
46+ protected static $ swaggerModelName = "CadConvertOptions " ;
4747
4848 /*
4949 * Array of property to type mappings. Used for (de)serialization
5050 *
5151 * @var string[]
5252 */
5353 protected static $ swaggerTypes = [
54-
54+ 'width ' => 'int ' ,
55+ 'height ' => 'int ' ,
56+ 'pageSize ' => 'string '
5557 ];
5658
5759 /*
@@ -60,7 +62,9 @@ class DocConvertOptions extends WordProcessingConvertOptions
6062 * @var string[]
6163 */
6264 protected static $ swaggerFormats = [
63-
65+ 'width ' => 'int32 ' ,
66+ 'height ' => 'int32 ' ,
67+ 'pageSize ' => null
6468 ];
6569
6670 /*
@@ -90,7 +94,9 @@ public static function swaggerFormats()
9094 * @var string[]
9195 */
9296 protected static $ attributeMap = [
93-
97+ 'width ' => 'Width ' ,
98+ 'height ' => 'Height ' ,
99+ 'pageSize ' => 'PageSize '
94100 ];
95101
96102 /*
@@ -99,7 +105,9 @@ public static function swaggerFormats()
99105 * @var string[]
100106 */
101107 protected static $ setters = [
102-
108+ 'width ' => 'setWidth ' ,
109+ 'height ' => 'setHeight ' ,
110+ 'pageSize ' => 'setPageSize '
103111 ];
104112
105113 /*
@@ -108,7 +116,9 @@ public static function swaggerFormats()
108116 * @var string[]
109117 */
110118 protected static $ getters = [
111-
119+ 'width ' => 'getWidth ' ,
120+ 'height ' => 'getHeight ' ,
121+ 'pageSize ' => 'getPageSize '
112122 ];
113123
114124 /*
@@ -152,9 +162,56 @@ public function getModelName()
152162 return self ::$ swaggerModelName ;
153163 }
154164
165+ const PAGE_SIZE__DEFAULT = 'Default ' ;
166+ const PAGE_SIZE_A3 = 'A3 ' ;
167+ const PAGE_SIZE_STATEMENT = 'Statement ' ;
168+ const PAGE_SIZE_QUARTO = 'Quarto ' ;
169+ const PAGE_SIZE_PAPER11X17 = 'Paper11x17 ' ;
170+ const PAGE_SIZE_PAPER10X14 = 'Paper10x14 ' ;
171+ const PAGE_SIZE_LETTER = 'Letter ' ;
172+ const PAGE_SIZE_LEGAL = 'Legal ' ;
173+ const PAGE_SIZE_LEDGER = 'Ledger ' ;
174+ const PAGE_SIZE_FOLIO = 'Folio ' ;
175+ const PAGE_SIZE_EXECUTIVE = 'Executive ' ;
176+ const PAGE_SIZE_ENVELOPE_DL = 'EnvelopeDL ' ;
177+ const PAGE_SIZE_CUSTOM = 'Custom ' ;
178+ const PAGE_SIZE_B5 = 'B5 ' ;
179+ const PAGE_SIZE_B4 = 'B4 ' ;
180+ const PAGE_SIZE_A5 = 'A5 ' ;
181+ const PAGE_SIZE_A4 = 'A4 ' ;
182+ const PAGE_SIZE_TABLOID = 'Tabloid ' ;
155183
156184
157185
186+ /*
187+ * Gets allowable values of the enum
188+ *
189+ * @return string[]
190+ */
191+ public function getPageSizeAllowableValues ()
192+ {
193+ return [
194+ self ::PAGE_SIZE__DEFAULT ,
195+ self ::PAGE_SIZE_A3 ,
196+ self ::PAGE_SIZE_STATEMENT ,
197+ self ::PAGE_SIZE_QUARTO ,
198+ self ::PAGE_SIZE_PAPER11X17 ,
199+ self ::PAGE_SIZE_PAPER10X14 ,
200+ self ::PAGE_SIZE_LETTER ,
201+ self ::PAGE_SIZE_LEGAL ,
202+ self ::PAGE_SIZE_LEDGER ,
203+ self ::PAGE_SIZE_FOLIO ,
204+ self ::PAGE_SIZE_EXECUTIVE ,
205+ self ::PAGE_SIZE_ENVELOPE_DL ,
206+ self ::PAGE_SIZE_CUSTOM ,
207+ self ::PAGE_SIZE_B5 ,
208+ self ::PAGE_SIZE_B4 ,
209+ self ::PAGE_SIZE_A5 ,
210+ self ::PAGE_SIZE_A4 ,
211+ self ::PAGE_SIZE_TABLOID ,
212+ ];
213+ }
214+
158215
159216
160217 /*
@@ -167,6 +224,9 @@ public function __construct(array $data = null)
167224 {
168225 parent ::__construct ($ data );
169226
227+ $ this ->container ['width ' ] = isset ($ data ['width ' ]) ? $ data ['width ' ] : null ;
228+ $ this ->container ['height ' ] = isset ($ data ['height ' ]) ? $ data ['height ' ] : null ;
229+ $ this ->container ['pageSize ' ] = isset ($ data ['pageSize ' ]) ? $ data ['pageSize ' ] : null ;
170230 }
171231
172232 /*
@@ -178,6 +238,23 @@ public function listInvalidProperties()
178238 {
179239 $ invalidProperties = parent ::listInvalidProperties ();
180240
241+ if ($ this ->container ['width ' ] === null ) {
242+ $ invalidProperties [] = "'width' can't be null " ;
243+ }
244+ if ($ this ->container ['height ' ] === null ) {
245+ $ invalidProperties [] = "'height' can't be null " ;
246+ }
247+ if ($ this ->container ['pageSize ' ] === null ) {
248+ $ invalidProperties [] = "'pageSize' can't be null " ;
249+ }
250+ $ allowedValues = $ this ->getPageSizeAllowableValues ();
251+ if (!in_array ($ this ->container ['pageSize ' ], $ allowedValues )) {
252+ $ invalidProperties [] = sprintf (
253+ "invalid value for 'pageSize', must be one of '%s' " ,
254+ implode ("', ' " , $ allowedValues )
255+ );
256+ }
257+
181258 return $ invalidProperties ;
182259 }
183260
@@ -193,9 +270,99 @@ public function valid()
193270 return false ;
194271 }
195272
273+ if ($ this ->container ['width ' ] === null ) {
274+ return false ;
275+ }
276+ if ($ this ->container ['height ' ] === null ) {
277+ return false ;
278+ }
279+ if ($ this ->container ['pageSize ' ] === null ) {
280+ return false ;
281+ }
282+ $ allowedValues = $ this ->getPageSizeAllowableValues ();
283+ if (!in_array ($ this ->container ['pageSize ' ], $ allowedValues )) {
284+ return false ;
285+ }
196286 return true ;
197287 }
198288
289+
290+ /*
291+ * Gets width
292+ *
293+ * @return int
294+ */
295+ public function getWidth ()
296+ {
297+ return $ this ->container ['width ' ];
298+ }
299+
300+ /*
301+ * Sets width
302+ *
303+ * @param int $width Desired page width after conversion
304+ *
305+ * @return $this
306+ */
307+ public function setWidth ($ width )
308+ {
309+ $ this ->container ['width ' ] = $ width ;
310+
311+ return $ this ;
312+ }
313+
314+ /*
315+ * Gets height
316+ *
317+ * @return int
318+ */
319+ public function getHeight ()
320+ {
321+ return $ this ->container ['height ' ];
322+ }
323+
324+ /*
325+ * Sets height
326+ *
327+ * @param int $height Desired page height after conversion
328+ *
329+ * @return $this
330+ */
331+ public function setHeight ($ height )
332+ {
333+ $ this ->container ['height ' ] = $ height ;
334+
335+ return $ this ;
336+ }
337+
338+ /*
339+ * Gets pageSize
340+ *
341+ * @return string
342+ */
343+ public function getPageSize ()
344+ {
345+ return $ this ->container ['pageSize ' ];
346+ }
347+
348+ /*
349+ * Sets pageSize
350+ *
351+ * @param string $pageSize Page size
352+ *
353+ * @return $this
354+ */
355+ public function setPageSize ($ pageSize )
356+ {
357+ $ allowedValues = $ this ->getPageSizeAllowableValues ();
358+ if ((!is_numeric ($ pageSize ) && !in_array ($ pageSize , $ allowedValues )) || (is_numeric ($ pageSize ) && !in_array ($ allowedValues [$ pageSize ], $ allowedValues ))) {
359+ throw new \InvalidArgumentException (sprintf ("Invalid value for 'pageSize', must be one of '%s' " , implode ("', ' " , $ allowedValues )));
360+ }
361+
362+ $ this ->container ['pageSize ' ] = $ pageSize ;
363+
364+ return $ this ;
365+ }
199366 /*
200367 * Returns true if offset exists. False otherwise.
201368 *
0 commit comments