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);
        }