getSrsRecoveryPlanAutomationRunbookActionDetails(ASRRecoveryPlanAutomationRunbookActionDetails automationRunbookActionDetails)
        {
            var action = new RecoveryPlanAutomationRunbookActionDetails();

            action.RunbookId      = automationRunbookActionDetails.RunbookId;
            action.Timeout        = automationRunbookActionDetails.Timeout;
            action.FabricLocation = automationRunbookActionDetails.FabricLocation == ASRRecoveryPlanActionLocation.Primary ?
                                    "Primary" : "Recovery";

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