private Amazon.FraudDetector.Model.PutExternalModelResponse CallAWSServiceOperation(IAmazonFraudDetector client, Amazon.FraudDetector.Model.PutExternalModelRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Fraud Detector", "PutExternalModel");
     try
     {
         #if DESKTOP
         return(client.PutExternalModel(request));
         #elif CORECLR
         return(client.PutExternalModelAsync(request).GetAwaiter().GetResult());
         #else
                 #error "Unknown build edition"
         #endif
     }
     catch (AmazonServiceException exc)
     {
         var webException = exc.InnerException as System.Net.WebException;
         if (webException != null)
         {
             throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException);
         }
         throw;
     }
 }
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.FraudDetector.Model.PutExternalModelRequest();


            // populate InputConfiguration
            var requestInputConfigurationIsNull = true;

            request.InputConfiguration = new Amazon.FraudDetector.Model.ModelInputConfiguration();
            System.String requestInputConfiguration_inputConfiguration_CsvInputTemplate = null;
            if (cmdletContext.InputConfiguration_CsvInputTemplate != null)
            {
                requestInputConfiguration_inputConfiguration_CsvInputTemplate = cmdletContext.InputConfiguration_CsvInputTemplate;
            }
            if (requestInputConfiguration_inputConfiguration_CsvInputTemplate != null)
            {
                request.InputConfiguration.CsvInputTemplate = requestInputConfiguration_inputConfiguration_CsvInputTemplate;
                requestInputConfigurationIsNull             = false;
            }
            Amazon.FraudDetector.ModelInputDataFormat requestInputConfiguration_inputConfiguration_Format = null;
            if (cmdletContext.InputConfiguration_Format != null)
            {
                requestInputConfiguration_inputConfiguration_Format = cmdletContext.InputConfiguration_Format;
            }
            if (requestInputConfiguration_inputConfiguration_Format != null)
            {
                request.InputConfiguration.Format = requestInputConfiguration_inputConfiguration_Format;
                requestInputConfigurationIsNull   = false;
            }
            System.Boolean?requestInputConfiguration_inputConfiguration_IsOpaque = null;
            if (cmdletContext.InputConfiguration_IsOpaque != null)
            {
                requestInputConfiguration_inputConfiguration_IsOpaque = cmdletContext.InputConfiguration_IsOpaque.Value;
            }
            if (requestInputConfiguration_inputConfiguration_IsOpaque != null)
            {
                request.InputConfiguration.IsOpaque = requestInputConfiguration_inputConfiguration_IsOpaque.Value;
                requestInputConfigurationIsNull     = false;
            }
            System.String requestInputConfiguration_inputConfiguration_JsonInputTemplate = null;
            if (cmdletContext.InputConfiguration_JsonInputTemplate != null)
            {
                requestInputConfiguration_inputConfiguration_JsonInputTemplate = cmdletContext.InputConfiguration_JsonInputTemplate;
            }
            if (requestInputConfiguration_inputConfiguration_JsonInputTemplate != null)
            {
                request.InputConfiguration.JsonInputTemplate = requestInputConfiguration_inputConfiguration_JsonInputTemplate;
                requestInputConfigurationIsNull = false;
            }
            // determine if request.InputConfiguration should be set to null
            if (requestInputConfigurationIsNull)
            {
                request.InputConfiguration = null;
            }
            if (cmdletContext.ModelEndpoint != null)
            {
                request.ModelEndpoint = cmdletContext.ModelEndpoint;
            }
            if (cmdletContext.ModelEndpointStatus != null)
            {
                request.ModelEndpointStatus = cmdletContext.ModelEndpointStatus;
            }
            if (cmdletContext.ModelSource != null)
            {
                request.ModelSource = cmdletContext.ModelSource;
            }

            // populate OutputConfiguration
            var requestOutputConfigurationIsNull = true;

            request.OutputConfiguration = new Amazon.FraudDetector.Model.ModelOutputConfiguration();
            Dictionary <System.String, System.String> requestOutputConfiguration_outputConfiguration_CsvIndexToVariableMap = null;

            if (cmdletContext.OutputConfiguration_CsvIndexToVariableMap != null)
            {
                requestOutputConfiguration_outputConfiguration_CsvIndexToVariableMap = cmdletContext.OutputConfiguration_CsvIndexToVariableMap;
            }
            if (requestOutputConfiguration_outputConfiguration_CsvIndexToVariableMap != null)
            {
                request.OutputConfiguration.CsvIndexToVariableMap = requestOutputConfiguration_outputConfiguration_CsvIndexToVariableMap;
                requestOutputConfigurationIsNull = false;
            }
            Amazon.FraudDetector.ModelOutputDataFormat requestOutputConfiguration_outputConfiguration_Format = null;
            if (cmdletContext.OutputConfiguration_Format != null)
            {
                requestOutputConfiguration_outputConfiguration_Format = cmdletContext.OutputConfiguration_Format;
            }
            if (requestOutputConfiguration_outputConfiguration_Format != null)
            {
                request.OutputConfiguration.Format = requestOutputConfiguration_outputConfiguration_Format;
                requestOutputConfigurationIsNull   = false;
            }
            Dictionary <System.String, System.String> requestOutputConfiguration_outputConfiguration_JsonKeyToVariableMap = null;

            if (cmdletContext.OutputConfiguration_JsonKeyToVariableMap != null)
            {
                requestOutputConfiguration_outputConfiguration_JsonKeyToVariableMap = cmdletContext.OutputConfiguration_JsonKeyToVariableMap;
            }
            if (requestOutputConfiguration_outputConfiguration_JsonKeyToVariableMap != null)
            {
                request.OutputConfiguration.JsonKeyToVariableMap = requestOutputConfiguration_outputConfiguration_JsonKeyToVariableMap;
                requestOutputConfigurationIsNull = false;
            }
            // determine if request.OutputConfiguration should be set to null
            if (requestOutputConfigurationIsNull)
            {
                request.OutputConfiguration = null;
            }

            // populate Role
            var requestRoleIsNull = true;

            request.Role = new Amazon.FraudDetector.Model.Role();
            System.String requestRole_role_Arn = null;
            if (cmdletContext.Role_Arn != null)
            {
                requestRole_role_Arn = cmdletContext.Role_Arn;
            }
            if (requestRole_role_Arn != null)
            {
                request.Role.Arn  = requestRole_role_Arn;
                requestRoleIsNull = false;
            }
            System.String requestRole_role_Name = null;
            if (cmdletContext.Role_Name != null)
            {
                requestRole_role_Name = cmdletContext.Role_Name;
            }
            if (requestRole_role_Name != null)
            {
                request.Role.Name = requestRole_role_Name;
                requestRoleIsNull = false;
            }
            // determine if request.Role should be set to null
            if (requestRoleIsNull)
            {
                request.Role = 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);
        }