generated/cmdlets/SetCVDcPlan_UpdateViaIdentityExpanded.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.Cmdlets { using static Commvault.Powershell.Runtime.Extensions; using Commvault.Powershell.Runtime.PowerShell; using Commvault.Powershell.Runtime.Cmdlets; using System; /// <summary>Used to modify an existing data classification plan</summary> /// <remarks> /// [OpenAPI] UpdateDCPlan=>PUT:"/V4/DCPlan/{planId}" /// </remarks> [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Set, @"CVDcPlan_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Commvault.Powershell.Models.IGenericResp))] [global::Commvault.Powershell.Description(@"Used to modify an existing data classification plan")] [global::Commvault.Powershell.Generated] [global::Commvault.Powershell.HttpPath(Path = "/V4/DCPlan/{planId}", ApiVersion = "LATEST")] public partial class SetCVDcPlan_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Commvault.Powershell.Runtime.IEventListener, Commvault.Powershell.Runtime.IContext { /// <summary>A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet)</summary> private global::System.Management.Automation.InvocationInfo __invocationInfo; /// <summary>Describes Input to Update Data Classification Plan</summary> private Commvault.Powershell.Models.IUpdateDcPlan _body = new Commvault.Powershell.Models.UpdateDcPlan(); /// <summary> /// The <see cref="global::System.Threading.CancellationTokenSource" /> for this operation. /// </summary> private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// <summary>A dictionary to carry over additional data for pipeline.</summary> private global::System.Collections.Generic.Dictionary<global::System.String,global::System.Object> _extensibleParameters = new System.Collections.Generic.Dictionary<string, object>(); /// <summary>A buffer to record first returned object in response.</summary> private object _firstResponse = null; /// <summary> /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. /// Two means multiple returned objects in response. /// </summary> private int _responseSize = 0; /// <summary>Wait for .NET debugger to attach</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } /// <summary>Accessor for cancellationTokenSource.</summary> public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } /// <summary>The reference to the client API class.</summary> public Commvault.Powershell.CommvaultPowerShell Client => Commvault.Powershell.Module.Instance.ClientAPI; /// <summary>.</summary> [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @".", SerializedName = @"contentAnalyzer", PossibleTypes = new [] { typeof(Commvault.Powershell.Models.IIdName) })] public Commvault.Powershell.Models.IIdName[] ContentAnalyzer { get => _body.ContentAnalyzer?.ToArray() ?? null /* fixedArrayOf */; set => _body.ContentAnalyzer = (value != null ? new System.Collections.Generic.List<Commvault.Powershell.Models.IIdName>(value) : null); } /// <summary>.</summary> [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @".", SerializedName = @"backupCopy", PossibleTypes = new [] { typeof(Commvault.Powershell.Models.IDcBackupCopy) })] public Commvault.Powershell.Models.IDcBackupCopy[] ContentIndexingBackupCopy { get => _body.ContentIndexingBackupCopy?.ToArray() ?? null /* fixedArrayOf */; set => _body.ContentIndexingBackupCopy = (value != null ? new System.Collections.Generic.List<Commvault.Powershell.Models.IDcBackupCopy>(value) : null); } /// <summary>OCR Languages Supported By DC Plan</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "OCR Languages Supported By DC Plan")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"OCR Languages Supported By DC Plan", SerializedName = @"contentLanguage", PossibleTypes = new [] { typeof(string) })] public string ContentIndexingContentLanguage { get => _body.ContentIndexingContentLanguage ?? null; set => _body.ContentIndexingContentLanguage = value; } /// <summary>Associated Domain of user having access to preview path</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Associated Domain of user having access to preview path")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Associated Domain of user having access to preview path", SerializedName = @"domainName", PossibleTypes = new [] { typeof(string) })] public string ContentIndexingDomainName { get => _body.ContentIndexingDomainName ?? null; set => _body.ContentIndexingDomainName = value; } /// <summary>Whether Exact Search is enabled or disabled</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether Exact Search is enabled or disabled")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Whether Exact Search is enabled or disabled", SerializedName = @"exactSearch", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter ContentIndexingExactSearch { get => _body.ContentIndexingExactSearch ?? default(global::System.Management.Automation.SwitchParameter); set => _body.ContentIndexingExactSearch = value; } /// <summary>Whether Image Extraction is Enabled</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Whether Image Extraction is Enabled")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Whether Image Extraction is Enabled", SerializedName = @"extractTextFromImage", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter ContentIndexingExtractTextFromImage { get => _body.ContentIndexingExtractTextFromImage ?? default(global::System.Management.Automation.SwitchParameter); set => _body.ContentIndexingExtractTextFromImage = value; } /// <summary> /// Describes the Preview path for Content Indexed Data when search type is METADATA_CONTENT_PREVIEW /// </summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Describes the Preview path for Content Indexed Data when search type is METADATA_CONTENT_PREVIEW")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Describes the Preview path for Content Indexed Data when search type is METADATA_CONTENT_PREVIEW", SerializedName = @"previewPath", PossibleTypes = new [] { typeof(string) })] public string ContentIndexingPreviewPath { get => _body.ContentIndexingPreviewPath ?? null; set => _body.ContentIndexingPreviewPath = value; } /// <summary>Describes the Content Indexing Operation Type for Data Classification Plan</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Describes the Content Indexing Operation Type for Data Classification Plan")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Describes the Content Indexing Operation Type for Data Classification Plan", SerializedName = @"searchType", PossibleTypes = new [] { typeof(string) })] public string ContentIndexingSearchType { get => _body.ContentIndexingSearchType ?? null; set => _body.ContentIndexingSearchType = value; } /// <summary>Associated user name of user having access to preview path</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Associated user name of user having access to preview path")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Associated user name of user having access to preview path", SerializedName = @"userName", PossibleTypes = new [] { typeof(string) })] public string ContentIndexingUserName { get => _body.ContentIndexingUserName ?? null; set => _body.ContentIndexingUserName = value; } /// <summary>Classifier TagId For Extraction</summary> [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Classifier TagId For Extraction")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Classifier TagId For Extraction", SerializedName = @"classifiers", PossibleTypes = new [] { typeof(Commvault.Powershell.Models.IIdName) })] public Commvault.Powershell.Models.IIdName[] EntityDetectionClassifiers { get => _body.EntityDetectionClassifiers?.ToArray() ?? null /* fixedArrayOf */; set => _body.EntityDetectionClassifiers = (value != null ? new System.Collections.Generic.List<Commvault.Powershell.Models.IIdName>(value) : null); } /// <summary>.</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @".", SerializedName = @"copyPrecendence", PossibleTypes = new [] { typeof(long) })] public long EntityDetectionCopyPrecendence { get => _body.EntityDetectionCopyPrecendence ?? default(long); set => _body.EntityDetectionCopyPrecendence = value; } /// <summary>Entity TagId for Extraction</summary> [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Entity TagId for Extraction")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Entity TagId for Extraction", SerializedName = @"entities", PossibleTypes = new [] { typeof(Commvault.Powershell.Models.IIdName) })] public Commvault.Powershell.Models.IIdName[] EntityDetectionEntities { get => _body.EntityDetectionEntities?.ToArray() ?? null /* fixedArrayOf */; set => _body.EntityDetectionEntities = (value != null ? new System.Collections.Generic.List<Commvault.Powershell.Models.IIdName>(value) : null); } /// <summary>Accessor for extensibleParameters.</summary> public global::System.Collections.Generic.IDictionary<global::System.String,global::System.Object> ExtensibleParameters { get => _extensibleParameters ; } /// <summary>.</summary> [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @".", SerializedName = @"excludePaths", PossibleTypes = new [] { typeof(string) })] public string[] FileFilterExcludePaths { get => _body.FileFilterExcludePaths?.ToArray() ?? null /* fixedArrayOf */; set => _body.FileFilterExcludePaths = (value != null ? new System.Collections.Generic.List<string>(value) : null); } /// <summary>.</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @".", SerializedName = @"includeDocTypes", PossibleTypes = new [] { typeof(string) })] public string FileFilterIncludeDocTypes { get => _body.FileFilterIncludeDocTypes ?? null; set => _body.FileFilterIncludeDocTypes = value; } /// <summary>.</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @".", SerializedName = @"maxDocSize", PossibleTypes = new [] { typeof(long) })] public long FileFilterMaxDocSize { get => _body.FileFilterMaxDocSize ?? default(long); set => _body.FileFilterMaxDocSize = value; } /// <summary>.</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @".", SerializedName = @"minDocSize", PossibleTypes = new [] { typeof(long) })] public long FileFilterMinDocSize { get => _body.FileFilterMinDocSize ?? default(long); set => _body.FileFilterMinDocSize = value; } /// <summary>SendAsync Pipeline Steps to be appended to the front of the pipeline</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Runtime)] public Commvault.Powershell.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } /// <summary>SendAsync Pipeline Steps to be prepended to the front of the pipeline</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Runtime)] public Commvault.Powershell.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } /// <summary>Backing field for <see cref="InputObject" /> property.</summary> private Commvault.Powershell.Models.ICommvaultPowerShellIdentity _inputObject; /// <summary>Identity Parameter</summary> [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Path)] public Commvault.Powershell.Models.ICommvaultPowerShellIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } /// <summary>Accessor for our copy of the InvocationInfo.</summary> public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// <summary> /// <see cref="Commvault.Powershell.Runtime.IEventListener" /> cancellation delegate. Stops the cmdlet when called. /// </summary> global::System.Action Commvault.Powershell.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; /// <summary><see cref="Commvault.Powershell.Runtime.IEventListener" /> cancellation token.</summary> global::System.Threading.CancellationToken Commvault.Powershell.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// <summary>Name of the Data Classification plan</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the Data Classification plan")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Name of the Data Classification plan", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] public string Name { get => _body.Name ?? null; set => _body.Name = value; } /// <summary> /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. /// </summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter PassThru { get; set; } /// <summary>Day on which to run the schedule, applicable for monthly, yearly</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Day on which to run the schedule, applicable for monthly, yearly")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Day on which to run the schedule, applicable for monthly, yearly", SerializedName = @"dayOfMonth", PossibleTypes = new [] { typeof(long) })] public long PatternDayOfMonth { get => _body.PatternDayOfMonth ?? default(long); set => _body.PatternDayOfMonth = value; } /// <summary>.</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @".", SerializedName = @"dayOfWeek", PossibleTypes = new [] { typeof(string) })] public string PatternDayOfWeek { get => _body.PatternDayOfWeek ?? null; set => _body.PatternDayOfWeek = value; } /// <summary> /// Exceptions to when a schedule should not run, either in dates or week of month and day /// </summary> [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Exceptions to when a schedule should not run, either in dates or week of month and day")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Exceptions to when a schedule should not run, either in dates or week of month and day", SerializedName = @"exceptions", PossibleTypes = new [] { typeof(Commvault.Powershell.Models.IScheduleRunException) })] public Commvault.Powershell.Models.IScheduleRunException[] PatternExceptions { get => _body.PatternExceptions?.ToArray() ?? null /* fixedArrayOf */; set => _body.PatternExceptions = (value != null ? new System.Collections.Generic.List<Commvault.Powershell.Models.IScheduleRunException>(value) : null); } /// <summary> /// Frequency of the schedule based on schedule frequency type eg. for Hours, value 2 is 2 hours, for Minutes, 30 is 30 minutes, /// for Daily, 2 is 2 days. for Monthly 2 is it repeats every 2 months /// </summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Frequency of the schedule based on schedule frequency type eg. for Hours, value 2 is 2 hours, for Minutes, 30 is 30 minutes, for Daily, 2 is 2 days. for Monthly 2 is it repeats every 2 months")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Frequency of the schedule based on schedule frequency type eg. for Hours, value 2 is 2 hours, for Minutes, 30 is 30 minutes, for Daily, 2 is 2 days. for Monthly 2 is it repeats every 2 months", SerializedName = @"frequency", PossibleTypes = new [] { typeof(long) })] public long PatternFrequency { get => _body.PatternFrequency ?? default(long); set => _body.PatternFrequency = value; } /// <summary>.</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @".", SerializedName = @"monthOfYear", PossibleTypes = new [] { typeof(string) })] public string PatternMonthOfYear { get => _body.PatternMonthOfYear ?? null; set => _body.PatternMonthOfYear = value; } /// <summary>schedule frequency type</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "schedule frequency type")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"schedule frequency type", SerializedName = @"scheduleFrequencyType", PossibleTypes = new [] { typeof(string) })] public string PatternScheduleFrequencyType { get => _body.PatternScheduleFrequencyType ?? null; set => _body.PatternScheduleFrequencyType = value; } /// <summary>start date of schedule in epoch format</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "start date of schedule in epoch format")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"start date of schedule in epoch format", SerializedName = @"startDate", PossibleTypes = new [] { typeof(long) })] public long PatternStartDate { get => _body.PatternStartDate ?? default(long); set => _body.PatternStartDate = value; } /// <summary>start time of schedule in seconds for daily, weekly, monthly, yearly frequency</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "start time of schedule in seconds for daily, weekly, monthly, yearly frequency")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"start time of schedule in seconds for daily, weekly, monthly, yearly frequency", SerializedName = @"startTime", PossibleTypes = new [] { typeof(long) })] public long PatternStartTime { get => _body.PatternStartTime ?? default(long); set => _body.PatternStartTime = value; } /// <summary>Specific week of a month</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specific week of a month")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Specific week of a month", SerializedName = @"weekOfMonth", PossibleTypes = new [] { typeof(string) })] public string PatternWeekOfMonth { get => _body.PatternWeekOfMonth ?? null; set => _body.PatternWeekOfMonth = value; } /// <summary>Days of the week for weekly frequency</summary> [global::System.Management.Automation.AllowEmptyCollection] [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Days of the week for weekly frequency")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Days of the week for weekly frequency", SerializedName = @"weeklyDays", PossibleTypes = new [] { typeof(string) })] public string[] PatternWeeklyDays { get => _body.PatternWeeklyDays?.ToArray() ?? null /* fixedArrayOf */; set => _body.PatternWeeklyDays = (value != null ? new System.Collections.Generic.List<string>(value) : null); } /// <summary> /// The instance of the <see cref="Commvault.Powershell.Runtime.HttpPipeline" /> that the remote call will use. /// </summary> public Commvault.Powershell.Runtime.HttpPipeline Pipeline { get; set; } /// <summary>The URI for the proxy server to use</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Runtime)] public global::System.Uri Proxy { get; set; } /// <summary>Credentials for a proxy server to use for the remote call</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] [global::System.Management.Automation.ValidateNotNull] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Runtime)] public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } /// <summary>Use the default credentials for the proxy</summary> [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } /// <summary>.</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = ".")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @".", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] public string ScheduleName { get => _body.ScheduleName ?? null; set => _body.ScheduleName = value; } /// <summary>Enables\Disables Threat Analysis support for DC Plan</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Enables\\Disables Threat Analysis support for DC Plan")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Enables\Disables Threat Analysis support for DC Plan", SerializedName = @"threatAnalysis", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter ThreatAnalysis { get => _body.ThreatAnalysis ?? default(global::System.Management.Automation.SwitchParameter); set => _body.ThreatAnalysis = value; } /// <summary> /// <c>overrideOnBadRequest</c> will be called before the regular onBadRequest has been processed, allowing customization /// of what happens on that response. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Commvault.Powershell.Models.IGenericResp">Commvault.Powershell.Models.IGenericResp</see> /// from the remote call</param> /// <param name="returnNow">/// Determines if the rest of the onBadRequest method should be processed, or if the method should /// return immediately (set to true to skip further processing )</param> partial void overrideOnBadRequest(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Commvault.Powershell.Models.IGenericResp> response, ref global::System.Threading.Tasks.Task<bool> returnNow); /// <summary> /// <c>overrideOnForbidden</c> will be called before the regular onForbidden has been processed, allowing customization of /// what happens on that response. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Commvault.Powershell.Models.IGenericResp">Commvault.Powershell.Models.IGenericResp</see> /// from the remote call</param> /// <param name="returnNow">/// Determines if the rest of the onForbidden method should be processed, or if the method should /// return immediately (set to true to skip further processing )</param> partial void overrideOnForbidden(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Commvault.Powershell.Models.IGenericResp> response, ref global::System.Threading.Tasks.Task<bool> returnNow); /// <summary> /// <c>overrideOnInternalServerError</c> will be called before the regular onInternalServerError has been processed, allowing /// customization of what happens on that response. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Commvault.Powershell.Models.IGenericResp">Commvault.Powershell.Models.IGenericResp</see> /// from the remote call</param> /// <param name="returnNow">/// Determines if the rest of the onInternalServerError method should be processed, or if the /// method should return immediately (set to true to skip further processing )</param> partial void overrideOnInternalServerError(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Commvault.Powershell.Models.IGenericResp> response, ref global::System.Threading.Tasks.Task<bool> returnNow); /// <summary> /// <c>overrideOnNotFound</c> will be called before the regular onNotFound has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="returnNow">/// Determines if the rest of the onNotFound method should be processed, or if the method should /// return immediately (set to true to skip further processing )</param> partial void overrideOnNotFound(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task<bool> returnNow); /// <summary> /// <c>overrideOnOk</c> will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// </summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Commvault.Powershell.Models.IGenericResp">Commvault.Powershell.Models.IGenericResp</see> /// from the remote call</param> /// <param name="returnNow">/// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing )</param> partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Commvault.Powershell.Models.IGenericResp> response, ref global::System.Threading.Tasks.Task<bool> returnNow); /// <summary> /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) /// </summary> protected override void BeginProcessing() { Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); if (Break) { Commvault.Powershell.Runtime.AttachDebugger.Break(); } ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Commvault.Powershell.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } /// <summary>Performs clean-up after the command execution</summary> protected override void EndProcessing() { if (1 ==_responseSize) { // Flush buffer WriteObject(_firstResponse); } ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Commvault.Powershell.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } /// <summary>Handles/Dispatches events during the call to the REST service.</summary> /// <param name="id">The message id</param> /// <param name="token">The message cancellation token. When this call is cancelled, this should be <c>true</c></param> /// <param name="messageData">Detailed message data for the message event.</param> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the message is completed. /// </returns> async global::System.Threading.Tasks.Task Commvault.Powershell.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func<Commvault.Powershell.Runtime.EventData> messageData) { using( NoSynchronizationContext ) { if (token.IsCancellationRequested) { return ; } switch ( id ) { case Commvault.Powershell.Runtime.Events.Verbose: { WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); return ; } case Commvault.Powershell.Runtime.Events.Warning: { WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); return ; } case Commvault.Powershell.Runtime.Events.Information: { var data = messageData(); WriteInformation(data.Message, new string[]{}); return ; } case Commvault.Powershell.Runtime.Events.Debug: { WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); return ; } case Commvault.Powershell.Runtime.Events.Error: { WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } case Commvault.Powershell.Runtime.Events.Progress: { var data = messageData(); int progress = (int)data.Value; string activityMessage, statusDescription; global::System.Management.Automation.ProgressRecordType recordType; if (progress < 100) { activityMessage = "In progress"; statusDescription = "Checking operation status"; recordType = System.Management.Automation.ProgressRecordType.Processing; } else { activityMessage = "Completed"; statusDescription = "Completed"; recordType = System.Management.Automation.ProgressRecordType.Completed; } WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) { PercentComplete = progress, RecordType = recordType }); return ; } } await Commvault.Powershell.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Commvault.Powershell.Runtime.IEventListener)this).Signal(i, t, () => Commvault.Powershell.Runtime.EventDataConverter.ConvertFrom(m()) as Commvault.Powershell.Runtime.EventData), InvocationInformation, this.ParameterSetName, null ); if (token.IsCancellationRequested) { return ; } WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); } } /// <summary>Performs execution of the command.</summary> protected override void ProcessRecord() { ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Commvault.Powershell.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } try { // work if (ShouldProcess($"Call remote 'UpdateDcPlan' operation")) { using( var asyncCommandRuntime = new Commvault.Powershell.Runtime.PowerShell.AsyncCommandRuntime(this, ((Commvault.Powershell.Runtime.IEventListener)this).Token) ) { asyncCommandRuntime.Wait( ProcessRecordAsync(),((Commvault.Powershell.Runtime.IEventListener)this).Token); } } } catch (global::System.AggregateException aggregateException) { // unroll the inner exceptions to get the root cause foreach( var innerException in aggregateException.Flatten().InnerExceptions ) { ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Commvault.Powershell.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } // Write exception out to error channel. WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); } } catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) { ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Commvault.Powershell.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } // Write exception out to error channel. WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); } finally { ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletProcessRecordEnd).Wait(); } } /// <summary>Performs execution of the command, working asynchronously if required.</summary> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed. /// </returns> protected async global::System.Threading.Tasks.Task ProcessRecordAsync() { using( NoSynchronizationContext ) { await ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Commvault.Powershell.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } await ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletGetPipeline); if( ((Commvault.Powershell.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } Pipeline = Commvault.Powershell.Module.Instance.CreatePipeline(InvocationInformation, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Commvault.Powershell.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); } if (null != HttpPipelineAppend) { Pipeline.Append((this.CommandRuntime as Commvault.Powershell.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); } // get the client instance try { await ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletBeforeAPICall); if( ((Commvault.Powershell.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } // try to call with PATH parameters from Input Object if (null == InputObject.PlanId) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PlanId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } await this.Client.UpdateDcPlan(InputObject.PlanId ?? default(long), _body, onOk, onBadRequest, onForbidden, onNotFound, onInternalServerError, this, Pipeline, Commvault.Powershell.Runtime.SerializationMode.IncludeCreate); await ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletAfterAPICall); if( ((Commvault.Powershell.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Commvault.Powershell.Runtime.UndeclaredResponseException urexception) { WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); } finally { await ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletProcessRecordAsyncEnd); } } } /// <summary> /// Initializes a new instance of the <see cref="SetCVDcPlan_UpdateViaIdentityExpanded" /> cmdlet class. /// </summary> public SetCVDcPlan_UpdateViaIdentityExpanded() { } /// <summary>Interrupts currently running code within the command.</summary> protected override void StopProcessing() { ((Commvault.Powershell.Runtime.IEventListener)this).Cancel(); base.StopProcessing(); } /// <summary>a delegate that is called when the remote service returns 400 (BadRequest).</summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Commvault.Powershell.Models.IGenericResp">Commvault.Powershell.Models.IGenericResp</see> /// from the remote call</param> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed. /// </returns> private async global::System.Threading.Tasks.Task onBadRequest(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Commvault.Powershell.Models.IGenericResp> response) { using( NoSynchronizationContext ) { var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false); overrideOnBadRequest(responseMessage, response, ref _returnNow); // if overrideOnBadRequest has returned true, then return right away. if ((null != _returnNow && await _returnNow)) { return ; } // onBadRequest - response for 400 / application/json // (await response) // should be Commvault.Powershell.Models.IGenericResp var result = (await response); if (null != result) { if (0 == _responseSize) { _firstResponse = result; _responseSize = 1; } else { if (1 ==_responseSize) { // Flush buffer WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); } WriteObject(result.AddMultipleTypeNameIntoPSObject()); _responseSize = 2; } } } } /// <summary>a delegate that is called when the remote service returns 403 (Forbidden).</summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Commvault.Powershell.Models.IGenericResp">Commvault.Powershell.Models.IGenericResp</see> /// from the remote call</param> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed. /// </returns> private async global::System.Threading.Tasks.Task onForbidden(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Commvault.Powershell.Models.IGenericResp> response) { using( NoSynchronizationContext ) { var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false); overrideOnForbidden(responseMessage, response, ref _returnNow); // if overrideOnForbidden has returned true, then return right away. if ((null != _returnNow && await _returnNow)) { return ; } // onForbidden - response for 403 / application/json // (await response) // should be Commvault.Powershell.Models.IGenericResp var result = (await response); if (null != result) { if (0 == _responseSize) { _firstResponse = result; _responseSize = 1; } else { if (1 ==_responseSize) { // Flush buffer WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); } WriteObject(result.AddMultipleTypeNameIntoPSObject()); _responseSize = 2; } } } } /// <summary> /// a delegate that is called when the remote service returns 500 (InternalServerError). /// </summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Commvault.Powershell.Models.IGenericResp">Commvault.Powershell.Models.IGenericResp</see> /// from the remote call</param> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed. /// </returns> private async global::System.Threading.Tasks.Task onInternalServerError(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Commvault.Powershell.Models.IGenericResp> response) { using( NoSynchronizationContext ) { var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false); overrideOnInternalServerError(responseMessage, response, ref _returnNow); // if overrideOnInternalServerError has returned true, then return right away. if ((null != _returnNow && await _returnNow)) { return ; } // onInternalServerError - response for 500 / application/json // (await response) // should be Commvault.Powershell.Models.IGenericResp var result = (await response); if (null != result) { if (0 == _responseSize) { _firstResponse = result; _responseSize = 1; } else { if (1 ==_responseSize) { // Flush buffer WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); } WriteObject(result.AddMultipleTypeNameIntoPSObject()); _responseSize = 2; } } } } /// <summary>a delegate that is called when the remote service returns 404 (NotFound).</summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed. /// </returns> private async global::System.Threading.Tasks.Task onNotFound(global::System.Net.Http.HttpResponseMessage responseMessage) { using( NoSynchronizationContext ) { var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false); overrideOnNotFound(responseMessage, ref _returnNow); // if overrideOnNotFound has returned true, then return right away. if ((null != _returnNow && await _returnNow)) { return ; } // onNotFound - response for 404 / if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } } } /// <summary>a delegate that is called when the remote service returns 200 (OK).</summary> /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param> /// <param name="response">the body result as a <see cref="Commvault.Powershell.Models.IGenericResp">Commvault.Powershell.Models.IGenericResp</see> /// from the remote call</param> /// <returns> /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed. /// </returns> private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Commvault.Powershell.Models.IGenericResp> response) { using( NoSynchronizationContext ) { var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false); overrideOnOk(responseMessage, response, ref _returnNow); // if overrideOnOk has returned true, then return right away. if ((null != _returnNow && await _returnNow)) { return ; } // onOk - response for 200 / application/json // (await response) // should be Commvault.Powershell.Models.IGenericResp var result = (await response); if (null != result) { if (0 == _responseSize) { _firstResponse = result; _responseSize = 1; } else { if (1 ==_responseSize) { // Flush buffer WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); } WriteObject(result.AddMultipleTypeNameIntoPSObject()); _responseSize = 2; } } } } } } |