in src/AlibabaCloud.OSS.V2/Transform/Functions.cs [242:274]
public static void DeserializerAnyBody(ref Models.ResultModel result, ref OperationOutput output)
{
if (output.Body == null) return;
switch (result.BodyFormat)
{
case "xml":
{
using var body = output.Body;
if (result.BodyType == null)
{
throw new Exception("body type is null");
}
var serializer = new XmlSerializer(result.BodyType);
result.InnerBody = serializer.Deserialize(body);
}
break;
case "string":
{
using var body = output.Body;
var reader = new StreamReader(body);
result.InnerBody = reader.ReadToEnd();
}
break;
case "stream":
{
result.InnerBody = output.Body;
}
break;
}
}