generated/api/Models/AllowedFeatures.PowerShell.cs

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

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

    /// <summary>Get details about allowed features of a laptop plan</summary>
    [System.ComponentModel.TypeConverter(typeof(AllowedFeaturesTypeConverter))]
    public partial class AllowedFeatures
    {

        /// <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 <see "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 <see "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>
        /// Deserializes a <see cref="global::System.Collections.IDictionary" /> into a new instance of <see cref="Commvault.Powershell.Models.AllowedFeatures"
        /// />.
        /// </summary>
        /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
        internal AllowedFeatures(global::System.Collections.IDictionary content)
        {
            bool returnNow = false;
            BeforeDeserializeDictionary(content, ref returnNow);
            if (returnNow)
            {
                return;
            }
            // actually deserialize
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRules = (Commvault.Powershell.Models.IArchivingRules) content.GetValueForProperty("ArchivingRules",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRules, Commvault.Powershell.Models.ArchivingRulesTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettings = (Commvault.Powershell.Models.IEdgeDriveSettings) content.GetValueForProperty("EdgeDriveSettings",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettings, Commvault.Powershell.Models.EdgeDriveSettingsTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).Archiving = (bool?) content.GetValueForProperty("Archiving",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).Archiving, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).Dlp = (bool?) content.GetValueForProperty("Dlp",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).Dlp, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDrive = (bool?) content.GetValueForProperty("EdgeDrive",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDrive, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleStartCleaningIfLessThan = (long?) content.GetValueForProperty("ArchivingRuleStartCleaningIfLessThan",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleStartCleaningIfLessThan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleStopCleaningIfupto = (long?) content.GetValueForProperty("ArchivingRuleStopCleaningIfupto",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleStopCleaningIfupto, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleFileAccessTimeOlderThan = (long?) content.GetValueForProperty("ArchivingRuleFileAccessTimeOlderThan",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleFileAccessTimeOlderThan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleFileModifiedTimeOlderThan = (long?) content.GetValueForProperty("ArchivingRuleFileModifiedTimeOlderThan",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleFileModifiedTimeOlderThan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleFileCreatedTimeOlderThan = (long?) content.GetValueForProperty("ArchivingRuleFileCreatedTimeOlderThan",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleFileCreatedTimeOlderThan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleFileSizeGreaterThan = (long?) content.GetValueForProperty("ArchivingRuleFileSizeGreaterThan",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleFileSizeGreaterThan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleMaximumFileSize = (long?) content.GetValueForProperty("ArchivingRuleMaximumFileSize",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleMaximumFileSize, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleArchiveReadOnlyFiles = (bool?) content.GetValueForProperty("ArchivingRuleArchiveReadOnlyFiles",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleArchiveReadOnlyFiles, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleAfterArchiving = (string) content.GetValueForProperty("ArchivingRuleAfterArchiving",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleAfterArchiving, global::System.Convert.ToString);
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettingIndexServer = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("EdgeDriveSettingIndexServer",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettingIndexServer, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettingAuditDriveOperations = (bool?) content.GetValueForProperty("EdgeDriveSettingAuditDriveOperations",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettingAuditDriveOperations, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettingNotificationsForShares = (bool?) content.GetValueForProperty("EdgeDriveSettingNotificationsForShares",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettingNotificationsForShares, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettingEdgeDriveQuota = (long?) content.GetValueForProperty("EdgeDriveSettingEdgeDriveQuota",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettingEdgeDriveQuota, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).IndexServerId = (long?) content.GetValueForProperty("IndexServerId",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).IndexServerId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).IndexServerName = (string) content.GetValueForProperty("IndexServerName",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).IndexServerName, 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.AllowedFeatures"
        /// />.
        /// </summary>
        /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
        internal AllowedFeatures(global::System.Management.Automation.PSObject content)
        {
            bool returnNow = false;
            BeforeDeserializePSObject(content, ref returnNow);
            if (returnNow)
            {
                return;
            }
            // actually deserialize
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRules = (Commvault.Powershell.Models.IArchivingRules) content.GetValueForProperty("ArchivingRules",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRules, Commvault.Powershell.Models.ArchivingRulesTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettings = (Commvault.Powershell.Models.IEdgeDriveSettings) content.GetValueForProperty("EdgeDriveSettings",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettings, Commvault.Powershell.Models.EdgeDriveSettingsTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).Archiving = (bool?) content.GetValueForProperty("Archiving",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).Archiving, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).Dlp = (bool?) content.GetValueForProperty("Dlp",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).Dlp, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDrive = (bool?) content.GetValueForProperty("EdgeDrive",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDrive, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleStartCleaningIfLessThan = (long?) content.GetValueForProperty("ArchivingRuleStartCleaningIfLessThan",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleStartCleaningIfLessThan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleStopCleaningIfupto = (long?) content.GetValueForProperty("ArchivingRuleStopCleaningIfupto",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleStopCleaningIfupto, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleFileAccessTimeOlderThan = (long?) content.GetValueForProperty("ArchivingRuleFileAccessTimeOlderThan",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleFileAccessTimeOlderThan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleFileModifiedTimeOlderThan = (long?) content.GetValueForProperty("ArchivingRuleFileModifiedTimeOlderThan",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleFileModifiedTimeOlderThan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleFileCreatedTimeOlderThan = (long?) content.GetValueForProperty("ArchivingRuleFileCreatedTimeOlderThan",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleFileCreatedTimeOlderThan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleFileSizeGreaterThan = (long?) content.GetValueForProperty("ArchivingRuleFileSizeGreaterThan",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleFileSizeGreaterThan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleMaximumFileSize = (long?) content.GetValueForProperty("ArchivingRuleMaximumFileSize",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleMaximumFileSize, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleArchiveReadOnlyFiles = (bool?) content.GetValueForProperty("ArchivingRuleArchiveReadOnlyFiles",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleArchiveReadOnlyFiles, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleAfterArchiving = (string) content.GetValueForProperty("ArchivingRuleAfterArchiving",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).ArchivingRuleAfterArchiving, global::System.Convert.ToString);
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettingIndexServer = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("EdgeDriveSettingIndexServer",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettingIndexServer, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettingAuditDriveOperations = (bool?) content.GetValueForProperty("EdgeDriveSettingAuditDriveOperations",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettingAuditDriveOperations, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettingNotificationsForShares = (bool?) content.GetValueForProperty("EdgeDriveSettingNotificationsForShares",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettingNotificationsForShares, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettingEdgeDriveQuota = (long?) content.GetValueForProperty("EdgeDriveSettingEdgeDriveQuota",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).EdgeDriveSettingEdgeDriveQuota, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).IndexServerId = (long?) content.GetValueForProperty("IndexServerId",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).IndexServerId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).IndexServerName = (string) content.GetValueForProperty("IndexServerName",((Commvault.Powershell.Models.IAllowedFeaturesInternal)this).IndexServerName, global::System.Convert.ToString);
            AfterDeserializePSObject(content);
        }

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

        /// <summary>
        /// Deserializes a <see cref="global::System.Management.Automation.PSObject" /> into an instance of <see cref="Commvault.Powershell.Models.AllowedFeatures"
        /// />.
        /// </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.IAllowedFeatures" />.</returns>
        public static Commvault.Powershell.Models.IAllowedFeatures DeserializeFromPSObject(global::System.Management.Automation.PSObject content)
        {
            return new AllowedFeatures(content);
        }

        /// <summary>
        /// Creates a new instance of <see cref="AllowedFeatures" />, 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="className" /> model class.</returns>
        public static Commvault.Powershell.Models.IAllowedFeatures FromJsonString(string jsonText) => FromJson(Commvault.Powershell.Runtime.Json.JsonNode.Parse(jsonText));

        /// <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();
    }
    /// Get details about allowed features of a laptop plan
    [System.ComponentModel.TypeConverter(typeof(AllowedFeaturesTypeConverter))]
    public partial interface IAllowedFeatures

    {

    }
}