private void HandleOutput(CreateDataGuardAssociationRequest request) { var waiterConfig = new WaiterConfiguration { MaxAttempts = MaxWaitAttempts, GetNextDelayInSeconds = (_) => WaitIntervalSeconds }; switch (ParameterSetName) { case StatusParamSet: response = client.Waiters.ForCreateDataGuardAssociation(request, waiterConfig, WaitForStatus).Execute(); break; case Default: response = client.CreateDataGuardAssociation(request).GetAwaiter().GetResult(); break; } WriteOutput(response, response.DataGuardAssociation); }
protected override void ProcessRecord() { base.ProcessRecord(); CreateDataGuardAssociationRequest request; try { request = new CreateDataGuardAssociationRequest { DatabaseId = DatabaseId, CreateDataGuardAssociationDetails = CreateDataGuardAssociationDetails, OpcRetryToken = OpcRetryToken }; HandleOutput(request); FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }