@@ -16,11 +16,11 @@ namespace Microsoft\Graph\Model;
1616<#
1717if (entity.Name.ToCheckedCase() == "Entity") {
1818#>
19- class <#=entity.Name.ToCheckedCase()#>
19+ class <#=entity.Name.ToCheckedCase()#> implements \JsonSerializable
2020<#
2121} else {
2222#>
23- class <#=entity.Name.ToCheckedCase()#> extends Entity
23+ class <#=entity.Name.ToCheckedCase()#> extends <#=entity.Base.Name.ToCheckedCase() #>
2424<#
2525}
2626#>
@@ -45,9 +45,7 @@ if (entity.Name.ToCheckedCase() == "Entity") {
4545 {
4646 $this->_propDict = $propDict;
4747 }
48- <#
49- }
50- #>
48+
5149 /**
5250 * Gets the property dictionary of the <#=entity.Name.ToUpperFirstChar()#>
5351 *
@@ -57,19 +55,20 @@ if (entity.Name.ToCheckedCase() == "Entity") {
5755 {
5856 return $this->_propDict;
5957 }
60- <#
58+
59+ <#
60+ }
6161foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString() != "bytes")){
6262 var propertyName = property.Name.ToUnderscore();
6363 var propertyNameCap = property.Name.ToUpperFirstChar();
6464 if (property.Type.IsComplex()) {
6565 if (property.IsCollection()) {
6666#>
67-
68- /**
69- * Gets the <#=property.Name#>
70- *
71- * @return array The <#=property.Name#>
72- */
67+ /**
68+ * Gets the <#=property.Name#>
69+ *
70+ * @return array The <#=property.Name#>
71+ */
7372 public function get<#=property.Name.ToCheckedCase()#>()
7473 {
7574 if (array_key_exists("<#=property.Name.ToCamelize()#>", $this->_propDict)) {
@@ -78,7 +77,7 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
7877 return null;
7978 }
8079 }
81-
80+
8281 /**
8382 * Sets the <#=property.Name#>
8483 *
@@ -91,11 +90,10 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
9190 $this->_propDict["<#=property.Name.ToCamelize()#>"] = $val;
9291 return $this;
9392 }
94-
93+
9594<#
9695 } else {
9796#>
98-
9997 /**
10098 * Gets the <#=property.Name#>
10199 *
@@ -107,13 +105,18 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
107105 if (is_a($this->_propDict["<#=property.Name.ToCamelize()#>"], "<#=property.Type.GetTypeString()#>")) {
108106 return $this->_propDict["<#=property.Name.ToCamelize()#>"];
109107 } else {
108+ <# if (property.Type.GetTypeString() == "\\GuzzleHttp\\Psr7\\Stream") { #>
109+ $this->_propDict["<#=property.Name.ToCamelize()#>"] = \GuzzleHttp\Psr7\stream_for($this->_propDict["<#=property.Name.ToCamelize()#>"]);
110+ return $this->_propDict["<#=property.Name.ToCamelize()#>"];
111+ <# } else { #>
110112 $this->_propDict["<#=property.Name.ToCamelize()#>"] = new <#=property.Type.GetTypeString()#>($this->_propDict["<#=property.Name.ToCamelize()#>"]);
111113 return $this->_propDict["<#=property.Name.ToCamelize()#>"];
114+ <# } #>
112115 }
113116 }
114117 return null;
115118 }
116-
119+
117120 /**
118121 * Sets the <#=property.Name#>
119122 *
@@ -132,11 +135,11 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
132135<# } #>
133136 return $this;
134137 }
138+
135139<#
136140 }
137141 } else {
138142#>
139-
140143 /**
141144 * Gets the <#=property.Name#>
142145 *
@@ -160,7 +163,7 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
160163 return null;
161164 }
162165 }
163-
166+
164167 /**
165168 * Sets the <#=property.Name#>
166169 *
@@ -190,8 +193,44 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
190193#>
191194 return $this;
192195 }
196+
193197<#
194198 }
195199 }
200+ if (entity.Name.ToCheckedCase() == "Entity") {
201+ #>
202+ /**
203+ * Gets the ODataType
204+ *
205+ * @return string The ODataType
206+ */
207+ public function getODataType()
208+ {
209+ return $this->_propDict["@odata.type"];
210+ }
211+
212+ /**
213+ * Sets the ODataType
214+ *
215+ * @param string The ODataType
216+ *
217+ * @return Entity
218+ */
219+ public function setODataType($val)
220+ {
221+ $this->_propDict["@odata.type"] = $val;
222+ }
223+
224+ /**
225+ * Serializes the object by property array
226+ *
227+ * @return array The list of properties
228+ */
229+ public function jsonSerialize()
230+ {
231+ return $this->getProperties();
232+ }
233+ <#
234+ }
196235#>
197236}
0 commit comments