// 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.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The whois record for a given domain. */
@Fluent
public final class EnrichmentDomainWhoisDetails {
    /*
     * The registrar associated with this domain
     */
    @JsonProperty(value = "registrar")
    private EnrichmentDomainWhoisRegistrarDetails registrar;

    /*
     * The set of contacts associated with this domain
     */
    @JsonProperty(value = "contacts")
    private EnrichmentDomainWhoisContacts contacts;

    /*
     * A list of name servers associated with this domain
     */
    @JsonProperty(value = "nameServers")
    private List<String> nameServers;

    /*
     * The set of status flags for this whois record
     */
    @JsonProperty(value = "statuses")
    private List<String> statuses;

    /**
     * Get the registrar property: The registrar associated with this domain.
     *
     * @return the registrar value.
     */
    public EnrichmentDomainWhoisRegistrarDetails registrar() {
        return this.registrar;
    }

    /**
     * Set the registrar property: The registrar associated with this domain.
     *
     * @param registrar the registrar value to set.
     * @return the EnrichmentDomainWhoisDetails object itself.
     */
    public EnrichmentDomainWhoisDetails withRegistrar(EnrichmentDomainWhoisRegistrarDetails registrar) {
        this.registrar = registrar;
        return this;
    }

    /**
     * Get the contacts property: The set of contacts associated with this domain.
     *
     * @return the contacts value.
     */
    public EnrichmentDomainWhoisContacts contacts() {
        return this.contacts;
    }

    /**
     * Set the contacts property: The set of contacts associated with this domain.
     *
     * @param contacts the contacts value to set.
     * @return the EnrichmentDomainWhoisDetails object itself.
     */
    public EnrichmentDomainWhoisDetails withContacts(EnrichmentDomainWhoisContacts contacts) {
        this.contacts = contacts;
        return this;
    }

    /**
     * Get the nameServers property: A list of name servers associated with this domain.
     *
     * @return the nameServers value.
     */
    public List<String> nameServers() {
        return this.nameServers;
    }

    /**
     * Set the nameServers property: A list of name servers associated with this domain.
     *
     * @param nameServers the nameServers value to set.
     * @return the EnrichmentDomainWhoisDetails object itself.
     */
    public EnrichmentDomainWhoisDetails withNameServers(List<String> nameServers) {
        this.nameServers = nameServers;
        return this;
    }

    /**
     * Get the statuses property: The set of status flags for this whois record.
     *
     * @return the statuses value.
     */
    public List<String> statuses() {
        return this.statuses;
    }

    /**
     * Set the statuses property: The set of status flags for this whois record.
     *
     * @param statuses the statuses value to set.
     * @return the EnrichmentDomainWhoisDetails object itself.
     */
    public EnrichmentDomainWhoisDetails withStatuses(List<String> statuses) {
        this.statuses = statuses;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (registrar() != null) {
            registrar().validate();
        }
        if (contacts() != null) {
            contacts().validate();
        }
    }
}
