generated/api/Models/MediaDetails.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>Details of Media</summary>
    [System.ComponentModel.TypeConverter(typeof(MediaDetailsTypeConverter))]
    public partial class MediaDetails
    {

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

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

        /// <summary>
        /// Creates a new instance of <see cref="MediaDetails" />, 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="MediaDetails" /> model class.</returns>
        public static Commvault.Powershell.Models.IMediaDetails 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.MediaDetails"
        /// />.
        /// </summary>
        /// <param name="content">The global::System.Collections.IDictionary content that should be used.</param>
        internal MediaDetails(global::System.Collections.IDictionary content)
        {
            bool returnNow = false;
            BeforeDeserializeDictionary(content, ref returnNow);
            if (returnNow)
            {
                return;
            }
            // actually deserialize
            if (content.Contains("StoragePolicy"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicy = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("StoragePolicy",((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicy, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            }
            if (content.Contains("StoragePolicyCopy"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyCopy = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("StoragePolicyCopy",((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyCopy, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            }
            if (content.Contains("Slot"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).Slot = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("Slot",((Commvault.Powershell.Models.IMediaDetailsInternal)this).Slot, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            }
            if (content.Contains("Container"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).Container = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("Container",((Commvault.Powershell.Models.IMediaDetailsInternal)this).Container, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            }
            if (content.Contains("SpareGroup"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).SpareGroup = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("SpareGroup",((Commvault.Powershell.Models.IMediaDetailsInternal)this).SpareGroup, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            }
            if (content.Contains("MediaType"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).MediaType = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("MediaType",((Commvault.Powershell.Models.IMediaDetailsInternal)this).MediaType, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            }
            if (content.Contains("Drive"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).Drive = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("Drive",((Commvault.Powershell.Models.IMediaDetailsInternal)this).Drive, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            }
            if (content.Contains("MediaId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).MediaId = (long?) content.GetValueForProperty("MediaId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).MediaId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("IsExported"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).IsExported = (bool?) content.GetValueForProperty("IsExported",((Commvault.Powershell.Models.IMediaDetailsInternal)this).IsExported, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            }
            if (content.Contains("LibraryId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).LibraryId = (long?) content.GetValueForProperty("LibraryId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).LibraryId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("LibraryName"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).LibraryName = (string) content.GetValueForProperty("LibraryName",((Commvault.Powershell.Models.IMediaDetailsInternal)this).LibraryName, global::System.Convert.ToString);
            }
            if (content.Contains("Status"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).Status = (string) content.GetValueForProperty("Status",((Commvault.Powershell.Models.IMediaDetailsInternal)this).Status, global::System.Convert.ToString);
            }
            if (content.Contains("Barcode"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).Barcode = (string) content.GetValueForProperty("Barcode",((Commvault.Powershell.Models.IMediaDetailsInternal)this).Barcode, global::System.Convert.ToString);
            }
            if (content.Contains("StoredDataBytes"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoredDataBytes = (long?) content.GetValueForProperty("StoredDataBytes",((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoredDataBytes, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("LastWriteTime"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).LastWriteTime = (long?) content.GetValueForProperty("LastWriteTime",((Commvault.Powershell.Models.IMediaDetailsInternal)this).LastWriteTime, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("RetainDataUntil"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).RetainDataUntil = (long?) content.GetValueForProperty("RetainDataUntil",((Commvault.Powershell.Models.IMediaDetailsInternal)this).RetainDataUntil, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SpareGroupType"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).SpareGroupType = (string) content.GetValueForProperty("SpareGroupType",((Commvault.Powershell.Models.IMediaDetailsInternal)this).SpareGroupType, global::System.Convert.ToString);
            }
            if (content.Contains("IsInMediaGroup"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).IsInMediaGroup = (bool?) content.GetValueForProperty("IsInMediaGroup",((Commvault.Powershell.Models.IMediaDetailsInternal)this).IsInMediaGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            }
            if (content.Contains("GuiMediaAttribute"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).GuiMediaAttribute = (long?) content.GetValueForProperty("GuiMediaAttribute",((Commvault.Powershell.Models.IMediaDetailsInternal)this).GuiMediaAttribute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("StoragePolicyId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyId = (long?) content.GetValueForProperty("StoragePolicyId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("StoragePolicyName"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyName = (string) content.GetValueForProperty("StoragePolicyName",((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyName, global::System.Convert.ToString);
            }
            if (content.Contains("StoragePolicyCopyId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyCopyId = (long?) content.GetValueForProperty("StoragePolicyCopyId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyCopyId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("StoragePolicyCopyName"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyCopyName = (string) content.GetValueForProperty("StoragePolicyCopyName",((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyCopyName, global::System.Convert.ToString);
            }
            if (content.Contains("SlotId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).SlotId = (long?) content.GetValueForProperty("SlotId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).SlotId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SlotName"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).SlotName = (string) content.GetValueForProperty("SlotName",((Commvault.Powershell.Models.IMediaDetailsInternal)this).SlotName, global::System.Convert.ToString);
            }
            if (content.Contains("ContainerId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).ContainerId = (long?) content.GetValueForProperty("ContainerId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).ContainerId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ContainerName"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Commvault.Powershell.Models.IMediaDetailsInternal)this).ContainerName, global::System.Convert.ToString);
            }
            if (content.Contains("SpareGroupId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).SpareGroupId = (long?) content.GetValueForProperty("SpareGroupId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).SpareGroupId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SpareGroupName"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).SpareGroupName = (string) content.GetValueForProperty("SpareGroupName",((Commvault.Powershell.Models.IMediaDetailsInternal)this).SpareGroupName, global::System.Convert.ToString);
            }
            if (content.Contains("MediaTypeId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).MediaTypeId = (long?) content.GetValueForProperty("MediaTypeId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).MediaTypeId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("MediaTypeName"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).MediaTypeName = (string) content.GetValueForProperty("MediaTypeName",((Commvault.Powershell.Models.IMediaDetailsInternal)this).MediaTypeName, global::System.Convert.ToString);
            }
            if (content.Contains("DriveId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).DriveId = (long?) content.GetValueForProperty("DriveId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).DriveId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("DriveName"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).DriveName = (string) content.GetValueForProperty("DriveName",((Commvault.Powershell.Models.IMediaDetailsInternal)this).DriveName, 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.MediaDetails"
        /// />.
        /// </summary>
        /// <param name="content">The global::System.Management.Automation.PSObject content that should be used.</param>
        internal MediaDetails(global::System.Management.Automation.PSObject content)
        {
            bool returnNow = false;
            BeforeDeserializePSObject(content, ref returnNow);
            if (returnNow)
            {
                return;
            }
            // actually deserialize
            if (content.Contains("StoragePolicy"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicy = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("StoragePolicy",((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicy, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            }
            if (content.Contains("StoragePolicyCopy"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyCopy = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("StoragePolicyCopy",((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyCopy, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            }
            if (content.Contains("Slot"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).Slot = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("Slot",((Commvault.Powershell.Models.IMediaDetailsInternal)this).Slot, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            }
            if (content.Contains("Container"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).Container = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("Container",((Commvault.Powershell.Models.IMediaDetailsInternal)this).Container, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            }
            if (content.Contains("SpareGroup"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).SpareGroup = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("SpareGroup",((Commvault.Powershell.Models.IMediaDetailsInternal)this).SpareGroup, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            }
            if (content.Contains("MediaType"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).MediaType = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("MediaType",((Commvault.Powershell.Models.IMediaDetailsInternal)this).MediaType, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            }
            if (content.Contains("Drive"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).Drive = (Commvault.Powershell.Models.IIdName) content.GetValueForProperty("Drive",((Commvault.Powershell.Models.IMediaDetailsInternal)this).Drive, Commvault.Powershell.Models.IdNameTypeConverter.ConvertFrom);
            }
            if (content.Contains("MediaId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).MediaId = (long?) content.GetValueForProperty("MediaId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).MediaId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("IsExported"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).IsExported = (bool?) content.GetValueForProperty("IsExported",((Commvault.Powershell.Models.IMediaDetailsInternal)this).IsExported, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            }
            if (content.Contains("LibraryId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).LibraryId = (long?) content.GetValueForProperty("LibraryId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).LibraryId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("LibraryName"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).LibraryName = (string) content.GetValueForProperty("LibraryName",((Commvault.Powershell.Models.IMediaDetailsInternal)this).LibraryName, global::System.Convert.ToString);
            }
            if (content.Contains("Status"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).Status = (string) content.GetValueForProperty("Status",((Commvault.Powershell.Models.IMediaDetailsInternal)this).Status, global::System.Convert.ToString);
            }
            if (content.Contains("Barcode"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).Barcode = (string) content.GetValueForProperty("Barcode",((Commvault.Powershell.Models.IMediaDetailsInternal)this).Barcode, global::System.Convert.ToString);
            }
            if (content.Contains("StoredDataBytes"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoredDataBytes = (long?) content.GetValueForProperty("StoredDataBytes",((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoredDataBytes, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("LastWriteTime"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).LastWriteTime = (long?) content.GetValueForProperty("LastWriteTime",((Commvault.Powershell.Models.IMediaDetailsInternal)this).LastWriteTime, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("RetainDataUntil"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).RetainDataUntil = (long?) content.GetValueForProperty("RetainDataUntil",((Commvault.Powershell.Models.IMediaDetailsInternal)this).RetainDataUntil, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SpareGroupType"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).SpareGroupType = (string) content.GetValueForProperty("SpareGroupType",((Commvault.Powershell.Models.IMediaDetailsInternal)this).SpareGroupType, global::System.Convert.ToString);
            }
            if (content.Contains("IsInMediaGroup"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).IsInMediaGroup = (bool?) content.GetValueForProperty("IsInMediaGroup",((Commvault.Powershell.Models.IMediaDetailsInternal)this).IsInMediaGroup, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool)));
            }
            if (content.Contains("GuiMediaAttribute"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).GuiMediaAttribute = (long?) content.GetValueForProperty("GuiMediaAttribute",((Commvault.Powershell.Models.IMediaDetailsInternal)this).GuiMediaAttribute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("StoragePolicyId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyId = (long?) content.GetValueForProperty("StoragePolicyId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("StoragePolicyName"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyName = (string) content.GetValueForProperty("StoragePolicyName",((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyName, global::System.Convert.ToString);
            }
            if (content.Contains("StoragePolicyCopyId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyCopyId = (long?) content.GetValueForProperty("StoragePolicyCopyId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyCopyId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("StoragePolicyCopyName"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyCopyName = (string) content.GetValueForProperty("StoragePolicyCopyName",((Commvault.Powershell.Models.IMediaDetailsInternal)this).StoragePolicyCopyName, global::System.Convert.ToString);
            }
            if (content.Contains("SlotId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).SlotId = (long?) content.GetValueForProperty("SlotId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).SlotId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SlotName"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).SlotName = (string) content.GetValueForProperty("SlotName",((Commvault.Powershell.Models.IMediaDetailsInternal)this).SlotName, global::System.Convert.ToString);
            }
            if (content.Contains("ContainerId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).ContainerId = (long?) content.GetValueForProperty("ContainerId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).ContainerId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("ContainerName"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Commvault.Powershell.Models.IMediaDetailsInternal)this).ContainerName, global::System.Convert.ToString);
            }
            if (content.Contains("SpareGroupId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).SpareGroupId = (long?) content.GetValueForProperty("SpareGroupId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).SpareGroupId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("SpareGroupName"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).SpareGroupName = (string) content.GetValueForProperty("SpareGroupName",((Commvault.Powershell.Models.IMediaDetailsInternal)this).SpareGroupName, global::System.Convert.ToString);
            }
            if (content.Contains("MediaTypeId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).MediaTypeId = (long?) content.GetValueForProperty("MediaTypeId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).MediaTypeId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("MediaTypeName"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).MediaTypeName = (string) content.GetValueForProperty("MediaTypeName",((Commvault.Powershell.Models.IMediaDetailsInternal)this).MediaTypeName, global::System.Convert.ToString);
            }
            if (content.Contains("DriveId"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).DriveId = (long?) content.GetValueForProperty("DriveId",((Commvault.Powershell.Models.IMediaDetailsInternal)this).DriveId, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long)));
            }
            if (content.Contains("DriveName"))
            {
                ((Commvault.Powershell.Models.IMediaDetailsInternal)this).DriveName = (string) content.GetValueForProperty("DriveName",((Commvault.Powershell.Models.IMediaDetailsInternal)this).DriveName, 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();
        }
    }
    /// Details of Media
    [System.ComponentModel.TypeConverter(typeof(MediaDetailsTypeConverter))]
    public partial interface IMediaDetails

    {

    }
}