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

package com.azure.resourcemanager.recoveryservicessiterecovery.models;

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

/** vCenter properties. */
@Fluent
public final class VCenterProperties {
    /*
     * Friendly name of the vCenter.
     */
    @JsonProperty(value = "friendlyName")
    private String friendlyName;

    /*
     * VCenter internal ID.
     */
    @JsonProperty(value = "internalId")
    private String internalId;

    /*
     * The time when the last heartbeat was received by vCenter.
     */
    @JsonProperty(value = "lastHeartbeat")
    private OffsetDateTime lastHeartbeat;

    /*
     * The VCenter discovery status.
     */
    @JsonProperty(value = "discoveryStatus")
    private String discoveryStatus;

    /*
     * The process server Id.
     */
    @JsonProperty(value = "processServerId")
    private String processServerId;

    /*
     * The IP address of the vCenter.
     */
    @JsonProperty(value = "ipAddress")
    private String ipAddress;

    /*
     * The infrastructure Id of vCenter.
     */
    @JsonProperty(value = "infrastructureId")
    private String infrastructureId;

    /*
     * The port number for discovery.
     */
    @JsonProperty(value = "port")
    private String port;

    /*
     * The account Id which has privileges to discover the vCenter.
     */
    @JsonProperty(value = "runAsAccountId")
    private String runAsAccountId;

    /*
     * The ARM resource name of the fabric containing this VCenter.
     */
    @JsonProperty(value = "fabricArmResourceName")
    private String fabricArmResourceName;

    /*
     * The health errors for this VCenter.
     */
    @JsonProperty(value = "healthErrors")
    private List<HealthError> healthErrors;

    /** Creates an instance of VCenterProperties class. */
    public VCenterProperties() {
    }

    /**
     * Get the friendlyName property: Friendly name of the vCenter.
     *
     * @return the friendlyName value.
     */
    public String friendlyName() {
        return this.friendlyName;
    }

    /**
     * Set the friendlyName property: Friendly name of the vCenter.
     *
     * @param friendlyName the friendlyName value to set.
     * @return the VCenterProperties object itself.
     */
    public VCenterProperties withFriendlyName(String friendlyName) {
        this.friendlyName = friendlyName;
        return this;
    }

    /**
     * Get the internalId property: VCenter internal ID.
     *
     * @return the internalId value.
     */
    public String internalId() {
        return this.internalId;
    }

    /**
     * Set the internalId property: VCenter internal ID.
     *
     * @param internalId the internalId value to set.
     * @return the VCenterProperties object itself.
     */
    public VCenterProperties withInternalId(String internalId) {
        this.internalId = internalId;
        return this;
    }

    /**
     * Get the lastHeartbeat property: The time when the last heartbeat was received by vCenter.
     *
     * @return the lastHeartbeat value.
     */
    public OffsetDateTime lastHeartbeat() {
        return this.lastHeartbeat;
    }

    /**
     * Set the lastHeartbeat property: The time when the last heartbeat was received by vCenter.
     *
     * @param lastHeartbeat the lastHeartbeat value to set.
     * @return the VCenterProperties object itself.
     */
    public VCenterProperties withLastHeartbeat(OffsetDateTime lastHeartbeat) {
        this.lastHeartbeat = lastHeartbeat;
        return this;
    }

    /**
     * Get the discoveryStatus property: The VCenter discovery status.
     *
     * @return the discoveryStatus value.
     */
    public String discoveryStatus() {
        return this.discoveryStatus;
    }

    /**
     * Set the discoveryStatus property: The VCenter discovery status.
     *
     * @param discoveryStatus the discoveryStatus value to set.
     * @return the VCenterProperties object itself.
     */
    public VCenterProperties withDiscoveryStatus(String discoveryStatus) {
        this.discoveryStatus = discoveryStatus;
        return this;
    }

    /**
     * Get the processServerId property: The process server Id.
     *
     * @return the processServerId value.
     */
    public String processServerId() {
        return this.processServerId;
    }

    /**
     * Set the processServerId property: The process server Id.
     *
     * @param processServerId the processServerId value to set.
     * @return the VCenterProperties object itself.
     */
    public VCenterProperties withProcessServerId(String processServerId) {
        this.processServerId = processServerId;
        return this;
    }

    /**
     * Get the ipAddress property: The IP address of the vCenter.
     *
     * @return the ipAddress value.
     */
    public String ipAddress() {
        return this.ipAddress;
    }

    /**
     * Set the ipAddress property: The IP address of the vCenter.
     *
     * @param ipAddress the ipAddress value to set.
     * @return the VCenterProperties object itself.
     */
    public VCenterProperties withIpAddress(String ipAddress) {
        this.ipAddress = ipAddress;
        return this;
    }

    /**
     * Get the infrastructureId property: The infrastructure Id of vCenter.
     *
     * @return the infrastructureId value.
     */
    public String infrastructureId() {
        return this.infrastructureId;
    }

    /**
     * Set the infrastructureId property: The infrastructure Id of vCenter.
     *
     * @param infrastructureId the infrastructureId value to set.
     * @return the VCenterProperties object itself.
     */
    public VCenterProperties withInfrastructureId(String infrastructureId) {
        this.infrastructureId = infrastructureId;
        return this;
    }

    /**
     * Get the port property: The port number for discovery.
     *
     * @return the port value.
     */
    public String port() {
        return this.port;
    }

    /**
     * Set the port property: The port number for discovery.
     *
     * @param port the port value to set.
     * @return the VCenterProperties object itself.
     */
    public VCenterProperties withPort(String port) {
        this.port = port;
        return this;
    }

    /**
     * Get the runAsAccountId property: The account Id which has privileges to discover the vCenter.
     *
     * @return the runAsAccountId value.
     */
    public String runAsAccountId() {
        return this.runAsAccountId;
    }

    /**
     * Set the runAsAccountId property: The account Id which has privileges to discover the vCenter.
     *
     * @param runAsAccountId the runAsAccountId value to set.
     * @return the VCenterProperties object itself.
     */
    public VCenterProperties withRunAsAccountId(String runAsAccountId) {
        this.runAsAccountId = runAsAccountId;
        return this;
    }

    /**
     * Get the fabricArmResourceName property: The ARM resource name of the fabric containing this VCenter.
     *
     * @return the fabricArmResourceName value.
     */
    public String fabricArmResourceName() {
        return this.fabricArmResourceName;
    }

    /**
     * Set the fabricArmResourceName property: The ARM resource name of the fabric containing this VCenter.
     *
     * @param fabricArmResourceName the fabricArmResourceName value to set.
     * @return the VCenterProperties object itself.
     */
    public VCenterProperties withFabricArmResourceName(String fabricArmResourceName) {
        this.fabricArmResourceName = fabricArmResourceName;
        return this;
    }

    /**
     * Get the healthErrors property: The health errors for this VCenter.
     *
     * @return the healthErrors value.
     */
    public List<HealthError> healthErrors() {
        return this.healthErrors;
    }

    /**
     * Set the healthErrors property: The health errors for this VCenter.
     *
     * @param healthErrors the healthErrors value to set.
     * @return the VCenterProperties object itself.
     */
    public VCenterProperties withHealthErrors(List<HealthError> healthErrors) {
        this.healthErrors = healthErrors;
        return this;
    }

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