From 4db45d2d6653ba3278110ccf9f5178aa9f4587af Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 17 May 2018 09:45:49 +0200 Subject: [PATCH 1/2] Add support for IFC files --- lib/Model/ManifestChildren.php | 10 ++++++---- lib/Model/ManifestDerivative.php | 12 +++++++----- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/lib/Model/ManifestChildren.php b/lib/Model/ManifestChildren.php index d3529b3..83004a8 100644 --- a/lib/Model/ManifestChildren.php +++ b/lib/Model/ManifestChildren.php @@ -161,6 +161,7 @@ public static function getters() const TYPE_VIEW = 'view'; const ROLE__2D = '2d'; const ROLE__3D = '3d'; + const ROLE__IFC = 'ifc'; const ROLE_GRAPHICS = 'graphics'; const ROLE_MANIFEST = 'manifest'; const ROLE_THUMBNAIL = 'thumbnail'; @@ -196,6 +197,7 @@ public function getRoleAllowableValues() return [ self::ROLE__2D, self::ROLE__3D, + self::ROLE__IFC, self::ROLE_GRAPHICS, self::ROLE_MANIFEST, self::ROLE_THUMBNAIL, @@ -266,9 +268,9 @@ public function listInvalidProperties() if ($this->container['role'] === null) { $invalid_properties[] = "'role' can't be null"; } - $allowed_values = ["2d", "3d", "graphics", "manifest", "thumbnail"]; + $allowed_values = ["2d", "3d", "graphics", "manifest", "thumbnail", "ifc"]; if (!in_array($this->container['role'], $allowed_values)) { - $invalid_properties[] = "invalid value for 'role', must be one of '2d', '3d', 'graphics', 'manifest', 'thumbnail'."; + $invalid_properties[] = "invalid value for 'role', must be one of '2d', '3d', 'graphics', 'manifest', 'thumbnail', 'ifc'."; } if ($this->container['mime'] === null) { @@ -358,9 +360,9 @@ public function getRole() */ public function setRole($role) { - $allowed_values = array('2d', '3d', 'graphics', 'manifest', 'thumbnail','Autodesk.CloudPlatform.PropertyDatabase','viewable'); + $allowed_values = array('2d', '3d', 'graphics', 'manifest', 'thumbnail','Autodesk.CloudPlatform.PropertyDatabase','viewable', 'ifc'); if ((!in_array($role, $allowed_values))) { - throw new \InvalidArgumentException("Invalid value for 'role', must be one of '2d', '3d', 'graphics', 'manifest', 'thumbnail','Autodesk.CloudPlatform.PropertyDatabase','viewable'"); + throw new \InvalidArgumentException("Invalid value for 'role', must be one of '2d', '3d', 'graphics', 'manifest', 'thumbnail','Autodesk.CloudPlatform.PropertyDatabase','viewable', 'ifc'"); } $this->container['role'] = $role; diff --git a/lib/Model/ManifestDerivative.php b/lib/Model/ManifestDerivative.php index b2b9e5f..657007a 100644 --- a/lib/Model/ManifestDerivative.php +++ b/lib/Model/ManifestDerivative.php @@ -132,6 +132,7 @@ public static function getters() const OUTPUT_TYPE_IGES = 'iges'; const OUTPUT_TYPE_OBJ = 'obj'; const OUTPUT_TYPE_SVF = 'svf'; + const OUTPUT_TYPE_IFC = 'ifc'; const OUTPUT_TYPE_THUMBNAIL = 'thumbnail'; const STATUS_PENDING = 'pending'; const STATUS_INPROGRESS = 'inprogress'; @@ -154,6 +155,7 @@ public function getOutputTypeAllowableValues() self::OUTPUT_TYPE_IGES, self::OUTPUT_TYPE_OBJ, self::OUTPUT_TYPE_SVF, + self::OUTPUT_TYPE_IFC, self::OUTPUT_TYPE_THUMBNAIL, ]; } @@ -210,9 +212,9 @@ public function listInvalidProperties() if ($this->container['has_thumbnail'] === null) { $invalid_properties[] = "'has_thumbnail' can't be null"; } - $allowed_values = ["stl", "step", "iges", "obj", "svf", "thumbnail"]; + $allowed_values = ["stl", "step", "iges", "obj", "svf", "thumbnail", "ifc"]; if (!in_array($this->container['output_type'], $allowed_values)) { - $invalid_properties[] = "invalid value for 'output_type', must be one of 'stl', 'step', 'iges', 'obj', 'svf', 'thumbnail'."; + $invalid_properties[] = "invalid value for 'output_type', must be one of 'stl', 'step', 'iges', 'obj', 'svf', 'thumbnail', 'ifc'."; } if ($this->container['progress'] === null) { @@ -247,7 +249,7 @@ public function valid() if ($this->container['has_thumbnail'] === null) { return false; } - $allowed_values = ["stl", "step", "iges", "obj", "svf", "thumbnail"]; + $allowed_values = ["stl", "step", "iges", "obj", "svf", "thumbnail", "ifc"]; if (!in_array($this->container['output_type'], $allowed_values)) { return false; } @@ -326,9 +328,9 @@ public function getOutputType() */ public function setOutputType($output_type) { - $allowed_values = array('stl', 'step', 'iges', 'obj', 'svf', 'thumbnail'); + $allowed_values = array('stl', 'step', 'iges', 'obj', 'svf', 'thumbnail', 'ifc'); if (!is_null($output_type) && (!in_array($output_type, $allowed_values))) { - throw new \InvalidArgumentException("Invalid value for 'output_type', must be one of 'stl', 'step', 'iges', 'obj', 'svf', 'thumbnail'"); + throw new \InvalidArgumentException("Invalid value for 'output_type', must be one of 'stl', 'step', 'iges', 'obj', 'svf', 'thumbnail', 'ifc'"); } $this->container['output_type'] = $output_type; From d5269dd304b1465fa32e07178231d4ed327c2832 Mon Sep 17 00:00:00 2001 From: Zhong Wu Date: Fri, 25 May 2018 22:29:58 +0800 Subject: [PATCH 2/2] add support of 'ifc' --- lib/Model/JobPayloadItem.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/Model/JobPayloadItem.php b/lib/Model/JobPayloadItem.php index c0c089d..ee5f6d1 100644 --- a/lib/Model/JobPayloadItem.php +++ b/lib/Model/JobPayloadItem.php @@ -121,6 +121,7 @@ public static function getters() const TYPE_STEP = 'step'; const TYPE_IGES = 'iges'; const TYPE_OBJ = 'obj'; + const TYPE_IFC = 'ifc'; const VIEWS__2D = '2d'; const VIEWS__3D = '3d'; @@ -139,6 +140,8 @@ public function getTypeAllowableValues() self::TYPE_STEP, self::TYPE_IGES, self::TYPE_OBJ, + self::TYPE_IFC, + ]; } @@ -184,9 +187,9 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalid_properties[] = "'type' can't be null"; } - $allowed_values = ["svf", "thumbnail", "stl", "step", "iges", "obj"]; + $allowed_values = ["svf", "thumbnail", "stl", "step", "iges", "obj", "ifc"]; if (!in_array($this->container['type'], $allowed_values)) { - $invalid_properties[] = "invalid value for 'type', must be one of 'svf', 'thumbnail', 'stl', 'step', 'iges', 'obj'."; + $invalid_properties[] = "invalid value for 'type', must be one of 'svf', 'thumbnail', 'stl', 'step', 'iges', 'obj', 'ifc'."; } return $invalid_properties; @@ -204,7 +207,7 @@ public function valid() if ($this->container['type'] === null) { return false; } - $allowed_values = ["svf", "thumbnail", "stl", "step", "iges", "obj"]; + $allowed_values = ["svf", "thumbnail", "stl", "step", "iges", "obj", "ifc"]; if (!in_array($this->container['type'], $allowed_values)) { return false; } @@ -223,14 +226,14 @@ public function getType() /** * Sets type - * @param string $type The requested output types. Possible values include `svf`, `thumbnai`, `stl`, `step`, `iges`, or `obj`. For a list of supported types, call the [GET formats](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/formats-GET) endpoint. + * @param string $type The requested output types. Possible values include `svf`, `thumbnai`, `stl`, `step`, `iges`, 'ifc', or `obj`. For a list of supported types, call the [GET formats](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/formats-GET) endpoint. * @return $this */ public function setType($type) { - $allowed_values = array('svf', 'thumbnail', 'stl', 'step', 'iges', 'obj'); + $allowed_values = array('svf', 'thumbnail', 'stl', 'step', 'iges', 'obj', 'ifc'); if ((!in_array($type, $allowed_values))) { - throw new \InvalidArgumentException("Invalid value for 'type', must be one of 'svf', 'thumbnail', 'stl', 'step', 'iges', 'obj'"); + throw new \InvalidArgumentException("Invalid value for 'type', must be one of 'svf', 'thumbnail', 'stl', 'step', 'iges', 'obj','ifc' "); } $this->container['type'] = $type;