com.azure.resourcemanager.machinelearning.models.UriFolderJobInput 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.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* The UriFolderJobInput model.
*/
@Fluent
public final class UriFolderJobInput extends JobInput {
/*
* [Required] Specifies the type of job.
*/
private JobInputType jobInputType = JobInputType.URI_FOLDER;
/*
* [Required] Input Asset URI.
*/
private String uri;
/*
* Input Asset Delivery Mode.
*/
private InputDeliveryMode mode;
/**
* Creates an instance of UriFolderJobInput class.
*/
public UriFolderJobInput() {
}
/**
* Get the jobInputType property: [Required] Specifies the type of job.
*
* @return the jobInputType value.
*/
@Override
public JobInputType jobInputType() {
return this.jobInputType;
}
/**
* Get the uri property: [Required] Input Asset URI.
*
* @return the uri value.
*/
public String uri() {
return this.uri;
}
/**
* Set the uri property: [Required] Input Asset URI.
*
* @param uri the uri value to set.
* @return the UriFolderJobInput object itself.
*/
public UriFolderJobInput withUri(String uri) {
this.uri = uri;
return this;
}
/**
* Get the mode property: Input Asset Delivery Mode.
*
* @return the mode value.
*/
public InputDeliveryMode mode() {
return this.mode;
}
/**
* Set the mode property: Input Asset Delivery Mode.
*
* @param mode the mode value to set.
* @return the UriFolderJobInput object itself.
*/
public UriFolderJobInput withMode(InputDeliveryMode mode) {
this.mode = mode;
return this;
}
/**
* {@inheritDoc}
*/
@Override
public UriFolderJobInput withDescription(String description) {
super.withDescription(description);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
@Override
public void validate() {
super.validate();
if (uri() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException("Missing required property uri in model UriFolderJobInput"));
}
}
private static final ClientLogger LOGGER = new ClientLogger(UriFolderJobInput.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("description", description());
jsonWriter.writeStringField("uri", this.uri);
jsonWriter.writeStringField("jobInputType", this.jobInputType == null ? null : this.jobInputType.toString());
jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString());
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of UriFolderJobInput from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of UriFolderJobInput if the JsonReader was pointing to an instance of it, or null if it was
* pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the UriFolderJobInput.
*/
public static UriFolderJobInput fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
UriFolderJobInput deserializedUriFolderJobInput = new UriFolderJobInput();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("description".equals(fieldName)) {
deserializedUriFolderJobInput.withDescription(reader.getString());
} else if ("uri".equals(fieldName)) {
deserializedUriFolderJobInput.uri = reader.getString();
} else if ("jobInputType".equals(fieldName)) {
deserializedUriFolderJobInput.jobInputType = JobInputType.fromString(reader.getString());
} else if ("mode".equals(fieldName)) {
deserializedUriFolderJobInput.mode = InputDeliveryMode.fromString(reader.getString());
} else {
reader.skipChildren();
}
}
return deserializedUriFolderJobInput;
});
}
}