Exemplo n.º 1
0
 public static async Task <LambdaResponse> Delete(DXUser user, string functionName)
 {
     return(await NetHelper.DELETE <LambdaResponse>(
                URL.Lambda.Main,
                NetHelper.PackData(
                    new Dictionary <string, string>()
     {
         { "email", user.Email },
         { "name", functionName }
     }),
                NetHelper.CreateFormDataHeader()));
 }
Exemplo n.º 2
0
        public static async Task <LambdaResponse> Deploy(DXUser user, string jsCode)
        {
            var result = ParseJS(jsCode);

            if (result.Succcess)
            {
                return(await NetHelper.POST <LambdaResponse>(
                           URL.Lambda.Main,
                           NetHelper.PackData(
                               new Dictionary <string, string>()
                {
                    { "email", user.Email },
                    { "name", result.FunctionName },
                    { "code", jsCode },
                    { "parameters", string.Join(",", result.Parameters) }
                }),
                           NetHelper.CreateFormDataHeader()));
            }

            return(new LambdaResponse("Failed", null, "Failed javascript parsing"));
        }