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

package com.azure.resourcemanager.azureadexternalidentities.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.azureadexternalidentities.fluent.models.B2CTenantResourceProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The request body to update the Azure AD B2C tenant resource. */
@Fluent
public final class B2CTenantUpdateRequest {
    /*
     * SKU properties of the Azure AD B2C tenant. Learn more about Azure AD B2C
     * billing at [aka.ms/b2cBilling](https://aka.ms/b2cBilling).
     */
    @JsonProperty(value = "sku")
    private B2CResourceSku sku;

    /*
     * The Azure AD B2C tenant resource properties.
     */
    @JsonProperty(value = "properties")
    private B2CTenantResourceProperties innerProperties;

    /*
     * Resource Tags
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

    /**
     * Get the sku property: SKU properties of the Azure AD B2C tenant. Learn more about Azure AD B2C billing at
     * [aka.ms/b2cBilling](https://aka.ms/b2cBilling).
     *
     * @return the sku value.
     */
    public B2CResourceSku sku() {
        return this.sku;
    }

    /**
     * Set the sku property: SKU properties of the Azure AD B2C tenant. Learn more about Azure AD B2C billing at
     * [aka.ms/b2cBilling](https://aka.ms/b2cBilling).
     *
     * @param sku the sku value to set.
     * @return the B2CTenantUpdateRequest object itself.
     */
    public B2CTenantUpdateRequest withSku(B2CResourceSku sku) {
        this.sku = sku;
        return this;
    }

    /**
     * Get the innerProperties property: The Azure AD B2C tenant resource properties.
     *
     * @return the innerProperties value.
     */
    private B2CTenantResourceProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the tags property: Resource Tags.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: Resource Tags.
     *
     * @param tags the tags value to set.
     * @return the B2CTenantUpdateRequest object itself.
     */
    public B2CTenantUpdateRequest withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

    /**
     * Get the billingConfig property: The billing configuration for the tenant.
     *
     * @return the billingConfig value.
     */
    public B2CTenantResourcePropertiesBillingConfig billingConfig() {
        return this.innerProperties() == null ? null : this.innerProperties().billingConfig();
    }

    /**
     * Set the billingConfig property: The billing configuration for the tenant.
     *
     * @param billingConfig the billingConfig value to set.
     * @return the B2CTenantUpdateRequest object itself.
     */
    public B2CTenantUpdateRequest withBillingConfig(B2CTenantResourcePropertiesBillingConfig billingConfig) {
        if (this.innerProperties() == null) {
            this.innerProperties = new B2CTenantResourceProperties();
        }
        this.innerProperties().withBillingConfig(billingConfig);
        return this;
    }

    /**
     * Get the tenantId property: An identifier of the Azure AD B2C tenant.
     *
     * @return the tenantId value.
     */
    public String tenantId() {
        return this.innerProperties() == null ? null : this.innerProperties().tenantId();
    }

    /**
     * Set the tenantId property: An identifier of the Azure AD B2C tenant.
     *
     * @param tenantId the tenantId value to set.
     * @return the B2CTenantUpdateRequest object itself.
     */
    public B2CTenantUpdateRequest withTenantId(String tenantId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new B2CTenantResourceProperties();
        }
        this.innerProperties().withTenantId(tenantId);
        return this;
    }

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