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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.newrelicobservability.models.AccountCreationSource;
import com.azure.resourcemanager.newrelicobservability.models.OrgCreationSource;
import com.azure.resourcemanager.newrelicobservability.models.PlanData;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The details of a PlanData resource. */
@Fluent
public final class PlanDataResourceInner extends ProxyResource {
    /*
     * The resource-specific properties for this resource.
     */
    @JsonProperty(value = "properties")
    private PlanDataProperties innerProperties;

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: The resource-specific properties for this resource.
     *
     * @return the innerProperties value.
     */
    private PlanDataProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the planData property: Plan details.
     *
     * @return the planData value.
     */
    public PlanData planData() {
        return this.innerProperties() == null ? null : this.innerProperties().planData();
    }

    /**
     * Set the planData property: Plan details.
     *
     * @param planData the planData value to set.
     * @return the PlanDataResourceInner object itself.
     */
    public PlanDataResourceInner withPlanData(PlanData planData) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PlanDataProperties();
        }
        this.innerProperties().withPlanData(planData);
        return this;
    }

    /**
     * Get the orgCreationSource property: Source of org creation.
     *
     * @return the orgCreationSource value.
     */
    public OrgCreationSource orgCreationSource() {
        return this.innerProperties() == null ? null : this.innerProperties().orgCreationSource();
    }

    /**
     * Set the orgCreationSource property: Source of org creation.
     *
     * @param orgCreationSource the orgCreationSource value to set.
     * @return the PlanDataResourceInner object itself.
     */
    public PlanDataResourceInner withOrgCreationSource(OrgCreationSource orgCreationSource) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PlanDataProperties();
        }
        this.innerProperties().withOrgCreationSource(orgCreationSource);
        return this;
    }

    /**
     * Get the accountCreationSource property: Source of account creation.
     *
     * @return the accountCreationSource value.
     */
    public AccountCreationSource accountCreationSource() {
        return this.innerProperties() == null ? null : this.innerProperties().accountCreationSource();
    }

    /**
     * Set the accountCreationSource property: Source of account creation.
     *
     * @param accountCreationSource the accountCreationSource value to set.
     * @return the PlanDataResourceInner object itself.
     */
    public PlanDataResourceInner withAccountCreationSource(AccountCreationSource accountCreationSource) {
        if (this.innerProperties() == null) {
            this.innerProperties = new PlanDataProperties();
        }
        this.innerProperties().withAccountCreationSource(accountCreationSource);
        return this;
    }

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