private void HandleOutput(GetBackupDestinationRequest request) { var waiterConfig = new WaiterConfiguration { MaxAttempts = MaxWaitAttempts, GetNextDelayInSeconds = (_) => WaitIntervalSeconds }; switch (ParameterSetName) { case LifecycleStateParamSet: response = client.Waiters.ForBackupDestination(request, waiterConfig, WaitForLifecycleState).Execute(); break; case Default: response = client.GetBackupDestination(request).GetAwaiter().GetResult(); break; } WriteOutput(response, response.BackupDestination); }
protected override void ProcessRecord() { base.ProcessRecord(); GetBackupDestinationRequest request; try { request = new GetBackupDestinationRequest { BackupDestinationId = BackupDestinationId, OpcRequestId = OpcRequestId }; HandleOutput(request); FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }