private Amazon.MediaLive.Model.UpdateChannelResponse CallAWSServiceOperation(IAmazonMediaLive client, Amazon.MediaLive.Model.UpdateChannelRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Elemental MediaLive", "UpdateChannel"); try { #if DESKTOP return(client.UpdateChannel(request)); #elif CORECLR return(client.UpdateChannelAsync(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.UpdateChannelRequest(); if (cmdletContext.ChannelId != null) { request.ChannelId = cmdletContext.ChannelId; } if (cmdletContext.Destination != null) { request.Destinations = cmdletContext.Destination; } if (cmdletContext.EncoderSetting != null) { request.EncoderSettings = cmdletContext.EncoderSetting; } if (cmdletContext.InputAttachment != null) { request.InputAttachments = cmdletContext.InputAttachment; } // populate InputSpecification var requestInputSpecificationIsNull = true; request.InputSpecification = new Amazon.MediaLive.Model.InputSpecification(); Amazon.MediaLive.InputCodec requestInputSpecification_inputSpecification_Codec = null; if (cmdletContext.InputSpecification_Codec != null) { requestInputSpecification_inputSpecification_Codec = cmdletContext.InputSpecification_Codec; } if (requestInputSpecification_inputSpecification_Codec != null) { request.InputSpecification.Codec = requestInputSpecification_inputSpecification_Codec; requestInputSpecificationIsNull = false; } Amazon.MediaLive.InputMaximumBitrate requestInputSpecification_inputSpecification_MaximumBitrate = null; if (cmdletContext.InputSpecification_MaximumBitrate != null) { requestInputSpecification_inputSpecification_MaximumBitrate = cmdletContext.InputSpecification_MaximumBitrate; } if (requestInputSpecification_inputSpecification_MaximumBitrate != null) { request.InputSpecification.MaximumBitrate = requestInputSpecification_inputSpecification_MaximumBitrate; requestInputSpecificationIsNull = false; } Amazon.MediaLive.InputResolution requestInputSpecification_inputSpecification_Resolution = null; if (cmdletContext.InputSpecification_Resolution != null) { requestInputSpecification_inputSpecification_Resolution = cmdletContext.InputSpecification_Resolution; } if (requestInputSpecification_inputSpecification_Resolution != null) { request.InputSpecification.Resolution = requestInputSpecification_inputSpecification_Resolution; requestInputSpecificationIsNull = false; } // determine if request.InputSpecification should be set to null if (requestInputSpecificationIsNull) { request.InputSpecification = null; } if (cmdletContext.LogLevel != null) { request.LogLevel = cmdletContext.LogLevel; } if (cmdletContext.Name != null) { request.Name = cmdletContext.Name; } if (cmdletContext.RoleArn != null) { request.RoleArn = cmdletContext.RoleArn; } 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); }