コード例 #1
0
        internal static AppliedReservations DeserializeAppliedReservations(JsonElement element)
        {
            ResourceIdentifier id         = default;
            string             name       = default;
            ResourceType       type       = default;
            SystemData         systemData = default;
            Optional <AppliedReservationList> reservationOrderIds = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = new ResourceType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("reservationOrderIds"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            reservationOrderIds = AppliedReservationList.DeserializeAppliedReservationList(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new AppliedReservations(id, name, type, systemData, reservationOrderIds.Value));
        }
コード例 #2
0
 internal AppliedReservations(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AppliedReservationList reservationOrderIds) : base(id, name, resourceType, systemData)
 {
     ReservationOrderIds = reservationOrderIds;
 }