Imports System.Net.Http Imports ModpackUpdater.Model Imports Newtonsoft.Json Public Class UpdateConfigExt ' 'Public Sub SaveToSnippet(config As UpdateConfig, gitlabUrl As String, gitlabToken As String, projectId As Integer, snippetId As Integer, snippetFilePath As String) ' Dim client As New GitLabClient(gitlabUrl, gitlabToken) ' Dim update As New SnippetProjectUpdate With { ' .Visibility = VisibilityLevel.Public, ' .ProjectId = projectId, ' .SnippetId = snippetId, ' .Files = { ' New SnippetUpdateFile With { ' .Action = SnippetUpdateFileAction.Update.Create, ' .FilePath = snippetFilePath, ' .Content = JsonConvert.SerializeObject(config) ' } ' } ' } ' client.Snippets.Update(update) 'End Sub Public Shared Function LoadFromSnippet(url As String) As UpdateConfig Dim client As New HttpClient Dim result = client.GetStringAsync(url).Result Return JsonConvert.DeserializeObject(Of UpdateConfig)(result) End Function End Class