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

package com.azure.resourcemanager.securityinsights.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;

/** Consent for Office365 tenant that already made. */
@Fluent
public final class OfficeConsentInner extends ProxyResource {
    /*
     * Office consent properties
     */
    @JsonProperty(value = "properties")
    private OfficeConsentProperties innerProperties;

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

    /**
     * Get the innerProperties property: Office consent properties.
     *
     * @return the innerProperties value.
     */
    private OfficeConsentProperties 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 tenantId property: The tenantId of the Office365 with the consent.
     *
     * @return the tenantId value.
     */
    public String tenantId() {
        return this.innerProperties() == null ? null : this.innerProperties().tenantId();
    }

    /**
     * Set the tenantId property: The tenantId of the Office365 with the consent.
     *
     * @param tenantId the tenantId value to set.
     * @return the OfficeConsentInner object itself.
     */
    public OfficeConsentInner withTenantId(String tenantId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new OfficeConsentProperties();
        }
        this.innerProperties().withTenantId(tenantId);
        return this;
    }

    /**
     * Get the consentId property: Help to easily cascade among the data layers.
     *
     * @return the consentId value.
     */
    public String consentId() {
        return this.innerProperties() == null ? null : this.innerProperties().consentId();
    }

    /**
     * Set the consentId property: Help to easily cascade among the data layers.
     *
     * @param consentId the consentId value to set.
     * @return the OfficeConsentInner object itself.
     */
    public OfficeConsentInner withConsentId(String consentId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new OfficeConsentProperties();
        }
        this.innerProperties().withConsentId(consentId);
        return this;
    }

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