![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.automation.fluent.models.ModuleInner 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.core.management.Resource;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.automation.models.ContentLink;
import com.azure.resourcemanager.automation.models.ModuleErrorInfo;
import com.azure.resourcemanager.automation.models.ModuleProvisioningState;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.Map;
/**
* Definition of the module type.
*/
@Fluent
public final class ModuleInner extends Resource {
/*
* Gets or sets the module properties.
*/
private ModuleProperties innerProperties;
/*
* Gets or sets the etag of the resource.
*/
private String etag;
/*
* The type of the resource.
*/
private String type;
/*
* The name of the resource.
*/
private String name;
/*
* Fully qualified resource Id for the resource.
*/
private String id;
/**
* Creates an instance of ModuleInner class.
*/
public ModuleInner() {
}
/**
* Get the innerProperties property: Gets or sets the module properties.
*
* @return the innerProperties value.
*/
private ModuleProperties innerProperties() {
return this.innerProperties;
}
/**
* Get the etag property: Gets or sets the etag of the resource.
*
* @return the etag value.
*/
public String etag() {
return this.etag;
}
/**
* Set the etag property: Gets or sets the etag of the resource.
*
* @param etag the etag value to set.
* @return the ModuleInner object itself.
*/
public ModuleInner withEtag(String etag) {
this.etag = etag;
return this;
}
/**
* Get the type property: The type of the resource.
*
* @return the type value.
*/
@Override
public String type() {
return this.type;
}
/**
* Get the name property: The name of the resource.
*
* @return the name value.
*/
@Override
public String name() {
return this.name;
}
/**
* Get the id property: Fully qualified resource Id for the resource.
*
* @return the id value.
*/
@Override
public String id() {
return this.id;
}
/**
* {@inheritDoc}
*/
@Override
public ModuleInner withLocation(String location) {
super.withLocation(location);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public ModuleInner withTags(Map tags) {
super.withTags(tags);
return this;
}
/**
* Get the isGlobal property: Gets or sets the isGlobal flag of the module.
*
* @return the isGlobal value.
*/
public Boolean isGlobal() {
return this.innerProperties() == null ? null : this.innerProperties().isGlobal();
}
/**
* Set the isGlobal property: Gets or sets the isGlobal flag of the module.
*
* @param isGlobal the isGlobal value to set.
* @return the ModuleInner object itself.
*/
public ModuleInner withIsGlobal(Boolean isGlobal) {
if (this.innerProperties() == null) {
this.innerProperties = new ModuleProperties();
}
this.innerProperties().withIsGlobal(isGlobal);
return this;
}
/**
* Get the version property: Gets or sets the version of the module.
*
* @return the version value.
*/
public String version() {
return this.innerProperties() == null ? null : this.innerProperties().version();
}
/**
* Set the version property: Gets or sets the version of the module.
*
* @param version the version value to set.
* @return the ModuleInner object itself.
*/
public ModuleInner withVersion(String version) {
if (this.innerProperties() == null) {
this.innerProperties = new ModuleProperties();
}
this.innerProperties().withVersion(version);
return this;
}
/**
* Get the sizeInBytes property: Gets or sets the size in bytes of the module.
*
* @return the sizeInBytes value.
*/
public Long sizeInBytes() {
return this.innerProperties() == null ? null : this.innerProperties().sizeInBytes();
}
/**
* Set the sizeInBytes property: Gets or sets the size in bytes of the module.
*
* @param sizeInBytes the sizeInBytes value to set.
* @return the ModuleInner object itself.
*/
public ModuleInner withSizeInBytes(Long sizeInBytes) {
if (this.innerProperties() == null) {
this.innerProperties = new ModuleProperties();
}
this.innerProperties().withSizeInBytes(sizeInBytes);
return this;
}
/**
* Get the activityCount property: Gets or sets the activity count of the module.
*
* @return the activityCount value.
*/
public Integer activityCount() {
return this.innerProperties() == null ? null : this.innerProperties().activityCount();
}
/**
* Set the activityCount property: Gets or sets the activity count of the module.
*
* @param activityCount the activityCount value to set.
* @return the ModuleInner object itself.
*/
public ModuleInner withActivityCount(Integer activityCount) {
if (this.innerProperties() == null) {
this.innerProperties = new ModuleProperties();
}
this.innerProperties().withActivityCount(activityCount);
return this;
}
/**
* Get the provisioningState property: Gets or sets the provisioning state of the module.
*
* @return the provisioningState value.
*/
public ModuleProvisioningState provisioningState() {
return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
}
/**
* Set the provisioningState property: Gets or sets the provisioning state of the module.
*
* @param provisioningState the provisioningState value to set.
* @return the ModuleInner object itself.
*/
public ModuleInner withProvisioningState(ModuleProvisioningState provisioningState) {
if (this.innerProperties() == null) {
this.innerProperties = new ModuleProperties();
}
this.innerProperties().withProvisioningState(provisioningState);
return this;
}
/**
* Get the contentLink property: Gets or sets the contentLink of the module.
*
* @return the contentLink value.
*/
public ContentLink contentLink() {
return this.innerProperties() == null ? null : this.innerProperties().contentLink();
}
/**
* Set the contentLink property: Gets or sets the contentLink of the module.
*
* @param contentLink the contentLink value to set.
* @return the ModuleInner object itself.
*/
public ModuleInner withContentLink(ContentLink contentLink) {
if (this.innerProperties() == null) {
this.innerProperties = new ModuleProperties();
}
this.innerProperties().withContentLink(contentLink);
return this;
}
/**
* Get the error property: Gets or sets the error info of the module.
*
* @return the error value.
*/
public ModuleErrorInfo error() {
return this.innerProperties() == null ? null : this.innerProperties().error();
}
/**
* Set the error property: Gets or sets the error info of the module.
*
* @param error the error value to set.
* @return the ModuleInner object itself.
*/
public ModuleInner withError(ModuleErrorInfo error) {
if (this.innerProperties() == null) {
this.innerProperties = new ModuleProperties();
}
this.innerProperties().withError(error);
return this;
}
/**
* Get the creationTime property: Gets or sets the creation time.
*
* @return the creationTime value.
*/
public OffsetDateTime creationTime() {
return this.innerProperties() == null ? null : this.innerProperties().creationTime();
}
/**
* Set the creationTime property: Gets or sets the creation time.
*
* @param creationTime the creationTime value to set.
* @return the ModuleInner object itself.
*/
public ModuleInner withCreationTime(OffsetDateTime creationTime) {
if (this.innerProperties() == null) {
this.innerProperties = new ModuleProperties();
}
this.innerProperties().withCreationTime(creationTime);
return this;
}
/**
* Get the lastModifiedTime property: Gets or sets the last modified time.
*
* @return the lastModifiedTime value.
*/
public OffsetDateTime lastModifiedTime() {
return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime();
}
/**
* Set the lastModifiedTime property: Gets or sets the last modified time.
*
* @param lastModifiedTime the lastModifiedTime value to set.
* @return the ModuleInner object itself.
*/
public ModuleInner withLastModifiedTime(OffsetDateTime lastModifiedTime) {
if (this.innerProperties() == null) {
this.innerProperties = new ModuleProperties();
}
this.innerProperties().withLastModifiedTime(lastModifiedTime);
return this;
}
/**
* Get the description property: Gets or sets the description.
*
* @return the description value.
*/
public String description() {
return this.innerProperties() == null ? null : this.innerProperties().description();
}
/**
* Set the description property: Gets or sets the description.
*
* @param description the description value to set.
* @return the ModuleInner object itself.
*/
public ModuleInner withDescription(String description) {
if (this.innerProperties() == null) {
this.innerProperties = new ModuleProperties();
}
this.innerProperties().withDescription(description);
return this;
}
/**
* Get the isComposite property: Gets or sets type of module, if its composite or not.
*
* @return the isComposite value.
*/
public Boolean isComposite() {
return this.innerProperties() == null ? null : this.innerProperties().isComposite();
}
/**
* Set the isComposite property: Gets or sets type of module, if its composite or not.
*
* @param isComposite the isComposite value to set.
* @return the ModuleInner object itself.
*/
public ModuleInner withIsComposite(Boolean isComposite) {
if (this.innerProperties() == null) {
this.innerProperties = new ModuleProperties();
}
this.innerProperties().withIsComposite(isComposite);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (innerProperties() != null) {
innerProperties().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("location", location());
jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element));
jsonWriter.writeJsonField("properties", this.innerProperties);
jsonWriter.writeStringField("etag", this.etag);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ModuleInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ModuleInner 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 ModuleInner.
*/
public static ModuleInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ModuleInner deserializedModuleInner = new ModuleInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedModuleInner.id = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedModuleInner.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedModuleInner.type = reader.getString();
} else if ("location".equals(fieldName)) {
deserializedModuleInner.withLocation(reader.getString());
} else if ("tags".equals(fieldName)) {
Map tags = reader.readMap(reader1 -> reader1.getString());
deserializedModuleInner.withTags(tags);
} else if ("properties".equals(fieldName)) {
deserializedModuleInner.innerProperties = ModuleProperties.fromJson(reader);
} else if ("etag".equals(fieldName)) {
deserializedModuleInner.etag = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedModuleInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy