private Amazon.LocationService.Model.CreateMapResponse CallAWSServiceOperation(IAmazonLocationService client, Amazon.LocationService.Model.CreateMapRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Location Service", "CreateMap"); try { #if DESKTOP return(client.CreateMap(request)); #elif CORECLR return(client.CreateMapAsync(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.LocationService.Model.CreateMapRequest(); // populate Configuration var requestConfigurationIsNull = true; request.Configuration = new Amazon.LocationService.Model.MapConfiguration(); System.String requestConfiguration_configuration_Style = null; if (cmdletContext.Configuration_Style != null) { requestConfiguration_configuration_Style = cmdletContext.Configuration_Style; } if (requestConfiguration_configuration_Style != null) { request.Configuration.Style = requestConfiguration_configuration_Style; requestConfigurationIsNull = false; } // determine if request.Configuration should be set to null if (requestConfigurationIsNull) { request.Configuration = null; } if (cmdletContext.Description != null) { request.Description = cmdletContext.Description; } if (cmdletContext.MapName != null) { request.MapName = cmdletContext.MapName; } if (cmdletContext.PricingPlan != null) { request.PricingPlan = cmdletContext.PricingPlan; } 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); }