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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.resourcemanager.desktopvirtualization.fluent.models.SessionHostPatchProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/** SessionHost properties that can be patched. */
@Fluent
public final class SessionHostPatch extends ProxyResource {
    /*
     * Detailed properties for SessionHost
     */
    @JsonProperty(value = "properties")
    private SessionHostPatchProperties innerProperties;

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

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

    /**
     * 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 SessionHostPatch object itself.
     */
    public SessionHostPatch withAllowNewSession(Boolean allowNewSession) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SessionHostPatchProperties();
        }
        this.innerProperties().withAllowNewSession(allowNewSession);
        return this;
    }

    /**
     * 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 SessionHostPatch object itself.
     */
    public SessionHostPatch withAssignedUser(String assignedUser) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SessionHostPatchProperties();
        }
        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 SessionHostPatch object itself.
     */
    public SessionHostPatch withFriendlyName(String friendlyName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SessionHostPatchProperties();
        }
        this.innerProperties().withFriendlyName(friendlyName);
        return this;
    }

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