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

            #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute
            if (cmdletContext.AllocatedCapacity != null)
            {
                request.AllocatedCapacity = cmdletContext.AllocatedCapacity.Value;
            }
            #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute
            if (cmdletContext.Command != null)
            {
                request.Command = cmdletContext.Command;
            }

            // populate Connections
            var requestConnectionsIsNull = true;
            request.Connections = new Amazon.Glue.Model.ConnectionsList();
            List <System.String> requestConnections_connections_Connection = null;
            if (cmdletContext.Connections_Connection != null)
            {
                requestConnections_connections_Connection = cmdletContext.Connections_Connection;
            }
            if (requestConnections_connections_Connection != null)
            {
                request.Connections.Connections = requestConnections_connections_Connection;
                requestConnectionsIsNull        = false;
            }
            // determine if request.Connections should be set to null
            if (requestConnectionsIsNull)
            {
                request.Connections = null;
            }
            if (cmdletContext.DefaultArgument != null)
            {
                request.DefaultArguments = cmdletContext.DefaultArgument;
            }
            if (cmdletContext.Description != null)
            {
                request.Description = cmdletContext.Description;
            }

            // populate ExecutionProperty
            var requestExecutionPropertyIsNull = true;
            request.ExecutionProperty = new Amazon.Glue.Model.ExecutionProperty();
            System.Int32?requestExecutionProperty_executionProperty_MaxConcurrentRun = null;
            if (cmdletContext.ExecutionProperty_MaxConcurrentRun != null)
            {
                requestExecutionProperty_executionProperty_MaxConcurrentRun = cmdletContext.ExecutionProperty_MaxConcurrentRun.Value;
            }
            if (requestExecutionProperty_executionProperty_MaxConcurrentRun != null)
            {
                request.ExecutionProperty.MaxConcurrentRuns = requestExecutionProperty_executionProperty_MaxConcurrentRun.Value;
                requestExecutionPropertyIsNull = false;
            }
            // determine if request.ExecutionProperty should be set to null
            if (requestExecutionPropertyIsNull)
            {
                request.ExecutionProperty = null;
            }
            if (cmdletContext.GlueVersion != null)
            {
                request.GlueVersion = cmdletContext.GlueVersion;
            }
            if (cmdletContext.LogUri != null)
            {
                request.LogUri = cmdletContext.LogUri;
            }
            if (cmdletContext.MaxCapacity != null)
            {
                request.MaxCapacity = cmdletContext.MaxCapacity.Value;
            }
            if (cmdletContext.MaxRetry != null)
            {
                request.MaxRetries = cmdletContext.MaxRetry.Value;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.NonOverridableArgument != null)
            {
                request.NonOverridableArguments = cmdletContext.NonOverridableArgument;
            }

            // populate NotificationProperty
            var requestNotificationPropertyIsNull = true;
            request.NotificationProperty = new Amazon.Glue.Model.NotificationProperty();
            System.Int32?requestNotificationProperty_notificationProperty_NotifyDelayAfter = null;
            if (cmdletContext.NotificationProperty_NotifyDelayAfter != null)
            {
                requestNotificationProperty_notificationProperty_NotifyDelayAfter = cmdletContext.NotificationProperty_NotifyDelayAfter.Value;
            }
            if (requestNotificationProperty_notificationProperty_NotifyDelayAfter != null)
            {
                request.NotificationProperty.NotifyDelayAfter = requestNotificationProperty_notificationProperty_NotifyDelayAfter.Value;
                requestNotificationPropertyIsNull             = false;
            }
            // determine if request.NotificationProperty should be set to null
            if (requestNotificationPropertyIsNull)
            {
                request.NotificationProperty = null;
            }
            if (cmdletContext.NumberOfWorker != null)
            {
                request.NumberOfWorkers = cmdletContext.NumberOfWorker.Value;
            }
            if (cmdletContext.Role != null)
            {
                request.Role = cmdletContext.Role;
            }
            if (cmdletContext.SecurityConfiguration != null)
            {
                request.SecurityConfiguration = cmdletContext.SecurityConfiguration;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }
            if (cmdletContext.Timeout != null)
            {
                request.Timeout = cmdletContext.Timeout.Value;
            }
            if (cmdletContext.WorkerType != null)
            {
                request.WorkerType = cmdletContext.WorkerType;
            }

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