generated/api/Models/PlanRuleApplicableEntity.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>Entity applicable for plan association via plan assignment rules.</summary>
    [System.ComponentModel.TypeConverter(typeof(PlanRuleApplicableEntityTypeConverter))]
    public partial class PlanRuleApplicableEntity
    {

        /// <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 an instance of <see cref="Commvault.Powershell.Models.PlanRuleApplicableEntity"
        /// />.
        /// </summary>
        /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
        /// <returns>
        /// an instance of <see cref="Commvault.Powershell.Models.IPlanRuleApplicableEntity" />.
        /// </returns>
        public static Commvault.Powershell.Models.IPlanRuleApplicableEntity DeserializeFromDictionary(global::System.Collections.IDictionary content)
        {
            return new PlanRuleApplicableEntity(content);
        }

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

        /// <summary>
        /// Creates a new instance of <see cref="PlanRuleApplicableEntity" />, 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.IPlanRuleApplicableEntity 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.PlanRuleApplicableEntity"
        /// />.
        /// </summary>
        /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
        internal PlanRuleApplicableEntity(global::System.Collections.IDictionary content)
        {
            bool returnNow = false;
            BeforeDeserializeDictionary(content, ref returnNow);
            if (returnNow)
            {
                return;
            }
            // actually deserialize
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Subclient = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("Subclient",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Subclient, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Backupset = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("Backupset",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Backupset, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Instance = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("Instance",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Instance, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Client = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("Client",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Client, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Apptype = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("Apptype",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Apptype, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).EvaluatedPlan = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("EvaluatedPlan",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).EvaluatedPlan, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).CurrentPlan = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("CurrentPlan",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).CurrentPlan, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).RuleDetails = (Commvault.Powershell.Models.IPlanEntityRuleInfo) content.GetValueForProperty("RuleDetails",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).RuleDetails, Commvault.Powershell.Models.PlanEntityRuleInfoTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).SubclientId = (long?) content.GetValueForProperty("SubclientId",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).SubclientId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).SubclientName = (string) content.GetValueForProperty("SubclientName",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).SubclientName, global::System.Convert.ToString);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).BackupsetId = (long?) content.GetValueForProperty("BackupsetId",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).BackupsetId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).BackupsetName = (string) content.GetValueForProperty("BackupsetName",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).BackupsetName, global::System.Convert.ToString);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).InstanceId = (long?) content.GetValueForProperty("InstanceId",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).InstanceId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).InstanceName = (string) content.GetValueForProperty("InstanceName",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).InstanceName, global::System.Convert.ToString);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).ClientId = (long?) content.GetValueForProperty("ClientId",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).ClientId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).ClientName = (string) content.GetValueForProperty("ClientName",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).ClientName, global::System.Convert.ToString);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).ApptypeId = (long?) content.GetValueForProperty("ApptypeId",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).ApptypeId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).ApptypeName = (string) content.GetValueForProperty("ApptypeName",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).ApptypeName, global::System.Convert.ToString);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).EvaluatedPlanId = (long?) content.GetValueForProperty("EvaluatedPlanId",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).EvaluatedPlanId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).EvaluatedPlanName = (string) content.GetValueForProperty("EvaluatedPlanName",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).EvaluatedPlanName, global::System.Convert.ToString);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).CurrentPlanId = (long?) content.GetValueForProperty("CurrentPlanId",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).CurrentPlanId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).CurrentPlanName = (string) content.GetValueForProperty("CurrentPlanName",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).CurrentPlanName, 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.PlanRuleApplicableEntity"
        /// />.
        /// </summary>
        /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
        internal PlanRuleApplicableEntity(global::System.Management.Automation.PSObject content)
        {
            bool returnNow = false;
            BeforeDeserializePSObject(content, ref returnNow);
            if (returnNow)
            {
                return;
            }
            // actually deserialize
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Subclient = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("Subclient",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Subclient, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Backupset = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("Backupset",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Backupset, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Instance = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("Instance",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Instance, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Client = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("Client",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Client, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Apptype = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("Apptype",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).Apptype, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).EvaluatedPlan = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("EvaluatedPlan",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).EvaluatedPlan, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).CurrentPlan = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("CurrentPlan",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).CurrentPlan, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).RuleDetails = (Commvault.Powershell.Models.IPlanEntityRuleInfo) content.GetValueForProperty("RuleDetails",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).RuleDetails, Commvault.Powershell.Models.PlanEntityRuleInfoTypeConverter.ConvertFrom);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).SubclientId = (long?) content.GetValueForProperty("SubclientId",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).SubclientId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).SubclientName = (string) content.GetValueForProperty("SubclientName",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).SubclientName, global::System.Convert.ToString);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).BackupsetId = (long?) content.GetValueForProperty("BackupsetId",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).BackupsetId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).BackupsetName = (string) content.GetValueForProperty("BackupsetName",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).BackupsetName, global::System.Convert.ToString);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).InstanceId = (long?) content.GetValueForProperty("InstanceId",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).InstanceId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).InstanceName = (string) content.GetValueForProperty("InstanceName",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).InstanceName, global::System.Convert.ToString);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).ClientId = (long?) content.GetValueForProperty("ClientId",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).ClientId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).ClientName = (string) content.GetValueForProperty("ClientName",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).ClientName, global::System.Convert.ToString);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).ApptypeId = (long?) content.GetValueForProperty("ApptypeId",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).ApptypeId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).ApptypeName = (string) content.GetValueForProperty("ApptypeName",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).ApptypeName, global::System.Convert.ToString);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).EvaluatedPlanId = (long?) content.GetValueForProperty("EvaluatedPlanId",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).EvaluatedPlanId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).EvaluatedPlanName = (string) content.GetValueForProperty("EvaluatedPlanName",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).EvaluatedPlanName, global::System.Convert.ToString);
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).CurrentPlanId = (long?) content.GetValueForProperty("CurrentPlanId",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).CurrentPlanId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            ((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).CurrentPlanName = (string) content.GetValueForProperty("CurrentPlanName",((Commvault.Powershell.Models.IPlanRuleApplicableEntityInternal)this).CurrentPlanName, 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();
    }
    /// Entity applicable for plan association via plan assignment rules.
    [System.ComponentModel.TypeConverter(typeof(PlanRuleApplicableEntityTypeConverter))]
    public partial interface IPlanRuleApplicableEntity

    {

    }
}