DiskEncryptionSet IOperationSource <DiskEncryptionSet> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = DiskEncryptionSetData.DeserializeDiskEncryptionSetData(document.RootElement);

            return(new DiskEncryptionSet(_armClient, data));
        }
Esempio n. 2
0
        internal static DiskEncryptionSetList DeserializeDiskEncryptionSetList(JsonElement element)
        {
            IReadOnlyList <DiskEncryptionSetData> value = default;
            Optional <string> nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    List <DiskEncryptionSetData> array = new List <DiskEncryptionSetData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(DiskEncryptionSetData.DeserializeDiskEncryptionSetData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new DiskEncryptionSetList(value, nextLink.Value));
        }