generated/api/Models/PlanSchedule.PowerShell.cs

// Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/powershell@4.0.708)
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

namespace Commvault.Powershell.Models
{
    using Commvault.Powershell.Runtime.PowerShell;

    /// <summary>Used to describe single plan schedule information</summary>
    [System.ComponentModel.TypeConverter(typeof(PlanScheduleTypeConverter))]
    public partial class PlanSchedule
    {

        /// <summary>
        /// <c>AfterDeserializeDictionary</c> will be called after the deserialization has finished, allowing customization of the
        /// object before it is returned. Implement this method in a partial class to enable this behavior
        /// </summary>
        /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>

        partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content);

        /// <summary>
        /// <c>AfterDeserializePSObject</c> will be called after the deserialization has finished, allowing customization of the object
        /// before it is returned. Implement this method in a partial class to enable this behavior
        /// </summary>
        /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>

        partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content);

        /// <summary>
        /// <c>BeforeDeserializeDictionary</c> will be called before the deserialization has commenced, allowing complete customization
        /// of the object before it is deserialized.
        /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <paramref name="returnNow" /> output
        /// parameter.
        /// Implement this method in a partial class to enable this behavior.
        /// </summary>
        /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
        /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return
        /// instantly.</param>

        partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow);

        /// <summary>
        /// <c>BeforeDeserializePSObject</c> will be called before the deserialization has commenced, allowing complete customization
        /// of the object before it is deserialized.
        /// If you wish to disable the default deserialization entirely, return <c>true</c> in the <paramref name="returnNow" /> output
        /// parameter.
        /// Implement this method in a partial class to enable this behavior.
        /// </summary>
        /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
        /// <param name="returnNow">Determines if the rest of the serialization should be processed, or if the method should return
        /// instantly.</param>

        partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow);

        /// <summary>
        /// <c>OverrideToString</c> will be called if it is implemented. Implement this method in a partial class to enable this behavior
        /// </summary>
        /// <param name="stringResult">/// instance serialized to a string, normally it is a Json</param>
        /// <param name="returnNow">/// set returnNow to true if you provide a customized OverrideToString function</param>

        partial void OverrideToString(ref string stringResult, ref bool returnNow);

        /// <summary>
        /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into an instance of <see cref="Commvault.Powershell.Models.PlanSchedule"
        /// />.
        /// </summary>
        /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
        /// <returns>an instance of <see cref="Commvault.Powershell.Models.IPlanSchedule" />.</returns>
        public static Commvault.Powershell.Models.IPlanSchedule DeserializeFromDictionary(global::System.Collections.IDictionary content)
        {
            return new PlanSchedule(content);
        }

        /// <summary>
        /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into an instance of <see cref="Commvault.Powershell.Models.PlanSchedule"
        /// />.
        /// </summary>
        /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
        /// <returns>an instance of <see cref="Commvault.Powershell.Models.IPlanSchedule" />.</returns>
        public static Commvault.Powershell.Models.IPlanSchedule DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
        {
            return new PlanSchedule(content);
        }

        /// <summary>
        /// Creates a new instance of <see cref="PlanSchedule" />, deserializing the content from a json string.
        /// </summary>
        /// <param name="jsonText">a string containing a JSON serialized instance of this model.</param>
        /// <returns>an instance of the <see cref="PlanSchedule" /> model class.</returns>
        public static Commvault.Powershell.Models.IPlanSchedule FromJsonString(string jsonText) => FromJson(Commvault.Powershell.Runtime.Json.JsonNode.Parse(jsonText));

        /// <summary>
        /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into a new instance of <see cref="Commvault.Powershell.Models.PlanSchedule"
        /// />.
        /// </summary>
        /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
        internal PlanSchedule(global::System.Collections.IDictionary content)
        {
            bool returnNow = false;
            BeforeDeserializeDictionary(content, ref returnNow);
            if (returnNow)
            {
                return;
            }
            // actually deserialize
            if (content.Contains("SchedulePattern"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePattern = (Commvault.Powershell.Models.ISchedulePattern) content.GetValueForProperty("SchedulePattern",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePattern, Commvault.Powershell.Models.SchedulePatternTypeConverter.ConvertFrom);
            }
            if (content.Contains("ScheduleOption"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOption = (Commvault.Powershell.Models.IScheduleOption) content.GetValueForProperty("ScheduleOption",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOption, Commvault.Powershell.Models.ScheduleOptionTypeConverter.ConvertFrom);
            }
            if (content.Contains("ScheduleId"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleId = (long?) content.GetValueForProperty("ScheduleId",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ScheduleName"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleName = (string) content.GetValueForProperty("ScheduleName",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleName, global::System.Convert.ToString);
            }
            if (content.Contains("PolicyId"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).PolicyId = (long?) content.GetValueForProperty("PolicyId",((Commvault.Powershell.Models.IPlanScheduleInternal)this).PolicyId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ScheduleOperation"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOperation = (string) content.GetValueForProperty("ScheduleOperation",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOperation, global::System.Convert.ToString);
            }
            if (content.Contains("VMOperationType"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).VMOperationType = (string) content.GetValueForProperty("VMOperationType",((Commvault.Powershell.Models.IPlanScheduleInternal)this).VMOperationType, global::System.Convert.ToString);
            }
            if (content.Contains("BackupType"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).BackupType = (string) content.GetValueForProperty("BackupType",((Commvault.Powershell.Models.IPlanScheduleInternal)this).BackupType, global::System.Convert.ToString);
            }
            if (content.Contains("ForDatabasesOnly"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ForDatabasesOnly = (bool?) content.GetValueForProperty("ForDatabasesOnly",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ForDatabasesOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            }
            if (content.Contains("IsRetentionBasedSyntheticFull"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).IsRetentionBasedSyntheticFull = (bool?) content.GetValueForProperty("IsRetentionBasedSyntheticFull",((Commvault.Powershell.Models.IPlanScheduleInternal)this).IsRetentionBasedSyntheticFull, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            }
            if (content.Contains("AdditionalInfo"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).AdditionalInfo = (string) content.GetValueForProperty("AdditionalInfo",((Commvault.Powershell.Models.IPlanScheduleInternal)this).AdditionalInfo, global::System.Convert.ToString);
            }
            if (content.Contains("SchedulePatternFrequency"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternFrequency = (long?) content.GetValueForProperty("SchedulePatternFrequency",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternFrequency, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternWeeklyDays"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternWeeklyDays = (System.Collections.Generic.List<string>) content.GetValueForProperty("SchedulePatternWeeklyDays",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternWeeklyDays, __y => TypeConverterExtensions.SelectToList<string>(__y, global::System.Convert.ToString));
            }
            if (content.Contains("SchedulePatternStartTime"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternStartTime = (long?) content.GetValueForProperty("SchedulePatternStartTime",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternStartTime, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternStartDate"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternStartDate = (long?) content.GetValueForProperty("SchedulePatternStartDate",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternStartDate, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternEndDate"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternEndDate = (long?) content.GetValueForProperty("SchedulePatternEndDate",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternEndDate, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternExceptions"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternExceptions = (System.Collections.Generic.List<Commvault.Powershell.Models.IScheduleRunException>) content.GetValueForProperty("SchedulePatternExceptions",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternExceptions, __y => TypeConverterExtensions.SelectToList<Commvault.Powershell.Models.IScheduleRunException>(__y, Commvault.Powershell.Models.ScheduleRunExceptionTypeConverter.ConvertFrom));
            }
            if (content.Contains("SchedulePatternTimezone"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternTimezone = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("SchedulePatternTimezone",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternTimezone, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            }
            if (content.Contains("SchedulePatternScheduleFrequencyType"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternScheduleFrequencyType = (string) content.GetValueForProperty("SchedulePatternScheduleFrequencyType",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternScheduleFrequencyType, global::System.Convert.ToString);
            }
            if (content.Contains("SchedulePatternDayOfMonth"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternDayOfMonth = (long?) content.GetValueForProperty("SchedulePatternDayOfMonth",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternDayOfMonth, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternWeekOfMonth"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternWeekOfMonth = (string) content.GetValueForProperty("SchedulePatternWeekOfMonth",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternWeekOfMonth, global::System.Convert.ToString);
            }
            if (content.Contains("SchedulePatternDayOfWeek"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternDayOfWeek = (string) content.GetValueForProperty("SchedulePatternDayOfWeek",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternDayOfWeek, global::System.Convert.ToString);
            }
            if (content.Contains("SchedulePatternMonthOfYear"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternMonthOfYear = (string) content.GetValueForProperty("SchedulePatternMonthOfYear",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternMonthOfYear, global::System.Convert.ToString);
            }
            if (content.Contains("SchedulePatternRepeatIntervalInMinutes"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternRepeatIntervalInMinutes = (long?) content.GetValueForProperty("SchedulePatternRepeatIntervalInMinutes",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternRepeatIntervalInMinutes, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternRepeatUntilTime"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternRepeatUntilTime = (long?) content.GetValueForProperty("SchedulePatternRepeatUntilTime",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternRepeatUntilTime, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternNoOfTimes"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternNoOfTimes = (long?) content.GetValueForProperty("SchedulePatternNoOfTimes",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternNoOfTimes, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternDaysBetweenSyntheticFulls"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternDaysBetweenSyntheticFulls = (long?) content.GetValueForProperty("SchedulePatternDaysBetweenSyntheticFulls",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternDaysBetweenSyntheticFulls, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternMaxBackupIntervalInMins"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternMaxBackupIntervalInMins = (long?) content.GetValueForProperty("SchedulePatternMaxBackupIntervalInMins",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternMaxBackupIntervalInMins, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ScheduleOptionUseDiskCacheForLogBackups"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionUseDiskCacheForLogBackups = (bool?) content.GetValueForProperty("ScheduleOptionUseDiskCacheForLogBackups",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionUseDiskCacheForLogBackups, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            }
            if (content.Contains("ScheduleOptionCommitFrequencyInHours"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionCommitFrequencyInHours = (long?) content.GetValueForProperty("ScheduleOptionCommitFrequencyInHours",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionCommitFrequencyInHours, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ScheduleOptionDaysBetweenAutoConvert"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionDaysBetweenAutoConvert = (long?) content.GetValueForProperty("ScheduleOptionDaysBetweenAutoConvert",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionDaysBetweenAutoConvert, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ScheduleOptionO365ItemSelectionOption"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionO365ItemSelectionOption = (string) content.GetValueForProperty("ScheduleOptionO365ItemSelectionOption",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionO365ItemSelectionOption, global::System.Convert.ToString);
            }
            if (content.Contains("ScheduleOptionJobRunningTimeInMins"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionJobRunningTimeInMins = (long?) content.GetValueForProperty("ScheduleOptionJobRunningTimeInMins",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionJobRunningTimeInMins, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ScheduleOptionMinBackupIntervalInMins"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionMinBackupIntervalInMins = (long?) content.GetValueForProperty("ScheduleOptionMinBackupIntervalInMins",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionMinBackupIntervalInMins, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ScheduleOptionLogFilesThreshold"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionLogFilesThreshold = (long?) content.GetValueForProperty("ScheduleOptionLogFilesThreshold",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionLogFilesThreshold, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ScheduleOptionLogsDiskUtilizationPercent"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionLogsDiskUtilizationPercent = (long?) content.GetValueForProperty("ScheduleOptionLogsDiskUtilizationPercent",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionLogsDiskUtilizationPercent, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("TimezoneId"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).TimezoneId = (long?) content.GetValueForProperty("TimezoneId",((Commvault.Powershell.Models.IPlanScheduleInternal)this).TimezoneId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("TimezoneName"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).TimezoneName = (string) content.GetValueForProperty("TimezoneName",((Commvault.Powershell.Models.IPlanScheduleInternal)this).TimezoneName, global::System.Convert.ToString);
            }
            AfterDeserializeDictionary(content);
        }

        /// <summary>
        /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into a new instance of <see cref="Commvault.Powershell.Models.PlanSchedule"
        /// />.
        /// </summary>
        /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
        internal PlanSchedule(global::System.Management.Automation.PSObject content)
        {
            bool returnNow = false;
            BeforeDeserializePSObject(content, ref returnNow);
            if (returnNow)
            {
                return;
            }
            // actually deserialize
            if (content.Contains("SchedulePattern"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePattern = (Commvault.Powershell.Models.ISchedulePattern) content.GetValueForProperty("SchedulePattern",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePattern, Commvault.Powershell.Models.SchedulePatternTypeConverter.ConvertFrom);
            }
            if (content.Contains("ScheduleOption"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOption = (Commvault.Powershell.Models.IScheduleOption) content.GetValueForProperty("ScheduleOption",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOption, Commvault.Powershell.Models.ScheduleOptionTypeConverter.ConvertFrom);
            }
            if (content.Contains("ScheduleId"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleId = (long?) content.GetValueForProperty("ScheduleId",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ScheduleName"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleName = (string) content.GetValueForProperty("ScheduleName",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleName, global::System.Convert.ToString);
            }
            if (content.Contains("PolicyId"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).PolicyId = (long?) content.GetValueForProperty("PolicyId",((Commvault.Powershell.Models.IPlanScheduleInternal)this).PolicyId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ScheduleOperation"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOperation = (string) content.GetValueForProperty("ScheduleOperation",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOperation, global::System.Convert.ToString);
            }
            if (content.Contains("VMOperationType"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).VMOperationType = (string) content.GetValueForProperty("VMOperationType",((Commvault.Powershell.Models.IPlanScheduleInternal)this).VMOperationType, global::System.Convert.ToString);
            }
            if (content.Contains("BackupType"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).BackupType = (string) content.GetValueForProperty("BackupType",((Commvault.Powershell.Models.IPlanScheduleInternal)this).BackupType, global::System.Convert.ToString);
            }
            if (content.Contains("ForDatabasesOnly"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ForDatabasesOnly = (bool?) content.GetValueForProperty("ForDatabasesOnly",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ForDatabasesOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            }
            if (content.Contains("IsRetentionBasedSyntheticFull"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).IsRetentionBasedSyntheticFull = (bool?) content.GetValueForProperty("IsRetentionBasedSyntheticFull",((Commvault.Powershell.Models.IPlanScheduleInternal)this).IsRetentionBasedSyntheticFull, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            }
            if (content.Contains("AdditionalInfo"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).AdditionalInfo = (string) content.GetValueForProperty("AdditionalInfo",((Commvault.Powershell.Models.IPlanScheduleInternal)this).AdditionalInfo, global::System.Convert.ToString);
            }
            if (content.Contains("SchedulePatternFrequency"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternFrequency = (long?) content.GetValueForProperty("SchedulePatternFrequency",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternFrequency, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternWeeklyDays"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternWeeklyDays = (System.Collections.Generic.List<string>) content.GetValueForProperty("SchedulePatternWeeklyDays",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternWeeklyDays, __y => TypeConverterExtensions.SelectToList<string>(__y, global::System.Convert.ToString));
            }
            if (content.Contains("SchedulePatternStartTime"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternStartTime = (long?) content.GetValueForProperty("SchedulePatternStartTime",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternStartTime, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternStartDate"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternStartDate = (long?) content.GetValueForProperty("SchedulePatternStartDate",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternStartDate, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternEndDate"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternEndDate = (long?) content.GetValueForProperty("SchedulePatternEndDate",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternEndDate, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternExceptions"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternExceptions = (System.Collections.Generic.List<Commvault.Powershell.Models.IScheduleRunException>) content.GetValueForProperty("SchedulePatternExceptions",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternExceptions, __y => TypeConverterExtensions.SelectToList<Commvault.Powershell.Models.IScheduleRunException>(__y, Commvault.Powershell.Models.ScheduleRunExceptionTypeConverter.ConvertFrom));
            }
            if (content.Contains("SchedulePatternTimezone"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternTimezone = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("SchedulePatternTimezone",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternTimezone, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            }
            if (content.Contains("SchedulePatternScheduleFrequencyType"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternScheduleFrequencyType = (string) content.GetValueForProperty("SchedulePatternScheduleFrequencyType",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternScheduleFrequencyType, global::System.Convert.ToString);
            }
            if (content.Contains("SchedulePatternDayOfMonth"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternDayOfMonth = (long?) content.GetValueForProperty("SchedulePatternDayOfMonth",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternDayOfMonth, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternWeekOfMonth"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternWeekOfMonth = (string) content.GetValueForProperty("SchedulePatternWeekOfMonth",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternWeekOfMonth, global::System.Convert.ToString);
            }
            if (content.Contains("SchedulePatternDayOfWeek"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternDayOfWeek = (string) content.GetValueForProperty("SchedulePatternDayOfWeek",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternDayOfWeek, global::System.Convert.ToString);
            }
            if (content.Contains("SchedulePatternMonthOfYear"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternMonthOfYear = (string) content.GetValueForProperty("SchedulePatternMonthOfYear",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternMonthOfYear, global::System.Convert.ToString);
            }
            if (content.Contains("SchedulePatternRepeatIntervalInMinutes"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternRepeatIntervalInMinutes = (long?) content.GetValueForProperty("SchedulePatternRepeatIntervalInMinutes",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternRepeatIntervalInMinutes, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternRepeatUntilTime"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternRepeatUntilTime = (long?) content.GetValueForProperty("SchedulePatternRepeatUntilTime",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternRepeatUntilTime, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternNoOfTimes"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternNoOfTimes = (long?) content.GetValueForProperty("SchedulePatternNoOfTimes",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternNoOfTimes, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternDaysBetweenSyntheticFulls"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternDaysBetweenSyntheticFulls = (long?) content.GetValueForProperty("SchedulePatternDaysBetweenSyntheticFulls",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternDaysBetweenSyntheticFulls, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SchedulePatternMaxBackupIntervalInMins"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternMaxBackupIntervalInMins = (long?) content.GetValueForProperty("SchedulePatternMaxBackupIntervalInMins",((Commvault.Powershell.Models.IPlanScheduleInternal)this).SchedulePatternMaxBackupIntervalInMins, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ScheduleOptionUseDiskCacheForLogBackups"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionUseDiskCacheForLogBackups = (bool?) content.GetValueForProperty("ScheduleOptionUseDiskCacheForLogBackups",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionUseDiskCacheForLogBackups, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            }
            if (content.Contains("ScheduleOptionCommitFrequencyInHours"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionCommitFrequencyInHours = (long?) content.GetValueForProperty("ScheduleOptionCommitFrequencyInHours",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionCommitFrequencyInHours, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ScheduleOptionDaysBetweenAutoConvert"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionDaysBetweenAutoConvert = (long?) content.GetValueForProperty("ScheduleOptionDaysBetweenAutoConvert",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionDaysBetweenAutoConvert, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ScheduleOptionO365ItemSelectionOption"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionO365ItemSelectionOption = (string) content.GetValueForProperty("ScheduleOptionO365ItemSelectionOption",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionO365ItemSelectionOption, global::System.Convert.ToString);
            }
            if (content.Contains("ScheduleOptionJobRunningTimeInMins"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionJobRunningTimeInMins = (long?) content.GetValueForProperty("ScheduleOptionJobRunningTimeInMins",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionJobRunningTimeInMins, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ScheduleOptionMinBackupIntervalInMins"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionMinBackupIntervalInMins = (long?) content.GetValueForProperty("ScheduleOptionMinBackupIntervalInMins",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionMinBackupIntervalInMins, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ScheduleOptionLogFilesThreshold"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionLogFilesThreshold = (long?) content.GetValueForProperty("ScheduleOptionLogFilesThreshold",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionLogFilesThreshold, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ScheduleOptionLogsDiskUtilizationPercent"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionLogsDiskUtilizationPercent = (long?) content.GetValueForProperty("ScheduleOptionLogsDiskUtilizationPercent",((Commvault.Powershell.Models.IPlanScheduleInternal)this).ScheduleOptionLogsDiskUtilizationPercent, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("TimezoneId"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).TimezoneId = (long?) content.GetValueForProperty("TimezoneId",((Commvault.Powershell.Models.IPlanScheduleInternal)this).TimezoneId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("TimezoneName"))
            {
                ((Commvault.Powershell.Models.IPlanScheduleInternal)this).TimezoneName = (string) content.GetValueForProperty("TimezoneName",((Commvault.Powershell.Models.IPlanScheduleInternal)this).TimezoneName, global::System.Convert.ToString);
            }
            AfterDeserializePSObject(content);
        }

        /// <summary>Serializes this instance to a json string.</summary>

        /// <returns>a <see cref="System.String" /> containing this model serialized to JSON text.</returns>
        public string ToJsonString() => ToJson(null, Commvault.Powershell.Runtime.SerializationMode.IncludeAll)?.ToString();

        public override string ToString()
        {
            var returnNow = false;
            var result = global::System.String.Empty;
            OverrideToString(ref result, ref returnNow);
            if (returnNow)
            {
                return result;
            }
            return ToJsonString();
        }
    }
    /// Used to describe single plan schedule information
    [System.ComponentModel.TypeConverter(typeof(PlanScheduleTypeConverter))]
    public partial interface IPlanSchedule

    {

    }
}