generated/cmdlets/SetCVVMGroup_UpdateExpanded.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>Update the VM Group</summary> /// <remarks> /// [OpenAPI] UpdateVMGroup=>PUT:"/V4/VmGroup/{VmGroupId}" /// </remarks> [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Set, @"CVVMGroup_UpdateExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Commvault.Powershell.Models.IGenericRespWithWarning), typeof(Commvault.Powershell.Models.IGenericResp))] [global::Commvault.Powershell.Description(@"Update the VM Group")] [global::Commvault.Powershell.Generated] [global::Commvault.Powershell.HttpPath(Path = "/V4/VmGroup/{VmGroupId}", ApiVersion = "LATEST")] public partial class SetCVVMGroup_UpdateExpanded : 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>UpdatevmGroupReq</summary> private Commvault.Powershell.Models.IUpdatevmGroupReq _body = new Commvault.Powershell.Models.UpdatevmGroupReq(); /// <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>.</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 = @"accessNode", PossibleTypes = new [] { typeof(Commvault.Powershell.Models.IAccessNodeModel) })] public Commvault.Powershell.Models.IAccessNodeModel[] AccessNode { get => _body.AccessNode?.ToArray() ?? null /* fixedArrayOf */; set => _body.AccessNode = (value != null ? new System.Collections.Generic.List<Commvault.Powershell.Models.IAccessNodeModel>(value) : null); } /// <summary>true if Backup is enabled</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "true if Backup is enabled")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"true if Backup is enabled", SerializedName = @"enableBackup", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter ActivityControlEnableBackup { get => _body.ActivityControlEnableBackup ?? default(global::System.Management.Automation.SwitchParameter); set => _body.ActivityControlEnableBackup = value; } /// <summary>true if Restore is enabled</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "true if Restore is enabled")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"true if Restore is enabled", SerializedName = @"enableRestore", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter ActivityControlEnableRestore { get => _body.ActivityControlEnableRestore ?? default(global::System.Management.Automation.SwitchParameter); set => _body.ActivityControlEnableRestore = value; } /// <summary>vmAppValidation</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "vmAppValidation")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"vmAppValidation", SerializedName = @"applicationValidation", PossibleTypes = new [] { typeof(Commvault.Powershell.Models.IVMAppValidation) })] public Commvault.Powershell.Models.IVMAppValidation ApplicationValidation { get => _body.ApplicationValidation ?? null /* object */; set => _body.ApplicationValidation = value; } /// <summary>denotes the activity type being considered</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "denotes the activity type being considered")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"denotes the activity type being considered", SerializedName = @"activityType", PossibleTypes = new [] { typeof(string) })] public string BackupActivityControlOptionActivityType { get => _body.BackupActivityControlOptionActivityType ?? null; set => _body.BackupActivityControlOptionActivityType = value; } /// <summary>True if the activity type is enabled</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "True if the activity type is enabled")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"True if the activity type is enabled", SerializedName = @"enableActivityType", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter BackupActivityControlOptionEnableActivityType { get => _body.BackupActivityControlOptionEnableActivityType ?? default(global::System.Management.Automation.SwitchParameter); set => _body.BackupActivityControlOptionEnableActivityType = value; } /// <summary>True if the activity will be enabled after a delay time interval</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "True if the activity will be enabled after a delay time interval")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"True if the activity will be enabled after a delay time interval", SerializedName = @"enableAfterADelay", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter BackupActivityControlOptionEnableAfterADelay { get => _body.BackupActivityControlOptionEnableAfterADelay ?? default(global::System.Management.Automation.SwitchParameter); set => _body.BackupActivityControlOptionEnableAfterADelay = value; } /// <summary>delay time in unix timestamp</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "delay time in unix timestamp")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"delay time in unix timestamp", SerializedName = @"time", PossibleTypes = new [] { typeof(long) })] public long BackupActivityControlOptionsDelayTime { get => _body.BackupActivityControlOptionsDelayTime ?? default(long); set => _body.BackupActivityControlOptionsDelayTime = value; } /// <summary>actual delay time value in string format according to the timezone</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "actual delay time value in string format according to the timezone")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"actual delay time value in string format according to the timezone", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] public string BackupActivityControlOptionsDelayTimeValue { get => _body.BackupActivityControlOptionsDelayTimeValue ?? null; set => _body.BackupActivityControlOptionsDelayTimeValue = 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 = @"id", PossibleTypes = new [] { typeof(long) })] public long BackupActivityControlOptionsDelayTimeZoneId { get => _body.BackupActivityControlOptionsDelayTimeZoneId ?? default(long); set => _body.BackupActivityControlOptionsDelayTimeZoneId = 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 = @"name", PossibleTypes = new [] { typeof(string) })] public string BackupActivityControlOptionsDelayTimeZoneName { get => _body.BackupActivityControlOptionsDelayTimeZoneName ?? null; set => _body.BackupActivityControlOptionsDelayTimeZoneName = value; } /// <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> /// True if content in vmgroup has to be overwritten, by default it will append the content /// </summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "True if content in vmgroup has to be overwritten, by default it will append the content")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"True if content in vmgroup has to be overwritten, by default it will append the content", SerializedName = @"overwrite", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter ContentOverwrite { get => _body.ContentOverwrite ?? default(global::System.Management.Automation.SwitchParameter); set => _body.ContentOverwrite = value; } /// <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 = @"ruleGroups", PossibleTypes = new [] { typeof(Commvault.Powershell.Models.IRuleGroupContent) })] public Commvault.Powershell.Models.IRuleGroupContent[] ContentRuleGroups { get => _body.ContentRuleGroups?.ToArray() ?? null /* fixedArrayOf */; set => _body.ContentRuleGroups = (value != null ? new System.Collections.Generic.List<Commvault.Powershell.Models.IRuleGroupContent>(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 = @"virtualMachines", PossibleTypes = new [] { typeof(Commvault.Powershell.Models.IVirtualMachinecontent) })] public Commvault.Powershell.Models.IVirtualMachinecontent[] ContentVirtualMachines { get => _body.ContentVirtualMachines?.ToArray() ?? null /* fixedArrayOf */; set => _body.ContentVirtualMachines = (value != null ? new System.Collections.Generic.List<Commvault.Powershell.Models.IVirtualMachinecontent>(value) : null); } /// <summary> /// True if content in vmgroup has to be overwritten, by default it will append the content /// </summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "True if content in vmgroup has to be overwritten, by default it will append the content")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"True if content in vmgroup has to be overwritten, by default it will append the content", SerializedName = @"overwrite", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter DiskFilterOverwrite { get => _body.DiskFilterOverwrite ?? default(global::System.Management.Automation.SwitchParameter); set => _body.DiskFilterOverwrite = value; } /// <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 = @"rules", PossibleTypes = new [] { typeof(Commvault.Powershell.Models.IVMDiskFilter) })] public Commvault.Powershell.Models.IVMDiskFilter[] DiskFilterRules { get => _body.DiskFilterRules?.ToArray() ?? null /* fixedArrayOf */; set => _body.DiskFilterRules = (value != null ? new System.Collections.Generic.List<Commvault.Powershell.Models.IVMDiskFilter>(value) : null); } /// <summary>True if file indexing needs to be enabled</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "True if file indexing needs to be enabled")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"True if file indexing needs to be enabled", SerializedName = @"enableFileIndexing", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter EnableFileIndexing { get => _body.EnableFileIndexing ?? default(global::System.Management.Automation.SwitchParameter); set => _body.EnableFileIndexing = value; } /// <summary>Accessor for extensibleParameters.</summary> public global::System.Collections.Generic.IDictionary<global::System.String,global::System.Object> ExtensibleParameters { get => _extensibleParameters ; } /// <summary> /// True if content in vmgroup has to be overwritten, by default it will append the content /// </summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "True if content in vmgroup has to be overwritten, by default it will append the content")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"True if content in vmgroup has to be overwritten, by default it will append the content", SerializedName = @"overwrite", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter FilterOverwrite { get => _body.FilterOverwrite ?? default(global::System.Management.Automation.SwitchParameter); set => _body.FilterOverwrite = value; } /// <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 = @"ruleGroups", PossibleTypes = new [] { typeof(Commvault.Powershell.Models.IRuleGroupContent) })] public Commvault.Powershell.Models.IRuleGroupContent[] FilterRuleGroups { get => _body.FilterRuleGroups?.ToArray() ?? null /* fixedArrayOf */; set => _body.FilterRuleGroups = (value != null ? new System.Collections.Generic.List<Commvault.Powershell.Models.IRuleGroupContent>(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 = @"virtualMachines", PossibleTypes = new [] { typeof(Commvault.Powershell.Models.IVirtualMachinecontent) })] public Commvault.Powershell.Models.IVirtualMachinecontent[] FilterVirtualMachines { get => _body.FilterVirtualMachines?.ToArray() ?? null /* fixedArrayOf */; set => _body.FilterVirtualMachines = (value != null ? new System.Collections.Generic.List<Commvault.Powershell.Models.IVirtualMachinecontent>(value) : null); } /// <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>Accessor for our copy of the InvocationInfo.</summary> public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } /// <summary>Meditech Listener IP of FQDN name</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Meditech Listener IP of FQDN name")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Meditech Listener IP of FQDN name", SerializedName = @"listenerIP", PossibleTypes = new [] { typeof(string) })] public string MeditechSystemListenerIP { get => _body.MeditechSystemListenerIP ?? null; set => _body.MeditechSystemListenerIP = value; } /// <summary>Meditech Listener Port</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Meditech Listener Port")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Meditech Listener Port", SerializedName = @"listenerPort", PossibleTypes = new [] { typeof(long) })] public long MeditechSystemListenerPort { get => _body.MeditechSystemListenerPort ?? default(long); set => _body.MeditechSystemListenerPort = value; } /// <summary>MBF timeout (in seconds)</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "MBF timeout (in seconds)")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"MBF timeout (in seconds)", SerializedName = @"MBFtimeout", PossibleTypes = new [] { typeof(long) })] public long MeditechSystemMbFtimeout { get => _body.MeditechSystemMbFtimeout ?? default(long); set => _body.MeditechSystemMbFtimeout = value; } /// <summary>Meditech system name</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Meditech system name")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Meditech system name", SerializedName = @"systemName", PossibleTypes = new [] { typeof(string) })] public string MeditechSystemName { get => _body.MeditechSystemName ?? null; set => _body.MeditechSystemName = 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>subclient name</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "subclient name ")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"subclient name ", SerializedName = @"newName", PossibleTypes = new [] { typeof(string) })] public string NewName { get => _body.NewName ?? null; set => _body.NewName = value; } /// <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>.</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 = @"id", PossibleTypes = new [] { typeof(long) })] public long PlanId { get => _body.PlanId ?? default(long); set => _body.PlanId = 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 = @"name", PossibleTypes = new [] { typeof(string) })] public string PlanName { get => _body.PlanName ?? null; set => _body.PlanName = value; } /// <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>denotes the activity type being considered</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "denotes the activity type being considered")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"denotes the activity type being considered", SerializedName = @"activityType", PossibleTypes = new [] { typeof(string) })] public string RestoreActivityControlOptionActivityType { get => _body.RestoreActivityControlOptionActivityType ?? null; set => _body.RestoreActivityControlOptionActivityType = value; } /// <summary>True if the activity type is enabled</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "True if the activity type is enabled")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"True if the activity type is enabled", SerializedName = @"enableActivityType", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter RestoreActivityControlOptionEnableActivityType { get => _body.RestoreActivityControlOptionEnableActivityType ?? default(global::System.Management.Automation.SwitchParameter); set => _body.RestoreActivityControlOptionEnableActivityType = value; } /// <summary>True if the activity will be enabled after a delay time interval</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "True if the activity will be enabled after a delay time interval")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"True if the activity will be enabled after a delay time interval", SerializedName = @"enableAfterADelay", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter RestoreActivityControlOptionEnableAfterADelay { get => _body.RestoreActivityControlOptionEnableAfterADelay ?? default(global::System.Management.Automation.SwitchParameter); set => _body.RestoreActivityControlOptionEnableAfterADelay = value; } /// <summary>delay time in unix timestamp</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "delay time in unix timestamp")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"delay time in unix timestamp", SerializedName = @"time", PossibleTypes = new [] { typeof(long) })] public long RestoreActivityControlOptionsDelayTime { get => _body.RestoreActivityControlOptionsDelayTime ?? default(long); set => _body.RestoreActivityControlOptionsDelayTime = value; } /// <summary>actual delay time value in string format according to the timezone</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "actual delay time value in string format according to the timezone")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"actual delay time value in string format according to the timezone", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] public string RestoreActivityControlOptionsDelayTimeValue { get => _body.RestoreActivityControlOptionsDelayTimeValue ?? null; set => _body.RestoreActivityControlOptionsDelayTimeValue = 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 = @"id", PossibleTypes = new [] { typeof(long) })] public long RestoreActivityControlOptionsDelayTimeZoneId { get => _body.RestoreActivityControlOptionsDelayTimeZoneId ?? default(long); set => _body.RestoreActivityControlOptionsDelayTimeZoneId = 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 = @"name", PossibleTypes = new [] { typeof(string) })] public string RestoreActivityControlOptionsDelayTimeZoneName { get => _body.RestoreActivityControlOptionsDelayTimeZoneName ?? null; set => _body.RestoreActivityControlOptionsDelayTimeZoneName = value; } /// <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 = @"securityAssociations", PossibleTypes = new [] { typeof(Commvault.Powershell.Models.ISecurityAssoc) })] public Commvault.Powershell.Models.ISecurityAssoc[] SecurityAssociations { get => _body.SecurityAssociations?.ToArray() ?? null /* fixedArrayOf */; set => _body.SecurityAssociations = (value != null ? new System.Collections.Generic.List<Commvault.Powershell.Models.ISecurityAssoc>(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 = @"settings", PossibleTypes = new [] { typeof(Commvault.Powershell.Models.IVMGroupSettings) })] public Commvault.Powershell.Models.IVMGroupSettings Settings { get => _body.Settings ?? null /* object */; set => _body.Settings = 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 = @"id", PossibleTypes = new [] { typeof(long) })] public long SnapEngineId { get => _body.SnapEngineId ?? default(long); set => _body.SnapEngineId = 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 = @"name", PossibleTypes = new [] { typeof(string) })] public string SnapEngineName { get => _body.SnapEngineName ?? null; set => _body.SnapEngineName = 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 = @"id", PossibleTypes = new [] { typeof(long) })] public long SnapMountProxyId { get => _body.SnapMountProxyId ?? default(long); set => _body.SnapMountProxyId = 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 = @"name", PossibleTypes = new [] { typeof(string) })] public string SnapMountProxyName { get => _body.SnapMountProxyName ?? null; set => _body.SnapMountProxyName = 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 = @"backupCopyInterface", PossibleTypes = new [] { typeof(string) })] public string SnapshotManagementBackupCopyInterface { get => _body.SnapshotManagementBackupCopyInterface ?? null; set => _body.SnapshotManagementBackupCopyInterface = value; } /// <summary>True if hardware snapshot is enabled</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "True if hardware snapshot is enabled")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"True if hardware snapshot is enabled", SerializedName = @"enableHardwareSnapshot", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter SnapshotManagementEnableHardwareSnapshot { get => _body.SnapshotManagementEnableHardwareSnapshot ?? default(global::System.Management.Automation.SwitchParameter); set => _body.SnapshotManagementEnableHardwareSnapshot = value; } /// <summary>True if independent disk option is enabled</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "True if independent disk option is enabled")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"True if independent disk option is enabled", SerializedName = @"isIndependentDisksEnabled", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter SnapshotManagementIsIndependentDisksEnabled { get => _body.SnapshotManagementIsIndependentDisksEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _body.SnapshotManagementIsIndependentDisksEnabled = value; } /// <summary>True if raw device maps option is enabled</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "True if raw device maps option is enabled")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"True if raw device maps option is enabled", SerializedName = @"isRawDeviceMapsEnabled", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter SnapshotManagementIsRawDeviceMapsEnabled { get => _body.SnapshotManagementIsRawDeviceMapsEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _body.SnapshotManagementIsRawDeviceMapsEnabled = value; } /// <summary>Name of ESX Host</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of ESX Host")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Name of ESX Host", SerializedName = @"snapMountESXHost", PossibleTypes = new [] { typeof(string) })] public string SnapshotManagementSnapMountEsxHost { get => _body.SnapshotManagementSnapMountEsxHost ?? null; set => _body.SnapshotManagementSnapMountEsxHost = value; } /// <summary>True if separate proxy client is used for snap to tape</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "True if separate proxy client is used for snap to tape")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"True if separate proxy client is used for snap to tape", SerializedName = @"useSeparateProxyForSnapToTape", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter SnapshotManagementUseSeparateProxyForSnapToTape { get => _body.SnapshotManagementUseSeparateProxyForSnapToTape ?? default(global::System.Management.Automation.SwitchParameter); set => _body.SnapshotManagementUseSeparateProxyForSnapToTape = value; } /// <summary>Virtual machine application user name</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Virtual machine application user name")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Virtual machine application user name", SerializedName = @"vmApplicationUserName", PossibleTypes = new [] { typeof(string) })] public string SnapshotManagementVMApplicationUserName { get => _body.SnapshotManagementVMApplicationUserName ?? null; set => _body.SnapshotManagementVMApplicationUserName = 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 = @"id", PossibleTypes = new [] { typeof(long) })] public long StorageId { get => _body.StorageId ?? default(long); set => _body.StorageId = 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 = @"name", PossibleTypes = new [] { typeof(string) })] public string StorageName { get => _body.StorageName ?? null; set => _body.StorageName = 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 = @"id", PossibleTypes = new [] { typeof(long) })] public long TimeZoneId { get => _body.TimeZoneId ?? default(long); set => _body.TimeZoneId = 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 = @"name", PossibleTypes = new [] { typeof(string) })] public string TimeZoneName { get => _body.TimeZoneName ?? null; set => _body.TimeZoneName = value; } /// <summary>username to access the network path</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "username to access the network path")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"username to access the network path", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] public string UserAccountName { get => _body.UserAccountName ?? null; set => _body.UserAccountName = value; } /// <summary>password to access the network path</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "password to access the network path")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"password to access the network path", SerializedName = @"password", PossibleTypes = new [] { typeof(string) })] public string UserAccountPassword { get => _body.UserAccountPassword ?? null; set => _body.UserAccountPassword = value; } /// <summary>Backing field for <see cref="VMGroupId" /> property.</summary> private long _vMGroupId; /// <summary>Id of the VMgroup to update</summary> [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Id of the VMgroup to update")] [Commvault.Powershell.Runtime.Info( Required = true, ReadOnly = false, Description = @"Id of the VMgroup to update", SerializedName = @"VmGroupId", PossibleTypes = new [] { typeof(long) })] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Path)] public long VMGroupId { get => this._vMGroupId; set => this._vMGroupId = 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>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>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.IGenericRespWithWarning">Commvault.Powershell.Models.IGenericRespWithWarning</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.IGenericRespWithWarning> 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 'UpdateVMGroup' 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; } await this.Client.UpdateVMGroup(VMGroupId, _body, onOk, onBadRequest, 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 { VMGroupId=VMGroupId}) { 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="SetCVVMGroup_UpdateExpanded" /> cmdlet class. /// </summary> public SetCVVMGroup_UpdateExpanded() { } /// <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 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 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.IGenericRespWithWarning">Commvault.Powershell.Models.IGenericRespWithWarning</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.IGenericRespWithWarning> 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.IGenericRespWithWarning 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; } } } } } } |