private Amazon.MediaConnect.Model.UpdateFlowSourceResponse CallAWSServiceOperation(IAmazonMediaConnect client, Amazon.MediaConnect.Model.UpdateFlowSourceRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Elemental MediaConnect", "UpdateFlowSource"); try { #if DESKTOP return(client.UpdateFlowSource(request)); #elif CORECLR return(client.UpdateFlowSourceAsync(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.MediaConnect.Model.UpdateFlowSourceRequest(); if (cmdletContext.Decryption != null) { request.Decryption = cmdletContext.Decryption; } if (cmdletContext.Description != null) { request.Description = cmdletContext.Description; } if (cmdletContext.EntitlementArn != null) { request.EntitlementArn = cmdletContext.EntitlementArn; } if (cmdletContext.FlowArn != null) { request.FlowArn = cmdletContext.FlowArn; } if (cmdletContext.IngestPort != null) { request.IngestPort = cmdletContext.IngestPort.Value; } if (cmdletContext.MaxBitrate != null) { request.MaxBitrate = cmdletContext.MaxBitrate.Value; } if (cmdletContext.MaxLatency != null) { request.MaxLatency = cmdletContext.MaxLatency.Value; } if (cmdletContext.MinLatency != null) { request.MinLatency = cmdletContext.MinLatency.Value; } if (cmdletContext.Protocol != null) { request.Protocol = cmdletContext.Protocol; } if (cmdletContext.SourceArn != null) { request.SourceArn = cmdletContext.SourceArn; } if (cmdletContext.StreamId != null) { request.StreamId = cmdletContext.StreamId; } if (cmdletContext.VpcInterfaceName != null) { request.VpcInterfaceName = cmdletContext.VpcInterfaceName; } if (cmdletContext.WhitelistCidr != null) { request.WhitelistCidr = cmdletContext.WhitelistCidr; } 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); }