private Amazon.Honeycode.Model.StartTableDataImportJobResponse CallAWSServiceOperation(IAmazonHoneycode client, Amazon.Honeycode.Model.StartTableDataImportJobRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Honeycode", "StartTableDataImportJob"); try { #if DESKTOP return(client.StartTableDataImportJob(request)); #elif CORECLR return(client.StartTableDataImportJobAsync(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.Honeycode.Model.StartTableDataImportJobRequest(); if (cmdletContext.ClientRequestToken != null) { request.ClientRequestToken = cmdletContext.ClientRequestToken; } if (cmdletContext.DataFormat != null) { request.DataFormat = cmdletContext.DataFormat; } // populate DataSource var requestDataSourceIsNull = true; request.DataSource = new Amazon.Honeycode.Model.ImportDataSource(); Amazon.Honeycode.Model.ImportDataSourceConfig requestDataSource_dataSource_DataSourceConfig = null; // populate DataSourceConfig var requestDataSource_dataSource_DataSourceConfigIsNull = true; requestDataSource_dataSource_DataSourceConfig = new Amazon.Honeycode.Model.ImportDataSourceConfig(); System.String requestDataSource_dataSource_DataSourceConfig_dataSourceConfig_DataSourceUrl = null; if (cmdletContext.DataSourceConfig_DataSourceUrl != null) { requestDataSource_dataSource_DataSourceConfig_dataSourceConfig_DataSourceUrl = cmdletContext.DataSourceConfig_DataSourceUrl; } if (requestDataSource_dataSource_DataSourceConfig_dataSourceConfig_DataSourceUrl != null) { requestDataSource_dataSource_DataSourceConfig.DataSourceUrl = requestDataSource_dataSource_DataSourceConfig_dataSourceConfig_DataSourceUrl; requestDataSource_dataSource_DataSourceConfigIsNull = false; } // determine if requestDataSource_dataSource_DataSourceConfig should be set to null if (requestDataSource_dataSource_DataSourceConfigIsNull) { requestDataSource_dataSource_DataSourceConfig = null; } if (requestDataSource_dataSource_DataSourceConfig != null) { request.DataSource.DataSourceConfig = requestDataSource_dataSource_DataSourceConfig; requestDataSourceIsNull = false; } // determine if request.DataSource should be set to null if (requestDataSourceIsNull) { request.DataSource = null; } if (cmdletContext.DestinationTableId != null) { request.DestinationTableId = cmdletContext.DestinationTableId; } // populate ImportOptions var requestImportOptionsIsNull = true; request.ImportOptions = new Amazon.Honeycode.Model.ImportOptions(); Amazon.Honeycode.Model.DestinationOptions requestImportOptions_importOptions_DestinationOptions = null; // populate DestinationOptions var requestImportOptions_importOptions_DestinationOptionsIsNull = true; requestImportOptions_importOptions_DestinationOptions = new Amazon.Honeycode.Model.DestinationOptions(); Dictionary <System.String, Amazon.Honeycode.Model.SourceDataColumnProperties> requestImportOptions_importOptions_DestinationOptions_destinationOptions_ColumnMap = null; if (cmdletContext.DestinationOptions_ColumnMap != null) { requestImportOptions_importOptions_DestinationOptions_destinationOptions_ColumnMap = cmdletContext.DestinationOptions_ColumnMap; } if (requestImportOptions_importOptions_DestinationOptions_destinationOptions_ColumnMap != null) { requestImportOptions_importOptions_DestinationOptions.ColumnMap = requestImportOptions_importOptions_DestinationOptions_destinationOptions_ColumnMap; requestImportOptions_importOptions_DestinationOptionsIsNull = false; } // determine if requestImportOptions_importOptions_DestinationOptions should be set to null if (requestImportOptions_importOptions_DestinationOptionsIsNull) { requestImportOptions_importOptions_DestinationOptions = null; } if (requestImportOptions_importOptions_DestinationOptions != null) { request.ImportOptions.DestinationOptions = requestImportOptions_importOptions_DestinationOptions; requestImportOptionsIsNull = false; } Amazon.Honeycode.Model.DelimitedTextImportOptions requestImportOptions_importOptions_DelimitedTextOptions = null; // populate DelimitedTextOptions var requestImportOptions_importOptions_DelimitedTextOptionsIsNull = true; requestImportOptions_importOptions_DelimitedTextOptions = new Amazon.Honeycode.Model.DelimitedTextImportOptions(); Amazon.Honeycode.ImportDataCharacterEncoding requestImportOptions_importOptions_DelimitedTextOptions_delimitedTextOptions_DataCharacterEncoding = null; if (cmdletContext.DelimitedTextOptions_DataCharacterEncoding != null) { requestImportOptions_importOptions_DelimitedTextOptions_delimitedTextOptions_DataCharacterEncoding = cmdletContext.DelimitedTextOptions_DataCharacterEncoding; } if (requestImportOptions_importOptions_DelimitedTextOptions_delimitedTextOptions_DataCharacterEncoding != null) { requestImportOptions_importOptions_DelimitedTextOptions.DataCharacterEncoding = requestImportOptions_importOptions_DelimitedTextOptions_delimitedTextOptions_DataCharacterEncoding; requestImportOptions_importOptions_DelimitedTextOptionsIsNull = false; } System.String requestImportOptions_importOptions_DelimitedTextOptions_delimitedTextOptions_Delimiter = null; if (cmdletContext.DelimitedTextOptions_Delimiter != null) { requestImportOptions_importOptions_DelimitedTextOptions_delimitedTextOptions_Delimiter = cmdletContext.DelimitedTextOptions_Delimiter; } if (requestImportOptions_importOptions_DelimitedTextOptions_delimitedTextOptions_Delimiter != null) { requestImportOptions_importOptions_DelimitedTextOptions.Delimiter = requestImportOptions_importOptions_DelimitedTextOptions_delimitedTextOptions_Delimiter; requestImportOptions_importOptions_DelimitedTextOptionsIsNull = false; } System.Boolean?requestImportOptions_importOptions_DelimitedTextOptions_delimitedTextOptions_HasHeaderRow = null; if (cmdletContext.DelimitedTextOptions_HasHeaderRow != null) { requestImportOptions_importOptions_DelimitedTextOptions_delimitedTextOptions_HasHeaderRow = cmdletContext.DelimitedTextOptions_HasHeaderRow.Value; } if (requestImportOptions_importOptions_DelimitedTextOptions_delimitedTextOptions_HasHeaderRow != null) { requestImportOptions_importOptions_DelimitedTextOptions.HasHeaderRow = requestImportOptions_importOptions_DelimitedTextOptions_delimitedTextOptions_HasHeaderRow.Value; requestImportOptions_importOptions_DelimitedTextOptionsIsNull = false; } System.Boolean?requestImportOptions_importOptions_DelimitedTextOptions_delimitedTextOptions_IgnoreEmptyRow = null; if (cmdletContext.DelimitedTextOptions_IgnoreEmptyRow != null) { requestImportOptions_importOptions_DelimitedTextOptions_delimitedTextOptions_IgnoreEmptyRow = cmdletContext.DelimitedTextOptions_IgnoreEmptyRow.Value; } if (requestImportOptions_importOptions_DelimitedTextOptions_delimitedTextOptions_IgnoreEmptyRow != null) { requestImportOptions_importOptions_DelimitedTextOptions.IgnoreEmptyRows = requestImportOptions_importOptions_DelimitedTextOptions_delimitedTextOptions_IgnoreEmptyRow.Value; requestImportOptions_importOptions_DelimitedTextOptionsIsNull = false; } // determine if requestImportOptions_importOptions_DelimitedTextOptions should be set to null if (requestImportOptions_importOptions_DelimitedTextOptionsIsNull) { requestImportOptions_importOptions_DelimitedTextOptions = null; } if (requestImportOptions_importOptions_DelimitedTextOptions != null) { request.ImportOptions.DelimitedTextOptions = requestImportOptions_importOptions_DelimitedTextOptions; requestImportOptionsIsNull = false; } // determine if request.ImportOptions should be set to null if (requestImportOptionsIsNull) { request.ImportOptions = null; } if (cmdletContext.WorkbookId != null) { request.WorkbookId = cmdletContext.WorkbookId; } 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); }