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

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

            // populate SingleMasterChannelEndpointConfiguration
            var requestSingleMasterChannelEndpointConfigurationIsNull = true;

            request.SingleMasterChannelEndpointConfiguration = new Amazon.KinesisVideo.Model.SingleMasterChannelEndpointConfiguration();
            List <System.String> requestSingleMasterChannelEndpointConfiguration_singleMasterChannelEndpointConfiguration_Protocol = null;

            if (cmdletContext.SingleMasterChannelEndpointConfiguration_Protocol != null)
            {
                requestSingleMasterChannelEndpointConfiguration_singleMasterChannelEndpointConfiguration_Protocol = cmdletContext.SingleMasterChannelEndpointConfiguration_Protocol;
            }
            if (requestSingleMasterChannelEndpointConfiguration_singleMasterChannelEndpointConfiguration_Protocol != null)
            {
                request.SingleMasterChannelEndpointConfiguration.Protocols = requestSingleMasterChannelEndpointConfiguration_singleMasterChannelEndpointConfiguration_Protocol;
                requestSingleMasterChannelEndpointConfigurationIsNull      = false;
            }
            Amazon.KinesisVideo.ChannelRole requestSingleMasterChannelEndpointConfiguration_singleMasterChannelEndpointConfiguration_Role = null;
            if (cmdletContext.SingleMasterChannelEndpointConfiguration_Role != null)
            {
                requestSingleMasterChannelEndpointConfiguration_singleMasterChannelEndpointConfiguration_Role = cmdletContext.SingleMasterChannelEndpointConfiguration_Role;
            }
            if (requestSingleMasterChannelEndpointConfiguration_singleMasterChannelEndpointConfiguration_Role != null)
            {
                request.SingleMasterChannelEndpointConfiguration.Role = requestSingleMasterChannelEndpointConfiguration_singleMasterChannelEndpointConfiguration_Role;
                requestSingleMasterChannelEndpointConfigurationIsNull = false;
            }
            // determine if request.SingleMasterChannelEndpointConfiguration should be set to null
            if (requestSingleMasterChannelEndpointConfigurationIsNull)
            {
                request.SingleMasterChannelEndpointConfiguration = null;
            }

            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);
        }