/*******************************************************************************
* 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.SageMaker;
using Amazon.SageMaker.Model;
namespace Amazon.PowerShell.Cmdlets.SM
{
///
/// Creates an Autopilot job also referred to as Autopilot experiment or AutoML job.
///
///
/// We recommend using the new versions CreateAutoMLJobV2
/// and DescribeAutoMLJobV2,
/// which offer backward compatibility.
/// CreateAutoMLJobV2
can manage tabular problem types identical to those
/// of its previous version CreateAutoMLJob
, as well as non-tabular problem
/// types such as image or text classification.
///
/// Find guidelines about how to migrate a CreateAutoMLJob
to CreateAutoMLJobV2
/// in Migrate
/// a CreateAutoMLJob to CreateAutoMLJobV2.
///
/// You can find the best-performing model after you run an AutoML job by calling DescribeAutoMLJobV2
/// (recommended) or DescribeAutoMLJob.
///
///
[Cmdlet("New", "SMAutoMLJob", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)]
[OutputType("System.String")]
[AWSCmdlet("Calls the Amazon SageMaker Service CreateAutoMLJob API operation.", Operation = new[] {"CreateAutoMLJob"}, SelectReturnType = typeof(Amazon.SageMaker.Model.CreateAutoMLJobResponse))]
[AWSCmdletOutput("System.String or Amazon.SageMaker.Model.CreateAutoMLJobResponse",
"This cmdlet returns a System.String object.",
"The service call response (type Amazon.SageMaker.Model.CreateAutoMLJobResponse) can also be referenced from properties attached to the cmdlet entry in the $AWSHistory stack."
)]
public partial class NewSMAutoMLJobCmdlet : AmazonSageMakerClientCmdlet, IExecutor
{
#region Parameter CandidateGenerationConfig_AlgorithmsConfig
///
///
/// Stores the configuration information for the selection of algorithms used to train
/// the model candidates.The list of available algorithms to choose from depends on the training mode set in
/// AutoMLJobConfig.Mode
.AlgorithmsConfig
should not be set in AUTO
training mode.- When
AlgorithmsConfig
is provided, one AutoMLAlgorithms
/// attribute must be set and one only.If the list of algorithms provided as values for AutoMLAlgorithms
is
/// empty, AutoMLCandidateGenerationConfig
uses the full set of algorithms
/// for the given training mode. - When
AlgorithmsConfig
is not provided, AutoMLCandidateGenerationConfig
/// uses the full set of algorithms for the given training mode.
For the list of all algorithms per training mode, see
/// AutoMLAlgorithmConfig.For more information on each algorithm, see the Algorithm
/// support section in Autopilot developer guide.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("AutoMLJobConfig_CandidateGenerationConfig_AlgorithmsConfig")]
public Amazon.SageMaker.Model.AutoMLAlgorithmConfig[] CandidateGenerationConfig_AlgorithmsConfig { get; set; }
#endregion
#region Parameter ModelDeployConfig_AutoGenerateEndpointName
///
///
/// Set to True
to automatically generate an endpoint name for a one-click
/// Autopilot model deployment; set to False
otherwise. The default value
/// is False
.If you set AutoGenerateEndpointName
to True
, do not specify
/// the EndpointName
; otherwise a 400 error is thrown.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Boolean? ModelDeployConfig_AutoGenerateEndpointName { get; set; }
#endregion
#region Parameter AutoMLJobName
///
///
/// Identifies an Autopilot job. The name must be unique to your account and is case insensitive.
///
///
#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 AutoMLJobName { get; set; }
#endregion
#region Parameter SecurityConfig_EnableInterContainerTrafficEncryption
///
///
/// Whether to use traffic encryption between the container layers.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("AutoMLJobConfig_SecurityConfig_EnableInterContainerTrafficEncryption")]
public System.Boolean? SecurityConfig_EnableInterContainerTrafficEncryption { get; set; }
#endregion
#region Parameter ModelDeployConfig_EndpointName
///
///
/// Specifies the endpoint name to use for a one-click Autopilot model deployment if the
/// endpoint name is not generated automatically.Specify the EndpointName
if and only if you set AutoGenerateEndpointName
/// to False
; otherwise a 400 error is thrown.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String ModelDeployConfig_EndpointName { get; set; }
#endregion
#region Parameter CandidateGenerationConfig_FeatureSpecificationS3Uri
///
///
/// A URL to the Amazon S3 data source containing selected features from the input data
/// source to run an Autopilot job. You can input FeatureAttributeNames
(optional)
/// in JSON format as shown below: { "FeatureAttributeNames":["col1", "col2", ...] }
.You can also specify the data type of the feature (optional) in the format shown below:{ "FeatureDataTypes":{"col1":"numeric", "col2":"categorical" ... } }
These column keys may not include the target column.In ensembling mode, Autopilot only supports the following data types: numeric
,
/// categorical
, text
, and datetime
. In HPO mode,
/// Autopilot can support numeric
, categorical
, text
,
/// datetime
, and sequence
.If only FeatureDataTypes
is provided, the column keys (col1
,
/// col2
,..) should be a subset of the column names in the input data. If both FeatureDataTypes
and FeatureAttributeNames
are provided,
/// then the column keys should be a subset of the column names provided in FeatureAttributeNames
.
/// The key name FeatureAttributeNames
is fixed. The values listed in ["col1",
/// "col2", ...]
are case sensitive and should be a list of strings containing
/// unique values that are a subset of the column names in the input data. The list of
/// columns provided must not include the target column.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("AutoMLJobConfig_CandidateGenerationConfig_FeatureSpecificationS3Uri")]
public System.String CandidateGenerationConfig_FeatureSpecificationS3Uri { get; set; }
#endregion
#region Parameter GenerateCandidateDefinitionsOnly
///
///
/// Generates possible candidates without training the models. A candidate is a combination
/// of data preprocessors, algorithms, and algorithm parameter settings.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.Boolean? GenerateCandidateDefinitionsOnly { get; set; }
#endregion
#region Parameter InputDataConfig
///
///
/// An array of channel objects that describes the input data and its location. Each channel
/// is a named input source. Similar to InputDataConfig
supported by HyperParameterTrainingJobDefinition.
/// Format(s) supported: CSV, Parquet. A minimum of 500 rows is required for the training
/// dataset. There is not a minimum number of rows required for the validation dataset.
///
///
#if !MODULAR
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
#else
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)]
[System.Management.Automation.AllowEmptyCollection]
[System.Management.Automation.AllowNull]
#endif
[Amazon.PowerShell.Common.AWSRequiredParameter]
public Amazon.SageMaker.Model.AutoMLChannel[] InputDataConfig { get; set; }
#endregion
#region Parameter OutputDataConfig_KmsKeyId
///
///
/// The Key Management Service (KMS) encryption key ID.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
public System.String OutputDataConfig_KmsKeyId { get; set; }
#endregion
#region Parameter CompletionCriteria_MaxAutoMLJobRuntimeInSecond
///
///
/// The maximum runtime, in seconds, an AutoML job has to complete.If an AutoML job exceeds the maximum runtime, the job is stopped automatically and
/// its processing is ended gracefully. The AutoML job identifies the best model whose
/// training was completed and marks it as the best-performing model. Any unfinished steps
/// of the job, such as automatic one-click Autopilot model deployment, are not completed.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("AutoMLJobConfig_CompletionCriteria_MaxAutoMLJobRuntimeInSeconds")]
public System.Int32? CompletionCriteria_MaxAutoMLJobRuntimeInSecond { get; set; }
#endregion
#region Parameter CompletionCriteria_MaxCandidate
///
///
/// The maximum number of times a training job is allowed to run.For text and image classification, as well as time-series forecasting problem types,
/// the supported value is 1. For tabular problem types, the maximum value is 750.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("AutoMLJobConfig_CompletionCriteria_MaxCandidates")]
public System.Int32? CompletionCriteria_MaxCandidate { get; set; }
#endregion
#region Parameter CompletionCriteria_MaxRuntimePerTrainingJobInSecond
///
///
/// The maximum time, in seconds, that each training job executed inside hyperparameter
/// tuning is allowed to run as part of a hyperparameter tuning job. For more information,
/// see the StoppingCondition
/// used by the CreateHyperParameterTuningJob
/// action.For job V2s (jobs created by calling CreateAutoMLJobV2
), this field controls
/// the runtime of the job candidate.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("AutoMLJobConfig_CompletionCriteria_MaxRuntimePerTrainingJobInSeconds")]
public System.Int32? CompletionCriteria_MaxRuntimePerTrainingJobInSecond { get; set; }
#endregion
#region Parameter AutoMLJobObjective_MetricName
///
///
/// The name of the objective metric used to measure the predictive quality of a machine
/// learning system. During training, the model's parameters are updated iteratively to
/// optimize its performance based on the feedback provided by the objective metric when
/// evaluating the model on the validation dataset.For the list of all available metrics supported by Autopilot, see Autopilot
/// metrics.If you do not specify a metric explicitly, the default behavior is to automatically
/// use:- For tabular problem types:
- Regression:
MSE
. - Binary classification:
F1
. - Multiclass classification:
Accuracy
.
- For image or text classification problem types:
Accuracy
- For time-series forecasting problem types:
AverageWeightedQuantileLoss
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[AWSConstantClassSource("Amazon.SageMaker.AutoMLMetricEnum")]
public Amazon.SageMaker.AutoMLMetricEnum AutoMLJobObjective_MetricName { get; set; }
#endregion
#region Parameter AutoMLJobConfig_Mode
///
///
/// The method that Autopilot uses to train the data. You can either specify the mode
/// manually or let Autopilot choose for you based on the dataset size by selecting AUTO
.
/// In AUTO
mode, Autopilot chooses ENSEMBLING
for datasets
/// smaller than 100 MB, and HYPERPARAMETER_TUNING
for larger ones.The ENSEMBLING
mode uses a multi-stack ensemble model to predict classification
/// and regression tasks directly from your dataset. This machine learning mode combines
/// several base models to produce an optimal predictive model. It then uses a stacking
/// ensemble method to combine predictions from contributing members. A multi-stack ensemble
/// model can provide better performance over a single model by combining the predictive
/// capabilities of multiple models. See Autopilot
/// algorithm support for a list of algorithms supported by ENSEMBLING
/// mode.The HYPERPARAMETER_TUNING
(HPO) mode uses the best hyperparameters to
/// train the best version of a model. HPO automatically selects an algorithm for the
/// type of problem you want to solve. Then HPO finds the best hyperparameters according
/// to your objective metric. See Autopilot
/// algorithm support for a list of algorithms supported by HYPERPARAMETER_TUNING
/// mode.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[AWSConstantClassSource("Amazon.SageMaker.AutoMLMode")]
public Amazon.SageMaker.AutoMLMode AutoMLJobConfig_Mode { get; set; }
#endregion
#region Parameter ProblemType
///
///
/// Defines the type of supervised learning problem available for the candidates. For
/// more information, see
/// Amazon SageMaker Autopilot problem types.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[AWSConstantClassSource("Amazon.SageMaker.ProblemType")]
public Amazon.SageMaker.ProblemType ProblemType { get; set; }
#endregion
#region Parameter RoleArn
///
///
/// The ARN of the role that is used to access the data.
///
///
#if !MODULAR
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
#else
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)]
[System.Management.Automation.AllowEmptyString]
[System.Management.Automation.AllowNull]
#endif
[Amazon.PowerShell.Common.AWSRequiredParameter]
public System.String RoleArn { get; set; }
#endregion
#region Parameter OutputDataConfig_S3OutputPath
///
///
/// The Amazon S3 output path. Must be 128 characters or less.
///
///
#if !MODULAR
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
#else
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true, Mandatory = true)]
[System.Management.Automation.AllowEmptyString]
[System.Management.Automation.AllowNull]
#endif
[Amazon.PowerShell.Common.AWSRequiredParameter]
public System.String OutputDataConfig_S3OutputPath { get; set; }
#endregion
#region Parameter VpcConfig_SecurityGroupId
///
///
/// The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for
/// the VPC that is specified in the Subnets
field.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("AutoMLJobConfig_SecurityConfig_VpcConfig_SecurityGroupIds")]
public System.String[] VpcConfig_SecurityGroupId { get; set; }
#endregion
#region Parameter VpcConfig_Subnet
///
///
/// The ID of the subnets in the VPC to which you want to connect your training job or
/// model. For information about the availability of specific instance types, see Supported
/// Instance Types and Availability Zones.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("AutoMLJobConfig_SecurityConfig_VpcConfig_Subnets")]
public System.String[] VpcConfig_Subnet { get; set; }
#endregion
#region Parameter Tag
///
///
/// An array of key-value pairs. You can use tags to categorize your Amazon Web Services
/// resources in different ways, for example, by purpose, owner, or environment. For more
/// information, see Tagging
/// Amazon Web ServicesResources. Tag keys must be unique per resource.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("Tags")]
public Amazon.SageMaker.Model.Tag[] Tag { get; set; }
#endregion
#region Parameter DataSplitConfig_ValidationFraction
///
///
/// The validation fraction (optional) is a float that specifies the portion of the training
/// dataset to be used for validation. The default value is 0.2, and values must be greater
/// than 0 and less than 1. We recommend setting this value to be less than 0.5.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("AutoMLJobConfig_DataSplitConfig_ValidationFraction")]
public System.Single? DataSplitConfig_ValidationFraction { get; set; }
#endregion
#region Parameter SecurityConfig_VolumeKmsKeyId
///
///
/// The key used to encrypt stored data.
///
///
[System.Management.Automation.Parameter(ValueFromPipelineByPropertyName = true)]
[Alias("AutoMLJobConfig_SecurityConfig_VolumeKmsKeyId")]
public System.String SecurityConfig_VolumeKmsKeyId { get; set; }
#endregion
#region Parameter Select
///
/// Use the -Select parameter to control the cmdlet output. The default value is 'AutoMLJobArn'.
/// Specifying -Select '*' will result in the cmdlet returning the whole service response (Amazon.SageMaker.Model.CreateAutoMLJobResponse).
/// Specifying the name of a property of type Amazon.SageMaker.Model.CreateAutoMLJobResponse 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; } = "AutoMLJobArn";
#endregion
#region Parameter PassThru
///
/// Changes the cmdlet behavior to return the value passed to the AutoMLJobName parameter.
/// The -PassThru parameter is deprecated, use -Select '^AutoMLJobName' instead. This parameter will be removed in a future version.
///
[System.Obsolete("The -PassThru parameter is deprecated, use -Select '^AutoMLJobName' 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.AutoMLJobName), MyInvocation.BoundParameters);
if (!ConfirmShouldProceed(this.Force.IsPresent, resourceIdentifiersText, "New-SMAutoMLJob (CreateAutoMLJob)"))
{
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.AutoMLJobName;
}
#pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute
if (this.CandidateGenerationConfig_AlgorithmsConfig != null)
{
context.CandidateGenerationConfig_AlgorithmsConfig = new List(this.CandidateGenerationConfig_AlgorithmsConfig);
}
context.CandidateGenerationConfig_FeatureSpecificationS3Uri = this.CandidateGenerationConfig_FeatureSpecificationS3Uri;
context.CompletionCriteria_MaxAutoMLJobRuntimeInSecond = this.CompletionCriteria_MaxAutoMLJobRuntimeInSecond;
context.CompletionCriteria_MaxCandidate = this.CompletionCriteria_MaxCandidate;
context.CompletionCriteria_MaxRuntimePerTrainingJobInSecond = this.CompletionCriteria_MaxRuntimePerTrainingJobInSecond;
context.DataSplitConfig_ValidationFraction = this.DataSplitConfig_ValidationFraction;
context.AutoMLJobConfig_Mode = this.AutoMLJobConfig_Mode;
context.SecurityConfig_EnableInterContainerTrafficEncryption = this.SecurityConfig_EnableInterContainerTrafficEncryption;
context.SecurityConfig_VolumeKmsKeyId = this.SecurityConfig_VolumeKmsKeyId;
if (this.VpcConfig_SecurityGroupId != null)
{
context.VpcConfig_SecurityGroupId = new List(this.VpcConfig_SecurityGroupId);
}
if (this.VpcConfig_Subnet != null)
{
context.VpcConfig_Subnet = new List(this.VpcConfig_Subnet);
}
context.AutoMLJobName = this.AutoMLJobName;
#if MODULAR
if (this.AutoMLJobName == null && ParameterWasBound(nameof(this.AutoMLJobName)))
{
WriteWarning("You are passing $null as a value for parameter AutoMLJobName 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
context.AutoMLJobObjective_MetricName = this.AutoMLJobObjective_MetricName;
context.GenerateCandidateDefinitionsOnly = this.GenerateCandidateDefinitionsOnly;
if (this.InputDataConfig != null)
{
context.InputDataConfig = new List(this.InputDataConfig);
}
#if MODULAR
if (this.InputDataConfig == null && ParameterWasBound(nameof(this.InputDataConfig)))
{
WriteWarning("You are passing $null as a value for parameter InputDataConfig 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
context.ModelDeployConfig_AutoGenerateEndpointName = this.ModelDeployConfig_AutoGenerateEndpointName;
context.ModelDeployConfig_EndpointName = this.ModelDeployConfig_EndpointName;
context.OutputDataConfig_KmsKeyId = this.OutputDataConfig_KmsKeyId;
context.OutputDataConfig_S3OutputPath = this.OutputDataConfig_S3OutputPath;
#if MODULAR
if (this.OutputDataConfig_S3OutputPath == null && ParameterWasBound(nameof(this.OutputDataConfig_S3OutputPath)))
{
WriteWarning("You are passing $null as a value for parameter OutputDataConfig_S3OutputPath 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
context.ProblemType = this.ProblemType;
context.RoleArn = this.RoleArn;
#if MODULAR
if (this.RoleArn == null && ParameterWasBound(nameof(this.RoleArn)))
{
WriteWarning("You are passing $null as a value for parameter RoleArn 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.Tag != null)
{
context.Tag = new List(this.Tag);
}
// 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.SageMaker.Model.CreateAutoMLJobRequest();
// populate AutoMLJobConfig
var requestAutoMLJobConfigIsNull = true;
request.AutoMLJobConfig = new Amazon.SageMaker.Model.AutoMLJobConfig();
Amazon.SageMaker.AutoMLMode requestAutoMLJobConfig_autoMLJobConfig_Mode = null;
if (cmdletContext.AutoMLJobConfig_Mode != null)
{
requestAutoMLJobConfig_autoMLJobConfig_Mode = cmdletContext.AutoMLJobConfig_Mode;
}
if (requestAutoMLJobConfig_autoMLJobConfig_Mode != null)
{
request.AutoMLJobConfig.Mode = requestAutoMLJobConfig_autoMLJobConfig_Mode;
requestAutoMLJobConfigIsNull = false;
}
Amazon.SageMaker.Model.AutoMLDataSplitConfig requestAutoMLJobConfig_autoMLJobConfig_DataSplitConfig = null;
// populate DataSplitConfig
var requestAutoMLJobConfig_autoMLJobConfig_DataSplitConfigIsNull = true;
requestAutoMLJobConfig_autoMLJobConfig_DataSplitConfig = new Amazon.SageMaker.Model.AutoMLDataSplitConfig();
System.Single? requestAutoMLJobConfig_autoMLJobConfig_DataSplitConfig_dataSplitConfig_ValidationFraction = null;
if (cmdletContext.DataSplitConfig_ValidationFraction != null)
{
requestAutoMLJobConfig_autoMLJobConfig_DataSplitConfig_dataSplitConfig_ValidationFraction = cmdletContext.DataSplitConfig_ValidationFraction.Value;
}
if (requestAutoMLJobConfig_autoMLJobConfig_DataSplitConfig_dataSplitConfig_ValidationFraction != null)
{
requestAutoMLJobConfig_autoMLJobConfig_DataSplitConfig.ValidationFraction = requestAutoMLJobConfig_autoMLJobConfig_DataSplitConfig_dataSplitConfig_ValidationFraction.Value;
requestAutoMLJobConfig_autoMLJobConfig_DataSplitConfigIsNull = false;
}
// determine if requestAutoMLJobConfig_autoMLJobConfig_DataSplitConfig should be set to null
if (requestAutoMLJobConfig_autoMLJobConfig_DataSplitConfigIsNull)
{
requestAutoMLJobConfig_autoMLJobConfig_DataSplitConfig = null;
}
if (requestAutoMLJobConfig_autoMLJobConfig_DataSplitConfig != null)
{
request.AutoMLJobConfig.DataSplitConfig = requestAutoMLJobConfig_autoMLJobConfig_DataSplitConfig;
requestAutoMLJobConfigIsNull = false;
}
Amazon.SageMaker.Model.AutoMLCandidateGenerationConfig requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfig = null;
// populate CandidateGenerationConfig
var requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfigIsNull = true;
requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfig = new Amazon.SageMaker.Model.AutoMLCandidateGenerationConfig();
List requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfig_candidateGenerationConfig_AlgorithmsConfig = null;
if (cmdletContext.CandidateGenerationConfig_AlgorithmsConfig != null)
{
requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfig_candidateGenerationConfig_AlgorithmsConfig = cmdletContext.CandidateGenerationConfig_AlgorithmsConfig;
}
if (requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfig_candidateGenerationConfig_AlgorithmsConfig != null)
{
requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfig.AlgorithmsConfig = requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfig_candidateGenerationConfig_AlgorithmsConfig;
requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfigIsNull = false;
}
System.String requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfig_candidateGenerationConfig_FeatureSpecificationS3Uri = null;
if (cmdletContext.CandidateGenerationConfig_FeatureSpecificationS3Uri != null)
{
requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfig_candidateGenerationConfig_FeatureSpecificationS3Uri = cmdletContext.CandidateGenerationConfig_FeatureSpecificationS3Uri;
}
if (requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfig_candidateGenerationConfig_FeatureSpecificationS3Uri != null)
{
requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfig.FeatureSpecificationS3Uri = requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfig_candidateGenerationConfig_FeatureSpecificationS3Uri;
requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfigIsNull = false;
}
// determine if requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfig should be set to null
if (requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfigIsNull)
{
requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfig = null;
}
if (requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfig != null)
{
request.AutoMLJobConfig.CandidateGenerationConfig = requestAutoMLJobConfig_autoMLJobConfig_CandidateGenerationConfig;
requestAutoMLJobConfigIsNull = false;
}
Amazon.SageMaker.Model.AutoMLJobCompletionCriteria requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria = null;
// populate CompletionCriteria
var requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteriaIsNull = true;
requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria = new Amazon.SageMaker.Model.AutoMLJobCompletionCriteria();
System.Int32? requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxAutoMLJobRuntimeInSecond = null;
if (cmdletContext.CompletionCriteria_MaxAutoMLJobRuntimeInSecond != null)
{
requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxAutoMLJobRuntimeInSecond = cmdletContext.CompletionCriteria_MaxAutoMLJobRuntimeInSecond.Value;
}
if (requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxAutoMLJobRuntimeInSecond != null)
{
requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria.MaxAutoMLJobRuntimeInSeconds = requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxAutoMLJobRuntimeInSecond.Value;
requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteriaIsNull = false;
}
System.Int32? requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxCandidate = null;
if (cmdletContext.CompletionCriteria_MaxCandidate != null)
{
requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxCandidate = cmdletContext.CompletionCriteria_MaxCandidate.Value;
}
if (requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxCandidate != null)
{
requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria.MaxCandidates = requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxCandidate.Value;
requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteriaIsNull = false;
}
System.Int32? requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxRuntimePerTrainingJobInSecond = null;
if (cmdletContext.CompletionCriteria_MaxRuntimePerTrainingJobInSecond != null)
{
requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxRuntimePerTrainingJobInSecond = cmdletContext.CompletionCriteria_MaxRuntimePerTrainingJobInSecond.Value;
}
if (requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxRuntimePerTrainingJobInSecond != null)
{
requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria.MaxRuntimePerTrainingJobInSeconds = requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria_completionCriteria_MaxRuntimePerTrainingJobInSecond.Value;
requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteriaIsNull = false;
}
// determine if requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria should be set to null
if (requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteriaIsNull)
{
requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria = null;
}
if (requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria != null)
{
request.AutoMLJobConfig.CompletionCriteria = requestAutoMLJobConfig_autoMLJobConfig_CompletionCriteria;
requestAutoMLJobConfigIsNull = false;
}
Amazon.SageMaker.Model.AutoMLSecurityConfig requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig = null;
// populate SecurityConfig
var requestAutoMLJobConfig_autoMLJobConfig_SecurityConfigIsNull = true;
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig = new Amazon.SageMaker.Model.AutoMLSecurityConfig();
System.Boolean? requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_securityConfig_EnableInterContainerTrafficEncryption = null;
if (cmdletContext.SecurityConfig_EnableInterContainerTrafficEncryption != null)
{
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_securityConfig_EnableInterContainerTrafficEncryption = cmdletContext.SecurityConfig_EnableInterContainerTrafficEncryption.Value;
}
if (requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_securityConfig_EnableInterContainerTrafficEncryption != null)
{
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig.EnableInterContainerTrafficEncryption = requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_securityConfig_EnableInterContainerTrafficEncryption.Value;
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfigIsNull = false;
}
System.String requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_securityConfig_VolumeKmsKeyId = null;
if (cmdletContext.SecurityConfig_VolumeKmsKeyId != null)
{
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_securityConfig_VolumeKmsKeyId = cmdletContext.SecurityConfig_VolumeKmsKeyId;
}
if (requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_securityConfig_VolumeKmsKeyId != null)
{
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig.VolumeKmsKeyId = requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_securityConfig_VolumeKmsKeyId;
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfigIsNull = false;
}
Amazon.SageMaker.Model.VpcConfig requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig = null;
// populate VpcConfig
var requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfigIsNull = true;
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig = new Amazon.SageMaker.Model.VpcConfig();
List requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig_vpcConfig_SecurityGroupId = null;
if (cmdletContext.VpcConfig_SecurityGroupId != null)
{
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig_vpcConfig_SecurityGroupId = cmdletContext.VpcConfig_SecurityGroupId;
}
if (requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig_vpcConfig_SecurityGroupId != null)
{
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig.SecurityGroupIds = requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig_vpcConfig_SecurityGroupId;
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfigIsNull = false;
}
List requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig_vpcConfig_Subnet = null;
if (cmdletContext.VpcConfig_Subnet != null)
{
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig_vpcConfig_Subnet = cmdletContext.VpcConfig_Subnet;
}
if (requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig_vpcConfig_Subnet != null)
{
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig.Subnets = requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig_vpcConfig_Subnet;
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfigIsNull = false;
}
// determine if requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig should be set to null
if (requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfigIsNull)
{
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig = null;
}
if (requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig != null)
{
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig.VpcConfig = requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig_autoMLJobConfig_SecurityConfig_VpcConfig;
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfigIsNull = false;
}
// determine if requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig should be set to null
if (requestAutoMLJobConfig_autoMLJobConfig_SecurityConfigIsNull)
{
requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig = null;
}
if (requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig != null)
{
request.AutoMLJobConfig.SecurityConfig = requestAutoMLJobConfig_autoMLJobConfig_SecurityConfig;
requestAutoMLJobConfigIsNull = false;
}
// determine if request.AutoMLJobConfig should be set to null
if (requestAutoMLJobConfigIsNull)
{
request.AutoMLJobConfig = null;
}
if (cmdletContext.AutoMLJobName != null)
{
request.AutoMLJobName = cmdletContext.AutoMLJobName;
}
// populate AutoMLJobObjective
var requestAutoMLJobObjectiveIsNull = true;
request.AutoMLJobObjective = new Amazon.SageMaker.Model.AutoMLJobObjective();
Amazon.SageMaker.AutoMLMetricEnum requestAutoMLJobObjective_autoMLJobObjective_MetricName = null;
if (cmdletContext.AutoMLJobObjective_MetricName != null)
{
requestAutoMLJobObjective_autoMLJobObjective_MetricName = cmdletContext.AutoMLJobObjective_MetricName;
}
if (requestAutoMLJobObjective_autoMLJobObjective_MetricName != null)
{
request.AutoMLJobObjective.MetricName = requestAutoMLJobObjective_autoMLJobObjective_MetricName;
requestAutoMLJobObjectiveIsNull = false;
}
// determine if request.AutoMLJobObjective should be set to null
if (requestAutoMLJobObjectiveIsNull)
{
request.AutoMLJobObjective = null;
}
if (cmdletContext.GenerateCandidateDefinitionsOnly != null)
{
request.GenerateCandidateDefinitionsOnly = cmdletContext.GenerateCandidateDefinitionsOnly.Value;
}
if (cmdletContext.InputDataConfig != null)
{
request.InputDataConfig = cmdletContext.InputDataConfig;
}
// populate ModelDeployConfig
var requestModelDeployConfigIsNull = true;
request.ModelDeployConfig = new Amazon.SageMaker.Model.ModelDeployConfig();
System.Boolean? requestModelDeployConfig_modelDeployConfig_AutoGenerateEndpointName = null;
if (cmdletContext.ModelDeployConfig_AutoGenerateEndpointName != null)
{
requestModelDeployConfig_modelDeployConfig_AutoGenerateEndpointName = cmdletContext.ModelDeployConfig_AutoGenerateEndpointName.Value;
}
if (requestModelDeployConfig_modelDeployConfig_AutoGenerateEndpointName != null)
{
request.ModelDeployConfig.AutoGenerateEndpointName = requestModelDeployConfig_modelDeployConfig_AutoGenerateEndpointName.Value;
requestModelDeployConfigIsNull = false;
}
System.String requestModelDeployConfig_modelDeployConfig_EndpointName = null;
if (cmdletContext.ModelDeployConfig_EndpointName != null)
{
requestModelDeployConfig_modelDeployConfig_EndpointName = cmdletContext.ModelDeployConfig_EndpointName;
}
if (requestModelDeployConfig_modelDeployConfig_EndpointName != null)
{
request.ModelDeployConfig.EndpointName = requestModelDeployConfig_modelDeployConfig_EndpointName;
requestModelDeployConfigIsNull = false;
}
// determine if request.ModelDeployConfig should be set to null
if (requestModelDeployConfigIsNull)
{
request.ModelDeployConfig = null;
}
// populate OutputDataConfig
var requestOutputDataConfigIsNull = true;
request.OutputDataConfig = new Amazon.SageMaker.Model.AutoMLOutputDataConfig();
System.String requestOutputDataConfig_outputDataConfig_KmsKeyId = null;
if (cmdletContext.OutputDataConfig_KmsKeyId != null)
{
requestOutputDataConfig_outputDataConfig_KmsKeyId = cmdletContext.OutputDataConfig_KmsKeyId;
}
if (requestOutputDataConfig_outputDataConfig_KmsKeyId != null)
{
request.OutputDataConfig.KmsKeyId = requestOutputDataConfig_outputDataConfig_KmsKeyId;
requestOutputDataConfigIsNull = false;
}
System.String requestOutputDataConfig_outputDataConfig_S3OutputPath = null;
if (cmdletContext.OutputDataConfig_S3OutputPath != null)
{
requestOutputDataConfig_outputDataConfig_S3OutputPath = cmdletContext.OutputDataConfig_S3OutputPath;
}
if (requestOutputDataConfig_outputDataConfig_S3OutputPath != null)
{
request.OutputDataConfig.S3OutputPath = requestOutputDataConfig_outputDataConfig_S3OutputPath;
requestOutputDataConfigIsNull = false;
}
// determine if request.OutputDataConfig should be set to null
if (requestOutputDataConfigIsNull)
{
request.OutputDataConfig = null;
}
if (cmdletContext.ProblemType != null)
{
request.ProblemType = cmdletContext.ProblemType;
}
if (cmdletContext.RoleArn != null)
{
request.RoleArn = cmdletContext.RoleArn;
}
if (cmdletContext.Tag != null)
{
request.Tags = cmdletContext.Tag;
}
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.SageMaker.Model.CreateAutoMLJobResponse CallAWSServiceOperation(IAmazonSageMaker client, Amazon.SageMaker.Model.CreateAutoMLJobRequest request)
{
Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon SageMaker Service", "CreateAutoMLJob");
try
{
#if DESKTOP
return client.CreateAutoMLJob(request);
#elif CORECLR
return client.CreateAutoMLJobAsync(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 CandidateGenerationConfig_AlgorithmsConfig { get; set; }
public System.String CandidateGenerationConfig_FeatureSpecificationS3Uri { get; set; }
public System.Int32? CompletionCriteria_MaxAutoMLJobRuntimeInSecond { get; set; }
public System.Int32? CompletionCriteria_MaxCandidate { get; set; }
public System.Int32? CompletionCriteria_MaxRuntimePerTrainingJobInSecond { get; set; }
public System.Single? DataSplitConfig_ValidationFraction { get; set; }
public Amazon.SageMaker.AutoMLMode AutoMLJobConfig_Mode { get; set; }
public System.Boolean? SecurityConfig_EnableInterContainerTrafficEncryption { get; set; }
public System.String SecurityConfig_VolumeKmsKeyId { get; set; }
public List VpcConfig_SecurityGroupId { get; set; }
public List VpcConfig_Subnet { get; set; }
public System.String AutoMLJobName { get; set; }
public Amazon.SageMaker.AutoMLMetricEnum AutoMLJobObjective_MetricName { get; set; }
public System.Boolean? GenerateCandidateDefinitionsOnly { get; set; }
public List InputDataConfig { get; set; }
public System.Boolean? ModelDeployConfig_AutoGenerateEndpointName { get; set; }
public System.String ModelDeployConfig_EndpointName { get; set; }
public System.String OutputDataConfig_KmsKeyId { get; set; }
public System.String OutputDataConfig_S3OutputPath { get; set; }
public Amazon.SageMaker.ProblemType ProblemType { get; set; }
public System.String RoleArn { get; set; }
public List Tag { get; set; }
public System.Func Select { get; set; } =
(response, cmdlet) => response.AutoMLJobArn;
}
}
}