private Amazon.ForecastService.Model.CreateForecastExportJobResponse CallAWSServiceOperation(IAmazonForecastService client, Amazon.ForecastService.Model.CreateForecastExportJobRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Forecast Service", "CreateForecastExportJob"); try { #if DESKTOP return(client.CreateForecastExportJob(request)); #elif CORECLR return(client.CreateForecastExportJobAsync(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.ForecastService.Model.CreateForecastExportJobRequest(); // populate Destination var requestDestinationIsNull = true; request.Destination = new Amazon.ForecastService.Model.DataDestination(); Amazon.ForecastService.Model.S3Config requestDestination_destination_S3Config = null; // populate S3Config var requestDestination_destination_S3ConfigIsNull = true; requestDestination_destination_S3Config = new Amazon.ForecastService.Model.S3Config(); System.String requestDestination_destination_S3Config_s3Config_KMSKeyArn = null; if (cmdletContext.S3Config_KMSKeyArn != null) { requestDestination_destination_S3Config_s3Config_KMSKeyArn = cmdletContext.S3Config_KMSKeyArn; } if (requestDestination_destination_S3Config_s3Config_KMSKeyArn != null) { requestDestination_destination_S3Config.KMSKeyArn = requestDestination_destination_S3Config_s3Config_KMSKeyArn; requestDestination_destination_S3ConfigIsNull = false; } System.String requestDestination_destination_S3Config_s3Config_Path = null; if (cmdletContext.S3Config_Path != null) { requestDestination_destination_S3Config_s3Config_Path = cmdletContext.S3Config_Path; } if (requestDestination_destination_S3Config_s3Config_Path != null) { requestDestination_destination_S3Config.Path = requestDestination_destination_S3Config_s3Config_Path; requestDestination_destination_S3ConfigIsNull = false; } System.String requestDestination_destination_S3Config_s3Config_RoleArn = null; if (cmdletContext.S3Config_RoleArn != null) { requestDestination_destination_S3Config_s3Config_RoleArn = cmdletContext.S3Config_RoleArn; } if (requestDestination_destination_S3Config_s3Config_RoleArn != null) { requestDestination_destination_S3Config.RoleArn = requestDestination_destination_S3Config_s3Config_RoleArn; requestDestination_destination_S3ConfigIsNull = false; } // determine if requestDestination_destination_S3Config should be set to null if (requestDestination_destination_S3ConfigIsNull) { requestDestination_destination_S3Config = null; } if (requestDestination_destination_S3Config != null) { request.Destination.S3Config = requestDestination_destination_S3Config; requestDestinationIsNull = false; } // determine if request.Destination should be set to null if (requestDestinationIsNull) { request.Destination = null; } if (cmdletContext.ForecastArn != null) { request.ForecastArn = cmdletContext.ForecastArn; } if (cmdletContext.ForecastExportJobName != null) { request.ForecastExportJobName = cmdletContext.ForecastExportJobName; } 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); }