private Amazon.IoTWireless.Model.UpdateWirelessDeviceResponse CallAWSServiceOperation(IAmazonIoTWireless client, Amazon.IoTWireless.Model.UpdateWirelessDeviceRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS IoT Wireless", "UpdateWirelessDevice"); try { #if DESKTOP return(client.UpdateWirelessDevice(request)); #elif CORECLR return(client.UpdateWirelessDeviceAsync(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.UpdateWirelessDeviceRequest(); if (cmdletContext.Description != null) { request.Description = cmdletContext.Description; } if (cmdletContext.DestinationName != null) { request.DestinationName = cmdletContext.DestinationName; } if (cmdletContext.Id != null) { request.Id = cmdletContext.Id; } // populate LoRaWAN var requestLoRaWANIsNull = true; request.LoRaWAN = new Amazon.IoTWireless.Model.LoRaWANUpdateDevice(); 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; } // determine if request.LoRaWAN should be set to null if (requestLoRaWANIsNull) { request.LoRaWAN = null; } if (cmdletContext.Name != null) { request.Name = cmdletContext.Name; } 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); }