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