com.azure.resourcemanager.machinelearning.models.OutboundRuleListResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-machinelearning Show documentation
Show all versions of azure-resourcemanager-machinelearning Show documentation
This package contains Microsoft Azure SDK for Machine Learning Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. These APIs allow end users to operate on Azure Machine Learning Workspace resources. 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.machinelearning.models;
import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.machinelearning.fluent.models.OutboundRuleBasicResourceInner;
import java.io.IOException;
import java.util.List;
/**
* List of outbound rules for the managed network of a machine learning workspace.
*/
@Fluent
public final class OutboundRuleListResult implements JsonSerializable {
/*
* The link to the next page constructed using the continuationToken. If null, there are no additional pages.
*/
private String nextLink;
/*
* The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to
* request the next list of machine learning workspaces.
*/
private List value;
/**
* Creates an instance of OutboundRuleListResult class.
*/
public OutboundRuleListResult() {
}
/**
* Get the nextLink property: The link to the next page constructed using the continuationToken. If null, there are
* no additional pages.
*
* @return the nextLink value.
*/
public String nextLink() {
return this.nextLink;
}
/**
* Set the nextLink property: The link to the next page constructed using the continuationToken. If null, there are
* no additional pages.
*
* @param nextLink the nextLink value to set.
* @return the OutboundRuleListResult object itself.
*/
public OutboundRuleListResult withNextLink(String nextLink) {
this.nextLink = nextLink;
return this;
}
/**
* Get the value property: The list of machine learning workspaces. Since this list may be incomplete, the nextLink
* field should be used to request the next list of machine learning workspaces.
*
* @return the value value.
*/
public List value() {
return this.value;
}
/**
* Set the value property: The list of machine learning workspaces. Since this list may be incomplete, the nextLink
* field should be used to request the next list of machine learning workspaces.
*
* @param value the value value to set.
* @return the OutboundRuleListResult object itself.
*/
public OutboundRuleListResult withValue(List value) {
this.value = value;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (value() != null) {
value().forEach(e -> e.validate());
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("nextLink", this.nextLink);
jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element));
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of OutboundRuleListResult from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of OutboundRuleListResult 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 OutboundRuleListResult.
*/
public static OutboundRuleListResult fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
OutboundRuleListResult deserializedOutboundRuleListResult = new OutboundRuleListResult();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("nextLink".equals(fieldName)) {
deserializedOutboundRuleListResult.nextLink = reader.getString();
} else if ("value".equals(fieldName)) {
List value
= reader.readArray(reader1 -> OutboundRuleBasicResourceInner.fromJson(reader1));
deserializedOutboundRuleListResult.value = value;
} else {
reader.skipChildren();
}
}
return deserializedOutboundRuleListResult;
});
}
}