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