private Amazon.MigrationHubRefactorSpaces.Model.CreateApplicationResponse CallAWSServiceOperation(IAmazonMigrationHubRefactorSpaces client, Amazon.MigrationHubRefactorSpaces.Model.CreateApplicationRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Migration Hub Refactor Spaces", "CreateApplication");
     try
     {
         #if DESKTOP
         return(client.CreateApplication(request));
         #elif CORECLR
         return(client.CreateApplicationAsync(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.MigrationHubRefactorSpaces.Model.CreateApplicationRequest();


            // populate ApiGatewayProxy
            var requestApiGatewayProxyIsNull = true;

            request.ApiGatewayProxy = new Amazon.MigrationHubRefactorSpaces.Model.ApiGatewayProxyInput();
            Amazon.MigrationHubRefactorSpaces.ApiGatewayEndpointType requestApiGatewayProxy_apiGatewayProxy_EndpointType = null;
            if (cmdletContext.ApiGatewayProxy_EndpointType != null)
            {
                requestApiGatewayProxy_apiGatewayProxy_EndpointType = cmdletContext.ApiGatewayProxy_EndpointType;
            }
            if (requestApiGatewayProxy_apiGatewayProxy_EndpointType != null)
            {
                request.ApiGatewayProxy.EndpointType = requestApiGatewayProxy_apiGatewayProxy_EndpointType;
                requestApiGatewayProxyIsNull         = false;
            }
            System.String requestApiGatewayProxy_apiGatewayProxy_StageName = null;
            if (cmdletContext.ApiGatewayProxy_StageName != null)
            {
                requestApiGatewayProxy_apiGatewayProxy_StageName = cmdletContext.ApiGatewayProxy_StageName;
            }
            if (requestApiGatewayProxy_apiGatewayProxy_StageName != null)
            {
                request.ApiGatewayProxy.StageName = requestApiGatewayProxy_apiGatewayProxy_StageName;
                requestApiGatewayProxyIsNull      = false;
            }
            // determine if request.ApiGatewayProxy should be set to null
            if (requestApiGatewayProxyIsNull)
            {
                request.ApiGatewayProxy = null;
            }
            if (cmdletContext.ClientToken != null)
            {
                request.ClientToken = cmdletContext.ClientToken;
            }
            if (cmdletContext.EnvironmentIdentifier != null)
            {
                request.EnvironmentIdentifier = cmdletContext.EnvironmentIdentifier;
            }
            if (cmdletContext.Name != null)
            {
                request.Name = cmdletContext.Name;
            }
            if (cmdletContext.ProxyType != null)
            {
                request.ProxyType = cmdletContext.ProxyType;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }
            if (cmdletContext.VpcId != null)
            {
                request.VpcId = cmdletContext.VpcId;
            }

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