// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.scvmm.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Defines the resource properties. */
@Fluent
public final class VirtualMachineUpdateProperties {
    /*
     * Defines the resource properties.
     */
    @JsonProperty(value = "hardwareProfile")
    private HardwareProfileUpdate hardwareProfile;

    /*
     * Defines the resource properties.
     */
    @JsonProperty(value = "storageProfile")
    private StorageProfileUpdate storageProfile;

    /*
     * Defines the resource properties.
     */
    @JsonProperty(value = "networkProfile")
    private NetworkProfileUpdate networkProfile;

    /*
     * Availability Sets in vm.
     */
    @JsonProperty(value = "availabilitySets")
    private List<AvailabilitySetListItem> availabilitySets;

    /**
     * Get the hardwareProfile property: Defines the resource properties.
     *
     * @return the hardwareProfile value.
     */
    public HardwareProfileUpdate hardwareProfile() {
        return this.hardwareProfile;
    }

    /**
     * Set the hardwareProfile property: Defines the resource properties.
     *
     * @param hardwareProfile the hardwareProfile value to set.
     * @return the VirtualMachineUpdateProperties object itself.
     */
    public VirtualMachineUpdateProperties withHardwareProfile(HardwareProfileUpdate hardwareProfile) {
        this.hardwareProfile = hardwareProfile;
        return this;
    }

    /**
     * Get the storageProfile property: Defines the resource properties.
     *
     * @return the storageProfile value.
     */
    public StorageProfileUpdate storageProfile() {
        return this.storageProfile;
    }

    /**
     * Set the storageProfile property: Defines the resource properties.
     *
     * @param storageProfile the storageProfile value to set.
     * @return the VirtualMachineUpdateProperties object itself.
     */
    public VirtualMachineUpdateProperties withStorageProfile(StorageProfileUpdate storageProfile) {
        this.storageProfile = storageProfile;
        return this;
    }

    /**
     * Get the networkProfile property: Defines the resource properties.
     *
     * @return the networkProfile value.
     */
    public NetworkProfileUpdate networkProfile() {
        return this.networkProfile;
    }

    /**
     * Set the networkProfile property: Defines the resource properties.
     *
     * @param networkProfile the networkProfile value to set.
     * @return the VirtualMachineUpdateProperties object itself.
     */
    public VirtualMachineUpdateProperties withNetworkProfile(NetworkProfileUpdate networkProfile) {
        this.networkProfile = networkProfile;
        return this;
    }

    /**
     * Get the availabilitySets property: Availability Sets in vm.
     *
     * @return the availabilitySets value.
     */
    public List<AvailabilitySetListItem> availabilitySets() {
        return this.availabilitySets;
    }

    /**
     * Set the availabilitySets property: Availability Sets in vm.
     *
     * @param availabilitySets the availabilitySets value to set.
     * @return the VirtualMachineUpdateProperties object itself.
     */
    public VirtualMachineUpdateProperties withAvailabilitySets(List<AvailabilitySetListItem> availabilitySets) {
        this.availabilitySets = availabilitySets;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (hardwareProfile() != null) {
            hardwareProfile().validate();
        }
        if (storageProfile() != null) {
            storageProfile().validate();
        }
        if (networkProfile() != null) {
            networkProfile().validate();
        }
        if (availabilitySets() != null) {
            availabilitySets().forEach(e -> e.validate());
        }
    }
}
