private Amazon.MediaLive.Model.UpdateInputDeviceResponse CallAWSServiceOperation(IAmazonMediaLive client, Amazon.MediaLive.Model.UpdateInputDeviceRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Elemental MediaLive", "UpdateInputDevice"); try { #if DESKTOP return(client.UpdateInputDevice(request)); #elif CORECLR return(client.UpdateInputDeviceAsync(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.MediaLive.Model.UpdateInputDeviceRequest(); // populate HdDeviceSettings var requestHdDeviceSettingsIsNull = true; request.HdDeviceSettings = new Amazon.MediaLive.Model.InputDeviceConfigurableSettings(); Amazon.MediaLive.InputDeviceConfiguredInput requestHdDeviceSettings_hdDeviceSettings_ConfiguredInput = null; if (cmdletContext.HdDeviceSettings_ConfiguredInput != null) { requestHdDeviceSettings_hdDeviceSettings_ConfiguredInput = cmdletContext.HdDeviceSettings_ConfiguredInput; } if (requestHdDeviceSettings_hdDeviceSettings_ConfiguredInput != null) { request.HdDeviceSettings.ConfiguredInput = requestHdDeviceSettings_hdDeviceSettings_ConfiguredInput; requestHdDeviceSettingsIsNull = false; } System.Int32?requestHdDeviceSettings_hdDeviceSettings_MaxBitrate = null; if (cmdletContext.HdDeviceSettings_MaxBitrate != null) { requestHdDeviceSettings_hdDeviceSettings_MaxBitrate = cmdletContext.HdDeviceSettings_MaxBitrate.Value; } if (requestHdDeviceSettings_hdDeviceSettings_MaxBitrate != null) { request.HdDeviceSettings.MaxBitrate = requestHdDeviceSettings_hdDeviceSettings_MaxBitrate.Value; requestHdDeviceSettingsIsNull = false; } // determine if request.HdDeviceSettings should be set to null if (requestHdDeviceSettingsIsNull) { request.HdDeviceSettings = null; } if (cmdletContext.InputDeviceId != null) { request.InputDeviceId = cmdletContext.InputDeviceId; } if (cmdletContext.Name != null) { request.Name = cmdletContext.Name; } // populate UhdDeviceSettings var requestUhdDeviceSettingsIsNull = true; request.UhdDeviceSettings = new Amazon.MediaLive.Model.InputDeviceConfigurableSettings(); Amazon.MediaLive.InputDeviceConfiguredInput requestUhdDeviceSettings_uhdDeviceSettings_ConfiguredInput = null; if (cmdletContext.UhdDeviceSettings_ConfiguredInput != null) { requestUhdDeviceSettings_uhdDeviceSettings_ConfiguredInput = cmdletContext.UhdDeviceSettings_ConfiguredInput; } if (requestUhdDeviceSettings_uhdDeviceSettings_ConfiguredInput != null) { request.UhdDeviceSettings.ConfiguredInput = requestUhdDeviceSettings_uhdDeviceSettings_ConfiguredInput; requestUhdDeviceSettingsIsNull = false; } System.Int32?requestUhdDeviceSettings_uhdDeviceSettings_MaxBitrate = null; if (cmdletContext.UhdDeviceSettings_MaxBitrate != null) { requestUhdDeviceSettings_uhdDeviceSettings_MaxBitrate = cmdletContext.UhdDeviceSettings_MaxBitrate.Value; } if (requestUhdDeviceSettings_uhdDeviceSettings_MaxBitrate != null) { request.UhdDeviceSettings.MaxBitrate = requestUhdDeviceSettings_uhdDeviceSettings_MaxBitrate.Value; requestUhdDeviceSettingsIsNull = false; } // determine if request.UhdDeviceSettings should be set to null if (requestUhdDeviceSettingsIsNull) { request.UhdDeviceSettings = 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); }