Creates a secret gist with the parameters provided. Optional parameter to make it public.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let func = | |
(Description as text, FunctionName as text, Content as text, AccessToken as text, optional public as any) => | |
let | |
Public = if public = null then false else true, | |
GitRecord = [description=Description, public=Public, files=Record.FromTable(#table({"Name", "Value"}, {{FunctionName, [content=Content]}}))], | |
URL = "https://api.github.com/gists?access_token=" & AccessToken, | |
BinaryJson = Json.FromValue(GitRecord), | |
Web= Json.Document(Web.Contents(URL, [#"Headers"=[#"Content-type"="application/json", access_token= AccessToken], Content=BinaryJson])) | |
in | |
Web , | |
documentation = [ | |
Documentation.Name = " Export.CreateGist.pq ", | |
Documentation.Description = " Creates a secret gist with the parameters provided. Optional parameter to make it public. ", | |
Documentation.LongDescription = " Creates a secret gist with the parameters provided. Optional parameter to make it public. ", | |
Documentation.Category = " Other ", | |
Documentation.Source = " Imke Feldmann: www.TheBIccountant.com. ", | |
Documentation.Version = " 1.0 ", | |
Documentation.Author = " Imke Feldmann: www.TheBIccountant.com. For details see: https://www.thebiccountant.com/2019/01/13/writing-data-to-github-using-power-query-only/ . ", | |
Documentation.Examples = {[Description = " For details see: https://www.thebiccountant.com/2019/01/13/writing-data-to-github-using-power-query-only/. ", | |
Code = " ", | |
Result = " "]}] | |
in | |
Value.ReplaceType(func, Value.ReplaceMetadata(Value.Type(func), documentation)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment