Пример #1
0
 private Amazon.Chime.Model.PutVoiceConnectorStreamingConfigurationResponse CallAWSServiceOperation(IAmazonChime client, Amazon.Chime.Model.PutVoiceConnectorStreamingConfigurationRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Chime", "PutVoiceConnectorStreamingConfiguration");
     try
     {
         #if DESKTOP
         return(client.PutVoiceConnectorStreamingConfiguration(request));
         #elif CORECLR
         return(client.PutVoiceConnectorStreamingConfigurationAsync(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.Chime.Model.PutVoiceConnectorStreamingConfigurationRequest();


            // populate StreamingConfiguration
            var requestStreamingConfigurationIsNull = true;

            request.StreamingConfiguration = new Amazon.Chime.Model.StreamingConfiguration();
            System.Int32?requestStreamingConfiguration_streamingConfiguration_DataRetentionInHour = null;
            if (cmdletContext.StreamingConfiguration_DataRetentionInHour != null)
            {
                requestStreamingConfiguration_streamingConfiguration_DataRetentionInHour = cmdletContext.StreamingConfiguration_DataRetentionInHour.Value;
            }
            if (requestStreamingConfiguration_streamingConfiguration_DataRetentionInHour != null)
            {
                request.StreamingConfiguration.DataRetentionInHours = requestStreamingConfiguration_streamingConfiguration_DataRetentionInHour.Value;
                requestStreamingConfigurationIsNull = false;
            }
            System.Boolean?requestStreamingConfiguration_streamingConfiguration_Disabled = null;
            if (cmdletContext.StreamingConfiguration_Disabled != null)
            {
                requestStreamingConfiguration_streamingConfiguration_Disabled = cmdletContext.StreamingConfiguration_Disabled.Value;
            }
            if (requestStreamingConfiguration_streamingConfiguration_Disabled != null)
            {
                request.StreamingConfiguration.Disabled = requestStreamingConfiguration_streamingConfiguration_Disabled.Value;
                requestStreamingConfigurationIsNull     = false;
            }
            // determine if request.StreamingConfiguration should be set to null
            if (requestStreamingConfigurationIsNull)
            {
                request.StreamingConfiguration = null;
            }
            if (cmdletContext.VoiceConnectorId != null)
            {
                request.VoiceConnectorId = cmdletContext.VoiceConnectorId;
            }

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