// 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.resourcemanager.desktopvirtualization.fluent.models.DesktopPatchProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Desktop properties that can be patched. */
@Fluent
public final class DesktopPatch {
    /*
     * tags to be updated
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

    /*
     * Detailed properties for Desktop
     */
    @JsonProperty(value = "properties")
    private DesktopPatchProperties innerProperties;

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

    /**
     * Get the tags property: tags to be updated.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: tags to be updated.
     *
     * @param tags the tags value to set.
     * @return the DesktopPatch object itself.
     */
    public DesktopPatch withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

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

    /**
     * Get the description property: Description of Desktop.
     *
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: Description of Desktop.
     *
     * @param description the description value to set.
     * @return the DesktopPatch object itself.
     */
    public DesktopPatch withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DesktopPatchProperties();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

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

    /**
     * Set the friendlyName property: Friendly name of Desktop.
     *
     * @param friendlyName the friendlyName value to set.
     * @return the DesktopPatch object itself.
     */
    public DesktopPatch withFriendlyName(String friendlyName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new DesktopPatchProperties();
        }
        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();
        }
    }
}
