com.azure.resourcemanager.security.fluent.models.AllowedConnectionsResourceProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-security Show documentation
Show all versions of azure-resourcemanager-security Show documentation
This package contains Microsoft Azure SDK for Security Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.Security (Azure Security Center) resource provider. Package tag package-composite-v3.
// 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.fluent.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 com.azure.resourcemanager.security.models.ConnectableResource;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;
/**
* Describes the allowed traffic between Azure resources.
*/
@Immutable
public final class AllowedConnectionsResourceProperties
implements JsonSerializable {
/*
* The UTC time on which the allowed connections resource was calculated
*/
private OffsetDateTime calculatedDateTime;
/*
* List of connectable resources
*/
private List connectableResources;
/**
* Creates an instance of AllowedConnectionsResourceProperties class.
*/
public AllowedConnectionsResourceProperties() {
}
/**
* Get the calculatedDateTime property: The UTC time on which the allowed connections resource was calculated.
*
* @return the calculatedDateTime value.
*/
public OffsetDateTime calculatedDateTime() {
return this.calculatedDateTime;
}
/**
* Get the connectableResources property: List of connectable resources.
*
* @return the connectableResources value.
*/
public List connectableResources() {
return this.connectableResources;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (connectableResources() != null) {
connectableResources().forEach(e -> e.validate());
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of AllowedConnectionsResourceProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AllowedConnectionsResourceProperties 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 AllowedConnectionsResourceProperties.
*/
public static AllowedConnectionsResourceProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AllowedConnectionsResourceProperties deserializedAllowedConnectionsResourceProperties
= new AllowedConnectionsResourceProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("calculatedDateTime".equals(fieldName)) {
deserializedAllowedConnectionsResourceProperties.calculatedDateTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("connectableResources".equals(fieldName)) {
List connectableResources
= reader.readArray(reader1 -> ConnectableResource.fromJson(reader1));
deserializedAllowedConnectionsResourceProperties.connectableResources = connectableResources;
} else {
reader.skipChildren();
}
}
return deserializedAllowedConnectionsResourceProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy