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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.resourcemanager.customerinsights.models.CalculationWindowTypes;
import com.azure.resourcemanager.customerinsights.models.EntityTypes;
import com.azure.resourcemanager.customerinsights.models.KpiAlias;
import com.azure.resourcemanager.customerinsights.models.KpiExtract;
import com.azure.resourcemanager.customerinsights.models.KpiFunctions;
import com.azure.resourcemanager.customerinsights.models.KpiGroupByMetadata;
import com.azure.resourcemanager.customerinsights.models.KpiParticipantProfilesMetadata;
import com.azure.resourcemanager.customerinsights.models.KpiThresholds;
import com.azure.resourcemanager.customerinsights.models.ProvisioningStates;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** The KPI resource format. */
@Fluent
public final class KpiResourceFormatInner extends ProxyResource {
    /*
     * Defines the KPI Threshold limits.
     */
    @JsonProperty(value = "properties")
    private KpiDefinitionInner innerProperties;

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

    /**
     * Get the innerProperties property: Defines the KPI Threshold limits.
     *
     * @return the innerProperties value.
     */
    private KpiDefinitionInner innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the entityType property: The mapping entity type.
     *
     * @return the entityType value.
     */
    public EntityTypes entityType() {
        return this.innerProperties() == null ? null : this.innerProperties().entityType();
    }

    /**
     * Set the entityType property: The mapping entity type.
     *
     * @param entityType the entityType value to set.
     * @return the KpiResourceFormatInner object itself.
     */
    public KpiResourceFormatInner withEntityType(EntityTypes entityType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new KpiDefinitionInner();
        }
        this.innerProperties().withEntityType(entityType);
        return this;
    }

    /**
     * Get the entityTypeName property: The mapping entity name.
     *
     * @return the entityTypeName value.
     */
    public String entityTypeName() {
        return this.innerProperties() == null ? null : this.innerProperties().entityTypeName();
    }

    /**
     * Set the entityTypeName property: The mapping entity name.
     *
     * @param entityTypeName the entityTypeName value to set.
     * @return the KpiResourceFormatInner object itself.
     */
    public KpiResourceFormatInner withEntityTypeName(String entityTypeName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new KpiDefinitionInner();
        }
        this.innerProperties().withEntityTypeName(entityTypeName);
        return this;
    }

    /**
     * Get the tenantId property: The hub name.
     *
     * @return the tenantId value.
     */
    public String tenantId() {
        return this.innerProperties() == null ? null : this.innerProperties().tenantId();
    }

    /**
     * Get the kpiName property: The KPI name.
     *
     * @return the kpiName value.
     */
    public String kpiName() {
        return this.innerProperties() == null ? null : this.innerProperties().kpiName();
    }

    /**
     * Get the displayName property: Localized display name for the KPI.
     *
     * @return the displayName value.
     */
    public Map<String, String> displayName() {
        return this.innerProperties() == null ? null : this.innerProperties().displayName();
    }

    /**
     * Set the displayName property: Localized display name for the KPI.
     *
     * @param displayName the displayName value to set.
     * @return the KpiResourceFormatInner object itself.
     */
    public KpiResourceFormatInner withDisplayName(Map<String, String> displayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new KpiDefinitionInner();
        }
        this.innerProperties().withDisplayName(displayName);
        return this;
    }

    /**
     * Get the description property: Localized description for the KPI.
     *
     * @return the description value.
     */
    public Map<String, String> description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: Localized description for the KPI.
     *
     * @param description the description value to set.
     * @return the KpiResourceFormatInner object itself.
     */
    public KpiResourceFormatInner withDescription(Map<String, String> description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new KpiDefinitionInner();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the calculationWindow property: The calculation window.
     *
     * @return the calculationWindow value.
     */
    public CalculationWindowTypes calculationWindow() {
        return this.innerProperties() == null ? null : this.innerProperties().calculationWindow();
    }

    /**
     * Set the calculationWindow property: The calculation window.
     *
     * @param calculationWindow the calculationWindow value to set.
     * @return the KpiResourceFormatInner object itself.
     */
    public KpiResourceFormatInner withCalculationWindow(CalculationWindowTypes calculationWindow) {
        if (this.innerProperties() == null) {
            this.innerProperties = new KpiDefinitionInner();
        }
        this.innerProperties().withCalculationWindow(calculationWindow);
        return this;
    }

    /**
     * Get the calculationWindowFieldName property: Name of calculation window field.
     *
     * @return the calculationWindowFieldName value.
     */
    public String calculationWindowFieldName() {
        return this.innerProperties() == null ? null : this.innerProperties().calculationWindowFieldName();
    }

    /**
     * Set the calculationWindowFieldName property: Name of calculation window field.
     *
     * @param calculationWindowFieldName the calculationWindowFieldName value to set.
     * @return the KpiResourceFormatInner object itself.
     */
    public KpiResourceFormatInner withCalculationWindowFieldName(String calculationWindowFieldName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new KpiDefinitionInner();
        }
        this.innerProperties().withCalculationWindowFieldName(calculationWindowFieldName);
        return this;
    }

    /**
     * Get the function property: The computation function for the KPI.
     *
     * @return the function value.
     */
    public KpiFunctions function() {
        return this.innerProperties() == null ? null : this.innerProperties().function();
    }

    /**
     * Set the function property: The computation function for the KPI.
     *
     * @param function the function value to set.
     * @return the KpiResourceFormatInner object itself.
     */
    public KpiResourceFormatInner withFunction(KpiFunctions function) {
        if (this.innerProperties() == null) {
            this.innerProperties = new KpiDefinitionInner();
        }
        this.innerProperties().withFunction(function);
        return this;
    }

    /**
     * Get the expression property: The computation expression for the KPI.
     *
     * @return the expression value.
     */
    public String expression() {
        return this.innerProperties() == null ? null : this.innerProperties().expression();
    }

    /**
     * Set the expression property: The computation expression for the KPI.
     *
     * @param expression the expression value to set.
     * @return the KpiResourceFormatInner object itself.
     */
    public KpiResourceFormatInner withExpression(String expression) {
        if (this.innerProperties() == null) {
            this.innerProperties = new KpiDefinitionInner();
        }
        this.innerProperties().withExpression(expression);
        return this;
    }

    /**
     * Get the unit property: The unit of measurement for the KPI.
     *
     * @return the unit value.
     */
    public String unit() {
        return this.innerProperties() == null ? null : this.innerProperties().unit();
    }

    /**
     * Set the unit property: The unit of measurement for the KPI.
     *
     * @param unit the unit value to set.
     * @return the KpiResourceFormatInner object itself.
     */
    public KpiResourceFormatInner withUnit(String unit) {
        if (this.innerProperties() == null) {
            this.innerProperties = new KpiDefinitionInner();
        }
        this.innerProperties().withUnit(unit);
        return this;
    }

    /**
     * Get the filter property: The filter expression for the KPI.
     *
     * @return the filter value.
     */
    public String filter() {
        return this.innerProperties() == null ? null : this.innerProperties().filter();
    }

    /**
     * Set the filter property: The filter expression for the KPI.
     *
     * @param filter the filter value to set.
     * @return the KpiResourceFormatInner object itself.
     */
    public KpiResourceFormatInner withFilter(String filter) {
        if (this.innerProperties() == null) {
            this.innerProperties = new KpiDefinitionInner();
        }
        this.innerProperties().withFilter(filter);
        return this;
    }

    /**
     * Get the groupBy property: the group by properties for the KPI.
     *
     * @return the groupBy value.
     */
    public List<String> groupBy() {
        return this.innerProperties() == null ? null : this.innerProperties().groupBy();
    }

    /**
     * Set the groupBy property: the group by properties for the KPI.
     *
     * @param groupBy the groupBy value to set.
     * @return the KpiResourceFormatInner object itself.
     */
    public KpiResourceFormatInner withGroupBy(List<String> groupBy) {
        if (this.innerProperties() == null) {
            this.innerProperties = new KpiDefinitionInner();
        }
        this.innerProperties().withGroupBy(groupBy);
        return this;
    }

    /**
     * Get the groupByMetadata property: The KPI GroupByMetadata.
     *
     * @return the groupByMetadata value.
     */
    public List<KpiGroupByMetadata> groupByMetadata() {
        return this.innerProperties() == null ? null : this.innerProperties().groupByMetadata();
    }

    /**
     * Get the participantProfilesMetadata property: The participant profiles.
     *
     * @return the participantProfilesMetadata value.
     */
    public List<KpiParticipantProfilesMetadata> participantProfilesMetadata() {
        return this.innerProperties() == null ? null : this.innerProperties().participantProfilesMetadata();
    }

    /**
     * Get the provisioningState property: Provisioning state.
     *
     * @return the provisioningState value.
     */
    public ProvisioningStates provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the thresHolds property: The KPI thresholds.
     *
     * @return the thresHolds value.
     */
    public KpiThresholds thresHolds() {
        return this.innerProperties() == null ? null : this.innerProperties().thresHolds();
    }

    /**
     * Set the thresHolds property: The KPI thresholds.
     *
     * @param thresHolds the thresHolds value to set.
     * @return the KpiResourceFormatInner object itself.
     */
    public KpiResourceFormatInner withThresHolds(KpiThresholds thresHolds) {
        if (this.innerProperties() == null) {
            this.innerProperties = new KpiDefinitionInner();
        }
        this.innerProperties().withThresHolds(thresHolds);
        return this;
    }

    /**
     * Get the aliases property: The aliases.
     *
     * @return the aliases value.
     */
    public List<KpiAlias> aliases() {
        return this.innerProperties() == null ? null : this.innerProperties().aliases();
    }

    /**
     * Set the aliases property: The aliases.
     *
     * @param aliases the aliases value to set.
     * @return the KpiResourceFormatInner object itself.
     */
    public KpiResourceFormatInner withAliases(List<KpiAlias> aliases) {
        if (this.innerProperties() == null) {
            this.innerProperties = new KpiDefinitionInner();
        }
        this.innerProperties().withAliases(aliases);
        return this;
    }

    /**
     * Get the extracts property: The KPI extracts.
     *
     * @return the extracts value.
     */
    public List<KpiExtract> extracts() {
        return this.innerProperties() == null ? null : this.innerProperties().extracts();
    }

    /**
     * Set the extracts property: The KPI extracts.
     *
     * @param extracts the extracts value to set.
     * @return the KpiResourceFormatInner object itself.
     */
    public KpiResourceFormatInner withExtracts(List<KpiExtract> extracts) {
        if (this.innerProperties() == null) {
            this.innerProperties = new KpiDefinitionInner();
        }
        this.innerProperties().withExtracts(extracts);
        return this;
    }

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