Esempio n. 1
0
 internal StorageAccountItem(string id, string resourceId, StorageAccountAttributes attributes, IReadOnlyDictionary <string, string> tags)
 {
     Id         = id;
     ResourceId = resourceId;
     Attributes = attributes;
     Tags       = tags;
 }
 internal StorageBundle(string id, string resourceId, string activeKeyName, bool?autoRegenerateKey, string regenerationPeriod, StorageAccountAttributes attributes, IReadOnlyDictionary <string, string> tags)
 {
     Id                 = id;
     ResourceId         = resourceId;
     ActiveKeyName      = activeKeyName;
     AutoRegenerateKey  = autoRegenerateKey;
     RegenerationPeriod = regenerationPeriod;
     Attributes         = attributes;
     Tags               = tags;
 }
        internal static DeletedStorageAccountItem DeserializeDeletedStorageAccountItem(JsonElement element)
        {
            Optional <string>                   recoveryId         = default;
            Optional <DateTimeOffset>           scheduledPurgeDate = default;
            Optional <DateTimeOffset>           deletedDate        = default;
            Optional <string>                   id                = default;
            Optional <string>                   resourceId        = default;
            Optional <StorageAccountAttributes> attributes        = default;
            Optional <IReadOnlyDictionary <string, string> > tags = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("recoveryId"))
                {
                    recoveryId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("scheduledPurgeDate"))
                {
                    scheduledPurgeDate = property.Value.GetDateTimeOffset("U");
                    continue;
                }
                if (property.NameEquals("deletedDate"))
                {
                    deletedDate = property.Value.GetDateTimeOffset("U");
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("resourceId"))
                {
                    resourceId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("attributes"))
                {
                    attributes = StorageAccountAttributes.DeserializeStorageAccountAttributes(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;
                }
            }
            return(new DeletedStorageAccountItem(id.Value, resourceId.Value, attributes.Value, Optional.ToDictionary(tags), recoveryId.Value, Optional.ToNullable(scheduledPurgeDate), Optional.ToNullable(deletedDate)));
        }
Esempio n. 4
0
        internal static StorageBundle DeserializeStorageBundle(JsonElement element)
        {
            Optional <string> id                                  = default;
            Optional <string> resourceId                          = default;
            Optional <string> activeKeyName                       = default;
            Optional <bool>   autoRegenerateKey                   = default;
            Optional <string> regenerationPeriod                  = default;
            Optional <StorageAccountAttributes> attributes        = default;
            Optional <IReadOnlyDictionary <string, string> > tags = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("resourceId"))
                {
                    resourceId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("activeKeyName"))
                {
                    activeKeyName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("autoRegenerateKey"))
                {
                    autoRegenerateKey = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("regenerationPeriod"))
                {
                    regenerationPeriod = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("attributes"))
                {
                    attributes = StorageAccountAttributes.DeserializeStorageAccountAttributes(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;
                }
            }
            return(new StorageBundle(id.Value, resourceId.Value, activeKeyName.Value, Optional.ToNullable(autoRegenerateKey), regenerationPeriod.Value, attributes.Value, Optional.ToDictionary(tags)));
        }
        internal static StorageAccountItem DeserializeStorageAccountItem(JsonElement element)
        {
            Optional <string> id         = default;
            Optional <string> resourceId = default;
            Optional <StorageAccountAttributes> attributes        = default;
            Optional <IReadOnlyDictionary <string, string> > tags = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("resourceId"))
                {
                    resourceId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("attributes"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    attributes = StorageAccountAttributes.DeserializeStorageAccountAttributes(property.Value);
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    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;
                }
            }
            return(new StorageAccountItem(id.Value, resourceId.Value, attributes.Value, Optional.ToDictionary(tags)));
        }
 internal DeletedStorageBundle(string id, string resourceId, string activeKeyName, bool?autoRegenerateKey, string regenerationPeriod, StorageAccountAttributes attributes, IReadOnlyDictionary <string, string> tags, string recoveryId, DateTimeOffset?scheduledPurgeDate, DateTimeOffset?deletedDate) : base(id, resourceId, activeKeyName, autoRegenerateKey, regenerationPeriod, attributes, tags)
 {
     RecoveryId         = recoveryId;
     ScheduledPurgeDate = scheduledPurgeDate;
     DeletedDate        = deletedDate;
 }
        internal static DeletedStorageBundle DeserializeDeletedStorageBundle(JsonElement element)
        {
            Optional <string>                   recoveryId         = default;
            Optional <DateTimeOffset>           scheduledPurgeDate = default;
            Optional <DateTimeOffset>           deletedDate        = default;
            Optional <string>                   id                 = default;
            Optional <string>                   resourceId         = default;
            Optional <string>                   activeKeyName      = default;
            Optional <bool>                     autoRegenerateKey  = default;
            Optional <string>                   regenerationPeriod = default;
            Optional <StorageAccountAttributes> attributes         = default;
            Optional <IReadOnlyDictionary <string, string> > tags  = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("recoveryId"))
                {
                    recoveryId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("scheduledPurgeDate"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    scheduledPurgeDate = property.Value.GetDateTimeOffset("U");
                    continue;
                }
                if (property.NameEquals("deletedDate"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    deletedDate = property.Value.GetDateTimeOffset("U");
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("resourceId"))
                {
                    resourceId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("activeKeyName"))
                {
                    activeKeyName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("autoRegenerateKey"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    autoRegenerateKey = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("regenerationPeriod"))
                {
                    regenerationPeriod = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("attributes"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    attributes = StorageAccountAttributes.DeserializeStorageAccountAttributes(property.Value);
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    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;
                }
            }
            return(new DeletedStorageBundle(id.Value, resourceId.Value, activeKeyName.Value, Optional.ToNullable(autoRegenerateKey), regenerationPeriod.Value, attributes.Value, Optional.ToDictionary(tags), recoveryId.Value, Optional.ToNullable(scheduledPurgeDate), Optional.ToNullable(deletedDate)));
        }
 internal DeletedStorageAccountItem(string id, string resourceId, StorageAccountAttributes attributes, IReadOnlyDictionary <string, string> tags, string recoveryId, DateTimeOffset?scheduledPurgeDate, DateTimeOffset?deletedDate) : base(id, resourceId, attributes, tags)
 {
     RecoveryId         = recoveryId;
     ScheduledPurgeDate = scheduledPurgeDate;
     DeletedDate        = deletedDate;
 }