Exemplo n.º 1
0
 private Amazon.LookoutMetrics.Model.GetSampleDataResponse CallAWSServiceOperation(IAmazonLookoutMetrics client, Amazon.LookoutMetrics.Model.GetSampleDataRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Lookout for Metrics", "GetSampleData");
     try
     {
         #if DESKTOP
         return(client.GetSampleData(request));
         #elif CORECLR
         return(client.GetSampleDataAsync(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;
     }
 }
Exemplo n.º 2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.LookoutMetrics.Model.GetSampleDataRequest();


            // populate S3SourceConfig
            var requestS3SourceConfigIsNull = true;

            request.S3SourceConfig = new Amazon.LookoutMetrics.Model.SampleDataS3SourceConfig();
            List <System.String> requestS3SourceConfig_s3SourceConfig_HistoricalDataPathList = null;

            if (cmdletContext.S3SourceConfig_HistoricalDataPathList != null)
            {
                requestS3SourceConfig_s3SourceConfig_HistoricalDataPathList = cmdletContext.S3SourceConfig_HistoricalDataPathList;
            }
            if (requestS3SourceConfig_s3SourceConfig_HistoricalDataPathList != null)
            {
                request.S3SourceConfig.HistoricalDataPathList = requestS3SourceConfig_s3SourceConfig_HistoricalDataPathList;
                requestS3SourceConfigIsNull = false;
            }
            System.String requestS3SourceConfig_s3SourceConfig_RoleArn = null;
            if (cmdletContext.S3SourceConfig_RoleArn != null)
            {
                requestS3SourceConfig_s3SourceConfig_RoleArn = cmdletContext.S3SourceConfig_RoleArn;
            }
            if (requestS3SourceConfig_s3SourceConfig_RoleArn != null)
            {
                request.S3SourceConfig.RoleArn = requestS3SourceConfig_s3SourceConfig_RoleArn;
                requestS3SourceConfigIsNull    = false;
            }
            List <System.String> requestS3SourceConfig_s3SourceConfig_TemplatedPathList = null;

            if (cmdletContext.S3SourceConfig_TemplatedPathList != null)
            {
                requestS3SourceConfig_s3SourceConfig_TemplatedPathList = cmdletContext.S3SourceConfig_TemplatedPathList;
            }
            if (requestS3SourceConfig_s3SourceConfig_TemplatedPathList != null)
            {
                request.S3SourceConfig.TemplatedPathList = requestS3SourceConfig_s3SourceConfig_TemplatedPathList;
                requestS3SourceConfigIsNull = false;
            }
            Amazon.LookoutMetrics.Model.FileFormatDescriptor requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor = null;

            // populate FileFormatDescriptor
            var requestS3SourceConfig_s3SourceConfig_FileFormatDescriptorIsNull = true;

            requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor = new Amazon.LookoutMetrics.Model.FileFormatDescriptor();
            Amazon.LookoutMetrics.Model.JsonFormatDescriptor requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptor = null;

            // populate JsonFormatDescriptor
            var requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptorIsNull = true;

            requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptor = new Amazon.LookoutMetrics.Model.JsonFormatDescriptor();
            System.String requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptor_jsonFormatDescriptor_Charset = null;
            if (cmdletContext.JsonFormatDescriptor_Charset != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptor_jsonFormatDescriptor_Charset = cmdletContext.JsonFormatDescriptor_Charset;
            }
            if (requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptor_jsonFormatDescriptor_Charset != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptor.Charset = requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptor_jsonFormatDescriptor_Charset;
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptorIsNull   = false;
            }
            Amazon.LookoutMetrics.JsonFileCompression requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptor_jsonFormatDescriptor_FileCompression = null;
            if (cmdletContext.JsonFormatDescriptor_FileCompression != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptor_jsonFormatDescriptor_FileCompression = cmdletContext.JsonFormatDescriptor_FileCompression;
            }
            if (requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptor_jsonFormatDescriptor_FileCompression != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptor.FileCompression = requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptor_jsonFormatDescriptor_FileCompression;
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptorIsNull           = false;
            }
            // determine if requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptor should be set to null
            if (requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptorIsNull)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptor = null;
            }
            if (requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptor != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor.JsonFormatDescriptor = requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_JsonFormatDescriptor;
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptorIsNull = false;
            }
            Amazon.LookoutMetrics.Model.CsvFormatDescriptor requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor = null;

            // populate CsvFormatDescriptor
            var requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptorIsNull = true;

            requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor = new Amazon.LookoutMetrics.Model.CsvFormatDescriptor();
            System.String requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_Charset = null;
            if (cmdletContext.CsvFormatDescriptor_Charset != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_Charset = cmdletContext.CsvFormatDescriptor_Charset;
            }
            if (requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_Charset != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor.Charset = requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_Charset;
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptorIsNull   = false;
            }
            System.Boolean?requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_ContainsHeader = null;
            if (cmdletContext.CsvFormatDescriptor_ContainsHeader != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_ContainsHeader = cmdletContext.CsvFormatDescriptor_ContainsHeader.Value;
            }
            if (requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_ContainsHeader != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor.ContainsHeader = requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_ContainsHeader.Value;
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptorIsNull          = false;
            }
            System.String requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_Delimiter = null;
            if (cmdletContext.CsvFormatDescriptor_Delimiter != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_Delimiter = cmdletContext.CsvFormatDescriptor_Delimiter;
            }
            if (requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_Delimiter != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor.Delimiter = requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_Delimiter;
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptorIsNull     = false;
            }
            Amazon.LookoutMetrics.CSVFileCompression requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_FileCompression = null;
            if (cmdletContext.CsvFormatDescriptor_FileCompression != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_FileCompression = cmdletContext.CsvFormatDescriptor_FileCompression;
            }
            if (requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_FileCompression != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor.FileCompression = requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_FileCompression;
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptorIsNull           = false;
            }
            List <System.String> requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_HeaderList = null;

            if (cmdletContext.CsvFormatDescriptor_HeaderList != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_HeaderList = cmdletContext.CsvFormatDescriptor_HeaderList;
            }
            if (requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_HeaderList != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor.HeaderList = requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_HeaderList;
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptorIsNull      = false;
            }
            System.String requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_QuoteSymbol = null;
            if (cmdletContext.CsvFormatDescriptor_QuoteSymbol != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_QuoteSymbol = cmdletContext.CsvFormatDescriptor_QuoteSymbol;
            }
            if (requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_QuoteSymbol != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor.QuoteSymbol = requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor_csvFormatDescriptor_QuoteSymbol;
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptorIsNull       = false;
            }
            // determine if requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor should be set to null
            if (requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptorIsNull)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor = null;
            }
            if (requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor != null)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor.CsvFormatDescriptor = requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor_s3SourceConfig_FileFormatDescriptor_CsvFormatDescriptor;
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptorIsNull = false;
            }
            // determine if requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor should be set to null
            if (requestS3SourceConfig_s3SourceConfig_FileFormatDescriptorIsNull)
            {
                requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor = null;
            }
            if (requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor != null)
            {
                request.S3SourceConfig.FileFormatDescriptor = requestS3SourceConfig_s3SourceConfig_FileFormatDescriptor;
                requestS3SourceConfigIsNull = false;
            }
            // determine if request.S3SourceConfig should be set to null
            if (requestS3SourceConfigIsNull)
            {
                request.S3SourceConfig = 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);
        }