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

/**
 * An Application Insights component definition.
 *
 * @extends models['ComponentsResource']
 */
class ApplicationInsightsComponent extends models['ComponentsResource'] {
  /**
   * Create a ApplicationInsightsComponent.
   * @member {string} kind The kind of application that this component refers
   * to, used to customize UI. This value is a freeform string, values should
   * typically be one of the following: web, ios, other, store, java, phone.
   * @member {string} [applicationId] The unique ID of your application. This
   * field mirrors the 'Name' field and cannot be changed.
   * @member {string} [appId] Application Insights Unique ID for your
   * Application.
   * @member {string} applicationType Type of application being monitored.
   * Possible values include: 'web', 'other'. Default value: 'web' .
   * @member {string} [flowType] Used by the Application Insights system to
   * determine what kind of flow this component was created by. This is to be
   * set to 'Bluefield' when creating/updating a component via the REST API.
   * Possible values include: 'Bluefield'. Default value: 'Bluefield' .
   * @member {string} [requestSource] Describes what tool created this
   * Application Insights component. Customers using this API should set this
   * to the default 'rest'. Possible values include: 'rest'. Default value:
   * 'rest' .
   * @member {string} [instrumentationKey] Application Insights Instrumentation
   * key. A read-only value that applications can use to identify the
   * destination for all telemetry sent to Azure Application Insights. This
   * value will be supplied upon construction of each new Application Insights
   * component.
   * @member {date} [creationDate] Creation Date for the Application Insights
   * component, in ISO 8601 format.
   * @member {string} [tenantId] Azure Tenant Id.
   * @member {string} [hockeyAppId] The unique application ID created when a
   * new application is added to HockeyApp, used for communications with
   * HockeyApp.
   * @member {string} [hockeyAppToken] Token used to authenticate
   * communications with between Application Insights and HockeyApp.
   * @member {string} [provisioningState] Current state of this component:
   * whether or not is has been provisioned within the resource group it is
   * defined. Users cannot change this value but are able to read from it.
   * Values will include Succeeded, Deploying, Canceled, and Failed.
   * @member {number} [samplingPercentage] Percentage of the data produced by
   * the application being monitored that is being sampled for Application
   * Insights telemetry.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ApplicationInsightsComponent
   *
   * @returns {object} metadata of ApplicationInsightsComponent
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ApplicationInsightsComponent',
      type: {
        name: 'Composite',
        className: 'ApplicationInsightsComponent',
        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'
            }
          },
          location: {
            required: true,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          kind: {
            required: true,
            serializedName: 'kind',
            type: {
              name: 'String'
            }
          },
          applicationId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.ApplicationId',
            type: {
              name: 'String'
            }
          },
          appId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.AppId',
            type: {
              name: 'String'
            }
          },
          applicationType: {
            required: true,
            serializedName: 'properties.Application_Type',
            defaultValue: 'web',
            type: {
              name: 'String'
            }
          },
          flowType: {
            required: false,
            serializedName: 'properties.Flow_Type',
            defaultValue: 'Bluefield',
            type: {
              name: 'String'
            }
          },
          requestSource: {
            required: false,
            serializedName: 'properties.Request_Source',
            defaultValue: 'rest',
            type: {
              name: 'String'
            }
          },
          instrumentationKey: {
            required: false,
            readOnly: true,
            serializedName: 'properties.InstrumentationKey',
            type: {
              name: 'String'
            }
          },
          creationDate: {
            required: false,
            readOnly: true,
            serializedName: 'properties.CreationDate',
            type: {
              name: 'DateTime'
            }
          },
          tenantId: {
            required: false,
            readOnly: true,
            serializedName: 'properties.TenantId',
            type: {
              name: 'String'
            }
          },
          hockeyAppId: {
            required: false,
            serializedName: 'properties.HockeyAppId',
            type: {
              name: 'String'
            }
          },
          hockeyAppToken: {
            required: false,
            readOnly: true,
            serializedName: 'properties.HockeyAppToken',
            type: {
              name: 'String'
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          samplingPercentage: {
            required: false,
            serializedName: 'properties.SamplingPercentage',
            type: {
              name: 'Number'
            }
          }
        }
      }
    };
  }
}

module.exports = ApplicationInsightsComponent;
