public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.IoT.Model.CreateOTAUpdateRequest();

            if (cmdletContext.AdditionalParameter != null)
            {
                request.AdditionalParameters = cmdletContext.AdditionalParameter;
            }

            // populate AwsJobExecutionsRolloutConfig
            var requestAwsJobExecutionsRolloutConfigIsNull = true;

            request.AwsJobExecutionsRolloutConfig = new Amazon.IoT.Model.AwsJobExecutionsRolloutConfig();
            System.Int32?requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_MaximumPerMinute = null;
            if (cmdletContext.AwsJobExecutionsRolloutConfig_MaximumPerMinute != null)
            {
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_MaximumPerMinute = cmdletContext.AwsJobExecutionsRolloutConfig_MaximumPerMinute.Value;
            }
            if (requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_MaximumPerMinute != null)
            {
                request.AwsJobExecutionsRolloutConfig.MaximumPerMinute = requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_MaximumPerMinute.Value;
                requestAwsJobExecutionsRolloutConfigIsNull             = false;
            }
            // determine if request.AwsJobExecutionsRolloutConfig should be set to null
            if (requestAwsJobExecutionsRolloutConfigIsNull)
            {
                request.AwsJobExecutionsRolloutConfig = null;
            }
            if (cmdletContext.Description != null)
            {
                request.Description = cmdletContext.Description;
            }
            if (cmdletContext.File != null)
            {
                request.Files = cmdletContext.File;
            }
            if (cmdletContext.OtaUpdateId != null)
            {
                request.OtaUpdateId = cmdletContext.OtaUpdateId;
            }
            if (cmdletContext.RoleArn != null)
            {
                request.RoleArn = cmdletContext.RoleArn;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }
            if (cmdletContext.Target != null)
            {
                request.Targets = cmdletContext.Target;
            }
            if (cmdletContext.TargetSelection != null)
            {
                request.TargetSelection = cmdletContext.TargetSelection;
            }

            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);
        }
 private Amazon.IoT.Model.CreateOTAUpdateResponse CallAWSServiceOperation(IAmazonIoT client, Amazon.IoT.Model.CreateOTAUpdateRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS IoT", "CreateOTAUpdate");
     try
     {
         #if DESKTOP
         return(client.CreateOTAUpdate(request));
         #elif CORECLR
         return(client.CreateOTAUpdateAsync(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.IoT.Model.CreateOTAUpdateRequest();

            if (cmdletContext.AdditionalParameter != null)
            {
                request.AdditionalParameters = cmdletContext.AdditionalParameter;
            }

            // populate AwsJobAbortConfig
            var requestAwsJobAbortConfigIsNull = true;

            request.AwsJobAbortConfig = new Amazon.IoT.Model.AwsJobAbortConfig();
            List <Amazon.IoT.Model.AwsJobAbortCriteria> requestAwsJobAbortConfig_awsJobAbortConfig_AbortCriteriaList = null;

            if (cmdletContext.AwsJobAbortConfig_AbortCriteriaList != null)
            {
                requestAwsJobAbortConfig_awsJobAbortConfig_AbortCriteriaList = cmdletContext.AwsJobAbortConfig_AbortCriteriaList;
            }
            if (requestAwsJobAbortConfig_awsJobAbortConfig_AbortCriteriaList != null)
            {
                request.AwsJobAbortConfig.AbortCriteriaList = requestAwsJobAbortConfig_awsJobAbortConfig_AbortCriteriaList;
                requestAwsJobAbortConfigIsNull = false;
            }
            // determine if request.AwsJobAbortConfig should be set to null
            if (requestAwsJobAbortConfigIsNull)
            {
                request.AwsJobAbortConfig = null;
            }

            // populate AwsJobExecutionsRolloutConfig
            var requestAwsJobExecutionsRolloutConfigIsNull = true;

            request.AwsJobExecutionsRolloutConfig = new Amazon.IoT.Model.AwsJobExecutionsRolloutConfig();
            System.Int32?requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_MaximumPerMinute = null;
            if (cmdletContext.AwsJobExecutionsRolloutConfig_MaximumPerMinute != null)
            {
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_MaximumPerMinute = cmdletContext.AwsJobExecutionsRolloutConfig_MaximumPerMinute.Value;
            }
            if (requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_MaximumPerMinute != null)
            {
                request.AwsJobExecutionsRolloutConfig.MaximumPerMinute = requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_MaximumPerMinute.Value;
                requestAwsJobExecutionsRolloutConfigIsNull             = false;
            }
            Amazon.IoT.Model.AwsJobExponentialRolloutRate requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate = null;

            // populate ExponentialRate
            var requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRateIsNull = true;

            requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate = new Amazon.IoT.Model.AwsJobExponentialRolloutRate();
            System.Int32?requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_exponentialRate_BaseRatePerMinute = null;
            if (cmdletContext.ExponentialRate_BaseRatePerMinute != null)
            {
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_exponentialRate_BaseRatePerMinute = cmdletContext.ExponentialRate_BaseRatePerMinute.Value;
            }
            if (requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_exponentialRate_BaseRatePerMinute != null)
            {
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate.BaseRatePerMinute = requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_exponentialRate_BaseRatePerMinute.Value;
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRateIsNull             = false;
            }
            System.Double?requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_exponentialRate_IncrementFactor = null;
            if (cmdletContext.ExponentialRate_IncrementFactor != null)
            {
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_exponentialRate_IncrementFactor = cmdletContext.ExponentialRate_IncrementFactor.Value;
            }
            if (requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_exponentialRate_IncrementFactor != null)
            {
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate.IncrementFactor = requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_exponentialRate_IncrementFactor.Value;
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRateIsNull           = false;
            }
            Amazon.IoT.Model.AwsJobRateIncreaseCriteria requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteria = null;

            // populate RateIncreaseCriteria
            var requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteriaIsNull = true;

            requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteria = new Amazon.IoT.Model.AwsJobRateIncreaseCriteria();
            System.Int32?requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteria_rateIncreaseCriteria_NumberOfNotifiedThing = null;
            if (cmdletContext.RateIncreaseCriteria_NumberOfNotifiedThing != null)
            {
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteria_rateIncreaseCriteria_NumberOfNotifiedThing = cmdletContext.RateIncreaseCriteria_NumberOfNotifiedThing.Value;
            }
            if (requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteria_rateIncreaseCriteria_NumberOfNotifiedThing != null)
            {
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteria.NumberOfNotifiedThings = requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteria_rateIncreaseCriteria_NumberOfNotifiedThing.Value;
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteriaIsNull = false;
            }
            System.Int32?requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteria_rateIncreaseCriteria_NumberOfSucceededThing = null;
            if (cmdletContext.RateIncreaseCriteria_NumberOfSucceededThing != null)
            {
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteria_rateIncreaseCriteria_NumberOfSucceededThing = cmdletContext.RateIncreaseCriteria_NumberOfSucceededThing.Value;
            }
            if (requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteria_rateIncreaseCriteria_NumberOfSucceededThing != null)
            {
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteria.NumberOfSucceededThings = requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteria_rateIncreaseCriteria_NumberOfSucceededThing.Value;
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteriaIsNull = false;
            }
            // determine if requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteria should be set to null
            if (requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteriaIsNull)
            {
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteria = null;
            }
            if (requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteria != null)
            {
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate.RateIncreaseCriteria = requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate_awsJobExecutionsRolloutConfig_ExponentialRate_RateIncreaseCriteria;
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRateIsNull = false;
            }
            // determine if requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate should be set to null
            if (requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRateIsNull)
            {
                requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate = null;
            }
            if (requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate != null)
            {
                request.AwsJobExecutionsRolloutConfig.ExponentialRate = requestAwsJobExecutionsRolloutConfig_awsJobExecutionsRolloutConfig_ExponentialRate;
                requestAwsJobExecutionsRolloutConfigIsNull            = false;
            }
            // determine if request.AwsJobExecutionsRolloutConfig should be set to null
            if (requestAwsJobExecutionsRolloutConfigIsNull)
            {
                request.AwsJobExecutionsRolloutConfig = null;
            }

            // populate AwsJobPresignedUrlConfig
            var requestAwsJobPresignedUrlConfigIsNull = true;

            request.AwsJobPresignedUrlConfig = new Amazon.IoT.Model.AwsJobPresignedUrlConfig();
            System.Int64?requestAwsJobPresignedUrlConfig_awsJobPresignedUrlConfig_ExpiresInSec = null;
            if (cmdletContext.AwsJobPresignedUrlConfig_ExpiresInSec != null)
            {
                requestAwsJobPresignedUrlConfig_awsJobPresignedUrlConfig_ExpiresInSec = cmdletContext.AwsJobPresignedUrlConfig_ExpiresInSec.Value;
            }
            if (requestAwsJobPresignedUrlConfig_awsJobPresignedUrlConfig_ExpiresInSec != null)
            {
                request.AwsJobPresignedUrlConfig.ExpiresInSec = requestAwsJobPresignedUrlConfig_awsJobPresignedUrlConfig_ExpiresInSec.Value;
                requestAwsJobPresignedUrlConfigIsNull         = false;
            }
            // determine if request.AwsJobPresignedUrlConfig should be set to null
            if (requestAwsJobPresignedUrlConfigIsNull)
            {
                request.AwsJobPresignedUrlConfig = null;
            }

            // populate AwsJobTimeoutConfig
            var requestAwsJobTimeoutConfigIsNull = true;

            request.AwsJobTimeoutConfig = new Amazon.IoT.Model.AwsJobTimeoutConfig();
            System.Int64?requestAwsJobTimeoutConfig_awsJobTimeoutConfig_InProgressTimeoutInMinute = null;
            if (cmdletContext.AwsJobTimeoutConfig_InProgressTimeoutInMinute != null)
            {
                requestAwsJobTimeoutConfig_awsJobTimeoutConfig_InProgressTimeoutInMinute = cmdletContext.AwsJobTimeoutConfig_InProgressTimeoutInMinute.Value;
            }
            if (requestAwsJobTimeoutConfig_awsJobTimeoutConfig_InProgressTimeoutInMinute != null)
            {
                request.AwsJobTimeoutConfig.InProgressTimeoutInMinutes = requestAwsJobTimeoutConfig_awsJobTimeoutConfig_InProgressTimeoutInMinute.Value;
                requestAwsJobTimeoutConfigIsNull = false;
            }
            // determine if request.AwsJobTimeoutConfig should be set to null
            if (requestAwsJobTimeoutConfigIsNull)
            {
                request.AwsJobTimeoutConfig = null;
            }
            if (cmdletContext.Description != null)
            {
                request.Description = cmdletContext.Description;
            }
            if (cmdletContext.File != null)
            {
                request.Files = cmdletContext.File;
            }
            if (cmdletContext.OtaUpdateId != null)
            {
                request.OtaUpdateId = cmdletContext.OtaUpdateId;
            }
            if (cmdletContext.Protocol != null)
            {
                request.Protocols = cmdletContext.Protocol;
            }
            if (cmdletContext.RoleArn != null)
            {
                request.RoleArn = cmdletContext.RoleArn;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }
            if (cmdletContext.Target != null)
            {
                request.Targets = cmdletContext.Target;
            }
            if (cmdletContext.TargetSelection != null)
            {
                request.TargetSelection = cmdletContext.TargetSelection;
            }

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