private void HandleOutput(GetLocalPeeringGatewayRequest request) { var waiterConfig = new WaiterConfiguration { MaxAttempts = MaxWaitAttempts, GetNextDelayInSeconds = (_) => WaitIntervalSeconds }; switch (ParameterSetName) { case LifecycleStateParamSet: response = client.Waiters.ForLocalPeeringGateway(request, waiterConfig, WaitForLifecycleState).Execute(); break; case PeeringStatusParamSet: response = client.Waiters.ForLocalPeeringGateway(request, waiterConfig, WaitForPeeringStatus).Execute(); break; case Default: response = client.GetLocalPeeringGateway(request).GetAwaiter().GetResult(); break; } WriteOutput(response, response.LocalPeeringGateway); }
protected override void ProcessRecord() { base.ProcessRecord(); GetLocalPeeringGatewayRequest request; try { request = new GetLocalPeeringGatewayRequest { LocalPeeringGatewayId = LocalPeeringGatewayId }; HandleOutput(request); FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }