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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.hardwaresecuritymodules.models.JsonWebKeyType;
import com.azure.resourcemanager.hardwaresecuritymodules.models.NetworkProfile;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Properties of the dedicated hsm. */
@Fluent
public final class DedicatedHsmProperties {
    /*
     * Specifies the network interfaces of the dedicated hsm.
     */
    @JsonProperty(value = "networkProfile")
    private NetworkProfile networkProfile;

    /*
     * Specifies the management network interfaces of the dedicated hsm.
     */
    @JsonProperty(value = "managementNetworkProfile")
    private NetworkProfile managementNetworkProfile;

    /*
     * This field will be used when RP does not support Availability zones.
     */
    @JsonProperty(value = "stampId")
    private String stampId;

    /*
     * Resource Status Message.
     */
    @JsonProperty(value = "statusMessage", access = JsonProperty.Access.WRITE_ONLY)
    private String statusMessage;

    /*
     * Provisioning state.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private JsonWebKeyType provisioningState;

    /**
     * Get the networkProfile property: Specifies the network interfaces of the dedicated hsm.
     *
     * @return the networkProfile value.
     */
    public NetworkProfile networkProfile() {
        return this.networkProfile;
    }

    /**
     * Set the networkProfile property: Specifies the network interfaces of the dedicated hsm.
     *
     * @param networkProfile the networkProfile value to set.
     * @return the DedicatedHsmProperties object itself.
     */
    public DedicatedHsmProperties withNetworkProfile(NetworkProfile networkProfile) {
        this.networkProfile = networkProfile;
        return this;
    }

    /**
     * Get the managementNetworkProfile property: Specifies the management network interfaces of the dedicated hsm.
     *
     * @return the managementNetworkProfile value.
     */
    public NetworkProfile managementNetworkProfile() {
        return this.managementNetworkProfile;
    }

    /**
     * Set the managementNetworkProfile property: Specifies the management network interfaces of the dedicated hsm.
     *
     * @param managementNetworkProfile the managementNetworkProfile value to set.
     * @return the DedicatedHsmProperties object itself.
     */
    public DedicatedHsmProperties withManagementNetworkProfile(NetworkProfile managementNetworkProfile) {
        this.managementNetworkProfile = managementNetworkProfile;
        return this;
    }

    /**
     * Get the stampId property: This field will be used when RP does not support Availability zones.
     *
     * @return the stampId value.
     */
    public String stampId() {
        return this.stampId;
    }

    /**
     * Set the stampId property: This field will be used when RP does not support Availability zones.
     *
     * @param stampId the stampId value to set.
     * @return the DedicatedHsmProperties object itself.
     */
    public DedicatedHsmProperties withStampId(String stampId) {
        this.stampId = stampId;
        return this;
    }

    /**
     * Get the statusMessage property: Resource Status Message.
     *
     * @return the statusMessage value.
     */
    public String statusMessage() {
        return this.statusMessage;
    }

    /**
     * Get the provisioningState property: Provisioning state.
     *
     * @return the provisioningState value.
     */
    public JsonWebKeyType provisioningState() {
        return this.provisioningState;
    }

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