/******************************************************************************* * Copyright 2012-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"). You may not use * this file except in compliance with the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * ***************************************************************************** * * AWS Tools for Windows (TM) PowerShell (TM) * */ using System; using System.Collections.Generic; using System.Linq; using System.Management.Automation; using System.Text; using Amazon.PowerShell.Common; using Amazon.Runtime; using Amazon.TranscribeService; using Amazon.TranscribeService.Model; namespace Amazon.PowerShell.Cmdlets.TRS { /// /// Transcribes the audio from a media file and applies any additional Request Parameters /// you choose to include in your request. /// /// /// /// To make a StartTranscriptionJob request, you must first upload your media /// file into an Amazon S3 bucket; you can then specify the Amazon S3 location of the /// file using the Media parameter. /// /// You must include the following parameters in your StartTranscriptionJob /// request: /// /// [Cmdlet("Start", "TRSTranscriptionJob", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)] [OutputType("Amazon.TranscribeService.Model.TranscriptionJob")] [AWSCmdlet("Calls the Amazon Transcribe Service StartTranscriptionJob API operation.", Operation = new[] {"StartTranscriptionJob"}, SelectReturnType = typeof(Amazon.TranscribeService.Model.StartTranscriptionJobResponse))] [AWSCmdletOutput("Amazon.TranscribeService.Model.TranscriptionJob or Amazon.TranscribeService.Model.StartTranscriptionJobResponse", "This cmdlet returns an Amazon.TranscribeService.Model.TranscriptionJob object.", "The service call response (type Amazon.TranscribeService.Model.StartTranscriptionJobResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack." )] public partial class StartTRSTranscriptionJobCmdlet : AmazonTranscribeServiceClientCmdlet, IExecutor { #region Parameter JobExecutionSettings_AllowDeferredExecution /// /// /// Makes it possible to enable job queuing when your concurrent request limit is exceeded. /// When AllowDeferredExecution is set to true, transcription /// job requests are placed in a queue until the number of jobs falls below the concurrent /// request limit. If AllowDeferredExecution is set to false /// and the number of transcription job requests exceed the concurrent request limit, /// you get a LimitExceededException error.If you include AllowDeferredExecution in your request, you must also /// include DataAccessRoleArn. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? JobExecutionSettings_AllowDeferredExecution { get; set; } #endregion #region Parameter Settings_ChannelIdentification /// /// /// Enables channel identification in multi-channel audio.Channel identification transcribes the audio on each channel independently, then appends /// the output for each channel into one transcript.You can't include both ShowSpeakerLabels and ChannelIdentification /// in the same request. Including both parameters returns a BadRequestException.For more information, see Transcribing /// multi-channel audio. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? Settings_ChannelIdentification { get; set; } #endregion #region Parameter JobExecutionSettings_DataAccessRoleArn /// /// /// The Amazon Resource Name (ARN) of an IAM role that has permissions to access the Amazon /// S3 bucket that contains your input files. If the role that you specify doesn’t have /// the appropriate permissions to access the specified Amazon S3 location, your request /// fails.IAM role ARNs have the format arn:partition:iam::account:role/role-name-with-path. /// For example: arn:aws:iam::111122223333:role/Admin. For more information, /// see IAM /// ARNs.Note that if you include DataAccessRoleArn in your request, you must /// also include AllowDeferredExecution. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String JobExecutionSettings_DataAccessRoleArn { get; set; } #endregion #region Parameter Subtitles_Format /// /// /// Specify the output format for your subtitle file; if you select both WebVTT (vtt) /// and SubRip (srt) formats, two output files are generated. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Subtitles_Formats")] public System.String[] Subtitles_Format { get; set; } #endregion #region Parameter IdentifyLanguage /// /// /// Enables automatic language identification in your transcription job request. Use this /// parameter if your media file contains only one language. If your media contains multiple /// languages, use IdentifyMultipleLanguages instead.If you include IdentifyLanguage, you can optionally include a list of /// language codes, using LanguageOptions, that you think may be present /// in your media file. Including LanguageOptions restricts IdentifyLanguage /// to only the language options that you specify, which can improve transcription accuracy.If you want to apply a custom language model, a custom vocabulary, or a custom vocabulary /// filter to your automatic language identification request, include LanguageIdSettings /// with the relevant sub-parameters (VocabularyName, LanguageModelName, /// and VocabularyFilterName). If you include LanguageIdSettings, /// also include LanguageOptions.Note that you must include one of LanguageCode, IdentifyLanguage, /// or IdentifyMultipleLanguages in your request. If you include more than /// one of these parameters, your transcription job fails. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Boolean? IdentifyLanguage { get; set; } #endregion #region Parameter IdentifyMultipleLanguage /// /// /// Enables automatic multi-language identification in your transcription job request. /// Use this parameter if your media file contains more than one language. If your media /// contains only one language, use IdentifyLanguage instead.If you include IdentifyMultipleLanguages, you can optionally include /// a list of language codes, using LanguageOptions, that you think may be /// present in your media file. Including LanguageOptions restricts IdentifyLanguage /// to only the language options that you specify, which can improve transcription accuracy.If you want to apply a custom vocabulary or a custom vocabulary filter to your automatic /// language identification request, include LanguageIdSettings with the /// relevant sub-parameters (VocabularyName and VocabularyFilterName). /// If you include LanguageIdSettings, also include LanguageOptions.Note that you must include one of LanguageCode, IdentifyLanguage, /// or IdentifyMultipleLanguages in your request. If you include more than /// one of these parameters, your transcription job fails. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("IdentifyMultipleLanguages")] public System.Boolean? IdentifyMultipleLanguage { get; set; } #endregion #region Parameter KMSEncryptionContext /// /// /// A map of plain text, non-secret key:value pairs, known as encryption context pairs, /// that provide an added layer of security for your data. For more information, see KMS /// encryption context and Asymmetric /// keys in KMS. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Collections.Hashtable KMSEncryptionContext { get; set; } #endregion #region Parameter LanguageCode /// /// /// The language code that represents the language spoken in the input media file.If you're unsure of the language spoken in your media file, consider using IdentifyLanguage /// or IdentifyMultipleLanguages to enable automatic language identification.Note that you must include one of LanguageCode, IdentifyLanguage, /// or IdentifyMultipleLanguages in your request. If you include more than /// one of these parameters, your transcription job fails.For a list of supported languages and their associated language codes, refer to the /// Supported /// languages table.To transcribe speech in Modern Standard Arabic (ar-SA), your media file /// must be encoded at a sample rate of 16,000 Hz or higher. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [AWSConstantClassSource("Amazon.TranscribeService.LanguageCode")] public Amazon.TranscribeService.LanguageCode LanguageCode { get; set; } #endregion #region Parameter LanguageIdSetting /// /// /// If using automatic language identification in your request and you want to apply a /// custom language model, a custom vocabulary, or a custom vocabulary filter, include /// LanguageIdSettings with the relevant sub-parameters (VocabularyName, /// LanguageModelName, and VocabularyFilterName). Note that /// multi-language identification (IdentifyMultipleLanguages) doesn't support /// custom language models.LanguageIdSettings supports two to five language codes. Each language /// code you include can have an associated custom language model, custom vocabulary, /// and custom vocabulary filter. The language codes that you specify must match the languages /// of the associated custom language models, custom vocabularies, and custom vocabulary /// filters.It's recommended that you include LanguageOptions when using LanguageIdSettings /// to ensure that the correct language dialect is identified. For example, if you specify /// a custom vocabulary that is in en-US but Amazon Transcribe determines /// that the language spoken in your media is en-AU, your custom vocabulary /// is not applied to your transcription. If you include LanguageOptions /// and include en-US as the only English language dialect, your custom vocabulary /// is applied to your transcription.If you want to include a custom language model with your request but do not /// want to use automatic language identification, use instead the parameter with /// the LanguageModelName sub-parameter. If you want to include a custom /// vocabulary or a custom vocabulary filter (or both) with your request but do not /// want to use automatic language identification, use instead the parameter with /// the VocabularyName or VocabularyFilterName (or both) sub-parameter. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("LanguageIdSettings")] public System.Collections.Hashtable LanguageIdSetting { get; set; } #endregion #region Parameter ModelSettings_LanguageModelName /// /// /// The name of the custom language model you want to use when processing your transcription /// job. Note that custom language model names are case sensitive.The language of the specified custom language model must match the language code that /// you specify in your transcription request. If the languages don't match, the custom /// language model isn't applied. There are no errors or warnings associated with a language /// mismatch. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String ModelSettings_LanguageModelName { get; set; } #endregion #region Parameter LanguageOption /// /// /// You can specify two or more language codes that represent the languages you think /// may be present in your media. Including more than five is not recommended. If you're /// unsure what languages are present, do not include this parameter.If you include LanguageOptions in your request, you must also include /// IdentifyLanguage.For more information, refer to Supported /// languages.To transcribe speech in Modern Standard Arabic (ar-SA), your media file /// must be encoded at a sample rate of 16,000 Hz or higher. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("LanguageOptions")] public System.String[] LanguageOption { get; set; } #endregion #region Parameter Settings_MaxAlternative /// /// /// Indicate the maximum number of alternative transcriptions you want Amazon Transcribe /// to include in your transcript.If you select a number greater than the number of alternative transcriptions generated /// by Amazon Transcribe, only the actual number of alternative transcriptions are included.If you include MaxAlternatives in your request, you must also include /// ShowAlternatives with a value of true.For more information, see Alternative /// transcriptions. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Settings_MaxAlternatives")] public System.Int32? Settings_MaxAlternative { get; set; } #endregion #region Parameter Settings_MaxSpeakerLabel /// /// /// Specify the maximum number of speakers you want to partition in your media.Note that if your media contains more speakers than the specified number, multiple /// speakers are treated as a single speaker.If you specify the MaxSpeakerLabels field, you must set the ShowSpeakerLabels /// field to true. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Settings_MaxSpeakerLabels")] public System.Int32? Settings_MaxSpeakerLabel { get; set; } #endregion #region Parameter Media_MediaFileUri /// /// /// The Amazon S3 location of the media file you want to transcribe. For example:
  • s3://DOC-EXAMPLE-BUCKET/my-media-file.flac
  • s3://DOC-EXAMPLE-BUCKET/media-files/my-media-file.flac
Note that the Amazon S3 bucket that contains your input media must be located in the /// same Amazon Web Services Region where you're making your transcription request. ///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String Media_MediaFileUri { get; set; } #endregion #region Parameter MediaFormat /// /// /// Specify the format of your input media file. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [AWSConstantClassSource("Amazon.TranscribeService.MediaFormat")] public Amazon.TranscribeService.MediaFormat MediaFormat { get; set; } #endregion #region Parameter MediaSampleRateHertz /// /// /// The sample rate, in hertz, of the audio track in your input media file.If you don't specify the media sample rate, Amazon Transcribe determines it for you. /// If you specify the sample rate, it must match the rate detected by Amazon Transcribe. /// If there's a mismatch between the value that you specify and the value detected, your /// job fails. In most cases, you can omit MediaSampleRateHertz and let Amazon /// Transcribe determine the sample rate. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? MediaSampleRateHertz { get; set; } #endregion #region Parameter OutputBucketName /// /// /// The name of the Amazon S3 bucket where you want your transcription output stored. /// Do not include the S3:// prefix of the specified bucket.If you want your output to go to a sub-folder of this bucket, specify it using the /// OutputKey parameter; OutputBucketName only accepts the name /// of a bucket.For example, if you want your output stored in S3://DOC-EXAMPLE-BUCKET, /// set OutputBucketName to DOC-EXAMPLE-BUCKET. However, if /// you want your output stored in S3://DOC-EXAMPLE-BUCKET/test-files/, set /// OutputBucketName to DOC-EXAMPLE-BUCKET and OutputKey /// to test-files/.Note that Amazon Transcribe must have permission to use the specified location. You /// can change Amazon S3 permissions using the Amazon /// Web Services Management Console. See also Permissions /// Required for IAM User Roles.If you don't specify OutputBucketName, your transcript is placed in a /// service-managed Amazon S3 bucket and you are provided with a URI to access your transcript. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String OutputBucketName { get; set; } #endregion #region Parameter OutputEncryptionKMSKeyId /// /// /// The KMS key you want to use to encrypt your transcription output.If using a key located in the current Amazon Web Services account, you can /// specify your KMS key in one of four ways:
  1. Use the KMS key ID itself. For example, 1234abcd-12ab-34cd-56ef-1234567890ab.
  2. Use an alias for the KMS key ID. For example, alias/ExampleAlias.
  3. Use the Amazon Resource Name (ARN) for the KMS key ID. For example, arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab.
  4. Use the ARN for the KMS key alias. For example, arn:aws:kms:region:account-ID:alias/ExampleAlias.
If using a key located in a different Amazon Web Services account than the /// current Amazon Web Services account, you can specify your KMS key in one of two ways:
  1. Use the ARN for the KMS key ID. For example, arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab.
  2. Use the ARN for the KMS key alias. For example, arn:aws:kms:region:account-ID:alias/ExampleAlias.
If you don't specify an encryption key, your output is encrypted with the default /// Amazon S3 key (SSE-S3).If you specify a KMS key to encrypt your output, you must also specify an output location /// using the OutputLocation parameter.Note that the role making the request must have permission to use the specified KMS /// key. ///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String OutputEncryptionKMSKeyId { get; set; } #endregion #region Parameter OutputKey /// /// /// Use in combination with OutputBucketName to specify the output location /// of your transcript and, optionally, a unique name for your output file. The default /// name for your transcription output is the same as the name you specified for your /// transcription job (TranscriptionJobName).Here are some examples of how you can use OutputKey:
  • If you specify 'DOC-EXAMPLE-BUCKET' as the OutputBucketName and 'my-transcript.json' /// as the OutputKey, your transcription output path is s3://DOC-EXAMPLE-BUCKET/my-transcript.json.
  • If you specify 'my-first-transcription' as the TranscriptionJobName, /// 'DOC-EXAMPLE-BUCKET' as the OutputBucketName, and 'my-transcript' as /// the OutputKey, your transcription output path is s3://DOC-EXAMPLE-BUCKET/my-transcript/my-first-transcription.json.
  • If you specify 'DOC-EXAMPLE-BUCKET' as the OutputBucketName and 'test-files/my-transcript.json' /// as the OutputKey, your transcription output path is s3://DOC-EXAMPLE-BUCKET/test-files/my-transcript.json.
  • If you specify 'my-first-transcription' as the TranscriptionJobName, /// 'DOC-EXAMPLE-BUCKET' as the OutputBucketName, and 'test-files/my-transcript' /// as the OutputKey, your transcription output path is s3://DOC-EXAMPLE-BUCKET/test-files/my-transcript/my-first-transcription.json.
If you specify the name of an Amazon S3 bucket sub-folder that doesn't exist, one /// is created for you. ///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String OutputKey { get; set; } #endregion #region Parameter Subtitles_OutputStartIndex /// /// /// Specify the starting value that is assigned to the first subtitle segment.The default start index for Amazon Transcribe is 0, which differs from /// the more widely used standard of 1. If you're uncertain which value to /// use, we recommend choosing 1, as this may improve compatibility with /// other services. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.Int32? Subtitles_OutputStartIndex { get; set; } #endregion #region Parameter ContentRedaction_PiiEntityType /// /// /// Specify which types of personally identifiable information (PII) you want to redact /// in your transcript. You can include as many types as you'd like, or you can select /// ALL. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("ContentRedaction_PiiEntityTypes")] public System.String[] ContentRedaction_PiiEntityType { get; set; } #endregion #region Parameter Media_RedactedMediaFileUri /// /// /// The Amazon S3 location of the media file you want to redact. For example:
  • s3://DOC-EXAMPLE-BUCKET/my-media-file.flac
  • s3://DOC-EXAMPLE-BUCKET/media-files/my-media-file.flac
Note that the Amazon S3 bucket that contains your input media must be located in the /// same Amazon Web Services Region where you're making your transcription request.RedactedMediaFileUri produces a redacted audio file in addition to a /// redacted transcript. It is only supported for Call Analytics (StartCallAnalyticsJob) /// transcription requests. ///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String Media_RedactedMediaFileUri { get; set; } #endregion #region Parameter ContentRedaction_RedactionOutput /// /// /// Specify if you want only a redacted transcript, or if you want a redacted and an unredacted /// transcript.When you choose redacted Amazon Transcribe creates only a redacted transcript.When you choose redacted_and_unredacted Amazon Transcribe creates a redacted /// and an unredacted transcript (as two separate files). /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [AWSConstantClassSource("Amazon.TranscribeService.RedactionOutput")] public Amazon.TranscribeService.RedactionOutput ContentRedaction_RedactionOutput { get; set; } #endregion #region Parameter ContentRedaction_RedactionType /// /// /// Specify the category of information you want to redact; PII (personally /// identifiable information) is the only valid value. You can use PiiEntityTypes /// to choose which types of PII you want to redact. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [AWSConstantClassSource("Amazon.TranscribeService.RedactionType")] public Amazon.TranscribeService.RedactionType ContentRedaction_RedactionType { get; set; } #endregion #region Parameter Settings_ShowAlternative /// /// /// To include alternative transcriptions within your transcription output, include ShowAlternatives /// in your transcription request.If you have multi-channel audio and do not enable channel identification, your audio /// is transcribed in a continuous manner and your transcript does not separate the speech /// by channel.If you include ShowAlternatives, you must also include MaxAlternatives, /// which is the maximum number of alternative transcriptions you want Amazon Transcribe /// to generate.For more information, see Alternative /// transcriptions. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Settings_ShowAlternatives")] public System.Boolean? Settings_ShowAlternative { get; set; } #endregion #region Parameter Settings_ShowSpeakerLabel /// /// /// Enables speaker partitioning (diarization) in your transcription output. Speaker partitioning /// labels the speech from individual speakers in your media file.If you enable ShowSpeakerLabels in your request, you must also include /// MaxSpeakerLabels.You can't include both ShowSpeakerLabels and ChannelIdentification /// in the same request. Including both parameters returns a BadRequestException.For more information, see Partitioning /// speakers (diarization). /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Settings_ShowSpeakerLabels")] public System.Boolean? Settings_ShowSpeakerLabel { get; set; } #endregion #region Parameter Tag /// /// /// Adds one or more custom tags, each in the form of a key:value pair, to a new transcription /// job at the time you start this new job.To learn more about using tags with Amazon Transcribe, refer to Tagging /// resources. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [Alias("Tags")] public Amazon.TranscribeService.Model.Tag[] Tag { get; set; } #endregion #region Parameter ToxicityDetection /// /// /// Enables toxic speech detection in your transcript. If you include ToxicityDetection /// in your request, you must also include ToxicityCategories.For information on the types of toxic speech Amazon Transcribe can detect, see Detecting /// toxic speech. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public Amazon.TranscribeService.Model.ToxicityDetectionSettings[] ToxicityDetection { get; set; } #endregion #region Parameter TranscriptionJobName /// /// /// A unique name, chosen by you, for your transcription job. The name that you specify /// is also used as the default name of your transcription output file. If you want to /// specify a different name for your transcription output, use the OutputKey /// parameter.This name is case sensitive, cannot contain spaces, and must be unique within an Amazon /// Web Services account. If you try to create a new job with the same name as an existing /// job, you get a ConflictException error. /// /// #if !MODULAR [System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true)] #else [System.Management.Automation.Parameter(Position = 0, ValueFromPipelineByPropertyName = true, ValueFromPipeline = true, Mandatory = true)] [System.Management.Automation.AllowEmptyString] [System.Management.Automation.AllowNull] #endif [Amazon.PowerShell.Common.AWSRequiredParameter] public System.String TranscriptionJobName { get; set; } #endregion #region Parameter Settings_VocabularyFilterMethod /// /// /// Specify how you want your custom vocabulary filter applied to your transcript.To replace words with ***, choose mask.To delete words, choose remove.To flag words without changing them, choose tag. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] [AWSConstantClassSource("Amazon.TranscribeService.VocabularyFilterMethod")] public Amazon.TranscribeService.VocabularyFilterMethod Settings_VocabularyFilterMethod { get; set; } #endregion #region Parameter Settings_VocabularyFilterName /// /// /// The name of the custom vocabulary filter you want to use in your transcription job /// request. This name is case sensitive, cannot contain spaces, and must be unique within /// an Amazon Web Services account.Note that if you include VocabularyFilterName in your request, you must /// also include VocabularyFilterMethod. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String Settings_VocabularyFilterName { get; set; } #endregion #region Parameter Settings_VocabularyName /// /// /// The name of the custom vocabulary you want to use in your transcription job request. /// This name is case sensitive, cannot contain spaces, and must be unique within an Amazon /// Web Services account. /// /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public System.String Settings_VocabularyName { get; set; } #endregion #region Parameter Select /// /// Use the -Select parameter to control the cmdlet output. The default value is 'TranscriptionJob'. /// Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.TranscribeService.Model.StartTranscriptionJobResponse). /// Specifying the name of a property of type Amazon.TranscribeService.Model.StartTranscriptionJobResponse will result in that property being returned. /// Specifying -Select '^ParameterName' will result in the cmdlet returning the selected cmdlet parameter value. /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public string Select { get; set; } = "TranscriptionJob"; #endregion #region Parameter PassThru /// /// Changes the cmdlet behavior to return the value passed to the TranscriptionJobName parameter. /// The -PassThru parameter is deprecated, use -Select '^TranscriptionJobName' instead. This parameter will be removed in a future version. /// [System.Obsolete("The -PassThru parameter is deprecated, use -Select '^TranscriptionJobName' instead. This parameter will be removed in a future version.")] [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public SwitchParameter PassThru { get; set; } #endregion #region Parameter Force /// /// This parameter overrides confirmation prompts to force /// the cmdlet to continue its operation. This parameter should always /// be used with caution. /// [System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)] public SwitchParameter Force { get; set; } #endregion protected override void ProcessRecord() { this._AWSSignerType = "v4"; base.ProcessRecord(); var resourceIdentifiersText = FormatParameterValuesForConfirmationMsg(nameof(this.TranscriptionJobName), MyInvocation.BoundParameters); if (!ConfirmShouldProceed(this.Force.IsPresent, resourceIdentifiersText, "Start-TRSTranscriptionJob (StartTranscriptionJob)")) { return; } var context = new CmdletContext(); // allow for manipulation of parameters prior to loading into context PreExecutionContextLoad(context); #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute if (ParameterWasBound(nameof(this.Select))) { context.Select = CreateSelectDelegate(Select) ?? throw new System.ArgumentException("Invalid value for -Select parameter.", nameof(this.Select)); if (this.PassThru.IsPresent) { throw new System.ArgumentException("-PassThru cannot be used when -Select is specified.", nameof(this.Select)); } } else if (this.PassThru.IsPresent) { context.Select = (response, cmdlet) => this.TranscriptionJobName; } #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute if (this.ContentRedaction_PiiEntityType != null) { context.ContentRedaction_PiiEntityType = new List(this.ContentRedaction_PiiEntityType); } context.ContentRedaction_RedactionOutput = this.ContentRedaction_RedactionOutput; context.ContentRedaction_RedactionType = this.ContentRedaction_RedactionType; context.IdentifyLanguage = this.IdentifyLanguage; context.IdentifyMultipleLanguage = this.IdentifyMultipleLanguage; context.JobExecutionSettings_AllowDeferredExecution = this.JobExecutionSettings_AllowDeferredExecution; context.JobExecutionSettings_DataAccessRoleArn = this.JobExecutionSettings_DataAccessRoleArn; if (this.KMSEncryptionContext != null) { context.KMSEncryptionContext = new Dictionary(StringComparer.Ordinal); foreach (var hashKey in this.KMSEncryptionContext.Keys) { context.KMSEncryptionContext.Add((String)hashKey, (String)(this.KMSEncryptionContext[hashKey])); } } context.LanguageCode = this.LanguageCode; if (this.LanguageIdSetting != null) { context.LanguageIdSetting = new Dictionary(StringComparer.Ordinal); foreach (var hashKey in this.LanguageIdSetting.Keys) { context.LanguageIdSetting.Add((String)hashKey, (LanguageIdSettings)(this.LanguageIdSetting[hashKey])); } } if (this.LanguageOption != null) { context.LanguageOption = new List(this.LanguageOption); } context.Media_MediaFileUri = this.Media_MediaFileUri; context.Media_RedactedMediaFileUri = this.Media_RedactedMediaFileUri; context.MediaFormat = this.MediaFormat; context.MediaSampleRateHertz = this.MediaSampleRateHertz; context.ModelSettings_LanguageModelName = this.ModelSettings_LanguageModelName; context.OutputBucketName = this.OutputBucketName; context.OutputEncryptionKMSKeyId = this.OutputEncryptionKMSKeyId; context.OutputKey = this.OutputKey; context.Settings_ChannelIdentification = this.Settings_ChannelIdentification; context.Settings_MaxAlternative = this.Settings_MaxAlternative; context.Settings_MaxSpeakerLabel = this.Settings_MaxSpeakerLabel; context.Settings_ShowAlternative = this.Settings_ShowAlternative; context.Settings_ShowSpeakerLabel = this.Settings_ShowSpeakerLabel; context.Settings_VocabularyFilterMethod = this.Settings_VocabularyFilterMethod; context.Settings_VocabularyFilterName = this.Settings_VocabularyFilterName; context.Settings_VocabularyName = this.Settings_VocabularyName; if (this.Subtitles_Format != null) { context.Subtitles_Format = new List(this.Subtitles_Format); } context.Subtitles_OutputStartIndex = this.Subtitles_OutputStartIndex; if (this.Tag != null) { context.Tag = new List(this.Tag); } if (this.ToxicityDetection != null) { context.ToxicityDetection = new List(this.ToxicityDetection); } context.TranscriptionJobName = this.TranscriptionJobName; #if MODULAR if (this.TranscriptionJobName == null && ParameterWasBound(nameof(this.TranscriptionJobName))) { WriteWarning("You are passing $null as a value for parameter TranscriptionJobName which is marked as required. In case you believe this parameter was incorrectly marked as required, report this by opening an issue at https://github.com/aws/aws-tools-for-powershell/issues."); } #endif // allow further manipulation of loaded context prior to processing PostExecutionContextLoad(context); var output = Execute(context) as CmdletOutput; ProcessOutput(output); } #region IExecutor Members public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.TranscribeService.Model.StartTranscriptionJobRequest(); // populate ContentRedaction var requestContentRedactionIsNull = true; request.ContentRedaction = new Amazon.TranscribeService.Model.ContentRedaction(); List requestContentRedaction_contentRedaction_PiiEntityType = null; if (cmdletContext.ContentRedaction_PiiEntityType != null) { requestContentRedaction_contentRedaction_PiiEntityType = cmdletContext.ContentRedaction_PiiEntityType; } if (requestContentRedaction_contentRedaction_PiiEntityType != null) { request.ContentRedaction.PiiEntityTypes = requestContentRedaction_contentRedaction_PiiEntityType; requestContentRedactionIsNull = false; } Amazon.TranscribeService.RedactionOutput requestContentRedaction_contentRedaction_RedactionOutput = null; if (cmdletContext.ContentRedaction_RedactionOutput != null) { requestContentRedaction_contentRedaction_RedactionOutput = cmdletContext.ContentRedaction_RedactionOutput; } if (requestContentRedaction_contentRedaction_RedactionOutput != null) { request.ContentRedaction.RedactionOutput = requestContentRedaction_contentRedaction_RedactionOutput; requestContentRedactionIsNull = false; } Amazon.TranscribeService.RedactionType requestContentRedaction_contentRedaction_RedactionType = null; if (cmdletContext.ContentRedaction_RedactionType != null) { requestContentRedaction_contentRedaction_RedactionType = cmdletContext.ContentRedaction_RedactionType; } if (requestContentRedaction_contentRedaction_RedactionType != null) { request.ContentRedaction.RedactionType = requestContentRedaction_contentRedaction_RedactionType; requestContentRedactionIsNull = false; } // determine if request.ContentRedaction should be set to null if (requestContentRedactionIsNull) { request.ContentRedaction = null; } if (cmdletContext.IdentifyLanguage != null) { request.IdentifyLanguage = cmdletContext.IdentifyLanguage.Value; } if (cmdletContext.IdentifyMultipleLanguage != null) { request.IdentifyMultipleLanguages = cmdletContext.IdentifyMultipleLanguage.Value; } // populate JobExecutionSettings var requestJobExecutionSettingsIsNull = true; request.JobExecutionSettings = new Amazon.TranscribeService.Model.JobExecutionSettings(); System.Boolean? requestJobExecutionSettings_jobExecutionSettings_AllowDeferredExecution = null; if (cmdletContext.JobExecutionSettings_AllowDeferredExecution != null) { requestJobExecutionSettings_jobExecutionSettings_AllowDeferredExecution = cmdletContext.JobExecutionSettings_AllowDeferredExecution.Value; } if (requestJobExecutionSettings_jobExecutionSettings_AllowDeferredExecution != null) { request.JobExecutionSettings.AllowDeferredExecution = requestJobExecutionSettings_jobExecutionSettings_AllowDeferredExecution.Value; requestJobExecutionSettingsIsNull = false; } System.String requestJobExecutionSettings_jobExecutionSettings_DataAccessRoleArn = null; if (cmdletContext.JobExecutionSettings_DataAccessRoleArn != null) { requestJobExecutionSettings_jobExecutionSettings_DataAccessRoleArn = cmdletContext.JobExecutionSettings_DataAccessRoleArn; } if (requestJobExecutionSettings_jobExecutionSettings_DataAccessRoleArn != null) { request.JobExecutionSettings.DataAccessRoleArn = requestJobExecutionSettings_jobExecutionSettings_DataAccessRoleArn; requestJobExecutionSettingsIsNull = false; } // determine if request.JobExecutionSettings should be set to null if (requestJobExecutionSettingsIsNull) { request.JobExecutionSettings = null; } if (cmdletContext.KMSEncryptionContext != null) { request.KMSEncryptionContext = cmdletContext.KMSEncryptionContext; } if (cmdletContext.LanguageCode != null) { request.LanguageCode = cmdletContext.LanguageCode; } if (cmdletContext.LanguageIdSetting != null) { request.LanguageIdSettings = cmdletContext.LanguageIdSetting; } if (cmdletContext.LanguageOption != null) { request.LanguageOptions = cmdletContext.LanguageOption; } // 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.MediaFormat != null) { request.MediaFormat = cmdletContext.MediaFormat; } if (cmdletContext.MediaSampleRateHertz != null) { request.MediaSampleRateHertz = cmdletContext.MediaSampleRateHertz.Value; } // populate ModelSettings var requestModelSettingsIsNull = true; request.ModelSettings = new Amazon.TranscribeService.Model.ModelSettings(); System.String requestModelSettings_modelSettings_LanguageModelName = null; if (cmdletContext.ModelSettings_LanguageModelName != null) { requestModelSettings_modelSettings_LanguageModelName = cmdletContext.ModelSettings_LanguageModelName; } if (requestModelSettings_modelSettings_LanguageModelName != null) { request.ModelSettings.LanguageModelName = requestModelSettings_modelSettings_LanguageModelName; requestModelSettingsIsNull = false; } // determine if request.ModelSettings should be set to null if (requestModelSettingsIsNull) { request.ModelSettings = null; } if (cmdletContext.OutputBucketName != null) { request.OutputBucketName = cmdletContext.OutputBucketName; } if (cmdletContext.OutputEncryptionKMSKeyId != null) { request.OutputEncryptionKMSKeyId = cmdletContext.OutputEncryptionKMSKeyId; } if (cmdletContext.OutputKey != null) { request.OutputKey = cmdletContext.OutputKey; } // populate Settings var requestSettingsIsNull = true; request.Settings = new Amazon.TranscribeService.Model.Settings(); System.Boolean? requestSettings_settings_ChannelIdentification = null; if (cmdletContext.Settings_ChannelIdentification != null) { requestSettings_settings_ChannelIdentification = cmdletContext.Settings_ChannelIdentification.Value; } if (requestSettings_settings_ChannelIdentification != null) { request.Settings.ChannelIdentification = requestSettings_settings_ChannelIdentification.Value; requestSettingsIsNull = false; } System.Int32? requestSettings_settings_MaxAlternative = null; if (cmdletContext.Settings_MaxAlternative != null) { requestSettings_settings_MaxAlternative = cmdletContext.Settings_MaxAlternative.Value; } if (requestSettings_settings_MaxAlternative != null) { request.Settings.MaxAlternatives = requestSettings_settings_MaxAlternative.Value; requestSettingsIsNull = false; } System.Int32? requestSettings_settings_MaxSpeakerLabel = null; if (cmdletContext.Settings_MaxSpeakerLabel != null) { requestSettings_settings_MaxSpeakerLabel = cmdletContext.Settings_MaxSpeakerLabel.Value; } if (requestSettings_settings_MaxSpeakerLabel != null) { request.Settings.MaxSpeakerLabels = requestSettings_settings_MaxSpeakerLabel.Value; requestSettingsIsNull = false; } System.Boolean? requestSettings_settings_ShowAlternative = null; if (cmdletContext.Settings_ShowAlternative != null) { requestSettings_settings_ShowAlternative = cmdletContext.Settings_ShowAlternative.Value; } if (requestSettings_settings_ShowAlternative != null) { request.Settings.ShowAlternatives = requestSettings_settings_ShowAlternative.Value; requestSettingsIsNull = false; } System.Boolean? requestSettings_settings_ShowSpeakerLabel = null; if (cmdletContext.Settings_ShowSpeakerLabel != null) { requestSettings_settings_ShowSpeakerLabel = cmdletContext.Settings_ShowSpeakerLabel.Value; } if (requestSettings_settings_ShowSpeakerLabel != null) { request.Settings.ShowSpeakerLabels = requestSettings_settings_ShowSpeakerLabel.Value; 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; } // determine if request.Settings should be set to null if (requestSettingsIsNull) { request.Settings = null; } // populate Subtitles var requestSubtitlesIsNull = true; request.Subtitles = new Amazon.TranscribeService.Model.Subtitles(); List requestSubtitles_subtitles_Format = null; if (cmdletContext.Subtitles_Format != null) { requestSubtitles_subtitles_Format = cmdletContext.Subtitles_Format; } if (requestSubtitles_subtitles_Format != null) { request.Subtitles.Formats = requestSubtitles_subtitles_Format; requestSubtitlesIsNull = false; } System.Int32? requestSubtitles_subtitles_OutputStartIndex = null; if (cmdletContext.Subtitles_OutputStartIndex != null) { requestSubtitles_subtitles_OutputStartIndex = cmdletContext.Subtitles_OutputStartIndex.Value; } if (requestSubtitles_subtitles_OutputStartIndex != null) { request.Subtitles.OutputStartIndex = requestSubtitles_subtitles_OutputStartIndex.Value; requestSubtitlesIsNull = false; } // determine if request.Subtitles should be set to null if (requestSubtitlesIsNull) { request.Subtitles = null; } if (cmdletContext.Tag != null) { request.Tags = cmdletContext.Tag; } if (cmdletContext.ToxicityDetection != null) { request.ToxicityDetection = cmdletContext.ToxicityDetection; } if (cmdletContext.TranscriptionJobName != null) { request.TranscriptionJobName = cmdletContext.TranscriptionJobName; } 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; } public ExecutorContext CreateContext() { return new CmdletContext(); } #endregion #region AWS Service Operation Call private Amazon.TranscribeService.Model.StartTranscriptionJobResponse CallAWSServiceOperation(IAmazonTranscribeService client, Amazon.TranscribeService.Model.StartTranscriptionJobRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Transcribe Service", "StartTranscriptionJob"); try { #if DESKTOP return client.StartTranscriptionJob(request); #elif CORECLR return client.StartTranscriptionJobAsync(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; } } #endregion internal partial class CmdletContext : ExecutorContext { public List ContentRedaction_PiiEntityType { get; set; } public Amazon.TranscribeService.RedactionOutput ContentRedaction_RedactionOutput { get; set; } public Amazon.TranscribeService.RedactionType ContentRedaction_RedactionType { get; set; } public System.Boolean? IdentifyLanguage { get; set; } public System.Boolean? IdentifyMultipleLanguage { get; set; } public System.Boolean? JobExecutionSettings_AllowDeferredExecution { get; set; } public System.String JobExecutionSettings_DataAccessRoleArn { get; set; } public Dictionary KMSEncryptionContext { get; set; } public Amazon.TranscribeService.LanguageCode LanguageCode { get; set; } public Dictionary LanguageIdSetting { get; set; } public List LanguageOption { get; set; } public System.String Media_MediaFileUri { get; set; } public System.String Media_RedactedMediaFileUri { get; set; } public Amazon.TranscribeService.MediaFormat MediaFormat { get; set; } public System.Int32? MediaSampleRateHertz { get; set; } public System.String ModelSettings_LanguageModelName { get; set; } public System.String OutputBucketName { get; set; } public System.String OutputEncryptionKMSKeyId { get; set; } public System.String OutputKey { get; set; } public System.Boolean? Settings_ChannelIdentification { get; set; } public System.Int32? Settings_MaxAlternative { get; set; } public System.Int32? Settings_MaxSpeakerLabel { get; set; } public System.Boolean? Settings_ShowAlternative { get; set; } public System.Boolean? Settings_ShowSpeakerLabel { get; set; } public Amazon.TranscribeService.VocabularyFilterMethod Settings_VocabularyFilterMethod { get; set; } public System.String Settings_VocabularyFilterName { get; set; } public System.String Settings_VocabularyName { get; set; } public List Subtitles_Format { get; set; } public System.Int32? Subtitles_OutputStartIndex { get; set; } public List Tag { get; set; } public List ToxicityDetection { get; set; } public System.String TranscriptionJobName { get; set; } public System.Func Select { get; set; } = (response, cmdlet) => response.TranscriptionJob; } } }