All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.desktopvirtualization.fluent.models.DesktopPatchProperties Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-04.

The newest version!
// 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.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * Desktop properties that can be patched.
 */
@Fluent
public final class DesktopPatchProperties implements JsonSerializable {
    /*
     * Description of Desktop.
     */
    private String description;

    /*
     * Friendly name of Desktop.
     */
    private String friendlyName;

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

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

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

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

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

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("description", this.description);
        jsonWriter.writeStringField("friendlyName", this.friendlyName);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of DesktopPatchProperties from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of DesktopPatchProperties if the JsonReader was pointing to an instance of it, or null if it
     * was pointing to JSON null.
     * @throws IOException If an error occurs while reading the DesktopPatchProperties.
     */
    public static DesktopPatchProperties fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            DesktopPatchProperties deserializedDesktopPatchProperties = new DesktopPatchProperties();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("description".equals(fieldName)) {
                    deserializedDesktopPatchProperties.description = reader.getString();
                } else if ("friendlyName".equals(fieldName)) {
                    deserializedDesktopPatchProperties.friendlyName = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedDesktopPatchProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy