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

com.azure.resourcemanager.azurestackhci.models.RemoteSupportRequestProperties 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.Fluent;
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;
import java.time.format.DateTimeFormatter;

/**
 * Properties for Remote Support Request.
 */
@Fluent
public final class RemoteSupportRequestProperties implements JsonSerializable {
    /*
     * Remote Support Access Level
     */
    private AccessLevel accessLevel;

    /*
     * Expiration DateTimeStamp when Remote Support Access will be expired
     */
    private OffsetDateTime expirationTimestamp;

    /*
     * Remote Support Type for cluster
     */
    private RemoteSupportType remoteSupportType;

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

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

    /**
     * Get the expirationTimestamp property: Expiration DateTimeStamp when Remote Support Access will be expired.
     * 
     * @return the expirationTimestamp value.
     */
    public OffsetDateTime expirationTimestamp() {
        return this.expirationTimestamp;
    }

    /**
     * Set the expirationTimestamp property: Expiration DateTimeStamp when Remote Support Access will be expired.
     * 
     * @param expirationTimestamp the expirationTimestamp value to set.
     * @return the RemoteSupportRequestProperties object itself.
     */
    public RemoteSupportRequestProperties withExpirationTimestamp(OffsetDateTime expirationTimestamp) {
        this.expirationTimestamp = expirationTimestamp;
        return this;
    }

    /**
     * Get the remoteSupportType property: Remote Support Type for cluster.
     * 
     * @return the remoteSupportType value.
     */
    public RemoteSupportType remoteSupportType() {
        return this.remoteSupportType;
    }

    /**
     * Set the remoteSupportType property: Remote Support Type for cluster.
     * 
     * @param remoteSupportType the remoteSupportType value to set.
     * @return the RemoteSupportRequestProperties object itself.
     */
    public RemoteSupportRequestProperties withRemoteSupportType(RemoteSupportType remoteSupportType) {
        this.remoteSupportType = remoteSupportType;
        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("expirationTimeStamp",
            this.expirationTimestamp == null
                ? null
                : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.expirationTimestamp));
        jsonWriter.writeStringField("remoteSupportType",
            this.remoteSupportType == null ? null : this.remoteSupportType.toString());
        return jsonWriter.writeEndObject();
    }

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

                if ("accessLevel".equals(fieldName)) {
                    deserializedRemoteSupportRequestProperties.accessLevel = AccessLevel.fromString(reader.getString());
                } else if ("expirationTimeStamp".equals(fieldName)) {
                    deserializedRemoteSupportRequestProperties.expirationTimestamp = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("remoteSupportType".equals(fieldName)) {
                    deserializedRemoteSupportRequestProperties.remoteSupportType
                        = RemoteSupportType.fromString(reader.getString());
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedRemoteSupportRequestProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy