Esempio n. 1
0
 internal ExportSummaryResource(string id, string name, string type, ExportSummary properties, SystemData systemData)
 {
     Id         = id;
     Name       = name;
     Type       = type;
     Properties = properties;
     SystemData = systemData;
 }
Esempio n. 2
0
        internal ExportSummaryResource(ExportSummary properties)
        {
            if (properties == null)
            {
                throw new ArgumentNullException(nameof(properties));
            }

            Properties = properties;
        }
Esempio n. 3
0
        internal static ExportSummaryResource DeserializeExportSummaryResource(JsonElement element)
        {
            Optional <string>     id         = default;
            Optional <string>     name       = default;
            Optional <string>     type       = default;
            ExportSummary         properties = default;
            Optional <SystemData> systemData = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    properties = ExportSummary.DeserializeExportSummary(property.Value);
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    systemData = SystemData.DeserializeSystemData(property.Value);
                    continue;
                }
            }
            return(new ExportSummaryResource(id.Value, name.Value, type.Value, properties, systemData.Value));
        }