com.azure.resourcemanager.qumulo.models.UserDetails 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.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;
/**
* User Details of Qumulo FileSystem resource.
*/
@Fluent
public final class UserDetails implements JsonSerializable {
/*
* User Email
*/
private String email;
/**
* Creates an instance of UserDetails class.
*/
public UserDetails() {
}
/**
* Get the email property: User Email.
*
* @return the email value.
*/
public String email() {
return this.email;
}
/**
* Set the email property: User Email.
*
* @param email the email value to set.
* @return the UserDetails object itself.
*/
public UserDetails withEmail(String email) {
this.email = email;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (email() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException("Missing required property email in model UserDetails"));
}
}
private static final ClientLogger LOGGER = new ClientLogger(UserDetails.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("email", this.email);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of UserDetails from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of UserDetails 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 UserDetails.
*/
public static UserDetails fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
UserDetails deserializedUserDetails = new UserDetails();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("email".equals(fieldName)) {
deserializedUserDetails.email = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedUserDetails;
});
}
}