private Amazon.RoboMaker.Model.CreateSimulationApplicationResponse CallAWSServiceOperation(IAmazonRoboMaker client, Amazon.RoboMaker.Model.CreateSimulationApplicationRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS RoboMaker", "CreateSimulationApplication"); try { #if DESKTOP return(client.CreateSimulationApplication(request)); #elif CORECLR return(client.CreateSimulationApplicationAsync(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.RoboMaker.Model.CreateSimulationApplicationRequest(); if (cmdletContext.Name != null) { request.Name = cmdletContext.Name; } // populate RenderingEngine var requestRenderingEngineIsNull = true; request.RenderingEngine = new Amazon.RoboMaker.Model.RenderingEngine(); Amazon.RoboMaker.RenderingEngineType requestRenderingEngine_renderingEngine_Name = null; if (cmdletContext.RenderingEngine_Name != null) { requestRenderingEngine_renderingEngine_Name = cmdletContext.RenderingEngine_Name; } if (requestRenderingEngine_renderingEngine_Name != null) { request.RenderingEngine.Name = requestRenderingEngine_renderingEngine_Name; requestRenderingEngineIsNull = false; } System.String requestRenderingEngine_renderingEngine_Version = null; if (cmdletContext.RenderingEngine_Version != null) { requestRenderingEngine_renderingEngine_Version = cmdletContext.RenderingEngine_Version; } if (requestRenderingEngine_renderingEngine_Version != null) { request.RenderingEngine.Version = requestRenderingEngine_renderingEngine_Version; requestRenderingEngineIsNull = false; } // determine if request.RenderingEngine should be set to null if (requestRenderingEngineIsNull) { request.RenderingEngine = null; } if (cmdletContext.RobotSoftwareSuite != null) { request.RobotSoftwareSuite = cmdletContext.RobotSoftwareSuite; } if (cmdletContext.SimulationSoftwareSuite != null) { request.SimulationSoftwareSuite = cmdletContext.SimulationSoftwareSuite; } if (cmdletContext.Source != null) { request.Sources = cmdletContext.Source; } 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); }