internal static ApiListResultApiUserAuthenticationKeyApiModel DeserializeApiListResultApiUserAuthenticationKeyApiModel(JsonElement element) { Optional <long> count = default; Optional <IReadOnlyList <ApiUserAuthenticationKeyApiModel> > 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 <ApiUserAuthenticationKeyApiModel> array = new List <ApiUserAuthenticationKeyApiModel>(); foreach (var item in property.Value.EnumerateArray()) { array.Add(ApiUserAuthenticationKeyApiModel.DeserializeApiUserAuthenticationKeyApiModel(item)); } data = array; continue; } if (property.NameEquals("totalCount")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } totalCount = property.Value.GetInt64(); continue; } } return(new ApiListResultApiUserAuthenticationKeyApiModel(Optional.ToNullable(count), Optional.ToList(data), Optional.ToNullable(totalCount))); }
internal static ApiResultApiUserAuthenticationKeyApiModel DeserializeApiResultApiUserAuthenticationKeyApiModel(JsonElement element) { Optional <ApiUserAuthenticationKeyApiModel> data = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("data")) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } data = ApiUserAuthenticationKeyApiModel.DeserializeApiUserAuthenticationKeyApiModel(property.Value); continue; } } return(new ApiResultApiUserAuthenticationKeyApiModel(data.Value)); }
internal static ApiListResultApiUserAuthenticationKeyApiModel DeserializeApiListResultApiUserAuthenticationKeyApiModel(XElement element) { long?count = default; long?totalCount = default; IReadOnlyList <ApiUserAuthenticationKeyApiModel> 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 <ApiUserAuthenticationKeyApiModel>(); foreach (var e in element.Elements("ApiUserAuthenticationKeyApiModel")) { array.Add(ApiUserAuthenticationKeyApiModel.DeserializeApiUserAuthenticationKeyApiModel(e)); } data = array; return(new ApiListResultApiUserAuthenticationKeyApiModel(count, data, totalCount)); }