// 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;

/** Details of the Process Server. */
@Fluent
public final class ProcessServer {
    /*
     * The Process Server's friendly name.
     */
    @JsonProperty(value = "friendlyName")
    private String friendlyName;

    /*
     * The Process Server Id.
     */
    @JsonProperty(value = "id")
    private String id;

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

    /*
     * The OS type of the server.
     */
    @JsonProperty(value = "osType")
    private String osType;

    /*
     * The version of the scout component on the server.
     */
    @JsonProperty(value = "agentVersion")
    private String agentVersion;

    /*
     * The last heartbeat received from the server.
     */
    @JsonProperty(value = "lastHeartbeat")
    private OffsetDateTime lastHeartbeat;

    /*
     * Version status.
     */
    @JsonProperty(value = "versionStatus")
    private String versionStatus;

    /*
     * The list of the mobility service updates available on the Process Server.
     */
    @JsonProperty(value = "mobilityServiceUpdates")
    private List<MobilityServiceUpdate> mobilityServiceUpdates;

    /*
     * The agent generated Id.
     */
    @JsonProperty(value = "hostId")
    private String hostId;

    /*
     * The servers configured with this PS.
     */
    @JsonProperty(value = "machineCount")
    private String machineCount;

    /*
     * The number of replication pairs configured in this PS.
     */
    @JsonProperty(value = "replicationPairCount")
    private String replicationPairCount;

    /*
     * The percentage of the system load.
     */
    @JsonProperty(value = "systemLoad")
    private String systemLoad;

    /*
     * The system load status.
     */
    @JsonProperty(value = "systemLoadStatus")
    private String systemLoadStatus;

    /*
     * The percentage of the CPU load.
     */
    @JsonProperty(value = "cpuLoad")
    private String cpuLoad;

    /*
     * The CPU load status.
     */
    @JsonProperty(value = "cpuLoadStatus")
    private String cpuLoadStatus;

    /*
     * The total memory.
     */
    @JsonProperty(value = "totalMemoryInBytes")
    private Long totalMemoryInBytes;

    /*
     * The available memory.
     */
    @JsonProperty(value = "availableMemoryInBytes")
    private Long availableMemoryInBytes;

    /*
     * The memory usage status.
     */
    @JsonProperty(value = "memoryUsageStatus")
    private String memoryUsageStatus;

    /*
     * The total space.
     */
    @JsonProperty(value = "totalSpaceInBytes")
    private Long totalSpaceInBytes;

    /*
     * The available space.
     */
    @JsonProperty(value = "availableSpaceInBytes")
    private Long availableSpaceInBytes;

    /*
     * The space usage status.
     */
    @JsonProperty(value = "spaceUsageStatus")
    private String spaceUsageStatus;

    /*
     * The PS service status.
     */
    @JsonProperty(value = "psServiceStatus")
    private String psServiceStatus;

    /*
     * The PS SSL cert expiry date.
     */
    @JsonProperty(value = "sslCertExpiryDate")
    private OffsetDateTime sslCertExpiryDate;

    /*
     * CS SSL cert expiry date.
     */
    @JsonProperty(value = "sslCertExpiryRemainingDays")
    private Integer sslCertExpiryRemainingDays;

    /*
     * OS Version of the process server. Note: This will get populated if user has CS version greater than 9.12.0.0.
     */
    @JsonProperty(value = "osVersion")
    private String osVersion;

    /*
     * Health errors.
     */
    @JsonProperty(value = "healthErrors")
    private List<HealthError> healthErrors;

    /*
     * Agent expiry date.
     */
    @JsonProperty(value = "agentExpiryDate")
    private OffsetDateTime agentExpiryDate;

    /*
     * The agent version details.
     */
    @JsonProperty(value = "agentVersionDetails")
    private VersionDetails agentVersionDetails;

    /*
     * The health of Process Server.
     */
    @JsonProperty(value = "health", access = JsonProperty.Access.WRITE_ONLY)
    private ProtectionHealth health;

