in csharp/Microsoft.Azure.Databricks.Client/Converters/InitScriptInfoConverter.cs [14:51]
public override InitScriptInfo Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
var info = JsonNode.Parse(ref reader)!.AsObject();
if (info.TryGetPropertyValue("workspace", out var workspace))
{
return new InitScriptInfo
{
StorageDestination = workspace.Deserialize<WorkspaceStorageInfo>()
};
}
if (info.TryGetPropertyValue("dbfs", out var dbfs))
{
return new InitScriptInfo
{
StorageDestination = dbfs.Deserialize<DbfsStorageInfo>()
};
}
if (info.TryGetPropertyValue("abfss", out var abfss))
{
return new InitScriptInfo
{
StorageDestination = abfss.Deserialize<AbfssStorageInfo>()
};
}
if (info.TryGetPropertyValue("volumes", out var volumes))
{
return new InitScriptInfo
{
StorageDestination = volumes.Deserialize<VolumesStorageInfo>()
};
}
throw new NotSupportedException($"Storage destination not recognized: {info}");
}