/// <summary> /// Parses the root node of a PhoneID JSON response and populates the /// data pacakges that are common to all PhoneID requests. The data /// common to all PhoneID responses is the numbering and cleansing /// information. /// </summary> /// <param name="response">The response object to populate.</param> /// <param name="node">The root node of the JSON response.</param> private void PopulateCommonPhoneIdResponseFields( CommonPhoneIdResponse response, JObject node) { JToken numberingNode = node["numbering"]; if (numberingNode == null) { response.OriginalNumber = new NumberingInfo(); response.CallCleansedNumber = new CleansingInfo(); response.SmsCleansedNumber = new CleansingInfo(); } else { response.OriginalNumber = this.ParseNumberingInfo((JObject)numberingNode["original"]); JObject cleansingNode = (JObject)numberingNode["cleansing"]; response.CallCleansedNumber = this.ParseCleansingInfo((JObject)cleansingNode["call"]); response.SmsCleansedNumber = this.ParseCleansingInfo((JObject)cleansingNode["sms"]); } }
/// <summary> /// Parses the root node of a PhoneID JSON response and populates the /// data pacakges that are common to all PhoneID requests. The data /// common to all PhoneID responses is the numbering and cleansing /// information. /// </summary> /// <param name="response">The response object to populate.</param> /// <param name="node">The root node of the JSON response.</param> private void PopulateCommonPhoneIdResponseFields( CommonPhoneIdResponse response, JObject node) { JToken numberingNode = node["numbering"]; if (numberingNode == null) { response.OriginalNumber = new NumberingInfo(); response.CallCleansedNumber = new CleansingInfo(); response.SmsCleansedNumber = new CleansingInfo(); } else { response.OriginalNumber = this.ParseNumberingInfo((JObject)numberingNode["original"]); JObject cleansingNode = (JObject)numberingNode["cleansing"]; response.CallCleansedNumber = this.ParseCleansingInfo((JObject)cleansingNode["call"]); response.SmsCleansedNumber = this.ParseCleansingInfo((JObject)cleansingNode["sms"]); } }