private Amazon.GlueDataBrew.Model.SendProjectSessionActionResponse CallAWSServiceOperation(IAmazonGlueDataBrew client, Amazon.GlueDataBrew.Model.SendProjectSessionActionRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Glue DataBrew", "SendProjectSessionAction");
     try
     {
         #if DESKTOP
         return(client.SendProjectSessionAction(request));
         #elif CORECLR
         return(client.SendProjectSessionActionAsync(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.GlueDataBrew.Model.SendProjectSessionActionRequest();

            if (cmdletContext.ClientSessionId != null)
            {
                request.ClientSessionId = cmdletContext.ClientSessionId;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.Preview != null)
            {
                request.Preview = cmdletContext.Preview.Value;
            }

            // populate RecipeStep
            var requestRecipeStepIsNull = true;

            request.RecipeStep = new Amazon.GlueDataBrew.Model.RecipeStep();
            List <Amazon.GlueDataBrew.Model.ConditionExpression> requestRecipeStep_recipeStep_ConditionExpression = null;

            if (cmdletContext.RecipeStep_ConditionExpression != null)
            {
                requestRecipeStep_recipeStep_ConditionExpression = cmdletContext.RecipeStep_ConditionExpression;
            }
            if (requestRecipeStep_recipeStep_ConditionExpression != null)
            {
                request.RecipeStep.ConditionExpressions = requestRecipeStep_recipeStep_ConditionExpression;
                requestRecipeStepIsNull = false;
            }
            Amazon.GlueDataBrew.Model.RecipeAction requestRecipeStep_recipeStep_Action = null;

            // populate Action
            var requestRecipeStep_recipeStep_ActionIsNull = true;

            requestRecipeStep_recipeStep_Action = new Amazon.GlueDataBrew.Model.RecipeAction();
            System.String requestRecipeStep_recipeStep_Action_action_Operation = null;
            if (cmdletContext.Action_Operation != null)
            {
                requestRecipeStep_recipeStep_Action_action_Operation = cmdletContext.Action_Operation;
            }
            if (requestRecipeStep_recipeStep_Action_action_Operation != null)
            {
                requestRecipeStep_recipeStep_Action.Operation = requestRecipeStep_recipeStep_Action_action_Operation;
                requestRecipeStep_recipeStep_ActionIsNull     = false;
            }
            Dictionary <System.String, System.String> requestRecipeStep_recipeStep_Action_action_Parameter = null;

            if (cmdletContext.Action_Parameter != null)
            {
                requestRecipeStep_recipeStep_Action_action_Parameter = cmdletContext.Action_Parameter;
            }
            if (requestRecipeStep_recipeStep_Action_action_Parameter != null)
            {
                requestRecipeStep_recipeStep_Action.Parameters = requestRecipeStep_recipeStep_Action_action_Parameter;
                requestRecipeStep_recipeStep_ActionIsNull      = false;
            }
            // determine if requestRecipeStep_recipeStep_Action should be set to null
            if (requestRecipeStep_recipeStep_ActionIsNull)
            {
                requestRecipeStep_recipeStep_Action = null;
            }
            if (requestRecipeStep_recipeStep_Action != null)
            {
                request.RecipeStep.Action = requestRecipeStep_recipeStep_Action;
                requestRecipeStepIsNull   = false;
            }
            // determine if request.RecipeStep should be set to null
            if (requestRecipeStepIsNull)
            {
                request.RecipeStep = null;
            }
            if (cmdletContext.StepIndex != null)
            {
                request.StepIndex = cmdletContext.StepIndex.Value;
            }

            // populate ViewFrame
            var requestViewFrameIsNull = true;

            request.ViewFrame = new Amazon.GlueDataBrew.Model.ViewFrame();
            Amazon.GlueDataBrew.AnalyticsMode requestViewFrame_viewFrame_Analytic = null;
            if (cmdletContext.ViewFrame_Analytic != null)
            {
                requestViewFrame_viewFrame_Analytic = cmdletContext.ViewFrame_Analytic;
            }
            if (requestViewFrame_viewFrame_Analytic != null)
            {
                request.ViewFrame.Analytics = requestViewFrame_viewFrame_Analytic;
                requestViewFrameIsNull      = false;
            }
            System.Int32?requestViewFrame_viewFrame_ColumnRange = null;
            if (cmdletContext.ViewFrame_ColumnRange != null)
            {
                requestViewFrame_viewFrame_ColumnRange = cmdletContext.ViewFrame_ColumnRange.Value;
            }
            if (requestViewFrame_viewFrame_ColumnRange != null)
            {
                request.ViewFrame.ColumnRange = requestViewFrame_viewFrame_ColumnRange.Value;
                requestViewFrameIsNull        = false;
            }
            List <System.String> requestViewFrame_viewFrame_HiddenColumn = null;

            if (cmdletContext.ViewFrame_HiddenColumn != null)
            {
                requestViewFrame_viewFrame_HiddenColumn = cmdletContext.ViewFrame_HiddenColumn;
            }
            if (requestViewFrame_viewFrame_HiddenColumn != null)
            {
                request.ViewFrame.HiddenColumns = requestViewFrame_viewFrame_HiddenColumn;
                requestViewFrameIsNull          = false;
            }
            System.Int32?requestViewFrame_viewFrame_RowRange = null;
            if (cmdletContext.ViewFrame_RowRange != null)
            {
                requestViewFrame_viewFrame_RowRange = cmdletContext.ViewFrame_RowRange.Value;
            }
            if (requestViewFrame_viewFrame_RowRange != null)
            {
                request.ViewFrame.RowRange = requestViewFrame_viewFrame_RowRange.Value;
                requestViewFrameIsNull     = false;
            }
            System.Int32?requestViewFrame_viewFrame_StartColumnIndex = null;
            if (cmdletContext.ViewFrame_StartColumnIndex != null)
            {
                requestViewFrame_viewFrame_StartColumnIndex = cmdletContext.ViewFrame_StartColumnIndex.Value;
            }
            if (requestViewFrame_viewFrame_StartColumnIndex != null)
            {
                request.ViewFrame.StartColumnIndex = requestViewFrame_viewFrame_StartColumnIndex.Value;
                requestViewFrameIsNull             = false;
            }
            System.Int32?requestViewFrame_viewFrame_StartRowIndex = null;
            if (cmdletContext.ViewFrame_StartRowIndex != null)
            {
                requestViewFrame_viewFrame_StartRowIndex = cmdletContext.ViewFrame_StartRowIndex.Value;
            }
            if (requestViewFrame_viewFrame_StartRowIndex != null)
            {
                request.ViewFrame.StartRowIndex = requestViewFrame_viewFrame_StartRowIndex.Value;
                requestViewFrameIsNull          = false;
            }
            // determine if request.ViewFrame should be set to null
            if (requestViewFrameIsNull)
            {
                request.ViewFrame = null;
            }

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