    /*
     * The process server stats refresh time.
     */
    @JsonProperty(value = "psStatsRefreshTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime psStatsRefreshTime;

    /*
     * The uploading pending data in bytes.
     */
    @JsonProperty(value = "throughputUploadPendingDataInBytes", access = JsonProperty.Access.WRITE_ONLY)
    private Long throughputUploadPendingDataInBytes;

    /*
     * The throughput in MBps.
     */
    @JsonProperty(value = "throughputInMBps", access = JsonProperty.Access.WRITE_ONLY)
    private Long throughputInMBps;

    /*
     * The throughput in bytes.
     */
    @JsonProperty(value = "throughputInBytes", access = JsonProperty.Access.WRITE_ONLY)
    private Long throughputInBytes;

    /*
     * The throughput status.
     */
    @JsonProperty(value = "throughputStatus", access = JsonProperty.Access.WRITE_ONLY)
    private String throughputStatus;

    /*
     * The MARS communication status.
     */
    @JsonProperty(value = "marsCommunicationStatus", access = JsonProperty.Access.WRITE_ONLY)
    private String marsCommunicationStatus;

    /*
     * The MARS registration status.
     */
    @JsonProperty(value = "marsRegistrationStatus", access = JsonProperty.Access.WRITE_ONLY)
    private String marsRegistrationStatus;

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

    /**
     * Get the friendlyName property: The Process Server's friendly name.
     *
     * @return the friendlyName value.
     */
    public String friendlyName() {
        return this.friendlyName;
    }

    /**
     * Set the friendlyName property: The Process Server's friendly name.
     *
     * @param friendlyName the friendlyName value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withFriendlyName(String friendlyName) {
        this.friendlyName = friendlyName;
        return this;
    }

    /**
     * Get the id property: The Process Server Id.
     *
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Set the id property: The Process Server Id.
     *
     * @param id the id value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withId(String id) {
        this.id = id;
        return this;
    }

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

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

    /**
     * Get the osType property: The OS type of the server.
     *
     * @return the osType value.
     */
    public String osType() {
        return this.osType;
    }

    /**
     * Set the osType property: The OS type of the server.
     *
     * @param osType the osType value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withOsType(String osType) {
        this.osType = osType;
        return this;
    }

    /**
     * Get the agentVersion property: The version of the scout component on the server.
     *
     * @return the agentVersion value.
     */
    public String agentVersion() {
        return this.agentVersion;
    }

    /**
     * Set the agentVersion property: The version of the scout component on the server.
     *
     * @param agentVersion the agentVersion value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withAgentVersion(String agentVersion) {
        this.agentVersion = agentVersion;
        return this;
    }

    /**
     * Get the lastHeartbeat property: The last heartbeat received from the server.
     *
     * @return the lastHeartbeat value.
     */
    public OffsetDateTime lastHeartbeat() {
        return this.lastHeartbeat;
    }

    /**
     * Set the lastHeartbeat property: The last heartbeat received from the server.
     *
     * @param lastHeartbeat the lastHeartbeat value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withLastHeartbeat(OffsetDateTime lastHeartbeat) {
        this.lastHeartbeat = lastHeartbeat;
        return this;
    }

    /**
     * Get the versionStatus property: Version status.
     *
     * @return the versionStatus value.
     */
    public String versionStatus() {
        return this.versionStatus;
    }

    /**
     * Set the versionStatus property: Version status.
     *
     * @param versionStatus the versionStatus value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withVersionStatus(String versionStatus) {
        this.versionStatus = versionStatus;
        return this;
    }

    /**
     * Get the mobilityServiceUpdates property: The list of the mobility service updates available on the Process
     * Server.
     *
     * @return the mobilityServiceUpdates value.
     */
    public List<MobilityServiceUpdate> mobilityServiceUpdates() {
        return this.mobilityServiceUpdates;
    }

    /**
     * Set the mobilityServiceUpdates property: The list of the mobility service updates available on the Process
     * Server.
     *
     * @param mobilityServiceUpdates the mobilityServiceUpdates value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withMobilityServiceUpdates(List<MobilityServiceUpdate> mobilityServiceUpdates) {
        this.mobilityServiceUpdates = mobilityServiceUpdates;
        return this;
    }

    /**
     * Get the hostId property: The agent generated Id.
     *
     * @return the hostId value.
     */
    public String hostId() {
        return this.hostId;
    }

    /**
     * Set the hostId property: The agent generated Id.
     *
     * @param hostId the hostId value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withHostId(String hostId) {
        this.hostId = hostId;
        return this;
    }

    /**
     * Get the machineCount property: The servers configured with this PS.
     *
     * @return the machineCount value.
     */
    public String machineCount() {
        return this.machineCount;
    }

    /**
     * Set the machineCount property: The servers configured with this PS.
     *
     * @param machineCount the machineCount value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withMachineCount(String machineCount) {
        this.machineCount = machineCount;
        return this;
    }

    /**
     * Get the replicationPairCount property: The number of replication pairs configured in this PS.
     *
     * @return the replicationPairCount value.
     */
    public String replicationPairCount() {
        return this.replicationPairCount;
    }

    /**
     * Set the replicationPairCount property: The number of replication pairs configured in this PS.
     *
     * @param replicationPairCount the replicationPairCount value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withReplicationPairCount(String replicationPairCount) {
        this.replicationPairCount = replicationPairCount;
        return this;
    }

    /**
     * Get the systemLoad property: The percentage of the system load.
     *
     * @return the systemLoad value.
     */
    public String systemLoad() {
        return this.systemLoad;
    }

    /**
     * Set the systemLoad property: The percentage of the system load.
     *
     * @param systemLoad the systemLoad value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withSystemLoad(String systemLoad) {
        this.systemLoad = systemLoad;
        return this;
    }

    /**
     * Get the systemLoadStatus property: The system load status.
     *
     * @return the systemLoadStatus value.
     */
    public String systemLoadStatus() {
        return this.systemLoadStatus;
    }

    /**
     * Set the systemLoadStatus property: The system load status.
     *
     * @param systemLoadStatus the systemLoadStatus value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withSystemLoadStatus(String systemLoadStatus) {
        this.systemLoadStatus = systemLoadStatus;
        return this;
    }

    /**
     * Get the cpuLoad property: The percentage of the CPU load.
     *
     * @return the cpuLoad value.
     */
    public String cpuLoad() {
        return this.cpuLoad;
    }

    /**
     * Set the cpuLoad property: The percentage of the CPU load.
     *
     * @param cpuLoad the cpuLoad value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withCpuLoad(String cpuLoad) {
        this.cpuLoad = cpuLoad;
        return this;
    }

    /**
     * Get the cpuLoadStatus property: The CPU load status.
     *
     * @return the cpuLoadStatus value.
     */
    public String cpuLoadStatus() {
        return this.cpuLoadStatus;
    }

    /**
     * Set the cpuLoadStatus property: The CPU load status.
     *
     * @param cpuLoadStatus the cpuLoadStatus value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withCpuLoadStatus(String cpuLoadStatus) {
        this.cpuLoadStatus = cpuLoadStatus;
        return this;
    }

    /**
     * Get the totalMemoryInBytes property: The total memory.
     *
     * @return the totalMemoryInBytes value.
     */
    public Long totalMemoryInBytes() {
        return this.totalMemoryInBytes;
    }

    /**
     * Set the totalMemoryInBytes property: The total memory.
     *
     * @param totalMemoryInBytes the totalMemoryInBytes value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withTotalMemoryInBytes(Long totalMemoryInBytes) {
        this.totalMemoryInBytes = totalMemoryInBytes;
        return this;
    }

    /**
     * Get the availableMemoryInBytes property: The available memory.
     *
     * @return the availableMemoryInBytes value.
     */
    public Long availableMemoryInBytes() {
        return this.availableMemoryInBytes;
    }

    /**
     * Set the availableMemoryInBytes property: The available memory.
     *
     * @param availableMemoryInBytes the availableMemoryInBytes value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withAvailableMemoryInBytes(Long availableMemoryInBytes) {
        this.availableMemoryInBytes = availableMemoryInBytes;
        return this;
    }

    /**
     * Get the memoryUsageStatus property: The memory usage status.
     *
     * @return the memoryUsageStatus value.
     */
    public String memoryUsageStatus() {
        return this.memoryUsageStatus;
    }

    /**
     * Set the memoryUsageStatus property: The memory usage status.
     *
     * @param memoryUsageStatus the memoryUsageStatus value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withMemoryUsageStatus(String memoryUsageStatus) {
        this.memoryUsageStatus = memoryUsageStatus;
        return this;
    }

    /**
     * Get the totalSpaceInBytes property: The total space.
     *
     * @return the totalSpaceInBytes value.
     */
    public Long totalSpaceInBytes() {
        return this.totalSpaceInBytes;
    }

    /**
     * Set the totalSpaceInBytes property: The total space.
     *
     * @param totalSpaceInBytes the totalSpaceInBytes value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withTotalSpaceInBytes(Long totalSpaceInBytes) {
        this.totalSpaceInBytes = totalSpaceInBytes;
        return this;
    }

    /**
     * Get the availableSpaceInBytes property: The available space.
     *
     * @return the availableSpaceInBytes value.
     */
    public Long availableSpaceInBytes() {
        return this.availableSpaceInBytes;
    }

    /**
     * Set the availableSpaceInBytes property: The available space.
     *
     * @param availableSpaceInBytes the availableSpaceInBytes value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withAvailableSpaceInBytes(Long availableSpaceInBytes) {
        this.availableSpaceInBytes = availableSpaceInBytes;
        return this;
    }

    /**
     * Get the spaceUsageStatus property: The space usage status.
     *
     * @return the spaceUsageStatus value.
     */
    public String spaceUsageStatus() {
        return this.spaceUsageStatus;
    }

    /**
     * Set the spaceUsageStatus property: The space usage status.
     *
     * @param spaceUsageStatus the spaceUsageStatus value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withSpaceUsageStatus(String spaceUsageStatus) {
        this.spaceUsageStatus = spaceUsageStatus;
        return this;
    }

    /**
     * Get the psServiceStatus property: The PS service status.
     *
     * @return the psServiceStatus value.
     */
    public String psServiceStatus() {
        return this.psServiceStatus;
    }

    /**
     * Set the psServiceStatus property: The PS service status.
     *
     * @param psServiceStatus the psServiceStatus value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withPsServiceStatus(String psServiceStatus) {
        this.psServiceStatus = psServiceStatus;
        return this;
    }

    /**
     * Get the sslCertExpiryDate property: The PS SSL cert expiry date.
     *
     * @return the sslCertExpiryDate value.
     */
    public OffsetDateTime sslCertExpiryDate() {
        return this.sslCertExpiryDate;
    }

    /**
     * Set the sslCertExpiryDate property: The PS SSL cert expiry date.
     *
     * @param sslCertExpiryDate the sslCertExpiryDate value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withSslCertExpiryDate(OffsetDateTime sslCertExpiryDate) {
        this.sslCertExpiryDate = sslCertExpiryDate;
        return this;
    }

    /**
     * Get the sslCertExpiryRemainingDays property: CS SSL cert expiry date.
     *
     * @return the sslCertExpiryRemainingDays value.
     */
    public Integer sslCertExpiryRemainingDays() {
        return this.sslCertExpiryRemainingDays;
    }

    /**
     * Set the sslCertExpiryRemainingDays property: CS SSL cert expiry date.
     *
     * @param sslCertExpiryRemainingDays the sslCertExpiryRemainingDays value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withSslCertExpiryRemainingDays(Integer sslCertExpiryRemainingDays) {
        this.sslCertExpiryRemainingDays = sslCertExpiryRemainingDays;
        return this;
    }

    /**
     * Get the osVersion property: OS Version of the process server. Note: This will get populated if user has CS
     * version greater than 9.12.0.0.
     *
     * @return the osVersion value.
     */
    public String osVersion() {
        return this.osVersion;
    }

    /**
     * Set the osVersion property: OS Version of the process server. Note: This will get populated if user has CS
     * version greater than 9.12.0.0.
     *
     * @param osVersion the osVersion value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withOsVersion(String osVersion) {
        this.osVersion = osVersion;
        return this;
    }

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

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

    /**
     * Get the agentExpiryDate property: Agent expiry date.
     *
     * @return the agentExpiryDate value.
     */
    public OffsetDateTime agentExpiryDate() {
        return this.agentExpiryDate;
    }

    /**
     * Set the agentExpiryDate property: Agent expiry date.
     *
     * @param agentExpiryDate the agentExpiryDate value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withAgentExpiryDate(OffsetDateTime agentExpiryDate) {
        this.agentExpiryDate = agentExpiryDate;
        return this;
    }

    /**
     * Get the agentVersionDetails property: The agent version details.
     *
     * @return the agentVersionDetails value.
     */
    public VersionDetails agentVersionDetails() {
        return this.agentVersionDetails;
    }

    /**
     * Set the agentVersionDetails property: The agent version details.
     *
     * @param agentVersionDetails the agentVersionDetails value to set.
     * @return the ProcessServer object itself.
     */
    public ProcessServer withAgentVersionDetails(VersionDetails agentVersionDetails) {
        this.agentVersionDetails = agentVersionDetails;
        return this;
    }

    /**
     * Get the health property: The health of Process Server.
     *
     * @return the health value.
     */
    public ProtectionHealth health() {
        return this.health;
    }

    /**
     * Get the psStatsRefreshTime property: The process server stats refresh time.
     *
     * @return the psStatsRefreshTime value.
     */
    public OffsetDateTime psStatsRefreshTime() {
        return this.psStatsRefreshTime;
    }

    /**
     * Get the throughputUploadPendingDataInBytes property: The uploading pending data in bytes.
     *
     * @return the throughputUploadPendingDataInBytes value.
     */
    public Long throughputUploadPendingDataInBytes() {
        return this.throughputUploadPendingDataInBytes;
    }

    /**
     * Get the throughputInMBps property: The throughput in MBps.
     *
     * @return the throughputInMBps value.
     */
    public Long throughputInMBps() {
        return this.throughputInMBps;
    }

    /**
     * Get the throughputInBytes property: The throughput in bytes.
     *
     * @return the throughputInBytes value.
     */
    public Long throughputInBytes() {
        return this.throughputInBytes;
    }

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

    /**
     * Get the marsCommunicationStatus property: The MARS communication status.
     *
     * @return the marsCommunicationStatus value.
     */
    public String marsCommunicationStatus() {
        return this.marsCommunicationStatus;
    }

    /**
     * Get the marsRegistrationStatus property: The MARS registration status.
     *
     * @return the marsRegistrationStatus value.
     */
    public String marsRegistrationStatus() {
        return this.marsRegistrationStatus;
    }

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