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

package com.azure.resourcemanager.connectedvmware.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.connectedvmware.models.HardwareProfile;
import com.azure.resourcemanager.connectedvmware.models.NetworkProfileUpdate;
import com.azure.resourcemanager.connectedvmware.models.OsProfileUpdate;
import com.azure.resourcemanager.connectedvmware.models.StorageProfileUpdate;
import com.fasterxml.jackson.annotation.JsonProperty;

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

    /*
     * OS properties.
     */
    @JsonProperty(value = "osProfile")
    private OsProfileUpdate osProfile;

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

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

    /**
     * Get the hardwareProfile property: Defines the resource properties.
     *
     * @return the hardwareProfile value.
     */
    public HardwareProfile 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(HardwareProfile hardwareProfile) {
        this.hardwareProfile = hardwareProfile;
        return this;
    }

    /**
     * Get the osProfile property: OS properties.
     *
     * @return the osProfile value.
     */
    public OsProfileUpdate osProfile() {
        return this.osProfile;
    }

    /**
     * Set the osProfile property: OS properties.
     *
     * @param osProfile the osProfile value to set.
     * @return the VirtualMachineUpdateProperties object itself.
     */
    public VirtualMachineUpdateProperties withOsProfile(OsProfileUpdate osProfile) {
        this.osProfile = osProfile;
        return this;
    }

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

    /**
     * Set the storageProfile property: Defines the resource update 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 update resource properties.
     *
     * @return the networkProfile value.
     */
    public NetworkProfileUpdate networkProfile() {
        return this.networkProfile;
    }

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

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