internal new static PolicyRangePartition CreateFromMetadata(Table parent, TOM.Partition metadataObject)
        {
            var obj = new PolicyRangePartition(metadataObject);

            parent.Partitions.Add(obj);

            obj.Init();

            return(obj);
        }
        public new static PolicyRangePartition CreateNew(Table parent, string name = null)
        {
            if (!parent.Handler.PowerBIGovernance.AllowCreate(typeof(PolicyRangePartition)))
            {
                throw new InvalidOperationException(string.Format(Messages.CannotCreatePowerBIObject, typeof(PolicyRangePartition).GetTypeName()));
            }

            var metadataObject = new TOM.Partition();

            metadataObject.Name   = parent.Partitions.GetNewName(string.IsNullOrWhiteSpace(name) ? "New " + typeof(PolicyRangePartition).GetTypeName() : name);
            metadataObject.Source = new TOM.PolicyRangePartitionSource();

            var obj = new PolicyRangePartition(metadataObject);

            parent.Partitions.Add(obj);

            obj.Init();

            return(obj);
        }