private Amazon.TranscribeService.Model.StartCallAnalyticsJobResponse CallAWSServiceOperation(IAmazonTranscribeService client, Amazon.TranscribeService.Model.StartCallAnalyticsJobRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Transcribe Service", "StartCallAnalyticsJob");
     try
     {
         #if DESKTOP
         return(client.StartCallAnalyticsJob(request));
         #elif CORECLR
         return(client.StartCallAnalyticsJobAsync(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.TranscribeService.Model.StartCallAnalyticsJobRequest();

            if (cmdletContext.CallAnalyticsJobName != null)
            {
                request.CallAnalyticsJobName = cmdletContext.CallAnalyticsJobName;
            }
            if (cmdletContext.ChannelDefinition != null)
            {
                request.ChannelDefinitions = cmdletContext.ChannelDefinition;
            }
            if (cmdletContext.DataAccessRoleArn != null)
            {
                request.DataAccessRoleArn = cmdletContext.DataAccessRoleArn;
            }

            // populate Media
            var requestMediaIsNull = true;

            request.Media = new Amazon.TranscribeService.Model.Media();
            System.String requestMedia_media_MediaFileUri = null;
            if (cmdletContext.Media_MediaFileUri != null)
            {
                requestMedia_media_MediaFileUri = cmdletContext.Media_MediaFileUri;
            }
            if (requestMedia_media_MediaFileUri != null)
            {
                request.Media.MediaFileUri = requestMedia_media_MediaFileUri;
                requestMediaIsNull         = false;
            }
            System.String requestMedia_media_RedactedMediaFileUri = null;
            if (cmdletContext.Media_RedactedMediaFileUri != null)
            {
                requestMedia_media_RedactedMediaFileUri = cmdletContext.Media_RedactedMediaFileUri;
            }
            if (requestMedia_media_RedactedMediaFileUri != null)
            {
                request.Media.RedactedMediaFileUri = requestMedia_media_RedactedMediaFileUri;
                requestMediaIsNull = false;
            }
            // determine if request.Media should be set to null
            if (requestMediaIsNull)
            {
                request.Media = null;
            }
            if (cmdletContext.OutputEncryptionKMSKeyId != null)
            {
                request.OutputEncryptionKMSKeyId = cmdletContext.OutputEncryptionKMSKeyId;
            }
            if (cmdletContext.OutputLocation != null)
            {
                request.OutputLocation = cmdletContext.OutputLocation;
            }

            // populate Settings
            var requestSettingsIsNull = true;

            request.Settings = new Amazon.TranscribeService.Model.CallAnalyticsJobSettings();
            Dictionary <System.String, Amazon.TranscribeService.Model.LanguageIdSettings> requestSettings_settings_LanguageIdSetting = null;

            if (cmdletContext.Settings_LanguageIdSetting != null)
            {
                requestSettings_settings_LanguageIdSetting = cmdletContext.Settings_LanguageIdSetting;
            }
            if (requestSettings_settings_LanguageIdSetting != null)
            {
                request.Settings.LanguageIdSettings = requestSettings_settings_LanguageIdSetting;
                requestSettingsIsNull = false;
            }
            System.String requestSettings_settings_LanguageModelName = null;
            if (cmdletContext.Settings_LanguageModelName != null)
            {
                requestSettings_settings_LanguageModelName = cmdletContext.Settings_LanguageModelName;
            }
            if (requestSettings_settings_LanguageModelName != null)
            {
                request.Settings.LanguageModelName = requestSettings_settings_LanguageModelName;
                requestSettingsIsNull = false;
            }
            List <System.String> requestSettings_settings_LanguageOption = null;

            if (cmdletContext.Settings_LanguageOption != null)
            {
                requestSettings_settings_LanguageOption = cmdletContext.Settings_LanguageOption;
            }
            if (requestSettings_settings_LanguageOption != null)
            {
                request.Settings.LanguageOptions = requestSettings_settings_LanguageOption;
                requestSettingsIsNull            = false;
            }
            Amazon.TranscribeService.VocabularyFilterMethod requestSettings_settings_VocabularyFilterMethod = null;
            if (cmdletContext.Settings_VocabularyFilterMethod != null)
            {
                requestSettings_settings_VocabularyFilterMethod = cmdletContext.Settings_VocabularyFilterMethod;
            }
            if (requestSettings_settings_VocabularyFilterMethod != null)
            {
                request.Settings.VocabularyFilterMethod = requestSettings_settings_VocabularyFilterMethod;
                requestSettingsIsNull = false;
            }
            System.String requestSettings_settings_VocabularyFilterName = null;
            if (cmdletContext.Settings_VocabularyFilterName != null)
            {
                requestSettings_settings_VocabularyFilterName = cmdletContext.Settings_VocabularyFilterName;
            }
            if (requestSettings_settings_VocabularyFilterName != null)
            {
                request.Settings.VocabularyFilterName = requestSettings_settings_VocabularyFilterName;
                requestSettingsIsNull = false;
            }
            System.String requestSettings_settings_VocabularyName = null;
            if (cmdletContext.Settings_VocabularyName != null)
            {
                requestSettings_settings_VocabularyName = cmdletContext.Settings_VocabularyName;
            }
            if (requestSettings_settings_VocabularyName != null)
            {
                request.Settings.VocabularyName = requestSettings_settings_VocabularyName;
                requestSettingsIsNull           = false;
            }
            Amazon.TranscribeService.Model.ContentRedaction requestSettings_settings_ContentRedaction = null;

            // populate ContentRedaction
            var requestSettings_settings_ContentRedactionIsNull = true;

            requestSettings_settings_ContentRedaction = new Amazon.TranscribeService.Model.ContentRedaction();
            Amazon.TranscribeService.RedactionOutput requestSettings_settings_ContentRedaction_contentRedaction_RedactionOutput = null;
            if (cmdletContext.ContentRedaction_RedactionOutput != null)
            {
                requestSettings_settings_ContentRedaction_contentRedaction_RedactionOutput = cmdletContext.ContentRedaction_RedactionOutput;
            }
            if (requestSettings_settings_ContentRedaction_contentRedaction_RedactionOutput != null)
            {
                requestSettings_settings_ContentRedaction.RedactionOutput = requestSettings_settings_ContentRedaction_contentRedaction_RedactionOutput;
                requestSettings_settings_ContentRedactionIsNull           = false;
            }
            Amazon.TranscribeService.RedactionType requestSettings_settings_ContentRedaction_contentRedaction_RedactionType = null;
            if (cmdletContext.ContentRedaction_RedactionType != null)
            {
                requestSettings_settings_ContentRedaction_contentRedaction_RedactionType = cmdletContext.ContentRedaction_RedactionType;
            }
            if (requestSettings_settings_ContentRedaction_contentRedaction_RedactionType != null)
            {
                requestSettings_settings_ContentRedaction.RedactionType = requestSettings_settings_ContentRedaction_contentRedaction_RedactionType;
                requestSettings_settings_ContentRedactionIsNull         = false;
            }
            // determine if requestSettings_settings_ContentRedaction should be set to null
            if (requestSettings_settings_ContentRedactionIsNull)
            {
                requestSettings_settings_ContentRedaction = null;
            }
            if (requestSettings_settings_ContentRedaction != null)
            {
                request.Settings.ContentRedaction = requestSettings_settings_ContentRedaction;
                requestSettingsIsNull             = false;
            }
            // determine if request.Settings should be set to null
            if (requestSettingsIsNull)
            {
                request.Settings = 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);
        }