public static SiteConfigCredentials ParseJSON(JArray iJSON) { SiteConfigCredentials pACCCreds = new SiteConfigCredentials(); foreach (JObject curCredential in iJSON) { String pStrCredType = curCredential["CredentialType"].Value <String>(); switch (pStrCredType) { case "Amazon": { SiteConfigCredentialAmazon pACCAmazon = SiteConfigCredentialAmazon.ParseJSON(curCredential); pACCCreds.cOCnCredentials.Add(pACCAmazon); break; } default: { //Unknown credential type break; } } } return(pACCCreds); }
public static SiteConfigCredentialAmazon ParseJSON(JObject iJSON) { SiteConfigCredentialAmazon cACAAmazon = new SiteConfigCredentialAmazon(iJSON["Name"].Value <String>()); cACAAmazon.cStrAccessKeyID = iJSON["AccessKeyID"].Value <String>(); cACAAmazon.cStrSecretAccessKey = iJSON["SecretAccessKey"].Value <String>(); return(cACAAmazon); }