Exemplo n.º 1
0
        private static async Task <int> ApiGetCommands(ApiGet apiOption)
        {
            AccountCommands acctCommands = new AccountCommands();
            var             account      = acctCommands.GetActiveAccount();
            ApiCommands     apiCommands  = new ApiCommands(account);

            if (apiOption.ListAllFiles)
            {
                await apiCommands.ListAllFiles(apiOption.ReturnJson);

                return(0);
            }
            else if (!string.IsNullOrWhiteSpace(apiOption.ListFilesFromDirectory))
            {
                await apiCommands.ListAllFiles(apiOption.ReturnJson, apiOption.ListFilesFromDirectory);

                return(0);
            }
            else if (apiOption.GetPersonalMetadata)
            {
                await apiCommands.GetSiteData(apiOption.ReturnJson);

                return(0);
            }
            else if (!string.IsNullOrWhiteSpace(apiOption.GetSiteMetadata))
            {
                await apiCommands.GetSiteData(apiOption.ReturnJson, apiOption.GetSiteMetadata);

                return(0);
            }
            else if (apiOption.GetApiKey)
            {
                await apiCommands.GetSiteKey(apiOption.ReturnJson);

                return(0);
            }

            return(1);
        }
Exemplo n.º 2
0
 public object OnApiGet(ApiEventArgs e)
 {
     return(ApiGet?.Invoke(this, e));
 }