private Amazon.NetworkManager.Model.GetNetworkRoutesResponse CallAWSServiceOperation(IAmazonNetworkManager client, Amazon.NetworkManager.Model.GetNetworkRoutesRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Network Manager", "GetNetworkRoutes");
     try
     {
         #if DESKTOP
         return(client.GetNetworkRoutes(request));
         #elif CORECLR
         return(client.GetNetworkRoutesAsync(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.NetworkManager.Model.GetNetworkRoutesRequest();

            if (cmdletContext.DestinationFilter != null)
            {
                request.DestinationFilters = cmdletContext.DestinationFilter;
            }
            if (cmdletContext.ExactCidrMatch != null)
            {
                request.ExactCidrMatches = cmdletContext.ExactCidrMatch;
            }
            if (cmdletContext.GlobalNetworkId != null)
            {
                request.GlobalNetworkId = cmdletContext.GlobalNetworkId;
            }
            if (cmdletContext.LongestPrefixMatch != null)
            {
                request.LongestPrefixMatches = cmdletContext.LongestPrefixMatch;
            }
            if (cmdletContext.PrefixListId != null)
            {
                request.PrefixListIds = cmdletContext.PrefixListId;
            }

            // populate RouteTableIdentifier
            var requestRouteTableIdentifierIsNull = true;

            request.RouteTableIdentifier = new Amazon.NetworkManager.Model.RouteTableIdentifier();
            System.String requestRouteTableIdentifier_routeTableIdentifier_TransitGatewayRouteTableArn = null;
            if (cmdletContext.RouteTableIdentifier_TransitGatewayRouteTableArn != null)
            {
                requestRouteTableIdentifier_routeTableIdentifier_TransitGatewayRouteTableArn = cmdletContext.RouteTableIdentifier_TransitGatewayRouteTableArn;
            }
            if (requestRouteTableIdentifier_routeTableIdentifier_TransitGatewayRouteTableArn != null)
            {
                request.RouteTableIdentifier.TransitGatewayRouteTableArn = requestRouteTableIdentifier_routeTableIdentifier_TransitGatewayRouteTableArn;
                requestRouteTableIdentifierIsNull = false;
            }
            Amazon.NetworkManager.Model.CoreNetworkSegmentEdgeIdentifier requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge = null;

            // populate CoreNetworkSegmentEdge
            var requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdgeIsNull = true;

            requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge = new Amazon.NetworkManager.Model.CoreNetworkSegmentEdgeIdentifier();
            System.String requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge_coreNetworkSegmentEdge_CoreNetworkId = null;
            if (cmdletContext.CoreNetworkSegmentEdge_CoreNetworkId != null)
            {
                requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge_coreNetworkSegmentEdge_CoreNetworkId = cmdletContext.CoreNetworkSegmentEdge_CoreNetworkId;
            }
            if (requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge_coreNetworkSegmentEdge_CoreNetworkId != null)
            {
                requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge.CoreNetworkId = requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge_coreNetworkSegmentEdge_CoreNetworkId;
                requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdgeIsNull         = false;
            }
            System.String requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge_coreNetworkSegmentEdge_EdgeLocation = null;
            if (cmdletContext.CoreNetworkSegmentEdge_EdgeLocation != null)
            {
                requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge_coreNetworkSegmentEdge_EdgeLocation = cmdletContext.CoreNetworkSegmentEdge_EdgeLocation;
            }
            if (requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge_coreNetworkSegmentEdge_EdgeLocation != null)
            {
                requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge.EdgeLocation = requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge_coreNetworkSegmentEdge_EdgeLocation;
                requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdgeIsNull        = false;
            }
            System.String requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge_coreNetworkSegmentEdge_SegmentName = null;
            if (cmdletContext.CoreNetworkSegmentEdge_SegmentName != null)
            {
                requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge_coreNetworkSegmentEdge_SegmentName = cmdletContext.CoreNetworkSegmentEdge_SegmentName;
            }
            if (requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge_coreNetworkSegmentEdge_SegmentName != null)
            {
                requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge.SegmentName = requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge_coreNetworkSegmentEdge_SegmentName;
                requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdgeIsNull       = false;
            }
            // determine if requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge should be set to null
            if (requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdgeIsNull)
            {
                requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge = null;
            }
            if (requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge != null)
            {
                request.RouteTableIdentifier.CoreNetworkSegmentEdge = requestRouteTableIdentifier_routeTableIdentifier_CoreNetworkSegmentEdge;
                requestRouteTableIdentifierIsNull = false;
            }
            // determine if request.RouteTableIdentifier should be set to null
            if (requestRouteTableIdentifierIsNull)
            {
                request.RouteTableIdentifier = null;
            }
            if (cmdletContext.State != null)
            {
                request.States = cmdletContext.State;
            }
            if (cmdletContext.SubnetOfMatch != null)
            {
                request.SubnetOfMatches = cmdletContext.SubnetOfMatch;
            }
            if (cmdletContext.SupernetOfMatch != null)
            {
                request.SupernetOfMatches = cmdletContext.SupernetOfMatch;
            }
            if (cmdletContext.Type != null)
            {
                request.Types = cmdletContext.Type;
            }

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