Esempio n. 1
0
        internal static RestorableSqlContainer DeserializeRestorableSqlContainer(JsonElement element)
        {
            ResourceIdentifier id         = default;
            string             name       = default;
            ResourceType       type       = default;
            SystemData         systemData = default;
            Optional <RestorableSqlContainerPropertiesResource> resource = 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 = 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("resource"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            resource = RestorableSqlContainerPropertiesResource.DeserializeRestorableSqlContainerPropertiesResource(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new RestorableSqlContainer(id, name, type, systemData, resource.Value));
        }
Esempio n. 2
0
 internal RestorableSqlContainer(ResourceIdentifier id, string name, ResourceType type, RestorableSqlContainerPropertiesResource resource) : base(id, name, type)
 {
     Resource = resource;
 }
 internal RestorableSqlContainer(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, RestorableSqlContainerPropertiesResource resource) : base(id, name, resourceType, systemData)
 {
     Resource = resource;
 }