//
        // Summary:
        //     Initializes a new instance of the RecoveryPlanAction class.
        public static RecoveryPlanAction GetSrsRecoveryPlanAction(RecoveryPlanAction_2016_08_10 asrRecoveryPlanAction)
        {
            var recoveryPlanAction = new RecoveryPlanAction();

            recoveryPlanAction.ActionName = asrRecoveryPlanAction.ActionName;
            if (asrRecoveryPlanAction.FailoverTypes != null)
            {
                recoveryPlanAction.FailoverTypes = new List <string>();
                foreach (var startGroupAction in asrRecoveryPlanAction.FailoverTypes)
                {
                    recoveryPlanAction.FailoverTypes.Add(ASRRecoveryPlanUtil.getSRSReplicationProtectedItemOperation(startGroupAction.Value));
                }
            }

            if (asrRecoveryPlanAction.FailoverDirections != null)
            {
                recoveryPlanAction.FailoverDirections = new List <String>();
                foreach (var failoverDirection in asrRecoveryPlanAction.FailoverDirections)
                {
                    var direction = failoverDirection ==
                                    ASRPossibleOperationsDirections.PrimaryToRecovery ? "PrimaryToRecovery" : "RecoveryToPrimary";
                    recoveryPlanAction.FailoverDirections.Add(direction);
                }
            }

            if (asrRecoveryPlanAction.CustomDetails is ASRRecoveryPlanAutomationRunbookActionDetails)
            {
                recoveryPlanAction.CustomDetails = ASRRecoveryPlanAutomationRunbookActionDetails.getSrsRecoveryPlanAutomationRunbookActionDetails(
                    (ASRRecoveryPlanAutomationRunbookActionDetails)asrRecoveryPlanAction.CustomDetails);
            }
            else if (asrRecoveryPlanAction.CustomDetails is ASRRecoveryPlanManualActionDetails)
            {
                recoveryPlanAction.CustomDetails = ASRRecoveryPlanManualActionDetails.getSrsRecoveryPlanAutomationRunbookActionDetails(
                    (ASRRecoveryPlanManualActionDetails)asrRecoveryPlanAction.CustomDetails);
            }
            else if (asrRecoveryPlanAction.CustomDetails is ASRRecoveryPlanScriptActionDetails)
            {
                recoveryPlanAction.CustomDetails = ASRRecoveryPlanScriptActionDetails.getRecoveryPlanScriptActionDetails(
                    (ASRRecoveryPlanScriptActionDetails)asrRecoveryPlanAction.CustomDetails);
            }

            return(recoveryPlanAction);
        }
        //
        // Summary:
        //     Initializes a new instance of the RecoveryPlanAction class.
        public RecoveryPlanAction_2016_08_10(RecoveryPlanAction srsRecoveryPlanAction)
        {
            this.ActionName = srsRecoveryPlanAction.ActionName;
            if (srsRecoveryPlanAction.FailoverTypes != null)
            {
                this.FailoverTypes = new List <ASRReplicationProtectedItemOperation?>();
                foreach (var startGroupAction in srsRecoveryPlanAction.FailoverTypes)
                {
                    this.FailoverTypes.Add(ASRRecoveryPlanUtil.getASRReplicationProtectedItemOperation(startGroupAction));
                }
            }

            if (srsRecoveryPlanAction.FailoverDirections != null)
            {
                this.FailoverDirections = new List <ASRPossibleOperationsDirections?>();
                foreach (var failoverDirection in srsRecoveryPlanAction.FailoverDirections)
                {
                    var direction = failoverDirection == "PrimaryToRecovery" ?
                                    ASRPossibleOperationsDirections.PrimaryToRecovery :
                                    ASRPossibleOperationsDirections.RecoveryToPrimary;
                    this.FailoverDirections.Add(direction);
                }
            }

            if (srsRecoveryPlanAction.CustomDetails is RecoveryPlanAutomationRunbookActionDetails)
            {
                this.CustomDetails = new ASRRecoveryPlanAutomationRunbookActionDetails(
                    srsRecoveryPlanAction.CustomDetails as RecoveryPlanAutomationRunbookActionDetails);
            }
            else if (srsRecoveryPlanAction.CustomDetails is RecoveryPlanManualActionDetails)
            {
                this.CustomDetails = new ASRRecoveryPlanManualActionDetails(
                    srsRecoveryPlanAction.CustomDetails as RecoveryPlanManualActionDetails);
            }
            else if (srsRecoveryPlanAction.CustomDetails is RecoveryPlanScriptActionDetails)
            {
                this.CustomDetails = new ASRRecoveryPlanScriptActionDetails(
                    srsRecoveryPlanAction.CustomDetails as RecoveryPlanScriptActionDetails);
            }
        }