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

com.azure.resourcemanager.automation.models.DscReportResourceNavigation Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for Automation Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Automation Client. Package tag package-2022-02-22.

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.automation.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;

/**
 * Navigation for DSC Report Resource.
 */
@Fluent
public final class DscReportResourceNavigation implements JsonSerializable {
    /*
     * Gets or sets the ID of the resource to navigate to.
     */
    private String resourceId;

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

    /**
     * Get the resourceId property: Gets or sets the ID of the resource to navigate to.
     * 
     * @return the resourceId value.
     */
    public String resourceId() {
        return this.resourceId;
    }

    /**
     * Set the resourceId property: Gets or sets the ID of the resource to navigate to.
     * 
     * @param resourceId the resourceId value to set.
     * @return the DscReportResourceNavigation object itself.
     */
    public DscReportResourceNavigation withResourceId(String resourceId) {
        this.resourceId = resourceId;
        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("resourceId", this.resourceId);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of DscReportResourceNavigation from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of DscReportResourceNavigation 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 DscReportResourceNavigation.
     */
    public static DscReportResourceNavigation fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            DscReportResourceNavigation deserializedDscReportResourceNavigation = new DscReportResourceNavigation();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("resourceId".equals(fieldName)) {
                    deserializedDscReportResourceNavigation.resourceId = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedDscReportResourceNavigation;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy