/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for
 * license information.
 *
 * Code generated by Microsoft (R) AutoRest Code Generator.
 * Changes may cause incorrect behavior and will be lost if the code is
 * regenerated.
 */

'use strict';

const models = require('./index');

/**
 * The KPI resource format.
 *
 * @extends models['ProxyResource']
 */
class KpiResourceFormat extends models['ProxyResource'] {
  /**
   * Create a KpiResourceFormat.
   * @member {string} entityType The mapping entity type. Possible values
   * include: 'None', 'Profile', 'Interaction', 'Relationship'
   * @member {string} entityTypeName The mapping entity name.
   * @member {string} [tenantId] The hub name.
   * @member {string} [kpiName] The KPI name.
   * @member {object} [displayName] Localized display name for the KPI.
   * @member {object} [description] Localized description for the KPI.
   * @member {string} calculationWindow The calculation window. Possible values
   * include: 'Lifetime', 'Hour', 'Day', 'Week', 'Month'
   * @member {string} [calculationWindowFieldName] Name of calculation window
   * field.
   * @member {string} functionProperty The computation function for the KPI.
   * Possible values include: 'Sum', 'Avg', 'Min', 'Max', 'Last', 'Count',
   * 'None', 'CountDistinct'
   * @member {string} expression The computation expression for the KPI.
   * @member {string} [unit] The unit of measurement for the KPI.
   * @member {string} [filter] The filter expression for the KPI.
   * @member {array} [groupBy] the group by properties for the KPI.
   * @member {array} [groupByMetadata] The KPI GroupByMetadata.
   * @member {array} [participantProfilesMetadata] The participant profiles.
   * @member {string} [provisioningState] Provisioning state. Possible values
   * include: 'Provisioning', 'Succeeded', 'Expiring', 'Deleting',
   * 'HumanIntervention', 'Failed'
   * @member {object} [thresHolds] The KPI thresholds.
   * @member {number} [thresHolds.lowerLimit] The lower threshold limit.
   * @member {number} [thresHolds.upperLimit] The upper threshold limit.
   * @member {boolean} [thresHolds.increasingKpi] Whether or not the KPI is an
   * increasing KPI.
   * @member {array} [aliases] The aliases.
   * @member {array} [extracts] The KPI extracts.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of KpiResourceFormat
   *
   * @returns {object} metadata of KpiResourceFormat
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'KpiResourceFormat',
      type: {
        name: 'Composite',
        className: 'KpiResourceFormat',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          entityType: {
            required: true,
            serializedName: 'properties.entityType',
            type: {
              name: 'Enum',
              allowedValues: [ 'None', 'Profile', 'Interaction', 'Relationship' ]
            }
          },
          entityTypeName: {
            required: true,
            serializedName: 'properties.entityTypeName',
            type: {
              name: 'String'
            }
          },
          tenantId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.tenantId',
            type: {
              name: 'String'
            }
          },
          kpiName: {
            required: false,
            readOnly: true,
            serializedName: 'properties.kpiName',
            type: {
              name: 'String'
            }
          },
          displayName: {
            required: false,
            serializedName: 'properties.displayName',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          description: {
            required: false,
            serializedName: 'properties.description',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          calculationWindow: {
            required: true,
            serializedName: 'properties.calculationWindow',
            type: {
              name: 'Enum',
              allowedValues: [ 'Lifetime', 'Hour', 'Day', 'Week', 'Month' ]
            }
          },
          calculationWindowFieldName: {
            required: false,
            serializedName: 'properties.calculationWindowFieldName',
            type: {
              name: 'String'
            }
          },
          functionProperty: {
            required: true,
            serializedName: 'properties.function',
            type: {
              name: 'Enum',
              allowedValues: [ 'Sum', 'Avg', 'Min', 'Max', 'Last', 'Count', 'None', 'CountDistinct' ]
            }
          },
          expression: {
            required: true,
            serializedName: 'properties.expression',
            type: {
              name: 'String'
            }
          },
          unit: {
            required: false,
            serializedName: 'properties.unit',
            type: {
              name: 'String'
            }
          },
          filter: {
            required: false,
            serializedName: 'properties.filter',
            type: {
              name: 'String'
            }
          },
          groupBy: {
            required: false,
            serializedName: 'properties.groupBy',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          groupByMetadata: {
            required: false,
            readOnly: true,
            serializedName: 'properties.groupByMetadata',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'KpiGroupByMetadataElementType',
                  type: {
                    name: 'Composite',
                    className: 'KpiGroupByMetadata'
                  }
              }
            }
          },
          participantProfilesMetadata: {
            required: false,
            readOnly: true,
            serializedName: 'properties.participantProfilesMetadata',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'KpiParticipantProfilesMetadataElementType',
                  type: {
                    name: 'Composite',
                    className: 'KpiParticipantProfilesMetadata'
                  }
              }
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          thresHolds: {
            required: false,
            serializedName: 'properties.thresHolds',
            type: {
              name: 'Composite',
              className: 'KpiThresholds'
            }
          },
          aliases: {
            required: false,
            serializedName: 'properties.aliases',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'KpiAliasElementType',
                  type: {
                    name: 'Composite',
                    className: 'KpiAlias'
                  }
              }
            }
          },
          extracts: {
            required: false,
            serializedName: 'properties.extracts',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'KpiExtractElementType',
                  type: {
                    name: 'Composite',
                    className: 'KpiExtract'
                  }
              }
            }
          }
        }
      }
    };
  }
}

module.exports = KpiResourceFormat;
