|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * CreateItemDataAttributes |
| 4 | + * |
| 5 | + * PHP version 5 |
| 6 | + * |
| 7 | + * @category Class |
| 8 | + * @package Autodesk\Forge\Client |
| 9 | + * @author Swaagger Codegen team |
| 10 | + * @link https://github.com/swagger-api/swagger-codegen |
| 11 | + */ |
| 12 | + |
| 13 | +/** |
| 14 | + * Forge SDK |
| 15 | + * |
| 16 | + * The Forge Platform contains an expanding collection of web service components that can be used with Autodesk cloud-based products or your own technologies. Take advantage of Autodesk’s expertise in design and engineering. |
| 17 | + * |
| 18 | + * OpenAPI spec version: 0.1.0 |
| 19 | + |
| 20 | + * Generated by: https://github.com/swagger-api/swagger-codegen.git |
| 21 | + * |
| 22 | + */ |
| 23 | + |
| 24 | +/** |
| 25 | + * NOTE: This class is auto generated by the swagger code generator program. |
| 26 | + * https://github.com/swagger-api/swagger-codegen |
| 27 | + * Do not edit the class manually. |
| 28 | + */ |
| 29 | + |
| 30 | +namespace Autodesk\Forge\Client\Model; |
| 31 | + |
| 32 | +use \ArrayAccess; |
| 33 | + |
| 34 | +/** |
| 35 | + * CreateItemDataAttributes Class Doc Comment |
| 36 | + * |
| 37 | + * @category Class |
| 38 | + * @package Autodesk\Forge\Client |
| 39 | + * @author Swagger Codegen team |
| 40 | + * @link https://github.com/swagger-api/swagger-codegen |
| 41 | + */ |
| 42 | +class CreateItemDataAttributes implements ArrayAccess |
| 43 | +{ |
| 44 | + const DISCRIMINATOR = null; |
| 45 | + |
| 46 | + /** |
| 47 | + * The original name of the model. |
| 48 | + * @var string |
| 49 | + */ |
| 50 | + protected static $swaggerModelName = 'create_item_data_attributes'; |
| 51 | + |
| 52 | + /** |
| 53 | + * Array of property to type mappings. Used for (de)serialization |
| 54 | + * @var string[] |
| 55 | + */ |
| 56 | + protected static $swaggerTypes = [ |
| 57 | + 'display_name' => 'string', |
| 58 | + 'extension' => '\Autodesk\Forge\Client\Model\BaseAttributesExtensionObjectWithoutSchemaLink', |
| 59 | + ]; |
| 60 | + |
| 61 | + /** |
| 62 | + * @return \string[] |
| 63 | + */ |
| 64 | + public static function swaggerTypes() |
| 65 | + { |
| 66 | + return self::$swaggerTypes; |
| 67 | + } |
| 68 | + |
| 69 | + /** |
| 70 | + * Array of attributes where the key is the local name, and the value is the original name |
| 71 | + * @var string[] |
| 72 | + */ |
| 73 | + protected static $attributeMap = [ |
| 74 | + 'display_name' => 'displayName', |
| 75 | + 'extension' => 'extension', |
| 76 | + ]; |
| 77 | + |
| 78 | + |
| 79 | + /** |
| 80 | + * Array of attributes to setter functions (for deserialization of responses) |
| 81 | + * @var string[] |
| 82 | + */ |
| 83 | + protected static $setters = [ |
| 84 | + 'display_name' => 'setDisplayName', |
| 85 | + 'extension' => 'setExtension', |
| 86 | + ]; |
| 87 | + |
| 88 | + |
| 89 | + /** |
| 90 | + * Array of attributes to getter functions (for serialization of requests) |
| 91 | + * @var string[] |
| 92 | + */ |
| 93 | + protected static $getters = [ |
| 94 | + 'display_name' => 'getDisplayName', |
| 95 | + 'extension' => 'getExtension', |
| 96 | + ]; |
| 97 | + |
| 98 | + public static function attributeMap() |
| 99 | + { |
| 100 | + return self::$attributeMap; |
| 101 | + } |
| 102 | + |
| 103 | + public static function setters() |
| 104 | + { |
| 105 | + return self::$setters; |
| 106 | + } |
| 107 | + |
| 108 | + public static function getters() |
| 109 | + { |
| 110 | + return self::$getters; |
| 111 | + } |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + /** |
| 118 | + * Associative array for storing property values |
| 119 | + * @var mixed[] |
| 120 | + */ |
| 121 | + protected $container = []; |
| 122 | + |
| 123 | + /** |
| 124 | + * Constructor |
| 125 | + * @param mixed[] $data Associated array of property values initializing the model |
| 126 | + */ |
| 127 | + public function __construct(array $data = null) |
| 128 | + { |
| 129 | + $this->container['display_name'] = isset($data['display_name']) ? $data['display_name'] : null; |
| 130 | + $this->container['extension'] = isset($data['extension']) ? $data['extension'] : null; |
| 131 | + } |
| 132 | + |
| 133 | + /** |
| 134 | + * show all the invalid properties with reasons. |
| 135 | + * |
| 136 | + * @return array invalid properties with reasons |
| 137 | + */ |
| 138 | + public function listInvalidProperties() |
| 139 | + { |
| 140 | + $invalid_properties = []; |
| 141 | + |
| 142 | + if ($this->container['display_name'] === null) { |
| 143 | + $invalid_properties[] = "'display_name' can't be null"; |
| 144 | + } |
| 145 | + if (!preg_match("/^.+$/", $this->container['display_name'])) { |
| 146 | + $invalid_properties[] = "invalid value for 'display_name', must be conform to the pattern /^.+$/."; |
| 147 | + } |
| 148 | + |
| 149 | + if ($this->container['extension'] === null) { |
| 150 | + $invalid_properties[] = "'extension' can't be null"; |
| 151 | + } |
| 152 | + return $invalid_properties; |
| 153 | + } |
| 154 | + |
| 155 | + /** |
| 156 | + * validate all the properties in the model |
| 157 | + * return true if all passed |
| 158 | + * |
| 159 | + * @return bool True if all properties are valid |
| 160 | + */ |
| 161 | + public function valid() |
| 162 | + { |
| 163 | + |
| 164 | + if ($this->container['display_name'] === null) { |
| 165 | + return false; |
| 166 | + } |
| 167 | + if (!preg_match("/^.+$/", $this->container['display_name'])) { |
| 168 | + return false; |
| 169 | + } |
| 170 | + if ($this->container['extension'] === null) { |
| 171 | + return false; |
| 172 | + } |
| 173 | + return true; |
| 174 | + } |
| 175 | + |
| 176 | + |
| 177 | + /** |
| 178 | + * Gets display_name |
| 179 | + * @return string |
| 180 | + */ |
| 181 | + public function getDisplayName() |
| 182 | + { |
| 183 | + return $this->container['display_name']; |
| 184 | + } |
| 185 | + |
| 186 | + /** |
| 187 | + * Sets display_name |
| 188 | + * @param string $display_name |
| 189 | + * @return $this |
| 190 | + */ |
| 191 | + public function setDisplayName($display_name) |
| 192 | + { |
| 193 | + |
| 194 | + if ((!preg_match("/^.+$/", $display_name))) { |
| 195 | + throw new \InvalidArgumentException("invalid value for $display_name when calling CreateItemDataAttributes., must conform to the pattern /^.+$/."); |
| 196 | + } |
| 197 | + |
| 198 | + $this->container['display_name'] = $display_name; |
| 199 | + |
| 200 | + return $this; |
| 201 | + } |
| 202 | + |
| 203 | + /** |
| 204 | + * Gets extension |
| 205 | + * @return \Autodesk\Forge\Client\Model\BaseAttributesExtensionObjectWithoutSchemaLink |
| 206 | + */ |
| 207 | + public function getExtension() |
| 208 | + { |
| 209 | + return $this->container['extension']; |
| 210 | + } |
| 211 | + |
| 212 | + /** |
| 213 | + * Sets extension |
| 214 | + * @param \Autodesk\Forge\Client\Model\BaseAttributesExtensionObjectWithoutSchemaLink $extension |
| 215 | + * @return $this |
| 216 | + */ |
| 217 | + public function setExtension($extension) |
| 218 | + { |
| 219 | + $this->container['extension'] = $extension; |
| 220 | + |
| 221 | + return $this; |
| 222 | + } |
| 223 | + /** |
| 224 | + * Returns true if offset exists. False otherwise. |
| 225 | + * @param integer $offset Offset |
| 226 | + * @return boolean |
| 227 | + */ |
| 228 | + public function offsetExists($offset) |
| 229 | + { |
| 230 | + return isset($this->container[$offset]); |
| 231 | + } |
| 232 | + |
| 233 | + /** |
| 234 | + * Gets offset. |
| 235 | + * @param integer $offset Offset |
| 236 | + * @return mixed |
| 237 | + */ |
| 238 | + public function offsetGet($offset) |
| 239 | + { |
| 240 | + return isset($this->container[$offset]) ? $this->container[$offset] : null; |
| 241 | + } |
| 242 | + |
| 243 | + /** |
| 244 | + * Sets value based on offset. |
| 245 | + * @param integer $offset Offset |
| 246 | + * @param mixed $value Value to be set |
| 247 | + * @return void |
| 248 | + */ |
| 249 | + public function offsetSet($offset, $value) |
| 250 | + { |
| 251 | + if (is_null($offset)) { |
| 252 | + $this->container[] = $value; |
| 253 | + } else { |
| 254 | + $this->container[$offset] = $value; |
| 255 | + } |
| 256 | + } |
| 257 | + |
| 258 | + /** |
| 259 | + * Unsets offset. |
| 260 | + * @param integer $offset Offset |
| 261 | + * @return void |
| 262 | + */ |
| 263 | + public function offsetUnset($offset) |
| 264 | + { |
| 265 | + unset($this->container[$offset]); |
| 266 | + } |
| 267 | + |
| 268 | + /** |
| 269 | + * Gets the string presentation of the object |
| 270 | + * @return string |
| 271 | + */ |
| 272 | + public function __toString() |
| 273 | + { |
| 274 | + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print |
| 275 | + return json_encode(\Autodesk\Forge\Client\ObjectSerializer::sanitizeForSerialization($this), JSON_PRETTY_PRINT); |
| 276 | + } |
| 277 | + |
| 278 | + return json_encode(\Autodesk\Forge\Client\ObjectSerializer::sanitizeForSerialization($this)); |
| 279 | + } |
| 280 | +} |
| 281 | + |
| 282 | + |
0 commit comments