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