public static GetUserDataResponse CreateFromDictionary(Dictionary <string, object> jsonMap) { try { if (jsonMap == null) { return(null); } var request = new GetUserDataResponse(); if (jsonMap.ContainsKey("requestId")) { request.RequestId = (string)jsonMap["requestId"]; } if (jsonMap.ContainsKey("amazonUserData")) { request.AmazonUserData = AmazonUserData.CreateFromDictionary(jsonMap["amazonUserData"] as Dictionary <string, object>); } if (jsonMap.ContainsKey("status")) { request.Status = (string)jsonMap["status"]; } return(request); } catch (System.ApplicationException ex) { throw new AmazonException("Error encountered while creating Object from dicionary", ex); } }
public static AmazonUserData CreateFromDictionary(Dictionary <string, object> jsonMap) { try { if (jsonMap == null) { return(null); } var request = new AmazonUserData(); if (jsonMap.ContainsKey("userId")) { request.UserId = (string)jsonMap["userId"]; } if (jsonMap.ContainsKey("marketplace")) { request.Marketplace = (string)jsonMap["marketplace"]; } return(request); } catch (System.ApplicationException ex) { throw new AmazonException("Error encountered while creating Object from dicionary", ex); } }
public static AmazonUserData CreateFromDictionary(Dictionary<string, object> jsonMap) { try { if (jsonMap == null) { return null; } var request = new AmazonUserData(); if(jsonMap.ContainsKey("userId")) { request.UserId = (string) jsonMap["userId"]; } if(jsonMap.ContainsKey("marketplace")) { request.Marketplace = (string) jsonMap["marketplace"]; } return request; } catch (System.ApplicationException ex) { throw new AmazonException("Error encountered while creating Object from dicionary", ex); } }
public static Dictionary <string, AmazonUserData> MapFromJson(Dictionary <string, object> jsonMap) { Dictionary <string, AmazonUserData> result = new Dictionary <string, AmazonUserData>(); foreach (var entry in jsonMap) { AmazonUserData value = CreateFromDictionary(entry.Value as Dictionary <string, object>); result.Add(entry.Key, value); } return(result); }
public override Dictionary <string, object> GetObjectDictionary() { try { Dictionary <string, object> objectDictionary = new Dictionary <string, object>(); objectDictionary.Add("requestId", RequestId); objectDictionary.Add("amazonUserData", (AmazonUserData != null) ? AmazonUserData.GetObjectDictionary() : null); objectDictionary.Add("status", Status); return(objectDictionary); } catch (System.ApplicationException ex) { throw new AmazonException("Error encountered while getting object dictionary", ex); } }