/*******************************************************************************
* 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 customer service call and applies any additional Request
/// Parameters you choose to include in your request.
///
///
///
/// In addition to many standard transcription features, Call Analytics provides you with
/// call characteristics, call summarization, speaker sentiment, and optional redaction
/// of your text transcript and your audio file. You can also apply custom categories
/// to flag specified conditions. To learn more about these features and insights, refer
/// to Analyzing
/// call center audio with Call Analytics.
///
/// If you want to apply categories to your Call Analytics job, you must create them before
/// submitting your job request. Categories cannot be retroactively applied to a job.
/// To create a new category, use the operation. To learn more about Call Analytics categories,
/// see Creating
/// categories for post-call transcriptions and Creating
/// categories for real-time transcriptions.
///
/// To make a StartCallAnalyticsJob
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.
///
/// Note that job queuing is enabled by default for Call Analytics jobs.
///
/// You must include the following parameters in your StartCallAnalyticsJob
/// request:
/// region
: The Amazon Web Services Region where you are making your request.
/// For a list of Amazon Web Services Regions supported with Amazon Transcribe, refer
/// to Amazon
/// Transcribe endpoints and quotas.
/// CallAnalyticsJobName
: A custom name that you create for your transcription
/// job that's unique within your Amazon Web Services account.
/// DataAccessRoleArn
: The Amazon Resource Name (ARN) of an IAM role that
/// has permissions to access the Amazon S3 bucket that contains your input files.
/// Media
(MediaFileUri
or RedactedMediaFileUri
):
/// The Amazon S3 location of your media file.
///
/// With Call Analytics, you can redact the audio contained in your media file by including
/// RedactedMediaFileUri
, instead of MediaFileUri
, to specify
/// the location of your input audio. If you choose to redact your audio, you can find
/// your redacted media at the location specified in the RedactedMediaFileUri
/// field of your response.
///
///
[Cmdlet("Start", "TRSCallAnalyticsJob", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)]
[OutputType("Amazon.TranscribeService.Model.CallAnalyticsJob")]
[AWSCmdlet("Calls the Amazon Transcribe Service StartCallAnalyticsJob API operation.", Operation = new[] {"StartCallAnalyticsJob"}, SelectReturnType = typeof(Amazon.TranscribeService.Model.StartCallAnalyticsJobResponse))]
[AWSCmdletOutput("Amazon.TranscribeService.Model.CallAnalyticsJob or Amazon.TranscribeService.Model.StartCallAnalyticsJobResponse",
"This cmdlet returns an Amazon.TranscribeService.Model.CallAnalyticsJob object.",
"The service call response (type Amazon.TranscribeService.Model.StartCallAnalyticsJobResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack."
)]
public partial class StartTRSCallAnalyticsJobCmdlet : AmazonTranscribeServiceClientCmdlet, IExecutor
{
#region Parameter CallAnalyticsJobName
///
///
/// A unique name, chosen by you, for your Call Analytics job.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 CallAnalyticsJobName { get; set; }
#endregion
#region Parameter ChannelDefinition
///
///
/// Makes it possible to specify which speaker is on which channel. For example, if your
/// agent is the first participant to speak, you would set ChannelId
to 0
/// (to indicate the first channel) and ParticipantRole
to AGENT
/// (to indicate that it's the agent speaking).
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("ChannelDefinitions")]
public Amazon.TranscribeService.Model.ChannelDefinition[] ChannelDefinition { get; set; }
#endregion
#region Parameter 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.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String DataAccessRoleArn { get; set; }
#endregion
#region Parameter Settings_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
).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, custom vocabulary, or custom vocabulary
/// filter with your request but do not want to use automatic language identification,
/// use instead the
parameter with the LanguageModelName
, VocabularyName
,
/// or VocabularyFilterName
sub-parameters.For a list of languages supported with Call Analytics, refer to Supported
/// languages and language-specific features.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("Settings_LanguageIdSettings")]
public System.Collections.Hashtable Settings_LanguageIdSetting { get; set; }
#endregion
#region Parameter Settings_LanguageModelName
///
///
/// The name of the custom language model you want to use when processing your Call Analytics
/// 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 Settings_LanguageModelName { get; set; }
#endregion
#region Parameter Settings_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.Including language options can improve the accuracy of language identification.For a list of languages supported with Call Analytics, 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)]
[Alias("Settings_LanguageOptions")]
public System.String[] Settings_LanguageOption { 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 OutputEncryptionKMSKeyId
///
///
/// The KMS key you want to use to encrypt your Call Analytics output.If using a key located in the current Amazon Web Services account, you can
/// specify your KMS key in one of four ways:- Use the KMS key ID itself. For example,
1234abcd-12ab-34cd-56ef-1234567890ab
. - Use an alias for the KMS key ID. For example,
alias/ExampleAlias
. - 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
. - 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:- Use the ARN for the KMS key ID. For example,
arn:aws:kms:region:account-ID:key/1234abcd-12ab-34cd-56ef-1234567890ab
. - 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 OutputLocation
///
///
/// The Amazon S3 location where you want your Call Analytics transcription output stored.
/// You can use any of the following formats to specify the output location:- s3://DOC-EXAMPLE-BUCKET
- s3://DOC-EXAMPLE-BUCKET/my-output-folder/
- s3://DOC-EXAMPLE-BUCKET/my-output-folder/my-call-analytics-job.json
Unless you specify a file name (option 3), the name of your output file has a default
/// value that matches the name you specified for your transcription job using the CallAnalyticsJobName
/// parameter.You can specify a KMS key to encrypt your output using the OutputEncryptionKMSKeyId
/// parameter. If you don't specify a KMS key, Amazon Transcribe uses the default Amazon
/// S3 key for server-side encryption.If you don't specify OutputLocation
, 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 OutputLocation { 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("Settings_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)]
[Alias("Settings_ContentRedaction_RedactionOutput")]
[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)]
[Alias("Settings_ContentRedaction_RedactionType")]
[AWSConstantClassSource("Amazon.TranscribeService.RedactionType")]
public Amazon.TranscribeService.RedactionType ContentRedaction_RedactionType { 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 include in your Call Analytics
/// transcription request. Custom vocabulary filter names are case sensitive.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 include in your Call Analytics transcription
/// request. Custom vocabulary names are case sensitive.
///
///
[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 'CallAnalyticsJob'.
/// Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.TranscribeService.Model.StartCallAnalyticsJobResponse).
/// Specifying the name of a property of type Amazon.TranscribeService.Model.StartCallAnalyticsJobResponse 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; } = "CallAnalyticsJob";
#endregion
#region Parameter PassThru
///
/// Changes the cmdlet behavior to return the value passed to the CallAnalyticsJobName parameter.
/// The -PassThru parameter is deprecated, use -Select '^CallAnalyticsJobName' instead. This parameter will be removed in a future version.
///
[System.Obsolete("The -PassThru parameter is deprecated, use -Select '^CallAnalyticsJobName' 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.CallAnalyticsJobName), MyInvocation.BoundParameters);
if (!ConfirmShouldProceed(this.Force.IsPresent, resourceIdentifiersText, "Start-TRSCallAnalyticsJob (StartCallAnalyticsJob)"))
{
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.CallAnalyticsJobName;
}
#pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute
context.CallAnalyticsJobName = this.CallAnalyticsJobName;
#if MODULAR
if (this.CallAnalyticsJobName == null && ParameterWasBound(nameof(this.CallAnalyticsJobName)))
{
WriteWarning("You are passing $null as a value for parameter CallAnalyticsJobName 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
if (this.ChannelDefinition != null)
{
context.ChannelDefinition = new List(this.ChannelDefinition);
}
context.DataAccessRoleArn = this.DataAccessRoleArn;
context.Media_MediaFileUri = this.Media_MediaFileUri;
context.Media_RedactedMediaFileUri = this.Media_RedactedMediaFileUri;
context.OutputEncryptionKMSKeyId = this.OutputEncryptionKMSKeyId;
context.OutputLocation = this.OutputLocation;
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;
if (this.Settings_LanguageIdSetting != null)
{
context.Settings_LanguageIdSetting = new Dictionary(StringComparer.Ordinal);
foreach (var hashKey in this.Settings_LanguageIdSetting.Keys)
{
context.Settings_LanguageIdSetting.Add((String)hashKey, (LanguageIdSettings)(this.Settings_LanguageIdSetting[hashKey]));
}
}
context.Settings_LanguageModelName = this.Settings_LanguageModelName;
if (this.Settings_LanguageOption != null)
{
context.Settings_LanguageOption = new List(this.Settings_LanguageOption);
}
context.Settings_VocabularyFilterMethod = this.Settings_VocabularyFilterMethod;
context.Settings_VocabularyFilterName = this.Settings_VocabularyFilterName;
context.Settings_VocabularyName = this.Settings_VocabularyName;
// 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.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 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 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();
List requestSettings_settings_ContentRedaction_contentRedaction_PiiEntityType = null;
if (cmdletContext.ContentRedaction_PiiEntityType != null)
{
requestSettings_settings_ContentRedaction_contentRedaction_PiiEntityType = cmdletContext.ContentRedaction_PiiEntityType;
}
if (requestSettings_settings_ContentRedaction_contentRedaction_PiiEntityType != null)
{
requestSettings_settings_ContentRedaction.PiiEntityTypes = requestSettings_settings_ContentRedaction_contentRedaction_PiiEntityType;
requestSettings_settings_ContentRedactionIsNull = false;
}
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;
}
public ExecutorContext CreateContext()
{
return new CmdletContext();
}
#endregion
#region AWS Service Operation Call
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;
}
}
#endregion
internal partial class CmdletContext : ExecutorContext
{
public System.String CallAnalyticsJobName { get; set; }
public List ChannelDefinition { get; set; }
public System.String DataAccessRoleArn { get; set; }
public System.String Media_MediaFileUri { get; set; }
public System.String Media_RedactedMediaFileUri { get; set; }
public System.String OutputEncryptionKMSKeyId { get; set; }
public System.String OutputLocation { get; set; }
public List ContentRedaction_PiiEntityType { get; set; }
public Amazon.TranscribeService.RedactionOutput ContentRedaction_RedactionOutput { get; set; }
public Amazon.TranscribeService.RedactionType ContentRedaction_RedactionType { get; set; }
public Dictionary Settings_LanguageIdSetting { get; set; }
public System.String Settings_LanguageModelName { get; set; }
public List Settings_LanguageOption { 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 System.Func Select { get; set; } =
(response, cmdlet) => response.CallAnalyticsJob;
}
}
}