Esempio n. 1
0
 private Amazon.MediaLive.Model.UpdateMultiplexResponse CallAWSServiceOperation(IAmazonMediaLive client, Amazon.MediaLive.Model.UpdateMultiplexRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Elemental MediaLive", "UpdateMultiplex");
     try
     {
         #if DESKTOP
         return(client.UpdateMultiplex(request));
         #elif CORECLR
         return(client.UpdateMultiplexAsync(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;
     }
 }
Esempio n. 2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.MediaLive.Model.UpdateMultiplexRequest();

            if (cmdletContext.MultiplexId != null)
            {
                request.MultiplexId = cmdletContext.MultiplexId;
            }

            // populate MultiplexSettings
            var requestMultiplexSettingsIsNull = true;

            request.MultiplexSettings = new Amazon.MediaLive.Model.MultiplexSettings();
            System.Int32?requestMultiplexSettings_multiplexSettings_MaximumVideoBufferDelayMillisecond = null;
            if (cmdletContext.MultiplexSettings_MaximumVideoBufferDelayMillisecond != null)
            {
                requestMultiplexSettings_multiplexSettings_MaximumVideoBufferDelayMillisecond = cmdletContext.MultiplexSettings_MaximumVideoBufferDelayMillisecond.Value;
            }
            if (requestMultiplexSettings_multiplexSettings_MaximumVideoBufferDelayMillisecond != null)
            {
                request.MultiplexSettings.MaximumVideoBufferDelayMilliseconds = requestMultiplexSettings_multiplexSettings_MaximumVideoBufferDelayMillisecond.Value;
                requestMultiplexSettingsIsNull = false;
            }
            System.Int32?requestMultiplexSettings_multiplexSettings_TransportStreamBitrate = null;
            if (cmdletContext.MultiplexSettings_TransportStreamBitrate != null)
            {
                requestMultiplexSettings_multiplexSettings_TransportStreamBitrate = cmdletContext.MultiplexSettings_TransportStreamBitrate.Value;
            }
            if (requestMultiplexSettings_multiplexSettings_TransportStreamBitrate != null)
            {
                request.MultiplexSettings.TransportStreamBitrate = requestMultiplexSettings_multiplexSettings_TransportStreamBitrate.Value;
                requestMultiplexSettingsIsNull = false;
            }
            System.Int32?requestMultiplexSettings_multiplexSettings_TransportStreamId = null;
            if (cmdletContext.MultiplexSettings_TransportStreamId != null)
            {
                requestMultiplexSettings_multiplexSettings_TransportStreamId = cmdletContext.MultiplexSettings_TransportStreamId.Value;
            }
            if (requestMultiplexSettings_multiplexSettings_TransportStreamId != null)
            {
                request.MultiplexSettings.TransportStreamId = requestMultiplexSettings_multiplexSettings_TransportStreamId.Value;
                requestMultiplexSettingsIsNull = false;
            }
            System.Int32?requestMultiplexSettings_multiplexSettings_TransportStreamReservedBitrate = null;
            if (cmdletContext.MultiplexSettings_TransportStreamReservedBitrate != null)
            {
                requestMultiplexSettings_multiplexSettings_TransportStreamReservedBitrate = cmdletContext.MultiplexSettings_TransportStreamReservedBitrate.Value;
            }
            if (requestMultiplexSettings_multiplexSettings_TransportStreamReservedBitrate != null)
            {
                request.MultiplexSettings.TransportStreamReservedBitrate = requestMultiplexSettings_multiplexSettings_TransportStreamReservedBitrate.Value;
                requestMultiplexSettingsIsNull = false;
            }
            // determine if request.MultiplexSettings should be set to null
            if (requestMultiplexSettingsIsNull)
            {
                request.MultiplexSettings = 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);
        }