internal static ApiListResultInvoiceNumberingFormatApiModel DeserializeApiListResultInvoiceNumberingFormatApiModel(JsonElement element) { Optional <long> count = default; Optional <IReadOnlyList <InvoiceNumberingFormatApiModel> > data = default; Optional <long> totalCount = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("count")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } count = property.Value.GetInt64(); continue; } if (property.NameEquals("data")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } List <InvoiceNumberingFormatApiModel> array = new List <InvoiceNumberingFormatApiModel>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(InvoiceNumberingFormatApiModel.DeserializeInvoiceNumberingFormatApiModel(item)); } data = array; continue; } if (property.NameEquals("totalCount")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } totalCount = property.Value.GetInt64(); continue; } } return(new ApiListResultInvoiceNumberingFormatApiModel(Optional.ToNullable(count), Optional.ToList(data), Optional.ToNullable(totalCount))); }
internal static ApiResultInvoiceNumberingFormatApiModel DeserializeApiResultInvoiceNumberingFormatApiModel(JsonElement element) { Optional <InvoiceNumberingFormatApiModel> data = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("data")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } data = InvoiceNumberingFormatApiModel.DeserializeInvoiceNumberingFormatApiModel(property.Value); continue; } } return(new ApiResultInvoiceNumberingFormatApiModel(data.Value)); }
internal static ApiListResultInvoiceNumberingFormatApiModel DeserializeApiListResultInvoiceNumberingFormatApiModel(XElement element) { long?count = default; long?totalCount = default; IReadOnlyList <InvoiceNumberingFormatApiModel> data = default; if (element.Element("count") is XElement countElement) { count = (long?)countElement; } if (element.Element("totalCount") is XElement totalCountElement) { totalCount = (long?)totalCountElement; } var array = new List <InvoiceNumberingFormatApiModel>(); foreach (var e in element.Elements("InvoiceNumberingFormatApiModel")) { array.Add(InvoiceNumberingFormatApiModel.DeserializeInvoiceNumberingFormatApiModel(e)); } data = array; return(new ApiListResultInvoiceNumberingFormatApiModel(count, data, totalCount)); }