private void HandleOutput(UpgradeDrgRequest request) { var waiterConfig = new WaiterConfiguration { MaxAttempts = MaxWaitAttempts, GetNextDelayInSeconds = (_) => WaitIntervalSeconds }; switch (ParameterSetName) { case StatusParamSet: response = client.Waiters.ForUpgradeDrg(request, waiterConfig, WaitForStatus).Execute(); break; case Default: response = client.UpgradeDrg(request).GetAwaiter().GetResult(); break; } WriteOutput(response, CreateWorkRequestObject(response.OpcWorkRequestId)); }
protected override void ProcessRecord() { base.ProcessRecord(); UpgradeDrgRequest request; try { request = new UpgradeDrgRequest { DrgId = DrgId, OpcRequestId = OpcRequestId, OpcRetryToken = OpcRetryToken }; HandleOutput(request); FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }