private Amazon.CodeStar.Model.CreateProjectResponse CallAWSServiceOperation(IAmazonCodeStar client, Amazon.CodeStar.Model.CreateProjectRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS CodeStar", "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.CodeStar.Model.CreateProjectRequest();

            if (cmdletContext.ClientRequestToken != null)
            {
                request.ClientRequestToken = cmdletContext.ClientRequestToken;
            }
            if (cmdletContext.Description != null)
            {
                request.Description = cmdletContext.Description;
            }
            if (cmdletContext.Id != null)
            {
                request.Id = cmdletContext.Id;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.SourceCode != null)
            {
                request.SourceCode = cmdletContext.SourceCode;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }

            // populate Toolchain
            var requestToolchainIsNull = true;

            request.Toolchain = new Amazon.CodeStar.Model.Toolchain();
            System.String requestToolchain_toolchain_RoleArn = null;
            if (cmdletContext.Toolchain_RoleArn != null)
            {
                requestToolchain_toolchain_RoleArn = cmdletContext.Toolchain_RoleArn;
            }
            if (requestToolchain_toolchain_RoleArn != null)
            {
                request.Toolchain.RoleArn = requestToolchain_toolchain_RoleArn;
                requestToolchainIsNull    = false;
            }
            Dictionary <System.String, System.String> requestToolchain_toolchain_StackParameter = null;

            if (cmdletContext.Toolchain_StackParameter != null)
            {
                requestToolchain_toolchain_StackParameter = cmdletContext.Toolchain_StackParameter;
            }
            if (requestToolchain_toolchain_StackParameter != null)
            {
                request.Toolchain.StackParameters = requestToolchain_toolchain_StackParameter;
                requestToolchainIsNull            = false;
            }
            Amazon.CodeStar.Model.ToolchainSource requestToolchain_toolchain_Source = null;

            // populate Source
            var requestToolchain_toolchain_SourceIsNull = true;

            requestToolchain_toolchain_Source = new Amazon.CodeStar.Model.ToolchainSource();
            Amazon.CodeStar.Model.S3Location requestToolchain_toolchain_Source_toolchain_Source_S3 = null;

            // populate S3
            var requestToolchain_toolchain_Source_toolchain_Source_S3IsNull = true;

            requestToolchain_toolchain_Source_toolchain_Source_S3 = new Amazon.CodeStar.Model.S3Location();
            System.String requestToolchain_toolchain_Source_toolchain_Source_S3_s3_BucketKey = null;
            if (cmdletContext.S3_BucketKey != null)
            {
                requestToolchain_toolchain_Source_toolchain_Source_S3_s3_BucketKey = cmdletContext.S3_BucketKey;
            }
            if (requestToolchain_toolchain_Source_toolchain_Source_S3_s3_BucketKey != null)
            {
                requestToolchain_toolchain_Source_toolchain_Source_S3.BucketKey = requestToolchain_toolchain_Source_toolchain_Source_S3_s3_BucketKey;
                requestToolchain_toolchain_Source_toolchain_Source_S3IsNull     = false;
            }
            System.String requestToolchain_toolchain_Source_toolchain_Source_S3_s3_BucketName = null;
            if (cmdletContext.S3_BucketName != null)
            {
                requestToolchain_toolchain_Source_toolchain_Source_S3_s3_BucketName = cmdletContext.S3_BucketName;
            }
            if (requestToolchain_toolchain_Source_toolchain_Source_S3_s3_BucketName != null)
            {
                requestToolchain_toolchain_Source_toolchain_Source_S3.BucketName = requestToolchain_toolchain_Source_toolchain_Source_S3_s3_BucketName;
                requestToolchain_toolchain_Source_toolchain_Source_S3IsNull      = false;
            }
            // determine if requestToolchain_toolchain_Source_toolchain_Source_S3 should be set to null
            if (requestToolchain_toolchain_Source_toolchain_Source_S3IsNull)
            {
                requestToolchain_toolchain_Source_toolchain_Source_S3 = null;
            }
            if (requestToolchain_toolchain_Source_toolchain_Source_S3 != null)
            {
                requestToolchain_toolchain_Source.S3    = requestToolchain_toolchain_Source_toolchain_Source_S3;
                requestToolchain_toolchain_SourceIsNull = false;
            }
            // determine if requestToolchain_toolchain_Source should be set to null
            if (requestToolchain_toolchain_SourceIsNull)
            {
                requestToolchain_toolchain_Source = null;
            }
            if (requestToolchain_toolchain_Source != null)
            {
                request.Toolchain.Source = requestToolchain_toolchain_Source;
                requestToolchainIsNull   = false;
            }
            // determine if request.Toolchain should be set to null
            if (requestToolchainIsNull)
            {
                request.Toolchain = 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);
        }