Example #1
0
        internal static StorageAccountListKeysResult DeserializeStorageAccountListKeysResult(JsonElement element)
        {
            IReadOnlyList <StorageAccountKey> keys = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("keys"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    List <StorageAccountKey> array = new List <StorageAccountKey>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        if (item.ValueKind == JsonValueKind.Null)
                        {
                            array.Add(null);
                        }
                        else
                        {
                            array.Add(StorageAccountKey.DeserializeStorageAccountKey(item));
                        }
                    }
                    keys = array;
                    continue;
                }
            }
            return(new StorageAccountListKeysResult(keys));
        }
        internal static StorageAccountListKeysResult DeserializeStorageAccountListKeysResult(JsonElement element)
        {
            Optional <IReadOnlyList <StorageAccountKey> > keys = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("keys"))
                {
                    List <StorageAccountKey> array = new List <StorageAccountKey>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(StorageAccountKey.DeserializeStorageAccountKey(item));
                    }
                    keys = array;
                    continue;
                }
            }
            return(new StorageAccountListKeysResult(Optional.ToList(keys)));
        }