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

            if (cmdletContext.ClientRequestToken != null)
            {
                request.ClientRequestToken = cmdletContext.ClientRequestToken;
            }
            if (cmdletContext.Description != null)
            {
                request.Description = cmdletContext.Description;
            }
            if (cmdletContext.DestinationName != null)
            {
                request.DestinationName = cmdletContext.DestinationName;
            }

            // populate LoRaWAN
            var requestLoRaWANIsNull = true;

            request.LoRaWAN = new Amazon.IoTWireless.Model.LoRaWANDevice();
            System.String requestLoRaWAN_loRaWAN_DevEui = null;
            if (cmdletContext.LoRaWAN_DevEui != null)
            {
                requestLoRaWAN_loRaWAN_DevEui = cmdletContext.LoRaWAN_DevEui;
            }
            if (requestLoRaWAN_loRaWAN_DevEui != null)
            {
                request.LoRaWAN.DevEui = requestLoRaWAN_loRaWAN_DevEui;
                requestLoRaWANIsNull   = false;
            }
            System.String requestLoRaWAN_loRaWAN_DeviceProfileId = null;
            if (cmdletContext.LoRaWAN_DeviceProfileId != null)
            {
                requestLoRaWAN_loRaWAN_DeviceProfileId = cmdletContext.LoRaWAN_DeviceProfileId;
            }
            if (requestLoRaWAN_loRaWAN_DeviceProfileId != null)
            {
                request.LoRaWAN.DeviceProfileId = requestLoRaWAN_loRaWAN_DeviceProfileId;
                requestLoRaWANIsNull            = false;
            }
            System.String requestLoRaWAN_loRaWAN_ServiceProfileId = null;
            if (cmdletContext.LoRaWAN_ServiceProfileId != null)
            {
                requestLoRaWAN_loRaWAN_ServiceProfileId = cmdletContext.LoRaWAN_ServiceProfileId;
            }
            if (requestLoRaWAN_loRaWAN_ServiceProfileId != null)
            {
                request.LoRaWAN.ServiceProfileId = requestLoRaWAN_loRaWAN_ServiceProfileId;
                requestLoRaWANIsNull             = false;
            }
            Amazon.IoTWireless.Model.AbpV1_0_x requestLoRaWAN_loRaWAN_AbpV1_0_x = null;

            // populate AbpV1_0_x
            var requestLoRaWAN_loRaWAN_AbpV1_0_xIsNull = true;

            requestLoRaWAN_loRaWAN_AbpV1_0_x = new Amazon.IoTWireless.Model.AbpV1_0_x();
            System.String requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_DevAddr = null;
            if (cmdletContext.LoRaWAN_AbpV1_0_x_DevAddr != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_DevAddr = cmdletContext.LoRaWAN_AbpV1_0_x_DevAddr;
            }
            if (requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_DevAddr != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_0_x.DevAddr = requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_DevAddr;
                requestLoRaWAN_loRaWAN_AbpV1_0_xIsNull   = false;
            }
            Amazon.IoTWireless.Model.SessionKeysAbpV1_0_x requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeys = null;

            // populate SessionKeys
            var requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeysIsNull = true;

            requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeys = new Amazon.IoTWireless.Model.SessionKeysAbpV1_0_x();
            System.String requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeys_loRaWAN_AbpV1_0_x_SessionKeys_AppSKey = null;
            if (cmdletContext.LoRaWAN_AbpV1_0_x_SessionKeys_AppSKey != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeys_loRaWAN_AbpV1_0_x_SessionKeys_AppSKey = cmdletContext.LoRaWAN_AbpV1_0_x_SessionKeys_AppSKey;
            }
            if (requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeys_loRaWAN_AbpV1_0_x_SessionKeys_AppSKey != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeys.AppSKey = requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeys_loRaWAN_AbpV1_0_x_SessionKeys_AppSKey;
                requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeysIsNull   = false;
            }
            System.String requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeys_loRaWAN_AbpV1_0_x_SessionKeys_NwkSKey = null;
            if (cmdletContext.LoRaWAN_AbpV1_0_x_SessionKeys_NwkSKey != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeys_loRaWAN_AbpV1_0_x_SessionKeys_NwkSKey = cmdletContext.LoRaWAN_AbpV1_0_x_SessionKeys_NwkSKey;
            }
            if (requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeys_loRaWAN_AbpV1_0_x_SessionKeys_NwkSKey != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeys.NwkSKey = requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeys_loRaWAN_AbpV1_0_x_SessionKeys_NwkSKey;
                requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeysIsNull   = false;
            }
            // determine if requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeys should be set to null
            if (requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeysIsNull)
            {
                requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeys = null;
            }
            if (requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeys != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_0_x.SessionKeys = requestLoRaWAN_loRaWAN_AbpV1_0_x_loRaWAN_AbpV1_0_x_SessionKeys;
                requestLoRaWAN_loRaWAN_AbpV1_0_xIsNull       = false;
            }
            // determine if requestLoRaWAN_loRaWAN_AbpV1_0_x should be set to null
            if (requestLoRaWAN_loRaWAN_AbpV1_0_xIsNull)
            {
                requestLoRaWAN_loRaWAN_AbpV1_0_x = null;
            }
            if (requestLoRaWAN_loRaWAN_AbpV1_0_x != null)
            {
                request.LoRaWAN.AbpV1_0_x = requestLoRaWAN_loRaWAN_AbpV1_0_x;
                requestLoRaWANIsNull      = false;
            }
            Amazon.IoTWireless.Model.AbpV1_1 requestLoRaWAN_loRaWAN_AbpV1_1 = null;

            // populate AbpV1_1
            var requestLoRaWAN_loRaWAN_AbpV1_1IsNull = true;

            requestLoRaWAN_loRaWAN_AbpV1_1 = new Amazon.IoTWireless.Model.AbpV1_1();
            System.String requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_DevAddr = null;
            if (cmdletContext.LoRaWAN_AbpV1_1_DevAddr != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_DevAddr = cmdletContext.LoRaWAN_AbpV1_1_DevAddr;
            }
            if (requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_DevAddr != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_1.DevAddr = requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_DevAddr;
                requestLoRaWAN_loRaWAN_AbpV1_1IsNull   = false;
            }
            Amazon.IoTWireless.Model.SessionKeysAbpV1_1 requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys = null;

            // populate SessionKeys
            var requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeysIsNull = true;

            requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys = new Amazon.IoTWireless.Model.SessionKeysAbpV1_1();
            System.String requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys_loRaWAN_AbpV1_1_SessionKeys_AppSKey = null;
            if (cmdletContext.LoRaWAN_AbpV1_1_SessionKeys_AppSKey != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys_loRaWAN_AbpV1_1_SessionKeys_AppSKey = cmdletContext.LoRaWAN_AbpV1_1_SessionKeys_AppSKey;
            }
            if (requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys_loRaWAN_AbpV1_1_SessionKeys_AppSKey != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys.AppSKey = requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys_loRaWAN_AbpV1_1_SessionKeys_AppSKey;
                requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeysIsNull   = false;
            }
            System.String requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys_loRaWAN_AbpV1_1_SessionKeys_FNwkSIntKey = null;
            if (cmdletContext.LoRaWAN_AbpV1_1_SessionKeys_FNwkSIntKey != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys_loRaWAN_AbpV1_1_SessionKeys_FNwkSIntKey = cmdletContext.LoRaWAN_AbpV1_1_SessionKeys_FNwkSIntKey;
            }
            if (requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys_loRaWAN_AbpV1_1_SessionKeys_FNwkSIntKey != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys.FNwkSIntKey = requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys_loRaWAN_AbpV1_1_SessionKeys_FNwkSIntKey;
                requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeysIsNull       = false;
            }
            System.String requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys_loRaWAN_AbpV1_1_SessionKeys_NwkSEncKey = null;
            if (cmdletContext.LoRaWAN_AbpV1_1_SessionKeys_NwkSEncKey != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys_loRaWAN_AbpV1_1_SessionKeys_NwkSEncKey = cmdletContext.LoRaWAN_AbpV1_1_SessionKeys_NwkSEncKey;
            }
            if (requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys_loRaWAN_AbpV1_1_SessionKeys_NwkSEncKey != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys.NwkSEncKey = requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys_loRaWAN_AbpV1_1_SessionKeys_NwkSEncKey;
                requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeysIsNull      = false;
            }
            System.String requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys_loRaWAN_AbpV1_1_SessionKeys_SNwkSIntKey = null;
            if (cmdletContext.LoRaWAN_AbpV1_1_SessionKeys_SNwkSIntKey != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys_loRaWAN_AbpV1_1_SessionKeys_SNwkSIntKey = cmdletContext.LoRaWAN_AbpV1_1_SessionKeys_SNwkSIntKey;
            }
            if (requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys_loRaWAN_AbpV1_1_SessionKeys_SNwkSIntKey != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys.SNwkSIntKey = requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys_loRaWAN_AbpV1_1_SessionKeys_SNwkSIntKey;
                requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeysIsNull       = false;
            }
            // determine if requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys should be set to null
            if (requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeysIsNull)
            {
                requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys = null;
            }
            if (requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys != null)
            {
                requestLoRaWAN_loRaWAN_AbpV1_1.SessionKeys = requestLoRaWAN_loRaWAN_AbpV1_1_loRaWAN_AbpV1_1_SessionKeys;
                requestLoRaWAN_loRaWAN_AbpV1_1IsNull       = false;
            }
            // determine if requestLoRaWAN_loRaWAN_AbpV1_1 should be set to null
            if (requestLoRaWAN_loRaWAN_AbpV1_1IsNull)
            {
                requestLoRaWAN_loRaWAN_AbpV1_1 = null;
            }
            if (requestLoRaWAN_loRaWAN_AbpV1_1 != null)
            {
                request.LoRaWAN.AbpV1_1 = requestLoRaWAN_loRaWAN_AbpV1_1;
                requestLoRaWANIsNull    = false;
            }
            Amazon.IoTWireless.Model.OtaaV1_0_x requestLoRaWAN_loRaWAN_OtaaV1_0_x = null;

            // populate OtaaV1_0_x
            var requestLoRaWAN_loRaWAN_OtaaV1_0_xIsNull = true;

            requestLoRaWAN_loRaWAN_OtaaV1_0_x = new Amazon.IoTWireless.Model.OtaaV1_0_x();
            System.String requestLoRaWAN_loRaWAN_OtaaV1_0_x_loRaWAN_OtaaV1_0_x_AppEui = null;
            if (cmdletContext.LoRaWAN_OtaaV1_0_x_AppEui != null)
            {
                requestLoRaWAN_loRaWAN_OtaaV1_0_x_loRaWAN_OtaaV1_0_x_AppEui = cmdletContext.LoRaWAN_OtaaV1_0_x_AppEui;
            }
            if (requestLoRaWAN_loRaWAN_OtaaV1_0_x_loRaWAN_OtaaV1_0_x_AppEui != null)
            {
                requestLoRaWAN_loRaWAN_OtaaV1_0_x.AppEui = requestLoRaWAN_loRaWAN_OtaaV1_0_x_loRaWAN_OtaaV1_0_x_AppEui;
                requestLoRaWAN_loRaWAN_OtaaV1_0_xIsNull  = false;
            }
            System.String requestLoRaWAN_loRaWAN_OtaaV1_0_x_loRaWAN_OtaaV1_0_x_AppKey = null;
            if (cmdletContext.LoRaWAN_OtaaV1_0_x_AppKey != null)
            {
                requestLoRaWAN_loRaWAN_OtaaV1_0_x_loRaWAN_OtaaV1_0_x_AppKey = cmdletContext.LoRaWAN_OtaaV1_0_x_AppKey;
            }
            if (requestLoRaWAN_loRaWAN_OtaaV1_0_x_loRaWAN_OtaaV1_0_x_AppKey != null)
            {
                requestLoRaWAN_loRaWAN_OtaaV1_0_x.AppKey = requestLoRaWAN_loRaWAN_OtaaV1_0_x_loRaWAN_OtaaV1_0_x_AppKey;
                requestLoRaWAN_loRaWAN_OtaaV1_0_xIsNull  = false;
            }
            // determine if requestLoRaWAN_loRaWAN_OtaaV1_0_x should be set to null
            if (requestLoRaWAN_loRaWAN_OtaaV1_0_xIsNull)
            {
                requestLoRaWAN_loRaWAN_OtaaV1_0_x = null;
            }
            if (requestLoRaWAN_loRaWAN_OtaaV1_0_x != null)
            {
                request.LoRaWAN.OtaaV1_0_x = requestLoRaWAN_loRaWAN_OtaaV1_0_x;
                requestLoRaWANIsNull       = false;
            }
            Amazon.IoTWireless.Model.OtaaV1_1 requestLoRaWAN_loRaWAN_OtaaV1_1 = null;

            // populate OtaaV1_1
            var requestLoRaWAN_loRaWAN_OtaaV1_1IsNull = true;

            requestLoRaWAN_loRaWAN_OtaaV1_1 = new Amazon.IoTWireless.Model.OtaaV1_1();
            System.String requestLoRaWAN_loRaWAN_OtaaV1_1_loRaWAN_OtaaV1_1_AppKey = null;
            if (cmdletContext.LoRaWAN_OtaaV1_1_AppKey != null)
            {
                requestLoRaWAN_loRaWAN_OtaaV1_1_loRaWAN_OtaaV1_1_AppKey = cmdletContext.LoRaWAN_OtaaV1_1_AppKey;
            }
            if (requestLoRaWAN_loRaWAN_OtaaV1_1_loRaWAN_OtaaV1_1_AppKey != null)
            {
                requestLoRaWAN_loRaWAN_OtaaV1_1.AppKey = requestLoRaWAN_loRaWAN_OtaaV1_1_loRaWAN_OtaaV1_1_AppKey;
                requestLoRaWAN_loRaWAN_OtaaV1_1IsNull  = false;
            }
            System.String requestLoRaWAN_loRaWAN_OtaaV1_1_loRaWAN_OtaaV1_1_JoinEui = null;
            if (cmdletContext.LoRaWAN_OtaaV1_1_JoinEui != null)
            {
                requestLoRaWAN_loRaWAN_OtaaV1_1_loRaWAN_OtaaV1_1_JoinEui = cmdletContext.LoRaWAN_OtaaV1_1_JoinEui;
            }
            if (requestLoRaWAN_loRaWAN_OtaaV1_1_loRaWAN_OtaaV1_1_JoinEui != null)
            {
                requestLoRaWAN_loRaWAN_OtaaV1_1.JoinEui = requestLoRaWAN_loRaWAN_OtaaV1_1_loRaWAN_OtaaV1_1_JoinEui;
                requestLoRaWAN_loRaWAN_OtaaV1_1IsNull   = false;
            }
            System.String requestLoRaWAN_loRaWAN_OtaaV1_1_loRaWAN_OtaaV1_1_NwkKey = null;
            if (cmdletContext.LoRaWAN_OtaaV1_1_NwkKey != null)
            {
                requestLoRaWAN_loRaWAN_OtaaV1_1_loRaWAN_OtaaV1_1_NwkKey = cmdletContext.LoRaWAN_OtaaV1_1_NwkKey;
            }
            if (requestLoRaWAN_loRaWAN_OtaaV1_1_loRaWAN_OtaaV1_1_NwkKey != null)
            {
                requestLoRaWAN_loRaWAN_OtaaV1_1.NwkKey = requestLoRaWAN_loRaWAN_OtaaV1_1_loRaWAN_OtaaV1_1_NwkKey;
                requestLoRaWAN_loRaWAN_OtaaV1_1IsNull  = false;
            }
            // determine if requestLoRaWAN_loRaWAN_OtaaV1_1 should be set to null
            if (requestLoRaWAN_loRaWAN_OtaaV1_1IsNull)
            {
                requestLoRaWAN_loRaWAN_OtaaV1_1 = null;
            }
            if (requestLoRaWAN_loRaWAN_OtaaV1_1 != null)
            {
                request.LoRaWAN.OtaaV1_1 = requestLoRaWAN_loRaWAN_OtaaV1_1;
                requestLoRaWANIsNull     = false;
            }
            // determine if request.LoRaWAN should be set to null
            if (requestLoRaWANIsNull)
            {
                request.LoRaWAN = null;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.Type != null)
            {
                request.Type = cmdletContext.Type;
            }

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