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

            if (cmdletContext.ApplicationIdentifier != null)
            {
                request.ApplicationIdentifier = cmdletContext.ApplicationIdentifier;
            }
            if (cmdletContext.ClientToken != null)
            {
                request.ClientToken = cmdletContext.ClientToken;
            }
            if (cmdletContext.EnvironmentIdentifier != null)
            {
                request.EnvironmentIdentifier = cmdletContext.EnvironmentIdentifier;
            }
            if (cmdletContext.RouteType != null)
            {
                request.RouteType = cmdletContext.RouteType;
            }
            if (cmdletContext.ServiceIdentifier != null)
            {
                request.ServiceIdentifier = cmdletContext.ServiceIdentifier;
            }
            if (cmdletContext.Tag != null)
            {
                request.Tags = cmdletContext.Tag;
            }

            // populate UriPathRoute
            var requestUriPathRouteIsNull = true;

            request.UriPathRoute = new Amazon.MigrationHubRefactorSpaces.Model.UriPathRouteInput();
            Amazon.MigrationHubRefactorSpaces.RouteActivationState requestUriPathRoute_uriPathRoute_ActivationState = null;
            if (cmdletContext.UriPathRoute_ActivationState != null)
            {
                requestUriPathRoute_uriPathRoute_ActivationState = cmdletContext.UriPathRoute_ActivationState;
            }
            if (requestUriPathRoute_uriPathRoute_ActivationState != null)
            {
                request.UriPathRoute.ActivationState = requestUriPathRoute_uriPathRoute_ActivationState;
                requestUriPathRouteIsNull            = false;
            }
            System.Boolean?requestUriPathRoute_uriPathRoute_IncludeChildPath = null;
            if (cmdletContext.UriPathRoute_IncludeChildPath != null)
            {
                requestUriPathRoute_uriPathRoute_IncludeChildPath = cmdletContext.UriPathRoute_IncludeChildPath.Value;
            }
            if (requestUriPathRoute_uriPathRoute_IncludeChildPath != null)
            {
                request.UriPathRoute.IncludeChildPaths = requestUriPathRoute_uriPathRoute_IncludeChildPath.Value;
                requestUriPathRouteIsNull = false;
            }
            List <System.String> requestUriPathRoute_uriPathRoute_Method = null;

            if (cmdletContext.UriPathRoute_Method != null)
            {
                requestUriPathRoute_uriPathRoute_Method = cmdletContext.UriPathRoute_Method;
            }
            if (requestUriPathRoute_uriPathRoute_Method != null)
            {
                request.UriPathRoute.Methods = requestUriPathRoute_uriPathRoute_Method;
                requestUriPathRouteIsNull    = false;
            }
            System.String requestUriPathRoute_uriPathRoute_SourcePath = null;
            if (cmdletContext.UriPathRoute_SourcePath != null)
            {
                requestUriPathRoute_uriPathRoute_SourcePath = cmdletContext.UriPathRoute_SourcePath;
            }
            if (requestUriPathRoute_uriPathRoute_SourcePath != null)
            {
                request.UriPathRoute.SourcePath = requestUriPathRoute_uriPathRoute_SourcePath;
                requestUriPathRouteIsNull       = false;
            }
            // determine if request.UriPathRoute should be set to null
            if (requestUriPathRouteIsNull)
            {
                request.UriPathRoute = 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);
        }