private Amazon.RoboMaker.Model.CreateWorldGenerationJobResponse CallAWSServiceOperation(IAmazonRoboMaker client, Amazon.RoboMaker.Model.CreateWorldGenerationJobRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS RoboMaker", "CreateWorldGenerationJob"); try { #if DESKTOP return(client.CreateWorldGenerationJob(request)); #elif CORECLR return(client.CreateWorldGenerationJobAsync(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.CreateWorldGenerationJobRequest(); if (cmdletContext.ClientRequestToken != null) { request.ClientRequestToken = cmdletContext.ClientRequestToken; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } if (cmdletContext.Template != null) { request.Template = cmdletContext.Template; } // populate WorldCount var requestWorldCountIsNull = true; request.WorldCount = new Amazon.RoboMaker.Model.WorldCount(); System.Int32?requestWorldCount_worldCount_FloorplanCount = null; if (cmdletContext.WorldCount_FloorplanCount != null) { requestWorldCount_worldCount_FloorplanCount = cmdletContext.WorldCount_FloorplanCount.Value; } if (requestWorldCount_worldCount_FloorplanCount != null) { request.WorldCount.FloorplanCount = requestWorldCount_worldCount_FloorplanCount.Value; requestWorldCountIsNull = false; } System.Int32?requestWorldCount_worldCount_InteriorCountPerFloorplan = null; if (cmdletContext.WorldCount_InteriorCountPerFloorplan != null) { requestWorldCount_worldCount_InteriorCountPerFloorplan = cmdletContext.WorldCount_InteriorCountPerFloorplan.Value; } if (requestWorldCount_worldCount_InteriorCountPerFloorplan != null) { request.WorldCount.InteriorCountPerFloorplan = requestWorldCount_worldCount_InteriorCountPerFloorplan.Value; requestWorldCountIsNull = false; } // determine if request.WorldCount should be set to null if (requestWorldCountIsNull) { request.WorldCount = null; } 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); }