private Amazon.Panorama.Model.CreateJobForDevicesResponse CallAWSServiceOperation(IAmazonPanorama client, Amazon.Panorama.Model.CreateJobForDevicesRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Panorama", "CreateJobForDevices"); try { #if DESKTOP return(client.CreateJobForDevices(request)); #elif CORECLR return(client.CreateJobForDevicesAsync(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.Panorama.Model.CreateJobForDevicesRequest(); if (cmdletContext.DeviceId != null) { request.DeviceIds = cmdletContext.DeviceId; } // populate DeviceJobConfig var requestDeviceJobConfigIsNull = true; request.DeviceJobConfig = new Amazon.Panorama.Model.DeviceJobConfig(); Amazon.Panorama.Model.OTAJobConfig requestDeviceJobConfig_deviceJobConfig_OTAJobConfig = null; // populate OTAJobConfig var requestDeviceJobConfig_deviceJobConfig_OTAJobConfigIsNull = true; requestDeviceJobConfig_deviceJobConfig_OTAJobConfig = new Amazon.Panorama.Model.OTAJobConfig(); System.String requestDeviceJobConfig_deviceJobConfig_OTAJobConfig_oTAJobConfig_ImageVersion = null; if (cmdletContext.OTAJobConfig_ImageVersion != null) { requestDeviceJobConfig_deviceJobConfig_OTAJobConfig_oTAJobConfig_ImageVersion = cmdletContext.OTAJobConfig_ImageVersion; } if (requestDeviceJobConfig_deviceJobConfig_OTAJobConfig_oTAJobConfig_ImageVersion != null) { requestDeviceJobConfig_deviceJobConfig_OTAJobConfig.ImageVersion = requestDeviceJobConfig_deviceJobConfig_OTAJobConfig_oTAJobConfig_ImageVersion; requestDeviceJobConfig_deviceJobConfig_OTAJobConfigIsNull = false; } // determine if requestDeviceJobConfig_deviceJobConfig_OTAJobConfig should be set to null if (requestDeviceJobConfig_deviceJobConfig_OTAJobConfigIsNull) { requestDeviceJobConfig_deviceJobConfig_OTAJobConfig = null; } if (requestDeviceJobConfig_deviceJobConfig_OTAJobConfig != null) { request.DeviceJobConfig.OTAJobConfig = requestDeviceJobConfig_deviceJobConfig_OTAJobConfig; requestDeviceJobConfigIsNull = false; } // determine if request.DeviceJobConfig should be set to null if (requestDeviceJobConfigIsNull) { request.DeviceJobConfig = null; } if (cmdletContext.JobType != null) { request.JobType = cmdletContext.JobType; } 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); }