com.azure.resourcemanager.netapp.fluent.models.MountTargetProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-netapp Show documentation
Show all versions of azure-resourcemanager-netapp Show documentation
This package contains Microsoft Azure SDK for NetAppFiles Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-2024-03.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.netapp.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* Mount target properties.
*/
@Fluent
public final class MountTargetProperties implements JsonSerializable {
/*
* UUID v4 used to identify the MountTarget
*/
private String mountTargetId;
/*
* UUID v4 used to identify the MountTarget
*/
private String fileSystemId;
/*
* The mount target's IPv4 address
*/
private String ipAddress;
/*
* The SMB server's Fully Qualified Domain Name, FQDN
*/
private String smbServerFqdn;
/**
* Creates an instance of MountTargetProperties class.
*/
public MountTargetProperties() {
}
/**
* Get the mountTargetId property: UUID v4 used to identify the MountTarget.
*
* @return the mountTargetId value.
*/
public String mountTargetId() {
return this.mountTargetId;
}
/**
* Get the fileSystemId property: UUID v4 used to identify the MountTarget.
*
* @return the fileSystemId value.
*/
public String fileSystemId() {
return this.fileSystemId;
}
/**
* Set the fileSystemId property: UUID v4 used to identify the MountTarget.
*
* @param fileSystemId the fileSystemId value to set.
* @return the MountTargetProperties object itself.
*/
public MountTargetProperties withFileSystemId(String fileSystemId) {
this.fileSystemId = fileSystemId;
return this;
}
/**
* Get the ipAddress property: The mount target's IPv4 address.
*
* @return the ipAddress value.
*/
public String ipAddress() {
return this.ipAddress;
}
/**
* Get the smbServerFqdn property: The SMB server's Fully Qualified Domain Name, FQDN.
*
* @return the smbServerFqdn value.
*/
public String smbServerFqdn() {
return this.smbServerFqdn;
}
/**
* Set the smbServerFqdn property: The SMB server's Fully Qualified Domain Name, FQDN.
*
* @param smbServerFqdn the smbServerFqdn value to set.
* @return the MountTargetProperties object itself.
*/
public MountTargetProperties withSmbServerFqdn(String smbServerFqdn) {
this.smbServerFqdn = smbServerFqdn;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (fileSystemId() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property fileSystemId in model MountTargetProperties"));
}
}
private static final ClientLogger LOGGER = new ClientLogger(MountTargetProperties.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("fileSystemId", this.fileSystemId);
jsonWriter.writeStringField("smbServerFqdn", this.smbServerFqdn);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of MountTargetProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of MountTargetProperties 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 MountTargetProperties.
*/
public static MountTargetProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
MountTargetProperties deserializedMountTargetProperties = new MountTargetProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("fileSystemId".equals(fieldName)) {
deserializedMountTargetProperties.fileSystemId = reader.getString();
} else if ("mountTargetId".equals(fieldName)) {
deserializedMountTargetProperties.mountTargetId = reader.getString();
} else if ("ipAddress".equals(fieldName)) {
deserializedMountTargetProperties.ipAddress = reader.getString();
} else if ("smbServerFqdn".equals(fieldName)) {
deserializedMountTargetProperties.smbServerFqdn = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedMountTargetProperties;
});
}
}