public static RecoveryPlanAction getRecoveryPlanAction(RecoveryPlanAction_2016_08_10 asrRecoveryPlanAction)
        {
            var recoveryPlanAction = new RecoveryPlanAction();

            recoveryPlanAction.ActionName = asrRecoveryPlanAction.ActionName;
            if (asrRecoveryPlanAction.FailoverDirections != null)
            {
                recoveryPlanAction.FailoverDirections =
                    asrRecoveryPlanAction.FailoverDirections.ToList().ConvertAll((asrFODirection) => { return(asrFODirection.ToString()); });
            }

            if (asrRecoveryPlanAction.FailoverTypes != null)
            {
                recoveryPlanAction.FailoverTypes =
                    asrRecoveryPlanAction.FailoverTypes.ToList().ConvertAll((asrFailoverTypes) => { return(asrFailoverTypes.ToString()); });
            }

            if (asrRecoveryPlanAction.CustomDetails is ASRRecoveryPlanAutomationRunbookActionDetails)
            {
                var actionDetails = asrRecoveryPlanAction.CustomDetails as ASRRecoveryPlanAutomationRunbookActionDetails;
                recoveryPlanAction.CustomDetails = new RecoveryPlanAutomationRunbookActionDetails
                {
                    FabricLocation = actionDetails.FabricLocation.ToString(),
                    RunbookId      = actionDetails.RunbookId,
                    Timeout        = actionDetails.Timeout
                };
            }
            else if (asrRecoveryPlanAction.CustomDetails is ASRRecoveryPlanManualActionDetails)
            {
                var actionDetails = asrRecoveryPlanAction.CustomDetails as ASRRecoveryPlanManualActionDetails;
                recoveryPlanAction.CustomDetails = new RecoveryPlanManualActionDetails
                {
                    Description = actionDetails.Description
                };
            }
            else if (asrRecoveryPlanAction.CustomDetails is ASRRecoveryPlanScriptActionDetails)
            {
                var actionDetails = asrRecoveryPlanAction.CustomDetails as ASRRecoveryPlanScriptActionDetails;
                recoveryPlanAction.CustomDetails = new RecoveryPlanScriptActionDetails
                {
                    FabricLocation = actionDetails.FabricLocation.ToString(),
                    Path           = actionDetails.Path,
                    Timeout        = actionDetails.Timeout
                };
            }


            return(recoveryPlanAction);
        }
        //
        // 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);
            }
        }