private Amazon.Glue.Model.CreatePartitionIndexResponse CallAWSServiceOperation(IAmazonGlue client, Amazon.Glue.Model.CreatePartitionIndexRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Glue", "CreatePartitionIndex");
     try
     {
         #if DESKTOP
         return(client.CreatePartitionIndex(request));
         #elif CORECLR
         return(client.CreatePartitionIndexAsync(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.Glue.Model.CreatePartitionIndexRequest();

            if (cmdletContext.CatalogId != null)
            {
                request.CatalogId = cmdletContext.CatalogId;
            }
            if (cmdletContext.DatabaseName != null)
            {
                request.DatabaseName = cmdletContext.DatabaseName;
            }

            // populate PartitionIndex
            var requestPartitionIndexIsNull = true;

            request.PartitionIndex = new Amazon.Glue.Model.PartitionIndex();
            System.String requestPartitionIndex_partitionIndex_IndexName = null;
            if (cmdletContext.PartitionIndex_IndexName != null)
            {
                requestPartitionIndex_partitionIndex_IndexName = cmdletContext.PartitionIndex_IndexName;
            }
            if (requestPartitionIndex_partitionIndex_IndexName != null)
            {
                request.PartitionIndex.IndexName = requestPartitionIndex_partitionIndex_IndexName;
                requestPartitionIndexIsNull      = false;
            }
            List <System.String> requestPartitionIndex_partitionIndex_Key = null;

            if (cmdletContext.PartitionIndex_Key != null)
            {
                requestPartitionIndex_partitionIndex_Key = cmdletContext.PartitionIndex_Key;
            }
            if (requestPartitionIndex_partitionIndex_Key != null)
            {
                request.PartitionIndex.Keys = requestPartitionIndex_partitionIndex_Key;
                requestPartitionIndexIsNull = false;
            }
            // determine if request.PartitionIndex should be set to null
            if (requestPartitionIndexIsNull)
            {
                request.PartitionIndex = null;
            }
            if (cmdletContext.TableName != null)
            {
                request.TableName = cmdletContext.TableName;
            }

            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);
        }