示例#1
0
 private Amazon.KinesisVideo.Model.CreateSignalingChannelResponse CallAWSServiceOperation(IAmazonKinesisVideo client, Amazon.KinesisVideo.Model.CreateSignalingChannelRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Kinesis Video Streams", "CreateSignalingChannel");
     try
     {
         #if DESKTOP
         return(client.CreateSignalingChannel(request));
         #elif CORECLR
         return(client.CreateSignalingChannelAsync(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;
     }
 }
示例#2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.KinesisVideo.Model.CreateSignalingChannelRequest();

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

            // populate SingleMasterConfiguration
            var requestSingleMasterConfigurationIsNull = true;

            request.SingleMasterConfiguration = new Amazon.KinesisVideo.Model.SingleMasterConfiguration();
            System.Int32?requestSingleMasterConfiguration_singleMasterConfiguration_MessageTtlSecond = null;
            if (cmdletContext.SingleMasterConfiguration_MessageTtlSecond != null)
            {
                requestSingleMasterConfiguration_singleMasterConfiguration_MessageTtlSecond = cmdletContext.SingleMasterConfiguration_MessageTtlSecond.Value;
            }
            if (requestSingleMasterConfiguration_singleMasterConfiguration_MessageTtlSecond != null)
            {
                request.SingleMasterConfiguration.MessageTtlSeconds = requestSingleMasterConfiguration_singleMasterConfiguration_MessageTtlSecond.Value;
                requestSingleMasterConfigurationIsNull = false;
            }
            // determine if request.SingleMasterConfiguration should be set to null
            if (requestSingleMasterConfigurationIsNull)
            {
                request.SingleMasterConfiguration = null;
            }
            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);
        }