private void HandleOutput(AttachInstancePoolInstanceRequest request)
        {
            var waiterConfig = new WaiterConfiguration
            {
                MaxAttempts           = MaxWaitAttempts,
                GetNextDelayInSeconds = (_) => WaitIntervalSeconds
            };

            switch (ParameterSetName)
            {
            case StatusParamSet:
                response = client.Waiters.ForAttachInstancePoolInstance(request, waiterConfig, WaitForStatus).Execute();
                break;

            case Default:
                response = client.AttachInstancePoolInstance(request).GetAwaiter().GetResult();
                break;
            }
            WriteOutput(response, response.InstancePoolInstance);
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            AttachInstancePoolInstanceRequest request;

            try
            {
                request = new AttachInstancePoolInstanceRequest
                {
                    InstancePoolId = InstancePoolId,
                    AttachInstancePoolInstanceDetails = AttachInstancePoolInstanceDetails,
                    OpcRetryToken = OpcRetryToken
                };

                HandleOutput(request);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
 /// <summary>
 /// Creates a waiter using the provided configuration.
 /// </summary>
 /// <param name="request">Request to send.</param>
 /// <param name="config">Wait Configuration</param>
 /// <param name="targetStates">Desired resource states. If multiple states are provided then the waiter will return once the resource reaches any of the provided states</param>
 /// <returns>a new Oci.common.Waiter instance</returns>
 public Waiter <AttachInstancePoolInstanceRequest, AttachInstancePoolInstanceResponse> ForAttachInstancePoolInstance(AttachInstancePoolInstanceRequest request, WaiterConfiguration config, params WorkrequestsService.Models.WorkRequest.StatusEnum[] targetStates)
 {
     return(new Waiter <AttachInstancePoolInstanceRequest, AttachInstancePoolInstanceResponse>(() =>
     {
         var response = client.AttachInstancePoolInstance(request).Result;
         var getWorkRequestRequest = new Oci.WorkrequestsService.Requests.GetWorkRequestRequest
         {
             WorkRequestId = response.OpcWorkRequestId
         };
         workRequestClient.Waiters.ForWorkRequest(getWorkRequestRequest, config, targetStates).Execute();
         return response;
     }));
 }
 /// <summary>
 /// Creates a waiter using default wait configuration.
 /// </summary>
 /// <param name="request">Request to send.</param>
 /// <param name="statuses">Desired resource states. If multiple states are provided then the waiter will return once the resource reaches any of the provided states</param>
 /// <returns>a new Oci.common.Waiter instance</returns>
 public Waiter <AttachInstancePoolInstanceRequest, AttachInstancePoolInstanceResponse> ForAttachInstancePoolInstance(AttachInstancePoolInstanceRequest request, params WorkrequestsService.Models.WorkRequest.StatusEnum[] targetStates)
 {
     return(this.ForAttachInstancePoolInstance(request, WaiterConfiguration.DefaultWaiterConfiguration, targetStates));
 }