private Amazon.SageMaker.Model.CreateProjectResponse CallAWSServiceOperation(IAmazonSageMaker client, Amazon.SageMaker.Model.CreateProjectRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon SageMaker Service", "CreateProject");
     try
     {
         #if DESKTOP
         return(client.CreateProject(request));
         #elif CORECLR
         return(client.CreateProjectAsync(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.SageMaker.Model.CreateProjectRequest();

            if (cmdletContext.ProjectDescription != null)
            {
                request.ProjectDescription = cmdletContext.ProjectDescription;
            }
            if (cmdletContext.ProjectName != null)
            {
                request.ProjectName = cmdletContext.ProjectName;
            }

            // populate ServiceCatalogProvisioningDetails
            var requestServiceCatalogProvisioningDetailsIsNull = true;

            request.ServiceCatalogProvisioningDetails = new Amazon.SageMaker.Model.ServiceCatalogProvisioningDetails();
            System.String requestServiceCatalogProvisioningDetails_serviceCatalogProvisioningDetails_PathId = null;
            if (cmdletContext.ServiceCatalogProvisioningDetails_PathId != null)
            {
                requestServiceCatalogProvisioningDetails_serviceCatalogProvisioningDetails_PathId = cmdletContext.ServiceCatalogProvisioningDetails_PathId;
            }
            if (requestServiceCatalogProvisioningDetails_serviceCatalogProvisioningDetails_PathId != null)
            {
                request.ServiceCatalogProvisioningDetails.PathId = requestServiceCatalogProvisioningDetails_serviceCatalogProvisioningDetails_PathId;
                requestServiceCatalogProvisioningDetailsIsNull   = false;
            }
            System.String requestServiceCatalogProvisioningDetails_serviceCatalogProvisioningDetails_ProductId = null;
            if (cmdletContext.ServiceCatalogProvisioningDetails_ProductId != null)
            {
                requestServiceCatalogProvisioningDetails_serviceCatalogProvisioningDetails_ProductId = cmdletContext.ServiceCatalogProvisioningDetails_ProductId;
            }
            if (requestServiceCatalogProvisioningDetails_serviceCatalogProvisioningDetails_ProductId != null)
            {
                request.ServiceCatalogProvisioningDetails.ProductId = requestServiceCatalogProvisioningDetails_serviceCatalogProvisioningDetails_ProductId;
                requestServiceCatalogProvisioningDetailsIsNull      = false;
            }
            System.String requestServiceCatalogProvisioningDetails_serviceCatalogProvisioningDetails_ProvisioningArtifactId = null;
            if (cmdletContext.ServiceCatalogProvisioningDetails_ProvisioningArtifactId != null)
            {
                requestServiceCatalogProvisioningDetails_serviceCatalogProvisioningDetails_ProvisioningArtifactId = cmdletContext.ServiceCatalogProvisioningDetails_ProvisioningArtifactId;
            }
            if (requestServiceCatalogProvisioningDetails_serviceCatalogProvisioningDetails_ProvisioningArtifactId != null)
            {
                request.ServiceCatalogProvisioningDetails.ProvisioningArtifactId = requestServiceCatalogProvisioningDetails_serviceCatalogProvisioningDetails_ProvisioningArtifactId;
                requestServiceCatalogProvisioningDetailsIsNull = false;
            }
            List <Amazon.SageMaker.Model.ProvisioningParameter> requestServiceCatalogProvisioningDetails_serviceCatalogProvisioningDetails_ProvisioningParameter = null;

            if (cmdletContext.ServiceCatalogProvisioningDetails_ProvisioningParameter != null)
            {
                requestServiceCatalogProvisioningDetails_serviceCatalogProvisioningDetails_ProvisioningParameter = cmdletContext.ServiceCatalogProvisioningDetails_ProvisioningParameter;
            }
            if (requestServiceCatalogProvisioningDetails_serviceCatalogProvisioningDetails_ProvisioningParameter != null)
            {
                request.ServiceCatalogProvisioningDetails.ProvisioningParameters = requestServiceCatalogProvisioningDetails_serviceCatalogProvisioningDetails_ProvisioningParameter;
                requestServiceCatalogProvisioningDetailsIsNull = false;
            }
            // determine if request.ServiceCatalogProvisioningDetails should be set to null
            if (requestServiceCatalogProvisioningDetailsIsNull)
            {
                request.ServiceCatalogProvisioningDetails = null;
            }
            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);
        }