private Amazon.QuickSight.Model.CreateDashboardResponse CallAWSServiceOperation(IAmazonQuickSight client, Amazon.QuickSight.Model.CreateDashboardRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon QuickSight", "CreateDashboard"); try { #if DESKTOP return(client.CreateDashboard(request)); #elif CORECLR return(client.CreateDashboardAsync(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.QuickSight.Model.CreateDashboardRequest(); if (cmdletContext.AwsAccountId != null) { request.AwsAccountId = cmdletContext.AwsAccountId; } if (cmdletContext.DashboardId != null) { request.DashboardId = cmdletContext.DashboardId; } // populate DashboardPublishOptions var requestDashboardPublishOptionsIsNull = true; request.DashboardPublishOptions = new Amazon.QuickSight.Model.DashboardPublishOptions(); Amazon.QuickSight.Model.AdHocFilteringOption requestDashboardPublishOptions_dashboardPublishOptions_AdHocFilteringOption = null; // populate AdHocFilteringOption var requestDashboardPublishOptions_dashboardPublishOptions_AdHocFilteringOptionIsNull = true; requestDashboardPublishOptions_dashboardPublishOptions_AdHocFilteringOption = new Amazon.QuickSight.Model.AdHocFilteringOption(); Amazon.QuickSight.DashboardBehavior requestDashboardPublishOptions_dashboardPublishOptions_AdHocFilteringOption_adHocFilteringOption_AvailabilityStatus = null; if (cmdletContext.AdHocFilteringOption_AvailabilityStatus != null) { requestDashboardPublishOptions_dashboardPublishOptions_AdHocFilteringOption_adHocFilteringOption_AvailabilityStatus = cmdletContext.AdHocFilteringOption_AvailabilityStatus; } if (requestDashboardPublishOptions_dashboardPublishOptions_AdHocFilteringOption_adHocFilteringOption_AvailabilityStatus != null) { requestDashboardPublishOptions_dashboardPublishOptions_AdHocFilteringOption.AvailabilityStatus = requestDashboardPublishOptions_dashboardPublishOptions_AdHocFilteringOption_adHocFilteringOption_AvailabilityStatus; requestDashboardPublishOptions_dashboardPublishOptions_AdHocFilteringOptionIsNull = false; } // determine if requestDashboardPublishOptions_dashboardPublishOptions_AdHocFilteringOption should be set to null if (requestDashboardPublishOptions_dashboardPublishOptions_AdHocFilteringOptionIsNull) { requestDashboardPublishOptions_dashboardPublishOptions_AdHocFilteringOption = null; } if (requestDashboardPublishOptions_dashboardPublishOptions_AdHocFilteringOption != null) { request.DashboardPublishOptions.AdHocFilteringOption = requestDashboardPublishOptions_dashboardPublishOptions_AdHocFilteringOption; requestDashboardPublishOptionsIsNull = false; } Amazon.QuickSight.Model.ExportToCSVOption requestDashboardPublishOptions_dashboardPublishOptions_ExportToCSVOption = null; // populate ExportToCSVOption var requestDashboardPublishOptions_dashboardPublishOptions_ExportToCSVOptionIsNull = true; requestDashboardPublishOptions_dashboardPublishOptions_ExportToCSVOption = new Amazon.QuickSight.Model.ExportToCSVOption(); Amazon.QuickSight.DashboardBehavior requestDashboardPublishOptions_dashboardPublishOptions_ExportToCSVOption_exportToCSVOption_AvailabilityStatus = null; if (cmdletContext.ExportToCSVOption_AvailabilityStatus != null) { requestDashboardPublishOptions_dashboardPublishOptions_ExportToCSVOption_exportToCSVOption_AvailabilityStatus = cmdletContext.ExportToCSVOption_AvailabilityStatus; } if (requestDashboardPublishOptions_dashboardPublishOptions_ExportToCSVOption_exportToCSVOption_AvailabilityStatus != null) { requestDashboardPublishOptions_dashboardPublishOptions_ExportToCSVOption.AvailabilityStatus = requestDashboardPublishOptions_dashboardPublishOptions_ExportToCSVOption_exportToCSVOption_AvailabilityStatus; requestDashboardPublishOptions_dashboardPublishOptions_ExportToCSVOptionIsNull = false; } // determine if requestDashboardPublishOptions_dashboardPublishOptions_ExportToCSVOption should be set to null if (requestDashboardPublishOptions_dashboardPublishOptions_ExportToCSVOptionIsNull) { requestDashboardPublishOptions_dashboardPublishOptions_ExportToCSVOption = null; } if (requestDashboardPublishOptions_dashboardPublishOptions_ExportToCSVOption != null) { request.DashboardPublishOptions.ExportToCSVOption = requestDashboardPublishOptions_dashboardPublishOptions_ExportToCSVOption; requestDashboardPublishOptionsIsNull = false; } Amazon.QuickSight.Model.SheetControlsOption requestDashboardPublishOptions_dashboardPublishOptions_SheetControlsOption = null; // populate SheetControlsOption var requestDashboardPublishOptions_dashboardPublishOptions_SheetControlsOptionIsNull = true; requestDashboardPublishOptions_dashboardPublishOptions_SheetControlsOption = new Amazon.QuickSight.Model.SheetControlsOption(); Amazon.QuickSight.DashboardUIState requestDashboardPublishOptions_dashboardPublishOptions_SheetControlsOption_sheetControlsOption_VisibilityState = null; if (cmdletContext.SheetControlsOption_VisibilityState != null) { requestDashboardPublishOptions_dashboardPublishOptions_SheetControlsOption_sheetControlsOption_VisibilityState = cmdletContext.SheetControlsOption_VisibilityState; } if (requestDashboardPublishOptions_dashboardPublishOptions_SheetControlsOption_sheetControlsOption_VisibilityState != null) { requestDashboardPublishOptions_dashboardPublishOptions_SheetControlsOption.VisibilityState = requestDashboardPublishOptions_dashboardPublishOptions_SheetControlsOption_sheetControlsOption_VisibilityState; requestDashboardPublishOptions_dashboardPublishOptions_SheetControlsOptionIsNull = false; } // determine if requestDashboardPublishOptions_dashboardPublishOptions_SheetControlsOption should be set to null if (requestDashboardPublishOptions_dashboardPublishOptions_SheetControlsOptionIsNull) { requestDashboardPublishOptions_dashboardPublishOptions_SheetControlsOption = null; } if (requestDashboardPublishOptions_dashboardPublishOptions_SheetControlsOption != null) { request.DashboardPublishOptions.SheetControlsOption = requestDashboardPublishOptions_dashboardPublishOptions_SheetControlsOption; requestDashboardPublishOptionsIsNull = false; } // determine if request.DashboardPublishOptions should be set to null if (requestDashboardPublishOptionsIsNull) { request.DashboardPublishOptions = null; } if (cmdletContext.Name != null) { request.Name = cmdletContext.Name; } // populate Parameters var requestParametersIsNull = true; request.Parameters = new Amazon.QuickSight.Model.Parameters(); List <Amazon.QuickSight.Model.DateTimeParameter> requestParameters_parameters_DateTimeParameter = null; if (cmdletContext.Parameters_DateTimeParameter != null) { requestParameters_parameters_DateTimeParameter = cmdletContext.Parameters_DateTimeParameter; } if (requestParameters_parameters_DateTimeParameter != null) { request.Parameters.DateTimeParameters = requestParameters_parameters_DateTimeParameter; requestParametersIsNull = false; } List <Amazon.QuickSight.Model.DecimalParameter> requestParameters_parameters_DecimalParameter = null; if (cmdletContext.Parameters_DecimalParameter != null) { requestParameters_parameters_DecimalParameter = cmdletContext.Parameters_DecimalParameter; } if (requestParameters_parameters_DecimalParameter != null) { request.Parameters.DecimalParameters = requestParameters_parameters_DecimalParameter; requestParametersIsNull = false; } List <Amazon.QuickSight.Model.IntegerParameter> requestParameters_parameters_IntegerParameter = null; if (cmdletContext.Parameters_IntegerParameter != null) { requestParameters_parameters_IntegerParameter = cmdletContext.Parameters_IntegerParameter; } if (requestParameters_parameters_IntegerParameter != null) { request.Parameters.IntegerParameters = requestParameters_parameters_IntegerParameter; requestParametersIsNull = false; } List <Amazon.QuickSight.Model.StringParameter> requestParameters_parameters_StringParameter = null; if (cmdletContext.Parameters_StringParameter != null) { requestParameters_parameters_StringParameter = cmdletContext.Parameters_StringParameter; } if (requestParameters_parameters_StringParameter != null) { request.Parameters.StringParameters = requestParameters_parameters_StringParameter; requestParametersIsNull = false; } // determine if request.Parameters should be set to null if (requestParametersIsNull) { request.Parameters = null; } if (cmdletContext.Permission != null) { request.Permissions = cmdletContext.Permission; } // populate SourceEntity var requestSourceEntityIsNull = true; request.SourceEntity = new Amazon.QuickSight.Model.DashboardSourceEntity(); Amazon.QuickSight.Model.DashboardSourceTemplate requestSourceEntity_sourceEntity_SourceTemplate = null; // populate SourceTemplate var requestSourceEntity_sourceEntity_SourceTemplateIsNull = true; requestSourceEntity_sourceEntity_SourceTemplate = new Amazon.QuickSight.Model.DashboardSourceTemplate(); System.String requestSourceEntity_sourceEntity_SourceTemplate_sourceTemplate_Arn = null; if (cmdletContext.SourceTemplate_Arn != null) { requestSourceEntity_sourceEntity_SourceTemplate_sourceTemplate_Arn = cmdletContext.SourceTemplate_Arn; } if (requestSourceEntity_sourceEntity_SourceTemplate_sourceTemplate_Arn != null) { requestSourceEntity_sourceEntity_SourceTemplate.Arn = requestSourceEntity_sourceEntity_SourceTemplate_sourceTemplate_Arn; requestSourceEntity_sourceEntity_SourceTemplateIsNull = false; } List <Amazon.QuickSight.Model.DataSetReference> requestSourceEntity_sourceEntity_SourceTemplate_sourceTemplate_DataSetReference = null; if (cmdletContext.SourceTemplate_DataSetReference != null) { requestSourceEntity_sourceEntity_SourceTemplate_sourceTemplate_DataSetReference = cmdletContext.SourceTemplate_DataSetReference; } if (requestSourceEntity_sourceEntity_SourceTemplate_sourceTemplate_DataSetReference != null) { requestSourceEntity_sourceEntity_SourceTemplate.DataSetReferences = requestSourceEntity_sourceEntity_SourceTemplate_sourceTemplate_DataSetReference; requestSourceEntity_sourceEntity_SourceTemplateIsNull = false; } // determine if requestSourceEntity_sourceEntity_SourceTemplate should be set to null if (requestSourceEntity_sourceEntity_SourceTemplateIsNull) { requestSourceEntity_sourceEntity_SourceTemplate = null; } if (requestSourceEntity_sourceEntity_SourceTemplate != null) { request.SourceEntity.SourceTemplate = requestSourceEntity_sourceEntity_SourceTemplate; requestSourceEntityIsNull = false; } // determine if request.SourceEntity should be set to null if (requestSourceEntityIsNull) { request.SourceEntity = null; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } if (cmdletContext.VersionDescription != null) { request.VersionDescription = cmdletContext.VersionDescription; } 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); }