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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.billing.models.AcceptanceMode;
import com.azure.resourcemanager.billing.models.BillingProfileInfo;
import com.azure.resourcemanager.billing.models.Category;
import com.azure.resourcemanager.billing.models.Participants;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** The properties of an agreement. */
@Fluent
public final class AgreementProperties {
    /*
     * The URL to download the agreement.
     */
    @JsonProperty(value = "agreementLink", access = JsonProperty.Access.WRITE_ONLY)
    private String agreementLink;

    /*
     * The category of the agreement signed by a customer.
     */
    @JsonProperty(value = "category", access = JsonProperty.Access.WRITE_ONLY)
    private Category category;

    /*
     * The mode of acceptance for an agreement.
     */
    @JsonProperty(value = "acceptanceMode", access = JsonProperty.Access.WRITE_ONLY)
    private AcceptanceMode acceptanceMode;

    /*
     * The list of billing profiles associated with agreement and present only for specific agreements.
     */
    @JsonProperty(value = "billingProfileInfo", access = JsonProperty.Access.WRITE_ONLY)
    private BillingProfileInfo billingProfileInfo;

    /*
     * The date from which the agreement is effective.
     */
    @JsonProperty(value = "effectiveDate", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime effectiveDate;

    /*
     * The date when the agreement expires.
     */
    @JsonProperty(value = "expirationDate", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime expirationDate;

    /*
     * The list of participants that participates in acceptance of an agreement.
     */
    @JsonProperty(value = "participants")
    private List<Participants> participants;

    /*
     * The current status of the agreement.
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private String status;

    /** Creates an instance of AgreementProperties class. */
    public AgreementProperties() {
    }

    /**
     * Get the agreementLink property: The URL to download the agreement.
     *
     * @return the agreementLink value.
     */
    public String agreementLink() {
        return this.agreementLink;
    }

    /**
     * Get the category property: The category of the agreement signed by a customer.
     *
     * @return the category value.
     */
    public Category category() {
        return this.category;
    }

    /**
     * Get the acceptanceMode property: The mode of acceptance for an agreement.
     *
     * @return the acceptanceMode value.
     */
    public AcceptanceMode acceptanceMode() {
        return this.acceptanceMode;
    }

    /**
     * Get the billingProfileInfo property: The list of billing profiles associated with agreement and present only for
     * specific agreements.
     *
     * @return the billingProfileInfo value.
     */
    public BillingProfileInfo billingProfileInfo() {
        return this.billingProfileInfo;
    }

    /**
     * Get the effectiveDate property: The date from which the agreement is effective.
     *
     * @return the effectiveDate value.
     */
    public OffsetDateTime effectiveDate() {
        return this.effectiveDate;
    }

    /**
     * Get the expirationDate property: The date when the agreement expires.
     *
     * @return the expirationDate value.
     */
    public OffsetDateTime expirationDate() {
        return this.expirationDate;
    }

    /**
     * Get the participants property: The list of participants that participates in acceptance of an agreement.
     *
     * @return the participants value.
     */
    public List<Participants> participants() {
        return this.participants;
    }

    /**
     * Set the participants property: The list of participants that participates in acceptance of an agreement.
     *
     * @param participants the participants value to set.
     * @return the AgreementProperties object itself.
     */
    public AgreementProperties withParticipants(List<Participants> participants) {
        this.participants = participants;
        return this;
    }

    /**
     * Get the status property: The current status of the agreement.
     *
     * @return the status value.
     */
    public String status() {
        return this.status;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (billingProfileInfo() != null) {
            billingProfileInfo().validate();
        }
        if (participants() != null) {
            participants().forEach(e -> e.validate());
        }
    }
}
