Пример #1
0
 private Amazon.Glue.Model.CreateMLTransformResponse CallAWSServiceOperation(IAmazonGlue client, Amazon.Glue.Model.CreateMLTransformRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Glue", "CreateMLTransform");
     try
     {
         #if DESKTOP
         return(client.CreateMLTransform(request));
         #elif CORECLR
         return(client.CreateMLTransformAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
Пример #2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.Glue.Model.CreateMLTransformRequest();

            if (cmdletContext.Description != null)
            {
                request.Description = cmdletContext.Description;
            }
            if (cmdletContext.GlueVersion != null)
            {
                request.GlueVersion = cmdletContext.GlueVersion;
            }
            if (cmdletContext.InputRecordTable != null)
            {
                request.InputRecordTables = cmdletContext.InputRecordTable;
            }
            if (cmdletContext.MaxCapacity != null)
            {
                request.MaxCapacity = cmdletContext.MaxCapacity.Value;
            }
            if (cmdletContext.MaxRetry != null)
            {
                request.MaxRetries = cmdletContext.MaxRetry.Value;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.NumberOfWorker != null)
            {
                request.NumberOfWorkers = cmdletContext.NumberOfWorker.Value;
            }

            // populate Parameters
            var requestParametersIsNull = true;

            request.Parameters = new Amazon.Glue.Model.TransformParameters();
            Amazon.Glue.TransformType requestParameters_parameters_TransformType = null;
            if (cmdletContext.Parameters_TransformType != null)
            {
                requestParameters_parameters_TransformType = cmdletContext.Parameters_TransformType;
            }
            if (requestParameters_parameters_TransformType != null)
            {
                request.Parameters.TransformType = requestParameters_parameters_TransformType;
                requestParametersIsNull          = false;
            }
            Amazon.Glue.Model.FindMatchesParameters requestParameters_parameters_FindMatchesParameters = null;

            // populate FindMatchesParameters
            var requestParameters_parameters_FindMatchesParametersIsNull = true;

            requestParameters_parameters_FindMatchesParameters = new Amazon.Glue.Model.FindMatchesParameters();
            System.Double?requestParameters_parameters_FindMatchesParameters_findMatchesParameters_AccuracyCostTradeoff = null;
            if (cmdletContext.FindMatchesParameters_AccuracyCostTradeoff != null)
            {
                requestParameters_parameters_FindMatchesParameters_findMatchesParameters_AccuracyCostTradeoff = cmdletContext.FindMatchesParameters_AccuracyCostTradeoff.Value;
            }
            if (requestParameters_parameters_FindMatchesParameters_findMatchesParameters_AccuracyCostTradeoff != null)
            {
                requestParameters_parameters_FindMatchesParameters.AccuracyCostTradeoff = requestParameters_parameters_FindMatchesParameters_findMatchesParameters_AccuracyCostTradeoff.Value;
                requestParameters_parameters_FindMatchesParametersIsNull = false;
            }
            System.Boolean?requestParameters_parameters_FindMatchesParameters_findMatchesParameters_EnforceProvidedLabel = null;
            if (cmdletContext.FindMatchesParameters_EnforceProvidedLabel != null)
            {
                requestParameters_parameters_FindMatchesParameters_findMatchesParameters_EnforceProvidedLabel = cmdletContext.FindMatchesParameters_EnforceProvidedLabel.Value;
            }
            if (requestParameters_parameters_FindMatchesParameters_findMatchesParameters_EnforceProvidedLabel != null)
            {
                requestParameters_parameters_FindMatchesParameters.EnforceProvidedLabels = requestParameters_parameters_FindMatchesParameters_findMatchesParameters_EnforceProvidedLabel.Value;
                requestParameters_parameters_FindMatchesParametersIsNull = false;
            }
            System.Double?requestParameters_parameters_FindMatchesParameters_findMatchesParameters_PrecisionRecallTradeoff = null;
            if (cmdletContext.FindMatchesParameters_PrecisionRecallTradeoff != null)
            {
                requestParameters_parameters_FindMatchesParameters_findMatchesParameters_PrecisionRecallTradeoff = cmdletContext.FindMatchesParameters_PrecisionRecallTradeoff.Value;
            }
            if (requestParameters_parameters_FindMatchesParameters_findMatchesParameters_PrecisionRecallTradeoff != null)
            {
                requestParameters_parameters_FindMatchesParameters.PrecisionRecallTradeoff = requestParameters_parameters_FindMatchesParameters_findMatchesParameters_PrecisionRecallTradeoff.Value;
                requestParameters_parameters_FindMatchesParametersIsNull = false;
            }
            System.String requestParameters_parameters_FindMatchesParameters_findMatchesParameters_PrimaryKeyColumnName = null;
            if (cmdletContext.FindMatchesParameters_PrimaryKeyColumnName != null)
            {
                requestParameters_parameters_FindMatchesParameters_findMatchesParameters_PrimaryKeyColumnName = cmdletContext.FindMatchesParameters_PrimaryKeyColumnName;
            }
            if (requestParameters_parameters_FindMatchesParameters_findMatchesParameters_PrimaryKeyColumnName != null)
            {
                requestParameters_parameters_FindMatchesParameters.PrimaryKeyColumnName = requestParameters_parameters_FindMatchesParameters_findMatchesParameters_PrimaryKeyColumnName;
                requestParameters_parameters_FindMatchesParametersIsNull = false;
            }
            // determine if requestParameters_parameters_FindMatchesParameters should be set to null
            if (requestParameters_parameters_FindMatchesParametersIsNull)
            {
                requestParameters_parameters_FindMatchesParameters = null;
            }
            if (requestParameters_parameters_FindMatchesParameters != null)
            {
                request.Parameters.FindMatchesParameters = requestParameters_parameters_FindMatchesParameters;
                requestParametersIsNull = false;
            }
            // determine if request.Parameters should be set to null
            if (requestParametersIsNull)
            {
                request.Parameters = null;
            }
            if (cmdletContext.Role != null)
            {
                request.Role = cmdletContext.Role;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }
            if (cmdletContext.Timeout != null)
            {
                request.Timeout = cmdletContext.Timeout.Value;
            }

            // populate TransformEncryption
            var requestTransformEncryptionIsNull = true;

            request.TransformEncryption = new Amazon.Glue.Model.TransformEncryption();
            System.String requestTransformEncryption_transformEncryption_TaskRunSecurityConfigurationName = null;
            if (cmdletContext.TransformEncryption_TaskRunSecurityConfigurationName != null)
            {
                requestTransformEncryption_transformEncryption_TaskRunSecurityConfigurationName = cmdletContext.TransformEncryption_TaskRunSecurityConfigurationName;
            }
            if (requestTransformEncryption_transformEncryption_TaskRunSecurityConfigurationName != null)
            {
                request.TransformEncryption.TaskRunSecurityConfigurationName = requestTransformEncryption_transformEncryption_TaskRunSecurityConfigurationName;
                requestTransformEncryptionIsNull = false;
            }
            Amazon.Glue.Model.MLUserDataEncryption requestTransformEncryption_transformEncryption_MlUserDataEncryption = null;

            // populate MlUserDataEncryption
            var requestTransformEncryption_transformEncryption_MlUserDataEncryptionIsNull = true;

            requestTransformEncryption_transformEncryption_MlUserDataEncryption = new Amazon.Glue.Model.MLUserDataEncryption();
            System.String requestTransformEncryption_transformEncryption_MlUserDataEncryption_mlUserDataEncryption_KmsKeyId = null;
            if (cmdletContext.MlUserDataEncryption_KmsKeyId != null)
            {
                requestTransformEncryption_transformEncryption_MlUserDataEncryption_mlUserDataEncryption_KmsKeyId = cmdletContext.MlUserDataEncryption_KmsKeyId;
            }
            if (requestTransformEncryption_transformEncryption_MlUserDataEncryption_mlUserDataEncryption_KmsKeyId != null)
            {
                requestTransformEncryption_transformEncryption_MlUserDataEncryption.KmsKeyId = requestTransformEncryption_transformEncryption_MlUserDataEncryption_mlUserDataEncryption_KmsKeyId;
                requestTransformEncryption_transformEncryption_MlUserDataEncryptionIsNull    = false;
            }
            Amazon.Glue.MLUserDataEncryptionModeString requestTransformEncryption_transformEncryption_MlUserDataEncryption_mlUserDataEncryption_MlUserDataEncryptionMode = null;
            if (cmdletContext.MlUserDataEncryption_MlUserDataEncryptionMode != null)
            {
                requestTransformEncryption_transformEncryption_MlUserDataEncryption_mlUserDataEncryption_MlUserDataEncryptionMode = cmdletContext.MlUserDataEncryption_MlUserDataEncryptionMode;
            }
            if (requestTransformEncryption_transformEncryption_MlUserDataEncryption_mlUserDataEncryption_MlUserDataEncryptionMode != null)
            {
                requestTransformEncryption_transformEncryption_MlUserDataEncryption.MlUserDataEncryptionMode = requestTransformEncryption_transformEncryption_MlUserDataEncryption_mlUserDataEncryption_MlUserDataEncryptionMode;
                requestTransformEncryption_transformEncryption_MlUserDataEncryptionIsNull = false;
            }
            // determine if requestTransformEncryption_transformEncryption_MlUserDataEncryption should be set to null
            if (requestTransformEncryption_transformEncryption_MlUserDataEncryptionIsNull)
            {
                requestTransformEncryption_transformEncryption_MlUserDataEncryption = null;
            }
            if (requestTransformEncryption_transformEncryption_MlUserDataEncryption != null)
            {
                request.TransformEncryption.MlUserDataEncryption = requestTransformEncryption_transformEncryption_MlUserDataEncryption;
                requestTransformEncryptionIsNull = false;
            }
            // determine if request.TransformEncryption should be set to null
            if (requestTransformEncryptionIsNull)
            {
                request.TransformEncryption = null;
            }
            if (cmdletContext.WorkerType != null)
            {
                request.WorkerType = cmdletContext.WorkerType;
            }

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