internal VaultData(ResourceIdentifier id, string name, ResourceType type, string location, IReadOnlyDictionary <string, string> tags, Models.SystemData systemData, VaultProperties properties) : base(id, name, type)
 {
     Location   = location;
     Tags       = tags;
     SystemData = systemData;
     Properties = properties;
 }
Exemple #2
0
        internal static ManagedHsmResource DeserializeManagedHsmResource(JsonElement element)
        {
            Optional <ManagedHsmSku>     sku        = default;
            Optional <SystemData>        systemData = default;
            IDictionary <string, string> tags       = default;
            Location           location             = default;
            ResourceIdentifier id   = default;
            string             name = default;
            ResourceType       type = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("sku"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sku = ManagedHsmSku.DeserializeManagedHsmSku(property.Value);
                    continue;
                }
                if (property.NameEquals("systemData"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    systemData = SystemData.DeserializeSystemData(property.Value);
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                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;
                }
            }
            return(new ManagedHsmResource(id, name, type, tags, location, sku.Value, systemData.Value));
        }