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

/**
 * Base class for backup item. Workload-specific backup items are derived from
 * this class.
 *
 * @extends models['Resource']
 */
class WorkloadProtectableItemResource extends models['Resource'] {
  /**
   * Create a WorkloadProtectableItemResource.
   * @member {object} [properties] WorkloadProtectableItemResource properties
   * @member {string} [properties.backupManagementType] Type of backup
   * managemenent to backup an item.
   * @member {string} [properties.workloadType] Type of workload for the backup
   * management
   * @member {string} [properties.friendlyName] Friendly name of the backup
   * item.
   * @member {string} [properties.protectionState] State of the back up item.
   * Possible values include: 'Invalid', 'NotProtected', 'Protecting',
   * 'Protected', 'ProtectionFailed'
   * @member {string} [properties.protectableItemType] Polymorphic
   * Discriminator
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of WorkloadProtectableItemResource
   *
   * @returns {object} metadata of WorkloadProtectableItemResource
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'WorkloadProtectableItemResource',
      type: {
        name: 'Composite',
        className: 'WorkloadProtectableItemResource',
        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'
                  }
              }
            }
          },
          eTag: {
            required: false,
            serializedName: 'eTag',
            type: {
              name: 'String'
            }
          },
          properties: {
            required: false,
            serializedName: 'properties',
            type: {
              name: 'Composite',
              polymorphicDiscriminator: {
                serializedName: 'protectableItemType',
                clientName: 'protectableItemType'
              },
              uberParent: 'WorkloadProtectableItem',
              className: 'WorkloadProtectableItem'
            }
          }
        }
      }
    };
  }
}

module.exports = WorkloadProtectableItemResource;
