generated/cmdlets/InvokeCVModifyFailoverGroupSchedule_ModifyViaIdentityExpanded.cs
// Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.9.4, generator: @autorest/powershell@3.0.415) // Changes may cause incorrect behavior and will be lost if the code is regenerated. namespace Commvault.Powershell.Cmdlets { using static Commvault.Powershell.Runtime.Extensions; /// <summary>API to create failover group DR operation schedule</summary> /// <remarks> /// [OpenAPI] ModifyFailoverGroupSchedule=>PUT:"/V4/FailoverGroups/{failoverGroupId}/Schedules/{scheduleId}" /// </remarks> [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"CVModifyFailoverGroupSchedule_ModifyViaIdentityExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(Commvault.Powershell.Models.IGenericResp))] [global::Commvault.Powershell.Description(@"API to create failover group DR operation schedule")] [global::Commvault.Powershell.Generated] public partial class InvokeCVModifyFailoverGroupSchedule_ModifyViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, Commvault.Powershell.Runtime.IEventListener { /// <summary>A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet)</summary> private global::System.Management.Automation.InvocationInfo __invocationInfo; /// <summary> /// The <see cref="global::System.Threading.CancellationTokenSource" /> for this operation. /// </summary> private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// <summary>Schedule Backup level</summary> [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Schedule Backup level")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = true, ReadOnly = false, Description = @"Schedule Backup level", SerializedName = @"backupType", PossibleTypes = new [] { typeof(string) })] public string BackupType { get => Body.BackupType ?? null; set => Body.BackupType = value; } /// <summary>Backing field for <see cref="Body" /> property.</summary> private Commvault.Powershell.Models.IPlanSchedule _body= new Commvault.Powershell.Models.PlanSchedule(); /// <summary>Used to describe single plan schedule information</summary> private Commvault.Powershell.Models.IPlanSchedule Body { get => this._body; set => this._body = 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>The reference to the client API class.</summary> public Commvault.Powershell.CommvaultPowerShell Client => Commvault.Powershell.Module.Instance.ClientAPI; /// <summary>Boolean to indicate if schedule is for database agents</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Boolean to indicate if schedule is for database agents")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Boolean to indicate if schedule is for database agents", SerializedName = @"forDatabasesOnly", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter ForDatabasesOnly { get => Body.ForDatabasesOnly ?? default(global::System.Management.Automation.SwitchParameter); set => Body.ForDatabasesOnly = 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="IEventListener" /> cancellation delegate. Stops the cmdlet when called. /// </summary> global::System.Action Commvault.Powershell.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; /// <summary><see cref="IEventListener" /> cancellation token.</summary> global::System.Threading.CancellationToken Commvault.Powershell.Runtime.IEventListener.Token => _cancellationTokenSource.Token; /// <summary> /// The instance of the <see cref="Commvault.Powershell.Runtime.HttpPipeline" /> that the remote call will use. /// </summary> private Commvault.Powershell.Runtime.HttpPipeline Pipeline { get; set; } /// <summary>Schedule policy Id to which the schedule belongs</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Schedule policy Id to which the schedule belongs")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Schedule policy Id to which the schedule belongs", SerializedName = @"policyId", PossibleTypes = new [] { typeof(long) })] public long PolicyId { get => Body.PolicyId ?? default(long); set => Body.PolicyId = 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>Id of the schedule if available, required for modifying, deleting schedule</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Id of the schedule if available, required for modifying, deleting schedule")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Id of the schedule if available, required for modifying, deleting schedule", SerializedName = @"scheduleId", PossibleTypes = new [] { typeof(long) })] public long ScheduleId { get => Body.ScheduleId ?? default(long); set => Body.ScheduleId = value; } /// <summary>Name of the schedule, for modify</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Name of the schedule, for modify")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Name of the schedule, for modify", SerializedName = @"scheduleName", PossibleTypes = new [] { typeof(string) })] public string ScheduleName { get => Body.ScheduleName ?? null; set => Body.ScheduleName = value; } /// <summary>Operation being performed on schedule</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Operation being performed on schedule")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Operation being performed on schedule", SerializedName = @"scheduleOperation", PossibleTypes = new [] { typeof(string) })] public string ScheduleOperation { get => Body.ScheduleOperation ?? null; set => Body.ScheduleOperation = value; } /// <summary>Commit frequency in hours for disk cache backups from automatic schedules</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Commit frequency in hours for disk cache backups from automatic schedules")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Commit frequency in hours for disk cache backups from automatic schedules", SerializedName = @"commitFrequencyInHours", PossibleTypes = new [] { typeof(long) })] public long ScheduleOptionCommitFrequencyInHours { get => Body.ScheduleOptionCommitFrequencyInHours ?? default(long); set => Body.ScheduleOptionCommitFrequencyInHours = value; } /// <summary> /// Number of days between auto conversion of backup level applicable for databases on incremental and differential schedules /// of server plan /// </summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Number of days between auto conversion of backup level applicable for databases on incremental and differential schedules of server plan")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Number of days between auto conversion of backup level applicable for databases on incremental and differential schedules of server plan", SerializedName = @"daysBetweenAutoConvert", PossibleTypes = new [] { typeof(long) })] public long ScheduleOptionDaysBetweenAutoConvert { get => Body.ScheduleOptionDaysBetweenAutoConvert ?? default(long); set => Body.ScheduleOptionDaysBetweenAutoConvert = value; } /// <summary>total job running time in minutes</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "total job running time in minutes")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"total job running time in minutes", SerializedName = @"jobRunningTimeInMins", PossibleTypes = new [] { typeof(long) })] public long ScheduleOptionJobRunningTimeInMins { get => Body.ScheduleOptionJobRunningTimeInMins ?? default(long); set => Body.ScheduleOptionJobRunningTimeInMins = value; } /// <summary>item backup option for O365 V2 backup jobs</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "item backup option for O365 V2 backup jobs")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"item backup option for O365 V2 backup jobs", SerializedName = @"o365ItemSelectionOption", PossibleTypes = new [] { typeof(string) })] public string ScheduleOptionO365ItemSelectionOption { get => Body.ScheduleOptionO365ItemSelectionOption ?? null; set => Body.ScheduleOptionO365ItemSelectionOption = value; } /// <summary> /// Used to enable disk caching feature on databases for automatic schedules on server plan /// </summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Used to enable disk caching feature on databases for automatic schedules on server plan")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Used to enable disk caching feature on databases for automatic schedules on server plan", SerializedName = @"useDiskCacheForLogBackups", PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter ScheduleOptionUseDiskCacheForLogBackups { get => Body.ScheduleOptionUseDiskCacheForLogBackups ?? default(global::System.Management.Automation.SwitchParameter); set => Body.ScheduleOptionUseDiskCacheForLogBackups = value; } /// <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 SchedulePatternDayOfMonth { get => Body.SchedulePatternDayOfMonth ?? default(long); set => Body.SchedulePatternDayOfMonth = 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 SchedulePatternDayOfWeek { get => Body.SchedulePatternDayOfWeek ?? null; set => Body.SchedulePatternDayOfWeek = value; } /// <summary>No of days between two synthetic full jobs</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "No of days between two synthetic full jobs")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"No of days between two synthetic full jobs", SerializedName = @"daysBetweenSyntheticFulls", PossibleTypes = new [] { typeof(long) })] public long SchedulePatternDaysBetweenSyntheticFulls { get => Body.SchedulePatternDaysBetweenSyntheticFulls ?? default(long); set => Body.SchedulePatternDaysBetweenSyntheticFulls = value; } /// <summary>Schedule end date in epoch format</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Schedule end date in epoch format")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Schedule end date in epoch format", SerializedName = @"endDate", PossibleTypes = new [] { typeof(long) })] public long SchedulePatternEndDate { get => Body.SchedulePatternEndDate ?? default(long); set => Body.SchedulePatternEndDate = value; } /// <summary> /// Exceptions to when a schedule should not run, either in dates or week of month and days /// </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 days")] [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 days", SerializedName = @"exceptions", PossibleTypes = new [] { typeof(Commvault.Powershell.Models.IScheduleRunException) })] public Commvault.Powershell.Models.IScheduleRunException[] SchedulePatternExceptions { get => Body.SchedulePatternExceptions ?? null /* arrayOf */; set => Body.SchedulePatternExceptions = value; } /// <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 SchedulePatternFrequency { get => Body.SchedulePatternFrequency ?? default(long); set => Body.SchedulePatternFrequency = value; } /// <summary>The number of mins to force a backup on automatic schedule.</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The number of mins to force a backup on automatic schedule.")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"The number of mins to force a backup on automatic schedule.", SerializedName = @"maxBackupIntervalInMins", PossibleTypes = new [] { typeof(long) })] public long SchedulePatternMaxBackupIntervalInMins { get => Body.SchedulePatternMaxBackupIntervalInMins ?? default(long); set => Body.SchedulePatternMaxBackupIntervalInMins = 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 SchedulePatternMonthOfYear { get => Body.SchedulePatternMonthOfYear ?? null; set => Body.SchedulePatternMonthOfYear = value; } /// <summary>The number of times you want the schedule to run.</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The number of times you want the schedule to run.")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"The number of times you want the schedule to run.", SerializedName = @"noOfTimes", PossibleTypes = new [] { typeof(long) })] public long SchedulePatternNoOfTimes { get => Body.SchedulePatternNoOfTimes ?? default(long); set => Body.SchedulePatternNoOfTimes = value; } /// <summary> /// How often in minutes in a day the schedule runs, applicable for daily, weekly, monthly and yearly frequency types. /// </summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "How often in minutes in a day the schedule runs, applicable for daily, weekly, monthly and yearly frequency types.")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"How often in minutes in a day the schedule runs, applicable for daily, weekly, monthly and yearly frequency types.", SerializedName = @"repeatIntervalInMinutes", PossibleTypes = new [] { typeof(long) })] public long SchedulePatternRepeatIntervalInMinutes { get => Body.SchedulePatternRepeatIntervalInMinutes ?? default(long); set => Body.SchedulePatternRepeatIntervalInMinutes = value; } /// <summary> /// Until what time to repeat the schedule in a day, requires repeatIntervalInMinutes /// </summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Until what time to repeat the schedule in a day, requires repeatIntervalInMinutes")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Until what time to repeat the schedule in a day, requires repeatIntervalInMinutes", SerializedName = @"repeatUntilTime", PossibleTypes = new [] { typeof(long) })] public long SchedulePatternRepeatUntilTime { get => Body.SchedulePatternRepeatUntilTime ?? default(long); set => Body.SchedulePatternRepeatUntilTime = value; } /// <summary>schedule frequency type</summary> [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "schedule frequency type")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = true, ReadOnly = false, Description = @"schedule frequency type", SerializedName = @"scheduleFrequencyType", PossibleTypes = new [] { typeof(string) })] public string SchedulePatternScheduleFrequencyType { get => Body.SchedulePatternScheduleFrequencyType ?? null; set => Body.SchedulePatternScheduleFrequencyType = 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 SchedulePatternStartDate { get => Body.SchedulePatternStartDate ?? default(long); set => Body.SchedulePatternStartDate = value; } /// <summary>start time of schedule in seconds</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "start time of schedule in seconds")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"start time of schedule in seconds", SerializedName = @"startTime", PossibleTypes = new [] { typeof(long) })] public long SchedulePatternStartTime { get => Body.SchedulePatternStartTime ?? default(long); set => Body.SchedulePatternStartTime = 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 SchedulePatternWeekOfMonth { get => Body.SchedulePatternWeekOfMonth ?? null; set => Body.SchedulePatternWeekOfMonth = 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[] SchedulePatternWeeklyDays { get => Body.SchedulePatternWeeklyDays ?? null /* arrayOf */; set => Body.SchedulePatternWeeklyDays = 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>Type of DR operation (only applicable for Failover groups)</summary> [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Type of DR operation (only applicable for Failover groups)")] [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)] [Commvault.Powershell.Runtime.Info( Required = false, ReadOnly = false, Description = @"Type of DR operation (only applicable for Failover groups)", SerializedName = @"vmOperationType", PossibleTypes = new [] { typeof(string) })] public string VMOperationType { get => Body.VMOperationType ?? null; set => Body.VMOperationType = 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" /> 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>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" /> 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> /// <c>overrideOnServiceUnavailable</c> will be called before the regular onServiceUnavailable 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" /> from the remote call</param> /// <param name="returnNow">/// Determines if the rest of the onServiceUnavailable method should be processed, or if the method /// should return immediately (set to true to skip further processing )</param> partial void overrideOnServiceUnavailable(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() { ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletEndProcessing).Wait(); if( ((Commvault.Powershell.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } /// <summary> /// Intializes a new instance of the <see cref="InvokeCVModifyFailoverGroupSchedule_ModifyViaIdentityExpanded" /> cmdlet class. /// </summary> public InvokeCVModifyFailoverGroupSchedule_ModifyViaIdentityExpanded() { } /// <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, new[] { data.Message }); 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 ; } } 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 'ModifyFailoverGroupSchedule' 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); 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.FailoverGroupId) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FailoverGroupId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } if (null == InputObject.ScheduleId) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ScheduleId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } await this.Client.ModifyFailoverGroupSchedule(InputObject.FailoverGroupId ?? default(long), InputObject.ScheduleId ?? default(long), Body, onOk, onBadRequest, onServiceUnavailable, this, Pipeline); 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 { body=Body}) { 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>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" /> 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 WriteObject((await response)); } } /// <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" /> 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 WriteObject((await response)); } } /// <summary> /// a delegate that is called when the remote service returns 503 (ServiceUnavailable). /// </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" /> 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 onServiceUnavailable(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); overrideOnServiceUnavailable(responseMessage, response, ref _returnNow); // if overrideOnServiceUnavailable has returned true, then return right away. if ((null != _returnNow && await _returnNow)) { return ; } // onServiceUnavailable - response for 503 / application/json // (await response) // should be Commvault.Powershell.Models.IGenericResp WriteObject((await response)); } } } } |