com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisContacts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-securityinsights Show documentation
Show all versions of azure-resourcemanager-securityinsights Show documentation
This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2022-09.
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.securityinsights.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;
/**
* The set of contacts associated with this domain.
*/
@Fluent
public final class EnrichmentDomainWhoisContacts implements JsonSerializable {
/*
* The admin contact for this whois record
*/
private EnrichmentDomainWhoisContact admin;
/*
* The billing contact for this whois record
*/
private EnrichmentDomainWhoisContact billing;
/*
* The registrant contact for this whois record
*/
private EnrichmentDomainWhoisContact registrant;
/*
* The technical contact for this whois record
*/
private EnrichmentDomainWhoisContact tech;
/**
* Creates an instance of EnrichmentDomainWhoisContacts class.
*/
public EnrichmentDomainWhoisContacts() {
}
/**
* Get the admin property: The admin contact for this whois record.
*
* @return the admin value.
*/
public EnrichmentDomainWhoisContact admin() {
return this.admin;
}
/**
* Set the admin property: The admin contact for this whois record.
*
* @param admin the admin value to set.
* @return the EnrichmentDomainWhoisContacts object itself.
*/
public EnrichmentDomainWhoisContacts withAdmin(EnrichmentDomainWhoisContact admin) {
this.admin = admin;
return this;
}
/**
* Get the billing property: The billing contact for this whois record.
*
* @return the billing value.
*/
public EnrichmentDomainWhoisContact billing() {
return this.billing;
}
/**
* Set the billing property: The billing contact for this whois record.
*
* @param billing the billing value to set.
* @return the EnrichmentDomainWhoisContacts object itself.
*/
public EnrichmentDomainWhoisContacts withBilling(EnrichmentDomainWhoisContact billing) {
this.billing = billing;
return this;
}
/**
* Get the registrant property: The registrant contact for this whois record.
*
* @return the registrant value.
*/
public EnrichmentDomainWhoisContact registrant() {
return this.registrant;
}
/**
* Set the registrant property: The registrant contact for this whois record.
*
* @param registrant the registrant value to set.
* @return the EnrichmentDomainWhoisContacts object itself.
*/
public EnrichmentDomainWhoisContacts withRegistrant(EnrichmentDomainWhoisContact registrant) {
this.registrant = registrant;
return this;
}
/**
* Get the tech property: The technical contact for this whois record.
*
* @return the tech value.
*/
public EnrichmentDomainWhoisContact tech() {
return this.tech;
}
/**
* Set the tech property: The technical contact for this whois record.
*
* @param tech the tech value to set.
* @return the EnrichmentDomainWhoisContacts object itself.
*/
public EnrichmentDomainWhoisContacts withTech(EnrichmentDomainWhoisContact tech) {
this.tech = tech;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (admin() != null) {
admin().validate();
}
if (billing() != null) {
billing().validate();
}
if (registrant() != null) {
registrant().validate();
}
if (tech() != null) {
tech().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("admin", this.admin);
jsonWriter.writeJsonField("billing", this.billing);
jsonWriter.writeJsonField("registrant", this.registrant);
jsonWriter.writeJsonField("tech", this.tech);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of EnrichmentDomainWhoisContacts from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of EnrichmentDomainWhoisContacts 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 EnrichmentDomainWhoisContacts.
*/
public static EnrichmentDomainWhoisContacts fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
EnrichmentDomainWhoisContacts deserializedEnrichmentDomainWhoisContacts
= new EnrichmentDomainWhoisContacts();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("admin".equals(fieldName)) {
deserializedEnrichmentDomainWhoisContacts.admin = EnrichmentDomainWhoisContact.fromJson(reader);
} else if ("billing".equals(fieldName)) {
deserializedEnrichmentDomainWhoisContacts.billing = EnrichmentDomainWhoisContact.fromJson(reader);
} else if ("registrant".equals(fieldName)) {
deserializedEnrichmentDomainWhoisContacts.registrant
= EnrichmentDomainWhoisContact.fromJson(reader);
} else if ("tech".equals(fieldName)) {
deserializedEnrichmentDomainWhoisContacts.tech = EnrichmentDomainWhoisContact.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedEnrichmentDomainWhoisContacts;
});
}
}