com.azure.resourcemanager.qumulo.fluent.models.FileSystemResourceProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-qumulo Show documentation
Show all versions of azure-resourcemanager-qumulo Show documentation
This package contains Microsoft Azure SDK for Qumulo Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-06-19.
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.qumulo.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 com.azure.resourcemanager.qumulo.models.MarketplaceDetails;
import com.azure.resourcemanager.qumulo.models.ProvisioningState;
import com.azure.resourcemanager.qumulo.models.UserDetails;
import java.io.IOException;
import java.util.List;
/**
* Properties specific to the Qumulo File System resource.
*/
@Fluent
public final class FileSystemResourceProperties implements JsonSerializable {
/*
* Marketplace details
*/
private MarketplaceDetails marketplaceDetails;
/*
* Provisioning State of the resource
*/
private ProvisioningState provisioningState;
/*
* Storage Sku
*/
private String storageSku;
/*
* User Details
*/
private UserDetails userDetails;
/*
* Delegated subnet id for Vnet injection
*/
private String delegatedSubnetId;
/*
* File system Id of the resource
*/
private String clusterLoginUrl;
/*
* Private IPs of the resource
*/
private List privateIPs;
/*
* Initial administrator password of the resource
*/
private String adminPassword;
/*
* Availability zone
*/
private String availabilityZone;
/**
* Creates an instance of FileSystemResourceProperties class.
*/
public FileSystemResourceProperties() {
}
/**
* Get the marketplaceDetails property: Marketplace details.
*
* @return the marketplaceDetails value.
*/
public MarketplaceDetails marketplaceDetails() {
return this.marketplaceDetails;
}
/**
* Set the marketplaceDetails property: Marketplace details.
*
* @param marketplaceDetails the marketplaceDetails value to set.
* @return the FileSystemResourceProperties object itself.
*/
public FileSystemResourceProperties withMarketplaceDetails(MarketplaceDetails marketplaceDetails) {
this.marketplaceDetails = marketplaceDetails;
return this;
}
/**
* Get the provisioningState property: Provisioning State of the resource.
*
* @return the provisioningState value.
*/
public ProvisioningState provisioningState() {
return this.provisioningState;
}
/**
* Get the storageSku property: Storage Sku.
*
* @return the storageSku value.
*/
public String storageSku() {
return this.storageSku;
}
/**
* Set the storageSku property: Storage Sku.
*
* @param storageSku the storageSku value to set.
* @return the FileSystemResourceProperties object itself.
*/
public FileSystemResourceProperties withStorageSku(String storageSku) {
this.storageSku = storageSku;
return this;
}
/**
* Get the userDetails property: User Details.
*
* @return the userDetails value.
*/
public UserDetails userDetails() {
return this.userDetails;
}
/**
* Set the userDetails property: User Details.
*
* @param userDetails the userDetails value to set.
* @return the FileSystemResourceProperties object itself.
*/
public FileSystemResourceProperties withUserDetails(UserDetails userDetails) {
this.userDetails = userDetails;
return this;
}
/**
* Get the delegatedSubnetId property: Delegated subnet id for Vnet injection.
*
* @return the delegatedSubnetId value.
*/
public String delegatedSubnetId() {
return this.delegatedSubnetId;
}
/**
* Set the delegatedSubnetId property: Delegated subnet id for Vnet injection.
*
* @param delegatedSubnetId the delegatedSubnetId value to set.
* @return the FileSystemResourceProperties object itself.
*/
public FileSystemResourceProperties withDelegatedSubnetId(String delegatedSubnetId) {
this.delegatedSubnetId = delegatedSubnetId;
return this;
}
/**
* Get the clusterLoginUrl property: File system Id of the resource.
*
* @return the clusterLoginUrl value.
*/
public String clusterLoginUrl() {
return this.clusterLoginUrl;
}
/**
* Set the clusterLoginUrl property: File system Id of the resource.
*
* @param clusterLoginUrl the clusterLoginUrl value to set.
* @return the FileSystemResourceProperties object itself.
*/
public FileSystemResourceProperties withClusterLoginUrl(String clusterLoginUrl) {
this.clusterLoginUrl = clusterLoginUrl;
return this;
}
/**
* Get the privateIPs property: Private IPs of the resource.
*
* @return the privateIPs value.
*/
public List privateIPs() {
return this.privateIPs;
}
/**
* Set the privateIPs property: Private IPs of the resource.
*
* @param privateIPs the privateIPs value to set.
* @return the FileSystemResourceProperties object itself.
*/
public FileSystemResourceProperties withPrivateIPs(List privateIPs) {
this.privateIPs = privateIPs;
return this;
}
/**
* Get the adminPassword property: Initial administrator password of the resource.
*
* @return the adminPassword value.
*/
public String adminPassword() {
return this.adminPassword;
}
/**
* Set the adminPassword property: Initial administrator password of the resource.
*
* @param adminPassword the adminPassword value to set.
* @return the FileSystemResourceProperties object itself.
*/
public FileSystemResourceProperties withAdminPassword(String adminPassword) {
this.adminPassword = adminPassword;
return this;
}
/**
* Get the availabilityZone property: Availability zone.
*
* @return the availabilityZone value.
*/
public String availabilityZone() {
return this.availabilityZone;
}
/**
* Set the availabilityZone property: Availability zone.
*
* @param availabilityZone the availabilityZone value to set.
* @return the FileSystemResourceProperties object itself.
*/
public FileSystemResourceProperties withAvailabilityZone(String availabilityZone) {
this.availabilityZone = availabilityZone;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (marketplaceDetails() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property marketplaceDetails in model FileSystemResourceProperties"));
} else {
marketplaceDetails().validate();
}
if (storageSku() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property storageSku in model FileSystemResourceProperties"));
}
if (userDetails() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property userDetails in model FileSystemResourceProperties"));
} else {
userDetails().validate();
}
if (delegatedSubnetId() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property delegatedSubnetId in model FileSystemResourceProperties"));
}
if (adminPassword() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property adminPassword in model FileSystemResourceProperties"));
}
}
private static final ClientLogger LOGGER = new ClientLogger(FileSystemResourceProperties.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("marketplaceDetails", this.marketplaceDetails);
jsonWriter.writeStringField("storageSku", this.storageSku);
jsonWriter.writeJsonField("userDetails", this.userDetails);
jsonWriter.writeStringField("delegatedSubnetId", this.delegatedSubnetId);
jsonWriter.writeStringField("adminPassword", this.adminPassword);
jsonWriter.writeStringField("clusterLoginUrl", this.clusterLoginUrl);
jsonWriter.writeArrayField("privateIPs", this.privateIPs, (writer, element) -> writer.writeString(element));
jsonWriter.writeStringField("availabilityZone", this.availabilityZone);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of FileSystemResourceProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of FileSystemResourceProperties 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 FileSystemResourceProperties.
*/
public static FileSystemResourceProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
FileSystemResourceProperties deserializedFileSystemResourceProperties = new FileSystemResourceProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("marketplaceDetails".equals(fieldName)) {
deserializedFileSystemResourceProperties.marketplaceDetails = MarketplaceDetails.fromJson(reader);
} else if ("storageSku".equals(fieldName)) {
deserializedFileSystemResourceProperties.storageSku = reader.getString();
} else if ("userDetails".equals(fieldName)) {
deserializedFileSystemResourceProperties.userDetails = UserDetails.fromJson(reader);
} else if ("delegatedSubnetId".equals(fieldName)) {
deserializedFileSystemResourceProperties.delegatedSubnetId = reader.getString();
} else if ("adminPassword".equals(fieldName)) {
deserializedFileSystemResourceProperties.adminPassword = reader.getString();
} else if ("provisioningState".equals(fieldName)) {
deserializedFileSystemResourceProperties.provisioningState
= ProvisioningState.fromString(reader.getString());
} else if ("clusterLoginUrl".equals(fieldName)) {
deserializedFileSystemResourceProperties.clusterLoginUrl = reader.getString();
} else if ("privateIPs".equals(fieldName)) {
List privateIPs = reader.readArray(reader1 -> reader1.getString());
deserializedFileSystemResourceProperties.privateIPs = privateIPs;
} else if ("availabilityZone".equals(fieldName)) {
deserializedFileSystemResourceProperties.availabilityZone = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedFileSystemResourceProperties;
});
}
}