private Amazon.LakeFormation.Model.StartQueryPlanningResponse CallAWSServiceOperation(IAmazonLakeFormation client, Amazon.LakeFormation.Model.StartQueryPlanningRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Lake Formation", "StartQueryPlanning");
     try
     {
         #if DESKTOP
         return(client.StartQueryPlanning(request));
         #elif CORECLR
         return(client.StartQueryPlanningAsync(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.LakeFormation.Model.StartQueryPlanningRequest();


            // populate QueryPlanningContext
            var requestQueryPlanningContextIsNull = true;

            request.QueryPlanningContext = new Amazon.LakeFormation.Model.QueryPlanningContext();
            System.String requestQueryPlanningContext_queryPlanningContext_CatalogId = null;
            if (cmdletContext.QueryPlanningContext_CatalogId != null)
            {
                requestQueryPlanningContext_queryPlanningContext_CatalogId = cmdletContext.QueryPlanningContext_CatalogId;
            }
            if (requestQueryPlanningContext_queryPlanningContext_CatalogId != null)
            {
                request.QueryPlanningContext.CatalogId = requestQueryPlanningContext_queryPlanningContext_CatalogId;
                requestQueryPlanningContextIsNull      = false;
            }
            System.String requestQueryPlanningContext_queryPlanningContext_DatabaseName = null;
            if (cmdletContext.QueryPlanningContext_DatabaseName != null)
            {
                requestQueryPlanningContext_queryPlanningContext_DatabaseName = cmdletContext.QueryPlanningContext_DatabaseName;
            }
            if (requestQueryPlanningContext_queryPlanningContext_DatabaseName != null)
            {
                request.QueryPlanningContext.DatabaseName = requestQueryPlanningContext_queryPlanningContext_DatabaseName;
                requestQueryPlanningContextIsNull         = false;
            }
            System.DateTime?requestQueryPlanningContext_queryPlanningContext_QueryAsOfTime = null;
            if (cmdletContext.QueryPlanningContext_QueryAsOfTime != null)
            {
                requestQueryPlanningContext_queryPlanningContext_QueryAsOfTime = cmdletContext.QueryPlanningContext_QueryAsOfTime.Value;
            }
            if (requestQueryPlanningContext_queryPlanningContext_QueryAsOfTime != null)
            {
                request.QueryPlanningContext.QueryAsOfTime = requestQueryPlanningContext_queryPlanningContext_QueryAsOfTime.Value;
                requestQueryPlanningContextIsNull          = false;
            }
            Dictionary <System.String, System.String> requestQueryPlanningContext_queryPlanningContext_QueryParameter = null;

            if (cmdletContext.QueryPlanningContext_QueryParameter != null)
            {
                requestQueryPlanningContext_queryPlanningContext_QueryParameter = cmdletContext.QueryPlanningContext_QueryParameter;
            }
            if (requestQueryPlanningContext_queryPlanningContext_QueryParameter != null)
            {
                request.QueryPlanningContext.QueryParameters = requestQueryPlanningContext_queryPlanningContext_QueryParameter;
                requestQueryPlanningContextIsNull            = false;
            }
            System.String requestQueryPlanningContext_queryPlanningContext_TransactionId = null;
            if (cmdletContext.QueryPlanningContext_TransactionId != null)
            {
                requestQueryPlanningContext_queryPlanningContext_TransactionId = cmdletContext.QueryPlanningContext_TransactionId;
            }
            if (requestQueryPlanningContext_queryPlanningContext_TransactionId != null)
            {
                request.QueryPlanningContext.TransactionId = requestQueryPlanningContext_queryPlanningContext_TransactionId;
                requestQueryPlanningContextIsNull          = false;
            }
            // determine if request.QueryPlanningContext should be set to null
            if (requestQueryPlanningContextIsNull)
            {
                request.QueryPlanningContext = null;
            }
            if (cmdletContext.QueryString != null)
            {
                request.QueryString = cmdletContext.QueryString;
            }

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