generated/cmdlets/SetCVDrBackupDestinationDetail_UpdateViaIdentityExpanded.cs

// Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.10.2, generator: @autorest/powershell@4.0.708)
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

namespace Commvault.Powershell.Cmdlets
{
    using static Commvault.Powershell.Runtime.Extensions;
    using Commvault.Powershell.Runtime.PowerShell;
    using Commvault.Powershell.Runtime.Cmdlets;
    using System;

    /// <summary>Modify Backup Destination details for CommServe DR backups</summary>
    /// <remarks>
    /// [OpenAPI] UpdateDRBackupDestinationDetails=>PUT:"/V4/DRBackup/BackupDestination/{BackupDestinationId}"
    /// </remarks>
    [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Set, @"CVDrBackupDestinationDetail_UpdateViaIdentityExpanded", SupportsShouldProcess = true)]
    [global::System.Management.Automation.OutputType(typeof(Commvault.Powershell.Models.IPlanBackupDestinationResp), typeof(Commvault.Powershell.Models.IGenericResp))]
    [global::Commvault.Powershell.Description(@"Modify Backup Destination details for CommServe DR backups")]
    [global::Commvault.Powershell.Generated]
    [global::Commvault.Powershell.HttpPath(Path = "/V4/DRBackup/BackupDestination/{BackupDestinationId}", ApiVersion = "LATEST")]
    public partial class SetCVDrBackupDestinationDetail_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet,
        Commvault.Powershell.Runtime.IEventListener,
        Commvault.Powershell.Runtime.IContext
    {
        /// <summary>A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet)</summary>
        private global::System.Management.Automation.InvocationInfo __invocationInfo;

        private Commvault.Powershell.Models.IUpdatePlanBackupDestinationDetails _body = new Commvault.Powershell.Models.UpdatePlanBackupDestinationDetails();

        /// <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>
        /// Tells what start date, backup types should be copied from. The date is provided in unix time format in number of seconds.
        /// -1 means initial backup date.
        /// </summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tells what start date, backup types should be copied from. The date is provided in unix time format in number of seconds. -1 means initial backup date.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Tells what start date, backup types should be copied from. The date is provided in unix time format in number of seconds. -1 means initial backup date.",
        SerializedName = @"backupTypesCopiedFrom",
        PossibleTypes = new [] { typeof(long) })]
        public long BackupTypeBackupTypesCopiedFrom { get => _body.BackupTypeBackupTypesCopiedFrom ?? default(long); set => _body.BackupTypeBackupTypesCopiedFrom = value; }

        /// <summary>
        /// All_JOBS means SYNCHRONOUS copy type, others are applicable for SELECTIVE copy Type only.
        /// </summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "All_JOBS means SYNCHRONOUS copy type, others are applicable for SELECTIVE copy Type only.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"All_JOBS means SYNCHRONOUS copy type, others are applicable for SELECTIVE copy Type only.",
        SerializedName = @"backupTypesToCopy",
        PossibleTypes = new [] { typeof(string) })]
        public string BackupTypeBackupTypesToCopy { get => _body.BackupTypeBackupTypesToCopy ?? null; set => _body.BackupTypeBackupTypesToCopy = value; }

        /// <summary>
        /// Which type of backup type should be copied for the given backup destination when backup type is not all jobs. Default
        /// is LAST while adding new backup destination.
        /// </summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Which type of backup type should be copied for the given backup destination when backup type is not all jobs. Default is LAST while adding new backup destination.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Which type of backup type should be copied for the given backup destination when backup type is not all jobs. Default is LAST while adding new backup destination.",
        SerializedName = @"fullBackupTypesToCopy",
        PossibleTypes = new [] { typeof(string) })]
        public string BackupTypeFullBackupTypesToCopy { get => _body.BackupTypeFullBackupTypesToCopy ?? null; set => _body.BackupTypeFullBackupTypesToCopy = 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>Tells if we need to force kill jobs and promote copy after waiting.</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tells if we need to force kill jobs and promote copy after waiting.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Tells if we need to force kill jobs and promote copy after waiting.",
        SerializedName = @"forceKill",
        PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })]
        public global::System.Management.Automation.SwitchParameter CopyPromotionOptionForceKill { get => _body.CopyPromotionOptionForceKill ?? default(global::System.Management.Automation.SwitchParameter); set => _body.CopyPromotionOptionForceKill = value; }

        /// <summary>
        /// Tells the number of hours to wait before failing/killing jobs for copy promotion
        /// </summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tells the number of hours to wait before failing/killing jobs for copy promotion")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Tells the number of hours to wait before failing/killing jobs for copy promotion",
        SerializedName = @"hours",
        PossibleTypes = new [] { typeof(long) })]
        public long CopyPromotionOptionHours { get => _body.CopyPromotionOptionHours ?? default(long); set => _body.CopyPromotionOptionHours = value; }

        /// <summary>Tells if the copy has to be promoted immediately.</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tells if the copy has to be promoted immediately.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Tells if the copy has to be promoted immediately.",
        SerializedName = @"immediate",
        PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })]
        public global::System.Management.Automation.SwitchParameter CopyPromotionOptionImmediate { get => _body.CopyPromotionOptionImmediate ?? default(global::System.Management.Automation.SwitchParameter); set => _body.CopyPromotionOptionImmediate = value; }

        /// <summary>Tells if copy promotion needs to wait for running jobs</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tells if copy promotion needs to wait for running jobs")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Tells if copy promotion needs to wait for running jobs",
        SerializedName = @"waitForRunningJobs",
        PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })]
        public global::System.Management.Automation.SwitchParameter CopyPromotionOptionWaitForRunningJobs { get => _body.CopyPromotionOptionWaitForRunningJobs ?? default(global::System.Management.Automation.SwitchParameter); set => _body.CopyPromotionOptionWaitForRunningJobs = value; }

        /// <summary>Tells if copy promotion needs to wait for synchronization of copies.</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tells if copy promotion needs to wait for synchronization of copies.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Tells if copy promotion needs to wait for synchronization of copies.",
        SerializedName = @"waitForSynchronize",
        PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })]
        public global::System.Management.Automation.SwitchParameter CopyPromotionOptionWaitForSynchronize { get => _body.CopyPromotionOptionWaitForSynchronize ?? default(global::System.Management.Automation.SwitchParameter); set => _body.CopyPromotionOptionWaitForSynchronize = value; }

        /// <summary>Accessor for extensibleParameters.</summary>
        public global::System.Collections.Generic.IDictionary<global::System.String,global::System.Object> ExtensibleParameters { get => _extensibleParameters ; }

        /// <summary>If this is set as true, no need to specify retentionPeriodDays.</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If this is set as true, no need to specify retentionPeriodDays.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"If this is set as true, no need to specify retentionPeriodDays.",
        SerializedName = @"isInfiniteRetention",
        PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })]
        public global::System.Management.Automation.SwitchParameter FirstExtendedRetentionRuleIsInfiniteRetention { get => _body.FirstExtendedRetentionRuleIsInfiniteRetention ?? default(global::System.Management.Automation.SwitchParameter); set => _body.FirstExtendedRetentionRuleIsInfiniteRetention = value; }

        /// <summary>If this is set, no need to specify isInfiniteRetention as false.</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If this is set, no need to specify isInfiniteRetention as false.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"If this is set, no need to specify isInfiniteRetention as false.",
        SerializedName = @"retentionPeriodDays",
        PossibleTypes = new [] { typeof(long) })]
        public long FirstExtendedRetentionRuleRetentionPeriodDays { get => _body.FirstExtendedRetentionRuleRetentionPeriodDays ?? default(long); set => _body.FirstExtendedRetentionRuleRetentionPeriodDays = value; }

        /// <summary>
        /// All_JOBS means SYNCHRONOUS copy type, others are applicable for SELECTIVE copy Type only.
        /// </summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "All_JOBS means SYNCHRONOUS copy type, others are applicable for SELECTIVE copy Type only.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"All_JOBS means SYNCHRONOUS copy type, others are applicable for SELECTIVE copy Type only.",
        SerializedName = @"type",
        PossibleTypes = new [] { typeof(string) })]
        public string FirstExtendedRetentionRuleType { get => _body.FirstExtendedRetentionRuleType ?? null; set => _body.FirstExtendedRetentionRuleType = value; }

        /// <summary>
        /// Toggle to enable compliance lock on backup destination. One time operation, once enabled cannot be disabled and if it
        /// is enabled retention on backup destination cannot be lowered.
        /// </summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Toggle to enable compliance lock on backup destination. One time operation, once enabled cannot be disabled and if it is enabled retention on backup destination cannot be lowered.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Toggle to enable compliance lock on backup destination. One time operation, once enabled cannot be disabled and if it is enabled retention on backup destination cannot be lowered.",
        SerializedName = @"complianceLock",
        PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })]
        public global::System.Management.Automation.SwitchParameter GeneralComplianceLock { get => _body.GeneralComplianceLock ?? default(global::System.Management.Automation.SwitchParameter); set => _body.GeneralComplianceLock = value; }

        /// <summary>Toggle to keep backup destination active</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Toggle to keep backup destination active")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Toggle to keep backup destination active",
        SerializedName = @"isActive",
        PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })]
        public global::System.Management.Automation.SwitchParameter GeneralIsActive { get => _body.GeneralIsActive ?? default(global::System.Management.Automation.SwitchParameter); set => _body.GeneralIsActive = value; }

        /// <summary>Toggle to enable immutable snap for snap copy</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Toggle to enable immutable snap for snap copy")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Toggle to enable immutable snap for snap copy",
        SerializedName = @"isImmutableSnapCopy",
        PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })]
        public global::System.Management.Automation.SwitchParameter GeneralIsImmutableSnapCopy { get => _body.GeneralIsImmutableSnapCopy ?? default(global::System.Management.Automation.SwitchParameter); set => _body.GeneralIsImmutableSnapCopy = 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>.</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 = @"mappings",
        PossibleTypes = new [] { typeof(Commvault.Powershell.Models.ISnapshotCopyMapping) })]
        public Commvault.Powershell.Models.ISnapshotCopyMapping[] Mappings { get => _body.Mappings?.ToArray() ?? null /* fixedArrayOf */; set => _body.Mappings = (value != null ? new System.Collections.Generic.List<Commvault.Powershell.Models.ISnapshotCopyMapping>(value) : null); }

        /// <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>New name for backup destination</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "New name for backup destination")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"New name for backup destination",
        SerializedName = @"newName",
        PossibleTypes = new [] { typeof(string) })]
        public string NewName { get => _body.NewName ?? null; set => _body.NewName = value; }

        /// <summary>
        /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default.
        /// </summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Runtime)]
        public global::System.Management.Automation.SwitchParameter PassThru { get; set; }

        /// <summary>
        /// The instance of the <see cref="Commvault.Powershell.Runtime.HttpPipeline" /> that the remote call will use.
        /// </summary>
        public Commvault.Powershell.Runtime.HttpPipeline Pipeline { get; set; }

        /// <summary>The URI for the proxy server to use</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Runtime)]
        public global::System.Uri Proxy { get; set; }

        /// <summary>Credentials for a proxy server to use for the remote call</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")]
        [global::System.Management.Automation.ValidateNotNull]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Runtime)]
        public global::System.Management.Automation.PSCredential ProxyCredential { get; set; }

        /// <summary>Use the default credentials for the proxy</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Runtime)]
        public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; }

        /// <summary>Tells if this copy has data aging enabled</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tells if this copy has data aging enabled")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Tells if this copy has data aging enabled",
        SerializedName = @"enableDataAging",
        PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })]
        public global::System.Management.Automation.SwitchParameter RetentionRuleEnableDataAging { get => _body.RetentionRuleEnableDataAging ?? default(global::System.Management.Automation.SwitchParameter); set => _body.RetentionRuleEnableDataAging = value; }

        /// <summary>
        /// Which type of backup type should be copied for the given backup destination when backup type is not all jobs. Default
        /// is LAST while adding new backup destination.
        /// </summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Which type of backup type should be copied for the given backup destination when backup type is not all jobs. Default is LAST while adding new backup destination.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Which type of backup type should be copied for the given backup destination when backup type is not all jobs. Default is LAST while adding new backup destination.",
        SerializedName = @"fullBackupTypesToBeRetained",
        PossibleTypes = new [] { typeof(string) })]
        public string RetentionRuleFullBackupTypesToBeRetained { get => _body.RetentionRuleFullBackupTypesToBeRetained ?? null; set => _body.RetentionRuleFullBackupTypesToBeRetained = value; }

        /// <summary>
        /// Tells if this copy should use storage pool retention period days or the retention defined for this copy. Set as true to
        /// use retention defined on this copy.
        /// </summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Tells if this copy should use storage pool retention period days or the retention defined for this copy. Set as true to use retention defined on this copy.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Tells if this copy should use storage pool retention period days or the retention defined for this copy. Set as true to use retention defined on this copy.",
        SerializedName = @"overrideRetentionSettings",
        PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })]
        public global::System.Management.Automation.SwitchParameter RetentionRuleOverrideRetentionSettings { get => _body.RetentionRuleOverrideRetentionSettings ?? default(global::System.Management.Automation.SwitchParameter); set => _body.RetentionRuleOverrideRetentionSettings = value; }

        /// <summary>Retention period in days</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Retention period in days")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Retention period in days",
        SerializedName = @"retentionPeriodDays",
        PossibleTypes = new [] { typeof(long) })]
        public long RetentionRuleRetentionPeriodDays { get => _body.RetentionRuleRetentionPeriodDays ?? default(long); set => _body.RetentionRuleRetentionPeriodDays = value; }

        /// <summary>Number of snap recovery points for snap copy for retention</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Number of snap recovery points for snap copy for retention")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Number of snap recovery points for snap copy for retention",
        SerializedName = @"snapRecoveryPoints",
        PossibleTypes = new [] { typeof(long) })]
        public long RetentionRuleSnapRecoveryPoints { get => _body.RetentionRuleSnapRecoveryPoints ?? default(long); set => _body.RetentionRuleSnapRecoveryPoints = value; }

        /// <summary>Which type of retention rule should be used for the given backup destination</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Which type of retention rule should be used for the given backup destination")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Which type of retention rule should be used for the given backup destination",
        SerializedName = @"retentionRuleType",
        PossibleTypes = new [] { typeof(string) })]
        public string RetentionRuleType { get => _body.RetentionRuleType ?? null; set => _body.RetentionRuleType = value; }

        /// <summary>Should extended retention rules be used</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Should extended retention rules be used")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Should extended retention rules be used",
        SerializedName = @"useExtendedRetentionRules",
        PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })]
        public global::System.Management.Automation.SwitchParameter RetentionRuleUseExtendedRetentionRules { get => _body.RetentionRuleUseExtendedRetentionRules ?? default(global::System.Management.Automation.SwitchParameter); set => _body.RetentionRuleUseExtendedRetentionRules = value; }

        /// <summary>If this is set as true, no need to specify retentionPeriodDays.</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If this is set as true, no need to specify retentionPeriodDays.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"If this is set as true, no need to specify retentionPeriodDays.",
        SerializedName = @"isInfiniteRetention",
        PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })]
        public global::System.Management.Automation.SwitchParameter SecondExtendedRetentionRuleIsInfiniteRetention { get => _body.SecondExtendedRetentionRuleIsInfiniteRetention ?? default(global::System.Management.Automation.SwitchParameter); set => _body.SecondExtendedRetentionRuleIsInfiniteRetention = value; }

        /// <summary>If this is set, no need to specify isInfiniteRetention as false.</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If this is set, no need to specify isInfiniteRetention as false.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"If this is set, no need to specify isInfiniteRetention as false.",
        SerializedName = @"retentionPeriodDays",
        PossibleTypes = new [] { typeof(long) })]
        public long SecondExtendedRetentionRuleRetentionPeriodDays { get => _body.SecondExtendedRetentionRuleRetentionPeriodDays ?? default(long); set => _body.SecondExtendedRetentionRuleRetentionPeriodDays = value; }

        /// <summary>
        /// All_JOBS means SYNCHRONOUS copy type, others are applicable for SELECTIVE copy Type only.
        /// </summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "All_JOBS means SYNCHRONOUS copy type, others are applicable for SELECTIVE copy Type only.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"All_JOBS means SYNCHRONOUS copy type, others are applicable for SELECTIVE copy Type only.",
        SerializedName = @"type",
        PossibleTypes = new [] { typeof(string) })]
        public string SecondExtendedRetentionRuleType { get => _body.SecondExtendedRetentionRuleType ?? null; set => _body.SecondExtendedRetentionRuleType = value; }

        /// <summary>Is this the source snap copy for backup copy operations</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Is this the source snap copy for backup copy operations")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"Is this the source snap copy for backup copy operations",
        SerializedName = @"isSourceBackupCopy",
        PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })]
        public global::System.Management.Automation.SwitchParameter SnapOptionIsSourceBackupCopy { get => _body.SnapOptionIsSourceBackupCopy ?? default(global::System.Management.Automation.SwitchParameter); set => _body.SnapOptionIsSourceBackupCopy = 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 SourceId { get => _body.SourceId ?? default(long); set => _body.SourceId = 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 SourceName { get => _body.SourceName ?? null; set => _body.SourceName = value; }

        /// <summary>If this is set as true, no need to specify retentionPeriodDays.</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If this is set as true, no need to specify retentionPeriodDays.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"If this is set as true, no need to specify retentionPeriodDays.",
        SerializedName = @"isInfiniteRetention",
        PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })]
        public global::System.Management.Automation.SwitchParameter ThirdExtendedRetentionRuleIsInfiniteRetention { get => _body.ThirdExtendedRetentionRuleIsInfiniteRetention ?? default(global::System.Management.Automation.SwitchParameter); set => _body.ThirdExtendedRetentionRuleIsInfiniteRetention = value; }

        /// <summary>If this is set, no need to specify isInfiniteRetention as false.</summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "If this is set, no need to specify isInfiniteRetention as false.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"If this is set, no need to specify isInfiniteRetention as false.",
        SerializedName = @"retentionPeriodDays",
        PossibleTypes = new [] { typeof(long) })]
        public long ThirdExtendedRetentionRuleRetentionPeriodDays { get => _body.ThirdExtendedRetentionRuleRetentionPeriodDays ?? default(long); set => _body.ThirdExtendedRetentionRuleRetentionPeriodDays = value; }

        /// <summary>
        /// All_JOBS means SYNCHRONOUS copy type, others are applicable for SELECTIVE copy Type only.
        /// </summary>
        [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "All_JOBS means SYNCHRONOUS copy type, others are applicable for SELECTIVE copy Type only.")]
        [global::Commvault.Powershell.Category(global::Commvault.Powershell.ParameterCategory.Body)]
        [Commvault.Powershell.Runtime.Info(
        Required = false,
        ReadOnly = false,
        Description = @"All_JOBS means SYNCHRONOUS copy type, others are applicable for SELECTIVE copy Type only.",
        SerializedName = @"type",
        PossibleTypes = new [] { typeof(string) })]
        public string ThirdExtendedRetentionRuleType { get => _body.ThirdExtendedRetentionRuleType ?? null; set => _body.ThirdExtendedRetentionRuleType = value; }

        /// <summary>
        /// <c>overrideOnInternalServerError</c> will be called before the regular onInternalServerError has been processed, allowing
        /// customization of what happens on that response. Implement this method in a partial class to enable this behavior
        /// </summary>
        /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
        /// <param name="response">the body result as a <see cref="Commvault.Powershell.Models.IGenericResp">Commvault.Powershell.Models.IGenericResp</see>
        /// from the remote call</param>
        /// <param name="returnNow">/// Determines if the rest of the onInternalServerError method should be processed, or if the
        /// method should return immediately (set to true to skip further processing )</param>

        partial void overrideOnInternalServerError(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Commvault.Powershell.Models.IGenericResp> response, ref global::System.Threading.Tasks.Task<bool> returnNow);

        /// <summary>
        /// <c>overrideOnNotFound</c> will be called before the regular onNotFound has been processed, allowing customization of what
        /// happens on that response. Implement this method in a partial class to enable this behavior
        /// </summary>
        /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
        /// <param name="returnNow">/// Determines if the rest of the onNotFound method should be processed, or if the method should
        /// return immediately (set to true to skip further processing )</param>

        partial void overrideOnNotFound(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task<bool> returnNow);

        /// <summary>
        /// <c>overrideOnOk</c> will be called before the regular onOk has been processed, allowing customization of what happens
        /// on that response. Implement this method in a partial class to enable this behavior
        /// </summary>
        /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
        /// <param name="response">the body result as a <see cref="Commvault.Powershell.Models.IPlanBackupDestinationResp">Commvault.Powershell.Models.IPlanBackupDestinationResp</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.IPlanBackupDestinationResp> 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 'UpdateDrBackupDestinationDetails' operation"))
                {
                    using( var asyncCommandRuntime = new Commvault.Powershell.Runtime.PowerShell.AsyncCommandRuntime(this, ((Commvault.Powershell.Runtime.IEventListener)this).Token) )
                    {
                        asyncCommandRuntime.Wait( ProcessRecordAsync(),((Commvault.Powershell.Runtime.IEventListener)this).Token);
                    }
                }
            }
            catch (global::System.AggregateException aggregateException)
            {
                // unroll the inner exceptions to get the root cause
                foreach( var innerException in aggregateException.Flatten().InnerExceptions )
                {
                    ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Commvault.Powershell.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
                    // Write exception out to error channel.
                    WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) );
                }
            }
            catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null)
            {
                ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Commvault.Powershell.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
                // Write exception out to error channel.
                WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) );
            }
            finally
            {
                ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletProcessRecordEnd).Wait();
            }
        }

        /// <summary>Performs execution of the command, working asynchronously if required.</summary>
        /// <returns>
        /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed.
        /// </returns>
        protected async global::System.Threading.Tasks.Task ProcessRecordAsync()
        {
            using( NoSynchronizationContext )
            {
                await ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletProcessRecordAsyncStart); if( ((Commvault.Powershell.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
                await ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletGetPipeline); if( ((Commvault.Powershell.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
                Pipeline = Commvault.Powershell.Module.Instance.CreatePipeline(InvocationInformation, this.ParameterSetName, this.ExtensibleParameters);
                if (null != HttpPipelinePrepend)
                {
                    Pipeline.Prepend((this.CommandRuntime as Commvault.Powershell.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend);
                }
                if (null != HttpPipelineAppend)
                {
                    Pipeline.Append((this.CommandRuntime as Commvault.Powershell.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend);
                }
                // get the client instance
                try
                {
                    await ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletBeforeAPICall); if( ((Commvault.Powershell.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
                    // try to call with PATH parameters from Input Object
                    if (null == InputObject.BackupDestinationId)
                    {
                        ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.BackupDestinationId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) );
                    }
                    await this.Client.UpdateDrBackupDestinationDetails(InputObject.BackupDestinationId ?? default(long), _body, onOk, onNotFound, onInternalServerError, this, Pipeline, Commvault.Powershell.Runtime.SerializationMode.IncludeCreate);
                    await ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletAfterAPICall); if( ((Commvault.Powershell.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; }
                }
                catch (Commvault.Powershell.Runtime.UndeclaredResponseException urexception)
                {
                    WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { })
                    {
                      ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action }
                    });
                }
                finally
                {
                    await ((Commvault.Powershell.Runtime.IEventListener)this).Signal(Commvault.Powershell.Runtime.Events.CmdletProcessRecordAsyncEnd);
                }
            }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="SetCVDrBackupDestinationDetail_UpdateViaIdentityExpanded" /> cmdlet class.
        /// </summary>
        public SetCVDrBackupDestinationDetail_UpdateViaIdentityExpanded()
        {

        }

        /// <summary>Interrupts currently running code within the command.</summary>
        protected override void StopProcessing()
        {
            ((Commvault.Powershell.Runtime.IEventListener)this).Cancel();
            base.StopProcessing();
        }

        /// <summary>
        /// a delegate that is called when the remote service returns 500 (InternalServerError).
        /// </summary>
        /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
        /// <param name="response">the body result as a <see cref="Commvault.Powershell.Models.IGenericResp">Commvault.Powershell.Models.IGenericResp</see>
        /// from the remote call</param>
        /// <returns>
        /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed.
        /// </returns>
        private async global::System.Threading.Tasks.Task onInternalServerError(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task<Commvault.Powershell.Models.IGenericResp> response)
        {
            using( NoSynchronizationContext )
            {
                var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false);
                overrideOnInternalServerError(responseMessage, response, ref _returnNow);
                // if overrideOnInternalServerError has returned true, then return right away.
                if ((null != _returnNow && await _returnNow))
                {
                    return ;
                }
                // onInternalServerError - response for 500 / application/json
                // (await response) // should be Commvault.Powershell.Models.IGenericResp
                var result = (await response);
                if (null != result)
                {
                    if (0 == _responseSize)
                    {
                        _firstResponse = result;
                        _responseSize = 1;
                    }
                    else
                    {
                        if (1 ==_responseSize)
                        {
                            // Flush buffer
                            WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject());
                        }
                        WriteObject(result.AddMultipleTypeNameIntoPSObject());
                        _responseSize = 2;
                    }
                }
            }
        }

        /// <summary>a delegate that is called when the remote service returns 404 (NotFound).</summary>
        /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
        /// <returns>
        /// A <see cref="global::System.Threading.Tasks.Task" /> that will be complete when handling of the method is completed.
        /// </returns>
        private async global::System.Threading.Tasks.Task onNotFound(global::System.Net.Http.HttpResponseMessage responseMessage)
        {
            using( NoSynchronizationContext )
            {
                var _returnNow = global::System.Threading.Tasks.Task<bool>.FromResult(false);
                overrideOnNotFound(responseMessage, ref _returnNow);
                // if overrideOnNotFound has returned true, then return right away.
                if ((null != _returnNow && await _returnNow))
                {
                    return ;
                }
                // onNotFound - response for 404 /
                if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru"))
                {
                    WriteObject(true);
                }
            }
        }

        /// <summary>a delegate that is called when the remote service returns 200 (OK).</summary>
        /// <param name="responseMessage">the raw response message as an global::System.Net.Http.HttpResponseMessage.</param>
        /// <param name="response">the body result as a <see cref="Commvault.Powershell.Models.IPlanBackupDestinationResp">Commvault.Powershell.Models.IPlanBackupDestinationResp</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.IPlanBackupDestinationResp> 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.IPlanBackupDestinationResp
                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;
                    }
                }
            }
        }
    }
}