com.azure.resourcemanager.azurestackhci.models.LogCollectionProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-azurestackhci Show documentation
Show all versions of azure-resourcemanager-azurestackhci Show documentation
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;
import java.util.List;
/**
* Log Collection properties of the cluster.
*/
@Immutable
public final class LogCollectionProperties implements JsonSerializable {
/*
* From DateTimeStamp from when logs need to be connected
*/
private OffsetDateTime fromDate;
/*
* To DateTimeStamp till when logs need to be connected
*/
private OffsetDateTime toDate;
/*
* Recent DateTimeStamp where logs are successfully generated
*/
private OffsetDateTime lastLogGenerated;
/*
* The logCollectionSessionDetails property.
*/
private List logCollectionSessionDetails;
/**
* Creates an instance of LogCollectionProperties class.
*/
public LogCollectionProperties() {
}
/**
* Get the fromDate property: From DateTimeStamp from when logs need to be connected.
*
* @return the fromDate value.
*/
public OffsetDateTime fromDate() {
return this.fromDate;
}
/**
* Get the toDate property: To DateTimeStamp till when logs need to be connected.
*
* @return the toDate value.
*/
public OffsetDateTime toDate() {
return this.toDate;
}
/**
* Get the lastLogGenerated property: Recent DateTimeStamp where logs are successfully generated.
*
* @return the lastLogGenerated value.
*/
public OffsetDateTime lastLogGenerated() {
return this.lastLogGenerated;
}
/**
* Get the logCollectionSessionDetails property: The logCollectionSessionDetails property.
*
* @return the logCollectionSessionDetails value.
*/
public List logCollectionSessionDetails() {
return this.logCollectionSessionDetails;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (logCollectionSessionDetails() != null) {
logCollectionSessionDetails().forEach(e -> e.validate());
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of LogCollectionProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of LogCollectionProperties 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 LogCollectionProperties.
*/
public static LogCollectionProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
LogCollectionProperties deserializedLogCollectionProperties = new LogCollectionProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("fromDate".equals(fieldName)) {
deserializedLogCollectionProperties.fromDate = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("toDate".equals(fieldName)) {
deserializedLogCollectionProperties.toDate = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("lastLogGenerated".equals(fieldName)) {
deserializedLogCollectionProperties.lastLogGenerated = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("logCollectionSessionDetails".equals(fieldName)) {
List logCollectionSessionDetails
= reader.readArray(reader1 -> LogCollectionSession.fromJson(reader1));
deserializedLogCollectionProperties.logCollectionSessionDetails = logCollectionSessionDetails;
} else {
reader.skipChildren();
}
}
return deserializedLogCollectionProperties;
});
}
}