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

/**
 * Replication protected item.
 *
 * @extends models['Resource']
 */
class ReplicationProtectedItem extends models['Resource'] {
  /**
   * Create a ReplicationProtectedItem.
   * @member {object} [properties] The custom data.
   * @member {string} [properties.friendlyName] The name.
   * @member {string} [properties.protectedItemType] The type of protected item
   * type.
   * @member {string} [properties.protectableItemId] The protected item ARM Id.
   * @member {string} [properties.recoveryServicesProviderId] The recovery
   * provider ARM Id.
   * @member {string} [properties.primaryFabricFriendlyName] The friendly name
   * of the primary fabric.
   * @member {string} [properties.primaryFabricProvider] The fabric provider of
   * the primary fabric.
   * @member {string} [properties.recoveryFabricFriendlyName] The friendly name
   * of recovery fabric.
   * @member {string} [properties.recoveryFabricId] The Arm Id of recovery
   * fabric.
   * @member {string} [properties.primaryProtectionContainerFriendlyName] The
   * name of primary protection container friendly name.
   * @member {string} [properties.recoveryProtectionContainerFriendlyName] The
   * name of recovery container friendly name.
   * @member {string} [properties.protectionState] The protection status.
   * @member {string} [properties.protectionStateDescription] The protection
   * state description.
   * @member {string} [properties.activeLocation] The Current active location
   * of the PE.
   * @member {string} [properties.testFailoverState] The Test failover state.
   * @member {string} [properties.testFailoverStateDescription] The Test
   * failover state description.
   * @member {array} [properties.allowedOperations] The allowed operations on
   * the Replication protected item.
   * @member {string} [properties.replicationHealth] The consolidated
   * protection health for the VM taking any issues with SRS as well as all the
   * replication units associated with the VM's replication group into account.
   * This is a string representation of the ProtectionHealth enumeration.
   * @member {string} [properties.failoverHealth] The consolidated failover
   * health for the VM.
   * @member {array} [properties.healthErrors] List of health errors.
   * @member {string} [properties.policyId] The ID of Policy governing this PE.
   * @member {string} [properties.policyFriendlyName] The name of Policy
   * governing this PE.
   * @member {date} [properties.lastSuccessfulFailoverTime] The Last successful
   * failover time.
   * @member {date} [properties.lastSuccessfulTestFailoverTime] The Last
   * successful test failover time.
   * @member {object} [properties.currentScenario] The current scenario.
   * @member {string} [properties.currentScenario.scenarioName] Scenario name.
   * @member {string} [properties.currentScenario.jobId] ARM Id of the job
   * being executed.
   * @member {date} [properties.currentScenario.startTime] Start time of the
   * workflow.
   * @member {string} [properties.failoverRecoveryPointId] The recovery point
   * ARM Id to which the Vm was failed over.
   * @member {object} [properties.providerSpecificDetails] The Replication
   * provider custom settings.
   * @member {string} [properties.providerSpecificDetails.instanceType]
   * Polymorphic Discriminator
   * @member {string} [properties.recoveryContainerId] The recovery container
   * Id.
   */
  constructor() {
    super();
  }

  /**
   * Defines the metadata of ReplicationProtectedItem
   *
   * @returns {object} metadata of ReplicationProtectedItem
   *
   */
  mapper() {
    return {
      required: false,
      serializedName: 'ReplicationProtectedItem',
      type: {
        name: 'Composite',
        className: 'ReplicationProtectedItem',
        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'
            }
          },
          properties: {
            required: false,
            serializedName: 'properties',
            type: {
              name: 'Composite',
              className: 'ReplicationProtectedItemProperties'
            }
          }
        }
      }
    };
  }
}

module.exports = ReplicationProtectedItem;
