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

com.azure.resourcemanager.security.models.TopologySingleResourceParent Maven / Gradle / Ivy

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

package com.azure.resourcemanager.security.models;

import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * The TopologySingleResourceParent model.
 */
@Immutable
public final class TopologySingleResourceParent implements JsonSerializable {
    /*
     * Azure resource id which serves as parent resource in topology view
     */
    private String resourceId;

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

    /**
     * Get the resourceId property: Azure resource id which serves as parent resource in topology view.
     * 
     * @return the resourceId value.
     */
    public String resourceId() {
        return this.resourceId;
    }

    /**
     * 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();
        return jsonWriter.writeEndObject();
    }

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

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

            return deserializedTopologySingleResourceParent;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy