/*
 * 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 custom image.
 *
 * @extends models['Resource']
 */
class CustomImage extends models['Resource'] {
  /**
   * Create a CustomImage.
   * @property {object} [vm] The virtual machine from which the image is to be
   * created.
   * @property {string} [vm.sourceVmId] The source vm identifier.
   * @property {object} [vm.windowsOsInfo] The Windows OS information of the
   * VM.
   * @property {string} [vm.windowsOsInfo.windowsOsState] The state of the
   * Windows OS (i.e. NonSysprepped, SysprepRequested, SysprepApplied).
   * Possible values include: 'NonSysprepped', 'SysprepRequested',
   * 'SysprepApplied'
   * @property {object} [vm.linuxOsInfo] The Linux OS information of the VM.
   * @property {string} [vm.linuxOsInfo.linuxOsState] The state of the Linux OS
   * (i.e. NonDeprovisioned, DeprovisionRequested, DeprovisionApplied).
   * Possible values include: 'NonDeprovisioned', 'DeprovisionRequested',
   * 'DeprovisionApplied'
   * @property {object} [vhd] The VHD from which the image is to be created.
   * @property {string} [vhd.imageName] The image name.
   * @property {boolean} [vhd.sysPrep] Indicates whether sysprep has been run
   * on the VHD.
   * @property {string} [vhd.osType] The OS type of the custom image (i.e.
   * Windows, Linux). Possible values include: 'Windows', 'Linux', 'None'
   * @property {string} [description] The description of the custom image.
   * @property {string} [author] The author of the custom image.
   * @property {date} [creationDate] The creation date of the custom image.
   * @property {string} [managedImageId] The Managed Image Id backing the
   * custom image.
   * @property {string} [managedSnapshotId] The Managed Snapshot Id backing the
   * custom image.
   * @property {array} [dataDiskStorageInfo] Storage information about the data
   * disks present in the custom image
   * @property {object} [customImagePlan] Storage information about the plan
   * related to this custom image
   * @property {string} [customImagePlan.id] The id of the plan, equivalent to
   * name of the plan
   * @property {string} [customImagePlan.publisher] The publisher for the plan
   * from the marketplace image the custom image is derived from
   * @property {string} [customImagePlan.offer] The offer for the plan from the
   * marketplace image the custom image is derived from
   * @property {boolean} [isPlanAuthorized] Whether or not the custom images
   * underlying offer/plan has been enabled for programmatic deployment
   * @property {string} [provisioningState] The provisioning status of the
   * resource.
   * @property {string} [uniqueIdentifier] The unique immutable identifier of a
   * resource (Guid).
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of CustomImage
   *
   * @returns {object} metadata of CustomImage
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'CustomImage',
      type: {
        name: 'Composite',
        className: 'CustomImage',
        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: false,
            serializedName: 'location',
            type: {
              name: 'String'
            }
          },
          tags: {
            required: false,
            serializedName: 'tags',
            type: {
              name: 'Dictionary',
              value: {
                  required: false,
                  serializedName: 'StringElementType',
                  type: {
                    name: 'String'
                  }
              }
            }
          },
          vm: {
            required: false,
            serializedName: 'properties.vm',
            type: {
              name: 'Composite',
              className: 'CustomImagePropertiesFromVm'
            }
          },
          vhd: {
            required: false,
            serializedName: 'properties.vhd',
            type: {
              name: 'Composite',
              className: 'CustomImagePropertiesCustom'
            }
          },
          description: {
            required: false,
            serializedName: 'properties.description',
            type: {
              name: 'String'
            }
          },
          author: {
            required: false,
            serializedName: 'properties.author',
            type: {
              name: 'String'
            }
          },
          creationDate: {
            required: false,
            readOnly: true,
            serializedName: 'properties.creationDate',
            type: {
              name: 'DateTime'
            }
          },
          managedImageId: {
            required: false,
            serializedName: 'properties.managedImageId',
            type: {
              name: 'String'
            }
          },
          managedSnapshotId: {
            required: false,
            serializedName: 'properties.managedSnapshotId',
            type: {
              name: 'String'
            }
          },
          dataDiskStorageInfo: {
            required: false,
            serializedName: 'properties.dataDiskStorageInfo',
            type: {
              name: 'Sequence',
              element: {
                  required: false,
                  serializedName: 'DataDiskStorageTypeInfoElementType',
                  type: {
                    name: 'Composite',
                    className: 'DataDiskStorageTypeInfo'
                  }
              }
            }
          },
          customImagePlan: {
            required: false,
            serializedName: 'properties.customImagePlan',
            type: {
              name: 'Composite',
              className: 'CustomImagePropertiesFromPlan'
            }
          },
          isPlanAuthorized: {
            required: false,
            serializedName: 'properties.isPlanAuthorized',
            type: {
              name: 'Boolean'
            }
          },
          provisioningState: {
            required: false,
            readOnly: true,
            serializedName: 'properties.provisioningState',
            type: {
              name: 'String'
            }
          },
          uniqueIdentifier: {
            required: false,
            readOnly: true,
            serializedName: 'properties.uniqueIdentifier',
            type: {
              name: 'String'
            }
          }
        }
      }
    };
  }
}

module.exports = CustomImage;
