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