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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The commitment plan association. */
@Fluent
public final class CommitmentPlanAccountAssociationInner extends ProxyResource {
    /*
     * Metadata pertaining to creation and last modification of the resource.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

    /*
     * Resource Etag.
     */
    @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY)
    private String etag;

    /*
     * Properties of Cognitive Services account commitment plan association.
     */
    @JsonProperty(value = "properties")
    private CommitmentPlanAccountAssociationProperties innerProperties;

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

    /**
     * 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 etag property: Resource Etag.
     *
     * @return the etag value.
     */
    public String etag() {
        return this.etag;
    }

    /**
     * Get the innerProperties property: Properties of Cognitive Services account commitment plan association.
     *
     * @return the innerProperties value.
     */
    private CommitmentPlanAccountAssociationProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the accountId property: The Azure resource id of the account.
     *
     * @return the accountId value.
     */
    public String accountId() {
        return this.innerProperties() == null ? null : this.innerProperties().accountId();
    }

    /**
     * Set the accountId property: The Azure resource id of the account.
     *
     * @param accountId the accountId value to set.
     * @return the CommitmentPlanAccountAssociationInner object itself.
     */
    public CommitmentPlanAccountAssociationInner withAccountId(String accountId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new CommitmentPlanAccountAssociationProperties();
        }
        this.innerProperties().withAccountId(accountId);
        return this;
    }

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