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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.desktopvirtualization.models.SessionHostHealthCheckReport;
import com.azure.resourcemanager.desktopvirtualization.models.Status;
import com.azure.resourcemanager.desktopvirtualization.models.UpdateState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** Represents a SessionHost definition. */
@Fluent
public final class SessionHostInner extends ProxyResource {
    /*
     * Metadata pertaining to creation and last modification of the resource.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

    /*
     * Detailed properties for SessionHost
     */
    @JsonProperty(value = "properties")
    private SessionHostProperties innerProperties;

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

    /**
     * Get the systemData property: Metadata pertaining to creation and last modification of the resource.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the innerProperties property: Detailed properties for SessionHost.
     *
     * @return the innerProperties value.
     */
    private SessionHostProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the objectId property: ObjectId of SessionHost. (internal use).
     *
     * @return the objectId value.
     */
    public String objectId() {
        return this.innerProperties() == null ? null : this.innerProperties().objectId();
    }

    /**
     * Get the lastHeartBeat property: Last heart beat from SessionHost.
     *
     * @return the lastHeartBeat value.
     */
    public OffsetDateTime lastHeartBeat() {
        return this.innerProperties() == null ? null : this.innerProperties().lastHeartBeat();
    }

    /**
     * Set the lastHeartBeat property: Last heart beat from SessionHost.
     *
     * @param lastHeartBeat the lastHeartBeat value to set.
     * @return the SessionHostInner object itself.
     */
    public SessionHostInner withLastHeartBeat(OffsetDateTime lastHeartBeat) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SessionHostProperties();
        }
        this.innerProperties().withLastHeartBeat(lastHeartBeat);
        return this;
    }

    /**
     * Get the sessions property: Number of sessions on SessionHost.
     *
     * @return the sessions value.
     */
    public Integer sessions() {
        return this.innerProperties() == null ? null : this.innerProperties().sessions();
    }

    /**
     * Set the sessions property: Number of sessions on SessionHost.
     *
     * @param sessions the sessions value to set.
     * @return the SessionHostInner object itself.
     */
    public SessionHostInner withSessions(Integer sessions) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SessionHostProperties();
        }
        this.innerProperties().withSessions(sessions);
        return this;
    }

    /**
     * Get the agentVersion property: Version of agent on SessionHost.
     *
     * @return the agentVersion value.
     */
    public String agentVersion() {
        return this.innerProperties() == null ? null : this.innerProperties().agentVersion();
    }

    /**
     * Set the agentVersion property: Version of agent on SessionHost.
     *
     * @param agentVersion the agentVersion value to set.
     * @return the SessionHostInner object itself.
     */
    public SessionHostInner withAgentVersion(String agentVersion) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SessionHostProperties();
        }
        this.innerProperties().withAgentVersion(agentVersion);
        return this;
    }

    /**
     * Get the allowNewSession property: Allow a new session.
     *
     * @return the allowNewSession value.
     */
    public Boolean allowNewSession() {
        return this.innerProperties() == null ? null : this.innerProperties().allowNewSession();
    }

    /**
     * Set the allowNewSession property: Allow a new session.
     *
     * @param allowNewSession the allowNewSession value to set.
     * @return the SessionHostInner object itself.
     */
    public SessionHostInner withAllowNewSession(Boolean allowNewSession) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SessionHostProperties();
        }
        this.innerProperties().withAllowNewSession(allowNewSession);
        return this;
    }

    /**
     * Get the virtualMachineId property: Virtual Machine Id of SessionHost's underlying virtual machine.
     *
     * @return the virtualMachineId value.
     */
    public String virtualMachineId() {
        return this.innerProperties() == null ? null : this.innerProperties().virtualMachineId();
    }

    /**
     * Get the resourceId property: Resource Id of SessionHost's underlying virtual machine.
     *
     * @return the resourceId value.
     */
    public String resourceId() {
        return this.innerProperties() == null ? null : this.innerProperties().resourceId();
    }

    /**
     * Get the assignedUser property: User assigned to SessionHost.
     *
     * @return the assignedUser value.
     */
    public String assignedUser() {
        return this.innerProperties() == null ? null : this.innerProperties().assignedUser();
    }

    /**
     * Set the assignedUser property: User assigned to SessionHost.
     *
     * @param assignedUser the assignedUser value to set.
     * @return the SessionHostInner object itself.
     */
    public SessionHostInner withAssignedUser(String assignedUser) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SessionHostProperties();
        }
        this.innerProperties().withAssignedUser(assignedUser);
        return this;
    }

    /**
     * Get the friendlyName property: Friendly name of SessionHost.
     *
     * @return the friendlyName value.
     */
    public String friendlyName() {
        return this.innerProperties() == null ? null : this.innerProperties().friendlyName();
    }

    /**
     * Set the friendlyName property: Friendly name of SessionHost.
     *
     * @param friendlyName the friendlyName value to set.
     * @return the SessionHostInner object itself.
     */
    public SessionHostInner withFriendlyName(String friendlyName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SessionHostProperties();
        }
        this.innerProperties().withFriendlyName(friendlyName);
        return this;
    }

    /**
     * Get the status property: Status for a SessionHost.
     *
     * @return the status value.
     */
    public Status status() {
        return this.innerProperties() == null ? null : this.innerProperties().status();
    }

    /**
     * Set the status property: Status for a SessionHost.
     *
     * @param status the status value to set.
     * @return the SessionHostInner object itself.
     */
    public SessionHostInner withStatus(Status status) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SessionHostProperties();
        }
        this.innerProperties().withStatus(status);
        return this;
    }

    /**
     * Get the statusTimestamp property: The timestamp of the status.
     *
     * @return the statusTimestamp value.
     */
    public OffsetDateTime statusTimestamp() {
        return this.innerProperties() == null ? null : this.innerProperties().statusTimestamp();
    }

    /**
     * Get the osVersion property: The version of the OS on the session host.
     *
     * @return the osVersion value.
     */
    public String osVersion() {
        return this.innerProperties() == null ? null : this.innerProperties().osVersion();
    }

    /**
     * Set the osVersion property: The version of the OS on the session host.
     *
     * @param osVersion the osVersion value to set.
     * @return the SessionHostInner object itself.
     */
    public SessionHostInner withOsVersion(String osVersion) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SessionHostProperties();
        }
        this.innerProperties().withOsVersion(osVersion);
        return this;
    }

    /**
     * Get the sxSStackVersion property: The version of the side by side stack on the session host.
     *
     * @return the sxSStackVersion value.
     */
    public String sxSStackVersion() {
        return this.innerProperties() == null ? null : this.innerProperties().sxSStackVersion();
    }

    /**
     * Set the sxSStackVersion property: The version of the side by side stack on the session host.
     *
     * @param sxSStackVersion the sxSStackVersion value to set.
     * @return the SessionHostInner object itself.
     */
    public SessionHostInner withSxSStackVersion(String sxSStackVersion) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SessionHostProperties();
        }
        this.innerProperties().withSxSStackVersion(sxSStackVersion);
        return this;
    }

    /**
     * Get the updateState property: Update state of a SessionHost.
     *
     * @return the updateState value.
     */
    public UpdateState updateState() {
        return this.innerProperties() == null ? null : this.innerProperties().updateState();
    }

    /**
     * Set the updateState property: Update state of a SessionHost.
     *
     * @param updateState the updateState value to set.
     * @return the SessionHostInner object itself.
     */
    public SessionHostInner withUpdateState(UpdateState updateState) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SessionHostProperties();
        }
        this.innerProperties().withUpdateState(updateState);
        return this;
    }

    /**
     * Get the lastUpdateTime property: The timestamp of the last update.
     *
     * @return the lastUpdateTime value.
     */
    public OffsetDateTime lastUpdateTime() {
        return this.innerProperties() == null ? null : this.innerProperties().lastUpdateTime();
    }

    /**
     * Get the updateErrorMessage property: The error message.
     *
     * @return the updateErrorMessage value.
     */
    public String updateErrorMessage() {
        return this.innerProperties() == null ? null : this.innerProperties().updateErrorMessage();
    }

    /**
     * Set the updateErrorMessage property: The error message.
     *
     * @param updateErrorMessage the updateErrorMessage value to set.
     * @return the SessionHostInner object itself.
     */
    public SessionHostInner withUpdateErrorMessage(String updateErrorMessage) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SessionHostProperties();
        }
        this.innerProperties().withUpdateErrorMessage(updateErrorMessage);
        return this;
    }

    /**
     * Get the sessionHostHealthCheckResults property: List of SessionHostHealthCheckReports.
     *
     * @return the sessionHostHealthCheckResults value.
     */
    public List<SessionHostHealthCheckReport> sessionHostHealthCheckResults() {
        return this.innerProperties() == null ? null : this.innerProperties().sessionHostHealthCheckResults();
    }

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