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

/**
 * Configuration of App Service site logs.
 *
 * @extends models['ProxyOnlyResource']
 */
class SiteLogsConfig extends models['ProxyOnlyResource'] {
  /**
   * Create a SiteLogsConfig.
   * @member {object} [applicationLogs] Application logs configuration.
   * @member {object} [applicationLogs.fileSystem] Application logs to file
   * system configuration.
   * @member {string} [applicationLogs.fileSystem.level] Log level. Possible
   * values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error'
   * @member {object} [applicationLogs.azureTableStorage] Application logs to
   * azure table storage configuration.
   * @member {string} [applicationLogs.azureTableStorage.level] Log level.
   * Possible values include: 'Off', 'Verbose', 'Information', 'Warning',
   * 'Error'
   * @member {string} [applicationLogs.azureTableStorage.sasUrl] SAS URL to an
   * Azure table with add/query/delete permissions.
   * @member {object} [applicationLogs.azureBlobStorage] Application logs to
   * blob storage configuration.
   * @member {string} [applicationLogs.azureBlobStorage.level] Log level.
   * Possible values include: 'Off', 'Verbose', 'Information', 'Warning',
   * 'Error'
   * @member {string} [applicationLogs.azureBlobStorage.sasUrl] SAS url to a
   * azure blob container with read/write/list/delete permissions.
   * @member {number} [applicationLogs.azureBlobStorage.retentionInDays]
   * Retention in days.
   * Remove blobs older than X days.
   * 0 or lower means no retention.
   * @member {object} [httpLogs] HTTP logs configuration.
   * @member {object} [httpLogs.fileSystem] Http logs to file system
   * configuration.
   * @member {number} [httpLogs.fileSystem.retentionInMb] Maximum size in
   * megabytes that http log files can use.
   * When reached old log files will be removed to make space for new ones.
   * Value can range between 25 and 100.
   * @member {number} [httpLogs.fileSystem.retentionInDays] Retention in days.
   * Remove files older than X days.
   * 0 or lower means no retention.
   * @member {boolean} [httpLogs.fileSystem.enabled] True if configuration is
   * enabled, false if it is disabled and null if configuration is not set.
   * @member {object} [httpLogs.azureBlobStorage] Http logs to azure blob
   * storage configuration.
   * @member {string} [httpLogs.azureBlobStorage.sasUrl] SAS url to a azure
   * blob container with read/write/list/delete permissions.
   * @member {number} [httpLogs.azureBlobStorage.retentionInDays] Retention in
   * days.
   * Remove blobs older than X days.
   * 0 or lower means no retention.
   * @member {boolean} [httpLogs.azureBlobStorage.enabled] True if
   * configuration is enabled, false if it is disabled and null if
   * configuration is not set.
   * @member {object} [failedRequestsTracing] Failed requests tracing
   * configuration.
   * @member {boolean} [failedRequestsTracing.enabled] True if configuration is
   * enabled, false if it is disabled and null if configuration is not set.
   * @member {object} [detailedErrorMessages] Detailed error messages
   * configuration.
   * @member {boolean} [detailedErrorMessages.enabled] True if configuration is
   * enabled, false if it is disabled and null if configuration is not set.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of SiteLogsConfig
   *
   * @returns {object} metadata of SiteLogsConfig
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'SiteLogsConfig',
      type: {
        name: 'Composite',
        className: 'SiteLogsConfig',
        modelProperties: {
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          kind: {
            required: false,
            serializedName: 'kind',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          applicationLogs: {
            required: false,
            serializedName: 'properties.applicationLogs',
            type: {
              name: 'Composite',
              className: 'ApplicationLogsConfig'
            }
          },
          httpLogs: {
            required: false,
            serializedName: 'properties.httpLogs',
            type: {
              name: 'Composite',
              className: 'HttpLogsConfig'
            }
          },
          failedRequestsTracing: {
            required: false,
            serializedName: 'properties.failedRequestsTracing',
            type: {
              name: 'Composite',
              className: 'EnabledConfig'
            }
          },
          detailedErrorMessages: {
            required: false,
            serializedName: 'properties.detailedErrorMessages',
            type: {
              name: 'Composite',
              className: 'EnabledConfig'
            }
          }
        }
      }
    };
  }
}

module.exports = SiteLogsConfig;
