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

/** The properties of a department. */
@Fluent
public final class DepartmentProperties {
    /*
     * The name of the department.
     */
    @JsonProperty(value = "departmentName")
    private String departmentName;

    /*
     * The cost center associated with the department.
     */
    @JsonProperty(value = "costCenter")
    private String costCenter;

    /*
     * The status of the department.
     */
    @JsonProperty(value = "status")
    private String status;

    /*
     * Associated enrollment accounts. By default this is not populated, unless it's specified in $expand.
     */
    @JsonProperty(value = "enrollmentAccounts")
    private List<EnrollmentAccount> enrollmentAccounts;

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

    /**
     * Get the departmentName property: The name of the department.
     *
     * @return the departmentName value.
     */
    public String departmentName() {
        return this.departmentName;
    }

    /**
     * Set the departmentName property: The name of the department.
     *
     * @param departmentName the departmentName value to set.
     * @return the DepartmentProperties object itself.
     */
    public DepartmentProperties withDepartmentName(String departmentName) {
        this.departmentName = departmentName;
        return this;
    }

    /**
     * Get the costCenter property: The cost center associated with the department.
     *
     * @return the costCenter value.
     */
    public String costCenter() {
        return this.costCenter;
    }

    /**
     * Set the costCenter property: The cost center associated with the department.
     *
     * @param costCenter the costCenter value to set.
     * @return the DepartmentProperties object itself.
     */
    public DepartmentProperties withCostCenter(String costCenter) {
        this.costCenter = costCenter;
        return this;
    }

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

    /**
     * Set the status property: The status of the department.
     *
     * @param status the status value to set.
     * @return the DepartmentProperties object itself.
     */
    public DepartmentProperties withStatus(String status) {
        this.status = status;
        return this;
    }

    /**
     * Get the enrollmentAccounts property: Associated enrollment accounts. By default this is not populated, unless
     * it's specified in $expand.
     *
     * @return the enrollmentAccounts value.
     */
    public List<EnrollmentAccount> enrollmentAccounts() {
        return this.enrollmentAccounts;
    }

    /**
     * Set the enrollmentAccounts property: Associated enrollment accounts. By default this is not populated, unless
     * it's specified in $expand.
     *
     * @param enrollmentAccounts the enrollmentAccounts value to set.
     * @return the DepartmentProperties object itself.
     */
    public DepartmentProperties withEnrollmentAccounts(List<EnrollmentAccount> enrollmentAccounts) {
        this.enrollmentAccounts = enrollmentAccounts;
        return this;
    }

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