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

com.azure.resourcemanager.azurestackhci.models.PerNodeRemoteSupportSession Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. 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.azurestackhci.models;

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

/**
 * Remote Support Node Session Details on the Node.
 */
@Immutable
public final class PerNodeRemoteSupportSession implements JsonSerializable {
    /*
     * Remote Support Session StartTime on the Node
     */
    private OffsetDateTime sessionStartTime;

    /*
     * Remote Support Session EndTime on the Node
     */
    private OffsetDateTime sessionEndTime;

    /*
     * Name of the node
     */
    private String nodeName;

    /*
     * Duration of Remote Support Enablement
     */
    private Long duration;

    /*
     * Remote Support Access Level
     */
    private AccessLevel accessLevel;

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

    /**
     * Get the sessionStartTime property: Remote Support Session StartTime on the Node.
     * 
     * @return the sessionStartTime value.
     */
    public OffsetDateTime sessionStartTime() {
        return this.sessionStartTime;
    }

    /**
     * Get the sessionEndTime property: Remote Support Session EndTime on the Node.
     * 
     * @return the sessionEndTime value.
     */
    public OffsetDateTime sessionEndTime() {
        return this.sessionEndTime;
    }

    /**
     * Get the nodeName property: Name of the node.
     * 
     * @return the nodeName value.
     */
    public String nodeName() {
        return this.nodeName;
    }

    /**
     * Get the duration property: Duration of Remote Support Enablement.
     * 
     * @return the duration value.
     */
    public Long duration() {
        return this.duration;
    }

    /**
     * Get the accessLevel property: Remote Support Access Level.
     * 
     * @return the accessLevel value.
     */
    public AccessLevel accessLevel() {
        return this.accessLevel;
    }

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

                if ("sessionStartTime".equals(fieldName)) {
                    deserializedPerNodeRemoteSupportSession.sessionStartTime = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("sessionEndTime".equals(fieldName)) {
                    deserializedPerNodeRemoteSupportSession.sessionEndTime = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("nodeName".equals(fieldName)) {
                    deserializedPerNodeRemoteSupportSession.nodeName = reader.getString();
                } else if ("duration".equals(fieldName)) {
                    deserializedPerNodeRemoteSupportSession.duration = reader.getNullable(JsonReader::getLong);
                } else if ("accessLevel".equals(fieldName)) {
                    deserializedPerNodeRemoteSupportSession.accessLevel = AccessLevel.fromString(reader.getString());
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedPerNodeRemoteSupportSession;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy