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

/**
 * Azure Application Insights information for performance counters reporting.
 *
 */
class AppInsightsReference {
  /**
   * Create a AppInsightsReference.
   * @member {object} component Component ID. Azure Application Insights
   * component resource ID.
   * @member {string} [component.id] The ID of the resource
   * @member {string} [instrumentationKey] Instrumentation Key. Value of the
   * Azure Application Insights instrumentation key.
   * @member {object} [instrumentationKeySecretReference] Instrumentation key
   * KeyVault Secret reference. KeyVault Store and Secret which contains Azure
   * Application Insights instrumentation key. One of instrumentationKey or
   * instrumentationKeySecretReference must be specified.
   * @member {object} [instrumentationKeySecretReference.sourceVault] Fully
   * qualified resource indentifier of the Key Vault.
   * @member {string} [instrumentationKeySecretReference.sourceVault.id] The ID
   * of the resource
   * @member {string} [instrumentationKeySecretReference.secretUrl] The URL
   * referencing a secret in the Key Vault.
   */
  constructor() {
  }

  /**
   * Defines the metadata of AppInsightsReference
   *
   * @returns {object} metadata of AppInsightsReference
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'AppInsightsReference',
      type: {
        name: 'Composite',
        className: 'AppInsightsReference',
        modelProperties: {
          component: {
            required: true,
            serializedName: 'component',
            type: {
              name: 'Composite',
              className: 'ResourceId'
            }
          },
          instrumentationKey: {
            required: false,
            serializedName: 'instrumentationKey',
            type: {
              name: 'String'
            }
          },
          instrumentationKeySecretReference: {
            required: false,
            serializedName: 'instrumentationKeySecretReference',
            type: {
              name: 'Composite',
              className: 'KeyVaultSecretReference'
            }
          }
        }
      }
    };
  }
}

module.exports = AppInsightsReference;
