/*
 * 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 enriching KPI definition.
 *
 * @extends models['KpiDefinition']
 */
class EnrichingKpi extends models['KpiDefinition'] {
  /**
   * Create a EnrichingKpi.
   */
  constructor() {
    super();
  }

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

module.exports = EnrichingKpi;
