internal static VirtualMachineScaleSetVmListResult DeserializeVirtualMachineScaleSetVmListResult(JsonElement element)
        {
            IReadOnlyList <VirtualMachineScaleSetVmData> value = default;
            Optional <string> nextLink = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    List <VirtualMachineScaleSetVmData> array = new List <VirtualMachineScaleSetVmData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(VirtualMachineScaleSetVmData.DeserializeVirtualMachineScaleSetVmData(item));
                    }
                    value = array;
                    continue;
                }
                if (property.NameEquals("nextLink"))
                {
                    nextLink = property.Value.GetString();
                    continue;
                }
            }
            return(new VirtualMachineScaleSetVmListResult(value, nextLink.Value));
        }
Пример #2
0
        VirtualMachineScaleSetVm IOperationSource <VirtualMachineScaleSetVm> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = VirtualMachineScaleSetVmData.DeserializeVirtualMachineScaleSetVmData(document.RootElement);

            return(new VirtualMachineScaleSetVm(_armClient, data));
        }