private Amazon.IoTWireless.Model.CreateWirelessGatewayTaskDefinitionResponse CallAWSServiceOperation(IAmazonIoTWireless client, Amazon.IoTWireless.Model.CreateWirelessGatewayTaskDefinitionRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS IoT Wireless", "CreateWirelessGatewayTaskDefinition");
     try
     {
         #if DESKTOP
         return(client.CreateWirelessGatewayTaskDefinition(request));
         #elif CORECLR
         return(client.CreateWirelessGatewayTaskDefinitionAsync(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.IoTWireless.Model.CreateWirelessGatewayTaskDefinitionRequest();

            if (cmdletContext.AutoCreateTask != null)
            {
                request.AutoCreateTasks = cmdletContext.AutoCreateTask.Value;
            }
            if (cmdletContext.ClientRequestToken != null)
            {
                request.ClientRequestToken = cmdletContext.ClientRequestToken;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }

            // populate Update
            var requestUpdateIsNull = true;

            request.Update = new Amazon.IoTWireless.Model.UpdateWirelessGatewayTaskCreate();
            System.String requestUpdate_update_UpdateDataRole = null;
            if (cmdletContext.Update_UpdateDataRole != null)
            {
                requestUpdate_update_UpdateDataRole = cmdletContext.Update_UpdateDataRole;
            }
            if (requestUpdate_update_UpdateDataRole != null)
            {
                request.Update.UpdateDataRole = requestUpdate_update_UpdateDataRole;
                requestUpdateIsNull           = false;
            }
            System.String requestUpdate_update_UpdateDataSource = null;
            if (cmdletContext.Update_UpdateDataSource != null)
            {
                requestUpdate_update_UpdateDataSource = cmdletContext.Update_UpdateDataSource;
            }
            if (requestUpdate_update_UpdateDataSource != null)
            {
                request.Update.UpdateDataSource = requestUpdate_update_UpdateDataSource;
                requestUpdateIsNull             = false;
            }
            Amazon.IoTWireless.Model.LoRaWANUpdateGatewayTaskCreate requestUpdate_update_LoRaWAN = null;

            // populate LoRaWAN
            var requestUpdate_update_LoRaWANIsNull = true;

            requestUpdate_update_LoRaWAN = new Amazon.IoTWireless.Model.LoRaWANUpdateGatewayTaskCreate();
            System.Int64?requestUpdate_update_LoRaWAN_loRaWAN_SigKeyCrc = null;
            if (cmdletContext.LoRaWAN_SigKeyCrc != null)
            {
                requestUpdate_update_LoRaWAN_loRaWAN_SigKeyCrc = cmdletContext.LoRaWAN_SigKeyCrc.Value;
            }
            if (requestUpdate_update_LoRaWAN_loRaWAN_SigKeyCrc != null)
            {
                requestUpdate_update_LoRaWAN.SigKeyCrc = requestUpdate_update_LoRaWAN_loRaWAN_SigKeyCrc.Value;
                requestUpdate_update_LoRaWANIsNull     = false;
            }
            System.String requestUpdate_update_LoRaWAN_loRaWAN_UpdateSignature = null;
            if (cmdletContext.LoRaWAN_UpdateSignature != null)
            {
                requestUpdate_update_LoRaWAN_loRaWAN_UpdateSignature = cmdletContext.LoRaWAN_UpdateSignature;
            }
            if (requestUpdate_update_LoRaWAN_loRaWAN_UpdateSignature != null)
            {
                requestUpdate_update_LoRaWAN.UpdateSignature = requestUpdate_update_LoRaWAN_loRaWAN_UpdateSignature;
                requestUpdate_update_LoRaWANIsNull           = false;
            }
            Amazon.IoTWireless.Model.LoRaWANGatewayVersion requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion = null;

            // populate CurrentVersion
            var requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersionIsNull = true;

            requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion = new Amazon.IoTWireless.Model.LoRaWANGatewayVersion();
            System.String requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion_currentVersion_Model = null;
            if (cmdletContext.CurrentVersion_Model != null)
            {
                requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion_currentVersion_Model = cmdletContext.CurrentVersion_Model;
            }
            if (requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion_currentVersion_Model != null)
            {
                requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion.Model = requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion_currentVersion_Model;
                requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersionIsNull = false;
            }
            System.String requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion_currentVersion_PackageVersion = null;
            if (cmdletContext.CurrentVersion_PackageVersion != null)
            {
                requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion_currentVersion_PackageVersion = cmdletContext.CurrentVersion_PackageVersion;
            }
            if (requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion_currentVersion_PackageVersion != null)
            {
                requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion.PackageVersion = requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion_currentVersion_PackageVersion;
                requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersionIsNull          = false;
            }
            System.String requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion_currentVersion_Station = null;
            if (cmdletContext.CurrentVersion_Station != null)
            {
                requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion_currentVersion_Station = cmdletContext.CurrentVersion_Station;
            }
            if (requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion_currentVersion_Station != null)
            {
                requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion.Station = requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion_currentVersion_Station;
                requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersionIsNull   = false;
            }
            // determine if requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion should be set to null
            if (requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersionIsNull)
            {
                requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion = null;
            }
            if (requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion != null)
            {
                requestUpdate_update_LoRaWAN.CurrentVersion = requestUpdate_update_LoRaWAN_update_LoRaWAN_CurrentVersion;
                requestUpdate_update_LoRaWANIsNull          = false;
            }
            Amazon.IoTWireless.Model.LoRaWANGatewayVersion requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion = null;

            // populate UpdateVersion
            var requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersionIsNull = true;

            requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion = new Amazon.IoTWireless.Model.LoRaWANGatewayVersion();
            System.String requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion_updateVersion_Model = null;
            if (cmdletContext.UpdateVersion_Model != null)
            {
                requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion_updateVersion_Model = cmdletContext.UpdateVersion_Model;
            }
            if (requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion_updateVersion_Model != null)
            {
                requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion.Model = requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion_updateVersion_Model;
                requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersionIsNull = false;
            }
            System.String requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion_updateVersion_PackageVersion = null;
            if (cmdletContext.UpdateVersion_PackageVersion != null)
            {
                requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion_updateVersion_PackageVersion = cmdletContext.UpdateVersion_PackageVersion;
            }
            if (requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion_updateVersion_PackageVersion != null)
            {
                requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion.PackageVersion = requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion_updateVersion_PackageVersion;
                requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersionIsNull          = false;
            }
            System.String requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion_updateVersion_Station = null;
            if (cmdletContext.UpdateVersion_Station != null)
            {
                requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion_updateVersion_Station = cmdletContext.UpdateVersion_Station;
            }
            if (requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion_updateVersion_Station != null)
            {
                requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion.Station = requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion_updateVersion_Station;
                requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersionIsNull   = false;
            }
            // determine if requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion should be set to null
            if (requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersionIsNull)
            {
                requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion = null;
            }
            if (requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion != null)
            {
                requestUpdate_update_LoRaWAN.UpdateVersion = requestUpdate_update_LoRaWAN_update_LoRaWAN_UpdateVersion;
                requestUpdate_update_LoRaWANIsNull         = false;
            }
            // determine if requestUpdate_update_LoRaWAN should be set to null
            if (requestUpdate_update_LoRaWANIsNull)
            {
                requestUpdate_update_LoRaWAN = null;
            }
            if (requestUpdate_update_LoRaWAN != null)
            {
                request.Update.LoRaWAN = requestUpdate_update_LoRaWAN;
                requestUpdateIsNull    = false;
            }
            // determine if request.Update should be set to null
            if (requestUpdateIsNull)
            {
                request.Update = 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);
        }