// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.securityinsights.models.EnrichmentDomainWhoisDetails;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Whois information for a given domain and associated metadata. */
@Fluent
public final class EnrichmentDomainWhoisInner {
    /*
     * The domain for this whois record
     */
    @JsonProperty(value = "domain")
    private String domain;

    /*
     * The hostname of this registrar's whois server
     */
    @JsonProperty(value = "server")
    private String server;

    /*
     * The timestamp at which this record was created
     */
    @JsonProperty(value = "created")
    private OffsetDateTime created;

    /*
     * The timestamp at which this record was last updated
     */
    @JsonProperty(value = "updated")
    private OffsetDateTime updated;

    /*
     * The timestamp at which this record will expire
     */
    @JsonProperty(value = "expires")
    private OffsetDateTime expires;

    /*
     * The whois record for a given domain
     */
    @JsonProperty(value = "parsedWhois")
    private EnrichmentDomainWhoisDetails parsedWhois;

    /**
     * Get the domain property: The domain for this whois record.
     *
     * @return the domain value.
     */
    public String domain() {
        return this.domain;
    }

    /**
     * Set the domain property: The domain for this whois record.
     *
     * @param domain the domain value to set.
     * @return the EnrichmentDomainWhoisInner object itself.
     */
    public EnrichmentDomainWhoisInner withDomain(String domain) {
        this.domain = domain;
        return this;
    }

    /**
     * Get the server property: The hostname of this registrar's whois server.
     *
     * @return the server value.
     */
    public String server() {
        return this.server;
    }

    /**
     * Set the server property: The hostname of this registrar's whois server.
     *
     * @param server the server value to set.
     * @return the EnrichmentDomainWhoisInner object itself.
     */
    public EnrichmentDomainWhoisInner withServer(String server) {
        this.server = server;
        return this;
    }

    /**
     * Get the created property: The timestamp at which this record was created.
     *
     * @return the created value.
     */
    public OffsetDateTime created() {
        return this.created;
    }

    /**
     * Set the created property: The timestamp at which this record was created.
     *
     * @param created the created value to set.
     * @return the EnrichmentDomainWhoisInner object itself.
     */
    public EnrichmentDomainWhoisInner withCreated(OffsetDateTime created) {
        this.created = created;
        return this;
    }

    /**
     * Get the updated property: The timestamp at which this record was last updated.
     *
     * @return the updated value.
     */
    public OffsetDateTime updated() {
        return this.updated;
    }

    /**
     * Set the updated property: The timestamp at which this record was last updated.
     *
     * @param updated the updated value to set.
     * @return the EnrichmentDomainWhoisInner object itself.
     */
    public EnrichmentDomainWhoisInner withUpdated(OffsetDateTime updated) {
        this.updated = updated;
        return this;
    }

    /**
     * Get the expires property: The timestamp at which this record will expire.
     *
     * @return the expires value.
     */
    public OffsetDateTime expires() {
        return this.expires;
    }

    /**
     * Set the expires property: The timestamp at which this record will expire.
     *
     * @param expires the expires value to set.
     * @return the EnrichmentDomainWhoisInner object itself.
     */
    public EnrichmentDomainWhoisInner withExpires(OffsetDateTime expires) {
        this.expires = expires;
        return this;
    }

    /**
     * Get the parsedWhois property: The whois record for a given domain.
     *
     * @return the parsedWhois value.
     */
    public EnrichmentDomainWhoisDetails parsedWhois() {
        return this.parsedWhois;
    }

    /**
     * Set the parsedWhois property: The whois record for a given domain.
     *
     * @param parsedWhois the parsedWhois value to set.
     * @return the EnrichmentDomainWhoisInner object itself.
     */
    public EnrichmentDomainWhoisInner withParsedWhois(EnrichmentDomainWhoisDetails parsedWhois) {
        this.parsedWhois = parsedWhois;
        return this;
    }

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