public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.MediaTailor.Model.CreateChannelRequest(); if (cmdletContext.ChannelName != null) { request.ChannelName = cmdletContext.ChannelName; } if (cmdletContext.Output != null) { request.Outputs = cmdletContext.Output; } if (cmdletContext.PlaybackMode != null) { request.PlaybackMode = cmdletContext.PlaybackMode; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } 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); }
private Amazon.MediaTailor.Model.CreateChannelResponse CallAWSServiceOperation(IAmazonMediaTailor client, Amazon.MediaTailor.Model.CreateChannelRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Elemental MediaTailor", "CreateChannel"); try { #if DESKTOP return(client.CreateChannel(request)); #elif CORECLR return(client.CreateChannelAsync(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.MediaTailor.Model.CreateChannelRequest(); if (cmdletContext.ChannelName != null) { request.ChannelName = cmdletContext.ChannelName; } // populate FillerSlate var requestFillerSlateIsNull = true; request.FillerSlate = new Amazon.MediaTailor.Model.SlateSource(); System.String requestFillerSlate_fillerSlate_SourceLocationName = null; if (cmdletContext.FillerSlate_SourceLocationName != null) { requestFillerSlate_fillerSlate_SourceLocationName = cmdletContext.FillerSlate_SourceLocationName; } if (requestFillerSlate_fillerSlate_SourceLocationName != null) { request.FillerSlate.SourceLocationName = requestFillerSlate_fillerSlate_SourceLocationName; requestFillerSlateIsNull = false; } System.String requestFillerSlate_fillerSlate_VodSourceName = null; if (cmdletContext.FillerSlate_VodSourceName != null) { requestFillerSlate_fillerSlate_VodSourceName = cmdletContext.FillerSlate_VodSourceName; } if (requestFillerSlate_fillerSlate_VodSourceName != null) { request.FillerSlate.VodSourceName = requestFillerSlate_fillerSlate_VodSourceName; requestFillerSlateIsNull = false; } // determine if request.FillerSlate should be set to null if (requestFillerSlateIsNull) { request.FillerSlate = null; } if (cmdletContext.Output != null) { request.Outputs = cmdletContext.Output; } if (cmdletContext.PlaybackMode != null) { request.PlaybackMode = cmdletContext.PlaybackMode; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } 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); }