Beispiel #1
0
 internal VirtualMachineScaleSetVmProfile(VirtualMachineScaleSetOSProfile osProfile, VirtualMachineScaleSetStorageProfile storageProfile, VirtualMachineScaleSetNetworkProfile networkProfile, SecurityProfile securityProfile, DiagnosticsProfile diagnosticsProfile, VirtualMachineScaleSetExtensionProfile extensionProfile, string licenseType, VirtualMachinePriorityTypes?priority, VirtualMachineEvictionPolicyTypes?evictionPolicy, BillingProfile billingProfile, ScheduledEventsProfile scheduledEventsProfile, string userData, CapacityReservationProfile capacityReservation, ApplicationProfile applicationProfile)
 {
     OsProfile              = osProfile;
     StorageProfile         = storageProfile;
     NetworkProfile         = networkProfile;
     SecurityProfile        = securityProfile;
     DiagnosticsProfile     = diagnosticsProfile;
     ExtensionProfile       = extensionProfile;
     LicenseType            = licenseType;
     Priority               = priority;
     EvictionPolicy         = evictionPolicy;
     BillingProfile         = billingProfile;
     ScheduledEventsProfile = scheduledEventsProfile;
     UserData               = userData;
     CapacityReservation    = capacityReservation;
     ApplicationProfile     = applicationProfile;
 }
        internal static VirtualMachineScaleSetVmProfile DeserializeVirtualMachineScaleSetVmProfile(JsonElement element)
        {
            Optional <VirtualMachineScaleSetOSProfile>      osProfile      = default;
            Optional <VirtualMachineScaleSetStorageProfile> storageProfile = default;
            Optional <VirtualMachineScaleSetNetworkProfile> networkProfile = default;
            Optional <SecurityProfile>    securityProfile    = default;
            Optional <DiagnosticsProfile> diagnosticsProfile = default;
            Optional <VirtualMachineScaleSetExtensionProfile> extensionProfile = default;
            Optional <string> licenseType = default;
            Optional <VirtualMachinePriorityTypes>       priority       = default;
            Optional <VirtualMachineEvictionPolicyTypes> evictionPolicy = default;
            Optional <BillingProfile>         billingProfile            = default;
            Optional <ScheduledEventsProfile> scheduledEventsProfile    = default;
            Optional <string> userData = default;
            Optional <CapacityReservationProfile> capacityReservation = default;
            Optional <ApplicationProfile>         applicationProfile  = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("osProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    osProfile = VirtualMachineScaleSetOSProfile.DeserializeVirtualMachineScaleSetOSProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("storageProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    storageProfile = VirtualMachineScaleSetStorageProfile.DeserializeVirtualMachineScaleSetStorageProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("networkProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    networkProfile = VirtualMachineScaleSetNetworkProfile.DeserializeVirtualMachineScaleSetNetworkProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("securityProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    securityProfile = SecurityProfile.DeserializeSecurityProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("diagnosticsProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    diagnosticsProfile = DiagnosticsProfile.DeserializeDiagnosticsProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("extensionProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    extensionProfile = VirtualMachineScaleSetExtensionProfile.DeserializeVirtualMachineScaleSetExtensionProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("licenseType"))
                {
                    licenseType = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("priority"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    priority = new VirtualMachinePriorityTypes(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("evictionPolicy"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    evictionPolicy = new VirtualMachineEvictionPolicyTypes(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("billingProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    billingProfile = BillingProfile.DeserializeBillingProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("scheduledEventsProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    scheduledEventsProfile = ScheduledEventsProfile.DeserializeScheduledEventsProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("userData"))
                {
                    userData = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("capacityReservation"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    capacityReservation = CapacityReservationProfile.DeserializeCapacityReservationProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("applicationProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    applicationProfile = ApplicationProfile.DeserializeApplicationProfile(property.Value);
                    continue;
                }
            }
            return(new VirtualMachineScaleSetVmProfile(osProfile.Value, storageProfile.Value, networkProfile.Value, securityProfile.Value, diagnosticsProfile.Value, extensionProfile.Value, licenseType.Value, Optional.ToNullable(priority), Optional.ToNullable(evictionPolicy), billingProfile.Value, scheduledEventsProfile.Value, userData.Value, capacityReservation.Value, applicationProfile.Value));
        }
Beispiel #3
0
        internal static VirtualMachineScaleSetVMProfile DeserializeVirtualMachineScaleSetVMProfile(JsonElement element)
        {
            Optional <VirtualMachineScaleSetOSProfile>      osProfile      = default;
            Optional <VirtualMachineScaleSetStorageProfile> storageProfile = default;
            Optional <VirtualMachineScaleSetNetworkProfile> networkProfile = default;
            Optional <DiagnosticsProfile> diagnosticsProfile = default;
            Optional <VirtualMachineScaleSetExtensionProfile> extensionProfile = default;
            Optional <string> licenseType = default;
            Optional <VirtualMachinePriorityTypes>       priority       = default;
            Optional <VirtualMachineEvictionPolicyTypes> evictionPolicy = default;
            Optional <BillingProfile>         billingProfile            = default;
            Optional <ScheduledEventsProfile> scheduledEventsProfile    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("osProfile"))
                {
                    osProfile = VirtualMachineScaleSetOSProfile.DeserializeVirtualMachineScaleSetOSProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("storageProfile"))
                {
                    storageProfile = VirtualMachineScaleSetStorageProfile.DeserializeVirtualMachineScaleSetStorageProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("networkProfile"))
                {
                    networkProfile = VirtualMachineScaleSetNetworkProfile.DeserializeVirtualMachineScaleSetNetworkProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("diagnosticsProfile"))
                {
                    diagnosticsProfile = DiagnosticsProfile.DeserializeDiagnosticsProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("extensionProfile"))
                {
                    extensionProfile = VirtualMachineScaleSetExtensionProfile.DeserializeVirtualMachineScaleSetExtensionProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("licenseType"))
                {
                    licenseType = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("priority"))
                {
                    priority = new VirtualMachinePriorityTypes(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("evictionPolicy"))
                {
                    evictionPolicy = new VirtualMachineEvictionPolicyTypes(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("billingProfile"))
                {
                    billingProfile = BillingProfile.DeserializeBillingProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("scheduledEventsProfile"))
                {
                    scheduledEventsProfile = ScheduledEventsProfile.DeserializeScheduledEventsProfile(property.Value);
                    continue;
                }
            }
            return(new VirtualMachineScaleSetVMProfile(osProfile.Value, storageProfile.Value, networkProfile.Value, diagnosticsProfile.Value, extensionProfile.Value, licenseType.Value, Optional.ToNullable(priority), Optional.ToNullable(evictionPolicy), billingProfile.Value, scheduledEventsProfile.Value));
        }
        internal static VirtualMachineScaleSetVMProfile DeserializeVirtualMachineScaleSetVMProfile(JsonElement element)
        {
            VirtualMachineScaleSetOSProfile      osProfile      = default;
            VirtualMachineScaleSetStorageProfile storageProfile = default;
            VirtualMachineScaleSetNetworkProfile networkProfile = default;
            DiagnosticsProfile diagnosticsProfile = default;
            VirtualMachineScaleSetExtensionProfile extensionProfile = default;
            string licenseType = default;
            VirtualMachinePriorityTypes?      priority       = default;
            VirtualMachineEvictionPolicyTypes?evictionPolicy = default;
            BillingProfile         billingProfile            = default;
            ScheduledEventsProfile scheduledEventsProfile    = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("osProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    osProfile = VirtualMachineScaleSetOSProfile.DeserializeVirtualMachineScaleSetOSProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("storageProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    storageProfile = VirtualMachineScaleSetStorageProfile.DeserializeVirtualMachineScaleSetStorageProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("networkProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    networkProfile = VirtualMachineScaleSetNetworkProfile.DeserializeVirtualMachineScaleSetNetworkProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("diagnosticsProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    diagnosticsProfile = DiagnosticsProfile.DeserializeDiagnosticsProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("extensionProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    extensionProfile = VirtualMachineScaleSetExtensionProfile.DeserializeVirtualMachineScaleSetExtensionProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("licenseType"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    licenseType = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("priority"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    priority = new VirtualMachinePriorityTypes(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("evictionPolicy"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    evictionPolicy = new VirtualMachineEvictionPolicyTypes(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("billingProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    billingProfile = BillingProfile.DeserializeBillingProfile(property.Value);
                    continue;
                }
                if (property.NameEquals("scheduledEventsProfile"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    scheduledEventsProfile = ScheduledEventsProfile.DeserializeScheduledEventsProfile(property.Value);
                    continue;
                }
            }
            return(new VirtualMachineScaleSetVMProfile(osProfile, storageProfile, networkProfile, diagnosticsProfile, extensionProfile, licenseType, priority, evictionPolicy, billingProfile, scheduledEventsProfile));
        }