/*
 * 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');

/**
 * A page view result
 *
 * @extends models['EventsResultData']
 */
class EventsPageViewResult extends models['EventsResultData'] {
  /**
   * Create a EventsPageViewResult.
   * @member {object} [pageView]
   * @member {string} [pageView.name] The name of the page
   * @member {string} [pageView.url] The URL of the page
   * @member {string} [pageView.duration] The duration of the page view
   * @member {string} [pageView.performanceBucket] The performance bucket of
   * the page view
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of EventsPageViewResult
   *
   * @returns {object} metadata of EventsPageViewResult
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'pageView',
      type: {
        name: 'Composite',
        polymorphicDiscriminator: {
          serializedName: 'type',
          clientName: 'type'
        },
        uberParent: 'EventsResultData',
        className: 'EventsPageViewResult',
        modelProperties: {
          id: {
            required: false,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          count: {
            required: false,
            serializedName: 'count',
            type: {
              name: 'Number'
            }
          },
          timestamp: {
            required: false,
            serializedName: 'timestamp',
            type: {
              name: 'DateTime'
            }
          },
          customDimensions: {
            required: false,
            serializedName: 'customDimensions',
            type: {
              name: 'Composite',
              className: 'EventsResultDataCustomDimensions'
            }
          },
          customMeasurements: {
            required: false,
            serializedName: 'customMeasurements',
            type: {
              name: 'Composite',
              className: 'EventsResultDataCustomMeasurements'
            }
          },
          operation: {
            required: false,
            serializedName: 'operation',
            type: {
              name: 'Composite',
              className: 'EventsOperationInfo'
            }
          },
          session: {
            required: false,
            serializedName: 'session',
            type: {
              name: 'Composite',
              className: 'EventsSessionInfo'
            }
          },
          user: {
            required: false,
            serializedName: 'user',
            type: {
              name: 'Composite',
              className: 'EventsUserInfo'
            }
          },
          cloud: {
            required: false,
            serializedName: 'cloud',
            type: {
              name: 'Composite',
              className: 'EventsCloudInfo'
            }
          },
          ai: {
            required: false,
            serializedName: 'ai',
            type: {
              name: 'Composite',
              className: 'EventsAiInfo'
            }
          },
          application: {
            required: false,
            serializedName: 'application',
            type: {
              name: 'Composite',
              className: 'EventsApplicationInfo'
            }
          },
          client: {
            required: false,
            serializedName: 'client',
            type: {
              name: 'Composite',
              className: 'EventsClientInfo'
            }
          },
          type: {
            required: true,
            serializedName: 'type',
            isPolymorphicDiscriminator: true,
            type: {
              name: 'String'
            }
          },
          pageView: {
            required: false,
            serializedName: 'pageView',
            type: {
              name: 'Composite',
              className: 'EventsPageViewInfo'
            }
          }
        }
      }
    };
  }
}

module.exports = EventsPageViewResult;
