com.azure.resourcemanager.dataprotection.models.ClientDiscoveryForLogSpecification Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-dataprotection Show documentation
Show all versions of azure-resourcemanager-dataprotection Show documentation
This package contains Microsoft Azure SDK for DataProtection Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Open API 2.0 Specs for Azure Data Protection service. Package tag package-2024-04.
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.dataprotection.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 java.io.IOException;
/**
* ClientDiscoveryForLogSpecification
*
* Class to represent shoebox log specification in json client discovery.
*/
@Fluent
public final class ClientDiscoveryForLogSpecification implements JsonSerializable {
/*
* blob duration of shoebox log specification
*/
private String blobDuration;
/*
* Localized display name
*/
private String displayName;
/*
* Name for shoebox log specification.
*/
private String name;
/**
* Creates an instance of ClientDiscoveryForLogSpecification class.
*/
public ClientDiscoveryForLogSpecification() {
}
/**
* Get the blobDuration property: blob duration of shoebox log specification.
*
* @return the blobDuration value.
*/
public String blobDuration() {
return this.blobDuration;
}
/**
* Set the blobDuration property: blob duration of shoebox log specification.
*
* @param blobDuration the blobDuration value to set.
* @return the ClientDiscoveryForLogSpecification object itself.
*/
public ClientDiscoveryForLogSpecification withBlobDuration(String blobDuration) {
this.blobDuration = blobDuration;
return this;
}
/**
* Get the displayName property: Localized display name.
*
* @return the displayName value.
*/
public String displayName() {
return this.displayName;
}
/**
* Set the displayName property: Localized display name.
*
* @param displayName the displayName value to set.
* @return the ClientDiscoveryForLogSpecification object itself.
*/
public ClientDiscoveryForLogSpecification withDisplayName(String displayName) {
this.displayName = displayName;
return this;
}
/**
* Get the name property: Name for shoebox log specification.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Set the name property: Name for shoebox log specification.
*
* @param name the name value to set.
* @return the ClientDiscoveryForLogSpecification object itself.
*/
public ClientDiscoveryForLogSpecification withName(String name) {
this.name = name;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("blobDuration", this.blobDuration);
jsonWriter.writeStringField("displayName", this.displayName);
jsonWriter.writeStringField("name", this.name);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ClientDiscoveryForLogSpecification from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ClientDiscoveryForLogSpecification 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 ClientDiscoveryForLogSpecification.
*/
public static ClientDiscoveryForLogSpecification fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ClientDiscoveryForLogSpecification deserializedClientDiscoveryForLogSpecification
= new ClientDiscoveryForLogSpecification();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("blobDuration".equals(fieldName)) {
deserializedClientDiscoveryForLogSpecification.blobDuration = reader.getString();
} else if ("displayName".equals(fieldName)) {
deserializedClientDiscoveryForLogSpecification.displayName = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedClientDiscoveryForLogSpecification.name = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedClientDiscoveryForLogSpecification;
});
}
}