@@ -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,7 +55,9 @@ 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();
@@ -82,7 +82,7 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
8282 return null;
8383 }
8484 }
85-
85+
8686 /**
8787 * Sets the <#=property.Name#>
8888<# if (property.LongDescription != null) {
@@ -99,11 +99,10 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
9999 $this->_propDict["<#=property.Name.ToCamelize()#>"] = $val;
100100 return $this;
101101 }
102-
102+
103103<#
104104 } else {
105105#>
106-
107106 /**
108107 * Gets the <#=property.Name#>
109108<# if (property.LongDescription != null) {
@@ -119,13 +118,18 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
119118 if (is_a($this->_propDict["<#=property.Name.ToCamelize()#>"], "<#=property.Type.GetTypeString()#>")) {
120119 return $this->_propDict["<#=property.Name.ToCamelize()#>"];
121120 } else {
121+ <# if (property.Type.GetTypeString() == "\\GuzzleHttp\\Psr7\\Stream") { #>
122+ $this->_propDict["<#=property.Name.ToCamelize()#>"] = \GuzzleHttp\Psr7\stream_for($this->_propDict["<#=property.Name.ToCamelize()#>"]);
123+ return $this->_propDict["<#=property.Name.ToCamelize()#>"];
124+ <# } else { #>
122125 $this->_propDict["<#=property.Name.ToCamelize()#>"] = new <#=property.Type.GetTypeString()#>($this->_propDict["<#=property.Name.ToCamelize()#>"]);
123126 return $this->_propDict["<#=property.Name.ToCamelize()#>"];
127+ <# } #>
124128 }
125129 }
126130 return null;
127131 }
128-
132+
129133 /**
130134 * Sets the <#=property.Name#>
131135<# if (property.LongDescription != null) {
@@ -148,11 +152,11 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
148152<# } #>
149153 return $this;
150154 }
155+
151156<#
152157 }
153158 } else {
154159#>
155-
156160 /**
157161 * Gets the <#=property.Name#>
158162<# if (property.LongDescription != null) {
@@ -180,7 +184,7 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
180184 return null;
181185 }
182186 }
183-
187+
184188 /**
185189 * Sets the <#=property.Name#>
186190<# if (property.LongDescription != null) {
@@ -214,8 +218,44 @@ foreach(var property in entity.Properties.Where(prop => prop.Type.GetTypeString(
214218#>
215219 return $this;
216220 }
221+
217222<#
218223 }
219224 }
225+ if (entity.Name.ToCheckedCase() == "Entity") {
226+ #>
227+ /**
228+ * Gets the ODataType
229+ *
230+ * @return string The ODataType
231+ */
232+ public function getODataType()
233+ {
234+ return $this->_propDict["@odata.type"];
235+ }
236+
237+ /**
238+ * Sets the ODataType
239+ *
240+ * @param string The ODataType
241+ *
242+ * @return Entity
243+ */
244+ public function setODataType($val)
245+ {
246+ $this->_propDict["@odata.type"] = $val;
247+ }
248+
249+ /**
250+ * Serializes the object by property array
251+ *
252+ * @return array The list of properties
253+ */
254+ public function jsonSerialize()
255+ {
256+ return $this->getProperties();
257+ }
258+ <#
259+ }
220260#>
221261}
0 commit comments