private Amazon.Connect.Model.CreateQueueResponse CallAWSServiceOperation(IAmazonConnect client, Amazon.Connect.Model.CreateQueueRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Connect Service", "CreateQueue");
     try
     {
         #if DESKTOP
         return(client.CreateQueue(request));
         #elif CORECLR
         return(client.CreateQueueAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Connect.Model.CreateQueueRequest();

            if (cmdletContext.Description != null)
            {
                request.Description = cmdletContext.Description;
            }
            if (cmdletContext.HoursOfOperationId != null)
            {
                request.HoursOfOperationId = cmdletContext.HoursOfOperationId;
            }
            if (cmdletContext.InstanceId != null)
            {
                request.InstanceId = cmdletContext.InstanceId;
            }
            if (cmdletContext.MaxContact != null)
            {
                request.MaxContacts = cmdletContext.MaxContact.Value;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }

            // populate OutboundCallerConfig
            var requestOutboundCallerConfigIsNull = true;

            request.OutboundCallerConfig = new Amazon.Connect.Model.OutboundCallerConfig();
            System.String requestOutboundCallerConfig_outboundCallerConfig_OutboundCallerIdName = null;
            if (cmdletContext.OutboundCallerConfig_OutboundCallerIdName != null)
            {
                requestOutboundCallerConfig_outboundCallerConfig_OutboundCallerIdName = cmdletContext.OutboundCallerConfig_OutboundCallerIdName;
            }
            if (requestOutboundCallerConfig_outboundCallerConfig_OutboundCallerIdName != null)
            {
                request.OutboundCallerConfig.OutboundCallerIdName = requestOutboundCallerConfig_outboundCallerConfig_OutboundCallerIdName;
                requestOutboundCallerConfigIsNull = false;
            }
            System.String requestOutboundCallerConfig_outboundCallerConfig_OutboundCallerIdNumberId = null;
            if (cmdletContext.OutboundCallerConfig_OutboundCallerIdNumberId != null)
            {
                requestOutboundCallerConfig_outboundCallerConfig_OutboundCallerIdNumberId = cmdletContext.OutboundCallerConfig_OutboundCallerIdNumberId;
            }
            if (requestOutboundCallerConfig_outboundCallerConfig_OutboundCallerIdNumberId != null)
            {
                request.OutboundCallerConfig.OutboundCallerIdNumberId = requestOutboundCallerConfig_outboundCallerConfig_OutboundCallerIdNumberId;
                requestOutboundCallerConfigIsNull = false;
            }
            System.String requestOutboundCallerConfig_outboundCallerConfig_OutboundFlowId = null;
            if (cmdletContext.OutboundCallerConfig_OutboundFlowId != null)
            {
                requestOutboundCallerConfig_outboundCallerConfig_OutboundFlowId = cmdletContext.OutboundCallerConfig_OutboundFlowId;
            }
            if (requestOutboundCallerConfig_outboundCallerConfig_OutboundFlowId != null)
            {
                request.OutboundCallerConfig.OutboundFlowId = requestOutboundCallerConfig_outboundCallerConfig_OutboundFlowId;
                requestOutboundCallerConfigIsNull           = false;
            }
            // determine if request.OutboundCallerConfig should be set to null
            if (requestOutboundCallerConfigIsNull)
            {
                request.OutboundCallerConfig = null;
            }
            if (cmdletContext.QuickConnectId != null)
            {
                request.QuickConnectIds = cmdletContext.QuickConnectId;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }

            CmdletOutput output;

            // issue call
            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);

            try
            {
                var    response       = CallAWSServiceOperation(client, request);
                object pipelineOutput = null;
                pipelineOutput = cmdletContext.Select(response, this);
                output         = new CmdletOutput
                {
                    PipelineOutput  = pipelineOutput,
                    ServiceResponse = response
                };
            }
            catch (Exception e)
            {
                output = new CmdletOutput {
                    ErrorResponse = e
                };
            }

            return(output);
        }