![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.automation.fluent.models.ModuleUpdateProperties Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.automation.fluent.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.automation.models.ContentLink;
import java.io.IOException;
/**
* The parameters supplied to the update properties.
*/
@Fluent
public final class ModuleUpdateProperties implements JsonSerializable {
/*
* Gets or sets the module content link.
*/
private ContentLink contentLink;
/**
* Creates an instance of ModuleUpdateProperties class.
*/
public ModuleUpdateProperties() {
}
/**
* Get the contentLink property: Gets or sets the module content link.
*
* @return the contentLink value.
*/
public ContentLink contentLink() {
return this.contentLink;
}
/**
* Set the contentLink property: Gets or sets the module content link.
*
* @param contentLink the contentLink value to set.
* @return the ModuleUpdateProperties object itself.
*/
public ModuleUpdateProperties withContentLink(ContentLink contentLink) {
this.contentLink = contentLink;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (contentLink() != null) {
contentLink().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("contentLink", this.contentLink);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ModuleUpdateProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ModuleUpdateProperties 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 ModuleUpdateProperties.
*/
public static ModuleUpdateProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ModuleUpdateProperties deserializedModuleUpdateProperties = new ModuleUpdateProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("contentLink".equals(fieldName)) {
deserializedModuleUpdateProperties.contentLink = ContentLink.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedModuleUpdateProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy