private Amazon.MediaLive.Model.UpdateMultiplexProgramResponse CallAWSServiceOperation(IAmazonMediaLive client, Amazon.MediaLive.Model.UpdateMultiplexProgramRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Elemental MediaLive", "UpdateMultiplexProgram"); try { #if DESKTOP return(client.UpdateMultiplexProgram(request)); #elif CORECLR return(client.UpdateMultiplexProgramAsync(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.UpdateMultiplexProgramRequest(); if (cmdletContext.MultiplexId != null) { request.MultiplexId = cmdletContext.MultiplexId; } // populate MultiplexProgramSettings var requestMultiplexProgramSettingsIsNull = true; request.MultiplexProgramSettings = new Amazon.MediaLive.Model.MultiplexProgramSettings(); Amazon.MediaLive.PreferredChannelPipeline requestMultiplexProgramSettings_multiplexProgramSettings_PreferredChannelPipeline = null; if (cmdletContext.MultiplexProgramSettings_PreferredChannelPipeline != null) { requestMultiplexProgramSettings_multiplexProgramSettings_PreferredChannelPipeline = cmdletContext.MultiplexProgramSettings_PreferredChannelPipeline; } if (requestMultiplexProgramSettings_multiplexProgramSettings_PreferredChannelPipeline != null) { request.MultiplexProgramSettings.PreferredChannelPipeline = requestMultiplexProgramSettings_multiplexProgramSettings_PreferredChannelPipeline; requestMultiplexProgramSettingsIsNull = false; } System.Int32?requestMultiplexProgramSettings_multiplexProgramSettings_ProgramNumber = null; if (cmdletContext.MultiplexProgramSettings_ProgramNumber != null) { requestMultiplexProgramSettings_multiplexProgramSettings_ProgramNumber = cmdletContext.MultiplexProgramSettings_ProgramNumber.Value; } if (requestMultiplexProgramSettings_multiplexProgramSettings_ProgramNumber != null) { request.MultiplexProgramSettings.ProgramNumber = requestMultiplexProgramSettings_multiplexProgramSettings_ProgramNumber.Value; requestMultiplexProgramSettingsIsNull = false; } Amazon.MediaLive.Model.MultiplexProgramServiceDescriptor requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptor = null; // populate ServiceDescriptor var requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptorIsNull = true; requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptor = new Amazon.MediaLive.Model.MultiplexProgramServiceDescriptor(); System.String requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptor_serviceDescriptor_ProviderName = null; if (cmdletContext.ServiceDescriptor_ProviderName != null) { requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptor_serviceDescriptor_ProviderName = cmdletContext.ServiceDescriptor_ProviderName; } if (requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptor_serviceDescriptor_ProviderName != null) { requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptor.ProviderName = requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptor_serviceDescriptor_ProviderName; requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptorIsNull = false; } System.String requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptor_serviceDescriptor_ServiceName = null; if (cmdletContext.ServiceDescriptor_ServiceName != null) { requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptor_serviceDescriptor_ServiceName = cmdletContext.ServiceDescriptor_ServiceName; } if (requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptor_serviceDescriptor_ServiceName != null) { requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptor.ServiceName = requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptor_serviceDescriptor_ServiceName; requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptorIsNull = false; } // determine if requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptor should be set to null if (requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptorIsNull) { requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptor = null; } if (requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptor != null) { request.MultiplexProgramSettings.ServiceDescriptor = requestMultiplexProgramSettings_multiplexProgramSettings_ServiceDescriptor; requestMultiplexProgramSettingsIsNull = false; } Amazon.MediaLive.Model.MultiplexVideoSettings requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings = null; // populate VideoSettings var requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettingsIsNull = true; requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings = new Amazon.MediaLive.Model.MultiplexVideoSettings(); System.Int32?requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_videoSettings_ConstantBitrate = null; if (cmdletContext.VideoSettings_ConstantBitrate != null) { requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_videoSettings_ConstantBitrate = cmdletContext.VideoSettings_ConstantBitrate.Value; } if (requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_videoSettings_ConstantBitrate != null) { requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings.ConstantBitrate = requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_videoSettings_ConstantBitrate.Value; requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettingsIsNull = false; } Amazon.MediaLive.Model.MultiplexStatmuxVideoSettings requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings = null; // populate StatmuxSettings var requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettingsIsNull = true; requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings = new Amazon.MediaLive.Model.MultiplexStatmuxVideoSettings(); System.Int32?requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings_statmuxSettings_MaximumBitrate = null; if (cmdletContext.StatmuxSettings_MaximumBitrate != null) { requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings_statmuxSettings_MaximumBitrate = cmdletContext.StatmuxSettings_MaximumBitrate.Value; } if (requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings_statmuxSettings_MaximumBitrate != null) { requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings.MaximumBitrate = requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings_statmuxSettings_MaximumBitrate.Value; requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettingsIsNull = false; } System.Int32?requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings_statmuxSettings_MinimumBitrate = null; if (cmdletContext.StatmuxSettings_MinimumBitrate != null) { requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings_statmuxSettings_MinimumBitrate = cmdletContext.StatmuxSettings_MinimumBitrate.Value; } if (requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings_statmuxSettings_MinimumBitrate != null) { requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings.MinimumBitrate = requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings_statmuxSettings_MinimumBitrate.Value; requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettingsIsNull = false; } System.Int32?requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings_statmuxSettings_Priority = null; if (cmdletContext.StatmuxSettings_Priority != null) { requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings_statmuxSettings_Priority = cmdletContext.StatmuxSettings_Priority.Value; } if (requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings_statmuxSettings_Priority != null) { requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings.Priority = requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings_statmuxSettings_Priority.Value; requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettingsIsNull = false; } // determine if requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings should be set to null if (requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettingsIsNull) { requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings = null; } if (requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings != null) { requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings.StatmuxSettings = requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings_multiplexProgramSettings_VideoSettings_StatmuxSettings; requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettingsIsNull = false; } // determine if requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings should be set to null if (requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettingsIsNull) { requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings = null; } if (requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings != null) { request.MultiplexProgramSettings.VideoSettings = requestMultiplexProgramSettings_multiplexProgramSettings_VideoSettings; requestMultiplexProgramSettingsIsNull = false; } // determine if request.MultiplexProgramSettings should be set to null if (requestMultiplexProgramSettingsIsNull) { request.MultiplexProgramSettings = null; } if (cmdletContext.ProgramName != null) { request.ProgramName = cmdletContext.ProgramName; } 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); }