Example #1
0
        VirtualMachineScaleSetVMExtension IOperationSource <VirtualMachineScaleSetVMExtension> .CreateResult(Response response, CancellationToken cancellationToken)
        {
            using var document = JsonDocument.Parse(response.ContentStream);
            var data = VirtualMachineScaleSetVMExtensionData.DeserializeVirtualMachineScaleSetVMExtensionData(document.RootElement);

            return(new VirtualMachineScaleSetVMExtension(_operationBase, data));
        }
        internal static VirtualMachineScaleSetVMExtensionsListResult DeserializeVirtualMachineScaleSetVMExtensionsListResult(JsonElement element)
        {
            Optional <IReadOnlyList <VirtualMachineScaleSetVMExtensionData> > value = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("value"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    List <VirtualMachineScaleSetVMExtensionData> array = new List <VirtualMachineScaleSetVMExtensionData>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(VirtualMachineScaleSetVMExtensionData.DeserializeVirtualMachineScaleSetVMExtensionData(item));
                    }
                    value = array;
                    continue;
                }
            }
            return(new VirtualMachineScaleSetVMExtensionsListResult(Optional.ToList(value)));
        }