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

/**
 * Software update configuration properties.
 *
 * @extends models['BaseResource']
 */
class SoftwareUpdateConfiguration extends models['BaseResource'] {
  /**
   * Create a SoftwareUpdateConfiguration.
   * @member {string} [name] Resource name.
   * @member {string} [id] Resource Id.
   * @member {string} [type] Resource type
   * @member {object} updateConfiguration update specific properties for the
   * Software update configuration
   * @member {string} [updateConfiguration.operatingSystem] operating system of
   * target machines. Possible values include: 'Windows', 'Linux'
   * @member {object} [updateConfiguration.windows] Windows specific update
   * configuration.
   * @member {string}
   * [updateConfiguration.windows.includedUpdateClassifications] Update
   * classification included in the software update configuration. A comma
   * separated string with required values. Possible values include:
   * 'Unclassified', 'Critical', 'Security', 'UpdateRollup', 'FeaturePack',
   * 'ServicePack', 'Definition', 'Tools', 'Updates'
   * @member {array} [updateConfiguration.windows.excludedKbNumbers] KB numbers
   * excluded from the software update configuration.
   * @member {array} [updateConfiguration.windows.includedKbNumbers] KB numbers
   * included from the software update configuration.
   * @member {string} [updateConfiguration.windows.rebootSetting] Reboot
   * setting for the software update configuration.
   * @member {object} [updateConfiguration.linux] Linux specific update
   * configuration.
   * @member {string}
   * [updateConfiguration.linux.includedPackageClassifications] Update
   * classifications included in the software update configuration. Possible
   * values include: 'Unclassified', 'Critical', 'Security', 'Other'
   * @member {array} [updateConfiguration.linux.excludedPackageNameMasks]
   * packages excluded from the software update configuration.
   * @member {array} [updateConfiguration.linux.includedPackageNameMasks]
   * packages included from the software update configuration.
   * @member {string} [updateConfiguration.linux.rebootSetting] Reboot setting
   * for the software update configuration.
   * @member {moment.duration} [updateConfiguration.duration] Maximum time
   * allowed for the software update configuration run. Duration needs to be
   * specified using the format PT[n]H[n]M[n]S as per ISO8601
   * @member {array} [updateConfiguration.azureVirtualMachines] List of azure
   * resource Ids for azure virtual machines targeted by the software update
   * configuration.
   * @member {array} [updateConfiguration.nonAzureComputerNames] List of names
   * of non-azure machines targeted by the software update configuration.
   * @member {object} [updateConfiguration.targets] Group targets for the
   * software update configuration.
   * @member {array} [updateConfiguration.targets.azureQueries] List of Azure
   * queries in the software update configuration.
   * @member {object} scheduleInfo Schedule information for the Software update
   * configuration
   * @member {date} [scheduleInfo.startTime] Gets or sets the start time of the
   * schedule.
   * @member {number} [scheduleInfo.startTimeOffsetMinutes] Gets the start
   * time's offset in minutes.
   * @member {date} [scheduleInfo.expiryTime] Gets or sets the end time of the
   * schedule.
   * @member {number} [scheduleInfo.expiryTimeOffsetMinutes] Gets or sets the
   * expiry time's offset in minutes.
   * @member {boolean} [scheduleInfo.isEnabled] Gets or sets a value indicating
   * whether this schedule is enabled.
   * @member {date} [scheduleInfo.nextRun] Gets or sets the next run time of
   * the schedule.
   * @member {number} [scheduleInfo.nextRunOffsetMinutes] Gets or sets the next
   * run time's offset in minutes.
   * @member {number} [scheduleInfo.interval] Gets or sets the interval of the
   * schedule.
   * @member {string} [scheduleInfo.frequency] Gets or sets the frequency of
   * the schedule. Possible values include: 'OneTime', 'Day', 'Hour', 'Week',
   * 'Month'
   * @member {string} [scheduleInfo.timeZone] Gets or sets the time zone of the
   * schedule.
   * @member {object} [scheduleInfo.advancedSchedule] Gets or sets the advanced
   * schedule.
   * @member {array} [scheduleInfo.advancedSchedule.weekDays] Days of the week
   * that the job should execute on.
   * @member {array} [scheduleInfo.advancedSchedule.monthDays] Days of the
   * month that the job should execute on. Must be between 1 and 31.
   * @member {array} [scheduleInfo.advancedSchedule.monthlyOccurrences]
   * Occurrences of days within a month.
   * @member {date} [scheduleInfo.creationTime] Gets or sets the creation time.
   * @member {date} [scheduleInfo.lastModifiedTime] Gets or sets the last
   * modified time.
   * @member {string} [scheduleInfo.description] Gets or sets the description.
   * @member {string} [provisioningState] Provisioning state for the software
   * update configuration, which only appears in the response.
   * @member {object} [error] Details of provisioning error
   * @member {string} [error.code] Error code
   * @member {string} [error.message] Error message indicating why the
   * operation failed.
   * @member {date} [creationTime] Creation time of the resource, which only
   * appears in the response.
   * @member {string} [createdBy] CreatedBy property, which only appears in the
   * response.
   * @member {date} [lastModifiedTime] Last time resource was modified, which
   * only appears in the response.
   * @member {string} [lastModifiedBy] LastModifiedBy property, which only
   * appears in the response.
   * @member {object} [tasks] Tasks information for the Software update
   * configuration.
   * @member {object} [tasks.preTask] Pre task properties.
   * @member {object} [tasks.preTask.parameters] Gets or sets the parameters of
   * the task.
   * @member {string} [tasks.preTask.source] Gets or sets the name of the
   * runbook.
   * @member {object} [tasks.postTask] Post task properties.
   * @member {object} [tasks.postTask.parameters] Gets or sets the parameters
   * of the task.
   * @member {string} [tasks.postTask.source] Gets or sets the name of the
   * runbook.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of SoftwareUpdateConfiguration
   *
   * @returns {object} metadata of SoftwareUpdateConfiguration
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'softwareUpdateConfiguration',
      type: {
        name: 'Composite',
        className: 'SoftwareUpdateConfiguration',
        modelProperties: {
          name: {
            required: false,
            readOnly: true,
            serializedName: 'name',
            type: {
              name: 'String'
            }
          },
          id: {
            required: false,
            readOnly: true,
            serializedName: 'id',
            type: {
              name: 'String'
            }
          },
          type: {
            required: false,
            readOnly: true,
            serializedName: 'type',
            type: {
              name: 'String'
            }
          },
          updateConfiguration: {
            required: true,
            serializedName: 'properties.updateConfiguration',
            type: {
              name: 'Composite',
              className: 'UpdateConfiguration'
            }
          },
          scheduleInfo: {
            required: true,
            serializedName: 'properties.scheduleInfo',
            type: {
              name: 'Composite',
              className: 'ScheduleProperties'
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          error: {
            required: false,
            serializedName: 'properties.error',
            type: {
              name: 'Composite',
              className: 'ErrorResponse'
            }
          },
          creationTime: {
            required: false,
            nullable: false,
            readOnly: true,
            serializedName: 'properties.creationTime',
            type: {
              name: 'DateTime'
            }
          },
          createdBy: {
            required: false,
            readOnly: true,
            serializedName: 'properties.createdBy',
            type: {
              name: 'String'
            }
          },
          lastModifiedTime: {
            required: false,
            nullable: false,
            readOnly: true,
            serializedName: 'properties.lastModifiedTime',
            type: {
              name: 'DateTime'
            }
          },
          lastModifiedBy: {
            required: false,
            readOnly: true,
            serializedName: 'properties.lastModifiedBy',
            type: {
              name: 'String'
            }
          },
          tasks: {
            required: false,
            serializedName: 'properties.tasks',
            type: {
              name: 'Composite',
              className: 'SoftwareUpdateConfigurationTasks'
            }
          }
        }
      }
    };
  }
}

module.exports = SoftwareUpdateConfiguration;
