private Amazon.QuickSight.Model.CreateDataSetResponse CallAWSServiceOperation(IAmazonQuickSight client, Amazon.QuickSight.Model.CreateDataSetRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon QuickSight", "CreateDataSet"); try { #if DESKTOP return(client.CreateDataSet(request)); #elif CORECLR return(client.CreateDataSetAsync(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.CreateDataSetRequest(); if (cmdletContext.AwsAccountId != null) { request.AwsAccountId = cmdletContext.AwsAccountId; } if (cmdletContext.ColumnGroup != null) { request.ColumnGroups = cmdletContext.ColumnGroup; } if (cmdletContext.ColumnLevelPermissionRule != null) { request.ColumnLevelPermissionRules = cmdletContext.ColumnLevelPermissionRule; } if (cmdletContext.DataSetId != null) { request.DataSetId = cmdletContext.DataSetId; } if (cmdletContext.FieldFolder != null) { request.FieldFolders = cmdletContext.FieldFolder; } if (cmdletContext.ImportMode != null) { request.ImportMode = cmdletContext.ImportMode; } if (cmdletContext.LogicalTableMap != null) { request.LogicalTableMap = cmdletContext.LogicalTableMap; } if (cmdletContext.Name != null) { request.Name = cmdletContext.Name; } if (cmdletContext.Permission != null) { request.Permissions = cmdletContext.Permission; } if (cmdletContext.PhysicalTableMap != null) { request.PhysicalTableMap = cmdletContext.PhysicalTableMap; } // populate RowLevelPermissionDataSet var requestRowLevelPermissionDataSetIsNull = true; request.RowLevelPermissionDataSet = new Amazon.QuickSight.Model.RowLevelPermissionDataSet(); System.String requestRowLevelPermissionDataSet_rowLevelPermissionDataSet_Arn = null; if (cmdletContext.RowLevelPermissionDataSet_Arn != null) { requestRowLevelPermissionDataSet_rowLevelPermissionDataSet_Arn = cmdletContext.RowLevelPermissionDataSet_Arn; } if (requestRowLevelPermissionDataSet_rowLevelPermissionDataSet_Arn != null) { request.RowLevelPermissionDataSet.Arn = requestRowLevelPermissionDataSet_rowLevelPermissionDataSet_Arn; requestRowLevelPermissionDataSetIsNull = false; } System.String requestRowLevelPermissionDataSet_rowLevelPermissionDataSet_Namespace = null; if (cmdletContext.RowLevelPermissionDataSet_Namespace != null) { requestRowLevelPermissionDataSet_rowLevelPermissionDataSet_Namespace = cmdletContext.RowLevelPermissionDataSet_Namespace; } if (requestRowLevelPermissionDataSet_rowLevelPermissionDataSet_Namespace != null) { request.RowLevelPermissionDataSet.Namespace = requestRowLevelPermissionDataSet_rowLevelPermissionDataSet_Namespace; requestRowLevelPermissionDataSetIsNull = false; } Amazon.QuickSight.RowLevelPermissionPolicy requestRowLevelPermissionDataSet_rowLevelPermissionDataSet_PermissionPolicy = null; if (cmdletContext.RowLevelPermissionDataSet_PermissionPolicy != null) { requestRowLevelPermissionDataSet_rowLevelPermissionDataSet_PermissionPolicy = cmdletContext.RowLevelPermissionDataSet_PermissionPolicy; } if (requestRowLevelPermissionDataSet_rowLevelPermissionDataSet_PermissionPolicy != null) { request.RowLevelPermissionDataSet.PermissionPolicy = requestRowLevelPermissionDataSet_rowLevelPermissionDataSet_PermissionPolicy; requestRowLevelPermissionDataSetIsNull = false; } // determine if request.RowLevelPermissionDataSet should be set to null if (requestRowLevelPermissionDataSetIsNull) { request.RowLevelPermissionDataSet = null; } 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); }