private Amazon.Connect.Model.UpdateQueueOutboundCallerConfigResponse CallAWSServiceOperation(IAmazonConnect client, Amazon.Connect.Model.UpdateQueueOutboundCallerConfigRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Connect Service", "UpdateQueueOutboundCallerConfig"); try { #if DESKTOP return(client.UpdateQueueOutboundCallerConfig(request)); #elif CORECLR return(client.UpdateQueueOutboundCallerConfigAsync(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.UpdateQueueOutboundCallerConfigRequest(); if (cmdletContext.InstanceId != null) { request.InstanceId = cmdletContext.InstanceId; } // 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.QueueId != null) { request.QueueId = cmdletContext.QueueId; } 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); }