com.azure.resourcemanager.machinelearning.models.RegistryTrackedResourceArmPaginatedResult 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.RegistryInner;
import java.io.IOException;
import java.util.List;
/**
* A paginated list of Registry entities.
*/
@Fluent
public final class RegistryTrackedResourceArmPaginatedResult
implements JsonSerializable {
/*
* The link to the next page of Registry objects. If null, there are no additional pages.
*/
private String nextLink;
/*
* An array of objects of type Registry.
*/
private List value;
/**
* Creates an instance of RegistryTrackedResourceArmPaginatedResult class.
*/
public RegistryTrackedResourceArmPaginatedResult() {
}
/**
* Get the nextLink property: The link to the next page of Registry objects. 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 of Registry objects. If null, there are no additional pages.
*
* @param nextLink the nextLink value to set.
* @return the RegistryTrackedResourceArmPaginatedResult object itself.
*/
public RegistryTrackedResourceArmPaginatedResult withNextLink(String nextLink) {
this.nextLink = nextLink;
return this;
}
/**
* Get the value property: An array of objects of type Registry.
*
* @return the value value.
*/
public List value() {
return this.value;
}
/**
* Set the value property: An array of objects of type Registry.
*
* @param value the value value to set.
* @return the RegistryTrackedResourceArmPaginatedResult object itself.
*/
public RegistryTrackedResourceArmPaginatedResult 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 RegistryTrackedResourceArmPaginatedResult from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of RegistryTrackedResourceArmPaginatedResult 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 RegistryTrackedResourceArmPaginatedResult.
*/
public static RegistryTrackedResourceArmPaginatedResult fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
RegistryTrackedResourceArmPaginatedResult deserializedRegistryTrackedResourceArmPaginatedResult
= new RegistryTrackedResourceArmPaginatedResult();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("nextLink".equals(fieldName)) {
deserializedRegistryTrackedResourceArmPaginatedResult.nextLink = reader.getString();
} else if ("value".equals(fieldName)) {
List value = reader.readArray(reader1 -> RegistryInner.fromJson(reader1));
deserializedRegistryTrackedResourceArmPaginatedResult.value = value;
} else {
reader.skipChildren();
}
}
return deserializedRegistryTrackedResourceArmPaginatedResult;
});
}
}