private Amazon.LookoutEquipment.Model.CreateDatasetResponse CallAWSServiceOperation(IAmazonLookoutEquipment client, Amazon.LookoutEquipment.Model.CreateDatasetRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Lookout for Equipment", "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.LookoutEquipment.Model.CreateDatasetRequest();

            if (cmdletContext.ClientToken != null)
            {
                request.ClientToken = cmdletContext.ClientToken;
            }
            if (cmdletContext.DatasetName != null)
            {
                request.DatasetName = cmdletContext.DatasetName;
            }

            // populate DatasetSchema
            var requestDatasetSchemaIsNull = true;

            request.DatasetSchema = new Amazon.LookoutEquipment.Model.DatasetSchema();
            System.String requestDatasetSchema_datasetSchema_InlineDataSchema = null;
            if (cmdletContext.DatasetSchema_InlineDataSchema != null)
            {
                requestDatasetSchema_datasetSchema_InlineDataSchema = cmdletContext.DatasetSchema_InlineDataSchema;
            }
            if (requestDatasetSchema_datasetSchema_InlineDataSchema != null)
            {
                request.DatasetSchema.InlineDataSchema = requestDatasetSchema_datasetSchema_InlineDataSchema;
                requestDatasetSchemaIsNull             = false;
            }
            // determine if request.DatasetSchema should be set to null
            if (requestDatasetSchemaIsNull)
            {
                request.DatasetSchema = null;
            }
            if (cmdletContext.ServerSideKmsKeyId != null)
            {
                request.ServerSideKmsKeyId = cmdletContext.ServerSideKmsKeyId;
            }
            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);
        }