// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.confluent.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Agreement Terms definition. */
@Fluent
public final class ConfluentAgreementResourceInner extends ProxyResource {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(ConfluentAgreementResourceInner.class);

    /*
     * Metadata pertaining to creation and last modification of the resource
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

    /*
     * Represents the properties of the resource.
     */
    @JsonProperty(value = "properties")
    private ConfluentAgreementProperties innerProperties;

    /**
     * Get the systemData property: Metadata pertaining to creation and last modification of the resource.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the innerProperties property: Represents the properties of the resource.
     *
     * @return the innerProperties value.
     */
    private ConfluentAgreementProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the publisher property: Publisher identifier string.
     *
     * @return the publisher value.
     */
    public String publisher() {
        return this.innerProperties() == null ? null : this.innerProperties().publisher();
    }

    /**
     * Set the publisher property: Publisher identifier string.
     *
     * @param publisher the publisher value to set.
     * @return the ConfluentAgreementResourceInner object itself.
     */
    public ConfluentAgreementResourceInner withPublisher(String publisher) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ConfluentAgreementProperties();
        }
        this.innerProperties().withPublisher(publisher);
        return this;
    }

    /**
     * Get the product property: Product identifier string.
     *
     * @return the product value.
     */
    public String product() {
        return this.innerProperties() == null ? null : this.innerProperties().product();
    }

    /**
     * Set the product property: Product identifier string.
     *
     * @param product the product value to set.
     * @return the ConfluentAgreementResourceInner object itself.
     */
    public ConfluentAgreementResourceInner withProduct(String product) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ConfluentAgreementProperties();
        }
        this.innerProperties().withProduct(product);
        return this;
    }

    /**
     * Get the plan property: Plan identifier string.
     *
     * @return the plan value.
     */
    public String plan() {
        return this.innerProperties() == null ? null : this.innerProperties().plan();
    }

    /**
     * Set the plan property: Plan identifier string.
     *
     * @param plan the plan value to set.
     * @return the ConfluentAgreementResourceInner object itself.
     */
    public ConfluentAgreementResourceInner withPlan(String plan) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ConfluentAgreementProperties();
        }
        this.innerProperties().withPlan(plan);
        return this;
    }

    /**
     * Get the licenseTextLink property: Link to HTML with Microsoft and Publisher terms.
     *
     * @return the licenseTextLink value.
     */
    public String licenseTextLink() {
        return this.innerProperties() == null ? null : this.innerProperties().licenseTextLink();
    }

    /**
     * Set the licenseTextLink property: Link to HTML with Microsoft and Publisher terms.
     *
     * @param licenseTextLink the licenseTextLink value to set.
     * @return the ConfluentAgreementResourceInner object itself.
     */
    public ConfluentAgreementResourceInner withLicenseTextLink(String licenseTextLink) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ConfluentAgreementProperties();
        }
        this.innerProperties().withLicenseTextLink(licenseTextLink);
        return this;
    }

    /**
     * Get the privacyPolicyLink property: Link to the privacy policy of the publisher.
     *
     * @return the privacyPolicyLink value.
     */
    public String privacyPolicyLink() {
        return this.innerProperties() == null ? null : this.innerProperties().privacyPolicyLink();
    }

    /**
     * Set the privacyPolicyLink property: Link to the privacy policy of the publisher.
     *
     * @param privacyPolicyLink the privacyPolicyLink value to set.
     * @return the ConfluentAgreementResourceInner object itself.
     */
    public ConfluentAgreementResourceInner withPrivacyPolicyLink(String privacyPolicyLink) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ConfluentAgreementProperties();
        }
        this.innerProperties().withPrivacyPolicyLink(privacyPolicyLink);
        return this;
    }

    /**
     * Get the retrieveDatetime property: Date and time in UTC of when the terms were accepted. This is empty if
     * Accepted is false.
     *
     * @return the retrieveDatetime value.
     */
    public OffsetDateTime retrieveDatetime() {
        return this.innerProperties() == null ? null : this.innerProperties().retrieveDatetime();
    }

    /**
     * Set the retrieveDatetime property: Date and time in UTC of when the terms were accepted. This is empty if
     * Accepted is false.
     *
     * @param retrieveDatetime the retrieveDatetime value to set.
     * @return the ConfluentAgreementResourceInner object itself.
     */
    public ConfluentAgreementResourceInner withRetrieveDatetime(OffsetDateTime retrieveDatetime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ConfluentAgreementProperties();
        }
        this.innerProperties().withRetrieveDatetime(retrieveDatetime);
        return this;
    }

    /**
     * Get the signature property: Terms signature.
     *
     * @return the signature value.
     */
    public String signature() {
        return this.innerProperties() == null ? null : this.innerProperties().signature();
    }

    /**
     * Set the signature property: Terms signature.
     *
     * @param signature the signature value to set.
     * @return the ConfluentAgreementResourceInner object itself.
     */
    public ConfluentAgreementResourceInner withSignature(String signature) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ConfluentAgreementProperties();
        }
        this.innerProperties().withSignature(signature);
        return this;
    }

    /**
     * Get the accepted property: If any version of the terms have been accepted, otherwise false.
     *
     * @return the accepted value.
     */
    public Boolean accepted() {
        return this.innerProperties() == null ? null : this.innerProperties().accepted();
    }

    /**
     * Set the accepted property: If any version of the terms have been accepted, otherwise false.
     *
     * @param accepted the accepted value to set.
     * @return the ConfluentAgreementResourceInner object itself.
     */
    public ConfluentAgreementResourceInner withAccepted(Boolean accepted) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ConfluentAgreementProperties();
        }
        this.innerProperties().withAccepted(accepted);
        return this;
    }

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